From 05d7dfebd0cfaf8e86ae3343e2ddbad170f9d815 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 17:40:33 +0200 Subject: [PATCH 001/226] Getters on struct records get readonly attribute --- src/Compiler/CodeGen/IlxGen.fs | 21 ++- .../EmittedIL/StructGettersReadOnly.fs | 142 ++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 2 + tests/FSharp.Test.Utilities/Compiler.fs | 22 ++- .../FSharp.Test.Utilities.fsproj | 1 + .../FSharp.Test.Utilities/ReflectionHelper.fs | 63 ++++++++ 6 files changed, 236 insertions(+), 15 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs create mode 100644 tests/FSharp.Test.Utilities/ReflectionHelper.fs diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 802583aeaa0..470c4898ed3 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -68,7 +68,7 @@ let iLdcDouble i = AI_ldc(DT_R8, ILConst.R8 i) let iLdcSingle i = AI_ldc(DT_R4, ILConst.R4 i) /// Make a method that simply loads a field -let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType) = +let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = let ilFieldSpec = mkILFieldSpecInTy (ilTy, ilFieldName, ilPropType) let ilReturn = mkILReturn ilPropType @@ -84,7 +84,9 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) - ilMethodDef.WithSpecialName + ilMethodDef + .With(customAttrs = mkILCustomAttrs customAttrs) + .WithSpecialName /// Choose the constructor parameter names for fields let ChooseParamNames fieldNamesAndTypes = @@ -598,11 +600,13 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK +let GenReadOnlyAttribute (g: TcGlobals) = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref if add then - let attr = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let attr = GenReadOnlyAttribute g Some attr else None @@ -2087,7 +2091,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy) + let attrs = if isStruct then [GenReadOnlyAttribute g] else [] + mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) yield! genToStringMethod ilTy ] @@ -9089,7 +9094,7 @@ and GenMethodForBinding // Check if we're compiling the property as a .NET event assert not (CompileAsEvent cenv.g v.Attribs) - // Emit the property, but not if its a private method impl + // Emit the property, but not if it's a private method impl if mdef.Access <> ILMemberAccess.Private then let vtyp = ReturnTypeOfPropertyVal g v let ilPropTy = GenType cenv m eenvUnderMethTypeTypars.tyenv vtyp @@ -10692,7 +10697,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilPropName = fspec.LogicalName let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden - yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType) + let isStruct = tcref.IsFSharpStructOrEnumTycon && not tcref.IsEnumTycon + let attrs = if isStruct && not isStatic then [GenReadOnlyAttribute g] else [] + yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) // Generate property setter methods for the mutable fields for useGenuineField, ilFieldName, isFSharpMutable, isStatic, _, ilPropType, isPropHidden, fspec in fieldSummaries do @@ -11216,7 +11223,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) = let ilFieldName = ComputeFieldName exnc fld let ilMethodDef = - mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType) + mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType, []) let ilFieldDef = mkILInstanceField (ilFieldName, ilPropType, None, ILMemberAccess.Assembly) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs new file mode 100644 index 00000000000..29b41a6c1ba --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -0,0 +1,142 @@ +namespace FSharp.Compiler.ComponentTests.EmittedIL + +open Microsoft.FSharp.Core +open Xunit +open FSharp.Test.Compiler +open FSharp.Test.ReflectionHelper + +module ``Struct getters readonly`` = + + let structRecord = + FSharp + """ + module TestStructRecord + + [] type MyRecord = { MyField : int } + """ + + let nonStructRecord = + FSharp + """ + module TestNonStructRecord + + type MyRecord = { MyField : int } + """ + + let structAnonRecord = + FSharp + """ + module TestStructAnonRecord + + let myRecord = struct {| MyField = 3 |} + """ + + let nonStructAnonRecord = + FSharp + """ + module TestNonStructAnonRecord + + let myRecord = {| MyField = 3 |} + """ + + let structNonRecord = + FSharp + """ + module TestStructNonRecord + + [] + type MyStruct(myField: int) = + member _.MyField = myField + """ + + let structWithCustomGetter = + FSharp + """ + module TestStructWithCustomGetter + + [] + type MyStruct = + val mutable x: int + member this.MyField with get () = this.x <- 4 + """ + + [] + let ``Struct record has readonly attribute on getter`` () = + structRecord + |> compileAssembly + |> getType "TestStructRecord+MyRecord" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct anonymous record has readonly attribute on getter`` () = + structAnonRecord + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct anonymous record doesn't have readonly attribute on getter`` () = + nonStructAnonRecord + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct record doesn't have readonly getters`` () = + nonStructRecord + |> compileAssembly + |> getType "TestNonStructRecord+MyRecord" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct non-record has readonly getters`` () = + structNonRecord + |> compileAssembly + |> getType "TestStructNonRecord+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Custom getter on a struct doesn't have readonly attribute`` () = + structWithCustomGetter + |> compileAssembly + |> getType "TestStructWithCustomGetter+MyStruct" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct record has readonly attribute on getter in IL`` () = + structRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 TestStructRecord/MyRecord::MyField@ + IL_0006: ret + }""" ] + + [] + let ``Non-struct record doesn't have readonly getters in IL`` () = + nonStructRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 TestNonStructRecord/MyRecord::MyField@ + IL_0006: ret + } """ ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 562fbb40a88..12a18baf33e 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -92,6 +92,7 @@ + @@ -122,6 +123,7 @@ + diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index a374f3d4475..2c0452ae08d 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -631,16 +631,22 @@ module rec Compiler = | _ -> failwith "Compilation has errors." - let compileGuid (cUnit: CompilationUnit) : Guid = - let bytes = - compile cUnit - |> shouldSucceed - |> getAssemblyInBytes + let getAssembly = getAssemblyInBytes >> Assembly.Load - use reader1 = new PEReader(bytes.ToImmutableArray()) - let reader1 = reader1.GetMetadataReader() + let withPeReader func compilationResult = + let bytes = getAssemblyInBytes compilationResult + use reader = new PEReader(bytes.ToImmutableArray()) + func reader - reader1.GetModuleDefinition().Mvid |> reader1.GetGuid + let withMetadataReader func = + withPeReader (fun reader -> reader.GetMetadataReader() |> func) + + let compileGuid = + compile + >> shouldSucceed + >> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) + + let compileAssembly = compile >> shouldSucceed >> getAssembly let private parseFSharp (fsSource: FSharpCompilationSource) : CompilationResult = let source = fsSource.Source.GetSourceText |> Option.defaultValue "" diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index c9852f0fb8c..a20052b3f66 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -26,6 +26,7 @@ + diff --git a/tests/FSharp.Test.Utilities/ReflectionHelper.fs b/tests/FSharp.Test.Utilities/ReflectionHelper.fs new file mode 100644 index 00000000000..5759752c706 --- /dev/null +++ b/tests/FSharp.Test.Utilities/ReflectionHelper.fs @@ -0,0 +1,63 @@ +module FSharp.Test.ReflectionHelper + +open System +open System.Reflection + +/// Gets the given type from the assembly (otherwise throws) +let getType typeName (asm: Assembly) = + match asm.GetType(typeName, false) with + | null -> + let allTypes = + asm.GetTypes() + |> Array.map (fun ty -> ty.Name) + |> Array.reduce (fun x y -> $"%s{x}\r%s{y}") + + failwith $"Error: Assembly did not contain type %s{typeName}.\nAll types in asm:\n%s{allTypes}" + | ty -> ty + +/// Gets all anonymous types from the assembly +let getAnonymousTypes (asm: Assembly) = + [ for ty in asm.GetTypes() do + if ty.FullName.StartsWith "<>f__AnonymousType" then ty ] + +/// Gets the first anonymous type from the assembly +let getFirstAnonymousType asm = + match getAnonymousTypes asm with + | ty :: _ -> ty + | [] -> failwith "Error: No anonymous types found in the assembly" + +/// Gets a type's method +let getMethod methodName (ty: Type) = + match ty.GetMethod(methodName) with + | null -> failwith $"Error: Type did not contain member %s{methodName}" + | methodInfo -> methodInfo + +/// Assert that function f returns Ok for given input +let should f x y = + match f x y with + | Ok _ -> () + | Error message -> failwith $"%s{message} but it should" + +/// Assert that function f doesn't return Ok for given input +let shouldn't f x y = + match f x y with + | Ok message -> failwith $"%s{message} but it shouldn't" + | Error _ -> () + +/// Verify the object contains a custom attribute with the given name. E.g. "ObsoleteAttribute" +let haveAttribute attrName thingy = + let attrs = + match box thingy with + | :? Type as ty -> ty.GetCustomAttributes(false) + | :? MethodInfo as mi -> mi.GetCustomAttributes(false) + | :? PropertyInfo as pi -> pi.GetCustomAttributes(false) + | :? EventInfo as ei -> ei.GetCustomAttributes(false) + | _ -> failwith "Error: Unsupported primitive type, unable to get custom attributes." + + let hasAttribute = + attrs |> Array.exists (fun att -> att.GetType().Name = attrName) + + if hasAttribute then + Ok $"'{thingy}' has attribute '{attrName}'" + else + Error $"'{thingy}' doesn't have attribute '{attrName}'" From 859d150b25bf777469edbe18ffcc5503703c6122 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 18:51:27 +0200 Subject: [PATCH 002/226] Fantomas --- src/Compiler/CodeGen/IlxGen.fs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 470c4898ed3..d39dd1fa238 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -84,9 +84,7 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) - ilMethodDef - .With(customAttrs = mkILCustomAttrs customAttrs) - .WithSpecialName + ilMethodDef.With(customAttrs = mkILCustomAttrs customAttrs).WithSpecialName /// Choose the constructor parameter names for fields let ChooseParamNames fieldNamesAndTypes = @@ -600,7 +598,8 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK -let GenReadOnlyAttribute (g: TcGlobals) = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) +let GenReadOnlyAttribute (g: TcGlobals) = + mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref @@ -2091,7 +2090,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - let attrs = if isStruct then [GenReadOnlyAttribute g] else [] + let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) yield! genToStringMethod ilTy ] @@ -10698,7 +10697,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden let isStruct = tcref.IsFSharpStructOrEnumTycon && not tcref.IsEnumTycon - let attrs = if isStruct && not isStatic then [GenReadOnlyAttribute g] else [] + + let attrs = + if isStruct && not isStatic then + [ GenReadOnlyAttribute g ] + else + [] + yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) // Generate property setter methods for the mutable fields From 41035ab58740a46a3d18d69b510bfacf8b667754 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 19:31:06 +0200 Subject: [PATCH 003/226] Explicit argument --- tests/FSharp.Test.Utilities/Compiler.fs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 2c0452ae08d..54822b93d80 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -641,12 +641,17 @@ module rec Compiler = let withMetadataReader func = withPeReader (fun reader -> reader.GetMetadataReader() |> func) - let compileGuid = - compile - >> shouldSucceed - >> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) + let compileGuid cUnit = + cUnit + |> compile + |> shouldSucceed + |> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) - let compileAssembly = compile >> shouldSucceed >> getAssembly + let compileAssembly cUnit = + cUnit + |> compile + |> shouldSucceed + |> getAssembly let private parseFSharp (fsSource: FSharpCompilationSource) : CompilationResult = let source = fsSource.Source.GetSourceText |> Option.defaultValue "" From a19aa4a4d31dc8c36accd492f8040885f902887c Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 30 Jun 2022 14:03:12 +0200 Subject: [PATCH 004/226] Tests update --- .../EmittedIL/Misc/Structs02.fs.il.debug.bsl | 1 + .../Misc/Structs02.fs.il.release.bsl | 1 + .../EmittedIL/StructGettersReadOnly.fs | 20 ++++++++++++++++++- .../FloatsAndDoubles.fs.il.debug.bsl | 2 ++ .../FloatsAndDoubles.fs.il.release.bsl | 2 ++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl index 11721f6522a..cc8f56cd993 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl index 5c412d430d3..ed4eefc32ed 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs index 29b41a6c1ba..720b02f0f02 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -49,6 +49,16 @@ module ``Struct getters readonly`` = member _.MyField = myField """ + let structNonRecordVal = + FSharp + """ + module TestStructNonRecordVal + + [] + type MyStruct = + val MyField: int + """ + let structWithCustomGetter = FSharp """ @@ -93,13 +103,21 @@ module ``Struct getters readonly`` = |> shouldn't haveAttribute "IsReadOnlyAttribute" [] - let ``Struct non-record has readonly getters`` () = + let ``Struct has readonly getters`` () = structNonRecord |> compileAssembly |> getType "TestStructNonRecord+MyStruct" |> getMethod "get_MyField" |> should haveAttribute "IsReadOnlyAttribute" + [] + let ``Struct val has readonly getter`` () = + structNonRecordVal + |> compileAssembly + |> getType "TestStructNonRecordVal+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + [] let ``Custom getter on a struct doesn't have readonly attribute`` () = structWithCustomGetter diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl index 1e35a8e9c26..0e84741e970 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -409,6 +410,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl index caa632f0fa0..9d6c3245635 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -376,6 +377,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 From 6415f1481cbb18d61261345cc0a623f9a95f2e6a Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 17:40:33 +0200 Subject: [PATCH 005/226] Getters on struct records get readonly attribute --- src/Compiler/CodeGen/IlxGen.fs | 21 ++- .../EmittedIL/StructGettersReadOnly.fs | 142 ++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 2 + tests/FSharp.Test.Utilities/Compiler.fs | 22 ++- .../FSharp.Test.Utilities.fsproj | 1 + .../FSharp.Test.Utilities/ReflectionHelper.fs | 63 ++++++++ 6 files changed, 236 insertions(+), 15 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs create mode 100644 tests/FSharp.Test.Utilities/ReflectionHelper.fs diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 802583aeaa0..470c4898ed3 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -68,7 +68,7 @@ let iLdcDouble i = AI_ldc(DT_R8, ILConst.R8 i) let iLdcSingle i = AI_ldc(DT_R4, ILConst.R4 i) /// Make a method that simply loads a field -let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType) = +let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = let ilFieldSpec = mkILFieldSpecInTy (ilTy, ilFieldName, ilPropType) let ilReturn = mkILReturn ilPropType @@ -84,7 +84,9 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) - ilMethodDef.WithSpecialName + ilMethodDef + .With(customAttrs = mkILCustomAttrs customAttrs) + .WithSpecialName /// Choose the constructor parameter names for fields let ChooseParamNames fieldNamesAndTypes = @@ -598,11 +600,13 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK +let GenReadOnlyAttribute (g: TcGlobals) = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref if add then - let attr = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let attr = GenReadOnlyAttribute g Some attr else None @@ -2087,7 +2091,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy) + let attrs = if isStruct then [GenReadOnlyAttribute g] else [] + mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) yield! genToStringMethod ilTy ] @@ -9089,7 +9094,7 @@ and GenMethodForBinding // Check if we're compiling the property as a .NET event assert not (CompileAsEvent cenv.g v.Attribs) - // Emit the property, but not if its a private method impl + // Emit the property, but not if it's a private method impl if mdef.Access <> ILMemberAccess.Private then let vtyp = ReturnTypeOfPropertyVal g v let ilPropTy = GenType cenv m eenvUnderMethTypeTypars.tyenv vtyp @@ -10692,7 +10697,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilPropName = fspec.LogicalName let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden - yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType) + let isStruct = tcref.IsFSharpStructOrEnumTycon && not tcref.IsEnumTycon + let attrs = if isStruct && not isStatic then [GenReadOnlyAttribute g] else [] + yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) // Generate property setter methods for the mutable fields for useGenuineField, ilFieldName, isFSharpMutable, isStatic, _, ilPropType, isPropHidden, fspec in fieldSummaries do @@ -11216,7 +11223,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) = let ilFieldName = ComputeFieldName exnc fld let ilMethodDef = - mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType) + mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType, []) let ilFieldDef = mkILInstanceField (ilFieldName, ilPropType, None, ILMemberAccess.Assembly) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs new file mode 100644 index 00000000000..29b41a6c1ba --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -0,0 +1,142 @@ +namespace FSharp.Compiler.ComponentTests.EmittedIL + +open Microsoft.FSharp.Core +open Xunit +open FSharp.Test.Compiler +open FSharp.Test.ReflectionHelper + +module ``Struct getters readonly`` = + + let structRecord = + FSharp + """ + module TestStructRecord + + [] type MyRecord = { MyField : int } + """ + + let nonStructRecord = + FSharp + """ + module TestNonStructRecord + + type MyRecord = { MyField : int } + """ + + let structAnonRecord = + FSharp + """ + module TestStructAnonRecord + + let myRecord = struct {| MyField = 3 |} + """ + + let nonStructAnonRecord = + FSharp + """ + module TestNonStructAnonRecord + + let myRecord = {| MyField = 3 |} + """ + + let structNonRecord = + FSharp + """ + module TestStructNonRecord + + [] + type MyStruct(myField: int) = + member _.MyField = myField + """ + + let structWithCustomGetter = + FSharp + """ + module TestStructWithCustomGetter + + [] + type MyStruct = + val mutable x: int + member this.MyField with get () = this.x <- 4 + """ + + [] + let ``Struct record has readonly attribute on getter`` () = + structRecord + |> compileAssembly + |> getType "TestStructRecord+MyRecord" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct anonymous record has readonly attribute on getter`` () = + structAnonRecord + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct anonymous record doesn't have readonly attribute on getter`` () = + nonStructAnonRecord + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct record doesn't have readonly getters`` () = + nonStructRecord + |> compileAssembly + |> getType "TestNonStructRecord+MyRecord" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct non-record has readonly getters`` () = + structNonRecord + |> compileAssembly + |> getType "TestStructNonRecord+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Custom getter on a struct doesn't have readonly attribute`` () = + structWithCustomGetter + |> compileAssembly + |> getType "TestStructWithCustomGetter+MyStruct" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct record has readonly attribute on getter in IL`` () = + structRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 TestStructRecord/MyRecord::MyField@ + IL_0006: ret + }""" ] + + [] + let ``Non-struct record doesn't have readonly getters in IL`` () = + nonStructRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 TestNonStructRecord/MyRecord::MyField@ + IL_0006: ret + } """ ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 562fbb40a88..12a18baf33e 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -92,6 +92,7 @@ + @@ -122,6 +123,7 @@ + diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index a374f3d4475..2c0452ae08d 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -631,16 +631,22 @@ module rec Compiler = | _ -> failwith "Compilation has errors." - let compileGuid (cUnit: CompilationUnit) : Guid = - let bytes = - compile cUnit - |> shouldSucceed - |> getAssemblyInBytes + let getAssembly = getAssemblyInBytes >> Assembly.Load - use reader1 = new PEReader(bytes.ToImmutableArray()) - let reader1 = reader1.GetMetadataReader() + let withPeReader func compilationResult = + let bytes = getAssemblyInBytes compilationResult + use reader = new PEReader(bytes.ToImmutableArray()) + func reader - reader1.GetModuleDefinition().Mvid |> reader1.GetGuid + let withMetadataReader func = + withPeReader (fun reader -> reader.GetMetadataReader() |> func) + + let compileGuid = + compile + >> shouldSucceed + >> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) + + let compileAssembly = compile >> shouldSucceed >> getAssembly let private parseFSharp (fsSource: FSharpCompilationSource) : CompilationResult = let source = fsSource.Source.GetSourceText |> Option.defaultValue "" diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index c9852f0fb8c..a20052b3f66 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -26,6 +26,7 @@ + diff --git a/tests/FSharp.Test.Utilities/ReflectionHelper.fs b/tests/FSharp.Test.Utilities/ReflectionHelper.fs new file mode 100644 index 00000000000..5759752c706 --- /dev/null +++ b/tests/FSharp.Test.Utilities/ReflectionHelper.fs @@ -0,0 +1,63 @@ +module FSharp.Test.ReflectionHelper + +open System +open System.Reflection + +/// Gets the given type from the assembly (otherwise throws) +let getType typeName (asm: Assembly) = + match asm.GetType(typeName, false) with + | null -> + let allTypes = + asm.GetTypes() + |> Array.map (fun ty -> ty.Name) + |> Array.reduce (fun x y -> $"%s{x}\r%s{y}") + + failwith $"Error: Assembly did not contain type %s{typeName}.\nAll types in asm:\n%s{allTypes}" + | ty -> ty + +/// Gets all anonymous types from the assembly +let getAnonymousTypes (asm: Assembly) = + [ for ty in asm.GetTypes() do + if ty.FullName.StartsWith "<>f__AnonymousType" then ty ] + +/// Gets the first anonymous type from the assembly +let getFirstAnonymousType asm = + match getAnonymousTypes asm with + | ty :: _ -> ty + | [] -> failwith "Error: No anonymous types found in the assembly" + +/// Gets a type's method +let getMethod methodName (ty: Type) = + match ty.GetMethod(methodName) with + | null -> failwith $"Error: Type did not contain member %s{methodName}" + | methodInfo -> methodInfo + +/// Assert that function f returns Ok for given input +let should f x y = + match f x y with + | Ok _ -> () + | Error message -> failwith $"%s{message} but it should" + +/// Assert that function f doesn't return Ok for given input +let shouldn't f x y = + match f x y with + | Ok message -> failwith $"%s{message} but it shouldn't" + | Error _ -> () + +/// Verify the object contains a custom attribute with the given name. E.g. "ObsoleteAttribute" +let haveAttribute attrName thingy = + let attrs = + match box thingy with + | :? Type as ty -> ty.GetCustomAttributes(false) + | :? MethodInfo as mi -> mi.GetCustomAttributes(false) + | :? PropertyInfo as pi -> pi.GetCustomAttributes(false) + | :? EventInfo as ei -> ei.GetCustomAttributes(false) + | _ -> failwith "Error: Unsupported primitive type, unable to get custom attributes." + + let hasAttribute = + attrs |> Array.exists (fun att -> att.GetType().Name = attrName) + + if hasAttribute then + Ok $"'{thingy}' has attribute '{attrName}'" + else + Error $"'{thingy}' doesn't have attribute '{attrName}'" From 259c8aaab7271245a9faf288f5e5abc3cb82ae35 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 18:51:27 +0200 Subject: [PATCH 006/226] Fantomas --- src/Compiler/CodeGen/IlxGen.fs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 470c4898ed3..d39dd1fa238 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -84,9 +84,7 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) - ilMethodDef - .With(customAttrs = mkILCustomAttrs customAttrs) - .WithSpecialName + ilMethodDef.With(customAttrs = mkILCustomAttrs customAttrs).WithSpecialName /// Choose the constructor parameter names for fields let ChooseParamNames fieldNamesAndTypes = @@ -600,7 +598,8 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK -let GenReadOnlyAttribute (g: TcGlobals) = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) +let GenReadOnlyAttribute (g: TcGlobals) = + mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref @@ -2091,7 +2090,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - let attrs = if isStruct then [GenReadOnlyAttribute g] else [] + let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) yield! genToStringMethod ilTy ] @@ -10698,7 +10697,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden let isStruct = tcref.IsFSharpStructOrEnumTycon && not tcref.IsEnumTycon - let attrs = if isStruct && not isStatic then [GenReadOnlyAttribute g] else [] + + let attrs = + if isStruct && not isStatic then + [ GenReadOnlyAttribute g ] + else + [] + yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) // Generate property setter methods for the mutable fields From 91d29a6a9360c2d2c5350f469a6642330bcbd465 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Wed, 29 Jun 2022 19:31:06 +0200 Subject: [PATCH 007/226] Explicit argument --- tests/FSharp.Test.Utilities/Compiler.fs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 2c0452ae08d..54822b93d80 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -641,12 +641,17 @@ module rec Compiler = let withMetadataReader func = withPeReader (fun reader -> reader.GetMetadataReader() |> func) - let compileGuid = - compile - >> shouldSucceed - >> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) + let compileGuid cUnit = + cUnit + |> compile + |> shouldSucceed + |> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) - let compileAssembly = compile >> shouldSucceed >> getAssembly + let compileAssembly cUnit = + cUnit + |> compile + |> shouldSucceed + |> getAssembly let private parseFSharp (fsSource: FSharpCompilationSource) : CompilationResult = let source = fsSource.Source.GetSourceText |> Option.defaultValue "" From 738184ccbc5a8afd3b44cb2bb59b78322c4c1373 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 30 Jun 2022 14:03:12 +0200 Subject: [PATCH 008/226] Tests update --- .../EmittedIL/Misc/Structs02.fs.il.debug.bsl | 1 + .../Misc/Structs02.fs.il.release.bsl | 1 + .../EmittedIL/StructGettersReadOnly.fs | 20 ++++++++++++++++++- .../FloatsAndDoubles.fs.il.debug.bsl | 2 ++ .../FloatsAndDoubles.fs.il.release.bsl | 2 ++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl index 11721f6522a..cc8f56cd993 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl index 5c412d430d3..ed4eefc32ed 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs index 29b41a6c1ba..720b02f0f02 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -49,6 +49,16 @@ module ``Struct getters readonly`` = member _.MyField = myField """ + let structNonRecordVal = + FSharp + """ + module TestStructNonRecordVal + + [] + type MyStruct = + val MyField: int + """ + let structWithCustomGetter = FSharp """ @@ -93,13 +103,21 @@ module ``Struct getters readonly`` = |> shouldn't haveAttribute "IsReadOnlyAttribute" [] - let ``Struct non-record has readonly getters`` () = + let ``Struct has readonly getters`` () = structNonRecord |> compileAssembly |> getType "TestStructNonRecord+MyStruct" |> getMethod "get_MyField" |> should haveAttribute "IsReadOnlyAttribute" + [] + let ``Struct val has readonly getter`` () = + structNonRecordVal + |> compileAssembly + |> getType "TestStructNonRecordVal+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + [] let ``Custom getter on a struct doesn't have readonly attribute`` () = structWithCustomGetter diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl index 1e35a8e9c26..0e84741e970 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -409,6 +410,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl index caa632f0fa0..9d6c3245635 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -376,6 +377,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 From bf6063ae851aa95e3f754066aca18cb933b5512a Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 30 Jun 2022 17:19:11 +0200 Subject: [PATCH 009/226] Tests update --- .../EmittedIL/StructGettersReadOnly.fs | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs index 720b02f0f02..77feb7f0260 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -10,7 +10,7 @@ module ``Struct getters readonly`` = let structRecord = FSharp """ - module TestStructRecord + module Test [] type MyRecord = { MyField : int } """ @@ -18,7 +18,7 @@ module ``Struct getters readonly`` = let nonStructRecord = FSharp """ - module TestNonStructRecord + module Test type MyRecord = { MyField : int } """ @@ -26,7 +26,7 @@ module ``Struct getters readonly`` = let structAnonRecord = FSharp """ - module TestStructAnonRecord + module Test let myRecord = struct {| MyField = 3 |} """ @@ -34,7 +34,7 @@ module ``Struct getters readonly`` = let nonStructAnonRecord = FSharp """ - module TestNonStructAnonRecord + module Test let myRecord = {| MyField = 3 |} """ @@ -42,17 +42,7 @@ module ``Struct getters readonly`` = let structNonRecord = FSharp """ - module TestStructNonRecord - - [] - type MyStruct(myField: int) = - member _.MyField = myField - """ - - let structNonRecordVal = - FSharp - """ - module TestStructNonRecordVal + module Test [] type MyStruct = @@ -62,7 +52,7 @@ module ``Struct getters readonly`` = let structWithCustomGetter = FSharp """ - module TestStructWithCustomGetter + module Test [] type MyStruct = @@ -74,7 +64,7 @@ module ``Struct getters readonly`` = let ``Struct record has readonly attribute on getter`` () = structRecord |> compileAssembly - |> getType "TestStructRecord+MyRecord" + |> getType "Test+MyRecord" |> getMethod "get_MyField" |> should haveAttribute "IsReadOnlyAttribute" @@ -98,7 +88,7 @@ module ``Struct getters readonly`` = let ``Non-struct record doesn't have readonly getters`` () = nonStructRecord |> compileAssembly - |> getType "TestNonStructRecord+MyRecord" + |> getType "Test+MyRecord" |> getMethod "get_MyField" |> shouldn't haveAttribute "IsReadOnlyAttribute" @@ -106,15 +96,7 @@ module ``Struct getters readonly`` = let ``Struct has readonly getters`` () = structNonRecord |> compileAssembly - |> getType "TestStructNonRecord+MyStruct" - |> getMethod "get_MyField" - |> should haveAttribute "IsReadOnlyAttribute" - - [] - let ``Struct val has readonly getter`` () = - structNonRecordVal - |> compileAssembly - |> getType "TestStructNonRecordVal+MyStruct" + |> getType "Test+MyStruct" |> getMethod "get_MyField" |> should haveAttribute "IsReadOnlyAttribute" @@ -122,7 +104,7 @@ module ``Struct getters readonly`` = let ``Custom getter on a struct doesn't have readonly attribute`` () = structWithCustomGetter |> compileAssembly - |> getType "TestStructWithCustomGetter+MyStruct" + |> getType "Test+MyStruct" |> getMethod "get_MyField" |> shouldn't haveAttribute "IsReadOnlyAttribute" @@ -139,7 +121,7 @@ module ``Struct getters readonly`` = .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld int32 TestStructRecord/MyRecord::MyField@ + IL_0001: ldfld int32 Test/MyRecord::MyField@ IL_0006: ret }""" ] @@ -155,6 +137,6 @@ module ``Struct getters readonly`` = .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld int32 TestNonStructRecord/MyRecord::MyField@ + IL_0001: ldfld int32 Test/MyRecord::MyField@ IL_0006: ret } """ ] From f6e8644847bda97e70cb67b3cf61930af88955ae Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 7 Jul 2022 13:24:30 +0200 Subject: [PATCH 010/226] Small optimization --- src/Compiler/CodeGen/IlxGen.fs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index d39dd1fa238..f0d7b2b27fd 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -10696,13 +10696,12 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilPropName = fspec.LogicalName let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden - let isStruct = tcref.IsFSharpStructOrEnumTycon && not tcref.IsEnumTycon + let isStruct = tycon.IsFSharpStructOrEnumTycon && not tycon.IsEnumTycon let attrs = - if isStruct && not isStatic then - [ GenReadOnlyAttribute g ] - else - [] + [ + if isStruct && not isStatic then GenReadOnlyAttribute g + ] yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) From e8eca37ea91782b85386117c7c4c7dd03fa616d1 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 7 Jul 2022 13:24:53 +0200 Subject: [PATCH 011/226] Reorganized tests --- .../EmittedIL/StructGettersReadOnly.fs | 150 ++++++++---------- 1 file changed, 69 insertions(+), 81 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs index 77feb7f0260..ccb94a97e50 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -15,6 +15,31 @@ module ``Struct getters readonly`` = [] type MyRecord = { MyField : int } """ + [] + let ``Struct record has readonly attribute on getter`` () = + structRecord + |> compileAssembly + |> getType "Test+MyRecord" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct record has readonly attribute on getter in IL`` () = + structRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Test/MyRecord::MyField@ + IL_0006: ret + }""" ] + let nonStructRecord = FSharp """ @@ -23,23 +48,58 @@ module ``Struct getters readonly`` = type MyRecord = { MyField : int } """ - let structAnonRecord = + [] + let ``Non-struct record doesn't have readonly getters`` () = + nonStructRecord + |> compileAssembly + |> getType "Test+MyRecord" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct record doesn't have readonly getters in IL`` () = + nonStructRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Test/MyRecord::MyField@ + IL_0006: ret + } """ ] + + [] + let ``Struct anonymous record has readonly attribute on getter`` () = FSharp """ module Test let myRecord = struct {| MyField = 3 |} """ + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" - let nonStructAnonRecord = + [] + let ``Non-struct anonymous record doesn't have readonly attribute on getter`` () = FSharp """ module Test let myRecord = {| MyField = 3 |} """ + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" - let structNonRecord = + [] + let ``Struct has readonly getters`` () = FSharp """ module Test @@ -48,8 +108,13 @@ module ``Struct getters readonly`` = type MyStruct = val MyField: int """ + |> compileAssembly + |> getType "Test+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" - let structWithCustomGetter = + [] + let ``Custom getter on a struct doesn't have readonly attribute`` () = FSharp """ module Test @@ -59,84 +124,7 @@ module ``Struct getters readonly`` = val mutable x: int member this.MyField with get () = this.x <- 4 """ - - [] - let ``Struct record has readonly attribute on getter`` () = - structRecord - |> compileAssembly - |> getType "Test+MyRecord" - |> getMethod "get_MyField" - |> should haveAttribute "IsReadOnlyAttribute" - - [] - let ``Struct anonymous record has readonly attribute on getter`` () = - structAnonRecord - |> compileAssembly - |> getFirstAnonymousType - |> getMethod "get_MyField" - |> should haveAttribute "IsReadOnlyAttribute" - - [] - let ``Non-struct anonymous record doesn't have readonly attribute on getter`` () = - nonStructAnonRecord - |> compileAssembly - |> getFirstAnonymousType - |> getMethod "get_MyField" - |> shouldn't haveAttribute "IsReadOnlyAttribute" - - [] - let ``Non-struct record doesn't have readonly getters`` () = - nonStructRecord - |> compileAssembly - |> getType "Test+MyRecord" - |> getMethod "get_MyField" - |> shouldn't haveAttribute "IsReadOnlyAttribute" - - [] - let ``Struct has readonly getters`` () = - structNonRecord - |> compileAssembly - |> getType "Test+MyStruct" - |> getMethod "get_MyField" - |> should haveAttribute "IsReadOnlyAttribute" - - [] - let ``Custom getter on a struct doesn't have readonly attribute`` () = - structWithCustomGetter |> compileAssembly |> getType "Test+MyStruct" |> getMethod "get_MyField" |> shouldn't haveAttribute "IsReadOnlyAttribute" - - [] - let ``Struct record has readonly attribute on getter in IL`` () = - structRecord - |> compile - |> shouldSucceed - |> verifyIL [ """ - .method public hidebysig specialname - instance int32 get_MyField() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 Test/MyRecord::MyField@ - IL_0006: ret - }""" ] - - [] - let ``Non-struct record doesn't have readonly getters in IL`` () = - nonStructRecord - |> compile - |> shouldSucceed - |> verifyIL [ """ - .method public hidebysig specialname - instance int32 get_MyField() cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 Test/MyRecord::MyField@ - IL_0006: ret - } """ ] From 9572852ae0dd3f90a71b562e9fa304e69a8de3a9 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 7 Jul 2022 14:09:28 +0200 Subject: [PATCH 012/226] Revert list construction --- src/Compiler/CodeGen/IlxGen.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index f0d7b2b27fd..96631c19b69 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -10699,9 +10699,10 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let isStruct = tycon.IsFSharpStructOrEnumTycon && not tycon.IsEnumTycon let attrs = - [ - if isStruct && not isStatic then GenReadOnlyAttribute g - ] + if isStruct && not isStatic then + [ GenReadOnlyAttribute g ] + else + [] yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) From 23a0b3a9e705ec6051bdbcf7ccd0e355742a6bdc Mon Sep 17 00:00:00 2001 From: Peter Semkin Date: Thu, 7 Jul 2022 17:38:25 +0200 Subject: [PATCH 013/226] An extra test for the tooltips --- .../tests/UnitTests/QuickInfoTests.fs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index ff460f45144..d255f0f3d34 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -444,7 +444,7 @@ module Test = () [] -let ``Automation.LetBindings.InsideType``() = +let ``Automation.LetBindings.InsideType.Instance``() = let code = """ namespace FsTest @@ -459,3 +459,20 @@ module Test = StringAssert.StartsWith(expectedSignature, tooltip) () + +[] +let ``Automation.LetBindings.InsideType.Static``() = + let code = """ +namespace FsTest + +module Test = + type T() = + static let fu$$nc x = () +""" + + let expectedSignature = "val func: x: 'a -> unit" + + let tooltip = GetQuickInfoTextFromCode code + + StringAssert.StartsWith(expectedSignature, tooltip) + () From 864413f39c32ca5134d73995826743d1f09df361 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 7 Jul 2022 17:57:41 +0200 Subject: [PATCH 014/226] Update VS insertion target --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cbcc657f839..01abb29a8a0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -591,7 +591,7 @@ stages: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - template: eng/release/insert-into-vs.yml parameters: - componentBranchName: refs/heads/release/dev17.3 + componentBranchName: refs/heads/release/dev17.4 insertTargetBranch: main insertTeamEmail: fsharpteam@microsoft.com insertTeamName: 'F#' From 2211866bd809e5160f3afe62257ced1de4ff358c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 7 Jul 2022 11:33:24 -0600 Subject: [PATCH 015/226] add instructions for creating and onboarding new branches (#13458) --- INTERNAL.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/INTERNAL.md b/INTERNAL.md index 2dbfdcd20e0..d6e9913f71a 100644 --- a/INTERNAL.md +++ b/INTERNAL.md @@ -57,6 +57,25 @@ Note that insertions for other teams will also be listed. Insertions to any other VS branch (e.g., `main`) will have the auto-merge flag set and should handle themselves, but it's a good idea to check the previous link for any old or stalled insertions into VS `main`. +## Preparing for a new VS release branch + +### When a VS branch snaps from `main` to `rel/d*` and switches to ask mode: + +Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in the appropriate release branch. E.g., when VS 17.3 snapped and switched to ask mode, [this PR](https://github.com/dotnet/fsharp/pull/13456/files) correctly updates the insertion target so that future builds from that F# branch will get auto-inserted to VS. + +### When VS `main` is open for insertions for preview releases of VS: + +1. Create a new `release/dev*` branch (e.g., `release/dev17.4`) and initially set its HEAD commit to that of the previous release (e.g., `release/dev17.3` in this case). +2. Set the new branch to receive auto-merges from `main`, and also set the old release branch to flow into the new one. [This PR](https://github.com/dotnet/roslyn-tools/pull/1245/files) is a good example of what to do when a new `release/dev17.4` branch is created that should receive merges from both `main` and the previous release branch, `release/dev17.3`. +3. Set the packages from the new branch to flow into the correct package feeds via the `darc` tool. To do this: + 1. Ensure the latest `darc` tool is installed by running `eng/common/darc-init.ps1`. + 2. (only needed once) Run the command `darc authenticate`. A text file will be opened with instructions on how to populate access tokens. + 3. Check the current package/channel subscriptions by running `darc get-default-channels --source-repo fsharp`. For this example, notice that the latest subscription shows the F# branch `release/dev17.3` is getting added to the `VS 17.3` channel. + 4. Get the list of `darc` channels and determine the appropriate one to use for the new branch via the command `darc get-channels`. For this example, notice that a channel named `VS 17.4` is listed. + 5. Add the new F# branch to the appropriate `darc` channel. In this example, run `darc add-default-channel --channel "VS 17.4" --branch release/dev17.4 --repo https://github.com/dotnet/fsharp` + 6. Ensure the subscription was added by repeating step 3 above. + 7. Note, the help in the `darc` tool is really good. E.g., you can simply run `darc` to see a list of all commands available, and if you run `darc ` with no arguments, you'll be given a list of arguments you can use. + ## Less interesting links [FSharp.Core (Official NuGet Release)](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=72). From 3c845eed6e94095e645e54d9b650fa753d0f6930 Mon Sep 17 00:00:00 2001 From: David Kean Date: Fri, 8 Jul 2022 15:57:48 +1000 Subject: [PATCH 016/226] Remove unneeded codebase registration (#13445) This code base registration is not being used due to the existing binding redirections which specify a codebase by default. This fixes these warnings in ActivityLog: Found both a Binding Redirection and a Code Base entries for the same Assembly. Ignoring Code Base, keeping Binding Redirection. FSharp.ProjectSystem.FSharp, Version=17.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Found both a Binding Redirection and a Code Base entries for the same Assembly. Ignoring Code Base, keeping Binding Redirection. FSharp.ProjectSystem.PropertyPages, Version=17.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a --- .../VisualFSharpFull/Source.extension.vsixmanifest | 1 - .../Vsix/VisualFSharpFull/VisualFSharp.Core.targets | 2 +- .../FSharp.ProjectSystem.FSharp.fsproj | 10 ---------- .../FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb | 5 ----- .../FSharp.ProjectSystem.PropertyPages.vbproj | 2 +- 5 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb diff --git a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest index 0e4dbf472c1..fb2764e3d58 100644 --- a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest +++ b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest @@ -49,7 +49,6 @@ - diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets index 9b932e87ec3..8205ac783f3 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets @@ -188,7 +188,7 @@ {FCFB214C-462E-42B3-91CA-FC557EFEE74F} FSharp.PropertiesPages - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b + BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true All diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj index 20c03b24ed9..aab721f9de1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj @@ -66,16 +66,6 @@ $(VSAssemblyVersion) - - FSharp.Core - $(FSCoreVersion) - $PackageFolder$\FSharp.Core.dll - - - FSharp.ProjectSystem.FSharp - $(VSAssemblyVersion) - $PackageFolder$\FSharp.ProjectSystem.FSharp.dll - FSharp.Compiler.Service $(FSharpCompilerServiceVersion) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb deleted file mode 100644 index a852e3a3399..00000000000 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb +++ /dev/null @@ -1,5 +0,0 @@ -' Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -Imports Microsoft.VisualStudio.Shell - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj index 799603e1c35..a6b16f955b3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj @@ -16,6 +16,7 @@ win true false + false false true false @@ -61,7 +62,6 @@ - From 7a6c935bd92547c1ac41a364bd5d9ef7b24b1225 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 8 Jul 2022 00:37:17 -0700 Subject: [PATCH 017/226] Remove a few commented out strings from .txt files (#13464) --- src/Compiler/FSComp.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 6bbd661d7cf..a6ce206cc8f 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -270,7 +270,6 @@ chkUnionCaseDefaultAugmentation,"default augmentation of the union case" 435,chkGetterSetterDoNotMatchAbstract,"The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well." 436,chkPropertySameNameIndexer,"The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties." 437,chkCantStoreByrefValue,"A type would store a byref typed value. This is not permitted by Common IL." -#See related 1205 chkDuplicateInherittedVirtualMethod 438,chkDuplicateMethod,"Duplicate method. The method '%s' has the same name and signature as another method in type '%s'." 438,chkDuplicateMethodWithSuffix,"Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased." 439,chkDuplicateMethodCurried,"The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments." @@ -474,7 +473,6 @@ parsSyntaxModuleStructEndDeprecated,"The syntax 'module ... = struct .. end' is parsSyntaxModuleSigEndDeprecated,"The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end'" 627,tcStaticFieldUsedWhenInstanceFieldExpected,"A static field was used where an instance field is expected" 629,tcMethodNotAccessible,"Method '%s' is not accessible from this code location" -#630,tcTypeFunctionFieldsCannotBeMutated,"Fields which are type functions cannot be mutated" 632,tcImplicitMeasureFollowingSlash,"Implicit product of measures following /" 633,tcUnexpectedMeasureAnon,"Unexpected SynMeasure.Anon" 634,tcNonZeroConstantCannotHaveGenericUnit,"Non-zero constants cannot have generic units. For generic zero, write 0.0<_>." @@ -647,8 +645,6 @@ tcExpressionWithIfRequiresParenthesis,"This list or array expression includes an 799,tcInvalidAssignment,"Invalid assignment" 800,tcInvalidUseOfTypeName,"Invalid use of a type name" 801,tcTypeHasNoAccessibleConstructor,"This type has no accessible object constructors" -#802,tcInvalidUseOfTypeNameOrConstructor,"Invalid use of a type name and/or object constructor. If necessary use 'new' and apply the constructor to its arguments, e.g. 'new Type(args)'." -#803,tcInvalidUseOfTypeNameOrConstructorWithOverloads,"Invalid use of a type name and/or object constructor. If necessary use 'new' and apply the constructor to its arguments, e.g. 'new Type(args)'. The required signature is:\n\t%s." 804,tcInvalidUseOfInterfaceType,"Invalid use of an interface type" 805,tcInvalidUseOfDelegate,"Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'." 806,tcPropertyIsNotStatic,"Property '%s' is not static" @@ -765,7 +761,6 @@ tcTypeOrModule,"type or module" 919,tcExceptionAbbreviationsMustReferToValidExceptions,"Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception" 920,tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor,"Abbreviations for Common IL exception types must have a matching object constructor" 921,tcNotAnException,"Not an exception" -#922,tcUnexpectedConstraintsOrParametersOnModule,"Unexpected constraints or parameters on module specification" 924,tcInvalidModuleName,"Invalid module name" 925,tcInvalidTypeExtension,"Invalid type extension" 926,tcAttributesOfTypeSpecifyMultipleKindsForType,"The attributes of this type specify multiple kinds for the type" @@ -798,7 +793,6 @@ tcTypeAbbreviationHasTypeParametersMissingOnType,"This type abbreviation has one 949,tcInvalidDelegateSpecification,"Delegate specifications must be of the form 'typ -> typ'" 950,tcDelegatesCannotBeCurried,"Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values." 951,tcInvalidTypeForLiteralEnumeration,"Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char" -#952,tcTypeAbbreviationMustBePublic,"Type abbreviations must be public. If you want to use a private type abbreviation you must use an explicit signature." 953,tcTypeDefinitionIsCyclic,"This type definition involves an immediate cyclic reference through an abbreviation" 954,tcTypeDefinitionIsCyclicThroughInheritance,"This type definition involves an immediate cyclic reference through a struct field or inheritance relation" tcReservedSyntaxForAugmentation,"The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[] attribute to the type definition in the signature" @@ -813,8 +807,6 @@ tcReservedSyntaxForAugmentation,"The syntax 'type X with ...' is reserved for au 965,tcModuleAbbreviationForNamespace,"The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace." 966,tcTypeUsedInInvalidWay,"The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference." 967,tcMemberUsedInInvalidWay,"The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference." -#968,tcExplicitSignaturesInImplementationFileCannotBeUsed,"Explicit signatures within implementation files are not permitted" -#969,tcModulesCannotUseNamedModuleSignatures,"Modules cannot use named module signature definitions" 970,tcAttributeAutoOpenWasIgnored,"The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored" 971,ilUndefinedValue,"Undefined value '%s'" 972,ilLabelNotFound,"Label %s not found" @@ -1069,8 +1061,6 @@ lexHashBangMustBeFirstInFile,"#! may only appear as the first line at the start 1189,parsNonAdjacentTypars,"Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name." 1190,parsNonAdjacentTyargs,"Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name." parsNonAtomicType,"The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C'" -# 1191,tastUndefinedTyconItemField,"The type %s did not contain the field '%s'" -# 1192,tastUndefinedTyconItemUnionCase,"The type %s did not contain the union case '%s'" 1193,tastUndefinedItemRefModuleNamespace,"The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s'" 1194,tastUndefinedItemRefVal,"The module/namespace '%s' from compilation unit '%s' did not contain the val '%s'" 1195,tastUndefinedItemRefModuleNamespaceType,"The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s'" @@ -1090,7 +1080,6 @@ mlCompatSigColonNoLongerSupported,"The use of 'module M: sig ... end ' was depre mlCompatSigEndNoLongerSupported,"The use of 'module M = sig ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'sig' and 'end' and use indentation instead" mlCompatMultiPrefixTyparsNoLongerSupported,"The use of multiple parenthesized type parameters before a generic type name such as '(int, int) Map' was deprecated in F# 2.0 and is no longer supported" mlCompatStructEndNoLongerSupported,"The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead" -#1205,chkDuplicateInherittedVirtualMethod,"Duplicate virtual methods. There are multiple virtual methods named '%s' with the same signature in the parent (inherited) type. This may be a result of instantiating the parent type." 1206,ilFieldDoesNotHaveValidOffsetForStructureLayout,"The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute" 1207,tcInterfacesShouldUseInheritNotInterface,"Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...'" 1208,parsInvalidPrefixOperator,"Invalid prefix operator" @@ -1103,7 +1092,6 @@ lexIfOCaml,"IF-FSHARP/IF-CAML regions are no longer supported" 1211,ilFieldHasOffsetForSequentialLayout,"The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)" 1212,tcOptionalArgsMustComeAfterNonOptionalArgs,"Optional arguments must come at the end of the argument list, after any non-optional arguments" 1213,tcConditionalAttributeUsage,"Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes" -#1214,monoRegistryBugWorkaround,"Could not determine highest installed .NET framework version from Registry keys, using version 2.0" 1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." 1216,ilwriteMDBFileNameCannotBeChangedWarning,"The name of the MDB file must be .mdb. The --pdb option will be ignored." 1217,ilwriteMDBMemberMissing,"MDB generation failed. Could not find compatible member %s" @@ -1215,7 +1203,6 @@ fscTooManyErrors,"Exiting - too many errors" 3049,etProviderHasDesignerAssemblyException,"The type provider designer assembly '%s' could not be loaded from folder '%s'. The exception reported was: %s - %s" invalidNamespaceForProvidedType,"invalid namespace for provided type" invalidFullNameForProvidedType,"invalid full name for provided type" -#3050,etGenerateAttributeRequiresInternal,"The 'Generate' attribute must be used with a type definition with 'internal' visibility" 3051,etProviderReturnedNull,"The type provider returned 'null', which is not a valid return value from '%s'" 3053,etTypeProviderConstructorException,"The type provider constructor has thrown an exception: %s" 3056,etNullProvidedExpression,"Type provider '%s' returned null from GetInvokerExpression." @@ -1604,7 +1591,6 @@ forFormatInvalidForInterpolated4,"Interpolated strings used as type IFormattable 3388,tcSubsumptionImplicitConversionUsed,"This expression implicitly converts type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs." 3389,tcBuiltInImplicitConversionUsed,"This expression uses a built-in implicit conversion to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs." 3391,tcImplicitConversionUsedForNonMethodArg,"This expression uses the implicit conversion '%s' to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs. This warning may be disabled using '#nowarn \"3391\"." -#3501 "This construct is not supported by your version of the F# compiler" CompilerMessage(ExperimentalAttributeMessages.NotSupportedYet, 3501, IsError=true) 3390,xmlDocBadlyFormed,"This XML comment is invalid: '%s'" 3390,xmlDocMissingParameterName,"This XML comment is invalid: missing 'name' attribute for parameter or parameter reference" 3390,xmlDocMissingCrossReference,"This XML comment is invalid: missing 'cref' attribute for cross-reference" From b71a62cc1b214858874ac8dff67c238e08334cb2 Mon Sep 17 00:00:00 2001 From: 0101 <0101@innit.cz> Date: Fri, 8 Jul 2022 11:19:39 +0200 Subject: [PATCH 018/226] Unified way of determining a struct --- src/Compiler/CodeGen/IlxGen.fs | 2 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 96631c19b69..a246f176612 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -10696,7 +10696,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilPropName = fspec.LogicalName let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden - let isStruct = tycon.IsFSharpStructOrEnumTycon && not tycon.IsEnumTycon + let isStruct = isStructTyconRef tcref let attrs = if isStruct && not isStatic then diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index a7ad47779dc..c0a2dd51211 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1662,6 +1662,9 @@ val underlyingTypeOfEnumTy: TcGlobals -> TType -> TType /// If the input type is an enum type, then convert to its underlying type, otherwise return the input type val normalizeEnumTy: TcGlobals -> TType -> TType +/// Determine if TyconRef is to a struct type +val isStructTyconRef: TyconRef -> bool + /// Determine if a type is a struct type val isStructTy: TcGlobals -> TType -> bool From 776799d0c5dd515e231598065d8a8d5bd410758f Mon Sep 17 00:00:00 2001 From: Petr Semkin Date: Fri, 8 Jul 2022 16:53:00 +0200 Subject: [PATCH 019/226] Fixed double-clicking of our unit tests in VS test explorer (#13469) --- .../Tests.ProjectSystem.References.fs | 85 ------------------- 1 file changed, 85 deletions(-) diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs index 50805ed6356..6e2f5b08e7c 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs @@ -8,15 +8,12 @@ open System.IO open System.Reflection open NUnit.Framework -open Salsa open UnitTests.TestLib.Utils.Asserts open UnitTests.TestLib.Utils.FilesystemHelpers open UnitTests.TestLib.ProjectSystem -open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.ProjectSystem open Microsoft.VisualStudio.Shell.Interop -open Microsoft.Win32 open System.Xml.Linq [][] @@ -25,26 +22,12 @@ type References() = //TODO: look for a way to remove the helper functions static let currentFrameworkDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() - static let Net20AssemExPath () = - let key = @"SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\Public Assemblies (Common Files)" - let hklm = Registry.LocalMachine - let rkey = hklm.OpenSubKey(key) - let path = rkey.GetValue("") :?> string - if String.IsNullOrEmpty(path) then None - else Some(path) ///////////////////////////////// // project helpers static let SaveProject(project : UnitTestingFSharpProjectNode) = project.Save(null, 1, 0u) |> ignore - static let DefaultBuildActionOfFilename(filename) : Salsa.BuildAction = - match Path.GetExtension(filename) with - | ".fsx" -> Salsa.BuildAction.None - | ".resx" - | ".resources" -> Salsa.BuildAction.EmbeddedResource - | _ -> Salsa.BuildAction.Compile - static let GetReferenceContainerNode(project : ProjectNode) = let l = new List() project.FindNodesOfType(l) @@ -249,74 +232,6 @@ type References() = with e -> TheTests.HelpfulAssertMatches ' ' "A reference to '.*' could not be added. A reference to the component '.*' already exists in the project." e.Message - [] - [] - member public this.``ReferenceResolution.Bug650591.AutomationReference.Add.FullPath``() = - match Net20AssemExPath() with - | Some(net20) -> - let invoker = - { - new Microsoft.Internal.VisualStudio.Shell.Interop.IVsInvokerPrivate with - member this.Invoke(invokable) = invokable.Invoke() - } - let log = - { - new Microsoft.VisualStudio.Shell.Interop.IVsActivityLog with - member this.LogEntry(_, _, _) = VSConstants.S_OK - member this.LogEntryGuid(_, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidHr(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidHrPath(_, _, _, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidPath(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryHr(_, _, _, _) = VSConstants.S_OK - member this.LogEntryHrPath(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryPath(_, _, _, _) = VSConstants.S_OK - } - let mocks = - [ - typeof.GUID, box invoker - typeof.GUID, box log - ] |> dict - let mockProvider = - { - new Microsoft.VisualStudio.OLE.Interop.IServiceProvider with - member this.QueryService(guidService, riid, punk) = - match mocks.TryGetValue guidService with - | true, v -> - punk <- System.Runtime.InteropServices.Marshal.GetIUnknownForObject(v) - VSConstants.S_OK - | _ -> - punk <- IntPtr.Zero - VSConstants.E_NOINTERFACE - } - - let _ = Microsoft.VisualStudio.Shell.ServiceProvider.CreateFromSetSite(mockProvider) - let envDte80RefAssemPath = Path.Combine(net20, "EnvDTE80.dll") - let dirName = Path.GetTempPath() - let copy = Path.Combine(dirName, "EnvDTE80.dll") - try - File.Copy(envDte80RefAssemPath, copy, true) - this.MakeProjectAndDo - ( - ["DoesNotMatter.fs"], - [], - "", - fun proj -> - let refContainer = GetReferenceContainerNode(proj) - let automationRefs = refContainer.Object :?> Automation.OAReferences - automationRefs.Add(copy) |> ignore - SaveProject(proj) - let fsprojFileText = File.ReadAllText(proj.FileName) - printfn "%s" fsprojFileText - let expectedFsProj = - @"" - + @"\s*\.\.\\EnvDTE80.dll" - + @"\s*" - TheTests.HelpfulAssertMatches '<' expectedFsProj fsprojFileText - ) - finally - File.Delete(copy) - | _ -> () - /// Create a dummy project named 'Test', build it, and then call k with the full path to the resulting exe member public this.CreateDummyTestProjectBuildItAndDo(k : string -> unit) = this.MakeProjectAndDo(["foo.fs"], [], "", (fun project -> From 96685dcaeb1f2db7db95a96f4ef0cdaea85df4a1 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 8 Jul 2022 17:23:57 +0100 Subject: [PATCH 020/226] Create representations.md (#13474) --- docs/representations.md | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/representations.md diff --git a/docs/representations.md b/docs/representations.md new file mode 100644 index 00000000000..abd8c9a0b3b --- /dev/null +++ b/docs/representations.md @@ -0,0 +1,58 @@ +--- +title: Representations +category: Compiler Internals +categoryindex: 200 +index: 350 +--- +# Representation Decisions in the F# Compiler + +Consider the following declarations, all of which look very similar. + +```fsharp +module M = + let z = 1 + let f = x + z + + +type C(w: int, z: int) = + + let f x = x + z + let f x = f 3 + x + + +let g (z: int) = + let f x = x + 1 +``` +Part of the job of the F# compiler is to "decide" how these declarations are compiled. The following acts as a guide to how these different bindings are represented and where these decisions are made. + +First for module-level `let` bindings. These representations are decided by code in `CheckExpressions.fs` and `CheckDeclarations.fs` based on syntax. + +```fsharp +module M = + let z = 1 // z --> static property + field, required by spec, compiled name mandated + let f x = x + z // f --> static method, required by spec, compiled name mandated +``` + +Next for class-level `let` bindings. These representations are decided by code in `CheckIncrementalClasses.fs` based on analysis of use. +```fsharp +// Decided in CheckIncrementalClasses.fs based on analysis of use +type C(w: int, z: int) = // w --> local to object constructor, required by spec + // z --> private instance field, required by spec + let f x = x + z // f --> private instance method, required by spec, compiled name not mandated + // Note: initially uses an ephemeral 'f' Val then creates a member Val with compiled name + + let f x = f 3 + x // f --> private instance method, required by spec, compiled name not mandated + // Note: initially uses an ephemeral 'f' Val then creates a member Val with compiled name + + static let g x = x + 1 // g --> private static method, required by spec, compiled name not mandated, initially uses an ephemeral 'g' Val then creates a member Val with compiled name + + static let g x = g 3 // g --> private static method, required by spec, compiled name not mandated, initially uses an ephemeral 'g' Val then creates a member Val with compiled name +``` +Next for expression-level `let` bindings. These representations are decided by code in various optimization phases. +```fsharp +let g (z: int) = // z --> local + field in closure for 'f', not mandated + let f x = x + 1 // f --> FSharpFunc value, or maybe a static method, not mandated + // Decided in various optimization phases +``` + +> NOTE: The representation decision is implied by the addition of ValReprInfo to the `Val` node. From ff7d17b4153b35b768c3381d8455419d7f75dc18 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 8 Jul 2022 09:49:51 -0700 Subject: [PATCH 021/226] Merge main to release/dev17.4 (#13472) Co-authored-by: Petr Pokorny Co-authored-by: Kevin Ransom (msft) Co-authored-by: 0101 <0101@innit.cz> Co-authored-by: Petr Semkin --- src/Compiler/CodeGen/IlxGen.fs | 26 +++- src/Compiler/FSComp.txt | 14 -- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 + .../EmittedIL/Misc/Structs02.fs.il.debug.bsl | 1 + .../Misc/Structs02.fs.il.release.bsl | 1 + .../EmittedIL/StructGettersReadOnly.fs | 130 ++++++++++++++++++ .../FloatsAndDoubles.fs.il.debug.bsl | 2 + .../FloatsAndDoubles.fs.il.release.bsl | 2 + .../FSharp.Compiler.ComponentTests.fsproj | 2 + tests/FSharp.Test.Utilities/Compiler.fs | 27 ++-- .../FSharp.Test.Utilities.fsproj | 1 + .../FSharp.Test.Utilities/ReflectionHelper.fs | 63 +++++++++ .../Tests.ProjectSystem.References.fs | 85 ------------ 13 files changed, 243 insertions(+), 114 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs create mode 100644 tests/FSharp.Test.Utilities/ReflectionHelper.fs diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index c6b672815cf..d2e3de58128 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -68,7 +68,7 @@ let iLdcDouble i = AI_ldc(DT_R8, ILConst.R8 i) let iLdcSingle i = AI_ldc(DT_R4, ILConst.R4 i) /// Make a method that simply loads a field -let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType) = +let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = let ilFieldSpec = mkILFieldSpecInTy (ilTy, ilFieldName, ilPropType) let ilReturn = mkILReturn ilPropType @@ -84,7 +84,7 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) - ilMethodDef.WithSpecialName + ilMethodDef.With(customAttrs = mkILCustomAttrs customAttrs).WithSpecialName /// Choose the constructor parameter names for fields let ChooseParamNames fieldNamesAndTypes = @@ -600,11 +600,14 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK +let GenReadOnlyAttribute (g: TcGlobals) = + mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref if add then - let attr = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + let attr = GenReadOnlyAttribute g Some attr else None @@ -2094,7 +2097,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy) + let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] + mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) yield! genToStringMethod ilTy ] @@ -9106,7 +9110,7 @@ and GenMethodForBinding // Check if we're compiling the property as a .NET event assert not (CompileAsEvent cenv.g v.Attribs) - // Emit the property, but not if its a private method impl + // Emit the property, but not if it's a private method impl if mdef.Access <> ILMemberAccess.Private then let vtyp = ReturnTypeOfPropertyVal g v let ilPropTy = GenType cenv m eenvUnderMethTypeTypars.tyenv vtyp @@ -10701,7 +10705,15 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilPropName = fspec.LogicalName let ilMethName = "get_" + ilPropName let access = ComputeMemberAccess isPropHidden - yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType) + let isStruct = isStructTyconRef tcref + + let attrs = + if isStruct && not isStatic then + [ GenReadOnlyAttribute g ] + else + [] + + yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) // Generate property setter methods for the mutable fields for useGenuineField, ilFieldName, isFSharpMutable, isStatic, _, ilPropType, isPropHidden, fspec in fieldSummaries do @@ -11225,7 +11237,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) = let ilFieldName = ComputeFieldName exnc fld let ilMethodDef = - mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType) + mkLdfldMethodDef (ilMethName, reprAccess, false, ilThisTy, ilFieldName, ilPropType, []) let ilFieldDef = mkILInstanceField (ilFieldName, ilPropType, None, ILMemberAccess.Assembly) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 6bbd661d7cf..a6ce206cc8f 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -270,7 +270,6 @@ chkUnionCaseDefaultAugmentation,"default augmentation of the union case" 435,chkGetterSetterDoNotMatchAbstract,"The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well." 436,chkPropertySameNameIndexer,"The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties." 437,chkCantStoreByrefValue,"A type would store a byref typed value. This is not permitted by Common IL." -#See related 1205 chkDuplicateInherittedVirtualMethod 438,chkDuplicateMethod,"Duplicate method. The method '%s' has the same name and signature as another method in type '%s'." 438,chkDuplicateMethodWithSuffix,"Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased." 439,chkDuplicateMethodCurried,"The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments." @@ -474,7 +473,6 @@ parsSyntaxModuleStructEndDeprecated,"The syntax 'module ... = struct .. end' is parsSyntaxModuleSigEndDeprecated,"The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end'" 627,tcStaticFieldUsedWhenInstanceFieldExpected,"A static field was used where an instance field is expected" 629,tcMethodNotAccessible,"Method '%s' is not accessible from this code location" -#630,tcTypeFunctionFieldsCannotBeMutated,"Fields which are type functions cannot be mutated" 632,tcImplicitMeasureFollowingSlash,"Implicit product of measures following /" 633,tcUnexpectedMeasureAnon,"Unexpected SynMeasure.Anon" 634,tcNonZeroConstantCannotHaveGenericUnit,"Non-zero constants cannot have generic units. For generic zero, write 0.0<_>." @@ -647,8 +645,6 @@ tcExpressionWithIfRequiresParenthesis,"This list or array expression includes an 799,tcInvalidAssignment,"Invalid assignment" 800,tcInvalidUseOfTypeName,"Invalid use of a type name" 801,tcTypeHasNoAccessibleConstructor,"This type has no accessible object constructors" -#802,tcInvalidUseOfTypeNameOrConstructor,"Invalid use of a type name and/or object constructor. If necessary use 'new' and apply the constructor to its arguments, e.g. 'new Type(args)'." -#803,tcInvalidUseOfTypeNameOrConstructorWithOverloads,"Invalid use of a type name and/or object constructor. If necessary use 'new' and apply the constructor to its arguments, e.g. 'new Type(args)'. The required signature is:\n\t%s." 804,tcInvalidUseOfInterfaceType,"Invalid use of an interface type" 805,tcInvalidUseOfDelegate,"Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'." 806,tcPropertyIsNotStatic,"Property '%s' is not static" @@ -765,7 +761,6 @@ tcTypeOrModule,"type or module" 919,tcExceptionAbbreviationsMustReferToValidExceptions,"Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception" 920,tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor,"Abbreviations for Common IL exception types must have a matching object constructor" 921,tcNotAnException,"Not an exception" -#922,tcUnexpectedConstraintsOrParametersOnModule,"Unexpected constraints or parameters on module specification" 924,tcInvalidModuleName,"Invalid module name" 925,tcInvalidTypeExtension,"Invalid type extension" 926,tcAttributesOfTypeSpecifyMultipleKindsForType,"The attributes of this type specify multiple kinds for the type" @@ -798,7 +793,6 @@ tcTypeAbbreviationHasTypeParametersMissingOnType,"This type abbreviation has one 949,tcInvalidDelegateSpecification,"Delegate specifications must be of the form 'typ -> typ'" 950,tcDelegatesCannotBeCurried,"Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values." 951,tcInvalidTypeForLiteralEnumeration,"Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char" -#952,tcTypeAbbreviationMustBePublic,"Type abbreviations must be public. If you want to use a private type abbreviation you must use an explicit signature." 953,tcTypeDefinitionIsCyclic,"This type definition involves an immediate cyclic reference through an abbreviation" 954,tcTypeDefinitionIsCyclicThroughInheritance,"This type definition involves an immediate cyclic reference through a struct field or inheritance relation" tcReservedSyntaxForAugmentation,"The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[] attribute to the type definition in the signature" @@ -813,8 +807,6 @@ tcReservedSyntaxForAugmentation,"The syntax 'type X with ...' is reserved for au 965,tcModuleAbbreviationForNamespace,"The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace." 966,tcTypeUsedInInvalidWay,"The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference." 967,tcMemberUsedInInvalidWay,"The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference." -#968,tcExplicitSignaturesInImplementationFileCannotBeUsed,"Explicit signatures within implementation files are not permitted" -#969,tcModulesCannotUseNamedModuleSignatures,"Modules cannot use named module signature definitions" 970,tcAttributeAutoOpenWasIgnored,"The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored" 971,ilUndefinedValue,"Undefined value '%s'" 972,ilLabelNotFound,"Label %s not found" @@ -1069,8 +1061,6 @@ lexHashBangMustBeFirstInFile,"#! may only appear as the first line at the start 1189,parsNonAdjacentTypars,"Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name." 1190,parsNonAdjacentTyargs,"Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name." parsNonAtomicType,"The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C'" -# 1191,tastUndefinedTyconItemField,"The type %s did not contain the field '%s'" -# 1192,tastUndefinedTyconItemUnionCase,"The type %s did not contain the union case '%s'" 1193,tastUndefinedItemRefModuleNamespace,"The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s'" 1194,tastUndefinedItemRefVal,"The module/namespace '%s' from compilation unit '%s' did not contain the val '%s'" 1195,tastUndefinedItemRefModuleNamespaceType,"The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s'" @@ -1090,7 +1080,6 @@ mlCompatSigColonNoLongerSupported,"The use of 'module M: sig ... end ' was depre mlCompatSigEndNoLongerSupported,"The use of 'module M = sig ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'sig' and 'end' and use indentation instead" mlCompatMultiPrefixTyparsNoLongerSupported,"The use of multiple parenthesized type parameters before a generic type name such as '(int, int) Map' was deprecated in F# 2.0 and is no longer supported" mlCompatStructEndNoLongerSupported,"The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead" -#1205,chkDuplicateInherittedVirtualMethod,"Duplicate virtual methods. There are multiple virtual methods named '%s' with the same signature in the parent (inherited) type. This may be a result of instantiating the parent type." 1206,ilFieldDoesNotHaveValidOffsetForStructureLayout,"The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute" 1207,tcInterfacesShouldUseInheritNotInterface,"Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...'" 1208,parsInvalidPrefixOperator,"Invalid prefix operator" @@ -1103,7 +1092,6 @@ lexIfOCaml,"IF-FSHARP/IF-CAML regions are no longer supported" 1211,ilFieldHasOffsetForSequentialLayout,"The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)" 1212,tcOptionalArgsMustComeAfterNonOptionalArgs,"Optional arguments must come at the end of the argument list, after any non-optional arguments" 1213,tcConditionalAttributeUsage,"Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes" -#1214,monoRegistryBugWorkaround,"Could not determine highest installed .NET framework version from Registry keys, using version 2.0" 1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." 1216,ilwriteMDBFileNameCannotBeChangedWarning,"The name of the MDB file must be .mdb. The --pdb option will be ignored." 1217,ilwriteMDBMemberMissing,"MDB generation failed. Could not find compatible member %s" @@ -1215,7 +1203,6 @@ fscTooManyErrors,"Exiting - too many errors" 3049,etProviderHasDesignerAssemblyException,"The type provider designer assembly '%s' could not be loaded from folder '%s'. The exception reported was: %s - %s" invalidNamespaceForProvidedType,"invalid namespace for provided type" invalidFullNameForProvidedType,"invalid full name for provided type" -#3050,etGenerateAttributeRequiresInternal,"The 'Generate' attribute must be used with a type definition with 'internal' visibility" 3051,etProviderReturnedNull,"The type provider returned 'null', which is not a valid return value from '%s'" 3053,etTypeProviderConstructorException,"The type provider constructor has thrown an exception: %s" 3056,etNullProvidedExpression,"Type provider '%s' returned null from GetInvokerExpression." @@ -1604,7 +1591,6 @@ forFormatInvalidForInterpolated4,"Interpolated strings used as type IFormattable 3388,tcSubsumptionImplicitConversionUsed,"This expression implicitly converts type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs." 3389,tcBuiltInImplicitConversionUsed,"This expression uses a built-in implicit conversion to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs." 3391,tcImplicitConversionUsedForNonMethodArg,"This expression uses the implicit conversion '%s' to convert type '%s' to type '%s'. See https://aka.ms/fsharp-implicit-convs. This warning may be disabled using '#nowarn \"3391\"." -#3501 "This construct is not supported by your version of the F# compiler" CompilerMessage(ExperimentalAttributeMessages.NotSupportedYet, 3501, IsError=true) 3390,xmlDocBadlyFormed,"This XML comment is invalid: '%s'" 3390,xmlDocMissingParameterName,"This XML comment is invalid: missing 'name' attribute for parameter or parameter reference" 3390,xmlDocMissingCrossReference,"This XML comment is invalid: missing 'cref' attribute for cross-reference" diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 17d9cc60766..1a89375f930 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1665,6 +1665,9 @@ val underlyingTypeOfEnumTy: TcGlobals -> TType -> TType /// If the input type is an enum type, then convert to its underlying type, otherwise return the input type val normalizeEnumTy: TcGlobals -> TType -> TType +/// Determine if TyconRef is to a struct type +val isStructTyconRef: TyconRef -> bool + /// Determine if a type is a struct type val isStructTy: TcGlobals -> TType -> bool diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl index 11721f6522a..cc8f56cd993 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl index 5c412d430d3..ed4eefc32ed 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl @@ -66,6 +66,7 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs new file mode 100644 index 00000000000..ccb94a97e50 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -0,0 +1,130 @@ +namespace FSharp.Compiler.ComponentTests.EmittedIL + +open Microsoft.FSharp.Core +open Xunit +open FSharp.Test.Compiler +open FSharp.Test.ReflectionHelper + +module ``Struct getters readonly`` = + + let structRecord = + FSharp + """ + module Test + + [] type MyRecord = { MyField : int } + """ + + [] + let ``Struct record has readonly attribute on getter`` () = + structRecord + |> compileAssembly + |> getType "Test+MyRecord" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct record has readonly attribute on getter in IL`` () = + structRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Test/MyRecord::MyField@ + IL_0006: ret + }""" ] + + let nonStructRecord = + FSharp + """ + module Test + + type MyRecord = { MyField : int } + """ + + [] + let ``Non-struct record doesn't have readonly getters`` () = + nonStructRecord + |> compileAssembly + |> getType "Test+MyRecord" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct record doesn't have readonly getters in IL`` () = + nonStructRecord + |> compile + |> shouldSucceed + |> verifyIL [ """ + .method public hidebysig specialname + instance int32 get_MyField() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Test/MyRecord::MyField@ + IL_0006: ret + } """ ] + + [] + let ``Struct anonymous record has readonly attribute on getter`` () = + FSharp + """ + module Test + + let myRecord = struct {| MyField = 3 |} + """ + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Non-struct anonymous record doesn't have readonly attribute on getter`` () = + FSharp + """ + module Test + + let myRecord = {| MyField = 3 |} + """ + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" + + [] + let ``Struct has readonly getters`` () = + FSharp + """ + module Test + + [] + type MyStruct = + val MyField: int + """ + |> compileAssembly + |> getType "Test+MyStruct" + |> getMethod "get_MyField" + |> should haveAttribute "IsReadOnlyAttribute" + + [] + let ``Custom getter on a struct doesn't have readonly attribute`` () = + FSharp + """ + module Test + + [] + type MyStruct = + val mutable x: int + member this.MyField with get () = this.x <- 4 + """ + |> compileAssembly + |> getType "Test+MyStruct" + |> getMethod "get_MyField" + |> shouldn't haveAttribute "IsReadOnlyAttribute" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl index 1e35a8e9c26..0e84741e970 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -409,6 +410,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl index caa632f0fa0..9d6c3245635 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl @@ -65,6 +65,7 @@ .method public hidebysig specialname instance float64 get_F() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -376,6 +377,7 @@ .method public hidebysig specialname instance float64 get_D() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index b41d408da26..a899d457f86 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -92,6 +92,7 @@ + @@ -122,6 +123,7 @@ + diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index a374f3d4475..54822b93d80 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -631,16 +631,27 @@ module rec Compiler = | _ -> failwith "Compilation has errors." - let compileGuid (cUnit: CompilationUnit) : Guid = - let bytes = - compile cUnit - |> shouldSucceed - |> getAssemblyInBytes + let getAssembly = getAssemblyInBytes >> Assembly.Load - use reader1 = new PEReader(bytes.ToImmutableArray()) - let reader1 = reader1.GetMetadataReader() + let withPeReader func compilationResult = + let bytes = getAssemblyInBytes compilationResult + use reader = new PEReader(bytes.ToImmutableArray()) + func reader - reader1.GetModuleDefinition().Mvid |> reader1.GetGuid + let withMetadataReader func = + withPeReader (fun reader -> reader.GetMetadataReader() |> func) + + let compileGuid cUnit = + cUnit + |> compile + |> shouldSucceed + |> withMetadataReader (fun reader -> reader.GetModuleDefinition().Mvid |> reader.GetGuid) + + let compileAssembly cUnit = + cUnit + |> compile + |> shouldSucceed + |> getAssembly let private parseFSharp (fsSource: FSharpCompilationSource) : CompilationResult = let source = fsSource.Source.GetSourceText |> Option.defaultValue "" diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index c9852f0fb8c..a20052b3f66 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -26,6 +26,7 @@ + diff --git a/tests/FSharp.Test.Utilities/ReflectionHelper.fs b/tests/FSharp.Test.Utilities/ReflectionHelper.fs new file mode 100644 index 00000000000..5759752c706 --- /dev/null +++ b/tests/FSharp.Test.Utilities/ReflectionHelper.fs @@ -0,0 +1,63 @@ +module FSharp.Test.ReflectionHelper + +open System +open System.Reflection + +/// Gets the given type from the assembly (otherwise throws) +let getType typeName (asm: Assembly) = + match asm.GetType(typeName, false) with + | null -> + let allTypes = + asm.GetTypes() + |> Array.map (fun ty -> ty.Name) + |> Array.reduce (fun x y -> $"%s{x}\r%s{y}") + + failwith $"Error: Assembly did not contain type %s{typeName}.\nAll types in asm:\n%s{allTypes}" + | ty -> ty + +/// Gets all anonymous types from the assembly +let getAnonymousTypes (asm: Assembly) = + [ for ty in asm.GetTypes() do + if ty.FullName.StartsWith "<>f__AnonymousType" then ty ] + +/// Gets the first anonymous type from the assembly +let getFirstAnonymousType asm = + match getAnonymousTypes asm with + | ty :: _ -> ty + | [] -> failwith "Error: No anonymous types found in the assembly" + +/// Gets a type's method +let getMethod methodName (ty: Type) = + match ty.GetMethod(methodName) with + | null -> failwith $"Error: Type did not contain member %s{methodName}" + | methodInfo -> methodInfo + +/// Assert that function f returns Ok for given input +let should f x y = + match f x y with + | Ok _ -> () + | Error message -> failwith $"%s{message} but it should" + +/// Assert that function f doesn't return Ok for given input +let shouldn't f x y = + match f x y with + | Ok message -> failwith $"%s{message} but it shouldn't" + | Error _ -> () + +/// Verify the object contains a custom attribute with the given name. E.g. "ObsoleteAttribute" +let haveAttribute attrName thingy = + let attrs = + match box thingy with + | :? Type as ty -> ty.GetCustomAttributes(false) + | :? MethodInfo as mi -> mi.GetCustomAttributes(false) + | :? PropertyInfo as pi -> pi.GetCustomAttributes(false) + | :? EventInfo as ei -> ei.GetCustomAttributes(false) + | _ -> failwith "Error: Unsupported primitive type, unable to get custom attributes." + + let hasAttribute = + attrs |> Array.exists (fun att -> att.GetType().Name = attrName) + + if hasAttribute then + Ok $"'{thingy}' has attribute '{attrName}'" + else + Error $"'{thingy}' doesn't have attribute '{attrName}'" diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs index 50805ed6356..6e2f5b08e7c 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs @@ -8,15 +8,12 @@ open System.IO open System.Reflection open NUnit.Framework -open Salsa open UnitTests.TestLib.Utils.Asserts open UnitTests.TestLib.Utils.FilesystemHelpers open UnitTests.TestLib.ProjectSystem -open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.ProjectSystem open Microsoft.VisualStudio.Shell.Interop -open Microsoft.Win32 open System.Xml.Linq [][] @@ -25,26 +22,12 @@ type References() = //TODO: look for a way to remove the helper functions static let currentFrameworkDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() - static let Net20AssemExPath () = - let key = @"SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\Public Assemblies (Common Files)" - let hklm = Registry.LocalMachine - let rkey = hklm.OpenSubKey(key) - let path = rkey.GetValue("") :?> string - if String.IsNullOrEmpty(path) then None - else Some(path) ///////////////////////////////// // project helpers static let SaveProject(project : UnitTestingFSharpProjectNode) = project.Save(null, 1, 0u) |> ignore - static let DefaultBuildActionOfFilename(filename) : Salsa.BuildAction = - match Path.GetExtension(filename) with - | ".fsx" -> Salsa.BuildAction.None - | ".resx" - | ".resources" -> Salsa.BuildAction.EmbeddedResource - | _ -> Salsa.BuildAction.Compile - static let GetReferenceContainerNode(project : ProjectNode) = let l = new List() project.FindNodesOfType(l) @@ -249,74 +232,6 @@ type References() = with e -> TheTests.HelpfulAssertMatches ' ' "A reference to '.*' could not be added. A reference to the component '.*' already exists in the project." e.Message - [] - [] - member public this.``ReferenceResolution.Bug650591.AutomationReference.Add.FullPath``() = - match Net20AssemExPath() with - | Some(net20) -> - let invoker = - { - new Microsoft.Internal.VisualStudio.Shell.Interop.IVsInvokerPrivate with - member this.Invoke(invokable) = invokable.Invoke() - } - let log = - { - new Microsoft.VisualStudio.Shell.Interop.IVsActivityLog with - member this.LogEntry(_, _, _) = VSConstants.S_OK - member this.LogEntryGuid(_, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidHr(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidHrPath(_, _, _, _, _, _) = VSConstants.S_OK - member this.LogEntryGuidPath(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryHr(_, _, _, _) = VSConstants.S_OK - member this.LogEntryHrPath(_, _, _, _, _) = VSConstants.S_OK - member this.LogEntryPath(_, _, _, _) = VSConstants.S_OK - } - let mocks = - [ - typeof.GUID, box invoker - typeof.GUID, box log - ] |> dict - let mockProvider = - { - new Microsoft.VisualStudio.OLE.Interop.IServiceProvider with - member this.QueryService(guidService, riid, punk) = - match mocks.TryGetValue guidService with - | true, v -> - punk <- System.Runtime.InteropServices.Marshal.GetIUnknownForObject(v) - VSConstants.S_OK - | _ -> - punk <- IntPtr.Zero - VSConstants.E_NOINTERFACE - } - - let _ = Microsoft.VisualStudio.Shell.ServiceProvider.CreateFromSetSite(mockProvider) - let envDte80RefAssemPath = Path.Combine(net20, "EnvDTE80.dll") - let dirName = Path.GetTempPath() - let copy = Path.Combine(dirName, "EnvDTE80.dll") - try - File.Copy(envDte80RefAssemPath, copy, true) - this.MakeProjectAndDo - ( - ["DoesNotMatter.fs"], - [], - "", - fun proj -> - let refContainer = GetReferenceContainerNode(proj) - let automationRefs = refContainer.Object :?> Automation.OAReferences - automationRefs.Add(copy) |> ignore - SaveProject(proj) - let fsprojFileText = File.ReadAllText(proj.FileName) - printfn "%s" fsprojFileText - let expectedFsProj = - @"" - + @"\s*\.\.\\EnvDTE80.dll" - + @"\s*" - TheTests.HelpfulAssertMatches '<' expectedFsProj fsprojFileText - ) - finally - File.Delete(copy) - | _ -> () - /// Create a dummy project named 'Test', build it, and then call k with the full path to the resulting exe member public this.CreateDummyTestProjectBuildItAndDo(k : string -> unit) = this.MakeProjectAndDo(["foo.fs"], [], "", (fun project -> From f37943d0d27acbbac870207557110fee88c22894 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Fri, 8 Jul 2022 18:51:12 +0200 Subject: [PATCH 022/226] Don't wrap IdentTrivia ident in SynExpr.Paren. (#13449) * Don't wrap IdentTrivia ident in SynExpr.Paren. * Move SyntaxTree tests to separate files. --- src/Compiler/pars.fsy | 22 +- .../FSharp.Compiler.Service.Tests.fsproj | 69 + .../FSharp.Compiler.UnitTests.fsproj | 69 + tests/service/Symbols.fs | 4455 ----------------- tests/service/SyntaxTreeTests/BindingTests.fs | 368 ++ .../SyntaxTreeTests/CodeCommentTests.fs | 146 + .../ComputationExpressionTests.fs | 57 + .../ConditionalDirectiveTests.fs | 357 ++ .../service/SyntaxTreeTests/EnumCaseTests.fs | 75 + .../service/SyntaxTreeTests/ExceptionTests.fs | 25 + .../SyntaxTreeTests/ExpressionTests.fs | 496 ++ .../SyntaxTreeTests/IfThenElseTests.fs | 177 + tests/service/SyntaxTreeTests/LambdaTests.fs | 146 + .../SyntaxTreeTests/MatchClauseTests.fs | 231 + tests/service/SyntaxTreeTests/MeasureTests.fs | 49 + .../SyntaxTreeTests/MemberFlagTests.fs | 178 + .../ModuleOrNamespaceSigTests.fs | 88 + .../SyntaxTreeTests/ModuleOrNamespaceTests.fs | 117 + .../SyntaxTreeTests/NestedModuleTests.fs | 172 + .../SyntaxTreeTests/OperatorNameTests.fs | 486 ++ .../ParsedHashDirectiveTests.fs | 61 + tests/service/SyntaxTreeTests/PatternTests.fs | 100 + .../SyntaxTreeTests/SignatureTypeTests.fs | 427 ++ .../SyntaxTreeTests/SourceIdentifierTests.fs | 48 + tests/service/SyntaxTreeTests/StringTests.fs | 121 + tests/service/SyntaxTreeTests/TypeTests.fs | 486 ++ .../service/SyntaxTreeTests/UnionCaseTests.fs | 138 + 27 files changed, 4688 insertions(+), 4476 deletions(-) create mode 100644 tests/service/SyntaxTreeTests/BindingTests.fs create mode 100644 tests/service/SyntaxTreeTests/CodeCommentTests.fs create mode 100644 tests/service/SyntaxTreeTests/ComputationExpressionTests.fs create mode 100644 tests/service/SyntaxTreeTests/ConditionalDirectiveTests.fs create mode 100644 tests/service/SyntaxTreeTests/EnumCaseTests.fs create mode 100644 tests/service/SyntaxTreeTests/ExceptionTests.fs create mode 100644 tests/service/SyntaxTreeTests/ExpressionTests.fs create mode 100644 tests/service/SyntaxTreeTests/IfThenElseTests.fs create mode 100644 tests/service/SyntaxTreeTests/LambdaTests.fs create mode 100644 tests/service/SyntaxTreeTests/MatchClauseTests.fs create mode 100644 tests/service/SyntaxTreeTests/MeasureTests.fs create mode 100644 tests/service/SyntaxTreeTests/MemberFlagTests.fs create mode 100644 tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs create mode 100644 tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs create mode 100644 tests/service/SyntaxTreeTests/NestedModuleTests.fs create mode 100644 tests/service/SyntaxTreeTests/OperatorNameTests.fs create mode 100644 tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs create mode 100644 tests/service/SyntaxTreeTests/PatternTests.fs create mode 100644 tests/service/SyntaxTreeTests/SignatureTypeTests.fs create mode 100644 tests/service/SyntaxTreeTests/SourceIdentifierTests.fs create mode 100644 tests/service/SyntaxTreeTests/StringTests.fs create mode 100644 tests/service/SyntaxTreeTests/TypeTests.fs create mode 100644 tests/service/SyntaxTreeTests/UnionCaseTests.fs diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index ae048f25464..ebc1d2cb28c 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5619,27 +5619,7 @@ identExpr: | opName { let m = lhs parseState let ident, trivia = $1 - let mLparen, mRparen, trivia = - match trivia with - | IdentTrivia.OriginalNotation text -> - let mLparen = mkFileIndexRange m.FileIndex m.Start (mkPos m.StartLine (m.StartColumn + 1)) - let mRparen = mkFileIndexRange m.FileIndex (mkPos m.EndLine (m.EndColumn - 1)) m.End - mLparen, mRparen, Some trivia - | IdentTrivia.OriginalNotationWithParen(lpr, text, rpr) -> - lpr, rpr, Some(IdentTrivia.OriginalNotation(text)) - | IdentTrivia.HasParenthesis(lpr, rpr) -> - lpr, rpr, None - - match trivia with - | None -> - SynExpr.Paren(SynExpr.Ident(ident), mLparen, Some mRparen, m) - | Some trivia -> - SynExpr.Paren( - SynExpr.LongIdent(false, SynLongIdent([ident], [], [Some trivia]), None, m), - mLparen, - Some mRparen, - m - ) } + SynExpr.LongIdent(false, SynLongIdent([ident], [], [Some trivia]), None, m) } topSeparator: | SEMICOLON { } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 9e7230e54f6..743c0da36fa 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -38,6 +38,75 @@ Symbols.fs + + SyntaxTree\TypeTests.fs + + + SyntaxTree\ExpressionTests.fs + + + SyntaxTree\StringTests.fs + + + SyntaxTree\ModuleOrNamespaceTests.fs + + + SyntaxTree\ModuleOrNamespaceSigTests.fs + + + SyntaxTree\SignatureTypeTests.fs + + + SyntaxTree\MeasureTests.fs + + + SyntaxTree\MatchClauseTests.fs + + + SyntaxTree\SourceIdentifierTests.fs + + + SyntaxTree\NestedModuleTests.fs + + + SyntaxTree\BindingTests.fs + + + SyntaxTree\ParsedHashDirectiveTests.fs + + + SyntaxTree\LambdaTests.fs + + + SyntaxTree\IfThenElseTests.fs + + + SyntaxTree\UnionCaseTests.fs + + + SyntaxTree\EnumCaseTests.fs + + + SyntaxTree\PatternTests.fs + + + SyntaxTree\ExceptionTests.fs + + + SyntaxTree\MemberFlagTests.fs + + + SyntaxTree\ComputationExpressionTests.fs + + + SyntaxTree\ConditionalDirectiveTests.fs + + + SyntaxTree\CodeCommentTests.fs + + + SyntaxTree\OperatorNameTests.fs + FileSystemTests.fs diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index d9d740dc622..e04fd102a12 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -36,6 +36,75 @@ CompilerService\Symbols.fs + + SyntaxTree\TypeTests.fs + + + SyntaxTree\ExpressionTests.fs + + + SyntaxTree\StringTests.fs + + + SyntaxTree\ModuleOrNamespaceTests.fs + + + SyntaxTree\ModuleOrNamespaceSigTests.fs + + + SyntaxTree\SignatureTypeTests.fs + + + SyntaxTree\MeasureTests.fs + + + SyntaxTree\MatchClauseTests.fs + + + SyntaxTree\SourceIdentifierTests.fs + + + SyntaxTree\NestedModuleTests.fs + + + SyntaxTree\BindingTests.fs + + + SyntaxTree\ParsedHashDirectiveTests.fs + + + SyntaxTree\LambdaTests.fs + + + SyntaxTree\IfThenElseTests.fs + + + SyntaxTree\UnionCaseTests.fs + + + SyntaxTree\EnumCaseTests.fs + + + SyntaxTree\PatternTests.fs + + + SyntaxTree\ExceptionTests.fs + + + SyntaxTree\MemberFlagTests.fs + + + SyntaxTree\ComputationExpressionTests.fs + + + SyntaxTree\ConditionalDirectiveTests.fs + + + SyntaxTree\CodeCommentTests.fs + + + SyntaxTree\OperatorNameTests.fs + CompilerService\EditorTests.fs diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index 68e29e03ddb..b6af2161a86 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -361,4458 +361,3 @@ let tester2: int Group = [] |> should equal expectedTypeFormat | _ -> Assert.Fail (sprintf "Couldn't get member: %s" entityName) ) - - [] - let ``Single SynEnumCase contains range of constant`` () = - let parseResults = - getParseResults - """ -type Foo = One = 0x00000001 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn.SynTypeDefn(typeRepr = - SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r) ])))]) - ]) ])) -> - assertRange (2, 17) (2, 27) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Multiple SynEnumCase contains range of constant`` () = - let parseResults = - getParseResults - """ -type Foo = - | One = 0x00000001 - | Two = 2 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn.SynTypeDefn(typeRepr = - SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r1) - SynEnumCase.SynEnumCase(valueRange = r2) ])))]) - ]) ])) -> - assertRange (3, 13) (3, 23) r1 - assertRange (4, 12) (4, 13) r2 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynTypeDefn`` () = - let parseResults = - getParseResults - """ -[] -type Bar = - class - end""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [t]) as types - ]) ])) -> - assertRange (2, 0) (5, 7) types.Range - assertRange (2, 0) (5, 7) t.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attributes should be included in recursive types`` () = - let parseResults = - getParseResults - """ -[] -type Foo<'context, 'a> = - | Apply of ApplyCrate<'context, 'a> - -and [] Bar<'context, 'a> = - internal { - Hash : int - Foo : Foo<'a, 'b> - }""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [t1;t2]) as types - ]) ])) -> - assertRange (2, 0) (10, 5) types.Range - assertRange (2, 0) (4, 39) t1.Range - assertRange (6, 4) (10, 5) t2.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with ObjectModel Delegate contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -type X = delegate of string -> string -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _) - trivia={ EqualsRange = Some mEquals }) ] - ) - ]) ])) -> - assertRange (2, 7) (2, 8) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with ObjectModel class contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -type Foobar () = - class - end -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Class) - trivia={ EqualsRange = Some mEquals }) ] - ) - ]) ])) -> - assertRange (2, 15) (2, 16) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with Enum contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -type Bear = - | BlackBear = 1 - | PolarBear = 2 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = - SynTypeDefnSimpleRepr.Enum(cases = [ - SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase1 }) - SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase2 }) - ])) - trivia={ EqualsRange = Some mEquals }) ] - ) - ]) ])) -> - assertRange (2, 10) (2, 11) mEquals - assertRange (3, 16) (3, 17) mEqualsEnumCase1 - assertRange (4, 16) (4, 17) mEqualsEnumCase2 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with Union contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -type Shape = - | Square of int - | Rectangle of int * int -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Union _) - trivia={ EqualsRange = Some mEquals }) ] - ) - ]) ])) -> - assertRange (2, 11) (2, 12) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with AutoProperty contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -/// mutable class with auto-properties -type Person(name : string, age : int) = - /// Full name - member val Name = name with get, set -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ ; SynMemberDefn.AutoProperty(equalsRange = mEquals)])) ] - ) - ]) ])) -> - assertRange (5, 20) (5, 21) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with Record contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo = - { Bar : int } - with - member this.Meh (v:int) = this.Bar + v -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr=SynTypeDefnRepr.Simple(simpleRepr= SynTypeDefnSimpleRepr.Record _) - trivia={ WithKeyword = Some mWithKeyword }) ] - ) - ]) ])) -> - assertRange (4, 4) (4, 8) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with Augmentation contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Int32 with - member _.Zero = 0 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation mWithKeyword)) ] - ) - ]) ])) -> - assertRange (2, 11) (2, 15) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynMemberDefn.Interface contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - interface Bar with - member Meh () = () - interface Other -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ SynMemberDefn.ImplicitCtor _ - SynMemberDefn.Interface(withKeyword=Some mWithKeyword) - SynMemberDefn.Interface(withKeyword=None) ])) ] - ) - ]) ])) -> - assertRange (3, 18) (3, 22) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with AutoProperty contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - member val AutoProperty = autoProp with get, set - member val AutoProperty2 = autoProp -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ - SynMemberDefn.AutoProperty(withKeyword=Some mWith) - SynMemberDefn.AutoProperty(withKeyword=None)])) ] - ) - ]) ])) -> - assertRange (3, 39) (3, 43) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with AbstractSlot contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - abstract member Bar : int with get,set -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ - SynMemberDefn.AbstractSlot(slotSig=SynValSig(trivia = { WithKeyword = Some mWith }))])) ] - ) - ]) ])) -> - assertRange (3, 30) (3, 34) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``read-only property in SynMemberDefn.Member contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - // A read-only property. - member this.MyReadProperty with get () = myInternalValue -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = - SynTypeDefnRepr.ObjectModel(members=[ - _ - SynMemberDefn.GetSetMember(Some(SynBinding _), None, _, { WithKeyword = mWith }) ]) - ) ]) - ]) ])) -> - assertRange (4, 31) (4, 35) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``write-only property in SynMemberDefn.Member contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - // A write-only property. - member this.MyWriteOnlyProperty with set (value) = myInternalValue <- value -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = - SynTypeDefnRepr.ObjectModel(members=[ - _ - SynMemberDefn.GetSetMember(None, Some(SynBinding _), _, { WithKeyword = mWith }) ]) - ) ]) - ]) ])) -> - assertRange (4, 36) (4, 40) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``read/write property in SynMemberDefn.Member contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -type Foo() = - // A read-write property. - member this.MyReadWriteProperty - with get () = myInternalValue - and set (value) = myInternalValue <- value -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = - SynTypeDefnRepr.ObjectModel(members=[ - _ - SynMemberDefn.GetSetMember(Some _, Some _, _, { WithKeyword = mWith; AndKeyword = Some mAnd }) ]) - ) ]) - ]) ])) -> - assertRange (5, 8) (5, 12) mWith - assertRange (6, 8) (6, 11) mAnd - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with XmlDoc contains the range of the type keyword`` () = - let parseResults = - getParseResults - """ -/// Doc -// noDoc -type A = B -and C = D -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) - SynTypeDefn(trivia={ TypeKeyword = None }) ] - ) - ]) ])) -> - assertRange (4, 0) (4, 4) mType - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with attribute contains the range of the type keyword`` () = - let parseResults = - getParseResults - """ -[] -// noDoc -type A = B -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) ] - ) - ]) ])) -> - assertRange (4, 0) (4, 4) mType - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with static member with get/set`` () = - let parseResults = - getParseResults - """ -type Foo = - static member ReadWrite2 - with set x = lastUsed <- ("ReadWrite2", x) - and get () = lastUsed <- ("ReadWrite2", 0); 4 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - SynMemberDefn.GetSetMember(Some _, Some _, m, { WithKeyword = mWith - GetKeyword = Some mGet - AndKeyword = Some mAnd - SetKeyword = Some mSet }) - ])) ] - ) - ]) ])) -> - assertRange (4, 8) (4, 12) mWith - assertRange (4, 13) (4, 16) mSet - assertRange (5, 8) (5, 11) mAnd - assertRange (5, 13) (5, 16) mGet - assertRange (3, 4) (5, 54) m - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefn with member with set/get`` () = - let parseResults = - getParseResults - """ -type A() = - member this.Z with set (_:int):unit = () and get():int = 1 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types( - typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - SynMemberDefn.ImplicitCtor _ - SynMemberDefn.GetSetMember(Some (SynBinding(headPat = SynPat.LongIdent(extraId = Some getIdent))), - Some (SynBinding(headPat = SynPat.LongIdent(extraId = Some setIdent))), - m, - { WithKeyword = mWith - GetKeyword = Some mGet - AndKeyword = Some mAnd - SetKeyword = Some mSet }) - ])) ] - ) - ]) ])) -> - Assert.AreEqual("get", getIdent.idText) - Assert.AreEqual("set", setIdent.idText) - assertRange (3, 18) (3, 22) mWith - assertRange (3, 23) (3, 26) mSet - assertRange (3, 23) (3, 26) setIdent.idRange - assertRange (3, 45) (3, 48) mAnd - assertRange (3, 49) (3, 52) mGet - assertRange (3, 49) (3, 52) getIdent.idRange - assertRange (3, 4) (3, 62) m - | _ -> Assert.Fail "Could not get valid AST" - -module SyntaxExpressions = - [] - let ``SynExpr.Do contains the range of the do keyword`` () = - let ast = """let a = - do - foobar - do! - foobarBang -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [ - SynBinding(expr = SynExpr.Sequential(expr1 = SynExpr.Do(_, doRange) ; expr2 = SynExpr.DoBang(_, doBangRange))) - ]) - ]) - ])) -> - assertRange (2, 4) (3, 14) doRange - assertRange (4, 4) (5, 18) doBangRange - | _ -> - Assert.Fail "Could not find SynExpr.Do" - - [] - let ``SynExpr.LetOrUseBang contains the range of the equals sign`` () = - let ast = - """ -comp { - let! x = y - and! z = someFunction () - return () -} -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.App(argExpr = - SynExpr.ComputationExpr(expr = - SynExpr.LetOrUseBang(trivia = { EqualsRange = Some mLetBangEquals } - andBangs = [ SynExprAndBang(trivia= { EqualsRange = mAndBangEquals }) ])))) - ]) - ])) -> - assertRange (3, 11) (3, 12) mLetBangEquals - assertRange (4, 11) (4, 12) mAndBangEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = - let ast = - """ -{ V = v - X = // some comment - someLongFunctionCall - a - b - c } -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Record(recordFields = [ - SynExprRecordField(equalsRange = Some mEqualsV) - SynExprRecordField(equalsRange = Some mEqualsX) - ])) - ]) - ])) -> - assertRange (2, 4) (2, 5) mEqualsV - assertRange (3, 9) (3, 10) mEqualsX - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``inherit SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = - let ast = - """ -{ inherit Exception(msg); X = 1; } -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Record(baseInfo = Some _ ; recordFields = [ - SynExprRecordField(equalsRange = Some mEquals) - ])) - ]) - ])) -> - assertRange (2, 28) (2, 29) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``copy SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = - let ast = - """ -{ foo with - X - = - 12 } -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Record(copyInfo = Some _ ; recordFields = [ - SynExprRecordField(equalsRange = Some mEquals) - ])) - ]) - ])) -> - assertRange (4, 12) (4, 13) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.AnonRecord contains the range of the equals sign in the fields`` () = - let ast = - """ -{| X = 5 - Y = 6 - Z = 7 |} -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.AnonRecd(recordFields = [ - (_, Some mEqualsX, _) - (_, Some mEqualsY, _) - (_, Some mEqualsZ, _) - ])) - ]) - ])) -> - assertRange (2, 5) (2, 6) mEqualsX - assertRange (3, 8) (3, 9) mEqualsY - assertRange (4, 12) (4, 13) mEqualsZ - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.For contains the range of the equals sign`` () = - let ast = - """ -for i = 1 to 10 do - printf "%d " i -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.For(equalsRange = Some mEquals)) - ]) - ])) -> - assertRange (2, 6) (2, 7) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.TryWith contains the range of the try and with keyword`` () = - let ast = - """ -try - x -with -| ex -> y -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.TryWith(trivia={ TryKeyword = mTry; WithKeyword = mWith })) - ]) - ])) -> - assertRange (2, 0) (2, 3) mTry - assertRange (4, 0) (4, 4) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.TryFinally contains the range of the try and with keyword`` () = - let ast = - """ -try - x -finally - () -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.TryFinally(trivia={ TryKeyword = mTry; FinallyKeyword = mFinally })) - ]) - ])) -> - assertRange (2, 0) (2, 3) mTry - assertRange (4, 0) (4, 7) mFinally - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.Match contains the range of the match and with keyword`` () = - let ast = - """ -match x with -| y -> z -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Match(trivia = { MatchKeyword = mMatch; WithKeyword = mWith })) - ]) - ])) -> - assertRange (2, 0) (2, 5) mMatch - assertRange (2, 8) (2, 12) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.MatchBang contains the range of the match and with keyword`` () = - let ast = - """ -match! x with -| y -> z -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.MatchBang(trivia = { MatchBangKeyword = mMatch; WithKeyword = mWith })) - ]) - ])) -> - assertRange (2, 0) (2, 6) mMatch - assertRange (2, 9) (2, 13) mWith - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.ObjExpr contains the range of with keyword`` () = - let ast = - """ -{ new obj() with - member x.ToString() = "INotifyEnumerableInternal" - interface INotifyEnumerableInternal<'T> - interface IEnumerable<_> with - member x.GetEnumerator() = null } -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.ObjExpr(withKeyword=Some mWithObjExpr; extraImpls=[ SynInterfaceImpl(withKeyword=None); SynInterfaceImpl(withKeyword=Some mWithSynInterfaceImpl) ])) - ]) - ])) -> - assertRange (2, 12) (2, 16) mWithObjExpr - assertRange (5, 27) (5, 31) mWithSynInterfaceImpl - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.LetOrUse contains the range of in keyword`` () = - let ast = - getParseResults "let x = 1 in ()" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.LetOrUse(trivia={ InKeyword = Some mIn })) - ]) - ])) -> - assertRange (1, 10) (1, 12) mIn - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.LetOrUse with recursive binding contains the range of in keyword`` () = - let ast = - getParseResults """ -do - let rec f = () - and g = () in - () -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Do(expr = SynExpr.LetOrUse(bindings=[_;_]; trivia={ InKeyword = Some mIn }))) - ]) - ])) -> - assertRange (4, 15) (4, 17) mIn - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``nested SynExpr.LetOrUse contains the range of in keyword`` () = - let ast = - getParseResults """ -let f () = - let x = 1 in // the "in" keyword is available in F# - let y = 2 in - x + y -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [ - SynBinding(expr = - SynExpr.LetOrUse(bindings=[_]; trivia={ InKeyword = Some mIn }; body=SynExpr.LetOrUse(trivia={ InKeyword = Some mInnerIn }))) - ]) - ]) - ])) -> - assertRange (3, 14) (3, 16) mIn - assertRange (4, 14) (4, 16) mInnerIn - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.LetOrUse does not contain the range of in keyword`` () = - let ast = - getParseResults """ -do - let x = 1 - () -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) - ]) - ])) -> - Assert.Pass() - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.LetOrUse where body expr starts with token of two characters does not contain the range of in keyword`` () = - let ast = - getParseResults """ -do - let e1 = e :?> Collections.DictionaryEntry - e1.Key, e1.Value -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) - ]) - ])) -> - Assert.Pass() - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``global keyword as SynExpr`` () = - let ast = - getParseResults """ -global -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.LongIdent(longDotId = SynLongIdent([mangledGlobal], [], [Some (IdentTrivia.OriginalNotation "global")])) - )]) - ])) -> - Assert.AreEqual("`global`", mangledGlobal.idText) - Assert.Pass() - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExprRecordFields contain correct amount of trivia`` () = - let ast = - getParseResults """ - { JobType = EsriBoundaryImport - FileToImport = filePath - State = state - DryRun = args.DryRun } -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Record(recordFields = [ - SynExprRecordField(fieldName = (synLongIdent, _)) - _; _; _ - ])) - ]) - ])) -> - match synLongIdent.IdentsWithTrivia with - | [ _ ] -> Assert.Pass() - | idents -> Assert.Fail $"Expected a single SynIdent, got {idents}" - | _ -> Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``SynExpr.Dynamic does contain ident`` () = - let ast = - getParseResults "x?k" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Dynamic (_, _, SynExpr.Ident(idK) ,mDynamicExpr)) - ]) - ])) -> - Assert.AreEqual("k", idK.idText) - assertRange (1,0) (1, 3) mDynamicExpr - | _ -> Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``SynExpr.Dynamic does contain parentheses`` () = - let ast = - getParseResults "x?(g)" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.Dynamic (_, _, SynExpr.Paren(SynExpr.Ident(idG), lpr, Some rpr, mParen) ,mDynamicExpr)) - ]) - ])) -> - Assert.AreEqual("g", idG.idText) - assertRange (1, 2) (1,3) lpr - assertRange (1, 4) (1,5) rpr - assertRange (1, 2) (1,5) mParen - assertRange (1,0) (1, 5) mDynamicExpr - | _ -> Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``SynExpr.Set with SynExpr.Dynamic`` () = - let ast = - getParseResults "x?v <- 2" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Set( - SynExpr.Dynamic (_, _, SynExpr.Ident(idV) ,mDynamicExpr), - SynExpr.Const _, - mSetExpr - )) - ]) - ])) -> - Assert.AreEqual("v", idV.idText) - assertRange (1,0) (1, 3) mDynamicExpr - assertRange (1,0) (1, 8) mSetExpr - | _ -> Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``SynExpr.Obj with setter`` () = - let ast = - getParseResults """ -[] -type CFoo() = - abstract AbstractClassPropertySet: string with set - -{ new CFoo() with - override this.AbstractClassPropertySet with set (v:string) = () } -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types _ - SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [ - SynMemberDefn.GetSetMember(None, Some _, m, { WithKeyword = mWith; SetKeyword = Some mSet }) - ])) - ]) - ])) -> - assertRange (7, 43) (7, 47) mWith - assertRange (7, 48) (7, 51) mSet - assertRange (7,4) (7, 67) m - | _ -> Assert.Fail $"Could not get valid AST, got {ast}" - - -module Strings = - let getBindingExpressionValue (parseResults: ParsedInput) = - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> - modules |> List.tryPick (fun (SynModuleOrNamespace (decls = decls)) -> - decls |> List.tryPick (fun decl -> - match decl with - | SynModuleDecl.Let (bindings = bindings) -> - bindings |> List.tryPick (fun binding -> - match binding with - | SynBinding.SynBinding (headPat=(SynPat.Named _|SynPat.As(_,SynPat.Named _,_)); expr=e) -> Some e - | _ -> None) - | _ -> None)) - | _ -> None - - let getBindingConstValue parseResults = - match getBindingExpressionValue parseResults with - | Some (SynExpr.Const(c,_)) -> Some c - | _ -> None - - [] - let ``SynConst.String with SynStringKind.Regular`` () = - let parseResults = - getParseResults - """ - let s = "yo" - """ - - match getBindingConstValue parseResults with - | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.Regular - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynConst.String with SynStringKind.Verbatim`` () = - let parseResults = - getParseResults - """ - let s = @"yo" - """ - - match getBindingConstValue parseResults with - | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.Verbatim - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynConst.String with SynStringKind.TripleQuote`` () = - let parseResults = - getParseResults - " - let s = \"\"\"yo\"\"\" - " - - match getBindingConstValue parseResults with - | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.TripleQuote - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynConst.Bytes with SynByteStringKind.Regular`` () = - let parseResults = - getParseResults - """ -let bytes = "yo"B - """ - - match getBindingConstValue parseResults with - | Some (SynConst.Bytes (_, kind, _)) -> kind |> should equal SynByteStringKind.Regular - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynConst.Bytes with SynByteStringKind.Verbatim`` () = - let parseResults = - getParseResults - """ -let bytes = @"yo"B - """ - - match getBindingConstValue parseResults with - | Some (SynConst.Bytes (_, kind, _)) -> kind |> should equal SynByteStringKind.Verbatim - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynExpr.InterpolatedString with SynStringKind.TripleQuote`` () = - let parseResults = - getParseResults - " - let s = $\"\"\"yo {42}\"\"\" - " - - match getBindingExpressionValue parseResults with - | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.TripleQuote - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynExpr.InterpolatedString with SynStringKind.Regular`` () = - let parseResults = - getParseResults - """ - let s = $"yo {42}" - """ - - match getBindingExpressionValue parseResults with - | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.Regular - | _ -> Assert.Fail "Couldn't find const" - - [] - let ``SynExpr.InterpolatedString with SynStringKind.Verbatim`` () = - let parseResults = - getParseResults - """ - let s = $@"Migrate notes of file ""{oldId}"" to new file ""{newId}""." - """ - - match getBindingExpressionValue parseResults with - | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.Verbatim - | _ -> Assert.Fail "Couldn't find const" - -module SynModuleOrNamespace = - [] - let ``DeclaredNamespace range should start at namespace keyword`` () = - let parseResults = - getParseResults - """namespace TypeEquality - -/// A type for witnessing type equality between 'a and 'b -type Teq<'a, 'b> -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r) ])) -> - assertRange (1, 0) (4, 8) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Multiple DeclaredNamespaces should have a range that starts at the namespace keyword`` () = - let parseResults = - getParseResults - """namespace TypeEquality - -/// A type for witnessing type equality between 'a and 'b -type Teq = class end - -namespace Foobar - -let x = 42 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r1) - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r2) ])) -> - assertRange (1, 0) (4, 20) r1 - assertRange (6, 0) (8, 10) r2 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``GlobalNamespace should start at namespace keyword`` () = - let parseResults = - getParseResults - """// foo -// bar -namespace global - -type X = int -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> - assertRange (3, 0) (5, 12) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Module range should start at first attribute`` () = - let parseResults = - getParseResults - """ -[< Foo >] -module Bar - -let s : string = "s" -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> - assertRange (2, 0) (5, 20) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Module should contain module keyword`` () = - let parseResults = - getParseResults - """ -/// this file contains patches to the F# Compiler Service that have not yet made it into -/// published nuget packages. We source-copy them here to have a consistent location for our to-be-removed extensions - -module FsAutoComplete.FCSPatches - -open FSharp.Compiler.Syntax -open FSharp.Compiler.Text -open FsAutoComplete.UntypedAstUtils -open FSharp.Compiler.CodeAnalysis - -module internal SynExprAppLocationsImpl = - let a = 42 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> - assertRange (5, 0) (5, 6) mModule - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Namespace should contain namespace keyword`` () = - let parseResults = - getParseResults - """ -namespace Foo -module Bar = - let a = 42 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> - assertRange (2, 0) (2, 9) mNamespace - | _ -> Assert.Fail "Could not get valid AST" - -module SynConsts = - [] - let ``Measure contains the range of the constant`` () = - let parseResults = - getParseResults - """ -let n = 1.0m -let m = 7.000 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r1), _)) ]) - SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r2), _)) ]) - ]) ])) -> - assertRange (2, 8) (2, 12) r1 - assertRange (3, 8) (3, 13) r2 - | _ -> Assert.Fail "Could not get valid AST" - -module SynModuleOrNamespaceSig = - [] - let ``Range member returns range of SynModuleOrNamespaceSig`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace Foobar - -type Bar = | Bar of string * int -""" - - match parseResults with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ - SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace) as singleModule - ])) -> - assertRange (2,0) (4,32) singleModule.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``GlobalNamespace should start at namespace keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """// foo -// bar -namespace global - -type Bar = | Bar of string * int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> - assertRange (3, 0) (5, 32) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Module range should start at first attribute`` () = - let parseResults = - getParseResultsOfSignatureFile - """ - [< Foo >] -module Bar - -val s : string -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> - assertRange (2, 1) (5, 14) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Module should contain module keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module Bar - -val a: int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> - assertRange (2, 0) (2, 6) mModule - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Namespace should contain namespace keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace Foo -module Bar = - val a: int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> - assertRange (2, 0) (2, 9) mNamespace - | _ -> Assert.Fail "Could not get valid AST" - -module SignatureTypes = - [] - let ``Range of Type should end at end keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace GreatProjectThing - -type Meh = - class - end - - -// foo""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(range = r)]) ])) -> - assertRange (3, 0) (5,11) r - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of SynTypeDefnSig record should end at last member`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace X -type MyRecord = - { Level: int } - member Score : unit -> int""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> - assertRange (2, 0) (4, 30) mTypes - assertRange (2, 5) (4, 30) mSynTypeDefnSig - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of SynTypeDefnSig object model should end at last member`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace X -type MyRecord = - class - end - member Score : unit -> int""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> - assertRange (2, 0) (5, 30) mTypes - assertRange (2, 5) (5, 30) mSynTypeDefnSig - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of SynTypeDefnSig delegate of should start from name`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace Y -type MyFunction = - delegate of int -> string""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes) ]) ])) -> - assertRange (2, 0) (3, 29) mTypes - assertRange (2, 5) (3, 29) mSynTypeDefnSig - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of SynTypeDefnSig simple should end at last val`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace Z -type SomeCollection with - val LastIndex : int - val SomeThingElse : int -> string""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> - assertRange (2, 0) (4, 37) mTypes - assertRange (2, 5) (4, 37) mSynTypeDefnSig - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynTypeDefnSig`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -[] -type MyType = - class - end -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(types = [SynTypeDefnSig.SynTypeDefnSig(range = r)]) as t]) ])) -> - assertRange (4, 0) (7, 7) r - assertRange (4, 0) (7, 7) t.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attributes should be included in recursive types`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -type Foo = - | Bar - -and [] Bang = - internal - { - LongNameBarBarBarBarBarBarBar: int - } - override GetHashCode : unit -> int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([ - SynTypeDefnSig.SynTypeDefnSig(range = r1) - SynTypeDefnSig.SynTypeDefnSig(range = r2) - ], mTypes)]) ])) -> - assertRange (4, 5) (5, 9) r1 - assertRange (7, 4) (12, 42) r2 - assertRange (4, 0) (12, 42) mTypes - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynValSpfn and Member`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -type FooType = - [] // ValSpfn - abstract x : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ - SynModuleOrNamespaceSig(decls = - [ SynModuleSigDecl.Types(types = [ - SynTypeDefnSig.SynTypeDefnSig(typeRepr = - SynTypeDefnSigRepr.ObjectModel(memberSigs = [ - SynMemberSig.Member(range = mr; memberSig = SynValSig(range = mv)) ])) - ]) ]) ])) -> - assertRange (5, 4) (6, 20) mr - assertRange (5, 4) (6, 20) mv - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefnSig with ObjectModel Delegate contains the range of the equals sign`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace Foo - -type X = delegate of string -> string -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals - typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _)) ] - ) - ]) ])) -> - assertRange (4, 7) (4, 8) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefnSig with ObjectModel class contains the range of the equals sign`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -type Foobar = - class - end -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals - typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Class)) ] - ) - ]) ])) -> - assertRange (4, 12) (4, 13) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefnSig with Enum contains the range of the equals sign`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -type Bear = - | BlackBear = 1 - | PolarBear = 2 -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals - typeRepr = SynTypeDefnSigRepr.Simple(repr = - SynTypeDefnSimpleRepr.Enum(cases = [ - SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase1 }) - SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase2 }) - ]) )) ] - ) - ]) ])) -> - assertRange (4, 10) (4, 11) mEquals - assertRange (5, 16) (5, 17) mEqualsEnumCase1 - assertRange (6, 16) (6, 17) mEqualsEnumCase2 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefnSig with Union contains the range of the equals sign`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -type Shape = - | Square of int - | Rectangle of int * int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals - typeRepr = SynTypeDefnSigRepr.Simple(repr = SynTypeDefnSimpleRepr.Union _)) ] - ) - ]) ])) -> - assertRange (4, 11) (4, 12) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynTypeDefnSig should contains the range of the with keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace X - -type Foo with - member Meh : unit -> unit -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules =[ SynModuleOrNamespaceSig(decls =[ - SynModuleSigDecl.Types( - types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple _ - withKeyword=Some mWithKeyword) ] - ) - ]) ])) -> - assertRange (4, 9) (4, 13) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynExceptionSig should contains the range of the with keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace X - -exception Foo with - member Meh : unit -> unit -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Exception( - exnSig=SynExceptionSig(withKeyword = Some mWithKeyword) - ) - ]) ])) -> - assertRange (4, 14) (4, 18) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``memberSig of SynMemberSig.Member should contains the range of the with keyword`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace X - -type Foo = - abstract member Bar : int with get,set -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types( - types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[SynMemberSig.Member(memberSig=SynValSig(trivia = { WithKeyword = Some mWithKeyword }))])) ] - ) - ]) ])) -> - assertRange (5, 30) (5, 34) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynExceptionDefnRepr and SynExceptionSig`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module internal FSharp.Compiler.ParseHelpers - -// The error raised by the parse_error_rich function, which is called by the parser engine -[] -exception SyntaxError of obj * range: range - - -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ - SynModuleOrNamespaceSig(decls=[ - SynModuleSigDecl.Exception( - SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) - ] ) ])) -> - assertRange (5, 0) (6, 43) mSynExceptionDefnRepr - assertRange (5, 0) (6, 43) mSynExceptionSig - assertRange (5, 0) (6, 43) mException - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of members should be included in SynExceptionSig and SynModuleSigDecl.Exception`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module internal FSharp.Compiler.ParseHelpers - -exception SyntaxError of obj * range: range with - member Meh : string -> int - -open Foo -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ - SynModuleOrNamespaceSig(decls=[ - SynModuleSigDecl.Exception( - SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) - SynModuleSigDecl.Open _ - ] ) ])) -> - assertRange (4, 0) (4, 43) mSynExceptionDefnRepr - assertRange (4, 0) (5, 30) mSynExceptionSig - assertRange (4, 0) (5, 30) mException - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Val keyword is present in SynValSig`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module Meh - -[] -// meh -val a : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ - SynModuleOrNamespaceSig(decls=[ - SynModuleSigDecl.Val(valSig = SynValSig(trivia = { ValKeyword = Some mVal })) - ] ) ])) -> - assertRange (6, 0) (6, 3) mVal - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Equals token is present in SynValSig value`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module Meh - -val a : int = 9 -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ - SynModuleOrNamespaceSig(decls=[ - SynModuleSigDecl.Val(valSig = SynValSig(trivia = { EqualsRange = Some mEquals }); range = mVal) - ] ) ])) -> - assertRange (4, 12) (4, 13) mEquals - assertRange (4, 0) (4, 15) mVal - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Equals token is present in SynValSig member`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -module Meh - -type X = - member a : int = 10 -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ - SynModuleOrNamespaceSig(decls=[ - SynModuleSigDecl.Types(types = [ - SynTypeDefnSig(typeRepr = SynTypeDefnSigRepr.ObjectModel(memberSigs = [ - SynMemberSig.Member(memberSig = SynValSig(trivia = { EqualsRange = Some mEquals }); range = mMember) - ])) - ]) - ] ) ])) -> - assertRange (5, 19) (5, 20) mEquals - assertRange (5, 4) (5, 23) mMember - | _ -> Assert.Fail "Could not get valid AST" - -module SynMatchClause = - [] - let ``Range of single SynMatchClause`` () = - let parseResults = - getParseResults - """ -try - let content = tryDownloadFile url - Some content -with ex -> - Infrastructure.ReportWarning ex - None""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) - ]) ])) -> - assertRange (5, 5) (7, 8) range - assertRange (5, 5) (7, 8) clause.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of multiple SynMatchClause`` () = - let parseResults = - getParseResults - """ -try - let content = tryDownloadFile url - Some content -with -| ex -> - Infrastructure.ReportWarning ex - None -| exx -> - None""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = r1) as clause1 - SynMatchClause(range = r2) as clause2 ])) - ]) ])) -> - assertRange (6, 2) (8, 8) r1 - assertRange (6, 2) (8, 8) clause1.Range - - assertRange (9, 2) (10, 8) r2 - assertRange (9, 2) (10, 8) clause2.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of single SynMatchClause followed by bar`` () = - let parseResults = - getParseResults - """ -try - let content = tryDownloadFile url - Some content -with -| ex -> - () -| """ - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) - ]) ])) -> - assertRange (6, 2) (7, 6) range - assertRange (6, 2) (7, 6) clause.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of single SynMatchClause with missing body`` () = - let parseResults = - getParseResults - """ -try - let content = tryDownloadFile url - Some content -with -| ex ->""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) - ]) ])) -> - assertRange (6, 2) (6, 4) range - assertRange (6, 2) (6, 4) clause.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of single SynMatchClause with missing body and when expr`` () = - let parseResults = - getParseResults - """ -try - let content = tryDownloadFile url - Some content -with -| ex when (isNull ex) ->""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) - ]) ])) -> - assertRange (6, 2) (6, 21) range - assertRange (6, 2) (6, 21) clause.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of arrow in SynMatchClause`` () = - let parseResults = - getParseResults - """ -match foo with -| Bar bar -> ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) - ]) ])) -> - assertRange (3, 10) (3, 12) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of arrow in SynMatchClause with when clause`` () = - let parseResults = - getParseResults - """ -match foo with -| Bar bar when (someCheck bar) -> ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) - ]) ])) -> - assertRange (3, 31) (3, 33) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of bar in a single SynMatchClause in SynExpr.Match`` () = - let parseResults = - getParseResults - """ -match foo with -| Bar bar when (someCheck bar) -> ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) - ]) ])) -> - assertRange (3, 0) (3, 1) mBar - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of bar in multiple SynMatchClauses in SynExpr.Match`` () = - let parseResults = - getParseResults - """ -match foo with -| Bar bar when (someCheck bar) -> () -| Far too -> near ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) - SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) - ]) ])) -> - assertRange (3, 0) (3, 1) mBar1 - assertRange (4, 0) (4, 1) mBar2 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of bar in a single SynMatchClause in SynExpr.TryWith`` () = - let parseResults = - getParseResults - """ -try - foo () -with -| exn -> ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) - ]) ])) -> - assertRange (5, 0) (5, 1) mBar - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``No range of bar in a single SynMatchClause in SynExpr.TryWith`` () = - let parseResults = - getParseResults - """ -try - foo () -with exn -> - // some comment - ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = None }) ])) - ]) ])) -> - Assert.Pass() - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of bar in a multiple SynMatchClauses in SynExpr.TryWith`` () = - let parseResults = - getParseResults - """ -try - foo () -with -| IOException as ioex -> - // some comment - () -| ex -> ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) - SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) - ]) ])) -> - assertRange (5, 0) (5, 1) mBar1 - assertRange (8, 0) (8, 1) mBar2 - | _ -> Assert.Fail "Could not get valid AST" - -module SourceIdentifiers = - [] - let ``__LINE__`` () = - let parseResults = - getParseResults - """ -__LINE__""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__LINE__", "2", range), _)) - ]) ])) -> - assertRange (2, 0) (2, 8) range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``__SOURCE_DIRECTORY__`` () = - let parseResults = - getParseResults - """ -__SOURCE_DIRECTORY__""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_DIRECTORY__", _, range), _)) - ]) ])) -> - assertRange (2, 0) (2, 20) range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``__SOURCE_FILE__`` () = - let parseResults = - getParseResults - """ -__SOURCE_FILE__""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_FILE__", _, range), _)) - ]) ])) -> - assertRange (2, 0) (2, 15) range - | _ -> Assert.Fail "Could not get valid AST" - -module NestedModules = - - [] - let ``Range of attribute should be included in SynModuleSigDecl.NestedModule`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace SomeNamespace - -[] -module Nested = - val x : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.NestedModule _ as nm - ]) as sigModule ])) -> - assertRange (4, 0) (6, 15) nm.Range - assertRange (2, 0) (6, 15) sigModule.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynModuleDecl.NestedModule`` () = - let parseResults = - getParseResults - """ -module TopLevel - -[] -module Nested = - ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.NestedModule _ as nm - ]) ])) -> - assertRange (4, 0) (6, 6) nm.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present`` () = - let parseResults = - getParseResults - """ -module X = - () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) - ]) ])) -> - assertRange (2, 0) (2, 6) mModule - assertRange (2, 9) (2, 10) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present, signature file`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace Foo - -module X = - val bar : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) - ]) ])) -> - assertRange (4, 0) (4, 6) mModule - assertRange (4, 9) (4, 10) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of nested module in signature file should end at the last SynModuleSigDecl`` () = - let parseResults = - getParseResultsOfSignatureFile - """namespace Microsoft.FSharp.Core - -open System -open System.Collections.Generic -open Microsoft.FSharp.Core -open Microsoft.FSharp.Collections -open System.Collections - - -module Tuple = - - type Tuple<'T1,'T2,'T3,'T4> = - interface IStructuralEquatable - interface IStructuralComparable - interface IComparable - new : 'T1 * 'T2 * 'T3 * 'T4 -> Tuple<'T1,'T2,'T3,'T4> - member Item1 : 'T1 with get - member Item2 : 'T2 with get - member Item3 : 'T3 with get - member Item4 : 'T4 with get - - -module Choice = - - /// Helper types for active patterns with 6 choices. - [] - [] - type Choice<'T1,'T2,'T3,'T4,'T5,'T6> = - /// Choice 1 of 6 choices - | Choice1Of6 of 'T1 - /// Choice 2 of 6 choices - | Choice2Of6 of 'T2 - /// Choice 3 of 6 choices - | Choice3Of6 of 'T3 - /// Choice 4 of 6 choices - | Choice4Of6 of 'T4 - /// Choice 5 of 6 choices - | Choice5Of6 of 'T5 - /// Choice 6 of 6 choices - | Choice6Of6 of 'T6 - - - -/// Basic F# Operators. This module is automatically opened in all F# code. -[] -module Operators = - - type ``[,]``<'T> with - [] - /// Get the length of an array in the first dimension - member Length1 : int - [] - /// Get the length of the array in the second dimension - member Length2 : int - [] - /// Get the lower bound of the array in the first dimension - member Base1 : int - [] - /// Get the lower bound of the array in the second dimension - member Base2 : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Open _ - SynModuleSigDecl.Open _ - SynModuleSigDecl.Open _ - SynModuleSigDecl.Open _ - SynModuleSigDecl.Open _ - SynModuleSigDecl.NestedModule(range=mTupleModule; moduleDecls=[ SynModuleSigDecl.Types([ - SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(range=mTupleObjectModel); range=mTupleType) - ], mTupleTypes) ]) - SynModuleSigDecl.NestedModule(range=mChoiceModule) - SynModuleSigDecl.NestedModule(range=mOperatorsModule; moduleDecls=[ SynModuleSigDecl.Types([ - SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple(range=mAugmentationSimple); range=mAugmentation) - ], mOperatorsTypes) ]) - ]) ])) -> - assertRange (10, 0) (20, 35) mTupleModule - assertRange (12, 4) (20, 35) mTupleTypes - assertRange (12, 9) (20, 35) mTupleType - assertRange (13, 8) (20, 35) mTupleObjectModel - assertRange (23, 0) (40, 25) mChoiceModule - assertRange (44, 0) (60, 26) mOperatorsModule - assertRange (48, 4) (60, 26) mOperatorsTypes - assertRange (48, 9) (60, 26) mAugmentation - assertRange (48, 9) (60, 26) mAugmentationSimple - | _ -> Assert.Fail "Could not get valid AST" - -module SynBindings = - [] - let ``Range of attribute should be included in SynModuleDecl.Let`` () = - let parseResults = - getParseResults - """ -[] -let a = 0""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt - ]) ])) -> - assertRange (2, 0) (3, 5) mb - assertRange (2, 0) (3, 9) lt.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute between let keyword and pattern should be included in SynModuleDecl.Let`` () = - let parseResults = - getParseResults - """ -let [] (A x) = 1""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt - ]) ])) -> - assertRange (2, 4) (2, 21) mb - assertRange (2, 0) (2, 25) lt.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynMemberDefn.LetBindings`` () = - let parseResults = - getParseResults - """ -type Bar = - [] - let x = 8""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.LetBindings(bindings = [SynBinding(range = mb)]) as m]))]) - ]) ])) -> - assertRange (3, 4) (4, 9) mb - assertRange (3, 4) (4, 13) m.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in SynMemberDefn.Member`` () = - let parseResults = - getParseResults - """ -type Bar = - [] - member this.Something () = ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) - ]) ])) -> - assertRange (3, 4) (4, 28) mb - assertRange (3, 4) (4, 33) m.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in binding of SynExpr.ObjExpr`` () = - let parseResults = - getParseResults - """ -{ new System.Object() with - [] - member x.ToString() = "F#" }""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [SynMemberDefn.Member(memberDefn=SynBinding(range = mb))])) - ]) ])) -> - assertRange (3, 4) (4, 23) mb - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in constructor SynMemberDefn.Member`` () = - let parseResults = - getParseResults - """ -type Tiger = - [] - new () = ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) - ]) ])) -> - assertRange (3, 4) (4, 10) mb - assertRange (3, 4) (4, 15) m.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in constructor SynMemberDefn.Member, optAsSpec`` () = - let parseResults = - getParseResults - """ -type Tiger = - [] - new () as tony = ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) - ]) ])) -> - assertRange (3, 4) (4, 18) mb - assertRange (3, 4) (4, 23) m.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in secondary constructor`` () = - let parseResults = - getParseResults - """ -type T() = - new () = - T () - - internal new () = - T () - - [] - new () = - T ()""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - SynMemberDefn.ImplicitCtor _ - SynMemberDefn.Member(memberDefn = SynBinding(range = mb1)) as m1 - SynMemberDefn.Member(memberDefn = SynBinding(range = mb2)) as m2 - SynMemberDefn.Member(memberDefn = SynBinding(range = mb3)) as m3 - ]))]) - ]) ])) -> - assertRange (3, 4) (3, 10) mb1 - assertRange (3, 4) (4, 12) m1.Range - assertRange (6, 4) (6, 19) mb2 - assertRange (6, 4) (7, 12) m2.Range - assertRange (9, 4) (10, 10) mb3 - assertRange (9, 4) (11, 12) m3.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in write only SynMemberDefn.Member property`` () = - let parseResults = - getParseResults - """ -type Crane = - [] - member this.MyWriteOnlyProperty with set (value) = myInternalValue <- value""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = - [SynMemberDefn.GetSetMember(memberDefnForSet = Some (SynBinding(range = mb))) as m]))]) - ]) ])) -> - assertRange (3, 4) (4, 52) mb - assertRange (3, 4) (4, 79) m.Range - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of attribute should be included in full SynMemberDefn.Member property`` () = - let parseResults = - getParseResults - """ -type Bird = - [] - member this.TheWord - with get () = myInternalValue - and set (value) = myInternalValue <- value""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - SynMemberDefn.GetSetMember(Some (SynBinding(range = mb1)), Some (SynBinding(range = mb2)), m, _) - ]))]) - ]) ])) -> - assertRange (3, 4) (5, 19) mb1 - assertRange (3, 4) (6, 23) mb2 - assertRange (3, 4) (6, 50) m - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in SynModuleDecl.Let binding`` () = - let parseResults = - getParseResults "let v = 12" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) - ]) ])) -> - assertRange (1, 6) (1, 7) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in SynModuleDecl.Let binding, typed`` () = - let parseResults = - getParseResults "let v : int = 12" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) - ]) ])) -> - assertRange (1, 12) (1, 13) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in local Let binding`` () = - let parseResults = - getParseResults - """ -do - let z = 2 - () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) - ]) ])) -> - assertRange (3, 10) (3, 11) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in local Let binding, typed`` () = - let parseResults = - getParseResults - """ -do - let z: int = 2 - () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) - ]) ])) -> - assertRange (3, 15) (3, 16) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in member binding`` () = - let parseResults = - getParseResults - """ -type X() = - member this.Y = z -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) - ]) ])) -> - assertRange (3, 18) (3, 19) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in member binding, with parameters`` () = - let parseResults = - getParseResults - """ -type X() = - member this.Y () = z -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) - ]) ])) -> - assertRange (3, 21) (3, 22) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in member binding, with return type`` () = - let parseResults = - getParseResults - """ -type X() = - member this.Y () : string = z -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) - ]) ])) -> - assertRange (3, 30) (3, 31) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of equal sign should be present in property`` () = - let parseResults = - getParseResults - """ -type Y() = - member this.MyReadWriteProperty - with get () = myInternalValue - and set (value) = myInternalValue <- value -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - _ - SynMemberDefn.GetSetMember( - Some(SynBinding(trivia={ EqualsRange = Some eqGetM })), - Some(SynBinding(trivia={ EqualsRange = Some eqSetM })), _, _) - ]))]) - ]) ])) -> - assertRange (4, 20) (4, 21) eqGetM - assertRange (5, 24) (5, 25) eqSetM - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of let keyword should be present in SynModuleDecl.Let binding`` () = - let parseResults = - getParseResults "let v = 12" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) - ]) ])) -> - assertRange (1, 0) (1, 3) mLet - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of let keyword should be present in SynModuleDecl.Let binding with attributes`` () = - let parseResults = - getParseResults """ -/// XmlDoc -[] -// some comment -let v = 12 -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) - ]) ])) -> - assertRange (5, 0) (5, 3) mLet - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Range of let keyword should be present in SynExpr.LetOrUse binding`` () = - let parseResults = - getParseResults """ -let a = - let b c = d - () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(expr=SynExpr.LetOrUse(bindings=[SynBinding(trivia={ LetKeyword = Some mLet })]))]) - ]) ])) -> - assertRange (3, 4) (3, 7) mLet - | _ -> Assert.Fail "Could not get valid AST" - -module ParsedHashDirective = - [] - let ``SourceIdentifier as ParsedHashDirectiveArgument`` () = - let parseResults = - getParseResults - "#I __SOURCE_DIRECTORY__" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.SourceIdentifier(c,_,m) ] , _), _) - ]) ])) -> - Assert.AreEqual("__SOURCE_DIRECTORY__", c) - assertRange (1, 3) (1, 23) m - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Regular String as ParsedHashDirectiveArgument`` () = - let parseResults = - getParseResults - "#I \"/tmp\"" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Regular, m) ] , _), _) - ]) ])) -> - Assert.AreEqual("/tmp", v) - assertRange (1, 3) (1, 9) m - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Verbatim String as ParsedHashDirectiveArgument`` () = - let parseResults = - getParseResults - "#I @\"C:\\Temp\"" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Verbatim, m) ] , _), _) - ]) ])) -> - Assert.AreEqual("C:\\Temp", v) - assertRange (1, 3) (1, 13) m - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Triple quote String as ParsedHashDirectiveArgument`` () = - let parseResults = - getParseResults - "#nowarn \"\"\"40\"\"\"" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.HashDirective(ParsedHashDirective("nowarn", [ ParsedHashDirectiveArgument.String(v, SynStringKind.TripleQuote, m) ] , _), _) - ]) ])) -> - Assert.AreEqual("40", v) - assertRange (1, 8) (1, 16) m - | _ -> Assert.Fail "Could not get valid AST" - -module Lambdas = - [] - let ``Lambda with two parameters gives correct body`` () = - let parseResults = - getParseResults - "fun a b -> x" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Named _], SynExpr.Ident ident)) - ) - ]) ])) -> - Assert.AreEqual("x", ident.idText) - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Lambda with wild card parameter gives correct body`` () = - let parseResults = - getParseResults - "fun a _ b -> x" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Wild _; SynPat.Named _], SynExpr.Ident ident)) - ) - ]) ])) -> - Assert.AreEqual("x", ident.idText) - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Lambda with tuple parameter with wild card gives correct body`` () = - let parseResults = - getParseResults - "fun a (b, _) c -> x" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Paren(SynPat.Tuple _,_); SynPat.Named _], SynExpr.Ident ident)) - ) - ]) ])) -> - Assert.AreEqual("x", ident.idText) - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Lambda with wild card that returns a lambda gives correct body`` () = - let parseResults = - getParseResults - "fun _ -> fun _ -> x" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Ident ident)))) - ) - ]) ])) -> - Assert.AreEqual("x", ident.idText) - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Simple lambda has arrow range`` () = - let parseResults = - getParseResults - "fun x -> x" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) - ) - ]) ])) -> - assertRange (1, 6) (1, 8) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Multiline lambda has arrow range`` () = - let parseResults = - getParseResults - "fun x y z - -> - x * y * z" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) - ) - ]) ])) -> - assertRange (2, 28) (2, 30) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Destructed lambda has arrow range`` () = - let parseResults = - getParseResults - "fun { X = x } -> x * 2" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) - ) - ]) ])) -> - assertRange (1, 14) (1, 16) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Tuple in lambda has arrow range`` () = - let parseResults = - getParseResults - "fun (x, _) -> x * 3" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) - ) - ]) ])) -> - assertRange (1, 11) (1, 13) mArrow - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Complex arguments lambda has arrow range`` () = - let parseResults = - getParseResults - "fun (x, _) - ({ Y = h::_ }) - (SomePattern(z)) - -> - x * y + z" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) - ) - ]) ])) -> - assertRange (4, 4) (4, 6) mArrow - | _ -> Assert.Fail "Could not get valid AST" - -module IfThenElse = - [] - let ``If keyword in IfThenElse`` () = - let parseResults = - getParseResults - "if a then b" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = None }) - ) - ]) ])) -> - assertRange (1, 0) (1, 2) mIfKw - assertRange (1, 5) (1, 9) mThenKw - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Else keyword in simple IfThenElse`` () = - let parseResults = - getParseResults - "if a then b else c" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr =SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) - ) - ]) ])) -> - assertRange (1, 0) (1, 2) mIfKw - assertRange (1, 5) (1, 9) mThenKw - assertRange (1, 12) (1, 16) mElse - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``If, Then and Else keyword on separate lines`` () = - let parseResults = - getParseResults - """ -if a -then b -else c""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) - ) - ]) ])) -> - assertRange (2, 0) (2, 2) mIfKw - assertRange (3, 0) (3, 4) mThenKw - assertRange (4, 0) (4, 4) mElse - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Nested elif in IfThenElse`` () = - let parseResults = - getParseResults - """ -if a then - b -elif c then d""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = None } - elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true }))) - ) - ]) ])) -> - assertRange (2, 0) (2, 2) mIfKw - assertRange (2, 5) (2, 9) mThenKw - assertRange (4, 0) (4, 4) mElif - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Nested else if in IfThenElse`` () = - let parseResults = - getParseResults - """ -if a then - b -else - if c then d""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } - elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) - ) - ]) ])) -> - assertRange (2, 0) (2, 2) mIfKw - assertRange (2, 5) (2, 9) mThenKw - assertRange (4, 0) (4, 4) mElse - assertRange (5, 4) (5, 6) mElseIf - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Nested else if on the same line in IfThenElse`` () = - let parseResults = - getParseResults - """ -if a then - b -else if c then - d""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } - elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) - ) - ]) ])) -> - assertRange (2, 0) (2, 2) mIfKw - assertRange (2, 5) (2, 9) mThenKw - assertRange (4, 0) (4, 4) mElse - assertRange (4, 5) (4, 7) mElseIf - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Deeply nested IfThenElse`` () = - let parseResults = - getParseResults - """ -if a then - b -elif c then - d -else - if e then - f - else - g""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = None } - elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true; ElseKeyword = Some mElse1 } - elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mIf2; IsElif = false; ElseKeyword = Some mElse2 })))))) - ]) ])) -> - assertRange (2, 0) (2, 2) mIf1 - assertRange (4, 0) (4, 4) mElif - assertRange (6, 0) (6, 4) mElse1 - assertRange (7, 8) (7, 10) mIf2 - assertRange (9, 8) (9, 12) mElse2 - - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``Comment between else and if`` () = - let parseResults = - getParseResults - """ -if a then - b -else (* some long comment here *) if c then - d""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = Some mElse } - elseExpr = Some (SynExpr.IfThenElse(trivia = { IfKeyword = mIf2; IsElif = false })))) - ]) ])) -> - assertRange (2, 0) (2, 2) mIf1 - assertRange (4, 0) (4, 4) mElse - assertRange (4, 34) (4, 36) mIf2 - - | _ -> Assert.Fail "Could not get valid AST" - -module UnionCases = - [] - let ``Union Case fields can have comments`` () = - let ast = """ -type Foo = -/// docs for Thing -| Thing of - /// docs for first - first: string * - /// docs for anon field - bool -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ - SynUnionCase.SynUnionCase (caseType = SynUnionCaseKind.Fields [ - SynField.SynField(xmlDoc = firstXml) - SynField.SynField(xmlDoc = anonXml) - ]) - ]))) - ], _) - ]) - ])) -> - let firstDocs = firstXml.ToXmlDoc(false, None).GetXmlText() - let anonDocs = anonXml.ToXmlDoc(false, None).GetXmlText() - - let nl = Environment.NewLine - - Assert.AreEqual($"{nl} docs for first{nl}", firstDocs) - Assert.AreEqual($"{nl} docs for anon field{nl}", anonDocs) - - | _ -> - failwith "Could not find SynExpr.Do" - - [] - let ``single SynUnionCase has bar range`` () = - let ast = """ -type Foo = | Bar of string -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ - SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar }) - ]))) - ], _) - ]) - ])) -> - assertRange (2, 11) (2, 12) mBar - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``multiple SynUnionCases have bar range`` () = - let ast = """ -type Foo = - | Bar of string - | Bear of int -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ - SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar1 }) - SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar2 }) - ]))) - ], _) - ]) - ])) -> - assertRange (3, 4) (3, 5) mBar1 - assertRange (4, 4) (4, 5) mBar2 - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``single SynUnionCase without bar`` () = - let ast = """ -type Foo = Bar of string -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ - SynUnionCase.SynUnionCase (trivia = { BarRange = None }) - ]))) - ], _) - ]) - ])) -> - Assert.Pass() - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``private keyword has range`` () = - let ast = """ -type Currency = - // Temporary fix until a new Thoth.Json.Net package is released - // See https://github.com/MangelMaxime/Thoth/pull/70 - -#if !FABLE_COMPILER - private -#endif - | Code of string -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union( - accessibility = Some (SynAccess.Private mPrivate) - unionCases = [ SynUnionCase.SynUnionCase _ ]))) - ], _) - ]) - ])) -> - assertRange (7, 4) (7, 11) mPrivate - | _ -> - Assert.Fail "Could not get valid AST" - -module EnumCases = - [] - let ``single SynEnumCase has bar range`` () = - let ast = """ -type Foo = | Bar = 1 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ - SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar; EqualsRange = mEquals }) - ]))) - ], _) - ]) - ])) -> - assertRange (2, 11) (2, 12) mBar - assertRange (2, 17) (2, 18) mEquals - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``multiple SynEnumCases have bar range`` () = - let ast = """ -type Foo = - | Bar = 1 - | Bear = 2 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ - SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar1; EqualsRange = mEquals1 }) - SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar2; EqualsRange = mEquals2 }) - ]))) - ], _) - ]) - ])) -> - assertRange (3, 4) (3, 5) mBar1 - assertRange (3, 10) (3, 11) mEquals1 - assertRange (4, 4) (4, 5) mBar2 - assertRange (4, 11) (4, 12) mEquals2 - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``single SynEnumCase without bar`` () = - let ast = """ -type Foo = Bar = 1 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ - SynEnumCase.SynEnumCase (trivia = { BarRange = None; EqualsRange = mEquals }) - ]))) - ], _) - ]) - ])) -> - assertRange (2, 15) (2, 16) mEquals - | _ -> - Assert.Fail "Could not get valid AST" - -module Patterns = - [] - let ``SynPat.Record contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -match x with -| { Foo = bar } -> () -| _ -> () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Record(fieldPats = [ (_, mEquals, _) ])) ; _ ]) - ) - ]) ])) -> - assertRange (3, 8) (3, 9) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynArgPats.NamePatPairs contains the range of the equals sign`` () = - let parseResults = - getParseResults - """ -match x with -| X(Y = y) -> y -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.LongIdent(argPats = SynArgPats.NamePatPairs(pats = [ _, mEquals ,_ ])))]) - ) - ]) ])) -> - assertRange (3, 7) (3, 8) mEquals - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynPat.Or contains the range of the bar`` () = - let parseResults = - getParseResults - """ -match x with -| A -| B -> () -| _ -> () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Or(trivia={ BarRange = mBar })) ; _ ]) - ) - ]) ])) -> - assertRange (4, 0) (4, 1) mBar - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``:: operator in SynPat.LongIdent`` () = - let parseResults = - getParseResults - """ -let (head::tail) = [ 1;2;4] -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let( - bindings = [ SynBinding(headPat = SynPat.Paren(SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ])), _)) ] - ) - ]) ])) -> - Assert.AreEqual("op_ColonColon", opColonColonIdent.idText) - | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" - - [] - let ``:: operator in match pattern`` () = - let parseResults = - getParseResults - """ -match x with -| (head) :: (tail) -> () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Match(clauses = [ - SynMatchClause(pat = SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ]))) - ]) - ) - ]) ])) -> - Assert.AreEqual("op_ColonColon", opColonColonIdent.idText) - | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" - -module Exceptions = - [] - let ``SynExceptionDefn should contains the range of the with keyword`` () = - let parseResults = - getParseResults - """ -namespace X - -exception Foo with - member Meh () = () -""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace(decls = [ - SynModuleDecl.Exception( - exnDefn=SynExceptionDefn(withKeyword = Some mWithKeyword) - ) - ]) ])) -> - assertRange (4, 14) (4, 18) mWithKeyword - | _ -> Assert.Fail "Could not get valid AST" - -module SynMemberFlags = - [] - let ``SynMemberSig.Member has correct keywords`` () = - let parseResults = - getParseResultsOfSignatureFile - """ -namespace X - -type Y = - abstract A : int - abstract member B : double - static member C : string - member D : int - override E : int - default F : int -""" - - match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Types(types =[ - SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[ - SynMemberSig.Member(flags={ Trivia= { AbstractRange = Some mAbstract1 } }) - SynMemberSig.Member(flags={ Trivia= { AbstractRange = Some mAbstract2 - MemberRange = Some mMember1 } }) - SynMemberSig.Member(flags={ Trivia= { StaticRange = Some mStatic3 - MemberRange = Some mMember3 } }) - SynMemberSig.Member(flags={ Trivia= { MemberRange = Some mMember4 } }) - SynMemberSig.Member(flags={ Trivia= { OverrideRange = Some mOverride5 } }) - SynMemberSig.Member(flags={ Trivia= { DefaultRange = Some mDefault6 } }) - ])) - ]) - ]) ])) -> - assertRange (5, 4) (5, 12) mAbstract1 - assertRange (6, 4) (6, 12) mAbstract2 - assertRange (6, 13) (6, 19) mMember1 - assertRange (7, 4) (7, 10) mStatic3 - assertRange (7, 11) (7, 17) mMember3 - assertRange (8, 4) (8, 10) mMember4 - assertRange (9, 4) (9, 12) mOverride5 - assertRange (10, 4) (10, 11) mDefault6 - | _ -> Assert.Fail "Could not get valid AST" - - [] - let ``SynMemberDefn.AbstractSlot has correct keyword`` () = - let ast = """ -type Foo = - abstract X : int - abstract member Y: int -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ - SynMemberDefn.AbstractSlot(flags={ Trivia = { AbstractRange = Some mAbstract1 } }) - SynMemberDefn.AbstractSlot(flags={ Trivia = { AbstractRange = Some mAbstract2 - MemberRange = Some mMember2 } }) - ])) - ], _) - ]) - ])) -> - assertRange (3, 4) (3, 12) mAbstract1 - assertRange (4, 4) (4, 12) mAbstract2 - assertRange (4, 13) (4, 19) mMember2 - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``SynMemberDefn.AutoProperty has correct keyword`` () = - let ast = """ -type Foo = - static member val W : int = 1 - member val X : int = 1 - override val Y : int = 2 - default val Z : int = 1 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ - SynMemberDefn.AutoProperty(memberFlags= mkFlags1) - SynMemberDefn.AutoProperty(memberFlags= mkFlags2) - SynMemberDefn.AutoProperty(memberFlags= mkFlags3) - SynMemberDefn.AutoProperty(memberFlags= mkFlags4) - ])) - ], _) - ]) - ])) -> - let ({ Trivia = flagsTrivia1 } : SynMemberFlags) = mkFlags1 SynMemberKind.Member - assertRange (3, 4) (3, 10) flagsTrivia1.StaticRange.Value - assertRange (3, 11) (3, 17) flagsTrivia1.MemberRange.Value - - let ({ Trivia = flagsTrivia2 } : SynMemberFlags) = mkFlags2 SynMemberKind.Member - assertRange (4, 4) (4, 10) flagsTrivia2.MemberRange.Value - - let ({ Trivia = flagsTrivia3 } : SynMemberFlags) = mkFlags3 SynMemberKind.Member - assertRange (5, 4) (5, 12) flagsTrivia3.OverrideRange.Value - - let ({ Trivia = flagsTrivia4 } : SynMemberFlags) = mkFlags4 SynMemberKind.Member - assertRange (6, 4) (6, 11) flagsTrivia4.DefaultRange.Value - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``SynMemberDefn.Member SynValData has correct keyword`` () = - let ast = """ -type Foo = - static member this.B() = () - member this.A() = () - override this.C() = () - default this.D() = () -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types ([ - SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { StaticRange = Some mStatic1 - MemberRange = Some mMember1 } }))) - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember2 } }))) - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { OverrideRange = Some mOverride3 } }))) - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { DefaultRange = Some mDefaultRange4 } }))) - ])) - ], _) - ]) - ])) -> - assertRange (3, 4) (3, 10) mStatic1 - assertRange (3, 11) (3, 17) mMember1 - assertRange (4, 4) (4, 10) mMember2 - assertRange (5, 4) (5, 12) mOverride3 - assertRange (6, 4) (6, 11) mDefaultRange4 - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``SynExpr.Obj members have correct keywords`` () = - let ast = """ -let meh = - { new Interface with - override this.Foo () = () - member this.Bar () = () - interface SomethingElse with - member this.Blah () = () } -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let (bindings = [ - SynBinding(expr=SynExpr.ObjExpr( - members=[ - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { OverrideRange = Some mOverride1 } }))) - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember2 } }))) - ] - extraImpls=[ SynInterfaceImpl(members=[ - SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember3 } }))) - ]) ])) - ]) - ]) ])) -> - assertRange (4, 8) (4, 16) mOverride1 - assertRange (5, 8) (5, 14) mMember2 - assertRange (7, 8) (7, 14) mMember3 - | _ -> - Assert.Fail "Could not get valid AST" - -module ComputationExpressions = - [] - let ``SynExprAndBang range starts at and! and ends after expression`` () = - let ast = - getParseResults """ -async { - let! bar = getBar () - - and! foo = getFoo () - - return bar -} -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ - SynExprAndBang(range = mAndBang) - ])))) - ]) - ])) -> - assertRange (5, 4) (5, 24) mAndBang - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``multiple SynExprAndBang have range that starts at and! and ends after expression`` () = - let ast = - getParseResults """ -async { - let! bar = getBar () - and! foo = getFoo () in - and! meh = getMeh () - return bar -} -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ - SynExprAndBang(range = mAndBang1; trivia={ InKeyword = Some mIn }) - SynExprAndBang(range = mAndBang2) - ])))) - ]) - ])) -> - assertRange (4, 4) (4, 24) mAndBang1 - assertRange (4, 25) (4, 27) mIn - assertRange (5, 4) (5, 24) mAndBang2 - | _ -> - Assert.Fail "Could not get valid AST" - -module ConditionalDirectives = - let private getDirectiveTrivia isSignatureFile source = - let ast = (if isSignatureFile then getParseResultsOfSignatureFile else getParseResults) source - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(trivia = { ConditionalDirectives = trivia })) - | ParsedInput.SigFile(ParsedSigFileInput(trivia = { ConditionalDirectives = trivia })) -> trivia - - [] - let ``single #if / #endif`` () = - let trivia = - getDirectiveTrivia false """ -let v = - #if DEBUG - () - #endif - 42 -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr, mIf) - ConditionalDirectiveTrivia.EndIf mEndif ] -> - assertRange (3, 4) (3, 13) mIf - assertRange (5, 4) (5, 10) mEndif - - match expr with - | IfDirectiveExpression.Ident "DEBUG" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``single #if / #else / #endif`` () = - let trivia = - getDirectiveTrivia false """ -let v = - #if DEBUG - 30 - #else - 42 - #endif -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr, mIf) - ConditionalDirectiveTrivia.Else mElse - ConditionalDirectiveTrivia.EndIf mEndif ] -> - assertRange (3, 4) (3, 13) mIf - assertRange (5, 4) (5, 9) mElse - assertRange (7, 4) (7, 10) mEndif - - match expr with - | IfDirectiveExpression.Ident "DEBUG" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``nested #if / #else / #endif`` () = - let trivia = - getDirectiveTrivia false """ -let v = - #if FOO - #if MEH - 1 - #else - 2 - #endif - #else - 3 - #endif -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr1, mIf1) - ConditionalDirectiveTrivia.If(expr2, mIf2) - ConditionalDirectiveTrivia.Else mElse1 - ConditionalDirectiveTrivia.EndIf mEndif1 - ConditionalDirectiveTrivia.Else mElse2 - ConditionalDirectiveTrivia.EndIf mEndif2 ] -> - assertRange (3, 4) (3, 11) mIf1 - assertRange (4, 8) (4, 15) mIf2 - assertRange (6, 8) (6, 13) mElse1 - assertRange (8, 8) (8, 14) mEndif1 - assertRange (9, 4) (9, 9) mElse2 - assertRange (11, 4) (11, 10) mEndif2 - - match expr1 with - | IfDirectiveExpression.Ident "FOO" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr1}" - - match expr2 with - | IfDirectiveExpression.Ident "MEH" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr2}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``nested #if / #endif with complex expressions`` () = - let trivia = - getDirectiveTrivia false """ -let v = - #if !DEBUG - #if FOO && BAR - #if MEH || HMM - printfn "oh some logging" - #endif - #endif - #endif -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr1, mIf1) - ConditionalDirectiveTrivia.If(expr2, mIf2) - ConditionalDirectiveTrivia.If(expr3, mIf3) - ConditionalDirectiveTrivia.EndIf mEndif1 - ConditionalDirectiveTrivia.EndIf mEndif2 - ConditionalDirectiveTrivia.EndIf mEndif3 ] -> - assertRange (3, 4) (3, 14) mIf1 - assertRange (4, 8) (4, 22) mIf2 - assertRange (5, 12) (5, 26) mIf3 - assertRange (7, 12) (7, 18) mEndif1 - assertRange (8, 8) (8, 14) mEndif2 - assertRange (9, 4) (9, 10) mEndif3 - - match expr1 with - | IfDirectiveExpression.Not (IfDirectiveExpression.Ident "DEBUG") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr1}" - - match expr2 with - | IfDirectiveExpression.And(IfDirectiveExpression.Ident "FOO", IfDirectiveExpression.Ident "BAR") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr2}" - - match expr3 with - | IfDirectiveExpression.Or(IfDirectiveExpression.Ident "MEH", IfDirectiveExpression.Ident "HMM") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr3}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``directives in multiline comment are not reported as trivia`` () = - let trivia = - getDirectiveTrivia false """ -let v = -(* - #if DEBUG - () - #endif -*) - 42 -""" - - match trivia with - | [] -> Assert.Pass() - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``directives in multiline string are not reported as trivia`` () = - let trivia = - getDirectiveTrivia false " -let v = \"\"\" - #if DEBUG - () - #endif - 42 -\"\"\" -" - - match trivia with - | [] -> Assert.Pass() - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``single #if / #endif, signature file`` () = - let trivia = - getDirectiveTrivia true """ -namespace Foobar - -val v: int = - #if DEBUG - 1 - #endif - 42 -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr, mIf) - ConditionalDirectiveTrivia.EndIf mEndif ] -> - assertRange (5, 4) (5, 13) mIf - assertRange (7, 4) (7, 10) mEndif - - match expr with - | IfDirectiveExpression.Ident "DEBUG" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``single #if / #else / #endif, signature file`` () = - let trivia = - getDirectiveTrivia true """ -namespace Foobar - -val v : int = - #if DEBUG - 30 - #else - 42 - #endif -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr, mIf) - ConditionalDirectiveTrivia.Else mElse - ConditionalDirectiveTrivia.EndIf mEndif ] -> - assertRange (5, 4) (5, 13) mIf - assertRange (7, 4) (7, 9) mElse - assertRange (9, 4) (9, 10) mEndif - - match expr with - | IfDirectiveExpression.Ident "DEBUG" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``nested #if / #else / #endif, signature file`` () = - let trivia = - getDirectiveTrivia true """ -namespace Foobar - -val v : int = - #if FOO - #if MEH - 1 - #else - 2 - #endif - #else - 3 - #endif -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr1, mIf1) - ConditionalDirectiveTrivia.If(expr2, mIf2) - ConditionalDirectiveTrivia.Else mElse1 - ConditionalDirectiveTrivia.EndIf mEndif1 - ConditionalDirectiveTrivia.Else mElse2 - ConditionalDirectiveTrivia.EndIf mEndif2 ] -> - assertRange (5, 4) (5, 11) mIf1 - assertRange (6, 8) (6, 15) mIf2 - assertRange (8, 8) (8, 13) mElse1 - assertRange (10, 8) (10, 14) mEndif1 - assertRange (11, 4) (11, 9) mElse2 - assertRange (13, 4) (13, 10) mEndif2 - - match expr1 with - | IfDirectiveExpression.Ident "FOO" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr1}" - - match expr2 with - | IfDirectiveExpression.Ident "MEH" -> () - | _ -> Assert.Fail $"Expected different expression, got {expr2}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``nested #if / #endif with complex expressions, signature file`` () = - let trivia = - getDirectiveTrivia true """ -namespace Foobar - -val v : int = - #if !DEBUG - #if FOO && BAR - #if MEH || HMM - 9 - #endif - #endif - #endif - 10 -""" - - match trivia with - | [ ConditionalDirectiveTrivia.If(expr1, mIf1) - ConditionalDirectiveTrivia.If(expr2, mIf2) - ConditionalDirectiveTrivia.If(expr3, mIf3) - ConditionalDirectiveTrivia.EndIf mEndif1 - ConditionalDirectiveTrivia.EndIf mEndif2 - ConditionalDirectiveTrivia.EndIf mEndif3 ] -> - assertRange (5, 4) (5, 14) mIf1 - assertRange (6, 8) (6, 22) mIf2 - assertRange (7, 12) (7, 26) mIf3 - assertRange (9, 12) (9, 18) mEndif1 - assertRange (10, 8) (10, 14) mEndif2 - assertRange (11, 4) (11, 10) mEndif3 - - match expr1 with - | IfDirectiveExpression.Not (IfDirectiveExpression.Ident "DEBUG") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr1}" - - match expr2 with - | IfDirectiveExpression.And(IfDirectiveExpression.Ident "FOO", IfDirectiveExpression.Ident "BAR") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr2}" - - match expr3 with - | IfDirectiveExpression.Or(IfDirectiveExpression.Ident "MEH", IfDirectiveExpression.Ident "HMM") -> () - | _ -> Assert.Fail $"Expected different expression, got {expr3}" - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``directives in multiline comment are not reported as trivia, signature file`` () = - let trivia = - getDirectiveTrivia true """ -namespace Foobar - -val v : int = -(* - #if DEBUG - () - #endif -*) - 42 -""" - - match trivia with - | [] -> Assert.Pass() - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - - [] - let ``directives in multiline string are not reported as trivia, signature file`` () = - let trivia = - getDirectiveTrivia true " -namespace Foobar - -let v : string = \"\"\" - #if DEBUG - () - #endif - 42 -\"\"\" -" - - match trivia with - | [] -> Assert.Pass() - | _ -> - Assert.Fail $"Unexpected trivia, got {trivia}" - -module CodeComments = - let private getCommentTrivia isSignatureFile source = - let ast = (if isSignatureFile then getParseResultsOfSignatureFile else getParseResults) source - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(trivia = { CodeComments = trivia })) - | ParsedInput.SigFile(ParsedSigFileInput(trivia = { CodeComments = trivia })) -> trivia - - [] - let ``comment on single line`` () = - let trivia = - getCommentTrivia false """ -// comment! -foo() -""" - - match trivia with - | [ CommentTrivia.LineComment mComment ] -> - assertRange (2, 0) (2, 11) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``comment on single line, signature file`` () = - let trivia = - getCommentTrivia true """ -namespace Meh -// comment! -foo() -""" - - match trivia with - | [ CommentTrivia.LineComment mComment ] -> - assertRange (3, 0) (3, 11) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``comment after source code`` () = - let trivia = - getCommentTrivia false """ -foo() // comment! -""" - - match trivia with - | [ CommentTrivia.LineComment mComment ] -> - assertRange (2, 6) (2, 17) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``comment after source code, signature file`` () = - let trivia = - getCommentTrivia true """ -namespace Meh - -val foo : int // comment! -""" - - match trivia with - | [ CommentTrivia.LineComment mComment ] -> - assertRange (4, 14) (4, 25) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``block comment in source code`` () = - let trivia = - getCommentTrivia false """ -let a (* b *) c = c + 42 -""" - - match trivia with - | [ CommentTrivia.BlockComment mComment ] -> - assertRange (2, 6) (2, 13) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``block comment in source code, signature file`` () = - let trivia = - getCommentTrivia true """ -namespace Meh - -val a (* b *) : int -""" - - match trivia with - | [ CommentTrivia.BlockComment mComment ] -> - assertRange (4, 6) (4, 13) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``comment at end of file`` () = - let trivia = - getCommentTrivia false "x // y" - - match trivia with - | [ CommentTrivia.LineComment mComment ] -> - assertRange (1, 2) (1, 6) mComment - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``triple slash comment should not be captured`` () = - let trivia = - getCommentTrivia false """ -/// Some great documentation comment -let x = 0 -""" - - match trivia with - | [] -> - Assert.Pass() - | _ -> - Assert.Fail "Could not get valid AST" - - [] - let ``triple slash comment should be captured, if used in an invalid location`` () = - let trivia = - getCommentTrivia false """ -/// Valid xml doc -let x = - /// Some great documentation comment - - /// With a blank line in between - /// but on a while loop - while true do () - a + 1 -""" - - match trivia with - | [ CommentTrivia.LineComment m1 - CommentTrivia.LineComment m2 - CommentTrivia.LineComment m3 ] -> - assertRange (4, 4) (4, 40) m1 - assertRange (6, 4) (6, 36) m2 - assertRange (7, 4) (7, 27) m3 - | _ -> - Assert.Fail "Could not get valid AST" - -module OperatorName = - [] - let ``operator as function`` () = - let ast = """ -(+) 3 4 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = SynExpr.App(funcExpr = - SynExpr.Paren(SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])), lpr, Some rpr, pr)))) - ]) - ])) -> - assertRange (2, 0) (2, 1) lpr - Assert.AreEqual("op_Addition", ident.idText) - assertRange (2, 2) (2, 3) rpr - assertRange (2, 0) (2, 3) pr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``active pattern as function `` () = - let ast = """ -(|Odd|Even|) 4 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = - SynExpr.Paren(SynExpr.Ident ident, lpr, Some rpr, pr))) - ]) - ])) -> - assertRange (2, 0) (2, 1) lpr - Assert.AreEqual("|Odd|Even|", ident.idText) - assertRange (2, 11) (2, 12) rpr - assertRange (2, 0) (2, 12) pr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``partial active pattern as function `` () = - let ast = """ -(|Odd|_|) 4 -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = - SynExpr.Paren(SynExpr.Ident ident, lpr, Some rpr, pr))) - ]) - ])) -> - assertRange (2, 0) (2, 1) lpr - Assert.AreEqual("|Odd|_|", ident.idText) - assertRange (2, 8) (2, 9) rpr - assertRange (2, 0) (2, 9) pr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``custom operator definition`` () = - let ast = """ -let (+) a b = a + b -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(headPat= - SynPat.LongIdent(longDotId = SynLongIdent([ ident ],_, [ Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr)) ]))) - ]) - ])])) -> - assertRange (2, 4) (2,5) lpr - Assert.AreEqual("op_Addition", ident.idText) - assertRange (2, 6) (2, 7) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``active pattern definition`` () = - let ast = """ -let (|Odd|Even|) (a: int) = if a % 2 = 0 then Even else Odd -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(headPat= - SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) - ]) - ])])) -> - assertRange (2, 4) (2, 5) lpr - Assert.AreEqual("|Odd|Even|", ident.idText) - assertRange (2, 15) (2, 16) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``partial active pattern definition`` () = - let ast = """ -let (|Int32Const|_|) (a: SynConst) = match a with SynConst.Int32 _ -> Some a | _ -> None -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(headPat= - SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) - ]) - ])])) -> - assertRange (2, 4) (2, 5) lpr - Assert.AreEqual("|Int32Const|_|", ident.idText) - assertRange (2, 19) (2, 20) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``partial active pattern definition without parameters`` () = - let ast = """ -let (|Boolean|_|) = Boolean.parse -""" - |> getParseResults - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [SynBinding(headPat= - SynPat.Named(ident = SynIdent(ident, Some (IdentTrivia.HasParenthesis(lpr, rpr))))) - ]) - ])])) -> - assertRange (2, 4) (2, 5) lpr - Assert.AreEqual("|Boolean|_|", ident.idText) - assertRange (2, 16) (2, 17) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - - [] - let ``operator name in SynValSig`` () = - let ast = """ -module IntrinsicOperators -val (&): e1: bool -> e2: bool -> bool -""" - |> getParseResultsOfSignatureFile - - match ast with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ - SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Val(valSig = SynValSig(ident = SynIdent(ident, Some (IdentTrivia.OriginalNotationWithParen(lpr, "&", rpr))) - ))]) - ])) -> - assertRange (3, 4) (3, 5) lpr - Assert.AreEqual("op_Amp", ident.idText) - assertRange (3, 6) (3, 7) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``operator name in val constraint`` () = - let ast = - getParseResultsOfSignatureFile """ - [] - module Operators - /// Overloaded unary negation. - /// - /// The value to negate. - /// - /// The result of the operation. - /// - /// - /// - val inline (~-): n: ^T -> ^T when ^T: (static member ( ~- ): ^T -> ^T) and default ^T: int -""" - - match ast with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ - SynModuleOrNamespaceSig(decls = [ - SynModuleSigDecl.Val(valSig = SynValSig(synType=SynType.WithGlobalConstraints(constraints=[ - SynTypeConstraint.WhereTyparSupportsMember(memberSig=SynMemberSig.Member(memberSig=SynValSig(ident = - SynIdent(ident, Some (IdentTrivia.OriginalNotationWithParen(lpr, "~-", rpr)))))) - SynTypeConstraint.WhereTyparDefaultsToType _ - ]))) - ]) - ])) -> - assertRange (12, 57) (12, 58) lpr - Assert.AreEqual("op_UnaryNegation", ident.idText) - assertRange (12, 62) (12, 63) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``named parameter`` () = - let ast = getParseResults """ -f(x=4) -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = SynExpr.App(argExpr = SynExpr.Paren(expr = SynExpr.App(funcExpr= - SynExpr.App(funcExpr= SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "=")]))))))) - ]) - ])) -> - Assert.AreEqual("op_Equality", ident.idText) - assertRange (2,3) (2,4) ident.idRange - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``infix operation`` () = - let ast = getParseResults """ -1 + 1 -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(funcExpr = SynExpr.App(isInfix = true - funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])) - argExpr = SynExpr.Const(SynConst.Int32(1), _)) - argExpr = SynExpr.Const(SynConst.Int32(1), _))) - ]) - ])) -> - Assert.AreEqual("op_Addition", ident.idText) - assertRange (2,2) (2,3) ident.idRange - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``prefix operation`` () = - let ast = getParseResults """ -+ -86 -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(isInfix = false - funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])) - argExpr = SynExpr.Const(SynConst.Int32(-86), _))) - ]) - ])) -> - Assert.AreEqual("op_UnaryPlus", ident.idText) - assertRange (2,0) (2,1) ident.idRange - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``prefix operation with two characters`` () = - let ast = getParseResults """ -%%arg -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(isInfix = false - funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "%%")])) - argExpr = SynExpr.Ident argIdent)) - ]) - ])) -> - Assert.AreEqual("op_SpliceUntyped", ident.idText) - assertRange (2,0) (2,2) ident.idRange - Assert.AreEqual("arg", argIdent.idText) - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``detect difference between compiled operators`` () = - let ast = getParseResults """ -(+) a b -op_Addition a b -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(funcExpr = SynExpr.App(isInfix = false - funcExpr = SynExpr.Paren(SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])), lpr, Some rpr, pr) - argExpr = SynExpr.Ident a1) - argExpr = SynExpr.Ident b1)) - SynModuleDecl.Expr(expr = - SynExpr.App(funcExpr = SynExpr.App(isInfix = false - funcExpr = SynExpr.Ident op_Addition - argExpr = SynExpr.Ident a2) - argExpr = SynExpr.Ident b2) - ) - ]) - ])) -> - assertRange (2,0) (2,1) lpr - Assert.AreEqual("op_Addition", ident.idText) - assertRange (2,2) (2,3) rpr - assertRange (2,0) (2,3) pr - Assert.AreEqual("a", a1.idText) - Assert.AreEqual("b", b1.idText) - - Assert.AreEqual("op_Addition", op_Addition.idText) - Assert.AreEqual("a", a2.idText) - Assert.AreEqual("b", b2.idText) - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``operator in member definition`` () = - let ast = getParseResults """ -type X with - member _.(+) a b = a + b -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn(members = [ - SynMemberDefn.Member(memberDefn = SynBinding(headPat = SynPat.LongIdent(longDotId = - SynLongIdent([ _; operatorIdent ], [ mDot ], [ None; Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr)) ]) as lid))) - ]) - ] - ) - ]) - ])) -> - assertRange (3,12) (3,13) mDot - assertRange (3,13) (3,14) lpr - Assert.AreEqual("op_Addition", operatorIdent.idText) - assertRange (3,15) (3,16) rpr - assertRange (3,11) (3,15) lid.Range - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``nameof operator`` () = - let ast = getParseResults """ -nameof(+) -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(isInfix = false - funcExpr = SynExpr.Ident nameofIdent - argExpr = SynExpr.Paren( - SynExpr.LongIdent(longDotId = SynLongIdent([operatorIdent], _, [Some (IdentTrivia.OriginalNotation "+")])), - lpr, - Some rpr, - pr - ) - ) - ) - ]) - ])) -> - Assert.AreEqual("nameof", nameofIdent.idText) - assertRange (2,6) (2,7) lpr - Assert.AreEqual("op_Addition", operatorIdent.idText) - assertRange (2,8) (2,9) rpr - assertRange (2,6) (2,9) pr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``optional expression`` () = - let ast = getParseResults """ -f(?x = 7) -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr(expr = - SynExpr.App(isInfix = false - funcExpr = SynExpr.Ident f - argExpr = SynExpr.Paren( - SynExpr.App(funcExpr = SynExpr.App( - isInfix = true - funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([eqIdent], _, [Some (IdentTrivia.OriginalNotation "=")])) - argExpr = SynExpr.LongIdent(true, SynLongIdent([x], [], [None]), _, mOptional) - ) - argExpr = SynExpr.Const(SynConst.Int32 7, _)), lpr, Some rpr, pr))) - ]) - ])) -> - Assert.AreEqual("f", f.idText) - assertRange (2,1) (2,2) lpr - Assert.AreEqual("x", x.idText) - assertRange (2,3) (2, 4) mOptional - Assert.AreEqual("op_Equality", eqIdent.idText) - assertRange (2,8) (2,9) rpr - assertRange (2,1) (2,9) pr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``object model with two members`` () = - let ast = getParseResults """ -type X() = - let mutable allowInto = 0 - member _.AllowIntoPattern with get() = allowInto and set v = allowInto <- v -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn.SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members =[ - SynMemberDefn.ImplicitCtor _ - SynMemberDefn.LetBindings _ - SynMemberDefn.GetSetMember( - Some (SynBinding(headPat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ _ ; allowIntoPatternGet ])))), - Some (SynBinding(headPat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ _ ; allowIntoPatternSet ])))), - _, - { WithKeyword = mWith; AndKeyword = Some mAnd }) - ])) - ]) - ]) - ])) -> - Assert.AreEqual("AllowIntoPattern", allowIntoPatternGet.idText) - assertRange (4, 30) (4, 34) mWith - Assert.AreEqual("AllowIntoPattern", allowIntoPatternSet.idText) - assertRange (4, 53) (4, 56) mAnd - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``qualified operator expression`` () = - let ast = getParseResults """ -let PowByte (x:byte) n = Checked.( * ) x -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Let(bindings = [ - SynBinding(expr = SynExpr.App(funcExpr = - SynExpr.LongIdent(longDotId = SynLongIdent([checkedIdent; operatorIdent], [mDot], [None; Some (IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr))])))) - ]) - ]) - ])) -> - Assert.AreEqual("Checked", checkedIdent.idText) - assertRange (2, 32) (2, 33) mDot - assertRange (2, 33) (2, 34) lpr - Assert.AreEqual("op_Multiply", operatorIdent.idText) - assertRange (2, 37) (2, 38) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - - [] - let ``active pattern identifier in private member`` () = - let ast = getParseResults """ -type A() = - member private _.(| - A' - |) = (| - Lazy - |) -""" - - match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ - SynMemberDefn.ImplicitCtor _ - SynMemberDefn.Member(memberDefn = SynBinding( - headPat = SynPat.LongIdent(longDotId = SynLongIdent([underscoreIdent; aQuoteIdent], [ mDot ], [ None; Some (IdentTrivia.HasParenthesis(lpr, rpr)) ])) - )) - ])) - ]) - ]) - ])) -> - () - Assert.AreEqual("_", underscoreIdent.idText) - Assert.AreEqual("|A'|", aQuoteIdent.idText) - assertRange (3, 21) (3, 22) lpr - assertRange (5, 5) (5, 6) rpr - | _ -> - Assert.Fail $"Could not get valid AST, got {ast}" - -module Measures = - [] - let ``SynMeasure.Paren has correct range`` () = - let parseResults = - getParseResults - """ -40u
-""" - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Expr( - expr = SynExpr.Const(SynConst.Measure(SynConst.UInt32 _, _, SynMeasure.Divide( - SynMeasure.Seq([ SynMeasure.Named([ hrIdent ], _) ], _), - SynMeasure.Seq([ SynMeasure.Paren(SynMeasure.Seq([ - SynMeasure.Named([ staffIdent ], _) - SynMeasure.Named([ weeksIdent ], _) - ], _) , mParen) ], _), - _) - ), _)) - ]) ])) -> - Assert.AreEqual("hr", hrIdent.idText) - Assert.AreEqual("staff", staffIdent.idText) - Assert.AreEqual("weeks", weeksIdent.idText) - assertRange (2, 9) (2, 22) mParen - | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" - -module SyntaxTypes = - [] - let ``SynType.Fun has range of arrow`` () = - let parseResults = - getParseResults - """ - type X = string -> // after a tuple, mixed needs an indent - int - """ - - match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ - SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.Types(typeDefns = [ - SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = - SynTypeDefnSimpleRepr.TypeAbbrev(rhsType = - SynType.Fun(trivia = { ArrowRange = mArrow })))) - ]) - ]) - ])) -> - assertRange (2, 21) (2, 23) mArrow - | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" diff --git a/tests/service/SyntaxTreeTests/BindingTests.fs b/tests/service/SyntaxTreeTests/BindingTests.fs new file mode 100644 index 00000000000..b8f8ed54bfd --- /dev/null +++ b/tests/service/SyntaxTreeTests/BindingTests.fs @@ -0,0 +1,368 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.BindingTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Range of attribute should be included in SynModuleDecl.Let`` () = + let parseResults = + getParseResults + """ +[] +let a = 0""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt + ]) ])) -> + assertRange (2, 0) (3, 5) mb + assertRange (2, 0) (3, 9) lt.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute between let keyword and pattern should be included in SynModuleDecl.Let`` () = + let parseResults = + getParseResults + """ +let [] (A x) = 1""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt + ]) ])) -> + assertRange (2, 4) (2, 21) mb + assertRange (2, 0) (2, 25) lt.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynMemberDefn.LetBindings`` () = + let parseResults = + getParseResults + """ +type Bar = + [] + let x = 8""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.LetBindings(bindings = [SynBinding(range = mb)]) as m]))]) + ]) ])) -> + assertRange (3, 4) (4, 9) mb + assertRange (3, 4) (4, 13) m.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynMemberDefn.Member`` () = + let parseResults = + getParseResults + """ +type Bar = + [] + member this.Something () = ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) + ]) ])) -> + assertRange (3, 4) (4, 28) mb + assertRange (3, 4) (4, 33) m.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in binding of SynExpr.ObjExpr`` () = + let parseResults = + getParseResults + """ +{ new System.Object() with + [] + member x.ToString() = "F#" }""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [SynMemberDefn.Member(memberDefn=SynBinding(range = mb))])) + ]) ])) -> + assertRange (3, 4) (4, 23) mb + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in constructor SynMemberDefn.Member`` () = + let parseResults = + getParseResults + """ +type Tiger = + [] + new () = ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) + ]) ])) -> + assertRange (3, 4) (4, 10) mb + assertRange (3, 4) (4, 15) m.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in constructor SynMemberDefn.Member, optAsSpec`` () = + let parseResults = + getParseResults + """ +type Tiger = + [] + new () as tony = ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) + ]) ])) -> + assertRange (3, 4) (4, 18) mb + assertRange (3, 4) (4, 23) m.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in secondary constructor`` () = + let parseResults = + getParseResults + """ +type T() = + new () = + T () + + internal new () = + T () + + [] + new () = + T ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.ImplicitCtor _ + SynMemberDefn.Member(memberDefn = SynBinding(range = mb1)) as m1 + SynMemberDefn.Member(memberDefn = SynBinding(range = mb2)) as m2 + SynMemberDefn.Member(memberDefn = SynBinding(range = mb3)) as m3 + ]))]) + ]) ])) -> + assertRange (3, 4) (3, 10) mb1 + assertRange (3, 4) (4, 12) m1.Range + assertRange (6, 4) (6, 19) mb2 + assertRange (6, 4) (7, 12) m2.Range + assertRange (9, 4) (10, 10) mb3 + assertRange (9, 4) (11, 12) m3.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in write only SynMemberDefn.Member property`` () = + let parseResults = + getParseResults + """ +type Crane = + [] + member this.MyWriteOnlyProperty with set (value) = myInternalValue <- value""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = + [SynMemberDefn.GetSetMember(memberDefnForSet = Some (SynBinding(range = mb))) as m]))]) + ]) ])) -> + assertRange (3, 4) (4, 52) mb + assertRange (3, 4) (4, 79) m.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in full SynMemberDefn.Member property`` () = + let parseResults = + getParseResults + """ +type Bird = + [] + member this.TheWord + with get () = myInternalValue + and set (value) = myInternalValue <- value""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.GetSetMember(Some (SynBinding(range = mb1)), Some (SynBinding(range = mb2)), m, _) + ]))]) + ]) ])) -> + assertRange (3, 4) (5, 19) mb1 + assertRange (3, 4) (6, 23) mb2 + assertRange (3, 4) (6, 50) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in SynModuleDecl.Let binding`` () = + let parseResults = + getParseResults "let v = 12" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) + ]) ])) -> + assertRange (1, 6) (1, 7) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in SynModuleDecl.Let binding, typed`` () = + let parseResults = + getParseResults "let v : int = 12" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) + ]) ])) -> + assertRange (1, 12) (1, 13) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in local Let binding`` () = + let parseResults = + getParseResults + """ +do + let z = 2 + () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) + ]) ])) -> + assertRange (3, 10) (3, 11) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in local Let binding, typed`` () = + let parseResults = + getParseResults + """ +do + let z: int = 2 + () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) + ]) ])) -> + assertRange (3, 15) (3, 16) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in member binding`` () = + let parseResults = + getParseResults + """ +type X() = + member this.Y = z +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) + ]) ])) -> + assertRange (3, 18) (3, 19) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in member binding, with parameters`` () = + let parseResults = + getParseResults + """ +type X() = + member this.Y () = z +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) + ]) ])) -> + assertRange (3, 21) (3, 22) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in member binding, with return type`` () = + let parseResults = + getParseResults + """ +type X() = + member this.Y () : string = z +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) + ]) ])) -> + assertRange (3, 30) (3, 31) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present in property`` () = + let parseResults = + getParseResults + """ +type Y() = + member this.MyReadWriteProperty + with get () = myInternalValue + and set (value) = myInternalValue <- value +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + _ + SynMemberDefn.GetSetMember( + Some(SynBinding(trivia={ EqualsRange = Some eqGetM })), + Some(SynBinding(trivia={ EqualsRange = Some eqSetM })), _, _) + ]))]) + ]) ])) -> + assertRange (4, 20) (4, 21) eqGetM + assertRange (5, 24) (5, 25) eqSetM + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of let keyword should be present in SynModuleDecl.Let binding`` () = + let parseResults = + getParseResults "let v = 12" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) + ]) ])) -> + assertRange (1, 0) (1, 3) mLet + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of let keyword should be present in SynModuleDecl.Let binding with attributes`` () = + let parseResults = + getParseResults """ +/// XmlDoc +[] +// some comment +let v = 12 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) + ]) ])) -> + assertRange (5, 0) (5, 3) mLet + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of let keyword should be present in SynExpr.LetOrUse binding`` () = + let parseResults = + getParseResults """ +let a = + let b c = d + () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(expr=SynExpr.LetOrUse(bindings=[SynBinding(trivia={ LetKeyword = Some mLet })]))]) + ]) ])) -> + assertRange (3, 4) (3, 7) mLet + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/CodeCommentTests.fs b/tests/service/SyntaxTreeTests/CodeCommentTests.fs new file mode 100644 index 00000000000..ce25783eecf --- /dev/null +++ b/tests/service/SyntaxTreeTests/CodeCommentTests.fs @@ -0,0 +1,146 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.CodeCommentTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +let private getCommentTrivia isSignatureFile source = + let ast = (if isSignatureFile then getParseResultsOfSignatureFile else getParseResults) source + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(trivia = { CodeComments = trivia })) + | ParsedInput.SigFile(ParsedSigFileInput(trivia = { CodeComments = trivia })) -> trivia + +[] +let ``comment on single line`` () = + let trivia = + getCommentTrivia false """ +// comment! +foo() +""" + + match trivia with + | [ CommentTrivia.LineComment mComment ] -> + assertRange (2, 0) (2, 11) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``comment on single line, signature file`` () = + let trivia = + getCommentTrivia true """ +namespace Meh +// comment! +foo() +""" + + match trivia with + | [ CommentTrivia.LineComment mComment ] -> + assertRange (3, 0) (3, 11) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``comment after source code`` () = + let trivia = + getCommentTrivia false """ +foo() // comment! +""" + + match trivia with + | [ CommentTrivia.LineComment mComment ] -> + assertRange (2, 6) (2, 17) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``comment after source code, signature file`` () = + let trivia = + getCommentTrivia true """ +namespace Meh + +val foo : int // comment! +""" + + match trivia with + | [ CommentTrivia.LineComment mComment ] -> + assertRange (4, 14) (4, 25) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``block comment in source code`` () = + let trivia = + getCommentTrivia false """ +let a (* b *) c = c + 42 +""" + + match trivia with + | [ CommentTrivia.BlockComment mComment ] -> + assertRange (2, 6) (2, 13) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``block comment in source code, signature file`` () = + let trivia = + getCommentTrivia true """ +namespace Meh + +val a (* b *) : int +""" + + match trivia with + | [ CommentTrivia.BlockComment mComment ] -> + assertRange (4, 6) (4, 13) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``comment at end of file`` () = + let trivia = + getCommentTrivia false "x // y" + + match trivia with + | [ CommentTrivia.LineComment mComment ] -> + assertRange (1, 2) (1, 6) mComment + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``triple slash comment should not be captured`` () = + let trivia = + getCommentTrivia false """ +/// Some great documentation comment +let x = 0 +""" + + match trivia with + | [] -> + Assert.Pass() + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``triple slash comment should be captured, if used in an invalid location`` () = + let trivia = + getCommentTrivia false """ +/// Valid xml doc +let x = + /// Some great documentation comment + + /// With a blank line in between + /// but on a while loop + while true do () + a + 1 +""" + + match trivia with + | [ CommentTrivia.LineComment m1 + CommentTrivia.LineComment m2 + CommentTrivia.LineComment m3 ] -> + assertRange (4, 4) (4, 40) m1 + assertRange (6, 4) (6, 36) m2 + assertRange (7, 4) (7, 27) m3 + | _ -> + Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs b/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs new file mode 100644 index 00000000000..5a1de7621bd --- /dev/null +++ b/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs @@ -0,0 +1,57 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ComputationExpressionTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``SynExprAndBang range starts at and! and ends after expression`` () = + let ast = + getParseResults """ +async { + let! bar = getBar () + + and! foo = getFoo () + + return bar +} +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ + SynExprAndBang(range = mAndBang) + ])))) + ]) + ])) -> + assertRange (5, 4) (5, 24) mAndBang + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``multiple SynExprAndBang have range that starts at and! and ends after expression`` () = + let ast = + getParseResults """ +async { + let! bar = getBar () + and! foo = getFoo () in + and! meh = getMeh () + return bar +} +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ + SynExprAndBang(range = mAndBang1; trivia={ InKeyword = Some mIn }) + SynExprAndBang(range = mAndBang2) + ])))) + ]) + ])) -> + assertRange (4, 4) (4, 24) mAndBang1 + assertRange (4, 25) (4, 27) mIn + assertRange (5, 4) (5, 24) mAndBang2 + | _ -> + Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ConditionalDirectiveTests.fs b/tests/service/SyntaxTreeTests/ConditionalDirectiveTests.fs new file mode 100644 index 00000000000..b48262d370b --- /dev/null +++ b/tests/service/SyntaxTreeTests/ConditionalDirectiveTests.fs @@ -0,0 +1,357 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ConditionalDirectiveTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +let private getDirectiveTrivia isSignatureFile source = + let ast = (if isSignatureFile then getParseResultsOfSignatureFile else getParseResults) source + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(trivia = { ConditionalDirectives = trivia })) + | ParsedInput.SigFile(ParsedSigFileInput(trivia = { ConditionalDirectives = trivia })) -> trivia + +[] +let ``single #if / #endif`` () = + let trivia = + getDirectiveTrivia false """ +let v = + #if DEBUG + () + #endif + 42 +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr, mIf) + ConditionalDirectiveTrivia.EndIf mEndif ] -> + assertRange (3, 4) (3, 13) mIf + assertRange (5, 4) (5, 10) mEndif + + match expr with + | IfDirectiveExpression.Ident "DEBUG" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``single #if / #else / #endif`` () = + let trivia = + getDirectiveTrivia false """ +let v = + #if DEBUG + 30 + #else + 42 + #endif +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr, mIf) + ConditionalDirectiveTrivia.Else mElse + ConditionalDirectiveTrivia.EndIf mEndif ] -> + assertRange (3, 4) (3, 13) mIf + assertRange (5, 4) (5, 9) mElse + assertRange (7, 4) (7, 10) mEndif + + match expr with + | IfDirectiveExpression.Ident "DEBUG" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``nested #if / #else / #endif`` () = + let trivia = + getDirectiveTrivia false """ +let v = + #if FOO + #if MEH + 1 + #else + 2 + #endif + #else + 3 + #endif +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr1, mIf1) + ConditionalDirectiveTrivia.If(expr2, mIf2) + ConditionalDirectiveTrivia.Else mElse1 + ConditionalDirectiveTrivia.EndIf mEndif1 + ConditionalDirectiveTrivia.Else mElse2 + ConditionalDirectiveTrivia.EndIf mEndif2 ] -> + assertRange (3, 4) (3, 11) mIf1 + assertRange (4, 8) (4, 15) mIf2 + assertRange (6, 8) (6, 13) mElse1 + assertRange (8, 8) (8, 14) mEndif1 + assertRange (9, 4) (9, 9) mElse2 + assertRange (11, 4) (11, 10) mEndif2 + + match expr1 with + | IfDirectiveExpression.Ident "FOO" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr1}" + + match expr2 with + | IfDirectiveExpression.Ident "MEH" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr2}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``nested #if / #endif with complex expressions`` () = + let trivia = + getDirectiveTrivia false """ +let v = + #if !DEBUG + #if FOO && BAR + #if MEH || HMM + printfn "oh some logging" + #endif + #endif + #endif +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr1, mIf1) + ConditionalDirectiveTrivia.If(expr2, mIf2) + ConditionalDirectiveTrivia.If(expr3, mIf3) + ConditionalDirectiveTrivia.EndIf mEndif1 + ConditionalDirectiveTrivia.EndIf mEndif2 + ConditionalDirectiveTrivia.EndIf mEndif3 ] -> + assertRange (3, 4) (3, 14) mIf1 + assertRange (4, 8) (4, 22) mIf2 + assertRange (5, 12) (5, 26) mIf3 + assertRange (7, 12) (7, 18) mEndif1 + assertRange (8, 8) (8, 14) mEndif2 + assertRange (9, 4) (9, 10) mEndif3 + + match expr1 with + | IfDirectiveExpression.Not (IfDirectiveExpression.Ident "DEBUG") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr1}" + + match expr2 with + | IfDirectiveExpression.And(IfDirectiveExpression.Ident "FOO", IfDirectiveExpression.Ident "BAR") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr2}" + + match expr3 with + | IfDirectiveExpression.Or(IfDirectiveExpression.Ident "MEH", IfDirectiveExpression.Ident "HMM") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr3}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``directives in multiline comment are not reported as trivia`` () = + let trivia = + getDirectiveTrivia false """ +let v = +(* +#if DEBUG +() +#endif +*) +42 +""" + + match trivia with + | [] -> Assert.Pass() + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``directives in multiline string are not reported as trivia`` () = + let trivia = + getDirectiveTrivia false " +let v = \"\"\" +#if DEBUG +() +#endif +42 +\"\"\" +" + + match trivia with + | [] -> Assert.Pass() + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``single #if / #endif, signature file`` () = + let trivia = + getDirectiveTrivia true """ +namespace Foobar + +val v: int = + #if DEBUG + 1 + #endif + 42 +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr, mIf) + ConditionalDirectiveTrivia.EndIf mEndif ] -> + assertRange (5, 4) (5, 13) mIf + assertRange (7, 4) (7, 10) mEndif + + match expr with + | IfDirectiveExpression.Ident "DEBUG" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``single #if / #else / #endif, signature file`` () = + let trivia = + getDirectiveTrivia true """ +namespace Foobar + +val v : int = + #if DEBUG + 30 + #else + 42 + #endif +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr, mIf) + ConditionalDirectiveTrivia.Else mElse + ConditionalDirectiveTrivia.EndIf mEndif ] -> + assertRange (5, 4) (5, 13) mIf + assertRange (7, 4) (7, 9) mElse + assertRange (9, 4) (9, 10) mEndif + + match expr with + | IfDirectiveExpression.Ident "DEBUG" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``nested #if / #else / #endif, signature file`` () = + let trivia = + getDirectiveTrivia true """ +namespace Foobar + +val v : int = + #if FOO + #if MEH + 1 + #else + 2 + #endif + #else + 3 + #endif +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr1, mIf1) + ConditionalDirectiveTrivia.If(expr2, mIf2) + ConditionalDirectiveTrivia.Else mElse1 + ConditionalDirectiveTrivia.EndIf mEndif1 + ConditionalDirectiveTrivia.Else mElse2 + ConditionalDirectiveTrivia.EndIf mEndif2 ] -> + assertRange (5, 4) (5, 11) mIf1 + assertRange (6, 8) (6, 15) mIf2 + assertRange (8, 8) (8, 13) mElse1 + assertRange (10, 8) (10, 14) mEndif1 + assertRange (11, 4) (11, 9) mElse2 + assertRange (13, 4) (13, 10) mEndif2 + + match expr1 with + | IfDirectiveExpression.Ident "FOO" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr1}" + + match expr2 with + | IfDirectiveExpression.Ident "MEH" -> () + | _ -> Assert.Fail $"Expected different expression, got {expr2}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``nested #if / #endif with complex expressions, signature file`` () = + let trivia = + getDirectiveTrivia true """ +namespace Foobar + +val v : int = + #if !DEBUG + #if FOO && BAR + #if MEH || HMM + 9 + #endif + #endif + #endif + 10 +""" + + match trivia with + | [ ConditionalDirectiveTrivia.If(expr1, mIf1) + ConditionalDirectiveTrivia.If(expr2, mIf2) + ConditionalDirectiveTrivia.If(expr3, mIf3) + ConditionalDirectiveTrivia.EndIf mEndif1 + ConditionalDirectiveTrivia.EndIf mEndif2 + ConditionalDirectiveTrivia.EndIf mEndif3 ] -> + assertRange (5, 4) (5, 14) mIf1 + assertRange (6, 8) (6, 22) mIf2 + assertRange (7, 12) (7, 26) mIf3 + assertRange (9, 12) (9, 18) mEndif1 + assertRange (10, 8) (10, 14) mEndif2 + assertRange (11, 4) (11, 10) mEndif3 + + match expr1 with + | IfDirectiveExpression.Not (IfDirectiveExpression.Ident "DEBUG") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr1}" + + match expr2 with + | IfDirectiveExpression.And(IfDirectiveExpression.Ident "FOO", IfDirectiveExpression.Ident "BAR") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr2}" + + match expr3 with + | IfDirectiveExpression.Or(IfDirectiveExpression.Ident "MEH", IfDirectiveExpression.Ident "HMM") -> () + | _ -> Assert.Fail $"Expected different expression, got {expr3}" + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``directives in multiline comment are not reported as trivia, signature file`` () = + let trivia = + getDirectiveTrivia true """ +namespace Foobar + +val v : int = +(* +#if DEBUG +() +#endif +*) +42 +""" + + match trivia with + | [] -> Assert.Pass() + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" + +[] +let ``directives in multiline string are not reported as trivia, signature file`` () = + let trivia = + getDirectiveTrivia true " +namespace Foobar + +let v : string = \"\"\" +#if DEBUG +() +#endif +42 +\"\"\" +" + + match trivia with + | [] -> Assert.Pass() + | _ -> + Assert.Fail $"Unexpected trivia, got {trivia}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/EnumCaseTests.fs b/tests/service/SyntaxTreeTests/EnumCaseTests.fs new file mode 100644 index 00000000000..60dd4a1e6eb --- /dev/null +++ b/tests/service/SyntaxTreeTests/EnumCaseTests.fs @@ -0,0 +1,75 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.EnumCaseTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``single SynEnumCase has bar range`` () = + let ast = """ +type Foo = | Bar = 1 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ + SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar; EqualsRange = mEquals }) + ]))) + ], _) + ]) + ])) -> + assertRange (2, 11) (2, 12) mBar + assertRange (2, 17) (2, 18) mEquals + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``multiple SynEnumCases have bar range`` () = + let ast = """ +type Foo = + | Bar = 1 + | Bear = 2 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ + SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar1; EqualsRange = mEquals1 }) + SynEnumCase.SynEnumCase (trivia = { BarRange = Some mBar2; EqualsRange = mEquals2 }) + ]))) + ], _) + ]) + ])) -> + assertRange (3, 4) (3, 5) mBar1 + assertRange (3, 10) (3, 11) mEquals1 + assertRange (4, 4) (4, 5) mBar2 + assertRange (4, 11) (4, 12) mEquals2 + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``single SynEnumCase without bar`` () = + let ast = """ +type Foo = Bar = 1 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ + SynEnumCase.SynEnumCase (trivia = { BarRange = None; EqualsRange = mEquals }) + ]))) + ], _) + ]) + ])) -> + assertRange (2, 15) (2, 16) mEquals + | _ -> + Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ExceptionTests.fs b/tests/service/SyntaxTreeTests/ExceptionTests.fs new file mode 100644 index 00000000000..cd0ccef1cd1 --- /dev/null +++ b/tests/service/SyntaxTreeTests/ExceptionTests.fs @@ -0,0 +1,25 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ExceptionTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``SynExceptionDefn should contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +namespace X + +exception Foo with + member Meh () = () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace(decls = [ + SynModuleDecl.Exception( + exnDefn=SynExceptionDefn(withKeyword = Some mWithKeyword) + ) + ]) ])) -> + assertRange (4, 14) (4, 18) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ExpressionTests.fs b/tests/service/SyntaxTreeTests/ExpressionTests.fs new file mode 100644 index 00000000000..eb18d053d6a --- /dev/null +++ b/tests/service/SyntaxTreeTests/ExpressionTests.fs @@ -0,0 +1,496 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ExpressionTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +[] +let ``SynExpr.Do contains the range of the do keyword`` () = + let ast = """let a = + do + foobar + do! + foobarBang +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(expr = SynExpr.Sequential(expr1 = SynExpr.Do(_, doRange) ; expr2 = SynExpr.DoBang(_, doBangRange))) + ]) + ]) + ])) -> + assertRange (2, 4) (3, 14) doRange + assertRange (4, 4) (5, 18) doBangRange + | _ -> + Assert.Fail "Could not find SynExpr.Do" + +[] +let ``SynExpr.LetOrUseBang contains the range of the equals sign`` () = + let ast = + """ +comp { + let! x = y + and! z = someFunction () + return () +} +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.App(argExpr = + SynExpr.ComputationExpr(expr = + SynExpr.LetOrUseBang(trivia = { EqualsRange = Some mLetBangEquals } + andBangs = [ SynExprAndBang(trivia= { EqualsRange = mAndBangEquals }) ])))) + ]) + ])) -> + assertRange (3, 11) (3, 12) mLetBangEquals + assertRange (4, 11) (4, 12) mAndBangEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = + let ast = + """ +{ V = v + X = // some comment + someLongFunctionCall + a + b + c } +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Record(recordFields = [ + SynExprRecordField(equalsRange = Some mEqualsV) + SynExprRecordField(equalsRange = Some mEqualsX) + ])) + ]) + ])) -> + assertRange (2, 4) (2, 5) mEqualsV + assertRange (3, 9) (3, 10) mEqualsX + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``inherit SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = + let ast = + """ +{ inherit Exception(msg); X = 1; } +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Record(baseInfo = Some _ ; recordFields = [ + SynExprRecordField(equalsRange = Some mEquals) + ])) + ]) + ])) -> + assertRange (2, 28) (2, 29) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``copy SynExpr.Record contains the range of the equals sign in SynExprRecordField`` () = + let ast = + """ +{ foo with + X + = + 12 } +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Record(copyInfo = Some _ ; recordFields = [ + SynExprRecordField(equalsRange = Some mEquals) + ])) + ]) + ])) -> + assertRange (4, 12) (4, 13) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.AnonRecord contains the range of the equals sign in the fields`` () = + let ast = + """ +{| X = 5 + Y = 6 + Z = 7 |} +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.AnonRecd(recordFields = [ + (_, Some mEqualsX, _) + (_, Some mEqualsY, _) + (_, Some mEqualsZ, _) + ])) + ]) + ])) -> + assertRange (2, 5) (2, 6) mEqualsX + assertRange (3, 8) (3, 9) mEqualsY + assertRange (4, 12) (4, 13) mEqualsZ + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.For contains the range of the equals sign`` () = + let ast = + """ +for i = 1 to 10 do +printf "%d " i +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.For(equalsRange = Some mEquals)) + ]) + ])) -> + assertRange (2, 6) (2, 7) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.TryWith contains the range of the try and with keyword`` () = + let ast = + """ +try +x +with +| ex -> y +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.TryWith(trivia={ TryKeyword = mTry; WithKeyword = mWith })) + ]) + ])) -> + assertRange (2, 0) (2, 3) mTry + assertRange (4, 0) (4, 4) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.TryFinally contains the range of the try and with keyword`` () = + let ast = + """ +try +x +finally +() +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.TryFinally(trivia={ TryKeyword = mTry; FinallyKeyword = mFinally })) + ]) + ])) -> + assertRange (2, 0) (2, 3) mTry + assertRange (4, 0) (4, 7) mFinally + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.Match contains the range of the match and with keyword`` () = + let ast = + """ +match x with +| y -> z +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Match(trivia = { MatchKeyword = mMatch; WithKeyword = mWith })) + ]) + ])) -> + assertRange (2, 0) (2, 5) mMatch + assertRange (2, 8) (2, 12) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.MatchBang contains the range of the match and with keyword`` () = + let ast = + """ +match! x with +| y -> z +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.MatchBang(trivia = { MatchBangKeyword = mMatch; WithKeyword = mWith })) + ]) + ])) -> + assertRange (2, 0) (2, 6) mMatch + assertRange (2, 9) (2, 13) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.ObjExpr contains the range of with keyword`` () = + let ast = + """ +{ new obj() with + member x.ToString() = "INotifyEnumerableInternal" + interface INotifyEnumerableInternal<'T> + interface IEnumerable<_> with + member x.GetEnumerator() = null } +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.ObjExpr(withKeyword=Some mWithObjExpr; extraImpls=[ SynInterfaceImpl(withKeyword=None); SynInterfaceImpl(withKeyword=Some mWithSynInterfaceImpl) ])) + ]) + ])) -> + assertRange (2, 12) (2, 16) mWithObjExpr + assertRange (5, 27) (5, 31) mWithSynInterfaceImpl + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.LetOrUse contains the range of in keyword`` () = + let ast = + getParseResults "let x = 1 in ()" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.LetOrUse(trivia={ InKeyword = Some mIn })) + ]) + ])) -> + assertRange (1, 10) (1, 12) mIn + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.LetOrUse with recursive binding contains the range of in keyword`` () = + let ast = + getParseResults """ +do + let rec f = () + and g = () in + () +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Do(expr = SynExpr.LetOrUse(bindings=[_;_]; trivia={ InKeyword = Some mIn }))) + ]) + ])) -> + assertRange (4, 15) (4, 17) mIn + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``nested SynExpr.LetOrUse contains the range of in keyword`` () = + let ast = + getParseResults """ +let f () = + let x = 1 in // the "in" keyword is available in F# + let y = 2 in + x + y +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(expr = + SynExpr.LetOrUse(bindings=[_]; trivia={ InKeyword = Some mIn }; body=SynExpr.LetOrUse(trivia={ InKeyword = Some mInnerIn }))) + ]) + ]) + ])) -> + assertRange (3, 14) (3, 16) mIn + assertRange (4, 14) (4, 16) mInnerIn + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.LetOrUse does not contain the range of in keyword`` () = + let ast = + getParseResults """ +do +let x = 1 +() +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) + ]) + ])) -> + Assert.Pass() + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.LetOrUse where body expr starts with token of two characters does not contain the range of in keyword`` () = + let ast = + getParseResults """ +do +let e1 = e :?> Collections.DictionaryEntry +e1.Key, e1.Value +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) + ]) + ])) -> + Assert.Pass() + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``global keyword as SynExpr`` () = + let ast = + getParseResults """ +global +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.LongIdent(longDotId = SynLongIdent([mangledGlobal], [], [Some (IdentTrivia.OriginalNotation "global")])) + )]) + ])) -> + Assert.AreEqual("`global`", mangledGlobal.idText) + Assert.Pass() + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExprRecordFields contain correct amount of trivia`` () = + let ast = + getParseResults """ + { JobType = EsriBoundaryImport + FileToImport = filePath + State = state + DryRun = args.DryRun } +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Record(recordFields = [ + SynExprRecordField(fieldName = (synLongIdent, _)) + _; _; _ + ])) + ]) + ])) -> + match synLongIdent.IdentsWithTrivia with + | [ _ ] -> Assert.Pass() + | idents -> Assert.Fail $"Expected a single SynIdent, got {idents}" + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``SynExpr.Dynamic does contain ident`` () = + let ast = + getParseResults "x?k" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Dynamic (_, _, SynExpr.Ident(idK) ,mDynamicExpr)) + ]) + ])) -> + Assert.AreEqual("k", idK.idText) + assertRange (1,0) (1, 3) mDynamicExpr + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``SynExpr.Dynamic does contain parentheses`` () = + let ast = + getParseResults "x?(g)" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.Dynamic (_, _, SynExpr.Paren(SynExpr.Ident(idG), lpr, Some rpr, mParen) ,mDynamicExpr)) + ]) + ])) -> + Assert.AreEqual("g", idG.idText) + assertRange (1, 2) (1,3) lpr + assertRange (1, 4) (1,5) rpr + assertRange (1, 2) (1,5) mParen + assertRange (1,0) (1, 5) mDynamicExpr + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``SynExpr.Set with SynExpr.Dynamic`` () = + let ast = + getParseResults "x?v <- 2" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Set( + SynExpr.Dynamic (_, _, SynExpr.Ident(idV) ,mDynamicExpr), + SynExpr.Const _, + mSetExpr + )) + ]) + ])) -> + Assert.AreEqual("v", idV.idText) + assertRange (1,0) (1, 3) mDynamicExpr + assertRange (1,0) (1, 8) mSetExpr + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``SynExpr.Obj with setter`` () = + let ast = + getParseResults """ +[] +type CFoo() = + abstract AbstractClassPropertySet: string with set + +{ new CFoo() with + override this.AbstractClassPropertySet with set (v:string) = () } +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types _ + SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [ + SynMemberDefn.GetSetMember(None, Some _, m, { WithKeyword = mWith; SetKeyword = Some mSet }) + ])) + ]) + ])) -> + assertRange (7, 43) (7, 47) mWith + assertRange (7, 48) (7, 51) mSet + assertRange (7,4) (7, 67) m + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + diff --git a/tests/service/SyntaxTreeTests/IfThenElseTests.fs b/tests/service/SyntaxTreeTests/IfThenElseTests.fs new file mode 100644 index 00000000000..7db54e4dfef --- /dev/null +++ b/tests/service/SyntaxTreeTests/IfThenElseTests.fs @@ -0,0 +1,177 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.IfThenElseTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``If keyword in IfThenElse`` () = + let parseResults = + getParseResults + "if a then b" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = None }) + ) + ]) ])) -> + assertRange (1, 0) (1, 2) mIfKw + assertRange (1, 5) (1, 9) mThenKw + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Else keyword in simple IfThenElse`` () = + let parseResults = + getParseResults + "if a then b else c" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr =SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) + ) + ]) ])) -> + assertRange (1, 0) (1, 2) mIfKw + assertRange (1, 5) (1, 9) mThenKw + assertRange (1, 12) (1, 16) mElse + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``If, Then and Else keyword on separate lines`` () = + let parseResults = + getParseResults + """ +if a +then b +else c""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) + ) + ]) ])) -> + assertRange (2, 0) (2, 2) mIfKw + assertRange (3, 0) (3, 4) mThenKw + assertRange (4, 0) (4, 4) mElse + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Nested elif in IfThenElse`` () = + let parseResults = + getParseResults + """ +if a then +b +elif c then d""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = None } + elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true }))) + ) + ]) ])) -> + assertRange (2, 0) (2, 2) mIfKw + assertRange (2, 5) (2, 9) mThenKw + assertRange (4, 0) (4, 4) mElif + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Nested else if in IfThenElse`` () = + let parseResults = + getParseResults + """ +if a then + b +else + if c then d""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } + elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) + ) + ]) ])) -> + assertRange (2, 0) (2, 2) mIfKw + assertRange (2, 5) (2, 9) mThenKw + assertRange (4, 0) (4, 4) mElse + assertRange (5, 4) (5, 6) mElseIf + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Nested else if on the same line in IfThenElse`` () = + let parseResults = + getParseResults + """ +if a then +b +else if c then +d""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } + elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) + ) + ]) ])) -> + assertRange (2, 0) (2, 2) mIfKw + assertRange (2, 5) (2, 9) mThenKw + assertRange (4, 0) (4, 4) mElse + assertRange (4, 5) (4, 7) mElseIf + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Deeply nested IfThenElse`` () = + let parseResults = + getParseResults + """ +if a then + b +elif c then + d +else + if e then + f + else + g""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = None } + elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true; ElseKeyword = Some mElse1 } + elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mIf2; IsElif = false; ElseKeyword = Some mElse2 })))))) + ]) ])) -> + assertRange (2, 0) (2, 2) mIf1 + assertRange (4, 0) (4, 4) mElif + assertRange (6, 0) (6, 4) mElse1 + assertRange (7, 8) (7, 10) mIf2 + assertRange (9, 8) (9, 12) mElse2 + + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Comment between else and if`` () = + let parseResults = + getParseResults + """ +if a then +b +else (* some long comment here *) if c then +d""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = Some mElse } + elseExpr = Some (SynExpr.IfThenElse(trivia = { IfKeyword = mIf2; IsElif = false })))) + ]) ])) -> + assertRange (2, 0) (2, 2) mIf1 + assertRange (4, 0) (4, 4) mElse + assertRange (4, 34) (4, 36) mIf2 + + | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/LambdaTests.fs b/tests/service/SyntaxTreeTests/LambdaTests.fs new file mode 100644 index 00000000000..788279f8e76 --- /dev/null +++ b/tests/service/SyntaxTreeTests/LambdaTests.fs @@ -0,0 +1,146 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.LambdaTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Lambda with two parameters gives correct body`` () = + let parseResults = + getParseResults + "fun a b -> x" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Named _], SynExpr.Ident ident)) + ) + ]) ])) -> + Assert.AreEqual("x", ident.idText) + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Lambda with wild card parameter gives correct body`` () = + let parseResults = + getParseResults + "fun a _ b -> x" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Wild _; SynPat.Named _], SynExpr.Ident ident)) + ) + ]) ])) -> + Assert.AreEqual("x", ident.idText) + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Lambda with tuple parameter with wild card gives correct body`` () = + let parseResults = + getParseResults + "fun a (b, _) c -> x" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Paren(SynPat.Tuple _,_); SynPat.Named _], SynExpr.Ident ident)) + ) + ]) ])) -> + Assert.AreEqual("x", ident.idText) + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Lambda with wild card that returns a lambda gives correct body`` () = + let parseResults = + getParseResults + "fun _ -> fun _ -> x" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Ident ident)))) + ) + ]) ])) -> + Assert.AreEqual("x", ident.idText) + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Simple lambda has arrow range`` () = + let parseResults = + getParseResults + "fun x -> x" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) + ) + ]) ])) -> + assertRange (1, 6) (1, 8) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Multiline lambda has arrow range`` () = + let parseResults = + getParseResults + "fun x y z + -> + x * y * z" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) + ) + ]) ])) -> + assertRange (2, 28) (2, 30) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Destructed lambda has arrow range`` () = + let parseResults = + getParseResults + "fun { X = x } -> x * 2" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) + ) + ]) ])) -> + assertRange (1, 14) (1, 16) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Tuple in lambda has arrow range`` () = + let parseResults = + getParseResults + "fun (x, _) -> x * 3" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) + ) + ]) ])) -> + assertRange (1, 11) (1, 13) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Complex arguments lambda has arrow range`` () = + let parseResults = + getParseResults + "fun (x, _) + ({ Y = h::_ }) + (SomePattern(z)) + -> + x * y + z" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) + ) + ]) ])) -> + assertRange (4, 4) (4, 6) mArrow + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/MatchClauseTests.fs b/tests/service/SyntaxTreeTests/MatchClauseTests.fs new file mode 100644 index 00000000000..caa6c5d6da5 --- /dev/null +++ b/tests/service/SyntaxTreeTests/MatchClauseTests.fs @@ -0,0 +1,231 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.MatchClauseTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Range of single SynMatchClause`` () = + let parseResults = + getParseResults + """ +try + let content = tryDownloadFile url + Some content +with ex -> + Infrastructure.ReportWarning ex + None""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) + ]) ])) -> + assertRange (5, 5) (7, 8) range + assertRange (5, 5) (7, 8) clause.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of multiple SynMatchClause`` () = + let parseResults = + getParseResults + """ +try + let content = tryDownloadFile url + Some content +with +| ex -> + Infrastructure.ReportWarning ex + None +| exx -> + None""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = r1) as clause1 + SynMatchClause(range = r2) as clause2 ])) + ]) ])) -> + assertRange (6, 2) (8, 8) r1 + assertRange (6, 2) (8, 8) clause1.Range + + assertRange (9, 2) (10, 8) r2 + assertRange (9, 2) (10, 8) clause2.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of single SynMatchClause followed by bar`` () = + let parseResults = + getParseResults + """ +try + let content = tryDownloadFile url + Some content +with +| ex -> + () +| """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) + ]) ])) -> + assertRange (6, 2) (7, 6) range + assertRange (6, 2) (7, 6) clause.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of single SynMatchClause with missing body`` () = + let parseResults = + getParseResults + """ +try + let content = tryDownloadFile url + Some content +with +| ex ->""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) + ]) ])) -> + assertRange (6, 2) (6, 4) range + assertRange (6, 2) (6, 4) clause.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of single SynMatchClause with missing body and when expr`` () = + let parseResults = + getParseResults + """ +try + let content = tryDownloadFile url + Some content +with +| ex when (isNull ex) ->""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) + ]) ])) -> + assertRange (6, 2) (6, 21) range + assertRange (6, 2) (6, 21) clause.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of arrow in SynMatchClause`` () = + let parseResults = + getParseResults + """ +match foo with +| Bar bar -> ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) + ]) ])) -> + assertRange (3, 10) (3, 12) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of arrow in SynMatchClause with when clause`` () = + let parseResults = + getParseResults + """ +match foo with +| Bar bar when (someCheck bar) -> ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) + ]) ])) -> + assertRange (3, 31) (3, 33) mArrow + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of bar in a single SynMatchClause in SynExpr.Match`` () = + let parseResults = + getParseResults + """ +match foo with +| Bar bar when (someCheck bar) -> ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) + ]) ])) -> + assertRange (3, 0) (3, 1) mBar + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of bar in multiple SynMatchClauses in SynExpr.Match`` () = + let parseResults = + getParseResults + """ +match foo with +| Bar bar when (someCheck bar) -> () +| Far too -> near ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) + SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) + ]) ])) -> + assertRange (3, 0) (3, 1) mBar1 + assertRange (4, 0) (4, 1) mBar2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of bar in a single SynMatchClause in SynExpr.TryWith`` () = + let parseResults = + getParseResults + """ +try + foo () +with +| exn -> ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) + ]) ])) -> + assertRange (5, 0) (5, 1) mBar + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``No range of bar in a single SynMatchClause in SynExpr.TryWith`` () = + let parseResults = + getParseResults + """ +try + foo () +with exn -> + // some comment + ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = None }) ])) + ]) ])) -> + Assert.Pass() + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of bar in a multiple SynMatchClauses in SynExpr.TryWith`` () = + let parseResults = + getParseResults + """ +try + foo () +with +| IOException as ioex -> + // some comment + () +| ex -> ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) + SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) + ]) ])) -> + assertRange (5, 0) (5, 1) mBar1 + assertRange (8, 0) (8, 1) mBar2 + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/MeasureTests.fs b/tests/service/SyntaxTreeTests/MeasureTests.fs new file mode 100644 index 00000000000..0ccbf5a6d5d --- /dev/null +++ b/tests/service/SyntaxTreeTests/MeasureTests.fs @@ -0,0 +1,49 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.MeasureTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Measure contains the range of the constant`` () = + let parseResults = + getParseResults + """ +let n = 1.0m +let m = 7.000 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r1), _)) ]) + SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r2), _)) ]) + ]) ])) -> + assertRange (2, 8) (2, 12) r1 + assertRange (3, 8) (3, 13) r2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynMeasure.Paren has correct range`` () = + let parseResults = + getParseResults + """ +40u
+""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Const(SynConst.Measure(SynConst.UInt32 _, _, SynMeasure.Divide( + SynMeasure.Seq([ SynMeasure.Named([ hrIdent ], _) ], _), + SynMeasure.Seq([ SynMeasure.Paren(SynMeasure.Seq([ + SynMeasure.Named([ staffIdent ], _) + SynMeasure.Named([ weeksIdent ], _) + ], _) , mParen) ], _), + _) + ), _)) + ]) ])) -> + Assert.AreEqual("hr", hrIdent.idText) + Assert.AreEqual("staff", staffIdent.idText) + Assert.AreEqual("weeks", weeksIdent.idText) + assertRange (2, 9) (2, 22) mParen + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/MemberFlagTests.fs b/tests/service/SyntaxTreeTests/MemberFlagTests.fs new file mode 100644 index 00000000000..464884ae055 --- /dev/null +++ b/tests/service/SyntaxTreeTests/MemberFlagTests.fs @@ -0,0 +1,178 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.MemberFlagTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + + +[] +let ``SynMemberSig.Member has correct keywords`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace X + +type Y = + abstract A : int + abstract member B : double + static member C : string + member D : int + override E : int + default F : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types(types =[ + SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[ + SynMemberSig.Member(flags={ Trivia= { AbstractRange = Some mAbstract1 } }) + SynMemberSig.Member(flags={ Trivia= { AbstractRange = Some mAbstract2 + MemberRange = Some mMember1 } }) + SynMemberSig.Member(flags={ Trivia= { StaticRange = Some mStatic3 + MemberRange = Some mMember3 } }) + SynMemberSig.Member(flags={ Trivia= { MemberRange = Some mMember4 } }) + SynMemberSig.Member(flags={ Trivia= { OverrideRange = Some mOverride5 } }) + SynMemberSig.Member(flags={ Trivia= { DefaultRange = Some mDefault6 } }) + ])) + ]) + ]) ])) -> + assertRange (5, 4) (5, 12) mAbstract1 + assertRange (6, 4) (6, 12) mAbstract2 + assertRange (6, 13) (6, 19) mMember1 + assertRange (7, 4) (7, 10) mStatic3 + assertRange (7, 11) (7, 17) mMember3 + assertRange (8, 4) (8, 10) mMember4 + assertRange (9, 4) (9, 12) mOverride5 + assertRange (10, 4) (10, 11) mDefault6 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynMemberDefn.AbstractSlot has correct keyword`` () = + let ast = """ +type Foo = + abstract X : int + abstract member Y: int +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ + SynMemberDefn.AbstractSlot(flags={ Trivia = { AbstractRange = Some mAbstract1 } }) + SynMemberDefn.AbstractSlot(flags={ Trivia = { AbstractRange = Some mAbstract2 + MemberRange = Some mMember2 } }) + ])) + ], _) + ]) + ])) -> + assertRange (3, 4) (3, 12) mAbstract1 + assertRange (4, 4) (4, 12) mAbstract2 + assertRange (4, 13) (4, 19) mMember2 + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``SynMemberDefn.AutoProperty has correct keyword`` () = + let ast = """ +type Foo = + static member val W : int = 1 + member val X : int = 1 + override val Y : int = 2 + default val Z : int = 1 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ + SynMemberDefn.AutoProperty(memberFlags= mkFlags1) + SynMemberDefn.AutoProperty(memberFlags= mkFlags2) + SynMemberDefn.AutoProperty(memberFlags= mkFlags3) + SynMemberDefn.AutoProperty(memberFlags= mkFlags4) + ])) + ], _) + ]) + ])) -> + let ({ Trivia = flagsTrivia1 } : SynMemberFlags) = mkFlags1 SynMemberKind.Member + assertRange (3, 4) (3, 10) flagsTrivia1.StaticRange.Value + assertRange (3, 11) (3, 17) flagsTrivia1.MemberRange.Value + + let ({ Trivia = flagsTrivia2 } : SynMemberFlags) = mkFlags2 SynMemberKind.Member + assertRange (4, 4) (4, 10) flagsTrivia2.MemberRange.Value + + let ({ Trivia = flagsTrivia3 } : SynMemberFlags) = mkFlags3 SynMemberKind.Member + assertRange (5, 4) (5, 12) flagsTrivia3.OverrideRange.Value + + let ({ Trivia = flagsTrivia4 } : SynMemberFlags) = mkFlags4 SynMemberKind.Member + assertRange (6, 4) (6, 11) flagsTrivia4.DefaultRange.Value + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``SynMemberDefn.Member SynValData has correct keyword`` () = + let ast = """ +type Foo = + static member this.B() = () + member this.A() = () + override this.C() = () + default this.D() = () +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { StaticRange = Some mStatic1 + MemberRange = Some mMember1 } }))) + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember2 } }))) + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { OverrideRange = Some mOverride3 } }))) + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { DefaultRange = Some mDefaultRange4 } }))) + ])) + ], _) + ]) + ])) -> + assertRange (3, 4) (3, 10) mStatic1 + assertRange (3, 11) (3, 17) mMember1 + assertRange (4, 4) (4, 10) mMember2 + assertRange (5, 4) (5, 12) mOverride3 + assertRange (6, 4) (6, 11) mDefaultRange4 + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``SynExpr.Obj members have correct keywords`` () = + let ast = """ +let meh = + { new Interface with + override this.Foo () = () + member this.Bar () = () + interface SomethingElse with + member this.Blah () = () } +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let (bindings = [ + SynBinding(expr=SynExpr.ObjExpr( + members=[ + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { OverrideRange = Some mOverride1 } }))) + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember2 } }))) + ] + extraImpls=[ SynInterfaceImpl(members=[ + SynMemberDefn.Member(memberDefn=SynBinding(valData=SynValData(memberFlags=Some { Trivia = { MemberRange = Some mMember3 } }))) + ]) ])) + ]) + ]) ])) -> + assertRange (4, 8) (4, 16) mOverride1 + assertRange (5, 8) (5, 14) mMember2 + assertRange (7, 8) (7, 14) mMember3 + | _ -> + Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs b/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs new file mode 100644 index 00000000000..bf9c025c36a --- /dev/null +++ b/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs @@ -0,0 +1,88 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ModuleOrNamespaceSigTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Range member returns range of SynModuleOrNamespaceSig`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace Foobar + +type Bar = | Bar of string * int +""" + + match parseResults with + | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace) as singleModule + ])) -> + assertRange (2,0) (4,32) singleModule.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``GlobalNamespace should start at namespace keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """// foo +// bar +namespace global + +type Bar = | Bar of string * int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> + assertRange (3, 0) (5, 32) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Module range should start at first attribute`` () = + let parseResults = + getParseResultsOfSignatureFile + """ + [< Foo >] +module Bar + +val s : string +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> + assertRange (2, 1) (5, 14) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Module should contain module keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Bar + +val a: int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> + assertRange (2, 0) (2, 6) mModule + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Namespace should contain namespace keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace Foo +module Bar = +val a: int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> + assertRange (2, 0) (2, 9) mNamespace + | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs new file mode 100644 index 00000000000..2dbd30d673a --- /dev/null +++ b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs @@ -0,0 +1,117 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ModuleOrNamespaceTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``DeclaredNamespace range should start at namespace keyword`` () = + let parseResults = + getParseResults + """namespace TypeEquality + +/// A type for witnessing type equality between 'a and 'b +type Teq<'a, 'b> +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r) ])) -> + assertRange (1, 0) (4, 8) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Multiple DeclaredNamespaces should have a range that starts at the namespace keyword`` () = + let parseResults = + getParseResults + """namespace TypeEquality + +/// A type for witnessing type equality between 'a and 'b +type Teq = class end + +namespace Foobar + +let x = 42 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r1) + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r2) ])) -> + assertRange (1, 0) (4, 20) r1 + assertRange (6, 0) (8, 10) r2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``GlobalNamespace should start at namespace keyword`` () = + let parseResults = + getParseResults + """// foo +// bar +namespace global + +type X = int +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> + assertRange (3, 0) (5, 12) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Module range should start at first attribute`` () = + let parseResults = + getParseResults + """ +[< Foo >] +module Bar + +let s : string = "s" +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> + assertRange (2, 0) (5, 20) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Module should contain module keyword`` () = + let parseResults = + getParseResults + """ +/// this file contains patches to the F# Compiler Service that have not yet made it into +/// published nuget packages. We source-copy them here to have a consistent location for our to-be-removed extensions + +module FsAutoComplete.FCSPatches + +open FSharp.Compiler.Syntax +open FSharp.Compiler.Text +open FsAutoComplete.UntypedAstUtils +open FSharp.Compiler.CodeAnalysis + +module internal SynExprAppLocationsImpl = +let a = 42 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> + assertRange (5, 0) (5, 6) mModule + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Namespace should contain namespace keyword`` () = + let parseResults = + getParseResults + """ +namespace Foo +module Bar = +let a = 42 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> + assertRange (2, 0) (2, 9) mNamespace + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/NestedModuleTests.fs b/tests/service/SyntaxTreeTests/NestedModuleTests.fs new file mode 100644 index 00000000000..d6dcac70f76 --- /dev/null +++ b/tests/service/SyntaxTreeTests/NestedModuleTests.fs @@ -0,0 +1,172 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.NestedModuleTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + + +[] +let ``Range of attribute should be included in SynModuleSigDecl.NestedModule`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +[] +module Nested = + val x : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.NestedModule _ as nm + ]) as sigModule ])) -> + assertRange (4, 0) (6, 15) nm.Range + assertRange (2, 0) (6, 15) sigModule.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynModuleDecl.NestedModule`` () = + let parseResults = + getParseResults + """ +module TopLevel + +[] +module Nested = + ()""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.NestedModule _ as nm + ]) ])) -> + assertRange (4, 0) (6, 6) nm.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present`` () = + let parseResults = + getParseResults + """ +module X = +() +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) + ]) ])) -> + assertRange (2, 0) (2, 6) mModule + assertRange (2, 9) (2, 10) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of equal sign should be present, signature file`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace Foo + +module X = +val bar : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) + ]) ])) -> + assertRange (4, 0) (4, 6) mModule + assertRange (4, 9) (4, 10) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of nested module in signature file should end at the last SynModuleSigDecl`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace Microsoft.FSharp.Core + +open System +open System.Collections.Generic +open Microsoft.FSharp.Core +open Microsoft.FSharp.Collections +open System.Collections + + +module Tuple = + + type Tuple<'T1,'T2,'T3,'T4> = + interface IStructuralEquatable + interface IStructuralComparable + interface IComparable + new : 'T1 * 'T2 * 'T3 * 'T4 -> Tuple<'T1,'T2,'T3,'T4> + member Item1 : 'T1 with get + member Item2 : 'T2 with get + member Item3 : 'T3 with get + member Item4 : 'T4 with get + + +module Choice = + + /// Helper types for active patterns with 6 choices. + [] + [] + type Choice<'T1,'T2,'T3,'T4,'T5,'T6> = + /// Choice 1 of 6 choices + | Choice1Of6 of 'T1 + /// Choice 2 of 6 choices + | Choice2Of6 of 'T2 + /// Choice 3 of 6 choices + | Choice3Of6 of 'T3 + /// Choice 4 of 6 choices + | Choice4Of6 of 'T4 + /// Choice 5 of 6 choices + | Choice5Of6 of 'T5 + /// Choice 6 of 6 choices + | Choice6Of6 of 'T6 + + + +/// Basic F# Operators. This module is automatically opened in all F# code. +[] +module Operators = + + type ``[,]``<'T> with + [] + /// Get the length of an array in the first dimension + member Length1 : int + [] + /// Get the length of the array in the second dimension + member Length2 : int + [] + /// Get the lower bound of the array in the first dimension + member Base1 : int + [] + /// Get the lower bound of the array in the second dimension + member Base2 : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Open _ + SynModuleSigDecl.Open _ + SynModuleSigDecl.Open _ + SynModuleSigDecl.Open _ + SynModuleSigDecl.Open _ + SynModuleSigDecl.NestedModule(range=mTupleModule; moduleDecls=[ SynModuleSigDecl.Types([ + SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(range=mTupleObjectModel); range=mTupleType) + ], mTupleTypes) ]) + SynModuleSigDecl.NestedModule(range=mChoiceModule) + SynModuleSigDecl.NestedModule(range=mOperatorsModule; moduleDecls=[ SynModuleSigDecl.Types([ + SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple(range=mAugmentationSimple); range=mAugmentation) + ], mOperatorsTypes) ]) + ]) ])) -> + assertRange (10, 0) (20, 35) mTupleModule + assertRange (12, 4) (20, 35) mTupleTypes + assertRange (12, 9) (20, 35) mTupleType + assertRange (13, 8) (20, 35) mTupleObjectModel + assertRange (23, 0) (40, 25) mChoiceModule + assertRange (44, 0) (60, 26) mOperatorsModule + assertRange (48, 4) (60, 26) mOperatorsTypes + assertRange (48, 9) (60, 26) mAugmentation + assertRange (48, 9) (60, 26) mAugmentationSimple + | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/OperatorNameTests.fs b/tests/service/SyntaxTreeTests/OperatorNameTests.fs new file mode 100644 index 00000000000..ce64e19b85e --- /dev/null +++ b/tests/service/SyntaxTreeTests/OperatorNameTests.fs @@ -0,0 +1,486 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.OperatorNameTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +[] +let ``operator as function`` () = + let ast = """ +(+) 3 4 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = SynExpr.App(funcExpr = + SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr))]))))) + ]) + ])) -> + assertRange (2, 0) (2, 1) lpr + Assert.AreEqual("op_Addition", ident.idText) + assertRange (2, 2) (2, 3) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``active pattern as function `` () = + let ast = """ +(|Odd|Even|) 4 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = + SynExpr.LongIdent(false, SynLongIdent([ ident ], _, [ Some(IdentTrivia.HasParenthesis(lpr, rpr)) ]), None, pr))) + ]) + ])) -> + assertRange (2, 0) (2, 1) lpr + Assert.AreEqual("|Odd|Even|", ident.idText) + assertRange (2, 11) (2, 12) rpr + assertRange (2, 0) (2, 12) pr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``partial active pattern as function `` () = + let ast = """ +(|Odd|_|) 4 +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = + SynExpr.LongIdent(false, SynLongIdent([ ident ], _, [ Some(IdentTrivia.HasParenthesis(lpr, rpr)) ]), None, pr))) + ]) + ])) -> + assertRange (2, 0) (2, 1) lpr + Assert.AreEqual("|Odd|_|", ident.idText) + assertRange (2, 8) (2, 9) rpr + assertRange (2, 0) (2, 9) pr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``custom operator definition`` () = + let ast = """ +let (+) a b = a + b +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(headPat= + SynPat.LongIdent(longDotId = SynLongIdent([ ident ],_, [ Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr)) ]))) + ]) + ])])) -> + assertRange (2, 4) (2,5) lpr + Assert.AreEqual("op_Addition", ident.idText) + assertRange (2, 6) (2, 7) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``active pattern definition`` () = + let ast = """ +let (|Odd|Even|) (a: int) = if a % 2 = 0 then Even else Odd +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(headPat= + SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) + ]) + ])])) -> + assertRange (2, 4) (2, 5) lpr + Assert.AreEqual("|Odd|Even|", ident.idText) + assertRange (2, 15) (2, 16) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``partial active pattern definition`` () = + let ast = """ +let (|Int32Const|_|) (a: SynConst) = match a with SynConst.Int32 _ -> Some a | _ -> None +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(headPat= + SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) + ]) + ])])) -> + assertRange (2, 4) (2, 5) lpr + Assert.AreEqual("|Int32Const|_|", ident.idText) + assertRange (2, 19) (2, 20) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``partial active pattern definition without parameters`` () = + let ast = """ +let (|Boolean|_|) = Boolean.parse +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [SynBinding(headPat= + SynPat.Named(ident = SynIdent(ident, Some (IdentTrivia.HasParenthesis(lpr, rpr))))) + ]) + ])])) -> + assertRange (2, 4) (2, 5) lpr + Assert.AreEqual("|Boolean|_|", ident.idText) + assertRange (2, 16) (2, 17) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + + +[] +let ``operator name in SynValSig`` () = + let ast = """ +module IntrinsicOperators +val (&): e1: bool -> e2: bool -> bool +""" + |> getParseResultsOfSignatureFile + + match ast with + | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Val(valSig = SynValSig(ident = SynIdent(ident, Some (IdentTrivia.OriginalNotationWithParen(lpr, "&", rpr))) + ))]) + ])) -> + assertRange (3, 4) (3, 5) lpr + Assert.AreEqual("op_Amp", ident.idText) + assertRange (3, 6) (3, 7) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``operator name in val constraint`` () = + let ast = + getParseResultsOfSignatureFile """ + [] + module Operators + /// Overloaded unary negation. + /// + /// The value to negate. + /// + /// The result of the operation. + /// + /// + /// + val inline (~-): n: ^T -> ^T when ^T: (static member ( ~- ): ^T -> ^T) and default ^T: int +""" + + match ast with + | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Val(valSig = SynValSig(synType=SynType.WithGlobalConstraints(constraints=[ + SynTypeConstraint.WhereTyparSupportsMember(memberSig=SynMemberSig.Member(memberSig=SynValSig(ident = + SynIdent(ident, Some (IdentTrivia.OriginalNotationWithParen(lpr, "~-", rpr)))))) + SynTypeConstraint.WhereTyparDefaultsToType _ + ]))) + ]) + ])) -> + assertRange (12, 57) (12, 58) lpr + Assert.AreEqual("op_UnaryNegation", ident.idText) + assertRange (12, 62) (12, 63) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``named parameter`` () = + let ast = getParseResults """ +f(x=4) +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.App(argExpr = SynExpr.Paren(expr = SynExpr.App(funcExpr= + SynExpr.App(funcExpr= SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "=")]))))))) + ]) + ])) -> + Assert.AreEqual("op_Equality", ident.idText) + assertRange (2,3) (2,4) ident.idRange + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``infix operation`` () = + let ast = getParseResults """ +1 + 1 +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(funcExpr = SynExpr.App(isInfix = true + funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])) + argExpr = SynExpr.Const(SynConst.Int32(1), _)) + argExpr = SynExpr.Const(SynConst.Int32(1), _))) + ]) + ])) -> + Assert.AreEqual("op_Addition", ident.idText) + assertRange (2,2) (2,3) ident.idRange + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``prefix operation`` () = + let ast = getParseResults """ ++ -86 +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(isInfix = false + funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "+")])) + argExpr = SynExpr.Const(SynConst.Int32(-86), _))) + ]) + ])) -> + Assert.AreEqual("op_UnaryPlus", ident.idText) + assertRange (2,0) (2,1) ident.idRange + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``prefix operation with two characters`` () = + let ast = getParseResults """ +%%arg +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(isInfix = false + funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "%%")])) + argExpr = SynExpr.Ident argIdent)) + ]) + ])) -> + Assert.AreEqual("op_SpliceUntyped", ident.idText) + assertRange (2,0) (2,2) ident.idRange + Assert.AreEqual("arg", argIdent.idText) + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``detect difference between compiled operators`` () = + let ast = getParseResults """ +(+) a b +op_Addition a b +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(funcExpr = SynExpr.App(isInfix = false + funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr))])) + argExpr = SynExpr.Ident a1) + argExpr = SynExpr.Ident b1)) + SynModuleDecl.Expr(expr = + SynExpr.App(funcExpr = SynExpr.App(isInfix = false + funcExpr = SynExpr.Ident op_Addition + argExpr = SynExpr.Ident a2) + argExpr = SynExpr.Ident b2) + ) + ]) + ])) -> + assertRange (2,0) (2,1) lpr + Assert.AreEqual("op_Addition", ident.idText) + assertRange (2,2) (2,3) rpr + Assert.AreEqual("a", a1.idText) + Assert.AreEqual("b", b1.idText) + + Assert.AreEqual("op_Addition", op_Addition.idText) + Assert.AreEqual("a", a2.idText) + Assert.AreEqual("b", b2.idText) + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``operator in member definition`` () = + let ast = getParseResults """ +type X with + member _.(+) a b = a + b +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(members = [ + SynMemberDefn.Member(memberDefn = SynBinding(headPat = SynPat.LongIdent(longDotId = + SynLongIdent([ _; operatorIdent ], [ mDot ], [ None; Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr)) ]) as lid))) + ]) + ] + ) + ]) + ])) -> + assertRange (3,12) (3,13) mDot + assertRange (3,13) (3,14) lpr + Assert.AreEqual("op_Addition", operatorIdent.idText) + assertRange (3,15) (3,16) rpr + assertRange (3,11) (3,15) lid.Range + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``nameof operator`` () = + let ast = getParseResults """ +nameof(+) +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(isInfix = false + funcExpr = SynExpr.Ident nameofIdent + argExpr = + SynExpr.LongIdent(longDotId = SynLongIdent([operatorIdent], _, [Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr))])) + ) + ) + ]) + ])) -> + Assert.AreEqual("nameof", nameofIdent.idText) + assertRange (2,6) (2,7) lpr + Assert.AreEqual("op_Addition", operatorIdent.idText) + assertRange (2,8) (2,9) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``optional expression`` () = + let ast = getParseResults """ +f(?x = 7) +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = + SynExpr.App(isInfix = false + funcExpr = SynExpr.Ident f + argExpr = SynExpr.Paren( + SynExpr.App(funcExpr = SynExpr.App( + isInfix = true + funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([eqIdent], _, [Some (IdentTrivia.OriginalNotation "=")])) + argExpr = SynExpr.LongIdent(true, SynLongIdent([x], [], [None]), _, mOptional) + ) + argExpr = SynExpr.Const(SynConst.Int32 7, _)), lpr, Some rpr, pr))) + ]) + ])) -> + Assert.AreEqual("f", f.idText) + assertRange (2,1) (2,2) lpr + Assert.AreEqual("x", x.idText) + assertRange (2,3) (2, 4) mOptional + Assert.AreEqual("op_Equality", eqIdent.idText) + assertRange (2,8) (2,9) rpr + assertRange (2,1) (2,9) pr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``object model with two members`` () = + let ast = getParseResults """ +type X() = + let mutable allowInto = 0 + member _.AllowIntoPattern with get() = allowInto and set v = allowInto <- v +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn.SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members =[ + SynMemberDefn.ImplicitCtor _ + SynMemberDefn.LetBindings _ + SynMemberDefn.GetSetMember( + Some (SynBinding(headPat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ _ ; allowIntoPatternGet ])))), + Some (SynBinding(headPat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ _ ; allowIntoPatternSet ])))), + _, + { WithKeyword = mWith; AndKeyword = Some mAnd }) + ])) + ]) + ]) + ])) -> + Assert.AreEqual("AllowIntoPattern", allowIntoPatternGet.idText) + assertRange (4, 30) (4, 34) mWith + Assert.AreEqual("AllowIntoPattern", allowIntoPatternSet.idText) + assertRange (4, 53) (4, 56) mAnd + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``qualified operator expression`` () = + let ast = getParseResults """ +let PowByte (x:byte) n = Checked.( * ) x +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(expr = SynExpr.App(funcExpr = + SynExpr.LongIdent(longDotId = SynLongIdent([checkedIdent; operatorIdent], [mDot], [None; Some (IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr))])))) + ]) + ]) + ])) -> + Assert.AreEqual("Checked", checkedIdent.idText) + assertRange (2, 32) (2, 33) mDot + assertRange (2, 33) (2, 34) lpr + Assert.AreEqual("op_Multiply", operatorIdent.idText) + assertRange (2, 37) (2, 38) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``active pattern identifier in private member`` () = + let ast = getParseResults """ +type A() = + member private _.(| + A' + |) = (| + Lazy + |) +""" + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.ImplicitCtor _ + SynMemberDefn.Member(memberDefn = SynBinding( + headPat = SynPat.LongIdent(longDotId = SynLongIdent([underscoreIdent; aQuoteIdent], [ _ ], [ None; Some (IdentTrivia.HasParenthesis(lpr, rpr)) ])) + )) + ])) + ]) + ]) + ])) -> + () + Assert.AreEqual("_", underscoreIdent.idText) + Assert.AreEqual("|A'|", aQuoteIdent.idText) + assertRange (3, 21) (3, 22) lpr + assertRange (5, 5) (5, 6) rpr + | _ -> + Assert.Fail $"Could not get valid AST, got {ast}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs b/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs new file mode 100644 index 00000000000..d59587c6b36 --- /dev/null +++ b/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs @@ -0,0 +1,61 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ParsedHashDirectiveTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``SourceIdentifier as ParsedHashDirectiveArgument`` () = + let parseResults = + getParseResults + "#I __SOURCE_DIRECTORY__" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.SourceIdentifier(c,_,m) ] , _), _) + ]) ])) -> + Assert.AreEqual("__SOURCE_DIRECTORY__", c) + assertRange (1, 3) (1, 23) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Regular String as ParsedHashDirectiveArgument`` () = + let parseResults = + getParseResults + "#I \"/tmp\"" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Regular, m) ] , _), _) + ]) ])) -> + Assert.AreEqual("/tmp", v) + assertRange (1, 3) (1, 9) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Verbatim String as ParsedHashDirectiveArgument`` () = + let parseResults = + getParseResults + "#I @\"C:\\Temp\"" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Verbatim, m) ] , _), _) + ]) ])) -> + Assert.AreEqual("C:\\Temp", v) + assertRange (1, 3) (1, 13) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Triple quote String as ParsedHashDirectiveArgument`` () = + let parseResults = + getParseResults + "#nowarn \"\"\"40\"\"\"" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.HashDirective(ParsedHashDirective("nowarn", [ ParsedHashDirectiveArgument.String(v, SynStringKind.TripleQuote, m) ] , _), _) + ]) ])) -> + Assert.AreEqual("40", v) + assertRange (1, 8) (1, 16) m + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/PatternTests.fs b/tests/service/SyntaxTreeTests/PatternTests.fs new file mode 100644 index 00000000000..42905ec976f --- /dev/null +++ b/tests/service/SyntaxTreeTests/PatternTests.fs @@ -0,0 +1,100 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.PatternTestsTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +[] +let ``SynPat.Record contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +match x with +| { Foo = bar } -> () +| _ -> () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Record(fieldPats = [ (_, mEquals, _) ])) ; _ ]) + ) + ]) ])) -> + assertRange (3, 8) (3, 9) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynArgPats.NamePatPairs contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +match x with +| X(Y = y) -> y +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.LongIdent(argPats = SynArgPats.NamePatPairs(pats = [ _, mEquals ,_ ])))]) + ) + ]) ])) -> + assertRange (3, 7) (3, 8) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynPat.Or contains the range of the bar`` () = + let parseResults = + getParseResults + """ +match x with +| A +| B -> () +| _ -> () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Or(trivia={ BarRange = mBar })) ; _ ]) + ) + ]) ])) -> + assertRange (4, 0) (4, 1) mBar + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``:: operator in SynPat.LongIdent`` () = + let parseResults = + getParseResults + """ +let (head::tail) = [ 1;2;4] +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let( + bindings = [ SynBinding(headPat = SynPat.Paren(SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ])), _)) ] + ) + ]) ])) -> + Assert.AreEqual("op_ColonColon", opColonColonIdent.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``:: operator in match pattern`` () = + let parseResults = + getParseResults + """ +match x with +| (head) :: (tail) -> () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr( + expr = SynExpr.Match(clauses = [ + SynMatchClause(pat = SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ]))) + ]) + ) + ]) ])) -> + Assert.AreEqual("op_ColonColon", opColonColonIdent.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs new file mode 100644 index 00000000000..acc789e1075 --- /dev/null +++ b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs @@ -0,0 +1,427 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.SignatureTypeTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Range of Type should end at end keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace GreatProjectThing + +type Meh = + class + end + + +// foo""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(range = r)]) ])) -> + assertRange (3, 0) (5,11) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of SynTypeDefnSig record should end at last member`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace X +type MyRecord = + { Level: int } + member Score : unit -> int""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> + assertRange (2, 0) (4, 30) mTypes + assertRange (2, 5) (4, 30) mSynTypeDefnSig + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of SynTypeDefnSig object model should end at last member`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace X +type MyRecord = + class + end + member Score : unit -> int""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> + assertRange (2, 0) (5, 30) mTypes + assertRange (2, 5) (5, 30) mSynTypeDefnSig + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of SynTypeDefnSig delegate of should start from name`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace Y +type MyFunction = + delegate of int -> string""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes) ]) ])) -> + assertRange (2, 0) (3, 29) mTypes + assertRange (2, 5) (3, 29) mSynTypeDefnSig + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of SynTypeDefnSig simple should end at last val`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace Z +type SomeCollection with + val LastIndex : int + val SomeThingElse : int -> string""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> + assertRange (2, 0) (4, 37) mTypes + assertRange (2, 5) (4, 37) mSynTypeDefnSig + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynTypeDefnSig`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +[] +type MyType = + class + end +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(types = [SynTypeDefnSig.SynTypeDefnSig(range = r)]) as t]) ])) -> + assertRange (4, 0) (7, 7) r + assertRange (4, 0) (7, 7) t.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attributes should be included in recursive types`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +type Foo = + | Bar + +and [] Bang = + internal + { + LongNameBarBarBarBarBarBarBar: int + } + override GetHashCode : unit -> int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([ + SynTypeDefnSig.SynTypeDefnSig(range = r1) + SynTypeDefnSig.SynTypeDefnSig(range = r2) + ], mTypes)]) ])) -> + assertRange (4, 5) (5, 9) r1 + assertRange (7, 4) (12, 42) r2 + assertRange (4, 0) (12, 42) mTypes + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynValSpfn and Member`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +type FooType = + [] // ValSpfn + abstract x : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + SynModuleOrNamespaceSig(decls = + [ SynModuleSigDecl.Types(types = [ + SynTypeDefnSig.SynTypeDefnSig(typeRepr = + SynTypeDefnSigRepr.ObjectModel(memberSigs = [ + SynMemberSig.Member(range = mr; memberSig = SynValSig(range = mv)) ])) + ]) ]) ])) -> + assertRange (5, 4) (6, 20) mr + assertRange (5, 4) (6, 20) mv + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefnSig with ObjectModel Delegate contains the range of the equals sign`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace Foo + +type X = delegate of string -> string +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types( + types = [ SynTypeDefnSig(equalsRange = Some mEquals + typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _)) ] + ) + ]) ])) -> + assertRange (4, 7) (4, 8) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefnSig with ObjectModel class contains the range of the equals sign`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +type Foobar = + class + end +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types( + types = [ SynTypeDefnSig(equalsRange = Some mEquals + typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Class)) ] + ) + ]) ])) -> + assertRange (4, 12) (4, 13) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefnSig with Enum contains the range of the equals sign`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +type Bear = + | BlackBear = 1 + | PolarBear = 2 +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types( + types = [ SynTypeDefnSig(equalsRange = Some mEquals + typeRepr = SynTypeDefnSigRepr.Simple(repr = + SynTypeDefnSimpleRepr.Enum(cases = [ + SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase1 }) + SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase2 }) + ]) )) ] + ) + ]) ])) -> + assertRange (4, 10) (4, 11) mEquals + assertRange (5, 16) (5, 17) mEqualsEnumCase1 + assertRange (6, 16) (6, 17) mEqualsEnumCase2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefnSig with Union contains the range of the equals sign`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace SomeNamespace + +type Shape = +| Square of int +| Rectangle of int * int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types( + types = [ SynTypeDefnSig(equalsRange = Some mEquals + typeRepr = SynTypeDefnSigRepr.Simple(repr = SynTypeDefnSimpleRepr.Union _)) ] + ) + ]) ])) -> + assertRange (4, 11) (4, 12) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefnSig should contains the range of the with keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace X + +type Foo with +member Meh : unit -> unit +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules =[ SynModuleOrNamespaceSig(decls =[ + SynModuleSigDecl.Types( + types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple _ + withKeyword=Some mWithKeyword) ] + ) + ]) ])) -> + assertRange (4, 9) (4, 13) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynExceptionSig should contains the range of the with keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace X + +exception Foo with +member Meh : unit -> unit +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Exception( + exnSig=SynExceptionSig(withKeyword = Some mWithKeyword) + ) + ]) ])) -> + assertRange (4, 14) (4, 18) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``memberSig of SynMemberSig.Member should contains the range of the with keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +namespace X + +type Foo = + abstract member Bar : int with get,set +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + SynModuleSigDecl.Types( + types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[SynMemberSig.Member(memberSig=SynValSig(trivia = { WithKeyword = Some mWithKeyword }))])) ] + ) + ]) ])) -> + assertRange (5, 30) (5, 34) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynExceptionDefnRepr and SynExceptionSig`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module internal FSharp.Compiler.ParseHelpers + +// The error raised by the parse_error_rich function, which is called by the parser engine +[] +exception SyntaxError of obj * range: range + + +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Exception( + SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) + ] ) ])) -> + assertRange (5, 0) (6, 43) mSynExceptionDefnRepr + assertRange (5, 0) (6, 43) mSynExceptionSig + assertRange (5, 0) (6, 43) mException + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of members should be included in SynExceptionSig and SynModuleSigDecl.Exception`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module internal FSharp.Compiler.ParseHelpers + +exception SyntaxError of obj * range: range with + member Meh : string -> int + +open Foo +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Exception( + SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) + SynModuleSigDecl.Open _ + ] ) ])) -> + assertRange (4, 0) (4, 43) mSynExceptionDefnRepr + assertRange (4, 0) (5, 30) mSynExceptionSig + assertRange (4, 0) (5, 30) mException + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Val keyword is present in SynValSig`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh + +[] +// meh +val a : int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Val(valSig = SynValSig(trivia = { ValKeyword = Some mVal })) + ] ) ])) -> + assertRange (6, 0) (6, 3) mVal + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Equals token is present in SynValSig value`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh + +val a : int = 9 +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Val(valSig = SynValSig(trivia = { EqualsRange = Some mEquals }); range = mVal) + ] ) ])) -> + assertRange (4, 12) (4, 13) mEquals + assertRange (4, 0) (4, 15) mVal + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Equals token is present in SynValSig member`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh + +type X = + member a : int = 10 +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Types(types = [ + SynTypeDefnSig(typeRepr = SynTypeDefnSigRepr.ObjectModel(memberSigs = [ + SynMemberSig.Member(memberSig = SynValSig(trivia = { EqualsRange = Some mEquals }); range = mMember) + ])) + ]) + ] ) ])) -> + assertRange (5, 19) (5, 20) mEquals + assertRange (5, 4) (5, 23) mMember + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs b/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs new file mode 100644 index 00000000000..190f2664574 --- /dev/null +++ b/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs @@ -0,0 +1,48 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.SourceIdentifierTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + + +[] +let ``__LINE__`` () = + let parseResults = + getParseResults + """ +__LINE__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__LINE__", "2", range), _)) + ]) ])) -> + assertRange (2, 0) (2, 8) range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``__SOURCE_DIRECTORY__`` () = + let parseResults = + getParseResults + """ +__SOURCE_DIRECTORY__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_DIRECTORY__", _, range), _)) + ]) ])) -> + assertRange (2, 0) (2, 20) range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``__SOURCE_FILE__`` () = + let parseResults = + getParseResults + """ +__SOURCE_FILE__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_FILE__", _, range), _)) + ]) ])) -> + assertRange (2, 0) (2, 15) range + | _ -> Assert.Fail "Could not get valid AST" diff --git a/tests/service/SyntaxTreeTests/StringTests.fs b/tests/service/SyntaxTreeTests/StringTests.fs new file mode 100644 index 00000000000..d75384d8f60 --- /dev/null +++ b/tests/service/SyntaxTreeTests/StringTests.fs @@ -0,0 +1,121 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.StringTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework +open FsUnit + +let private getBindingExpressionValue (parseResults: ParsedInput) = + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> + modules |> List.tryPick (fun (SynModuleOrNamespace (decls = decls)) -> + decls |> List.tryPick (fun decl -> + match decl with + | SynModuleDecl.Let (bindings = bindings) -> + bindings |> List.tryPick (fun binding -> + match binding with + | SynBinding.SynBinding (headPat=(SynPat.Named _|SynPat.As(_,SynPat.Named _,_)); expr=e) -> Some e + | _ -> None) + | _ -> None)) + | _ -> None + +let private getBindingConstValue parseResults = + match getBindingExpressionValue parseResults with + | Some (SynExpr.Const(c,_)) -> Some c + | _ -> None + +[] +let ``SynConst.String with SynStringKind.Regular`` () = + let parseResults = + getParseResults + """ +let s = "yo" +""" + + match getBindingConstValue parseResults with + | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.Regular + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynConst.String with SynStringKind.Verbatim`` () = + let parseResults = + getParseResults + """ +let s = @"yo" +""" + + match getBindingConstValue parseResults with + | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.Verbatim + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynConst.String with SynStringKind.TripleQuote`` () = + let parseResults = + getParseResults + " +let s = \"\"\"yo\"\"\" +" + + match getBindingConstValue parseResults with + | Some (SynConst.String (_, kind, _)) -> kind |> should equal SynStringKind.TripleQuote + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynConst.Bytes with SynByteStringKind.Regular`` () = + let parseResults = + getParseResults + """ +let bytes = "yo"B +""" + + match getBindingConstValue parseResults with + | Some (SynConst.Bytes (_, kind, _)) -> kind |> should equal SynByteStringKind.Regular + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynConst.Bytes with SynByteStringKind.Verbatim`` () = + let parseResults = + getParseResults + """ +let bytes = @"yo"B +""" + + match getBindingConstValue parseResults with + | Some (SynConst.Bytes (_, kind, _)) -> kind |> should equal SynByteStringKind.Verbatim + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynExpr.InterpolatedString with SynStringKind.TripleQuote`` () = + let parseResults = + getParseResults + " +let s = $\"\"\"yo {42}\"\"\" +" + + match getBindingExpressionValue parseResults with + | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.TripleQuote + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynExpr.InterpolatedString with SynStringKind.Regular`` () = + let parseResults = + getParseResults + """ +let s = $"yo {42}" +""" + + match getBindingExpressionValue parseResults with + | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.Regular + | _ -> Assert.Fail "Couldn't find const" + +[] +let ``SynExpr.InterpolatedString with SynStringKind.Verbatim`` () = + let parseResults = + getParseResults + """ +let s = $@"Migrate notes of file ""{oldId}"" to new file ""{newId}""." +""" + + match getBindingExpressionValue parseResults with + | Some (SynExpr.InterpolatedString(_, kind, _)) -> kind |> should equal SynStringKind.Verbatim + | _ -> Assert.Fail "Couldn't find const" diff --git a/tests/service/SyntaxTreeTests/TypeTests.fs b/tests/service/SyntaxTreeTests/TypeTests.fs new file mode 100644 index 00000000000..b965d7e929e --- /dev/null +++ b/tests/service/SyntaxTreeTests/TypeTests.fs @@ -0,0 +1,486 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.TypeTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +[] +let ``Single SynEnumCase contains range of constant`` () = + let parseResults = + getParseResults + """ +type Foo = One = 0x00000001 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn.SynTypeDefn(typeRepr = + SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r) ])))]) + ]) ])) -> + assertRange (2, 17) (2, 27) r + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Multiple SynEnumCase contains range of constant`` () = + let parseResults = + getParseResults + """ +type Foo = + | One = 0x00000001 + | Two = 2 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn.SynTypeDefn(typeRepr = + SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r1) + SynEnumCase.SynEnumCase(valueRange = r2) ])))]) + ]) ])) -> + assertRange (3, 13) (3, 23) r1 + assertRange (4, 12) (4, 13) r2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attribute should be included in SynTypeDefn`` () = + let parseResults = + getParseResults + """ +[] +type Bar = + class + end""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [t]) as types + ]) ])) -> + assertRange (2, 0) (5, 7) types.Range + assertRange (2, 0) (5, 7) t.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Range of attributes should be included in recursive types`` () = + let parseResults = + getParseResults + """ +[] +type Foo<'context, 'a> = + | Apply of ApplyCrate<'context, 'a> + +and [] Bar<'context, 'a> = + internal { + Hash : int + Foo : Foo<'a, 'b> + }""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [t1;t2]) as types + ]) ])) -> + assertRange (2, 0) (10, 5) types.Range + assertRange (2, 0) (4, 39) t1.Range + assertRange (6, 4) (10, 5) t2.Range + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with ObjectModel Delegate contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +type X = delegate of string -> string +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _) + trivia={ EqualsRange = Some mEquals }) ] + ) + ]) ])) -> + assertRange (2, 7) (2, 8) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with ObjectModel class contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +type Foobar () = + class + end +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Class) + trivia={ EqualsRange = Some mEquals }) ] + ) + ]) ])) -> + assertRange (2, 15) (2, 16) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with Enum contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +type Bear = + | BlackBear = 1 + | PolarBear = 2 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.Enum(cases = [ + SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase1 }) + SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase2 }) + ])) + trivia={ EqualsRange = Some mEquals }) ] + ) + ]) ])) -> + assertRange (2, 10) (2, 11) mEquals + assertRange (3, 16) (3, 17) mEqualsEnumCase1 + assertRange (4, 16) (4, 17) mEqualsEnumCase2 + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with Union contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +type Shape = + | Square of int + | Rectangle of int * int +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Union _) + trivia={ EqualsRange = Some mEquals }) ] + ) + ]) ])) -> + assertRange (2, 11) (2, 12) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with AutoProperty contains the range of the equals sign`` () = + let parseResults = + getParseResults + """ +/// mutable class with auto-properties +type Person(name : string, age : int) = + /// Full name + member val Name = name with get, set +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ ; SynMemberDefn.AutoProperty(equalsRange = mEquals)])) ] + ) + ]) ])) -> + assertRange (5, 20) (5, 21) mEquals + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with Record contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo = + { Bar : int } + with + member this.Meh (v:int) = this.Bar + v +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr=SynTypeDefnRepr.Simple(simpleRepr= SynTypeDefnSimpleRepr.Record _) + trivia={ WithKeyword = Some mWithKeyword }) ] + ) + ]) ])) -> + assertRange (4, 4) (4, 8) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with Augmentation contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Int32 with + member _.Zero = 0 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation mWithKeyword)) ] + ) + ]) ])) -> + assertRange (2, 11) (2, 15) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynMemberDefn.Interface contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + interface Bar with + member Meh () = () + interface Other +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ SynMemberDefn.ImplicitCtor _ + SynMemberDefn.Interface(withKeyword=Some mWithKeyword) + SynMemberDefn.Interface(withKeyword=None) ])) ] + ) + ]) ])) -> + assertRange (3, 18) (3, 22) mWithKeyword + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with AutoProperty contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + member val AutoProperty = autoProp with get, set + member val AutoProperty2 = autoProp +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ + SynMemberDefn.AutoProperty(withKeyword=Some mWith) + SynMemberDefn.AutoProperty(withKeyword=None)])) ] + ) + ]) ])) -> + assertRange (3, 39) (3, 43) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with AbstractSlot contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + abstract member Bar : int with get,set +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ + SynMemberDefn.AbstractSlot(slotSig=SynValSig(trivia = { WithKeyword = Some mWith }))])) ] + ) + ]) ])) -> + assertRange (3, 30) (3, 34) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``read-only property in SynMemberDefn.Member contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + // A read-only property. + member this.MyReadProperty with get () = myInternalValue +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = + SynTypeDefnRepr.ObjectModel(members=[ + _ + SynMemberDefn.GetSetMember(Some(SynBinding _), None, _, { WithKeyword = mWith }) ]) + ) ]) + ]) ])) -> + assertRange (4, 31) (4, 35) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``write-only property in SynMemberDefn.Member contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + // A write-only property. + member this.MyWriteOnlyProperty with set (value) = myInternalValue <- value +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = + SynTypeDefnRepr.ObjectModel(members=[ + _ + SynMemberDefn.GetSetMember(None, Some(SynBinding _), _, { WithKeyword = mWith }) ]) + ) ]) + ]) ])) -> + assertRange (4, 36) (4, 40) mWith + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``read/write property in SynMemberDefn.Member contains the range of the with keyword`` () = + let parseResults = + getParseResults + """ +type Foo() = + // A read-write property. + member this.MyReadWriteProperty + with get () = myInternalValue + and set (value) = myInternalValue <- value +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = + SynTypeDefnRepr.ObjectModel(members=[ + _ + SynMemberDefn.GetSetMember(Some _, Some _, _, { WithKeyword = mWith; AndKeyword = Some mAnd }) ]) + ) ]) + ]) ])) -> + assertRange (5, 8) (5, 12) mWith + assertRange (6, 8) (6, 11) mAnd + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with XmlDoc contains the range of the type keyword`` () = + let parseResults = + getParseResults + """ +/// Doc +// noDoc +type A = B +and C = D +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) + SynTypeDefn(trivia={ TypeKeyword = None }) ] + ) + ]) ])) -> + assertRange (4, 0) (4, 4) mType + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with attribute contains the range of the type keyword`` () = + let parseResults = + getParseResults + """ +[] +// noDoc +type A = B +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) ] + ) + ]) ])) -> + assertRange (4, 0) (4, 4) mType + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with static member with get/set`` () = + let parseResults = + getParseResults + """ +type Foo = + static member ReadWrite2 + with set x = lastUsed <- ("ReadWrite2", x) + and get () = lastUsed <- ("ReadWrite2", 0); 4 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.GetSetMember(Some _, Some _, m, { WithKeyword = mWith + GetKeyword = Some mGet + AndKeyword = Some mAnd + SetKeyword = Some mSet }) + ])) ] + ) + ]) ])) -> + assertRange (4, 8) (4, 12) mWith + assertRange (4, 13) (4, 16) mSet + assertRange (5, 8) (5, 11) mAnd + assertRange (5, 13) (5, 16) mGet + assertRange (3, 4) (5, 54) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynTypeDefn with member with set/get`` () = + let parseResults = + getParseResults + """ +type A() = + member this.Z with set (_:int):unit = () and get():int = 1 +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.ImplicitCtor _ + SynMemberDefn.GetSetMember(Some (SynBinding(headPat = SynPat.LongIdent(extraId = Some getIdent))), + Some (SynBinding(headPat = SynPat.LongIdent(extraId = Some setIdent))), + m, + { WithKeyword = mWith + GetKeyword = Some mGet + AndKeyword = Some mAnd + SetKeyword = Some mSet }) + ])) ] + ) + ]) ])) -> + Assert.AreEqual("get", getIdent.idText) + Assert.AreEqual("set", setIdent.idText) + assertRange (3, 18) (3, 22) mWith + assertRange (3, 23) (3, 26) mSet + assertRange (3, 23) (3, 26) setIdent.idRange + assertRange (3, 45) (3, 48) mAnd + assertRange (3, 49) (3, 52) mGet + assertRange (3, 49) (3, 52) getIdent.idRange + assertRange (3, 4) (3, 62) m + | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``SynType.Fun has range of arrow`` () = + let parseResults = + getParseResults + """ + type X = string -> // after a tuple, mixed needs an indent + int + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.TypeAbbrev(rhsType = + SynType.Fun(trivia = { ArrowRange = mArrow })))) + ]) + ]) + ])) -> + assertRange (2, 21) (2, 23) mArrow + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" diff --git a/tests/service/SyntaxTreeTests/UnionCaseTests.fs b/tests/service/SyntaxTreeTests/UnionCaseTests.fs new file mode 100644 index 00000000000..2cb1f80b730 --- /dev/null +++ b/tests/service/SyntaxTreeTests/UnionCaseTests.fs @@ -0,0 +1,138 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.UnionCaseTestsTests + +open System +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open NUnit.Framework + +[] +let ``Union Case fields can have comments`` () = + let ast = """ +type Foo = +/// docs for Thing +| Thing of + /// docs for first + first: string * + /// docs for anon field + bool +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase.SynUnionCase (caseType = SynUnionCaseKind.Fields [ + SynField.SynField(xmlDoc = firstXml) + SynField.SynField(xmlDoc = anonXml) + ]) + ]))) + ], _) + ]) + ])) -> + let firstDocs = firstXml.ToXmlDoc(false, None).GetXmlText() + let anonDocs = anonXml.ToXmlDoc(false, None).GetXmlText() + + let nl = Environment.NewLine + + Assert.AreEqual($"{nl} docs for first{nl}", firstDocs) + Assert.AreEqual($"{nl} docs for anon field{nl}", anonDocs) + + | _ -> + failwith "Could not find SynExpr.Do" + +[] +let ``single SynUnionCase has bar range`` () = + let ast = """ +type Foo = | Bar of string +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar }) + ]))) + ], _) + ]) + ])) -> + assertRange (2, 11) (2, 12) mBar + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``multiple SynUnionCases have bar range`` () = + let ast = """ +type Foo = + | Bar of string + | Bear of int +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar1 }) + SynUnionCase.SynUnionCase (trivia = { BarRange = Some mBar2 }) + ]))) + ], _) + ]) + ])) -> + assertRange (3, 4) (3, 5) mBar1 + assertRange (4, 4) (4, 5) mBar2 + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``single SynUnionCase without bar`` () = + let ast = """ +type Foo = Bar of string +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase.SynUnionCase (trivia = { BarRange = None }) + ]))) + ], _) + ]) + ])) -> + Assert.Pass() + | _ -> + Assert.Fail "Could not get valid AST" + +[] +let ``private keyword has range`` () = + let ast = """ +type Currency = + // Temporary fix until a new Thoth.Json.Net package is released + // See https://github.com/MangelMaxime/Thoth/pull/70 + +#if !FABLE_COMPILER + private +#endif + | Code of string +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types ([ + SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union( + accessibility = Some (SynAccess.Private mPrivate) + unionCases = [ SynUnionCase.SynUnionCase _ ]))) + ], _) + ]) + ])) -> + assertRange (7, 4) (7, 11) mPrivate + | _ -> + Assert.Fail "Could not get valid AST" \ No newline at end of file From af4d64442695280ff1c496262424f3adeaf07842 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 8 Jul 2022 17:51:29 +0100 Subject: [PATCH 023/226] Update overview.md (#13475) --- docs/overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/overview.md b/docs/overview.md index 51d60d50fa8..f66d80ae613 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -129,11 +129,11 @@ stateDiagram-v2 The following are the key phases and high-level logical operations of the F# compiler code in its various configurations: -* _Basic lexing_. Produces a token stream from input source file text. +* _Basic lexing_. Produces a token stream from input source file text. F# uses the [FsLex](http://fsprojects.github.io/FsLexYacc/) tool to process a declarative specification of the tokenizer in [lex.fsl](https://github.com/dotnet/fsharp/blob/main/src/Compiler/lex.fsl). This compiles the tokenizer specification to a number of tables which are then interpreted by the code in [prim-lexing.fs](https://github.com/dotnet/fsharp/blob/main/src/Compiler/Facilities/prim-lexing.fs) (see also [prim-lexing.fsi](https://github.com/dotnet/fsharp/blob/main/src/Compiler/Facilities/prim-lexing.fsi). * _White-space sensitive lexing_. Accepts and produces a token stream, augmenting per the [F# Language Specification](https://fsharp.org/specs/language-spec/). -* _Parsing_. Accepts a token stream and produces an AST per the grammar in the [F# Language Specification](https://fsharp.org/specs/language-spec/). +* _Parsing_. Accepts a token stream and produces an AST per the grammar in the [F# Language Specification](https://fsharp.org/specs/language-spec/). F# uses the [FsYacc](http://fsprojects.github.io/FsLexYacc/) tool to process a declarative specification of the parser in [pars.fsy](https://github.com/dotnet/fsharp/blob/main/src/Compiler/pars.fsy). This compiles the grammar to a number of tables which are then interpreted by the code in [prim-parsing.fs](https://github.com/dotnet/fsharp/blob/main/src/Compiler/Facilities/prim-parsing.fs) (see also [prim-parsing.fsi](https://github.com/dotnet/fsharp/blob/main/src/Compiler/Facilities/prim-parsing.fsi). * _Resolving references_. For .NET SDK generally references are resolved explicitly by external tooling. There is a legacy aspect to this if references use old .NET Framework references including for From 5055281af21ddb6619ec65d74089ac18d7b532c3 Mon Sep 17 00:00:00 2001 From: Petr Semkin Date: Mon, 11 Jul 2022 12:05:53 +0200 Subject: [PATCH 024/226] Consolidating TopValInfo and ValReprInfo terms (#13471) --- .../Checking/AugmentWithHashCompare.fs | 4 +- .../Checking/CheckIncrementalClasses.fs | 38 ++++++------ src/Compiler/Checking/FindUnsolved.fs | 18 +++--- src/Compiler/Checking/MethodCalls.fs | 6 +- src/Compiler/Checking/NicePrint.fs | 1 - src/Compiler/Checking/PostInferenceChecks.fs | 28 ++++----- src/Compiler/Checking/QuotationTranslator.fs | 4 +- src/Compiler/Checking/TypeRelations.fs | 12 ++-- src/Compiler/Checking/TypeRelations.fsi | 6 +- src/Compiler/CodeGen/IlxGen.fs | 48 +++++++-------- src/Compiler/Optimize/DetupleArgs.fs | 8 +-- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 4 +- src/Compiler/Optimize/LowerCalls.fs | 6 +- src/Compiler/Optimize/LowerLocalMutables.fs | 16 ++--- src/Compiler/Optimize/Optimizer.fs | 14 ++--- src/Compiler/Symbols/Exprs.fs | 8 +-- src/Compiler/TypedTree/TypedTreeOps.fs | 60 +++++++++---------- 17 files changed, 140 insertions(+), 141 deletions(-) diff --git a/src/Compiler/Checking/AugmentWithHashCompare.fs b/src/Compiler/Checking/AugmentWithHashCompare.fs index f6faeb7bee7..cb7320006b7 100644 --- a/src/Compiler/Checking/AugmentWithHashCompare.fs +++ b/src/Compiler/Checking/AugmentWithHashCompare.fs @@ -888,8 +888,8 @@ let mkValSpec g (tcref: TyconRef) ty vis slotsig methn valTy argData = slotImplMethod(final, tcref, slotsig) let inl = ValInline.Optional let args = ValReprInfo.unnamedTopArg :: argData - let topValInfo = Some (ValReprInfo (ValReprInfo.InferTyparInfo tps, args, ValReprInfo.unnamedRetVal)) - Construct.NewVal (methn, m, None, valTy, Immutable, true, topValInfo, vis, ValNotInRecScope, Some membInfo, NormalVal, [], inl, XmlDoc.Empty, true, false, false, false, false, false, None, Parent tcref) + let valReprInfo = Some (ValReprInfo (ValReprInfo.InferTyparInfo tps, args, ValReprInfo.unnamedRetVal)) + Construct.NewVal (methn, m, None, valTy, Immutable, true, valReprInfo, vis, ValNotInRecScope, Some membInfo, NormalVal, [], inl, XmlDoc.Empty, true, false, false, false, false, false, None, Parent tcref) let MakeValsForCompareAugmentation g (tcref: TyconRef) = let m = tcref.Range diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index 973c0c55803..f4371e3c925 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -132,9 +132,9 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let prelimValReprInfo = TranslateSynValInfo m (TcAttributes cenv env) valSynData let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, ctorTy) let isComplete = ComputeIsComplete copyOfTyconTypars [] ctorTy - let topValInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let ctorValScheme = ValScheme(id, prelimTyschemeG, Some topValInfo, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) - let paramNames = topValInfo.ArgNames + let varReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo + let ctorValScheme = ValScheme(id, prelimTyschemeG, Some varReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) + let paramNames = varReprInfo.ArgNames let xmlDoc = xmlDoc.ToXmlDoc(true, Some paramNames) let ctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValInRecScope isComplete, ctorValScheme, attribs, xmlDoc, None, false) ctorValScheme, ctorVal @@ -153,8 +153,8 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let memberInfo = MakeMemberDataAndMangledNameForMemberVal(g, tcref, false, [], [], (ClassCtorMemberFlags SynMemberFlagsTrivia.Zero), valSynData, id, false) let prelimValReprInfo = TranslateSynValInfo m (TcAttributes cenv env) valSynData let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, cctorTy) - let topValInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let cctorValScheme = ValScheme(id, prelimTyschemeG, Some topValInfo, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) + let valReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo + let cctorValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) let cctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, cctorValScheme, [(* no attributes*)], XmlDoc.Empty, None, false) cctorArgs, cctorVal, cctorValScheme @@ -317,9 +317,9 @@ type IncrClassReprInfo = // (staticForcedFieldVars |> Seq.map (fun v -> v.LogicalName) |> String.concat ",") // (instanceForcedFieldVars |> Seq.map (fun v -> v.LogicalName) |> String.concat ",") InVar isCtorArg - | topValInfo -> + | valReprInfo -> //dprintfn "Representing %s as a method %s" v.LogicalName name - let tps, _, argInfos, _, _ = GetTopValTypeInCompiledForm g topValInfo 0 v.Type v.Range + let tps, _, argInfos, _, _ = GetTopValTypeInCompiledForm g valReprInfo 0 v.Type v.Range let valSynInfo = SynValInfo(argInfos |> List.mapSquared (fun (_, argInfo) -> SynArgInfo([], false, argInfo.Name)), SynInfo.unnamedRetVal) let memberFlags = (if isStatic then StaticMemberFlags else NonVirtualMemberFlags) SynMemberFlagsTrivia.Zero SynMemberKind.Member @@ -328,34 +328,34 @@ type IncrClassReprInfo = let copyOfTyconTypars = ctorInfo.GetNormalizedInstanceCtorDeclaredTypars cenv env.DisplayEnv ctorInfo.TyconRef.Range - AdjustValToTopVal v (Parent tcref) topValInfo + AdjustValToTopVal v (Parent tcref) valReprInfo // Add the 'this' pointer on to the function - let memberTauTy, topValInfo = + let memberTauTy, valReprInfo = let tauTy = v.TauType if isStatic then - tauTy, topValInfo + tauTy, valReprInfo else let tauTy = mkFunTy g ctorInfo.InstanceCtorThisVal.Type v.TauType - let (ValReprInfo(tpNames, args, ret)) = topValInfo - let topValInfo = ValReprInfo(tpNames, ValReprInfo.selfMetadata :: args, ret) - tauTy, topValInfo + let (ValReprInfo(tpNames, args, ret)) = valReprInfo + let valReprInfo = ValReprInfo(tpNames, ValReprInfo.selfMetadata :: args, ret) + tauTy, valReprInfo // Add the enclosing type parameters on to the function - let topValInfo = - let (ValReprInfo(tpNames, args, ret)) = topValInfo + let valReprInfo = + let (ValReprInfo(tpNames, args, ret)) = valReprInfo ValReprInfo(tpNames@ValReprInfo.InferTyparInfo copyOfTyconTypars, args, ret) let prelimTyschemeG = GeneralizedType(copyOfTyconTypars@tps, memberTauTy) // NOTE: putting isCompilerGenerated=true here is strange. The method is not public, nor is // it a "member" in the F# sense, but the F# spec says it is generated and it is reasonable to reflect on it. - let memberValScheme = ValScheme(id, prelimTyschemeG, Some topValInfo, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) + let memberValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) let methodVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, memberValScheme, v.Attribs, XmlDoc.Empty, None, false) reportIfUnused() - InMethod(isStatic, methodVal, topValInfo) + InMethod(isStatic, methodVal, valReprInfo) repr, takenFieldNames @@ -401,9 +401,9 @@ type IncrClassReprInfo = let expr = mkStaticRecdFieldGet (rfref, tinst, m) MakeCheckSafeInit g tinst safeStaticInitInfo (mkInt g m idx) expr - | InMethod(isStatic, methodVal, topValInfo), _ -> + | InMethod(isStatic, methodVal, valReprInfo), _ -> //dprintfn "Rewriting application of %s to be call to method %s" v.LogicalName methodVal.LogicalName - let expr, exprTy = AdjustValForExpectedArity g m (mkLocalValRef methodVal) NormalValUse topValInfo + let expr, exprTy = AdjustValForExpectedArity g m (mkLocalValRef methodVal) NormalValUse valReprInfo // Prepend the the type arguments for the class let tyargs = tinst @ tyargs let thisArgs = diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index 76fb746ca4f..a914e61d256 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -84,15 +84,15 @@ let rec accExpr (cenv: cenv) (env: env) expr = accExprs cenv env argsl | Expr.Lambda (_, _ctorThisValOpt, _baseValOpt, argvs, _body, m, bodyTy) -> - let topValInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy cenv.g m argvs bodyTy - accLambdas cenv env topValInfo expr ty + accLambdas cenv env valReprInfo expr ty | Expr.TyLambda (_, tps, _body, _m, bodyTy) -> - let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) accTy cenv env bodyTy let ty = mkForallTyIfNeeded tps bodyTy - accLambdas cenv env topValInfo expr ty + accLambdas cenv env valReprInfo expr ty | Expr.TyChoose (_tps, e1, _m) -> accExpr cenv env e1 @@ -161,12 +161,12 @@ and accTraitInfo cenv env (TTrait(tys, _nm, _, argTys, retTy, _sln)) = retTy |> Option.iter (accTy cenv env) tys |> List.iter (accTy cenv env) -and accLambdas cenv env topValInfo expr exprTy = +and accLambdas cenv env valReprInfo expr exprTy = match stripDebugPoints expr with - | Expr.TyChoose (_tps, bodyExpr, _m) -> accLambdas cenv env topValInfo bodyExpr exprTy + | Expr.TyChoose (_tps, bodyExpr, _m) -> accLambdas cenv env valReprInfo bodyExpr exprTy | Expr.Lambda _ | Expr.TyLambda _ -> - let _tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda cenv.g cenv.amap topValInfo (expr, exprTy) + let _tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda cenv.g cenv.amap valReprInfo (expr, exprTy) accTy cenv env bodyTy vsl |> List.iterSquared (accVal cenv env) baseValOpt |> Option.iter (accVal cenv env) @@ -233,8 +233,8 @@ and accVal cenv env v = and accBind cenv env (bind: Binding) = accVal cenv env bind.Var - let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData - accLambdas cenv env topValInfo bind.Expr bind.Var.Type + let valReprInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData + accLambdas cenv env valReprInfo bind.Expr bind.Var.Type and accBinds cenv env binds = binds |> List.iter (accBind cenv env) diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 94807737e64..6331c9a992d 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -1211,7 +1211,7 @@ let BuildObjCtorCall (g: TcGlobals) m = let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, delInvokeMeth: MethInfo, delArgTys, delFuncExpr, delFuncTy, m) = let slotsig = delInvokeMeth.GetSlotSig(amap, m) let delArgVals, expr = - let topValInfo = ValReprInfo([], List.replicate (max 1 (List.length delArgTys)) ValReprInfo.unnamedTopArg, ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo([], List.replicate (max 1 (List.length delArgTys)) ValReprInfo.unnamedTopArg, ValReprInfo.unnamedRetVal) // Try to pull apart an explicit lambda and use it directly // Don't do this in the case where we're adjusting the arguments of a function used to build a .NET-compatible event handler @@ -1219,7 +1219,7 @@ let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, d if Option.isSome eventInfoOpt then None else - tryDestTopLambda g amap topValInfo (delFuncExpr, delFuncTy) + tryDestTopLambda g amap valReprInfo (delFuncExpr, delFuncTy) match lambdaContents with | None -> @@ -1244,7 +1244,7 @@ let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, d delArgVals, expr | Some _ -> - let _, _, _, vsl, body, _ = IteratedAdjustArityOfLambda g amap topValInfo delFuncExpr + let _, _, _, vsl, body, _ = IteratedAdjustArityOfLambda g amap valReprInfo delFuncExpr List.concat vsl, body let meth = TObjExprMethod(slotsig, [], [], [delArgVals], expr, m) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 6272e3ed5dc..3a398620de9 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -972,7 +972,6 @@ module PrintTypes = /// Layout a single type used as the type of a member or value let layoutTopType denv env argInfos retTy cxs = - // Parenthesize the return type to match the topValInfo let retTyL = layoutReturnType denv env retTy let cxsL = layoutConstraintsWithInfo denv env cxs match argInfos with diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 87eb68c7d80..1459fc99984 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -591,8 +591,8 @@ let mkArgsPermit n = /// Work out what byref-values are allowed at input positions to named F# functions or members let mkArgsForAppliedVal isBaseCall (vref: ValRef) argsl = match vref.ValReprInfo with - | Some topValInfo -> - let argArities = topValInfo.AritiesOfArgs + | Some valReprInfo -> + let argArities = valReprInfo.AritiesOfArgs let argArities = if isBaseCall && argArities.Length >= 1 then List.tail argArities else argArities // Check for partial applications: arguments to partial applications don't get to use byrefs if List.length argsl >= argArities.Length then @@ -1352,14 +1352,14 @@ and CheckApplication cenv env expr (f, tyargs, argsl, m) ctxt = CheckCall cenv env m returnTy argsl ctxts ctxt and CheckLambda cenv env expr (argvs, m, bodyTy) = - let topValInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy cenv.g m argvs bodyTy in - CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes + CheckLambdas false None cenv env false valReprInfo false expr m ty PermitByRefExpr.Yes and CheckTyLambda cenv env expr (tps, m, bodyTy) = - let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) let ty = mkForallTyIfNeeded tps bodyTy in - CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes + CheckLambdas false None cenv env false valReprInfo false expr m ty PermitByRefExpr.Yes and CheckMatch cenv env ctxt (dtree, targets, m, ty) = CheckTypeNoInnerByrefs cenv env m ty // computed byrefs allowed at each branch @@ -1699,20 +1699,20 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = CheckTypeInstNoByrefs cenv env m tyargs CheckExprsNoByRefLike cenv env args -and CheckLambdas isTop (memberVal: Val option) cenv env inlined topValInfo alwaysCheckNoReraise expr mOrig ety ctxt = +and CheckLambdas isTop (memberVal: Val option) cenv env inlined valReprInfo alwaysCheckNoReraise expr mOrig ety ctxt = let g = cenv.g let memInfo = memberVal |> Option.bind (fun v -> v.MemberInfo) - // The topValInfo here says we are _guaranteeing_ to compile a function value + // The valReprInfo here says we are _guaranteeing_ to compile a function value // as a .NET method with precisely the corresponding argument counts. match stripDebugPoints expr with | Expr.TyChoose (tps, e1, m) -> let env = BindTypars g env tps - CheckLambdas isTop memberVal cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety ctxt + CheckLambdas isTop memberVal cenv env inlined valReprInfo alwaysCheckNoReraise e1 m ety ctxt | Expr.Lambda (_, _, _, _, _, m, _) | Expr.TyLambda (_, _, _, m, _) -> - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g cenv.amap topValInfo (expr, ety) + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g cenv.amap valReprInfo (expr, ety) let env = BindTypars g env tps let thisAndBase = Option.toList ctorThisValOpt @ Option.toList baseValOpt let restArgs = List.concat vsl @@ -2071,7 +2071,7 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin | _ -> () - let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData + let valReprInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData // If the method has ResumableCode argument or return type it must be inline // unless warning is suppressed (user must know what they're doing). @@ -2089,7 +2089,7 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin else env - CheckLambdas isTop (Some v) cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type ctxt + CheckLambdas isTop (Some v) cenv env v.MustInline valReprInfo alwaysCheckNoReraise bindRhs v.Range v.Type ctxt and CheckBindings cenv env binds = for bind in binds do @@ -2479,8 +2479,8 @@ let CheckEntityDefn cenv env (tycon: Entity) = // Abstract slots can have byref arguments and returns for vref in abstractSlotValsOfTycons [tycon] do match vref.ValReprInfo with - | Some topValInfo -> - let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type m + | Some valReprInfo -> + let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m let env = BindTypars g env tps for argTys in argTysl do for argTy, _ in argTys do diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index fe05b73ac0a..044ff283f0b 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -348,12 +348,12 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. dprintfn "vref.DisplayName = %A was under applied" vref.DisplayName // Too few arguments or incorrect tupling? Convert to a lambda and beta-reduce the // partially applied arguments to 'let' bindings - let topValInfo = + let valReprInfo = match vref.ValReprInfo with | None -> error(InternalError("no arity information found for F# value " + vref.LogicalName, vref.Range)) | Some a -> a - let expr, exprTy = AdjustValForExpectedArity g m vref vFlags topValInfo + let expr, exprTy = AdjustValForExpectedArity g m vref vFlags valReprInfo ConvExpr cenv env (MakeApplicationAndBetaReduce g (expr, exprTy, [tyargs], curriedArgs, m)) else // Too many arguments? Chop diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index 6cbb7547f30..b0951fd9a79 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -259,8 +259,8 @@ let tryDestTopLambda g amap (ValReprInfo (tpNames, _, _) as tvd) (e, ty) = else Some (tps, ctorThisValOpt, baseValOpt, vsl, body, retTy) -let destTopLambda g amap topValInfo (e, ty) = - match tryDestTopLambda g amap topValInfo (e, ty) with +let destTopLambda g amap valReprInfo (e, ty) = + match tryDestTopLambda g amap valReprInfo (e, ty) with | None -> error(Error(FSComp.SR.typrelInvalidValue(), e.Range)) | Some res -> res @@ -271,11 +271,11 @@ let IteratedAdjustArityOfLambdaBody g arities vsl body = /// Do AdjustArityOfLambdaBody for a series of /// iterated lambdas, producing one method. -/// The required iterated function arity (List.length topValInfo) must be identical +/// The required iterated function arity (List.length valReprInfo) must be identical /// to the iterated function arity of the input lambda (List.length vsl) -let IteratedAdjustArityOfLambda g amap topValInfo e = - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g amap topValInfo (e, tyOfExpr g e) - let arities = topValInfo.AritiesOfArgs +let IteratedAdjustArityOfLambda g amap valReprInfo e = + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g amap valReprInfo (e, tyOfExpr g e) + let arities = valReprInfo.AritiesOfArgs if arities.Length <> vsl.Length then errorR(InternalError(sprintf "IteratedAdjustArityOfLambda, List.length arities = %d, List.length vsl = %d" arities.Length vsl.Length, body.Range)) let vsl, body = IteratedAdjustArityOfLambdaBody g arities vsl body diff --git a/src/Compiler/Checking/TypeRelations.fsi b/src/Compiler/Checking/TypeRelations.fsi index a33eb284c35..cdaa7aab8a6 100644 --- a/src/Compiler/Checking/TypeRelations.fsi +++ b/src/Compiler/Checking/TypeRelations.fsi @@ -63,17 +63,17 @@ val tryDestTopLambda: val destTopLambda: g: TcGlobals -> amap: ImportMap -> - topValInfo: ValReprInfo -> + valReprInfo: ValReprInfo -> e: Expr * ty: TType -> Typars * Val option * Val option * Val list list * Expr * TType /// Do AdjustArityOfLambdaBody for a series of iterated lambdas, producing one method. -/// The required iterated function arity (List.length topValInfo) must be identical +/// The required iterated function arity (List.length valReprInfo) must be identical /// to the iterated function arity of the input lambda (List.length vsl) val IteratedAdjustArityOfLambda: g: TcGlobals -> amap: ImportMap -> - topValInfo: ValReprInfo -> + valReprInfo: ValReprInfo -> e: Expr -> Typars * Val option * Val option * Val list list * Expr * TType diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index d2e3de58128..1bf87805a0b 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1054,7 +1054,7 @@ type ValStorage = /// Indicates the value is represented as an IL method (in a "main" class for a F# /// compilation unit, or as a member) according to its inferred or specified arity. | Method of - topValInfo: ValReprInfo * + valReprInfo: ValReprInfo * valRef: ValRef * ilMethSpec: ILMethodSpec * ilMethSpecWithWitnesses: ILMethodSpec * @@ -1517,22 +1517,22 @@ let ComputeStorageForFSharpValue amap (g: TcGlobals) cloc optIntraAssemblyInfo o StaticPropertyWithField(ilFieldSpec, vref, hasLiteralAttr, ilTyForProperty, nm, ilTy, ilGetterMethRef, ilSetterMethRef, optShadowLocal) /// Compute the representation information for an F#-declared member -let ComputeStorageForFSharpMember cenv topValInfo memberInfo (vref: ValRef) m = +let ComputeStorageForFSharpMember cenv valReprInfo memberInfo (vref: ValRef) m = let mspec, mspecW, ctps, mtps, curriedArgInfos, paramInfos, retInfo, witnessInfos, methodArgTys, _ = GetMethodSpecForMemberVal cenv memberInfo vref - Method(topValInfo, vref, mspec, mspecW, m, ctps, mtps, curriedArgInfos, paramInfos, witnessInfos, methodArgTys, retInfo) + Method(valReprInfo, vref, mspec, mspecW, m, ctps, mtps, curriedArgInfos, paramInfos, witnessInfos, methodArgTys, retInfo) /// Compute the representation information for an F#-declared function in a module or an F#-declared extension member. /// Note, there is considerable overlap with ComputeStorageForFSharpMember/GetMethodSpecForMemberVal and these could be /// rationalized. -let ComputeStorageForFSharpFunctionOrFSharpExtensionMember (cenv: cenv) cloc topValInfo (vref: ValRef) m = +let ComputeStorageForFSharpFunctionOrFSharpExtensionMember (cenv: cenv) cloc valReprInfo (vref: ValRef) m = let g = cenv.g let nm = vref.CompiledName g.CompilerGlobalState let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref let tps, witnessInfos, curriedArgInfos, returnTy, retInfo = - GetTopValTypeInCompiledForm g topValInfo numEnclosingTypars vref.Type m + GetTopValTypeInCompiledForm g valReprInfo numEnclosingTypars vref.Type m let tyenvUnderTypars = TypeReprEnv.Empty.ForTypars tps let methodArgTys, paramInfos = curriedArgInfos |> List.concat |> List.unzip @@ -1553,16 +1553,16 @@ let ComputeStorageForFSharpFunctionOrFSharpExtensionMember (cenv: cenv) cloc top mkILStaticMethSpecInTy (ilLocTy, ExtraWitnessMethodName nm, (ilWitnessArgTys @ ilMethodArgTys), ilRetTy, ilMethodInst) - Method(topValInfo, vref, mspec, mspecW, m, [], tps, curriedArgInfos, paramInfos, witnessInfos, methodArgTys, retInfo) + Method(valReprInfo, vref, mspec, mspecW, m, [], tps, curriedArgInfos, paramInfos, witnessInfos, methodArgTys, retInfo) /// Determine if an F#-declared value, method or function is compiled as a method. let IsFSharpValCompiledAsMethod g (v: Val) = match v.ValReprInfo with | None -> false - | Some topValInfo -> + | Some valReprInfo -> not (isUnitTy g v.Type && not v.IsMemberOrModuleBinding && not v.IsMutable) && not v.IsCompiledAsStaticPropertyWithoutField - && match GetTopValTypeInFSharpForm g topValInfo v.Type v.Range with + && match GetTopValTypeInFSharpForm g valReprInfo v.Type v.Range with | [], [], _, _ when not v.IsMember -> false | _ -> true @@ -1585,7 +1585,7 @@ let ComputeStorageForTopVal if isUnitTy g vref.Type && not vref.IsMemberOrModuleBinding && not vref.IsMutable then Null else - let topValInfo = + let valReprInfo = match vref.ValReprInfo with | None -> error (InternalError("ComputeStorageForTopVal: no arity found for " + showL (valRefL vref), vref.Range)) | Some a -> a @@ -1607,13 +1607,13 @@ let ComputeStorageForTopVal // // REVIEW: This call to GetTopValTypeInFSharpForm is only needed to determine if this is a (type) function or a value // We should just look at the arity - match GetTopValTypeInFSharpForm g topValInfo vref.Type vref.Range with + match GetTopValTypeInFSharpForm g valReprInfo vref.Type vref.Range with | [], [], returnTy, _ when not vref.IsMember -> ComputeStorageForFSharpValue cenv g cloc optIntraAssemblyInfo optShadowLocal isInteractive returnTy vref m | _ -> match vref.MemberInfo with - | Some memberInfo when not vref.IsExtensionMember -> ComputeStorageForFSharpMember cenv topValInfo memberInfo vref m - | _ -> ComputeStorageForFSharpFunctionOrFSharpExtensionMember cenv cloc topValInfo vref m + | Some memberInfo when not vref.IsExtensionMember -> ComputeStorageForFSharpMember cenv valReprInfo memberInfo vref m + | _ -> ComputeStorageForFSharpFunctionOrFSharpExtensionMember cenv cloc valReprInfo vref m /// Determine how an F#-declared value, function or member is represented, if it is in the assembly being compiled. let ComputeAndAddStorageForLocalTopVal (cenv, g, intraAssemblyFieldTable, isInteractive, optShadowLocal) cloc (v: Val) eenv = @@ -4162,8 +4162,8 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = (let storage = StorageForValRef m vref eenv match storage with - | Method (topValInfo, vref, _, _, _, _, _, _, _, _, _, _) -> - (let tps, argTys, _, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type m + | Method (valReprInfo, vref, _, _, _, _, _, _, _, _, _, _) -> + (let tps, argTys, _, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m tps.Length = tyargs.Length && argTys.Length <= curriedArgs.Length) | _ -> false) -> @@ -4171,14 +4171,14 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = let storage = StorageForValRef m vref eenv match storage with - | Method (topValInfo, vref, mspec, mspecW, _, ctps, mtps, curriedArgInfos, _, _, _, _) -> + | Method (valReprInfo, vref, mspec, mspecW, _, ctps, mtps, curriedArgInfos, _, _, _, _) -> let nowArgs, laterArgs = List.splitAt curriedArgInfos.Length curriedArgs let actualRetTy = applyTys cenv.g vref.Type (tyargs, nowArgs) let _, witnessInfos, curriedArgInfos, returnTy, _ = - GetTopValTypeInCompiledForm cenv.g topValInfo ctps.Length vref.Type m + GetTopValTypeInCompiledForm cenv.g valReprInfo ctps.Length vref.Type m let mspec = let generateWitnesses = ComputeGenerateWitnesses g eenv @@ -8121,10 +8121,10 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = CommitStartScope cgbuf startMarkOpt GenExpr cenv cgbuf eenv cctorBody discard - | Method (topValInfo, _, mspec, mspecW, _, ctps, mtps, curriedArgInfos, paramInfos, witnessInfos, argTys, retInfo) when not isStateVar -> + | Method (valReprInfo, _, mspec, mspecW, _, ctps, mtps, curriedArgInfos, paramInfos, witnessInfos, argTys, retInfo) when not isStateVar -> let methLambdaTypars, methLambdaCtorThisValOpt, methLambdaBaseValOpt, methLambdaCurriedVars, methLambdaBody, methLambdaBodyTy = - IteratedAdjustArityOfLambda g cenv.amap topValInfo rhsExpr + IteratedAdjustArityOfLambda g cenv.amap valReprInfo rhsExpr let methLambdaVars = List.concat methLambdaCurriedVars @@ -8148,7 +8148,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = paramInfos, argTys, retInfo, - topValInfo, + valReprInfo, methLambdaCtorThisValOpt, methLambdaBaseValOpt, methLambdaTypars, @@ -8177,7 +8177,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = paramInfos, argTys, retInfo, - topValInfo, + valReprInfo, methLambdaCtorThisValOpt, methLambdaBaseValOpt, methLambdaTypars, @@ -8783,7 +8783,7 @@ and GenMethodForBinding paramInfos, argTys, retInfo, - topValInfo, + valReprInfo, ctorThisValOpt, baseValOpt, methLambdaTypars, @@ -8868,7 +8868,7 @@ and GenMethodForBinding [ (mkLocalValRef v, BranchCallMethod( - topValInfo.AritiesOfArgs, + valReprInfo.AritiesOfArgs, curriedArgInfos, methLambdaTypars, selfMethodVars.Length, @@ -9379,7 +9379,7 @@ and GenGetStorageAndSequel (cenv: cenv) cgbuf eenv m (ty, ilTy) storage storeSeq CG.EmitInstr cgbuf (pop 0) (Push [ ilTy ]) (I_call(Normalcall, ilGetterMethSpec, None)) CommitGetStorageSequel cenv cgbuf eenv m ty None storeSequel - | Method (topValInfo, vref, _, _, _, _, _, _, _, _, _, _) -> + | Method (valReprInfo, vref, _, _, _, _, _, _, _, _, _, _) -> // Get a toplevel value as a first-class value. // We generate a lambda expression and that simply calls // the toplevel method. However we optimize the case where we are @@ -9387,7 +9387,7 @@ and GenGetStorageAndSequel (cenv: cenv) cgbuf eenv m (ty, ilTy) storage storeSeq // First build a lambda expression for the saturated use of the toplevel value... // REVIEW: we should NOT be doing this in the backend... - let expr, exprTy = AdjustValForExpectedArity g m vref NormalValUse topValInfo + let expr, exprTy = AdjustValForExpectedArity g m vref NormalValUse valReprInfo // Then reduce out any arguments (i.e. apply the sequel immediately if we can...) match storeSequel with diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 718cc21e87a..4bdb5262a0f 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -321,9 +321,9 @@ module GlobalUsageAnalysis = let internalError str = raise(Failure(str)) -let mkLocalVal m name ty topValInfo = +let mkLocalVal m name ty valReprInfo = let compgen = false - Construct.NewVal(name, m, None, ty, Immutable, compgen, topValInfo, taccessPublic, ValNotInRecScope, None, NormalVal, [], ValInline.Optional, XmlDoc.Empty, false, false, false, false, false, false, None, ParentNone) + Construct.NewVal(name, m, None, ty, Immutable, compgen, valReprInfo, taccessPublic, ValNotInRecScope, None, NormalVal, [], ValInline.Optional, XmlDoc.Empty, false, false, false, false, false, false, None, ParentNone) /// Represents inferred information about a tuple value type TupleStructure = @@ -467,7 +467,7 @@ let mkTransform g (f: Val) m tps x1Ntys retTy (callPattern, tyfringes: (TType li // Create transformedVal replacement for f // Mark the arity of the value - let topValInfo = + let valReprInfo = match f.ValReprInfo with | None -> None | _ -> Some(ValReprInfo (ValReprInfo.InferTyparInfo tps, List.collect ValReprInfoForTS callPattern, ValReprInfo.unnamedRetVal)) @@ -479,7 +479,7 @@ let mkTransform g (f: Val) m tps x1Ntys retTy (callPattern, tyfringes: (TType li let transformedVal = // Ensure that we have an g.CompilerGlobalState assert(g.CompilerGlobalState |> Option.isSome) - mkLocalVal f.Range (g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName (f.LogicalName, f.Range)) fCty topValInfo + mkLocalVal f.Range (g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName (f.LogicalName, f.Range)) fCty valReprInfo { transformCallPattern = callPattern transformedFormals = transformedFormals transformedVal = transformedVal } diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index 6a4afe2714c..a8e15eac7b1 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -86,8 +86,8 @@ let isDelayedRepr (f: Val) e = // REVIEW: these should just be replaced by direct calls to mkLocal, mkCompGenLocal etc. // REVIEW: However these set an arity whereas the others don't -let mkLocalNameTypeArity compgen m name ty topValInfo = - Construct.NewVal(name, m, None, ty, Immutable, compgen, topValInfo, taccessPublic, ValNotInRecScope, None, NormalVal, [], ValInline.Optional, XmlDoc.Empty, false, false, false, false, false, false, None, ParentNone) +let mkLocalNameTypeArity compgen m name ty valReprInfo = + Construct.NewVal(name, m, None, ty, Immutable, compgen, valReprInfo, taccessPublic, ValNotInRecScope, None, NormalVal, [], ValInline.Optional, XmlDoc.Empty, false, false, false, false, false, false, None, ParentNone) //------------------------------------------------------------------------- // definitions: TLR, arity, arity-met, arity-short diff --git a/src/Compiler/Optimize/LowerCalls.fs b/src/Compiler/Optimize/LowerCalls.fs index 5e58eea4911..3eebcc4437b 100644 --- a/src/Compiler/Optimize/LowerCalls.fs +++ b/src/Compiler/Optimize/LowerCalls.fs @@ -24,11 +24,11 @@ let InterceptExpr g cont expr = | Expr.App (Expr.Val (vref, flags, _) as f0, f0ty, tyargsl, argsl, m) -> // Only transform if necessary, i.e. there are not enough arguments match vref.ValReprInfo with - | Some(topValInfo) -> + | Some(valReprInfo) -> let argsl = List.map cont argsl let f0 = - if topValInfo.AritiesOfArgs.Length > argsl.Length - then fst(AdjustValForExpectedArity g m vref flags topValInfo) + if valReprInfo.AritiesOfArgs.Length > argsl.Length + then fst(AdjustValForExpectedArity g m vref flags valReprInfo) else f0 Some (MakeApplicationAndBetaReduce g (f0, f0ty, [tyargsl], argsl, m)) diff --git a/src/Compiler/Optimize/LowerLocalMutables.fs b/src/Compiler/Optimize/LowerLocalMutables.fs index 08b46d70727..a4ff9ba8f08 100644 --- a/src/Compiler/Optimize/LowerLocalMutables.fs +++ b/src/Compiler/Optimize/LowerLocalMutables.fs @@ -36,11 +36,11 @@ let DecideEscapes syntacticArgs body = frees.FreeLocals |> Zset.filter isMutableEscape /// Find all the mutable locals that escape a lambda expression, ignoring the arguments to the lambda -let DecideLambda exprF cenv topValInfo expr exprTy z = +let DecideLambda exprF cenv valReprInfo expr exprTy z = match stripDebugPoints expr with | Expr.Lambda _ | Expr.TyLambda _ -> - let _tps, ctorThisValOpt, baseValOpt, vsl, body, _bodyty = destTopLambda cenv.g cenv.amap topValInfo (expr, exprTy) + let _tps, ctorThisValOpt, baseValOpt, vsl, body, _bodyty = destTopLambda cenv.g cenv.amap valReprInfo (expr, exprTy) let snoc = fun x y -> y :: x let args = List.concat vsl let args = Option.fold snoc args baseValOpt @@ -78,14 +78,14 @@ let DecideExpr cenv exprF noInterceptF z expr = let g = cenv.g match stripDebugPoints expr with | Expr.Lambda (_, _ctorThisValOpt, _baseValOpt, argvs, _, m, bodyTy) -> - let topValInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy g m argvs bodyTy - DecideLambda (Some exprF) cenv topValInfo expr ty z + DecideLambda (Some exprF) cenv valReprInfo expr ty z | Expr.TyLambda (_, tps, _, _m, bodyTy) -> - let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) let ty = mkForallTyIfNeeded tps bodyTy - DecideLambda (Some exprF) cenv topValInfo expr ty z + DecideLambda (Some exprF) cenv valReprInfo expr ty z | Expr.Obj (_, _, baseValOpt, superInitCall, overrides, iimpls, _m) -> let CheckMethod z (TObjExprMethod(_, _attribs, _tps, vs, body, _m)) = @@ -111,8 +111,8 @@ let DecideExpr cenv exprF noInterceptF z expr = /// Find all the mutable locals that escape a binding let DecideBinding cenv z (TBind(v, expr, _m) as bind) = - let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData - DecideLambda None cenv topValInfo expr v.Type z + let valReprInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData + DecideLambda None cenv valReprInfo expr v.Type z /// Find all the mutable locals that escape a set of bindings let DecideBindings cenv z binds = (z, binds) ||> List.fold (DecideBinding cenv) diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 162b0f93c49..90e79010ed6 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -2367,14 +2367,14 @@ let rec OptimizeExpr cenv (env: IncrementalOptimizationEnv) expr = | None -> OptimizeApplication cenv env (f, fty, tyargs, argsl, m) | Expr.Lambda (_lambdaId, _, _, argvs, _body, m, bodyTy) -> - let topValInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo ([], [argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)], ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy g m argvs bodyTy - OptimizeLambdas None cenv env topValInfo expr ty + OptimizeLambdas None cenv env valReprInfo expr ty | Expr.TyLambda (_lambdaId, tps, _body, _m, bodyTy) -> - let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) + let valReprInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps, [], ValReprInfo.unnamedRetVal) let ty = mkForallTyIfNeeded tps bodyTy - OptimizeLambdas None cenv env topValInfo expr ty + OptimizeLambdas None cenv env valReprInfo expr ty | Expr.TyChoose _ -> OptimizeExpr cenv env (ChooseTyparSolutionsForFreeChoiceTypars g cenv.amap expr) @@ -3731,15 +3731,15 @@ and OptimizeFSharpDelegateInvoke cenv env (delInvokeRef, delExpr, delInvokeTy, d Info=ValueOfExpr newExpr } /// Optimize/analyze a lambda expression -and OptimizeLambdas (vspec: Val option) cenv env topValInfo expr exprTy = +and OptimizeLambdas (vspec: Val option) cenv env valReprInfo expr exprTy = let g = cenv.g match expr with | Expr.Lambda (lambdaId, _, _, _, _, m, _) | Expr.TyLambda (lambdaId, _, _, m, _) -> let env = { env with methEnv = { pipelineCount = 0 }} - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = IteratedAdjustArityOfLambda g cenv.amap topValInfo expr - let env = { env with functionVal = (match vspec with None -> None | Some v -> Some (v, topValInfo)) } + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = IteratedAdjustArityOfLambda g cenv.amap valReprInfo expr + let env = { env with functionVal = (match vspec with None -> None | Some v -> Some (v, valReprInfo)) } let env = Option.foldBack (BindInternalValToUnknown cenv) ctorThisValOpt env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env let env = BindTypeVarsToUnknown tps env diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index e2416af351e..24ffc3cb042 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -471,12 +471,12 @@ module FSharpExprConvert = // Too few arguments or incorrect tupling? Convert to a lambda and beta-reduce the // partially applied arguments to 'let' bindings - let topValInfo = + let valReprInfo = match vref.ValReprInfo with | None -> failwith ("no arity information found for F# value "+vref.LogicalName) | Some a -> a - let expr, exprTy = AdjustValForExpectedArity g m vref vFlags topValInfo + let expr, exprTy = AdjustValForExpectedArity g m vref vFlags valReprInfo let splitCallExpr = MakeApplicationAndBetaReduce g (expr, exprTy, [tyargs], curriedArgs, m) // tailcall ConvExprPrimLinear cenv env splitCallExpr contF @@ -1356,8 +1356,8 @@ and FSharpImplementationFileContents(cenv, mimpl) = let rec getBind (bind: Binding) = let v = bind.Var assert v.IsCompiledAsTopLevel - let topValInfo = InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v bind.Expr - let tps, _ctorThisValOpt, _baseValOpt, vsl, body, _bodyty = IteratedAdjustArityOfLambda g cenv.amap topValInfo bind.Expr + let valReprInfo = InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v bind.Expr + let tps, _ctorThisValOpt, _baseValOpt, vsl, body, _bodyty = IteratedAdjustArityOfLambda g cenv.amap valReprInfo bind.Expr let v = FSharpMemberOrFunctionOrValue(cenv, mkLocalValRef v) let gps = v.GenericParameters let vslR = List.mapSquared (FSharpExprConvert.ConvVal cenv) vsl diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 5cc97531e16..fd00a1f94bd 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -1750,8 +1750,8 @@ let destTopForallTy g (ValReprInfo (ntps, _, _)) ty = let tps = NormalizeDeclaredTyparsForEquiRecursiveInference g tps tps, tau -let GetTopValTypeInFSharpForm g (ValReprInfo(_, argInfos, retInfo) as topValInfo) ty m = - let tps, tau = destTopForallTy g topValInfo ty +let GetTopValTypeInFSharpForm g (ValReprInfo(_, argInfos, retInfo) as valReprInfo) ty m = + let tps, tau = destTopForallTy g valReprInfo ty let curriedArgTys, returnTy = GetTopTauTypeInFSharpForm g argInfos tau m tps, curriedArgTys, returnTy, retInfo @@ -2512,12 +2512,12 @@ let CountEnclosingTyparsOfActualParentOfVal (v: Val) = elif not v.IsMember then 0 else v.MemberApparentEntity.TyparsNoRange.Length -let GetTopValTypeInCompiledForm g topValInfo numEnclosingTypars ty m = - let tps, paramArgInfos, retTy, retInfo = GetTopValTypeInFSharpForm g topValInfo ty m +let GetTopValTypeInCompiledForm g valReprInfo numEnclosingTypars ty m = + let tps, paramArgInfos, retTy, retInfo = GetTopValTypeInFSharpForm g valReprInfo ty m let witnessInfos = GetTraitWitnessInfosOfTypars g numEnclosingTypars tps // Eliminate lone single unit arguments let paramArgInfos = - match paramArgInfos, topValInfo.ArgInfos with + match paramArgInfos, valReprInfo.ArgInfos with // static member and module value unit argument elimination | [[(_argType, _)]], [[]] -> //assert isUnitTy g argType @@ -2539,12 +2539,12 @@ let GetTopValTypeInCompiledForm g topValInfo numEnclosingTypars ty m = // This is used not only for the compiled form - it's also used for all type checking and object model // logic such as determining if abstract methods have been implemented or not, and how // many arguments the method takes etc. -let GetMemberTypeInMemberForm g memberFlags topValInfo numEnclosingTypars ty m = - let tps, paramArgInfos, retTy, retInfo = GetMemberTypeInFSharpForm g memberFlags topValInfo ty m +let GetMemberTypeInMemberForm g memberFlags valReprInfo numEnclosingTypars ty m = + let tps, paramArgInfos, retTy, retInfo = GetMemberTypeInFSharpForm g memberFlags valReprInfo ty m let witnessInfos = GetTraitWitnessInfosOfTypars g numEnclosingTypars tps // Eliminate lone single unit arguments let paramArgInfos = - match paramArgInfos, topValInfo.ArgInfos with + match paramArgInfos, valReprInfo.ArgInfos with // static member and module value unit argument elimination | [[(argType, _)]], [[]] -> assert isUnitTy g argType @@ -2560,13 +2560,13 @@ let GetMemberTypeInMemberForm g memberFlags topValInfo numEnclosingTypars ty m = let GetTypeOfMemberInMemberForm g (vref: ValRef) = //assert (not vref.IsExtensionMember) - let membInfo, topValInfo = checkMemberValRef vref + let membInfo, valReprInfo = checkMemberValRef vref let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref - GetMemberTypeInMemberForm g membInfo.MemberFlags topValInfo numEnclosingTypars vref.Type vref.Range + GetMemberTypeInMemberForm g membInfo.MemberFlags valReprInfo numEnclosingTypars vref.Type vref.Range let GetTypeOfMemberInFSharpForm g (vref: ValRef) = - let membInfo, topValInfo = checkMemberValRef vref - GetMemberTypeInFSharpForm g membInfo.MemberFlags topValInfo vref.Type vref.Range + let membInfo, valReprInfo = checkMemberValRef vref + GetMemberTypeInFSharpForm g membInfo.MemberFlags valReprInfo vref.Type vref.Range let PartitionValTyparsForApparentEnclosingType g (v: Val) = match v.ValReprInfo with @@ -2598,9 +2598,9 @@ let PartitionValRefTypars g (vref: ValRef) = PartitionValTypars g vref.Deref /// Get the arguments for an F# value that represents an object model method let ArgInfosOfMemberVal g (v: Val) = - let membInfo, topValInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range + let membInfo, valReprInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags topValInfo numEnclosingTypars v.Type v.Range + let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags valReprInfo numEnclosingTypars v.Type v.Range arginfos let ArgInfosOfMember g (vref: ValRef) = @@ -2615,18 +2615,18 @@ let GetFSharpViewOfReturnType (g: TcGlobals) retTy = /// Get the property "type" (getter return type) for an F# value that represents a getter or setter /// of an object model property. let ReturnTypeOfPropertyVal g (v: Val) = - let membInfo, topValInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range + let membInfo, valReprInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range match membInfo.MemberFlags.MemberKind with | SynMemberKind.PropertySet -> let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags topValInfo numEnclosingTypars v.Type v.Range + let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags valReprInfo numEnclosingTypars v.Type v.Range if not arginfos.IsEmpty && not arginfos.Head.IsEmpty then arginfos.Head |> List.last |> fst else error(Error(FSComp.SR.tastValueDoesNotHaveSetterType(), v.Range)) | SynMemberKind.PropertyGet -> let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let _, _, _, retTy, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags topValInfo numEnclosingTypars v.Type v.Range + let _, _, _, retTy, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags valReprInfo numEnclosingTypars v.Type v.Range GetFSharpViewOfReturnType g retTy | _ -> error(InternalError("ReturnTypeOfPropertyVal", v.Range)) @@ -2634,13 +2634,13 @@ let ReturnTypeOfPropertyVal g (v: Val) = /// Get the property arguments for an F# value that represents a getter or setter /// of an object model property. let ArgInfosOfPropertyVal g (v: Val) = - let membInfo, topValInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range + let membInfo, valReprInfo = checkMemberVal v.MemberInfo v.ValReprInfo v.Range match membInfo.MemberFlags.MemberKind with | SynMemberKind.PropertyGet -> ArgInfosOfMemberVal g v |> List.concat | SynMemberKind.PropertySet -> let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags topValInfo numEnclosingTypars v.Type v.Range + let _, _, arginfos, _, _ = GetMemberTypeInMemberForm g membInfo.MemberFlags valReprInfo numEnclosingTypars v.Type v.Range if not arginfos.IsEmpty && not arginfos.Head.IsEmpty then arginfos.Head |> List.frontAndBack |> fst else @@ -5546,11 +5546,11 @@ and remapValReprInfo ctxt tmenv (ValReprInfo(tpNames, arginfosl, retInfo)) = and remapValData ctxt tmenv (d: ValData) = let ty = d.val_type - let topValInfo = d.ValReprInfo + let valReprInfo = d.ValReprInfo let tyR = ty |> remapPossibleForallTyImpl ctxt tmenv let declaringEntityR = d.DeclaringEntity |> remapParentRef tmenv let reprInfoR = d.ValReprInfo |> Option.map (remapValReprInfo ctxt tmenv) - let memberInfoR = d.MemberInfo |> Option.map (remapMemberInfo ctxt d.val_range topValInfo ty tyR tmenv) + let memberInfoR = d.MemberInfo |> Option.map (remapMemberInfo ctxt d.val_range valReprInfo ty tyR tmenv) let attribsR = d.Attribs |> remapAttribs ctxt tmenv { d with val_type = tyR @@ -5935,12 +5935,12 @@ and remapTyconExnInfo ctxt tmenv inp = | TExnFresh x -> TExnFresh (remapRecdFields ctxt tmenv x) | TExnAsmRepr _ | TExnNone -> inp -and remapMemberInfo ctxt m topValInfo ty tyR tmenv x = +and remapMemberInfo ctxt m valReprInfo ty tyR tmenv x = // The slotsig in the ImplementedSlotSigs is w.r.t. the type variables in the value's type. // REVIEW: this is a bit gross. It would be nice if the slotsig was standalone - assert (Option.isSome topValInfo) - let tpsorig, _, _, _ = GetMemberTypeInFSharpForm ctxt.g x.MemberFlags (Option.get topValInfo) ty m - let tps, _, _, _ = GetMemberTypeInFSharpForm ctxt.g x.MemberFlags (Option.get topValInfo) tyR m + assert (Option.isSome valReprInfo) + let tpsorig, _, _, _ = GetMemberTypeInFSharpForm ctxt.g x.MemberFlags (Option.get valReprInfo) ty m + let tps, _, _, _ = GetMemberTypeInFSharpForm ctxt.g x.MemberFlags (Option.get valReprInfo) tyR m let renaming, _ = mkTyparToTyparRenaming tpsorig tps let tmenv = { tmenv with tpinst = tmenv.tpinst @ renaming } { x with @@ -7923,7 +7923,7 @@ let mkCompilerGeneratedAttr (g: TcGlobals) n = mkILCustomAttribute (tref_CompilationMappingAttr g, [mkILNonGenericValueTy (tref_SourceConstructFlags g)], [ILAttribElem.Int32 n], []) //-------------------------------------------------------------------------- -// tupled lambda --> method/function with a given topValInfo specification. +// tupled lambda --> method/function with a given valReprInfo specification. // // AdjustArityOfLambdaBody: "(vs, body)" represents a lambda "fun (vs) -> body". The // aim is to produce a "static method" represented by a pair @@ -8107,9 +8107,9 @@ let MakeArgsForTopArgs _g m argTysl tpenv = | Some id -> id.idText fst (mkCompGenLocal m nm ty))) -let AdjustValForExpectedArity g m (vref: ValRef) flags topValInfo = +let AdjustValForExpectedArity g m (vref: ValRef) flags valReprInfo = - let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type m + let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m let tpsR = copyTypars tps let tyargsR = List.map mkTyparTy tpsR let tpenv = bindTypars tps tyargsR emptyTyparInst @@ -9624,13 +9624,13 @@ let EvalLiteralExprOrAttribArg g x = // below is a little ugly. let GetTypeOfIntrinsicMemberInCompiledForm g (vref: ValRef) = assert (not vref.IsExtensionMember) - let membInfo, topValInfo = checkMemberValRef vref + let membInfo, valReprInfo = checkMemberValRef vref let tps, cxs, argInfos, retTy, retInfo = GetTypeOfMemberInMemberForm g vref let argInfos = // Check if the thing is really an instance member compiled as a static member // If so, the object argument counts as a normal argument in the compiled form if membInfo.MemberFlags.IsInstance && not (ValRefIsCompiledAsInstanceMember g vref) then - let _, origArgInfos, _, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type vref.Range + let _, origArgInfos, _, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type vref.Range match origArgInfos with | [] -> errorR(InternalError("value does not have a valid member type", vref.Range)) From 646de42211134d5ffc1e2ac0b54bfc884de238e3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 8 Jul 2022 19:26:49 +0100 Subject: [PATCH 025/226] ValRepInfoForDisplay added for improved quick info for functions defined in expressions --- src/Compiler/Checking/CheckExpressions.fs | 58 ++++++++++++------- src/Compiler/Checking/CheckExpressions.fsi | 3 +- .../Checking/CheckIncrementalClasses.fs | 8 +-- src/Compiler/Checking/NicePrint.fs | 3 +- src/Compiler/Checking/PostInferenceChecks.fs | 3 +- src/Compiler/Checking/PostInferenceChecks.fsi | 4 +- src/Compiler/TypedTree/TypedTree.fs | 31 ++++++++-- src/Compiler/TypedTree/TypedTree.fsi | 13 +++++ src/Compiler/TypedTree/TypedTreeBasics.fs | 18 +++++- src/Compiler/TypedTree/TypedTreeBasics.fsi | 4 ++ src/Compiler/TypedTree/TypedTreeOps.fs | 4 +- src/Compiler/TypedTree/TypedTreePickle.fs | 1 + 12 files changed, 112 insertions(+), 38 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 0de950283e7..a3114d259c5 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -578,6 +578,7 @@ type ValScheme = id: Ident * typeScheme: GeneralizedType * valReprInfo: ValReprInfo option * + valReprInfoForDisplay: ValReprInfo option * memberInfo: PrelimMemberInfo option * isMutable: bool * inlineInfo: ValInline * @@ -1500,7 +1501,7 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec let g = cenv.g - let (ValScheme(id, typeScheme, valReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme + let (ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme let ty = GeneralizedTypeForTypeScheme typeScheme @@ -1608,6 +1609,10 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec xmlDoc, isTopBinding, isExtrinsic, isIncrClass, isTyFunc, (hasDeclaredTypars || inSig), isGeneratedEventVal, konst, actualParent) + match valReprInfoForDisplay with + | Some info when not (ValReprInfo.IsEmpty info) -> + vspec.SetValReprInfoForDisplay valReprInfoForDisplay + | _ -> () CheckForAbnormalOperatorNames cenv id.idRange vspec.DisplayNameCoreMangled memberInfoOpt @@ -1641,10 +1646,11 @@ let MakeAndPublishVals cenv env (altActualParent, inSig, declKind, valRecInfo, v valSchemes Map.empty +/// Create a Val node for "base" in a class let MakeAndPublishBaseVal cenv env baseIdOpt ty = baseIdOpt |> Option.map (fun (id: Ident) -> - let valscheme = ValScheme(id, NonGenericTypeScheme ty, None, None, false, ValInline.Never, BaseVal, None, false, false, false, false) + let valscheme = ValScheme(id, NonGenericTypeScheme ty, None, None, None, false, ValInline.Never, BaseVal, None, false, false, false, false) MakeAndPublishVal cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valscheme, [], XmlDoc.Empty, None, false)) // Make the "delayed reference" value where the this pointer will reside after calling the base class constructor @@ -1657,7 +1663,7 @@ let MakeAndPublishSafeThisVal (cenv: cenv) env (thisIdOpt: Ident option) thisTy if not (isFSharpObjModelTy g thisTy) then errorR(Error(FSComp.SR.tcStructsCanOnlyBindThisAtMemberDeclaration(), thisId.idRange)) - let valScheme = ValScheme(thisId, NonGenericTypeScheme(mkRefCellTy g thisTy), None, None, false, ValInline.Never, CtorThisVal, None, false, false, false, false) + let valScheme = ValScheme(thisId, NonGenericTypeScheme(mkRefCellTy g thisTy), None, None, None, false, ValInline.Never, CtorThisVal, None, false, false, false, false) Some(MakeAndPublishVal cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valScheme, [], XmlDoc.Empty, None, false)) | None -> @@ -1742,11 +1748,11 @@ let ChooseCanonicalDeclaredTyparsAfterInference g denv declaredTypars m = declaredTypars let ChooseCanonicalValSchemeAfterInference g denv vscheme m = - let (ValScheme(id, typeScheme, arityInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme + let (ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme let (GeneralizedType(generalizedTypars, ty)) = typeScheme let generalizedTypars = ChooseCanonicalDeclaredTyparsAfterInference g denv generalizedTypars m let typeScheme = GeneralizedType(generalizedTypars, ty) - let valscheme = ValScheme(id, typeScheme, arityInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars) + let valscheme = ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars) valscheme let PlaceTyparsInDeclarationOrder declaredTypars generalizedTypars = @@ -1817,10 +1823,11 @@ let ComputeIsTyFunc(id: Ident, hasDeclaredTypars, arityInfo: ValReprInfo option) | Some info -> info.NumCurriedArgs = 0) let UseSyntacticArity declKind typeScheme prelimValReprInfo = + let valReprInfo = InferGenericArityFromTyScheme typeScheme prelimValReprInfo if DeclKind.MustHaveArity declKind then - Some(InferGenericArityFromTyScheme typeScheme prelimValReprInfo) + Some valReprInfo, None else - None + None, Some valReprInfo /// Combine the results of InferSynValData and InferArityOfExpr. // @@ -1855,18 +1862,17 @@ let UseSyntacticArity declKind typeScheme prelimValReprInfo = // { new Base with // member x.M(v: unit) = () } // -let CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme = +let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = let (PrelimVal2(_, typeScheme, partialValReprInfoOpt, memberInfoOpt, isMutable, _, _, ArgAndRetAttribs(argAttribs, retAttribs), _, _, _)) = prelimScheme - match partialValReprInfoOpt, DeclKind.MustHaveArity declKind with - | _, false -> None - | None, true -> Some(PrelimValReprInfo([], ValReprInfo.unnamedRetVal)) + match partialValReprInfoOpt with + | None -> Some(PrelimValReprInfo([], ValReprInfo.unnamedRetVal)) // Don't use any expression information for members, where syntax dictates the arity completely | _ when memberInfoOpt.IsSome -> partialValReprInfoOpt // Don't use any expression information for 'let' bindings where return attributes are present | _ when retAttribs.Length > 0 -> partialValReprInfoOpt - | Some partialValReprInfoFromSyntax, true -> + | Some partialValReprInfoFromSyntax -> let (PrelimValReprInfo(curriedArgInfosFromSyntax, retInfoFromSyntax)) = partialValReprInfoFromSyntax let partialArityInfo = if isMutable then @@ -1897,18 +1903,28 @@ let CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme = Some partialArityInfo +// "let"/"pat" --> TcLetBinding, SynPat, SynSimplePat: Syn* --> PrelimVal1 --> PrelimVal2 --> ValScheme --> Val +// "let rec"/"member"/...., SynPat, SynSimplePat: Syn* --> Val ---> Checking --> Incremental Generalization --> Fixup Val with inferred types + let BuildValScheme declKind partialArityInfoOpt prelimScheme = let (PrelimVal2(id, typeScheme, _, memberInfoOpt, isMutable, inlineFlag, baseOrThis, _, vis, isCompGen, hasDeclaredTypars)) = prelimScheme - let valReprInfo = + let valReprInfoOpt = + match partialArityInfoOpt with + | Some partialValReprInfo -> + let valReprInfo = InferGenericArityFromTyScheme typeScheme partialValReprInfo + Some valReprInfo + | None -> + None + let valReprInfo, valReprInfoForDisplay = if DeclKind.MustHaveArity declKind then - Option.map (InferGenericArityFromTyScheme typeScheme) partialArityInfoOpt + valReprInfoOpt, None else - None + None, valReprInfoOpt let isTyFunc = ComputeIsTyFunc(id, hasDeclaredTypars, valReprInfo) - ValScheme(id, typeScheme, valReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, false, isTyFunc, hasDeclaredTypars) + ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, false, isTyFunc, hasDeclaredTypars) let UseCombinedArity g declKind rhsExpr prelimScheme = - let partialArityInfoOpt = CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme + let partialArityInfoOpt = CombineSyntacticAndInferredArities g rhsExpr prelimScheme BuildValScheme declKind partialArityInfoOpt prelimScheme let UseNoArity prelimScheme = @@ -10229,7 +10245,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt | [] -> valSynData | {Range=mHead} :: _ -> let (SynValData(valMf, SynValInfo(args, SynArgInfo(attrs, opt, retId)), valId)) = valSynData - in SynValData(valMf, SynValInfo(args, SynArgInfo({Attributes=rotRetSynAttrs; Range=mHead} :: attrs, opt, retId)), valId) + SynValData(valMf, SynValInfo(args, SynArgInfo({Attributes=rotRetSynAttrs; Range=mHead} :: attrs, opt, retId)), valId) retAttribs, valAttribs, valSynData let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute valAttribs @@ -10779,7 +10795,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds // If the overall declaration is declaring statics or a module value, then force the patternInputTmp to also // have representation as module value. - if (DeclKind.MustHaveArity declKind) then + if DeclKind.MustHaveArity declKind then AdjustValToTopVal tmp altActualParent (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes tmp rhsExpr) tmp, checkedPat @@ -11355,9 +11371,9 @@ and AnalyzeAndMakeAndPublishRecursiveValue // NOTE: top arity, type and typars get fixed-up after inference let prelimTyscheme = GeneralizedType(enclosingDeclaredTypars@declaredTypars, ty) let prelimValReprInfo = TranslateSynValInfo mBinding (TcAttributes cenv envinner) valSynInfo - let valReprInfo = UseSyntacticArity declKind prelimTyscheme prelimValReprInfo + let valReprInfo, valReprInfoForDisplay = UseSyntacticArity declKind prelimTyscheme prelimValReprInfo let hasDeclaredTypars = not (List.isEmpty declaredTypars) - let prelimValScheme = ValScheme(bindingId, prelimTyscheme, valReprInfo, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) + let prelimValScheme = ValScheme(bindingId, prelimTyscheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) // Check the literal r.h.s., if any let _, literalValue = TcLiteral cenv ty envinner tpenv (bindingAttribs, bindingExpr) diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 831a4cf9b20..8b5f1878532 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -584,12 +584,13 @@ type RecursiveBindingInfo = [] type CheckedBindingInfo -/// Represnts the results of the second phase of checking simple values +/// Represents the results of the second phase of checking simple values type ValScheme = | ValScheme of id: Ident * typeScheme: GeneralizedType * valReprInfo: ValReprInfo option * + valReprInfoForDisplay: ValReprInfo option * memberInfo: PrelimMemberInfo option * isMutable: bool * inlineInfo: ValInline * diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index f4371e3c925..f225a9927e8 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -133,7 +133,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, ctorTy) let isComplete = ComputeIsComplete copyOfTyconTypars [] ctorTy let varReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let ctorValScheme = ValScheme(id, prelimTyschemeG, Some varReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) + let ctorValScheme = ValScheme(id, prelimTyschemeG, Some varReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) let paramNames = varReprInfo.ArgNames let xmlDoc = xmlDoc.ToXmlDoc(true, Some paramNames) let ctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValInRecScope isComplete, ctorValScheme, attribs, xmlDoc, None, false) @@ -154,7 +154,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let prelimValReprInfo = TranslateSynValInfo m (TcAttributes cenv env) valSynData let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, cctorTy) let valReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let cctorValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) + let cctorValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) let cctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, cctorValScheme, [(* no attributes*)], XmlDoc.Empty, None, false) cctorArgs, cctorVal, cctorValScheme @@ -162,7 +162,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let thisVal = // --- Create this for use inside constructor let thisId = ident ("this", m) - let thisValScheme = ValScheme(thisId, NonGenericTypeScheme thisTy, None, None, false, ValInline.Never, CtorThisVal, None, true, false, false, false) + let thisValScheme = ValScheme(thisId, NonGenericTypeScheme thisTy, None, None, None, false, ValInline.Never, CtorThisVal, None, true, false, false, false) let thisVal = MakeAndPublishVal cenv env (ParentNone, false, ClassLetBinding false, ValNotInRecScope, thisValScheme, [], XmlDoc.Empty, None, false) thisVal @@ -350,7 +350,7 @@ type IncrClassReprInfo = // NOTE: putting isCompilerGenerated=true here is strange. The method is not public, nor is // it a "member" in the F# sense, but the F# spec says it is generated and it is reasonable to reflect on it. - let memberValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) + let memberValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) let methodVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, memberValScheme, v.Attribs, XmlDoc.Empty, None, false) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 3a398620de9..6d8b38c7956 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1270,7 +1270,8 @@ module PrintTastMemberOrVals = let layoutNonMemberVal denv (tps, v: Val, tau, cxs) = let env = SimplifyTypes.CollectInfo true [tau] cxs let cxs = env.postfixConstraints - let argInfos, retTy = GetTopTauTypeInFSharpForm denv.g (arityOfVal v).ArgInfos tau v.Range + let valReprInfo = arityOfValForDisplay v + let argInfos, retTy = GetTopTauTypeInFSharpForm denv.g valReprInfo.ArgInfos tau v.Range let nameL = let tagF = diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 1459fc99984..bea20761e41 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -1977,7 +1977,8 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bind) : Limit = +and CheckBinding cenv env alwaysCheckNoReraise ctxt bind : Limit = + let (TBind(v, bindRhs, _)) = bind let vref = mkLocalValRef v let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo diff --git a/src/Compiler/Checking/PostInferenceChecks.fsi b/src/Compiler/Checking/PostInferenceChecks.fsi index 6e289af71c8..4230c06e371 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fsi +++ b/src/Compiler/Checking/PostInferenceChecks.fsi @@ -10,7 +10,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals -/// Perform the checks on the TAST for a file after type inference is complete. +/// Perform the checks on the TypedTree for a file after type inference is complete. val CheckImplFile: g: TcGlobals * amap: ImportMap * @@ -23,6 +23,6 @@ val CheckImplFile: implFileTy: ModuleOrNamespaceType * implFileContents: ModuleOrNamespaceContents * extraAttribs: Attribs * - (bool * bool) * + isLastCompiland: (bool * bool) * isInternalTestSpanStackReferring: bool -> bool * StampMap diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 3b328134868..23d252f0e84 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2488,6 +2488,9 @@ type ValOptionalData = /// Used to implement [] mutable val_defn: Expr option + /// Records the "extra information" for a value compiled as a method (rather + /// than a closure or a local), including argument names, attributes etc. + // // MUTABILITY CLEANUP: mutability of this field is used by // -- adjustAllUsesOfRecValue // -- TLR optimizations @@ -2497,6 +2500,10 @@ type ValOptionalData = // type-checked expression. mutable val_repr_info: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + mutable val_repr_info_for_display: ValReprInfo option + /// How visible is this? /// MUTABILITY: for unpickle linkage mutable val_access: Accessibility @@ -2556,6 +2563,7 @@ type Val = val_const = None val_defn = None val_repr_info = None + val_repr_info_for_display = None val_access = TAccess [] val_xmldoc = XmlDoc.Empty val_member_info = None @@ -2620,6 +2628,11 @@ type Val = | Some optData -> optData.val_repr_info | _ -> None + member x.ValReprInfoForDisplay: ValReprInfo option = + match x.val_opt_data with + | Some optData -> optData.val_repr_info_for_display + | _ -> None + member x.Id = ident(x.LogicalName, x.Range) /// Is this represented as a "top level" static binding (i.e. a static field, static member, @@ -2996,34 +3009,39 @@ type Val = member x.SetValReprInfo info = match x.val_opt_data with | Some optData -> optData.val_repr_info <- info - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info = info } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info = info } + + member x.SetValReprInfoForDisplay info = + match x.val_opt_data with + | Some optData -> optData.val_repr_info_for_display <- info + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info_for_display = info } member x.SetType ty = x.val_type <- ty member x.SetOtherRange m = match x.val_opt_data with | Some optData -> optData.val_other_range <- Some m - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_other_range = Some m } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_other_range = Some m } member x.SetDeclaringEntity parent = match x.val_opt_data with | Some optData -> optData.val_declaring_entity <- parent - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_declaring_entity = parent } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_declaring_entity = parent } member x.SetAttribs attribs = match x.val_opt_data with | Some optData -> optData.val_attribs <- attribs - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_attribs = attribs } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_attribs = attribs } member x.SetMemberInfo member_info = match x.val_opt_data with | Some optData -> optData.val_member_info <- Some member_info - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_member_info = Some member_info } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_member_info = Some member_info } member x.SetValDefn val_defn = match x.val_opt_data with | Some optData -> optData.val_defn <- Some val_defn - | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_defn = Some val_defn } + | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_defn = Some val_defn } /// Create a new value with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Val = @@ -3055,6 +3073,7 @@ type Val = val_other_range = tg.val_other_range val_const = tg.val_const val_defn = tg.val_defn + val_repr_info_for_display = tg.val_repr_info_for_display val_repr_info = tg.val_repr_info val_access = tg.val_access val_xmldoc = tg.val_xmldoc diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index d2a23e73038..50eec286e7b 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1777,8 +1777,15 @@ type ValOptionalData = /// What is the original, unoptimized, closed-term definition, if any? /// Used to implement [] mutable val_defn: Expr option + + /// Records the "extra information" for a value compiled as a method (rather + /// than a closure or a local), including argument names, attributes etc. mutable val_repr_info: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + mutable val_repr_info_for_display: ValReprInfo option + /// How visible is this? /// MUTABILITY: for unpickle linkage mutable val_access: Accessibility @@ -1888,6 +1895,8 @@ type Val = member SetValReprInfo: info: ValReprInfo option -> unit + member SetValReprInfoForDisplay: info: ValReprInfo option -> unit + override ToString: unit -> string /// How visible is this value, function or member? @@ -2134,6 +2143,10 @@ type Val = /// represent as "top level" bindings. member ValReprInfo: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + member ValReprInfoForDisplay: ValReprInfo option + /// Get the declared documentation for the value member XmlDoc: XmlDoc diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index b0020664ff7..e3010176807 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -41,6 +41,11 @@ module ValReprInfo = let emptyValData = ValReprInfo([], [], unnamedRetVal) + let IsEmpty info = + match info with + | ValReprInfo([], [], { Attribs = []; Name=None }) -> true + | _ -> false + let InferTyparInfo (tps: Typar list) = tps |> List.map (fun tp -> TyparReprInfo(tp.Id, tp.Kind)) let InferArgReprInfo (v: Val) : ArgReprInfo = { Attribs = []; Name= Some v.Id } @@ -59,7 +64,18 @@ let typesOfVals (v: Val list) = v |> List.map (fun v -> v.Type) let nameOfVal (v: Val) = v.LogicalName -let arityOfVal (v: Val) = (match v.ValReprInfo with None -> ValReprInfo.emptyValData | Some arities -> arities) +let arityOfVal (v: Val) = + match v.ValReprInfo with + | None -> ValReprInfo.emptyValData + | Some info -> info + +let arityOfValForDisplay (v: Val) = + match v.ValReprInfoForDisplay with + | Some info -> info + | None -> + match v.ValReprInfo with + | None -> ValReprInfo.emptyValData + | Some info -> info let tupInfoRef = TupInfo.Const false diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index 246a9e74baa..fe4930a71d7 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -29,6 +29,8 @@ module ValReprInfo = val emptyValData: ValReprInfo + val IsEmpty: ValReprInfo -> bool + val InferTyparInfo: tps: Typar list -> TyparReprInfo list val InferArgReprInfo: v: Val -> ArgReprInfo @@ -45,6 +47,8 @@ val nameOfVal: v: Val -> string val arityOfVal: v: Val -> ValReprInfo +val arityOfValForDisplay: v: Val -> ValReprInfo + val tupInfoRef: TupInfo val tupInfoStruct: TupInfo diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index fd00a1f94bd..ca7acd4cc12 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -5359,8 +5359,10 @@ let InferArityOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttri (ids, attribs) ||> List.map2 (fun id attribs -> { Name = id; Attribs = attribs }: ArgReprInfo )) let retInfo: ArgReprInfo = { Attribs = retAttribs; Name = None } - ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) + let info = ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) + if ValReprInfo.IsEmpty info then ValReprInfo.emptyValData else info +let x = 1 let InferArityOfExprBinding g allowTypeDirectedDetupling (v: Val) expr = match v.ValReprInfo with | Some info -> info diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index eda40c33fb5..3f5ba37afde 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -2353,6 +2353,7 @@ and u_ValData st = val_other_range = (match x1a with None -> None | Some(_, b) -> Some(b, true)) val_defn = None val_repr_info = x10 + val_repr_info_for_display = None val_const = x14 val_access = x13 val_xmldoc = defaultArg x15 XmlDoc.Empty From e3e39732adc1870d0b33a78a5480ccf8190b3edf Mon Sep 17 00:00:00 2001 From: Peter Semkin Date: Mon, 11 Jul 2022 15:55:10 +0200 Subject: [PATCH 026/226] Update --- src/Compiler/Checking/CheckExpressions.fs | 12 +++--------- src/Compiler/Checking/PostInferenceChecks.fs | 3 +-- src/Compiler/Checking/PostInferenceChecks.fsi | 4 ++-- src/Compiler/TypedTree/TypedTree.fs | 16 ++++++++-------- src/Compiler/TypedTree/TypedTree.fsi | 4 ++-- src/Compiler/TypedTree/TypedTreeBasics.fs | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 1 - 7 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index a3114d259c5..d513a326a74 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -1903,18 +1903,12 @@ let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = Some partialArityInfo -// "let"/"pat" --> TcLetBinding, SynPat, SynSimplePat: Syn* --> PrelimVal1 --> PrelimVal2 --> ValScheme --> Val -// "let rec"/"member"/...., SynPat, SynSimplePat: Syn* --> Val ---> Checking --> Incremental Generalization --> Fixup Val with inferred types - let BuildValScheme declKind partialArityInfoOpt prelimScheme = let (PrelimVal2(id, typeScheme, _, memberInfoOpt, isMutable, inlineFlag, baseOrThis, _, vis, isCompGen, hasDeclaredTypars)) = prelimScheme let valReprInfoOpt = - match partialArityInfoOpt with - | Some partialValReprInfo -> - let valReprInfo = InferGenericArityFromTyScheme typeScheme partialValReprInfo - Some valReprInfo - | None -> - None + partialArityInfoOpt + |> Option.map (InferGenericArityFromTyScheme typeScheme) + let valReprInfo, valReprInfoForDisplay = if DeclKind.MustHaveArity declKind then valReprInfoOpt, None diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index bea20761e41..1459fc99984 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -1977,8 +1977,7 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise ctxt bind : Limit = - let (TBind(v, bindRhs, _)) = bind +and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bind) : Limit = let vref = mkLocalValRef v let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo diff --git a/src/Compiler/Checking/PostInferenceChecks.fsi b/src/Compiler/Checking/PostInferenceChecks.fsi index 4230c06e371..6e289af71c8 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fsi +++ b/src/Compiler/Checking/PostInferenceChecks.fsi @@ -10,7 +10,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals -/// Perform the checks on the TypedTree for a file after type inference is complete. +/// Perform the checks on the TAST for a file after type inference is complete. val CheckImplFile: g: TcGlobals * amap: ImportMap * @@ -23,6 +23,6 @@ val CheckImplFile: implFileTy: ModuleOrNamespaceType * implFileContents: ModuleOrNamespaceContents * extraAttribs: Attribs * - isLastCompiland: (bool * bool) * + (bool * bool) * isInternalTestSpanStackReferring: bool -> bool * StampMap diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 23d252f0e84..2d3f8c0943f 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2501,7 +2501,7 @@ type ValOptionalData = mutable val_repr_info: ValReprInfo option /// Records the "extra information" for display purposes for expression-level function definitions - /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). mutable val_repr_info_for_display: ValReprInfo option /// How visible is this? @@ -3009,39 +3009,39 @@ type Val = member x.SetValReprInfo info = match x.val_opt_data with | Some optData -> optData.val_repr_info <- info - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info = info } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info = info } member x.SetValReprInfoForDisplay info = match x.val_opt_data with | Some optData -> optData.val_repr_info_for_display <- info - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info_for_display = info } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info_for_display = info } member x.SetType ty = x.val_type <- ty member x.SetOtherRange m = match x.val_opt_data with | Some optData -> optData.val_other_range <- Some m - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_other_range = Some m } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_other_range = Some m } member x.SetDeclaringEntity parent = match x.val_opt_data with | Some optData -> optData.val_declaring_entity <- parent - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_declaring_entity = parent } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_declaring_entity = parent } member x.SetAttribs attribs = match x.val_opt_data with | Some optData -> optData.val_attribs <- attribs - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_attribs = attribs } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_attribs = attribs } member x.SetMemberInfo member_info = match x.val_opt_data with | Some optData -> optData.val_member_info <- Some member_info - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_member_info = Some member_info } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_member_info = Some member_info } member x.SetValDefn val_defn = match x.val_opt_data with | Some optData -> optData.val_defn <- Some val_defn - | None -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_defn = Some val_defn } + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_defn = Some val_defn } /// Create a new value with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Val = diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 50eec286e7b..cdcf93e4518 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1783,7 +1783,7 @@ type ValOptionalData = mutable val_repr_info: ValReprInfo option /// Records the "extra information" for display purposes for expression-level function definitions - /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). mutable val_repr_info_for_display: ValReprInfo option /// How visible is this? @@ -2144,7 +2144,7 @@ type Val = member ValReprInfo: ValReprInfo option /// Records the "extra information" for display purposes for expression-level function definitions - /// that may be compiled as closures (that is are not-necessarily compiled as top-level methods). + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). member ValReprInfoForDisplay: ValReprInfo option /// Get the declared documentation for the value diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index e3010176807..1ec0b619604 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -26,7 +26,7 @@ let getNameOfScopeRef sref = | ILScopeRef.Assembly aref -> aref.Name | ILScopeRef.PrimaryAssembly -> "" -/// Metadata on values (names of arguments etc. +/// Metadata on values (names of arguments etc.) module ValReprInfo = let unnamedTopArg1: ArgReprInfo = { Attribs=[]; Name=None } diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index ca7acd4cc12..cef7fe70b74 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -5362,7 +5362,6 @@ let InferArityOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttri let info = ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) if ValReprInfo.IsEmpty info then ValReprInfo.emptyValData else info -let x = 1 let InferArityOfExprBinding g allowTypeDirectedDetupling (v: Val) expr = match v.ValReprInfo with | Some info -> info From d5ebbb257168fbbe567b36313c1503ae34f197bd Mon Sep 17 00:00:00 2001 From: Peter Semkin Date: Mon, 11 Jul 2022 16:08:17 +0200 Subject: [PATCH 027/226] Update QuickInfoTests.fs --- vsintegration/tests/UnitTests/QuickInfoTests.fs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index d255f0f3d34..2eba8d122ca 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -476,3 +476,20 @@ module Test = StringAssert.StartsWith(expectedSignature, tooltip) () + +[] +let ``Automation.LetBindings.InsideExpression``() = + let code = """ +namespace FsTest + +module Test = + do + let fu$$nc x = () +""" + + let expectedSignature = "val func: x: 'a -> unit" + + let tooltip = GetQuickInfoTextFromCode code + + StringAssert.StartsWith(expectedSignature, tooltip) + () From ff8cf853d33b4e8bfbf56728c97acd62cf07ff9c Mon Sep 17 00:00:00 2001 From: Peter Semkin Date: Mon, 11 Jul 2022 16:18:49 +0200 Subject: [PATCH 028/226] Update QuickInfoTests.fs --- .../tests/UnitTests/QuickInfoTests.fs | 49 ++++--------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index 2eba8d122ca..4be1be1115b 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -428,65 +428,34 @@ module Test = Assert.AreEqual(expected, quickInfo) () -[] -let ``Automation.LetBindings.InsideModule``() = - let code = """ +[] -let ``Automation.LetBindings.InsideType.Instance``() = - let code = """ +""">] +[] -let ``Automation.LetBindings.InsideType.Static``() = - let code = """ +""">] +[] -let ``Automation.LetBindings.InsideExpression``() = - let code = """ +""">] +[] +let ``Automation.LetBindings`` code = let expectedSignature = "val func: x: 'a -> unit" let tooltip = GetQuickInfoTextFromCode code From 662422e1c221a26206bc15146f2b633f933d5241 Mon Sep 17 00:00:00 2001 From: Peter Semkin Date: Mon, 11 Jul 2022 16:39:05 +0200 Subject: [PATCH 029/226] Update --- vsintegration/tests/UnitTests/QuickInfoTests.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index 4be1be1115b..0e65489a70d 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -454,6 +454,7 @@ namespace FsTest module Test = do let fu$$nc x = () + () """>] let ``Automation.LetBindings`` code = let expectedSignature = "val func: x: 'a -> unit" From de49e2f14f4c0ce3c1f9567c18a9f4713ae3151d Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 11 Jul 2022 16:44:32 +0100 Subject: [PATCH 030/226] add identifier analysis script (#13486) * add identifier analysis script * add identifier analysis script --- tests/scripts/identifierAnalysisByType.fsx | 152 +++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 tests/scripts/identifierAnalysisByType.fsx diff --git a/tests/scripts/identifierAnalysisByType.fsx b/tests/scripts/identifierAnalysisByType.fsx new file mode 100644 index 00000000000..7ac8de7a20b --- /dev/null +++ b/tests/scripts/identifierAnalysisByType.fsx @@ -0,0 +1,152 @@ +// Print some stats about identifiers grouped by type +// + +#r "nuget: Ionide.ProjInfo" +#I @"..\..\artifacts\bin\fsc\Debug\net6.0\" +#r "FSharp.Compiler.Service.dll" + +open System +open System.IO +open Ionide.ProjInfo +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols +open Ionide.ProjInfo.Types + +let argv = fsi.CommandLineArgs + +if argv.Length = 1 then + eprintfn "usage:" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx " + eprintfn "" + eprintfn "examples:" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx src/FSharp.Build/FSharp.Build.fsproj" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx src/Compiler/FSharp.Compiler.Service.fsproj" + eprintfn "" + eprintfn "Sample output is at https://gist.github.com/dsyme/abfa11bebf0713251418906d55c08804" + +//let projectFile = Path.Combine(__SOURCE_DIRECTORY__, @"..\..\src\Compiler\FSharp.Compiler.Service.fsproj") +//let projectFile = Path.Combine(__SOURCE_DIRECTORY__, @"..\..\src\FSharp.Build\FSharp.Build.fsproj") +let projectFile = Path.GetFullPath(argv[1]) + +let cwd = System.Environment.CurrentDirectory |> System.IO.DirectoryInfo + +let _toolsPath = Init.init cwd None + +printfn "Cracking project options...." +let opts = + match ProjectLoader.getProjectInfo projectFile [] BinaryLogGeneration.Off [] with + | Result.Ok res -> res + | Result.Error err -> failwithf "%s" err + +let checker = FSharpChecker.Create() + +let checkerOpts = checker.GetProjectOptionsFromCommandLineArgs(projectFile, [| yield! opts.SourceFiles; yield! opts.OtherOptions |] ) + +printfn "Checking project...." +let results = checker.ParseAndCheckProject(checkerOpts) |> Async.RunSynchronously + +printfn "Grouping symbol uses...." +let symbols = results.GetAllUsesOfAllSymbols() + +let rec stripTy (ty: FSharpType) = + if ty.IsAbbreviation then stripTy ty.AbbreviatedType else ty + +let getTypeText (sym: FSharpMemberOrFunctionOrValue) = + let ty = stripTy sym.FullType + FSharpType.Prettify(ty).Format(FSharpDisplayContext.Empty) + +symbols +|> Array.choose (fun vUse -> match vUse.Symbol with :? FSharpMemberOrFunctionOrValue as v -> Some (v, vUse.Range) | _ -> None) +|> Array.filter (fun (v, _) -> v.GenericParameters.Count = 0) +|> Array.filter (fun (v, _) -> v.CurriedParameterGroups.Count = 0) +|> Array.filter (fun (v, _) -> not v.FullType.IsGenericParameter) +|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse) +|> Array.filter (fun (vTypeText, v, _) -> + match vTypeText with + | "System.String" -> false + | "System.Boolean" -> false + | "System.Int32" -> false + | "System.Int64" -> false + | "System.Object" -> false + | "Microsoft.FSharp.Collections.List" -> false + | "Microsoft.FSharp.Core.Option" -> false + | s when s.EndsWith(" Microsoft.FSharp.Core.[]") -> false // for now filter array types + | _ when v.DisplayName.StartsWith "_" -> false + | _ -> true) +|> Array.groupBy (fun (vTypeText, _, _) -> vTypeText) +|> Array.map (fun (key, g) -> + key, + (g + |> Array.groupBy (fun (_, v, _) -> v.DisplayName) + |> Array.sortByDescending (snd >> Array.length))) +|> Array.filter (fun (_, g) -> g.Length > 1) +|> Array.sortByDescending (fun (key, g) -> Array.length g) +|> Array.iter (fun (key, g) -> + let key = key.Replace("Microsoft.FSharp", "FSharp").Replace("FSharp.Core.", "") + printfn "Type: %s" key + for (nm, entries) in g do + printfn " %s (%d times)" nm (Array.length entries) + for (_, _, vUse) in entries do + printfn " %s" (vUse.ToString()) + printfn "") + +(* +let isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + +let dotnet = + if isWindows then + "dotnet.exe" + else + "dotnet" +let fileExists pathToFile = + try + File.Exists(pathToFile) + with _ -> + false +// Look for global install of dotnet sdk +let getDotnetGlobalHostPath () = + let pf = Environment.GetEnvironmentVariable("ProgramW6432") + + let pf = + if String.IsNullOrEmpty(pf) then + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + else + pf + + let candidate = Path.Combine(pf, "dotnet", dotnet) + + if fileExists candidate then + Some candidate + else + // Can't find it --- give up + None + +let getDotnetHostPath () = + let probePathForDotnetHost () = + let paths = + let p = Environment.GetEnvironmentVariable("PATH") + + if not (isNull p) then + p.Split(Path.PathSeparator) + else + [||] + + paths |> Array.tryFind (fun f -> fileExists (Path.Combine(f, dotnet))) + + match (Environment.GetEnvironmentVariable("DOTNET_HOST_PATH")) with + // Value set externally + | value when not (String.IsNullOrEmpty(value)) && fileExists value -> Some value + | _ -> + // Probe for netsdk install, dotnet. and dotnet.exe is a constant offset from the location of System.Int32 + let candidate = + let assemblyLocation = Path.GetDirectoryName(typeof.Assembly.Location) + Path.GetFullPath(Path.Combine(assemblyLocation, "..", "..", "..", dotnet)) + + if fileExists candidate then + Some candidate + else + match probePathForDotnetHost () with + | Some f -> Some(Path.Combine(f, dotnet)) + | None -> getDotnetGlobalHostPath () +let dotnetExe = getDotnetHostPath () |> Option.map System.IO.FileInfo +*) From 575d5e7519fda9621730a0fceeb5334b9bc7c584 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 11 Jul 2022 18:01:44 +0200 Subject: [PATCH 031/226] Update fantomas alpha 11 (#13481) --- .config/dotnet-tools.json | 2 +- src/Compiler/AbstractIL/il.fs | 62 ++-- src/Compiler/AbstractIL/ilnativeres.fs | 12 +- src/Compiler/AbstractIL/ilprint.fs | 60 ++-- src/Compiler/AbstractIL/ilread.fs | 81 +++--- src/Compiler/AbstractIL/ilreflect.fs | 57 ++-- src/Compiler/AbstractIL/ilsupp.fs | 6 +- src/Compiler/AbstractIL/ilsupp.fsi | 12 +- src/Compiler/AbstractIL/ilwritepdb.fs | 22 +- src/Compiler/AbstractIL/ilx.fs | 2 +- src/Compiler/AbstractIL/ilx.fsi | 2 +- src/Compiler/CodeGen/EraseClosures.fs | 16 +- src/Compiler/CodeGen/EraseUnions.fs | 17 +- src/Compiler/CodeGen/IlxGen.fs | 275 +++++++++++------- src/Compiler/Driver/CompilerConfig.fs | 26 +- src/Compiler/Driver/CompilerDiagnostics.fs | 13 +- src/Compiler/Driver/CompilerImports.fs | 29 +- src/Compiler/Driver/CompilerOptions.fs | 17 +- src/Compiler/Driver/CreateILModule.fs | 25 +- src/Compiler/Driver/FxResolver.fs | 24 +- src/Compiler/Driver/OptimizeInputs.fs | 6 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 3 +- src/Compiler/Driver/ScriptClosure.fs | 3 +- src/Compiler/Driver/StaticLinking.fs | 13 +- src/Compiler/Driver/XmlDocFileWriter.fs | 7 +- src/Compiler/Driver/fsc.fs | 40 ++- src/Compiler/Service/FSharpCheckerResults.fs | 24 +- .../Service/FSharpParseFileResults.fs | 13 +- src/Compiler/Service/ItemKey.fs | 8 +- .../Service/SemanticClassification.fs | 20 +- src/Compiler/Service/ServiceAnalysis.fs | 15 +- .../Service/ServiceInterfaceStubGenerator.fs | 34 ++- src/Compiler/Service/ServiceLexing.fs | 6 +- src/Compiler/Service/ServiceNavigation.fs | 8 +- .../Service/ServiceParamInfoLocations.fs | 12 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 21 +- src/Compiler/Service/ServiceParsedInputOps.fs | 8 +- src/Compiler/Service/ServiceStructure.fs | 30 +- src/Compiler/Service/service.fs | 10 +- src/Compiler/SyntaxTree/LexHelpers.fs | 14 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 2 +- src/Compiler/SyntaxTree/PrettyNaming.fs | 8 +- src/Compiler/SyntaxTree/XmlDoc.fs | 5 +- src/Compiler/Utilities/FileSystem.fs | 18 +- src/Compiler/Utilities/HashMultiMap.fs | 3 +- src/Compiler/Utilities/ImmutableArray.fs | 9 +- src/Compiler/Utilities/ResizeArray.fs | 13 +- src/Compiler/Utilities/illib.fs | 11 +- src/Compiler/Utilities/range.fs | 24 +- src/Compiler/Utilities/sformat.fs | 35 ++- src/FSharp.Build/FSharpEmbedResXSource.fs | 8 +- src/FSharp.Core/QueryExtensions.fs | 2 +- src/FSharp.Core/array.fs | 11 +- src/FSharp.Core/async.fs | 19 +- src/FSharp.Core/eventmodule.fs | 6 +- src/FSharp.Core/list.fs | 13 +- src/FSharp.Core/map.fs | 6 +- src/FSharp.Core/observable.fs | 20 +- src/FSharp.Core/quotations.fs | 8 +- src/FSharp.Core/reflect.fs | 30 +- src/FSharp.Core/seq.fs | 61 ++-- .../FSharp.DependencyManager.Utilities.fs | 4 +- src/fsc/fscmain.fs | 6 +- src/fsi/console.fs | 15 +- src/fsi/fsimain.fs | 6 +- 65 files changed, 885 insertions(+), 513 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 057b9c816db..9a25558c924 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "5.0.0-alpha-008", + "version": "5.0.0-alpha-011", "commands": [ "fantomas" ] diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index ed951e0a03b..3600b0e2cf4 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -25,7 +25,9 @@ open Internal.Utilities let logging = false -let _ = if logging then dprintn "* warning: Il.logging is on" +let _ = + if logging then + dprintn "* warning: Il.logging is on" let int_order = LanguagePrimitives.FastGenericComparer @@ -68,11 +70,13 @@ let memoizeNamespaceRightTable = let memoizeNamespacePartTable = ConcurrentDictionary() let splitNameAt (nm: string) idx = - if idx < 0 then failwith "splitNameAt: idx < 0" + if idx < 0 then + failwith "splitNameAt: idx < 0" let last = nm.Length - 1 - if idx > last then failwith "splitNameAt: idx > last" + if idx > last then + failwith "splitNameAt: idx > last" (nm.Substring(0, idx)), (if idx < last then nm.Substring(idx + 1, last - idx) else "") @@ -551,7 +555,8 @@ type ILAssemblyRef(data) = addC (convDigit (int32 v / 16)) addC (convDigit (int32 v % 16)) // retargetable can be true only for system assemblies that definitely have Version - if aref.Retargetable then add ", Retargetable=Yes" + if aref.Retargetable then + add ", Retargetable=Yes" b.ToString() @@ -2497,8 +2502,10 @@ let typeKindOfFlags nm (super: ILType option) flags = if name = "System.Enum" then ILTypeDefKind.Enum - elif (name = "System.Delegate" && nm <> "System.MulticastDelegate") - || name = "System.MulticastDelegate" then + elif + (name = "System.Delegate" && nm <> "System.MulticastDelegate") + || name = "System.MulticastDelegate" + then ILTypeDefKind.Delegate elif name = "System.ValueType" && nm <> "System.Enum" then ILTypeDefKind.ValueType @@ -3925,7 +3932,8 @@ let cdef_cctorCode2CodeOrCreate tag imports f (cd: ILTypeDef) = [| yield f cctor for md in mdefs do - if md.Name <> ".cctor" then yield md + if md.Name <> ".cctor" then + yield md |]) cd.With(methods = methods) @@ -4888,7 +4896,8 @@ type ILTypeSigParser(tstring: string) = // Does the type name start with a leading '['? If so, ignore it // (if the specialization type is in another module, it will be wrapped in bracket) - if here () = '[' then drop () + if here () = '[' then + drop () // 1. Iterate over beginning of type, grabbing the type name and determining if it's generic or an array let typeName = @@ -4947,8 +4956,11 @@ type ILTypeSigParser(tstring: string) = let scope = if (here () = ',' || here () = ' ') && (peek () <> '[' && peekN 2 <> '[') then let grabScopeComponent () = - if here () = ',' then drop () // ditch the ',' - if here () = ' ' then drop () // ditch the ' ' + if here () = ',' then + drop () // ditch the ',' + + if here () = ' ' then + drop () // ditch the ' ' while (peek () <> ',' && peek () <> ']' && peek () <> nil) do step () @@ -4969,8 +4981,11 @@ type ILTypeSigParser(tstring: string) = ILScopeRef.Local // strip any extraneous trailing brackets or commas - if (here () = ']') then drop () - if (here () = ',') then drop () + if (here () = ']') then + drop () + + if (here () = ',') then + drop () // build the IL type let tref = mkILTyRef (scope, typeName) @@ -5549,17 +5564,18 @@ let resolveILMethodRefWithRescope r (td: ILTypeDef) (mref: ILMethodRef) = let argTypes = mref.ArgTypes |> List.map r let retType: ILType = r mref.ReturnType - match possibles - |> List.filter (fun md -> - mref.CallingConv = md.CallingConv - && - // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct - (md.Parameters, argTypes) - ||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) - && - // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct - r md.Return.Type = retType) - with + match + possibles + |> List.filter (fun md -> + mref.CallingConv = md.CallingConv + && + // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct + (md.Parameters, argTypes) + ||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) + && + // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct + r md.Return.Type = retType) + with | [] -> failwith ( "no method named " diff --git a/src/Compiler/AbstractIL/ilnativeres.fs b/src/Compiler/AbstractIL/ilnativeres.fs index 3c0752ea8db..70846577d68 100644 --- a/src/Compiler/AbstractIL/ilnativeres.fs +++ b/src/Compiler/AbstractIL/ilnativeres.fs @@ -96,8 +96,10 @@ type CvtResFile() = reader.Read(pAdditional.data, 0, pAdditional.data.Length) |> ignore stream.Position <- stream.Position + 3L &&& ~~~ 3L - if pAdditional.pstringType.theString = Unchecked.defaultof<_> - && (pAdditional.pstringType.Ordinal = uint16 CvtResFile.RT_DLGINCLUDE) then + if + pAdditional.pstringType.theString = Unchecked.defaultof<_> + && (pAdditional.pstringType.Ordinal = uint16 CvtResFile.RT_DLGINCLUDE) + then () (* ERROR ContinueNotSupported *) else resourceNames.Add pAdditional @@ -454,7 +456,8 @@ type VersionHelper() = doBreak <- false () (* ERROR ContinueNotSupported *) (* ERROR BreakNotSupported *) - if not breakLoop then i <- i + 1 + if not breakLoop then + i <- i + 1 if hasWildcard then let mutable (i: int) = lastExplicitValue @@ -1149,7 +1152,8 @@ type NativeResourceWriter() = if id >= 0 then writer.WriteInt32 id else - if name = Unchecked.defaultof<_> then name <- String.Empty + if name = Unchecked.defaultof<_> then + name <- String.Empty writer.WriteUInt32(nameOffset ||| 0x80000000u) dataWriter.WriteUInt16(uint16 name.Length) diff --git a/src/Compiler/AbstractIL/ilprint.fs b/src/Compiler/AbstractIL/ilprint.fs index a9f95cbc1b0..1c777f278b9 100644 --- a/src/Compiler/AbstractIL/ilprint.fs +++ b/src/Compiler/AbstractIL/ilprint.fs @@ -661,16 +661,20 @@ let goutput_fdef _tref env os (fd: ILFieldDef) = output_member_access os fd.Access output_string os " " - if fd.IsStatic then output_string os " static " + if fd.IsStatic then + output_string os " static " - if fd.IsLiteral then output_string os " literal " + if fd.IsLiteral then + output_string os " literal " if fd.IsSpecialName then output_string os " specialname rtspecialname " - if fd.IsInitOnly then output_string os " initonly " + if fd.IsInitOnly then + output_string os " initonly " - if fd.NotSerialized then output_string os " notserialized " + if fd.NotSerialized then + output_string os " notserialized " goutput_typ env os fd.FieldType output_string os " " @@ -740,7 +744,8 @@ let output_code_label os lab = output_string os (formatCodeLabel lab) let goutput_local env os (l: ILLocal) = goutput_typ env os l.Type - if l.IsPinned then output_string os " pinned" + if l.IsPinned then + output_string os " pinned" let goutput_param env os (l: ILParameter) = match l.Name with @@ -985,7 +990,8 @@ let rec goutput_instr env os inst = let rank = shape.Rank output_parens (output_array ", " (goutput_typ env)) os (Array.create rank PrimaryAssemblyILGlobals.typ_Int32) | I_ldelema (ro, _, shape, tok) -> - if ro = ReadonlyAddress then output_string os "readonly. " + if ro = ReadonlyAddress then + output_string os "readonly. " if shape = ILArrayShape.SingleDimensional then output_string os "ldelema " @@ -1034,7 +1040,8 @@ let rec goutput_instr env os inst = | _ -> output_string os "" let goutput_ilmbody env os (il: ILMethodBody) = - if il.IsZeroInit then output_string os " .zeroinit\n" + if il.IsZeroInit then + output_string os " .zeroinit\n" output_string os " .maxstack " output_i32 os il.MaxStack @@ -1067,7 +1074,8 @@ let goutput_mbody is_entrypoint env os (md: ILMethodDef) = | MethodBody.IL il -> goutput_ilmbody env os il.Value | _ -> () - if is_entrypoint then output_string os " .entrypoint" + if is_entrypoint then + output_string os " .entrypoint" output_string os "\n" output_string os "}\n" @@ -1125,11 +1133,14 @@ let goutput_mdef env os (md: ILMethodDef) = let menv = ppenv_enter_method (List.length md.GenericParams) env output_string os " .method " - if md.IsHideBySig then output_string os "hidebysig " + if md.IsHideBySig then + output_string os "hidebysig " - if md.IsReqSecObj then output_string os "reqsecobj " + if md.IsReqSecObj then + output_string os "reqsecobj " - if md.IsSpecialName then output_string os "specialname " + if md.IsSpecialName then + output_string os "specialname " if md.IsUnmanagedExport then output_string os "unmanagedexp " @@ -1149,13 +1160,17 @@ let goutput_mdef env os (md: ILMethodDef) = (goutput_params menv) os md.Parameters output_string os " " - if md.IsSynchronized then output_string os "synchronized " + if md.IsSynchronized then + output_string os "synchronized " - if md.IsMustRun then output_string os "/* mustrun */ " + if md.IsMustRun then + output_string os "/* mustrun */ " - if md.IsPreserveSig then output_string os "preservesig " + if md.IsPreserveSig then + output_string os "preservesig " - if md.IsNoInline then output_string os "noinlining " + if md.IsNoInline then + output_string os "noinlining " if md.IsAggressiveInline then output_string os "aggressiveinlining " @@ -1255,13 +1270,17 @@ let rec goutput_tdef enc env contents os (cd: ILTypeDef) = output_string os layout_attr output_string os " " - if cd.IsSealed then output_string os "sealed " + if cd.IsSealed then + output_string os "sealed " - if cd.IsAbstract then output_string os "abstract " + if cd.IsAbstract then + output_string os "abstract " - if cd.IsSerializable then output_string os "serializable " + if cd.IsSerializable then + output_string os "serializable " - if cd.IsComInterop then output_string os "import " + if cd.IsComInterop then + output_string os "import " output_sqstring os cd.Name goutput_gparams env os cd.GenericParams @@ -1339,7 +1358,8 @@ let output_assemblyRef os (aref: ILAssemblyRef) = output_string os " .assembly extern " output_sqstring os aref.Name - if aref.Retargetable then output_string os " retargetable " + if aref.Retargetable then + output_string os " retargetable " output_string os " { " output_option output_hash os aref.Hash diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 3b536d891fd..6ec589b3115 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1379,7 +1379,8 @@ let seekReadGuidIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadId let seekReadBlobIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadIdx ctxt.blobsBigness mdv &addr let seekReadModuleRow (ctxt: ILMetadataReader) mdv idx = - if idx = 0 then failwith "cannot read Module table row 0" + if idx = 0 then + failwith "cannot read Module table row 0" let mutable addr = ctxt.rowAddr TableNames.Module idx let generation = seekReadUInt16Adv mdv &addr @@ -1846,7 +1847,9 @@ let getDataEndPointsDelayed (pectxt: PEReader) ctxtH = |> List.sort let rvaToData (ctxt: ILMetadataReader) (pectxt: PEReader) nm rva = - if rva = 0x0 then failwith "rva is zero" + if rva = 0x0 then + failwith "rva is zero" + let start = pectxt.anyV2P (nm, rva) let endPoints = (Lazy.force ctxt.dataEndPoints) @@ -2565,7 +2568,8 @@ and sigptrGetTy (ctxt: ILMetadataReader) numTypars bytes sigptr = let ccByte, sigptr = sigptrGetByte bytes sigptr let generic, cc = byteAsCallConv ccByte - if generic then failwith "fptr sig may not be generic" + if generic then + failwith "fptr sig may not be generic" let struct (numparams, sigptr) = sigptrGetZInt32 bytes sigptr let retTy, sigptr = sigptrGetTy ctxt numTypars bytes sigptr @@ -3082,16 +3086,15 @@ and seekReadEvents (ctxt: ILMetadataReader) numTypars tidx = let mdv = ctxt.mdfile.GetView() match - seekReadOptionalIndexedRow - ( - ctxt.getNumRows TableNames.EventMap, - (fun i -> i, seekReadEventMapRow ctxt mdv i), - (fun (_, row) -> fst row), - compare tidx, - false, - (fun (i, row) -> (i, snd row)) - ) - with + seekReadOptionalIndexedRow ( + ctxt.getNumRows TableNames.EventMap, + (fun i -> i, seekReadEventMapRow ctxt mdv i), + (fun (_, row) -> fst row), + compare tidx, + false, + (fun (i, row) -> (i, snd row)) + ) + with | None -> [] | Some (rowNum, beginEventIdx) -> let endEventIdx = @@ -3150,16 +3153,15 @@ and seekReadProperties (ctxt: ILMetadataReader) numTypars tidx = let mdv = ctxt.mdfile.GetView() match - seekReadOptionalIndexedRow - ( - ctxt.getNumRows TableNames.PropertyMap, - (fun i -> i, seekReadPropertyMapRow ctxt mdv i), - (fun (_, row) -> fst row), - compare tidx, - false, - (fun (i, row) -> (i, snd row)) - ) - with + seekReadOptionalIndexedRow ( + ctxt.getNumRows TableNames.PropertyMap, + (fun i -> i, seekReadPropertyMapRow ctxt mdv i), + (fun (_, row) -> fst row), + compare tidx, + false, + (fun (i, row) -> (i, snd row)) + ) + with | None -> [] | Some (rowNum, beginPropIdx) -> let endPropIdx = @@ -3592,17 +3594,21 @@ and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start s curr <- curr + 4 (* REVIEW: this incorrectly labels all MemberRef tokens as ILMethod's: we should go look at the MemberRef sig to determine if it is a field or method *) let token_info = - if tab = TableNames.Method - || tab = TableNames.MemberRef (* REVIEW: generics or tab = TableNames.MethodSpec *) then + if + tab = TableNames.Method + || tab = TableNames.MemberRef (* REVIEW: generics or tab = TableNames.MethodSpec *) + then let (MethodData (enclTy, cc, nm, argTys, retTy, methInst)) = seekReadMethodDefOrRefNoVarargs ctxt numTypars (uncodedTokenToMethodDefOrRef (tab, idx)) ILToken.ILMethod(mkILMethSpecInTy (enclTy, cc, nm, argTys, retTy, methInst)) elif tab = TableNames.Field then ILToken.ILField(seekReadFieldDefAsFieldSpec ctxt idx) - elif tab = TableNames.TypeDef - || tab = TableNames.TypeRef - || tab = TableNames.TypeSpec then + elif + tab = TableNames.TypeDef + || tab = TableNames.TypeRef + || tab = TableNames.TypeSpec + then ILToken.ILType(seekReadTypeDefOrRef ctxt numTypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec (tab, idx))) else failwith "bad token for ldtoken" @@ -3680,7 +3686,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int let isFatFormat = (b &&& e_CorILMethod_FormatMask) = e_CorILMethod_FatFormat if not isTinyFormat && not isFatFormat then - if logging then failwith "unknown format" + if logging then + failwith "unknown format" MethodBody.Abstract else @@ -3924,7 +3931,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int nextSectionBase <- sectionBase + sectionSize // Convert the linear code format to the nested code format - if logging then dprintn "doing localPdbInfos2" + if logging then + dprintn "doing localPdbInfos2" let localPdbInfos2 = List.map (fun f -> f raw2nextLab) localPdbInfos @@ -3933,7 +3941,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int let code = buildILCode nm lab2pc instrs seh localPdbInfos2 - if logging then dprintn "done checking code." + if logging then + dprintn "done checking code." { IsZeroInit = initlocals @@ -4254,10 +4263,10 @@ let openMetadataReader | Some positions -> positions let tablesStreamPhysLoc, _tablesStreamSize = - match tryFindStream [| 0x23; 0x7e |] (* #~ *) with + match tryFindStream [| 0x23; 0x7e |] (* #~ *) with | Some res -> res | None -> - match tryFindStream [| 0x23; 0x2d |] (* #-: at least one DLL I've seen uses this! *) with + match tryFindStream [| 0x23; 0x2d |] (* #-: at least one DLL I've seen uses this! *) with | Some res -> res | None -> let firstStreamOffset = seekReadInt32 mdv (streamHeadersStart + 0) @@ -5073,8 +5082,10 @@ let stableFileHeuristicApplies fileName = let createByteFileChunk opts fileName chunk = // If we're trying to reduce memory usage then we are willing to go back and re-read the binary, so we can use // a weakly-held handle to an array of bytes. - if opts.reduceMemoryUsage = ReduceMemoryFlag.Yes - && stableFileHeuristicApplies fileName then + if + opts.reduceMemoryUsage = ReduceMemoryFlag.Yes + && stableFileHeuristicApplies fileName + then WeakByteFile(fileName, chunk) :> BinaryFile else let bytes = diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 06e2fc67a35..2781d8a381a 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -638,11 +638,13 @@ let envUpdateCreatedTypeRef emEnv (tref: ILTypeRef) = // of objects. We use System.Runtime.Serialization.FormatterServices.GetUninitializedObject to do // the fake allocation - this creates an "empty" object, even if the object doesn't have // a constructor. It is not usable in partial trust code. - if runningOnMono - && ty.IsClass - && not ty.IsAbstract - && not ty.IsGenericType - && not ty.IsGenericTypeDefinition then + if + runningOnMono + && ty.IsClass + && not ty.IsAbstract + && not ty.IsGenericType + && not ty.IsGenericTypeDefinition + then try System.Runtime.Serialization.FormatterServices.GetUninitializedObject ty |> ignore @@ -972,7 +974,9 @@ let convFieldSpec cenv emEnv fspec = nonQueryableTypeGetField parentTI fieldB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let fieldInfo = queryableTypeGetField emEnv parentT fref nonQueryableTypeGetField parentTI fieldInfo @@ -1009,10 +1013,12 @@ let queryableTypeGetMethodBySearch cenv emEnv parentT (mref: ILMethodRef) = | Some a -> if // obvious case - p.IsAssignableFrom a then + p.IsAssignableFrom a + then true elif - p.IsGenericType && a.IsGenericType + p.IsGenericType + && a.IsGenericType // non obvious due to contravariance: Action where T: IFoo accepts Action (for FooImpl: IFoo) && p.GetGenericTypeDefinition().IsAssignableFrom(a.GetGenericTypeDefinition()) then @@ -1124,8 +1130,10 @@ let queryableTypeGetMethod cenv emEnv parentT (mref: ILMethodRef) : MethodInfo = queryableTypeGetMethodBySearch cenv emEnv parentT mref let nonQueryableTypeGetMethod (parentTI: Type) (methInfo: MethodInfo) : MethodInfo MaybeNull = - if (parentTI.IsGenericType - && not (equalTypes parentTI (getTypeConstructor parentTI))) then + if + (parentTI.IsGenericType + && not (equalTypes parentTI (getTypeConstructor parentTI))) + then TypeBuilder.GetMethod(parentTI, methInfo) else methInfo @@ -1141,7 +1149,9 @@ let convMethodRef cenv emEnv (parentTI: Type) (mref: ILMethodRef) = nonQueryableTypeGetMethod parentTI methB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let methInfo = queryableTypeGetMethod cenv emEnv parentT mref nonQueryableTypeGetMethod parentTI methInfo @@ -1216,7 +1226,9 @@ let convConstructorSpec cenv emEnv (mspec: ILMethodSpec) = nonQueryableTypeGetConstructor parentTI consB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let ctorG = queryableTypeGetConstructor cenv emEnv parentT mref nonQueryableTypeGetConstructor parentTI ctorG @@ -2134,9 +2146,11 @@ let buildFieldPass2 cenv tref (typB: TypeBuilder) emEnv (fdef: ILFieldDef) = match fdef.LiteralValue with | None -> emEnv | Some initial -> - if not fieldT.IsEnum - // it is ok to init fields with type = enum that are defined in other assemblies - || not fieldT.Assembly.IsDynamic then + if + not fieldT.IsEnum + // it is ok to init fields with type = enum that are defined in other assemblies + || not fieldT.Assembly.IsDynamic + then fieldB.SetConstant(initial.AsObject()) emEnv else @@ -2267,9 +2281,10 @@ let typeAttributesOfTypeLayout cenv emEnv x = if p.Size = None && p.Pack = None then None else - match cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.StructLayoutAttribute", - cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.LayoutKind" - with + match + cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.StructLayoutAttribute", + cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.LayoutKind" + with | Some tref1, Some tref2 -> Some( convCustomAttr @@ -2564,7 +2579,8 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t match emEnv.emTypMap.TryFind typeRef with | Some (_, tb, _, _) -> - if not (tb.IsCreated()) then tb.CreateTypeAndLog() |> ignore + if not (tb.IsCreated()) then + tb.CreateTypeAndLog() |> ignore tb.Assembly | None -> null) @@ -2590,7 +2606,8 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t traverseTypeRef tref let rec buildTypeDefPass4 (visited, created) nesting emEnv (tdef: ILTypeDef) = - if verbose2 then dprintf "buildTypeDefPass4 %s\n" tdef.Name + if verbose2 then + dprintf "buildTypeDefPass4 %s\n" tdef.Name let tref = mkRefForNestedILTypeDef ILScopeRef.Local (nesting, tdef) createTypeRef (visited, created) emEnv tref diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index 1db894b1801..fea9a764487 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -611,7 +611,8 @@ type ResFormatNode(tid: int32, nid: int32, lid: int32, dataOffset: int32, pbLink let bNil = Bytes.zeroCreate 3 // Align remaining fields on DWORD (nb. poor bit twiddling code taken from ildasm's dres.cpp) - if (dwFiller &&& 0x1) <> 0 then SaveChunk(bNil, 2) + if (dwFiller &&& 0x1) <> 0 then + SaveChunk(bNil, 2) //---- Constant part of the header: DWORD, WORD, WORD, DWORD, DWORD SaveChunk(dwToBytes resHdr.DataVersion) @@ -627,7 +628,8 @@ type ResFormatNode(tid: int32, nid: int32, lid: int32, dataOffset: int32, pbLink dwFiller <- dataEntry.Size &&& 0x3 - if dwFiller <> 0 then SaveChunk(bNil, 4 - dwFiller) + if dwFiller <> 0 then + SaveChunk(bNil, 4 - dwFiller) size diff --git a/src/Compiler/AbstractIL/ilsupp.fsi b/src/Compiler/AbstractIL/ilsupp.fsi index a7b9ddefcfe..e0aa2785471 100644 --- a/src/Compiler/AbstractIL/ilsupp.fsi +++ b/src/Compiler/AbstractIL/ilsupp.fsi @@ -48,14 +48,14 @@ type PdbDebugPoint = pdbSeqPointEndLine: int pdbSeqPointEndColumn: int } -val pdbReadOpen: string (* module *) -> string (* path *) -> PdbReader +val pdbReadOpen: string (* module *) -> string (* path *) -> PdbReader val pdbReadClose: PdbReader -> unit -val pdbReaderGetMethod: PdbReader -> int32 (* token *) -> PdbMethod -val pdbReaderGetMethodFromDocumentPosition: PdbReader -> PdbDocument -> int (* line *) -> int (* col *) -> PdbMethod +val pdbReaderGetMethod: PdbReader -> int32 (* token *) -> PdbMethod +val pdbReaderGetMethodFromDocumentPosition: PdbReader -> PdbDocument -> int (* line *) -> int (* col *) -> PdbMethod val pdbReaderGetDocuments: PdbReader -> PdbDocument array val pdbReaderGetDocument: - PdbReader -> string (* url *) -> byte (* guid *) [] -> byte (* guid *) [] -> byte (* guid *) [] -> PdbDocument + PdbReader -> string (* url *) -> byte (* guid *) [] -> byte (* guid *) [] -> byte (* guid *) [] -> PdbDocument val pdbDocumentGetURL: PdbDocument -> string val pdbDocumentGetType: PdbDocument -> byte (* guid *) [] @@ -72,7 +72,7 @@ val pdbScopeGetLocals: PdbMethodScope -> PdbVariable array val pdbVariableGetName: PdbVariable -> string val pdbVariableGetSignature: PdbVariable -> byte[] -val pdbVariableGetAddressAttributes: PdbVariable -> int32 (* kind *) * int32 (* addrField1 *) +val pdbVariableGetAddressAttributes: PdbVariable -> int32 (* kind *) * int32 (* addrField1 *) #endif #if !FX_NO_PDB_WRITER @@ -89,7 +89,7 @@ type idd = iddType: int32 iddData: byte[] } -val pdbInitialize: string (* .exe/.dll already written and closed *) -> string (* .pdb to write *) -> PdbWriter +val pdbInitialize: string (* .exe/.dll already written and closed *) -> string (* .pdb to write *) -> PdbWriter val pdbClose: PdbWriter -> string -> string -> unit val pdbCloseDocument: PdbDocumentWriter -> unit val pdbSetUserEntryPoint: PdbWriter -> int32 -> unit diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index c81cfc23ad3..55b23795bbc 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -751,10 +751,12 @@ type PortablePdbGenerator builder.WriteCompressedInteger offsetDelta // Check for hidden-sequence-point-record - if startLine = 0xfeefee - || endLine = 0xfeefee - || (startColumn = 0 && endColumn = 0) - || ((endLine - startLine) = 0 && (endColumn - startColumn) = 0) then + if + startLine = 0xfeefee + || endLine = 0xfeefee + || (startColumn = 0 && endColumn = 0) + || ((endLine - startLine) = 0 && (endColumn - startColumn) = 0) + then // Hidden-sequence-point-record builder.WriteCompressedInteger 0 builder.WriteCompressedInteger 0 @@ -1008,14 +1010,16 @@ let writePdbInfo showTimes outfile pdbfile info cvChunk = | Some p -> sco.StartOffset <> p.StartOffset || sco.EndOffset <> p.EndOffset | None -> true - if nested then pdbOpenScope pdbw sco.StartOffset + if nested then + pdbOpenScope pdbw sco.StartOffset sco.Locals |> Array.iter (fun v -> pdbDefineLocalVariable pdbw v.Name v.Signature v.Index) sco.Children |> Array.iter (writePdbScope (if nested then Some sco else parent)) - if nested then pdbCloseScope pdbw sco.EndOffset) + if nested then + pdbCloseScope pdbw sco.EndOffset) match minfo.RootScope with | None -> () @@ -1242,8 +1246,10 @@ and allNamesOfScopes acc (scopes: PdbMethodScope[]) = let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[]) (scope: PdbMethodScope) = stackGuard.Guard(fun () -> // Check if child scopes are properly nested - if scope.Children - |> Array.forall (fun child -> child.StartOffset >= scope.StartOffset && child.EndOffset <= scope.EndOffset) then + if + scope.Children + |> Array.forall (fun child -> child.StartOffset >= scope.StartOffset && child.EndOffset <= scope.EndOffset) + then let children = scope.Children |> Array.sortWith scopeSorter diff --git a/src/Compiler/AbstractIL/ilx.fs b/src/Compiler/AbstractIL/ilx.fs index 6a7adab880b..4eb18649752 100644 --- a/src/Compiler/AbstractIL/ilx.fs +++ b/src/Compiler/AbstractIL/ilx.fs @@ -39,7 +39,7 @@ type IlxUnionHasHelpers = | SpecialFSharpListHelpers | SpecialFSharpOptionHelpers -type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers +type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers type IlxUnionSpec = | IlxUnionSpec of IlxUnionRef * ILGenericArgs diff --git a/src/Compiler/AbstractIL/ilx.fsi b/src/Compiler/AbstractIL/ilx.fsi index 901117867b7..a6a008434be 100644 --- a/src/Compiler/AbstractIL/ilx.fsi +++ b/src/Compiler/AbstractIL/ilx.fsi @@ -39,7 +39,7 @@ type IlxUnionRef = boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * - bool (* IsNullPermitted *) * + bool (* IsNullPermitted *) * IlxUnionHasHelpers (* HasHelpers *) type IlxUnionSpec = diff --git a/src/Compiler/CodeGen/EraseClosures.fs b/src/Compiler/CodeGen/EraseClosures.fs index 6f6646177a5..5ba6c4b50a0 100644 --- a/src/Compiler/CodeGen/EraseClosures.fs +++ b/src/Compiler/CodeGen/EraseClosures.fs @@ -500,9 +500,11 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = // nb. should combine the term and type abstraction cases for // to allow for term and type variables to be mixed in a single // application. - if (match laterStruct with - | Lambdas_return _ -> false - | _ -> true) then + if + (match laterStruct with + | Lambdas_return _ -> false + | _ -> true) + then let nowStruct = List.foldBack (fun x y -> Lambdas_forall(x, y)) tyargsl (Lambdas_return nowReturnTy) @@ -622,9 +624,11 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let nowReturnTy = mkTyOfLambdas cenv laterStruct // CASE 2a - Too Many Term Arguments or Remaining Type arguments - Split the Closure Class in Two - if (match laterStruct with - | Lambdas_return _ -> false - | _ -> true) then + if + (match laterStruct with + | Lambdas_return _ -> false + | _ -> true) + then let nowStruct = List.foldBack (fun l r -> Lambdas_lambda(l, r)) nowParams (Lambdas_return nowReturnTy) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 1e4b3c1f591..626ddd49758 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -76,7 +76,8 @@ type UnionReprDecisions<'Union, 'Alt, 'Type> if alts.Length = 1 then SingleCase elif - not (isStruct cu) && alts.Length < TaggingThresholdFixedConstant + not (isStruct cu) + && alts.Length < TaggingThresholdFixedConstant && not (repr.RepresentAllAlternativesAsConstantFieldsInRootClass cu) then RuntimeTypes @@ -1280,12 +1281,14 @@ let mkClassUnionDef ] let ctorMeths = - if (List.isEmpty selfFields - && List.isEmpty tagFieldsInObject - && not (List.isEmpty selfMeths)) - || isStruct - || cud.UnionCases - |> Array.forall (fun alt -> repr.RepresentAlternativeAsFreshInstancesOfRootClass(info, alt)) then + if + (List.isEmpty selfFields + && List.isEmpty tagFieldsInObject + && not (List.isEmpty selfMeths)) + || isStruct + || cud.UnionCases + |> Array.forall (fun alt -> repr.RepresentAlternativeAsFreshInstancesOfRootClass(info, alt)) + then [] (* no need for a second ctor in these cases *) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 1bf87805a0b..c39508fc595 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -210,7 +210,11 @@ let ReportStatistics (oc: TextWriter) = reports oc let NewCounter nm = let mutable count = 0 - AddReport(fun oc -> if count <> 0 then oc.WriteLine(string count + " " + nm)) + + AddReport(fun oc -> + if count <> 0 then + oc.WriteLine(string count + " " + nm)) + (fun () -> count <- count + 1) let CountClosure = NewCounter "closures" @@ -653,9 +657,11 @@ and GenNamedTyAppAux (cenv: cenv) m (tyenv: TypeReprEnv) ptrsOK tcref tinst = | _ -> let tinst = DropErasedTyargs tinst // See above note on ptrsOK - if ptrsOK = PtrTypesOK - && tyconRefEq g tcref g.nativeptr_tcr - && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty then + if + ptrsOK = PtrTypesOK + && tyconRefEq g tcref g.nativeptr_tcr + && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty + then GenNamedTyAppAux cenv m tyenv ptrsOK g.ilsigptr_tcr tinst else #if !NO_TYPEPROVIDERS @@ -1910,7 +1916,8 @@ type TypeDefBuilder(tdef: ILTypeDef, tdefDiscards) = | Some (mdefDiscard, _) -> mdefDiscard ilMethodDef | None -> false - if not discard then gmethods.Add ilMethodDef + if not discard then + gmethods.Add ilMethodDef member _.NestedTypeDefs = gnested @@ -1924,7 +1931,8 @@ type TypeDefBuilder(tdef: ILTypeDef, tdefDiscards) = | Some (_, pdefDiscard) -> pdefDiscard pdef | None -> false - if not discard then AddPropertyDefToHash m gproperties pdef + if not discard then + AddPropertyDefToHash m gproperties pdef member _.PrependInstructionsToSpecificMethodDef(cond, instrs, tag, imports) = match ResizeArray.tryFindIndex cond gmethods with @@ -2138,7 +2146,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu lmtyp ) - if isStruct then tycon.SetIsStructRecordOrUnion true + if isStruct then + tycon.SetIsStructRecordOrUnion true tycon.entity_tycon_repr <- TFSharpRecdRepr( @@ -2470,10 +2479,12 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs member private _.EnsureNopBetweenDebugPoints() = // Always add a nop between debug points to help .NET get the stepping right // Don't do this after a FeeFee marker for hidden code - if (codebuf.Count > 0 - && (match codebuf[codebuf.Count - 1] with - | I_seqpoint sm when sm.Line <> FeeFee mgbuf.cenv -> true - | _ -> false)) then + if + (codebuf.Count > 0 + && (match codebuf[codebuf.Count - 1] with + | I_seqpoint sm when sm.Line <> FeeFee mgbuf.cenv -> true + | _ -> false)) + then codebuf.Add(AI_nop) @@ -2599,11 +2610,13 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs let instrs = instrs |> Array.mapi (fun idx i2 -> - if idx = 0 - && (match i2 with - | AI_nop -> true - | _ -> false) - && anyDocument.IsSome then + if + idx = 0 + && (match i2 with + | AI_nop -> true + | _ -> false) + && anyDocument.IsSome + then // This special dummy debug point says skip the start of the method hasDebugPoints <- true FeeFeeInstr mgbuf.cenv anyDocument.Value @@ -2842,7 +2855,8 @@ 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 yield k.Name + if Range.equals m k.Range then + yield k.Name ] |> String.concat "," @@ -3553,9 +3567,11 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = // InitializeArray is a JIT intrinsic that will result in invalid runtime CodeGen when initializing an array // of enum types. Until bug 872799 is fixed, we'll need to generate arrays the "simple" way for enum types // Also note - C# never uses InitializeArray for enum types, so this change puts us on equal footing with them. - if elems.Length <= 5 - || not cenv.options.emitConstantArraysUsingStaticDataBlobs - || (isEnumTy cenv.g elemTy) then + if + elems.Length <= 5 + || not cenv.options.emitConstantArraysUsingStaticDataBlobs + || (isEnumTy cenv.g elemTy) + then GenNewArraySimple cenv cgbuf eenv (elems, elemTy, m) sequel else // Try to emit a constant byte-blob array @@ -3648,10 +3664,12 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = | _ -> false), (fun _ _ -> failwith "unreachable") - if elemsArray - |> Array.forall (function - | Expr.Const (c, _, _) -> test c - | _ -> false) then + if + elemsArray + |> Array.forall (function + | Expr.Const (c, _, _) -> test c + | _ -> false) + then let ilElemTy = GenType cenv m eenv.tyenv elemTy GenConstArray cenv cgbuf eenv ilElemTy elemsArray (fun buf -> @@ -3667,10 +3685,12 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = let g = cenv.g // Is this an upcast? - if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty - && - // Do an extra check - should not be needed - TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty then + if + TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty + && + // Do an extra check - should not be needed + TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty + then if isInterfaceTy g tgty then GenExpr cenv cgbuf eenv e Continue let ilToTy = GenType cenv m eenv.tyenv tgty @@ -3838,8 +3858,10 @@ and GenFieldGet isStatic cenv cgbuf eenv (rfref: RecdFieldRef, tyargs, m) = let fspec = GenRecdFieldRef m cenv eenv.tyenv rfref tyargs let vol = if rfref.RecdField.IsVolatile then Volatile else Nonvolatile - if useGenuineField rfref.Tycon rfref.RecdField - || entityRefInThisAssembly cenv.g.compilingFSharpCore rfref.TyconRef then + if + useGenuineField rfref.Tycon rfref.RecdField + || entityRefInThisAssembly cenv.g.compilingFSharpCore rfref.TyconRef + then let instr = if isStatic then I_ldsfld(vol, fspec) @@ -4306,9 +4328,11 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = // When generating debug code, generate a 'nop' after a 'call' that returns 'void' // This is what C# does, as it allows the call location to be maintained correctly in the stack frame - if cenv.options.generateDebugSymbols - && mustGenerateUnitAfterCall - && (isTailCall = Normalcall) then + if + cenv.options.generateDebugSymbols + && mustGenerateUnitAfterCall + && (isTailCall = Normalcall) + then CG.EmitInstr cgbuf (pop 0) Push0 AI_nop if isNil laterArgs then @@ -4352,22 +4376,24 @@ and CanTailcall // Can't tailcall with a struct object arg since it involves a byref // Can't tailcall with a .NET 2.0 generic constrained call since it involves a byref - if not hasStructObjArg - && Option.isNone ccallInfo - && not withinSEH - && not hasByrefArg - && not isDllImport - && not isSelfInit - && not makesNoCriticalTailcalls - && - - // We can tailcall even if we need to generate "unit", as long as we're about to throw the value away anyway as par of the return. - // We can tailcall if we don't need to generate "unit", as long as we're about to return. - (match sequelIgnoreEndScopes sequel with - | ReturnVoid - | Return -> not mustGenerateUnitAfterCall - | DiscardThen ReturnVoid -> mustGenerateUnitAfterCall - | _ -> false) then + if + not hasStructObjArg + && Option.isNone ccallInfo + && not withinSEH + && not hasByrefArg + && not isDllImport + && not isSelfInit + && not makesNoCriticalTailcalls + && + + // We can tailcall even if we need to generate "unit", as long as we're about to throw the value away anyway as par of the return. + // We can tailcall if we don't need to generate "unit", as long as we're about to return. + (match sequelIgnoreEndScopes sequel with + | ReturnVoid + | Return -> not mustGenerateUnitAfterCall + | DiscardThen ReturnVoid -> mustGenerateUnitAfterCall + | _ -> false) + then Tailcall else Normalcall @@ -5562,9 +5588,11 @@ 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 (System.Char.IsLower nm[1])) then + elif + nm.Length >= 1 + && nm[0] = 'T' + && (nm.Length = 1 || not (System.Char.IsLower nm[1])) + then nm else "T" + (String.capitalize nm) @@ -5874,14 +5902,13 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel let finfo = match - infoReader.GetRecordOrClassFieldsOfType - ( - Some fieldName, - AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, - m, - templateStructTy - ) - with + infoReader.GetRecordOrClassFieldsOfType( + Some fieldName, + AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, + m, + templateStructTy + ) + with | [ finfo ] -> finfo | _ -> error (InternalError(sprintf "expected class field %s not found" fieldName, m)) @@ -5894,14 +5921,13 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel let finfo = match - infoReader.GetRecordOrClassFieldsOfType - ( - Some fieldName, - AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, - m, - templateStructTy - ) - with + infoReader.GetRecordOrClassFieldsOfType( + Some fieldName, + AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, + m, + templateStructTy + ) + with | [ finfo ] -> finfo | _ -> error (InternalError(sprintf "expected class field %s not found" fieldName, m)) @@ -5939,7 +5965,7 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere imethName interfaceTy - with + with | [ meth ] when meth.IsInstance -> meth | _ -> error (InternalError(sprintf "expected method %s not found" imethName, m)) @@ -5989,7 +6015,7 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere imethName interfaceTy - with + with | [ meth ] when meth.IsInstance -> meth | _ -> error (InternalError(sprintf "expected method %s not found" imethName, m)) @@ -8093,9 +8119,11 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = // Workaround for .NET and Visual Studio restriction w.r.t debugger type proxys // Mark internal constructors in internal classes as public. let access = - if access = ILMemberAccess.Assembly - && vspec.IsConstructor - && IsHiddenTycon eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref then + if + access = ILMemberAccess.Assembly + && vspec.IsConstructor + && IsHiddenTycon eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref + then ILMemberAccess.Public else access @@ -8488,8 +8516,10 @@ and GenMarshal cenv attribs = match decoder.FindTypeName "SafeArrayUserDefinedSubType" "" with | "" -> None | res -> - if (safeArraySubType = ILNativeVariant.IDispatch) - || (safeArraySubType = ILNativeVariant.IUnknown) then + if + (safeArraySubType = ILNativeVariant.IDispatch) + || (safeArraySubType = ILNativeVariant.IUnknown) + then Some res else None @@ -8856,8 +8886,10 @@ and GenMethodForBinding |> AddStorageForLocalVals cenv.g (List.mapi (fun i v -> (v, Arg(numArgsUsed + i))) nonUnitNonSelfMethodVars) let eenvForMeth = - if eenvForMeth.initLocals - && HasFSharpAttribute g g.attrib_SkipLocalsInitAttribute v.Attribs then + if + eenvForMeth.initLocals + && HasFSharpAttribute g g.attrib_SkipLocalsInitAttribute v.Attribs + then { eenvForMeth with initLocals = false } else eenvForMeth @@ -8905,8 +8937,10 @@ and GenMethodForBinding let attr = TryFindFSharpBoolAttributeAssumeFalse cenv.g cenv.g.attrib_NoDynamicInvocationAttribute v.Attribs - if (not generateWitnessArgs && attr.IsSome) - || (generateWitnessArgs && attr = Some false) then + if + (not generateWitnessArgs && attr.IsSome) + || (generateWitnessArgs && attr = Some false) + then let exnArg = mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported (v.CompiledName g.CompilerGlobalState)) @@ -8939,7 +8973,7 @@ and GenMethodForBinding match v.Attribs |> List.tryFind (IsMatchingFSharpAttribute g g.attrib_CompiledNameAttribute) - with + with | Some (Attrib (_, _, [ AttribStringArg b ], _, _, _, _)) -> [ mkCompilationSourceNameAttr g v.LogicalName ], Some b | _ -> [], None @@ -9010,9 +9044,11 @@ and GenMethodForBinding -> let useMethodImpl = - if compileAsInstance - && ((memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) - || memberInfo.MemberFlags.IsOverrideOrExplicitImpl) then + if + compileAsInstance + && ((memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) + || memberInfo.MemberFlags.IsOverrideOrExplicitImpl) + then let useMethodImpl = ComputeUseMethodImpl cenv.g v @@ -9068,8 +9104,10 @@ and GenMethodForBinding if not compileAsInstance then mkILStaticMethod (ilMethTypars, mspec.Name, access, ilParams, ilReturn, ilMethodBody) - elif (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) - || memberInfo.MemberFlags.IsOverrideOrExplicitImpl then + elif + (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) + || memberInfo.MemberFlags.IsOverrideOrExplicitImpl + then let flagFixups = ComputeFlagFixupsForMemberBinding cenv v @@ -9197,7 +9235,8 @@ and GenMethodForBinding mdef.Name.StartsWithOrdinal("|") || // event add/remove method - v.val_flags.IsGeneratedEventVal then + v.val_flags.IsGeneratedEventVal + then mdef.WithSpecialName else mdef @@ -9763,7 +9802,8 @@ and GenTypeDefForCompLoc (cenv, eenv, mgbuf: AssemblyBuilder, cloc, hidden, attr TypeNameForImplicitMainMethod cloc TypeNameForInitClass cloc TypeNameForPrivateImplementationDetails cloc - ] then + ] + then [] else [ mkCompilationMappingAttr g (int SourceConstructFlags.Module) ]) @@ -9899,10 +9939,12 @@ and GenModuleBinding cenv (cgbuf: CodeGenBuffer) (qname: QualifiedNameOfFile) la // If the module has a .cctor for some mutable fields, we need to ensure that when // those fields are "touched" the InitClass .cctor is forced. The InitClass .cctor will // then fill in the value of the mutable fields. - if not mspec.IsNamespace - && (cgbuf.mgbuf.GetCurrentFields(TypeRefForCompLoc eenvinner.cloc) - |> Seq.isEmpty - |> not) then + if + not mspec.IsNamespace + && (cgbuf.mgbuf.GetCurrentFields(TypeRefForCompLoc eenvinner.cloc) + |> Seq.isEmpty + |> not) + then GenForceWholeFileInitializationAsPartOfCCtor cenv cgbuf.mgbuf @@ -10386,11 +10428,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // HOWEVER, if the type doesn't override Object.Equals already. let augmentOverrideMethodDefs = - (if Option.isNone tycon.GeneratedCompareToValues - && Option.isNone tycon.GeneratedHashAndEqualsValues - && tycon.HasInterface g g.mk_IComparable_ty - && not (tycon.HasOverride g "Equals" [ g.obj_ty ]) - && not tycon.IsFSharpInterfaceTycon then + (if + Option.isNone tycon.GeneratedCompareToValues + && Option.isNone tycon.GeneratedHashAndEqualsValues + && tycon.HasInterface g g.mk_IComparable_ty + && not (tycon.HasOverride g "Equals" [ g.obj_ty ]) + && not tycon.IsFSharpInterfaceTycon + then [ GenEqualsOverrideCallingIComparable cenv (tcref, ilThisTy, ilThisTy) ] else []) @@ -10602,7 +10646,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = [ // If using a field then all the attributes go on the field // See also FSharp 1.0 Bug 4727: once we start compiling them as real mutable fields, you should not be able to target both "property" for "val mutable" fields in classes - if useGenuineField then yield! fspec.PropertyAttribs + if useGenuineField then + yield! fspec.PropertyAttribs yield! fspec.FieldAttribs ] @@ -10866,9 +10911,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // FSharp 1.0 bug 1988: Explicitly setting the ComVisible(true) attribute on an F# type causes an F# record to be emitted in a way that enables mutation for COM interop scenarios // FSharp 3.0 feature: adding CLIMutable to a record type causes emit of default constructor, and all fields get property setters // Records that are value types do not create a default constructor with CLIMutable or ComVisible - if not isStructRecord - && (isCLIMutable - || (TryFindFSharpBoolAttribute g g.attrib_ComVisibleAttribute tycon.Attribs = Some true)) then + if + not isStructRecord + && (isCLIMutable + || (TryFindFSharpBoolAttribute g g.attrib_ComVisibleAttribute tycon.Attribs = Some true)) + then yield mkILSimpleStorageCtor (Some g.ilg.typ_Object.TypeSpec, ilThisTy, [], [], reprAccess, None, eenv.imports) if not (tycon.HasMember g "ToString" []) then @@ -11034,11 +11081,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // All structs are sequential by default // Structs with no instance fields get size 1, pack 0 - if tycon.AllFieldsArray |> Array.exists (fun f -> not f.IsStatic) - || - // Reflection emit doesn't let us emit 'pack' and 'size' for generic structs. - // In that case we generate a dummy field instead - (cenv.options.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) then + if + tycon.AllFieldsArray |> Array.exists (fun f -> not f.IsStatic) + || + // Reflection emit doesn't let us emit 'pack' and 'size' for generic structs. + // In that case we generate a dummy field instead + (cenv.options.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) + then ILTypeDefLayout.Sequential { Size = None; Pack = None }, ILDefaultPInvokeEncoding.Ansi else ILTypeDefLayout.Sequential { Size = Some 1; Pack = Some 0us }, ILDefaultPInvokeEncoding.Ansi @@ -11103,9 +11152,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let layout = if isStructTy g thisTy then - if (match ilTypeDefKind with - | ILTypeDefKind.ValueType -> true - | _ -> false) then + if + (match ilTypeDefKind with + | ILTypeDefKind.ValueType -> true + | _ -> false) + then // Structs with no instance fields get size 1, pack 0 ILTypeDefLayout.Sequential { Size = Some 1; Pack = Some 0us } else @@ -11206,9 +11257,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // order in the sequential initialization of the file. // // In this case, the .cctor for this type must force the .cctor of the backing static class for the file. - if tycon.TyparsNoRange.IsEmpty - && tycon.MembersOfFSharpTyconSorted - |> List.exists (fun vref -> vref.Deref.IsClassConstructor) then + if + tycon.TyparsNoRange.IsEmpty + && tycon.MembersOfFSharpTyconSorted + |> List.exists (fun vref -> vref.Deref.IsClassConstructor) + then GenForceWholeFileInitializationAsPartOfCCtor cenv mgbuf lazyInitInfo tref eenv.imports m /// Generate the type for an F# exception declaration. diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index b1bca1b6092..2786e30e9a3 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -859,7 +859,8 @@ type TcConfigBuilder = | None -> () | Some n -> // nowarn:62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- true + if n = 62 then + tcConfigB.mlCompatibility <- true tcConfigB.diagnosticsOptions <- { tcConfigB.diagnosticsOptions with @@ -873,7 +874,8 @@ type TcConfigBuilder = | None -> () | Some n -> // warnon 62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- false + if n = 62 then + tcConfigB.mlCompatibility <- false tcConfigB.diagnosticsOptions <- { tcConfigB.diagnosticsOptions with @@ -941,11 +943,10 @@ type TcConfigBuilder = if FileSystem.IsInvalidPathShim path then warning (Error(FSComp.SR.buildInvalidAssemblyName (path), m)) elif - not - ( - tcConfigB.referencedDLLs - |> List.exists (fun ar2 -> equals m ar2.Range && path = ar2.Text) - ) + not ( + tcConfigB.referencedDLLs + |> List.exists (fun ar2 -> equals m ar2.Range && path = ar2.Text) + ) then // NOTE: We keep same paths if range is different. let projectReference = tcConfigB.projectReferences @@ -1052,9 +1053,10 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = else None - match data.referencedDLLs - |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) - with + match + data.referencedDLLs + |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) + with | [] -> defaultCoreLibraryReference, None | [ r ] | r :: _ -> nameOfDll r @@ -1179,7 +1181,9 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = let frameworkRootVersion = Path.Combine(frameworkRoot, targetFrameworkVersionValue) yield frameworkRootVersion let facades = Path.Combine(frameworkRootVersion, "Facades") - if FileSystem.DirectoryExistsShim facades then yield facades + + if FileSystem.DirectoryExistsShim facades then + yield facades match data.FxResolver.GetFrameworkRefsPackDirectory() with | Some path when FileSystem.DirectoryExistsShim(path) -> yield path diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index f8fd613b267..fba0a064091 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1673,7 +1673,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Some (cex, false) -> os.AppendString(MatchIncomplete2E().Format cex) | Some (cex, true) -> os.AppendString(MatchIncomplete3E().Format cex) - if isComp then os.AppendString(MatchIncomplete4E().Format) + if isComp then + os.AppendString(MatchIncomplete4E().Format) | PatternMatchCompilation.EnumMatchIncomplete (isComp, cexOpt, _) -> os.AppendString(EnumMatchIncomplete1E().Format) @@ -1683,7 +1684,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Some (cex, false) -> os.AppendString(MatchIncomplete2E().Format cex) | Some (cex, true) -> os.AppendString(MatchIncomplete3E().Format cex) - if isComp then os.AppendString(MatchIncomplete4E().Format) + if isComp then + os.AppendString(MatchIncomplete4E().Format) | PatternMatchCompilation.RuleNeverMatched _ -> os.AppendString(RuleNeverMatchedE().Format) @@ -1695,7 +1697,9 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | ObsoleteWarning (s, _) -> os.AppendString(Obsolete1E().Format) - if s <> "" then os.AppendString(Obsolete2E().Format s) + + if s <> "" then + os.AppendString(Obsolete2E().Format s) | Experimental (s, _) -> os.AppendString(ExperimentalE().Format s) @@ -1990,7 +1994,8 @@ let CollectFormattedDiagnostics // Show prefix only for real files. Otherwise, we just want a truncated error like: // parse error FS0031: blah blah if - not (equals m range0) && not (equals m rangeStartup) + not (equals m range0) + && not (equals m rangeStartup) && not (equals m rangeCmdArgs) then let file = file.Replace("/", "\\") diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 515bb1b3868..1e63aa45dd5 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -402,7 +402,8 @@ type TcConfig with seq { yield! tcConfig.GetSearchPathsForLibraryFiles() - if isHashRReference m then Path.GetDirectoryName(m.FileName) + if isHashRReference m then + Path.GetDirectoryName(m.FileName) } let resolved = TryResolveFileUsingPaths(searchPaths, m, nm) @@ -592,8 +593,10 @@ type TcConfig with // O(N^2) here over a small set of referenced assemblies. let IsResolved (originalName: string) = - if resultingResolutions - |> List.exists (fun resolution -> resolution.originalReference.Text = originalName) then + if + resultingResolutions + |> List.exists (fun resolution -> resolution.originalReference.Text = originalName) + then true else // MSBuild resolution may have unified the result of two duplicate references. Try to re-resolve now. @@ -615,8 +618,10 @@ type TcConfig with // If mode=Speculative, then we haven't reported any errors. // We report the error condition by returning an empty list of resolutions - if mode = ResolveAssemblyReferenceMode.Speculative - && unresolvedReferences.Length > 0 then + if + mode = ResolveAssemblyReferenceMode.Speculative + && unresolvedReferences.Length > 0 + then [], unresolved else resultingResolutions, unresolved @@ -736,7 +741,8 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, resolutions.Length = 1 - if found then asm + if found then + asm if tcConfig.implicitlyReferenceDotNetAssemblies then let references, _useDotNetFramework = @@ -1097,7 +1103,9 @@ and [] TcImports let mutable disposed = false // this doesn't need locking, it's only for debugging let mutable tcGlobals = None // this doesn't need locking, it's set during construction of the TcImports - let CheckDisposed () = if disposed then assert false + let CheckDisposed () = + if disposed then + assert false let dispose () = CheckDisposed() @@ -1116,8 +1124,11 @@ and [] TcImports let unsuccessful = [ for ccuThunk, func in contents do - if ccuThunk.IsUnresolvedReference then func () - if ccuThunk.IsUnresolvedReference then (ccuThunk, func) + if ccuThunk.IsUnresolvedReference then + func () + + if ccuThunk.IsUnresolvedReference then + (ccuThunk, func) ] ccuThunks <- ResizeArray unsuccessful) diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index e33e311eb86..b8fbfbe4f91 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -288,9 +288,11 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler let getSwitchOpt (opt: string) = // if opt is a switch, strip the '+' or '-' - if opt <> "--" - && opt.Length > 1 - && (opt.EndsWithOrdinal("+") || opt.EndsWithOrdinal("-")) then + if + opt <> "--" + && opt.Length > 1 + && (opt.EndsWithOrdinal("+") || opt.EndsWithOrdinal("-")) + then opt[0 .. opt.Length - 2] else opt @@ -368,7 +370,10 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler | CompilerOption (s, _, OptionString f, d, _) as compilerOption :: _ when optToken = s -> reportDeprecatedOption d let oa = getOptionArg compilerOption argString - if oa <> "" then f (getOptionArg compilerOption oa) + + if oa <> "" then + f (getOptionArg compilerOption oa) + t | CompilerOption (s, _, OptionInt f, d, _) as compilerOption :: _ when optToken = s -> reportDeprecatedOption d @@ -1234,7 +1239,9 @@ let noFrameworkFlag isFsc tcConfigB = tagNone, OptionUnit(fun () -> tcConfigB.implicitlyReferenceDotNetAssemblies <- false - if isFsc then tcConfigB.implicitlyResolveAssemblies <- false), + + if isFsc then + tcConfigB.implicitlyResolveAssemblies <- false), None, Some(FSComp.SR.optsNoframework ()) ) diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 9039453478c..55ec3ad40a1 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -195,9 +195,10 @@ module MainModuleBuilder = "System.Runtime.Numerics" let numericsAssemblyRef = - match tcImports.GetImportedAssemblies() - |> List.tryFind (fun a -> a.FSharpViewOfMetadata.AssemblyName = refNumericsDllName) - with + match + tcImports.GetImportedAssemblies() + |> List.tryFind (fun a -> a.FSharpViewOfMetadata.AssemblyName = refNumericsDllName) + with | Some asm -> match asm.ILScopeRef with | ILScopeRef.Assembly aref -> Some aref @@ -581,10 +582,12 @@ module MainModuleBuilder = tcConfig.win32manifest // 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.win32res = "") - || runningOnMono then + elif + not (tcConfig.target.IsExe) + || not (tcConfig.includewin32manifest) + || not (tcConfig.win32res = "") + || runningOnMono + then "" // otherwise, include the default manifest else @@ -617,9 +620,11 @@ module MainModuleBuilder = tcConfig.target = CompilerTarget.Dll )) |] - if tcConfig.win32res = "" - && tcConfig.win32icon <> "" - && tcConfig.target <> CompilerTarget.Dll then + if + tcConfig.win32res = "" + && tcConfig.win32icon <> "" + && tcConfig.target <> CompilerTarget.Dll + then use ms = new MemoryStream() use iconStream = FileSystem.OpenFileForReadShim(tcConfig.win32icon) Win32ResourceConversions.AppendIconToResourceStream(ms, iconStream) diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index 2d1eb4ce7ae..d769b36678e 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -492,13 +492,14 @@ type internal FxResolver defaultMscorlibVersion // Get the ProductVersion of this framework compare with table compatible monikers - match desktopProductVersionMonikers - |> Array.tryFind (fun (major, minor, build, revision, _) -> - (majorPart >= major) - && (minorPart >= minor) - && (buildPart >= build) - && (privatePart >= revision)) - with + match + desktopProductVersionMonikers + |> Array.tryFind (fun (major, minor, build, revision, _) -> + (majorPart >= major) + && (minorPart >= minor) + && (buildPart >= build) + && (privatePart >= revision)) + with | Some (_, _, _, _, moniker) -> moniker | None -> // no TFM could be found, assume latest stable? @@ -653,7 +654,8 @@ type internal FxResolver "System.Configuration" getFSharpCoreLibraryName - if useFsiAuxLib then fsiLibraryName + if useFsiAuxLib then + fsiLibraryName // always include a default reference to System.ValueTuple.dll in scripts and out-of-project sources match getSystemValueTupleImplementationReference () with @@ -687,7 +689,8 @@ type internal FxResolver [ yield! Directory.GetFiles(implDir, "*.dll") getFSharpCoreImplementationReference () - if useFsiAuxLib then getFsiLibraryImplementationReference () + if useFsiAuxLib then + getFsiLibraryImplementationReference () ] (getDependenciesOf roots).Values |> Seq.toList @@ -979,7 +982,8 @@ type internal FxResolver [ yield! Directory.GetFiles(path, "*.dll") getFSharpCoreImplementationReference () - if useFsiAuxLib then getFsiLibraryImplementationReference () + if useFsiAuxLib then + getFsiLibraryImplementationReference () ] |> List.filter (fun f -> systemAssemblies.Contains(Path.GetFileNameWithoutExtension(f))) diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index bd8a76ab674..fc276a711a0 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -232,8 +232,10 @@ let GenerateIlxCode ) = let mainMethodInfo = - if (tcConfig.target = CompilerTarget.Dll) - || (tcConfig.target = CompilerTarget.Module) then + if + (tcConfig.target = CompilerTarget.Dll) + || (tcConfig.target = CompilerTarget.Module) + then None else Some topAttrs.mainMethodAttrs diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 3470f97a8af..6d764f264dd 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -617,7 +617,8 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam ) // Report the statistics for testing purposes - if tcConfig.reportNumDecls then ReportParsingStatistics res + if tcConfig.reportNumDecls then + ReportParsingStatistics res res) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 67adfb1e8de..868a9f80cae 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -98,7 +98,8 @@ module ScriptPreprocessClosure = let seen = Dictionary<_, bool>() member _.SetSeen check = - if not (seen.ContainsKey check) then seen.Add(check, true) + if not (seen.ContainsKey check) then + seen.Add(check, true) member _.HaveSeen check = seen.ContainsKey check diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index 6c23eb9b024..5ad9ff15f40 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -304,8 +304,10 @@ let FindDependentILModulesForStaticLinking (ctok, tcConfig: TcConfig, tcImports: let ilAssemRef = List.head remaining remaining <- List.tail remaining - if assumedIndependentSet.Contains ilAssemRef.Name - || (ilAssemRef.PublicKey = Some ecmaPublicKey) then + if + assumedIndependentSet.Contains ilAssemRef.Name + || (ilAssemRef.PublicKey = Some ecmaPublicKey) + then depModuleTable[ilAssemRef.Name] <- dummyEntry ilAssemRef.Name else if not (depModuleTable.ContainsKey ilAssemRef.Name) then match tcImports.TryFindDllInfo(ctok, rangeStartup, ilAssemRef.Name, lookupOnly = false) with @@ -502,10 +504,11 @@ let StaticLink (ctok, tcConfig: TcConfig, tcImports: TcImports, ilGlobals: ILGlo | Some provAssemStaticLinkInfo -> (importedBinary, provAssemStaticLinkInfo) ] #endif - if not tcConfig.standalone - && tcConfig.extraStaticLinkRoots.IsEmpty + if + not tcConfig.standalone + && tcConfig.extraStaticLinkRoots.IsEmpty #if !NO_TYPEPROVIDERS - && providerGeneratedAssemblies.IsEmpty + && providerGeneratedAssemblies.IsEmpty #endif then id diff --git a/src/Compiler/Driver/XmlDocFileWriter.fs b/src/Compiler/Driver/XmlDocFileWriter.fs index 97125744ace..fe6ac2a3fac 100644 --- a/src/Compiler/Driver/XmlDocFileWriter.fs +++ b/src/Compiler/Driver/XmlDocFileWriter.fs @@ -63,7 +63,8 @@ module XmlDocWriter = let ptext = defaultArg path "" - if mspec.IsModule then doModuleMemberSig ptext mspec + if mspec.IsModule then + doModuleMemberSig ptext mspec let vals = mtype.AllValsAndMembers @@ -116,7 +117,9 @@ module XmlDocWriter = let rec doModule (mspec: ModuleOrNamespace) = let mtype = mspec.ModuleOrNamespaceType - if mspec.IsModule then modulMember mspec + + if mspec.IsModule then + modulMember mspec let vals = mtype.AllValsAndMembers diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index b0519d50a8d..84fd4742d6d 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -149,7 +149,8 @@ type ConsoleLoggerProvider() = /// Notify the exiter if any error has occurred let AbortOnError (diagnosticsLogger: DiagnosticsLogger, exiter: Exiter) = - if diagnosticsLogger.ErrorCount > 0 then exiter.Exit 1 + if diagnosticsLogger.ErrorCount > 0 then + exiter.Exit 1 let TypeCheck ( @@ -382,7 +383,8 @@ module InterfaceFileWriter = for impl in declaredImpls do writeToFile os impl - if tcConfig.printSignatureFile <> "" then os.Dispose() + if tcConfig.printSignatureFile <> "" then + os.Dispose() let extensionForFile (filePath: string) = if (List.exists (FileSystemUtils.checkSuffix filePath) FSharpMLCompatFileSuffixes) then @@ -489,11 +491,13 @@ let main1 // See Bug 735819 let lcidFromCodePage = - if (Console.OutputEncoding.CodePage <> 65001) - && (Console.OutputEncoding.CodePage - <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) - && (Console.OutputEncoding.CodePage - <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) then + if + (Console.OutputEncoding.CodePage <> 65001) + && (Console.OutputEncoding.CodePage + <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) + && (Console.OutputEncoding.CodePage + <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + then Thread.CurrentThread.CurrentUICulture <- CultureInfo("en-US") Some 1033 else @@ -553,7 +557,8 @@ let main1 tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines // Display the banner text, if necessary - if not bannerAlreadyPrinted then DisplayBannerText tcConfigB + if not bannerAlreadyPrinted then + DisplayBannerText tcConfigB // Create tcGlobals and frameworkTcImports let outfile, pdbfile, assemblyName = @@ -633,7 +638,8 @@ let main1 printfn "%+A" input printf "\n" - if tcConfig.parseOnly then exiter.Exit 0 + if tcConfig.parseOnly then + exiter.Exit 0 if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) @@ -659,7 +665,8 @@ let main1 if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) - if tcConfig.importAllReferencesOnly then exiter.Exit 0 + if tcConfig.importAllReferencesOnly then + exiter.Exit 0 // Build the initial type checking environment ReportTime tcConfig "Typecheck" @@ -912,7 +919,8 @@ let main2 ilSourceDocs)) = - if tcConfig.typeCheckOnly then exiter.Exit 0 + if tcConfig.typeCheckOnly then + exiter.Exit 0 generatedCcu.Contents.SetAttribs(generatedCcu.Contents.Attribs @ topAttrs.assemblyAttrs) @@ -945,7 +953,7 @@ let main2 "AssemblyVersionAttribute" topAttrs.assemblyAttrs tcConfig.deterministic - with + with | Some v -> match tcConfig.version with | VersionNone -> Some v @@ -1351,9 +1359,11 @@ let main6 AbortOnError(diagnosticsLogger, exiter) // Don't copy referenced FSharp.core.dll if we are building FSharp.Core.dll - if (tcConfig.copyFSharpCore = CopyFSharpCoreFlag.Yes) - && not tcConfig.compilingFSharpCore - && not tcConfig.standalone then + if + (tcConfig.copyFSharpCore = CopyFSharpCoreFlag.Yes) + && not tcConfig.compilingFSharpCore + && not tcConfig.standalone + then CopyFSharpCore(outfile, tcConfig.referencedDLLs) ReportTime tcConfig "Exiting" diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index d11ae3d895b..c7f4e0ce0f0 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -381,8 +381,10 @@ type internal TypeCheckInfo if contained then match bestAlmostIncludedSoFar with | Some (rightm: range, _, _) -> - if posGt possm.End rightm.End - || (posEq possm.End rightm.End && posGt possm.Start rightm.Start) then + if + posGt possm.End rightm.End + || (posEq possm.End rightm.End && posGt possm.Start rightm.Start) + then bestAlmostIncludedSoFar <- Some(possm, env, ad) | _ -> bestAlmostIncludedSoFar <- Some(possm, env, ad)) @@ -914,9 +916,10 @@ type internal TypeCheckInfo match TryToResolveLongIdentAsType ncenv nenv m plid with | Some x -> tryTcrefOfAppTy g x | None -> - match lastDotPos - |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) - with + match + lastDotPos + |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) + with | Some p when lineStr[p] = '.' -> match FindFirstNonWhitespacePosition lineStr (p - 1) with | Some colAtEndOfNames -> @@ -1154,7 +1157,7 @@ type internal TypeCheckInfo match GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid, false) |> toCompletionItems - with + with | [], _, _ -> // no record fields found, return completion list as if we were outside any computation expression GetDeclaredItems( @@ -2395,19 +2398,22 @@ module internal ParseAndCheckFile = let errors = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Error then err + if severity = FSharpDiagnosticSeverity.Error then + err ] let warnings = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Warning then err + if severity = FSharpDiagnosticSeverity.Warning then + err ] let infos = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Info then err + if severity = FSharpDiagnosticSeverity.Info then + err ] let message = HashLoadedSourceHasIssues(infos, warnings, errors, rangeOfHashLoad) diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index 3959c84da3f..c2ee71a022e 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -498,7 +498,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, let findBreakPoints () = let checkRange m = [ - if isMatchRange m && not m.IsSynthetic then yield m + if isMatchRange m && not m.IsSynthetic then + yield m ] let walkBindSeqPt sp = @@ -559,7 +560,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | _ -> false // This extends the range of the implicit debug point for 'do expr' range to include the 'do' - if extendDebugPointForDo then yield! checkRange m + if extendDebugPointForDo then + yield! checkRange m let useImplicitDebugPoint = match spInfo with @@ -944,9 +946,10 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, if pos.Column = 0 then // we have a breakpoint that was set with mouse at line start - match locations - |> List.filter (fun m -> m.StartLine = m.EndLine && pos.Line = m.StartLine) - with + match + locations + |> List.filter (fun m -> m.StartLine = m.EndLine && pos.Line = m.StartLine) + with | [] -> match locations |> List.filter (fun m -> rangeContainsPos m pos) with | [] -> diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 2854da14a25..261d6ec094f 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -150,7 +150,9 @@ type ItemKeyStore(mmf: MemoryMappedFile, length) = while reader.Offset < reader.Length do let m = this.ReadRange &reader let keyString2 = this.ReadKeyString &reader - if keyString1.SequenceEqual keyString2 then results.Add m + + if keyString1.SequenceEqual keyString2 then + results.Add m results :> range seq @@ -271,7 +273,9 @@ and [] ItemKeyStoreBuilder() = and writeTypar (isStandalone: bool) (typar: Typar) = match typar.Solution with | Some ty -> writeType isStandalone ty - | _ -> if isStandalone then writeInt64 typar.Stamp + | _ -> + if isStandalone then + writeInt64 typar.Stamp let writeValRef (vref: ValRef) = match vref.MemberInfo with diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index c95195db8ff..bdbc73d783a 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -93,12 +93,14 @@ module TcResolutionsExtensions = | _ -> None let (|KeywordIntrinsicValue|_|) (vref: ValRef) = - if valRefEq g g.raise_vref vref - || valRefEq g g.reraise_vref vref - || valRefEq g g.typeof_vref vref - || valRefEq g g.typedefof_vref vref - || valRefEq g g.sizeof_vref vref - || valRefEq g g.nameof_vref vref then + if + valRefEq g g.raise_vref vref + || valRefEq g g.reraise_vref vref + || valRefEq g g.typeof_vref vref + || valRefEq g g.typedefof_vref vref + || valRefEq g g.sizeof_vref vref + || valRefEq g g.nameof_vref vref + then Some() else None @@ -257,8 +259,10 @@ module TcResolutionsExtensions = match minfos with | [] -> add m SemanticClassificationType.Method | _ -> - if minfos - |> List.forall (fun minfo -> minfo.IsExtensionMember || minfo.IsCSharpStyleExtensionMember) then + if + minfos + |> List.forall (fun minfo -> minfo.IsExtensionMember || minfo.IsCSharpStyleExtensionMember) + then add m SemanticClassificationType.ExtensionMethod else add m SemanticClassificationType.Method diff --git a/src/Compiler/Service/ServiceAnalysis.fs b/src/Compiler/Service/ServiceAnalysis.fs index 09e3545e8ad..38af8f7156c 100644 --- a/src/Compiler/Service/ServiceAnalysis.fs +++ b/src/Compiler/Service/ServiceAnalysis.fs @@ -40,7 +40,8 @@ module UnusedOpens = // fv.IsExtensionMember is always false for C# extension methods returning by `MembersFunctionsAndValues`, // so we have to check Extension attribute instead. // (note: fv.IsExtensionMember has proper value for symbols returning by GetAllUsesOfAllSymbolsInFile though) - if fv.HasAttribute() then fv + if fv.HasAttribute() then + fv for apCase in entity.ActivePatternCases do apCase @@ -429,11 +430,13 @@ module UnusedDeclarations = symbolsUses |> Seq.distinctBy (fun su -> su.Range) // Account for "hidden" uses, like a val in a member val definition. These aren't relevant |> Seq.choose (fun (su: FSharpSymbolUse) -> - if su.IsFromDefinition - && su.Symbol.DeclarationLocation.IsSome - && (isScript || su.IsPrivateToFile) - && not (su.Symbol.DisplayName.StartsWith "_") - && isPotentiallyUnusedDeclaration su.Symbol then + if + su.IsFromDefinition + && su.Symbol.DeclarationLocation.IsSome + && (isScript || su.IsPrivateToFile) + && not (su.Symbol.DisplayName.StartsWith "_") + && isPotentiallyUnusedDeclaration su.Symbol + then Some(su, usages.Contains su.Symbol.DeclarationLocation.Value) else None) diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs index 5458e129ffd..410d02dc786 100644 --- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs +++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs @@ -206,9 +206,11 @@ module InterfaceStubGenerator = let nm = match arg.Name with | None -> - if arg.Type.HasTypeDefinition - && arg.Type.TypeDefinition.CompiledName = "unit" - && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" then + if + arg.Type.HasTypeDefinition + && arg.Type.TypeDefinition.CompiledName = "unit" + && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" + then "()" else sprintf "arg%d" (namesWithIndices |> Map.toSeq |> Seq.map snd |> Seq.sumBy Set.count |> max 1) @@ -303,8 +305,10 @@ module InterfaceStubGenerator = let internal normalizePropertyName (v: FSharpMemberOrFunctionOrValue) = let displayName = v.DisplayName - if (v.IsPropertyGetterMethod && displayName.StartsWithOrdinal("get_")) - || (v.IsPropertySetterMethod && displayName.StartsWithOrdinal("set_")) then + if + (v.IsPropertyGetterMethod && displayName.StartsWithOrdinal("get_")) + || (v.IsPropertySetterMethod && displayName.StartsWithOrdinal("set_")) + then displayName[4..] else displayName @@ -362,7 +366,8 @@ module InterfaceStubGenerator = [ if v.InlineAnnotation = FSharpInlineAnnotation.AlwaysInline then yield "inline" - if v.Accessibility.IsInternal then yield "internal" + if v.Accessibility.IsInternal then + yield "internal" ] let argInfos, retType = getArgTypes ctx v @@ -371,9 +376,13 @@ module InterfaceStubGenerator = // A couple of helper methods for emitting close declarations of members and stub method bodies. let closeDeclaration (returnType: string) (writer: ColumnIndentedTextWriter) = - if verboseMode then writer.Write(": {0}", returnType) + if verboseMode then + writer.Write(": {0}", returnType) + writer.Write(" = ", returnType) - if verboseMode then writer.WriteLine("") + + if verboseMode then + writer.WriteLine("") let writeImplementation (ctx: Context) (writer: ColumnIndentedTextWriter) = match verboseMode, ctx.MethodBody with @@ -435,7 +444,10 @@ module InterfaceStubGenerator = let closeDeclaration = closeDeclaration retType let writeImplementation = writeImplementation ctx let writer = ctx.Writer - if isEventMember v then writer.WriteLine("[]") + + if isEventMember v then + writer.WriteLine("[]") + writer.Write("member ") for modifier in modifiers do @@ -464,7 +476,9 @@ module InterfaceStubGenerator = writer.Write(")") writer.Write(" = ") - if verboseMode then writer.WriteLine("") + + if verboseMode then + writer.WriteLine("") writer |> writeImplementation writer.Unindent ctx.Indentation diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 9ecdbb823a4..9f14d717af2 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -683,8 +683,10 @@ module internal LexerStateEncoding = let kind2 = ((nestingValue &&& 0b000000000011) >>> 0) [ - if tag1 then i1, decodeStringStyle kind1, range0 - if tag2 then i2, decodeStringStyle kind2, range0 + if tag1 then + i1, decodeStringStyle kind1, range0 + if tag2 then + i2, decodeStringStyle kind2, range0 ] (colorState, ncomments, pos, ifDefs, hardwhite, stringKind, stringNest) diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index f162076d44e..68b7eb268f9 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -831,7 +831,9 @@ module NavigateTo = and walkSynModuleOrNamespaceSig (inp: SynModuleOrNamespaceSig) container = let (SynModuleOrNamespaceSig (longId = lid; kind = kind; decls = decls)) = inp let isModule = kind.IsModule - if isModule then addModule lid true container + + if isModule then + addModule lid true container let container = { @@ -900,7 +902,9 @@ module NavigateTo = and walkSynModuleOrNamespace inp container = let (SynModuleOrNamespace (longId = lid; kind = kind; decls = decls)) = inp let isModule = kind.IsModule - if isModule then addModule lid false container + + if isModule then + addModule lid false container let container = { diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index 35b4b777d8a..ff34dd392d4 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -222,8 +222,10 @@ module internal ParameterLocationsImpl = let lidm = lidwd.Range let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End - if SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos - && args |> List.forall isStaticArg then + if + SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos + && args |> List.forall isStaticArg + then let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ] Some( @@ -344,8 +346,10 @@ module internal ParameterLocationsImpl = | None -> let typeArgsm = mkRange openm.FileName openm.Start wholem.End - if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos - && tyArgs |> List.forall isStaticArg then + if + SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos + && tyArgs |> List.forall isStaticArg + then let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ] let argRanges = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 32e20db6486..e2eedc9ba47 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -246,14 +246,15 @@ module SyntaxTraversal = else None) diveResults - with + with | [] -> // No entity's range contained the desired position. However the ranges in the parse tree only span actual characters present in the file. // The cursor may be at whitespace between entities or after everything, so find the nearest entity with the range left of the position. let mutable e = diveResults.Head for r in diveResults do - if posGt pos (fst r).Start then e <- r + if posGt pos (fst r).Start then + e <- r snd (e) () | [ x ] -> x () @@ -396,9 +397,11 @@ module SyntaxTraversal = // special-case:caret is located in the offside position below inherit // inherit A() // $ - if not (rangeContainsPos expr.Range pos) - && sepOpt.IsNone - && pos.Column = inheritRange.StartColumn then + if + not (rangeContainsPos expr.Range pos) + && sepOpt.IsNone + && pos.Column = inheritRange.StartColumn + then visitor.VisitRecordField(path, None, None) else traverseSynExpr expr) @@ -451,9 +454,11 @@ module SyntaxTraversal = // special case: caret is below field binding // field x = 5 // $ - if not (rangeContainsPos e.Range pos) - && sepOpt.IsNone - && pos.Column = offsideColumn then + if + not (rangeContainsPos e.Range pos) + && sepOpt.IsNone + && pos.Column = offsideColumn + then visitor.VisitRecordField(path, copyOpt, None) else traverseSynExpr expr) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index f61893d0eaf..757cd90a264 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -1539,7 +1539,9 @@ module ParsedInput = None override this.VisitModuleOrNamespace(_, SynModuleOrNamespace (longId = longId; range = range)) = - if rangeContainsPos range pos then path <- path @ longId + if rangeContainsPos range pos then + path <- path @ longId + None // we should traverse the rest of the AST to find the smallest module } @@ -1916,7 +1918,9 @@ module ParsedInput = List.iter walkAttribute attrs List.iter walkTyparDecl typars List.iter walkTypeConstraint constraints - if isTypeExtensionOrAlias then addLongIdent longIdent + + if isTypeExtensionOrAlias then + addLongIdent longIdent and walkTypeDefnRepr inp = match inp with diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index 8e3a96112ca..995e4e4d3e9 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -319,24 +319,28 @@ module Structure = | SynExpr.App (atomicFlag, isInfix, funcExpr, argExpr, r) -> // seq exprs, custom operators, etc - if ExprAtomicFlag.NonAtomic = atomicFlag - && not isInfix - && (match funcExpr with - | SynExpr.Ident _ -> true - | _ -> false) - && (match argExpr with - | SynExpr.ComputationExpr _ -> false - | _ -> true) then + if + ExprAtomicFlag.NonAtomic = atomicFlag + && not isInfix + && (match funcExpr with + | SynExpr.Ident _ -> true + | _ -> false) + && (match argExpr with + | SynExpr.ComputationExpr _ -> false + | _ -> true) + then // if the argExpr is a computation expression another match will handle the outlining // these cases must be removed to prevent creating unnecessary tags for the same scope let collapse = Range.endToEnd funcExpr.Range r rcheck Scope.SpecialFunc Collapse.Below r collapse - elif ExprAtomicFlag.NonAtomic = atomicFlag - && (not isInfix) - && (match argExpr with - | SynExpr.ComputationExpr _ -> true - | _ -> false) then + elif + ExprAtomicFlag.NonAtomic = atomicFlag + && (not isInfix) + && (match argExpr with + | SynExpr.ComputationExpr _ -> true + | _ -> false) + then let collapse = Range.startToEnd argExpr.Range r let collapse = Range.modBoth 1 1 collapse rcheck Scope.ComputationExpr Collapse.Same r collapse diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 023c0ddfe2a..20fd5956c43 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -334,11 +334,13 @@ type BackgroundCompiler // these cross-project references to FSharp.Core are VisualFSharp.sln and FSharp.sln. The ramification // of this is that you need to build FSharp.Core to get intellisense in those projects. - if (try + if + (try Path.GetFileNameWithoutExtension(nm) - with _ -> - "") - <> GetFSharpCoreLibraryName() then + with _ -> + "") + <> GetFSharpCoreLibraryName() + then { new IProjectReference with member x.EvaluateRawContents() = node { diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index c9b201b9445..67f6c78f558 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -211,7 +211,8 @@ let stringBufferIsBytes (buf: ByteBuffer) = let mutable ok = true for i = 0 to bytes.Length / 2 - 1 do - if bytes.Span[i * 2 + 1] <> 0uy then ok <- false + if bytes.Span[i * 2 + 1] <> 0uy then + ok <- false ok @@ -237,15 +238,20 @@ let hexdigit d = else failwith "hexdigit" let unicodeGraphShort (s: string) = - if s.Length <> 4 then failwith "unicodegraph" + if s.Length <> 4 then + failwith "unicodegraph" + uint16 (hexdigit s[0] * 4096 + hexdigit s[1] * 256 + hexdigit s[2] * 16 + hexdigit s[3]) let hexGraphShort (s: string) = - if s.Length <> 2 then failwith "hexgraph" + if s.Length <> 2 then + failwith "hexgraph" + uint16 (hexdigit s[0] * 16 + hexdigit s[1]) let unicodeGraphLong (s: string) = - if s.Length <> 8 then failwith "unicodeGraphLong" + if s.Length <> 8 then + failwith "unicodeGraphLong" let high = hexdigit s[0] * 4096 + hexdigit s[1] * 256 + hexdigit s[2] * 16 + hexdigit s[3] in diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index bcaebd20b92..ff7a44e98a4 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -25,7 +25,7 @@ open Internal.Utilities.Text.Parsing /// information about the grammar at the point where the error occurred, e.g. what tokens /// are valid to shift next at that point in the grammar. This information is processed in CompileOps.fs. [] -exception SyntaxError of obj (* ParseErrorContext<_> *) * range: range +exception SyntaxError of obj (* ParseErrorContext<_> *) * range: range exception IndentationProblem of string * range diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index ad02a04b1b7..6e25b5c6360 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -527,7 +527,8 @@ let DoesIdentifierNeedBackticks (name: string) : bool = /// A utility to help determine if an identifier needs to be quoted let AddBackticksToIdentifierIfNeeded (name: string) : string = if - DoesIdentifierNeedBackticks name && not (name.StartsWithOrdinal("`")) + DoesIdentifierNeedBackticks name + && not (name.StartsWithOrdinal("`")) && not (name.EndsWithOrdinal("`")) then "``" + name + "``" @@ -820,7 +821,10 @@ let TryDemangleGenericNameAndPos (n: string) = while res && i < n.Length do let char = n[i] - if not (char >= '0' && char <= '9') then res <- false + + if not (char >= '0' && char <= '9') then + res <- false + i <- i + 1 if res then ValueSome pos else ValueNone diff --git a/src/Compiler/SyntaxTree/XmlDoc.fs b/src/Compiler/SyntaxTree/XmlDoc.fs index 81dbde3ca22..72c657d2911 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fs +++ b/src/Compiler/SyntaxTree/XmlDoc.fs @@ -262,7 +262,10 @@ type PreXmlDoc = let lines = Array.map fst preLines let m = Array.reduce unionRanges (Array.map snd preLines) let doc = XmlDoc(lines, m) - if check then doc.Check(paramNamesOpt) + + if check then + doc.Check(paramNamesOpt) + doc member internal x.Range = diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index 465adeac51d..bdd64e87b69 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -127,7 +127,8 @@ type ByteArrayMemory(bytes: byte[], offset, length) = ByteArrayMemory(Array.empty, 0, 0) :> ByteMemory override _.CopyTo stream = - if length > 0 then stream.Write(bytes, offset, length) + if length > 0 then + stream.Write(bytes, offset, length) override _.Copy(srcOffset, dest, destOffset, count) = checkCount count @@ -412,7 +413,8 @@ module internal FileSystemUtils = let checkSuffix (path: string) (suffix: string) = path.EndsWithOrdinalIgnoreCase(suffix) let hasExtensionWithValidate (validate: bool) (s: string) = - if validate then (checkPathForIllegalChars s) + if validate then + (checkPathForIllegalChars s) let sLen = s.Length @@ -437,7 +439,8 @@ module internal FileSystemUtils = Path.GetFileName(path) let fileNameWithoutExtensionWithValidate (validate: bool) path = - if validate then checkPathForIllegalChars path + if validate then + checkPathForIllegalChars path Path.GetFileNameWithoutExtension(path) @@ -563,7 +566,8 @@ type DefaultFileSystem() as this = let stream = new MemoryMappedStream(mmf, length) - if not stream.CanRead then invalidOp "Cannot read file" + if not stream.CanRead then + invalidOp "Cannot read file" stream :> Stream @@ -881,7 +885,8 @@ type internal ByteStream = } member b.ReadByte() = - if b.pos >= b.max then failwith "end of stream" + if b.pos >= b.max then + failwith "end of stream" let res = b.bytes[b.pos] b.pos <- b.pos + 1 @@ -948,7 +953,8 @@ type internal ByteBuffer = Bytes.blit old 0 buf.bbArray 0 buf.bbCurrent - if buf.useArrayPool then ArrayPool.Shared.Return old + if buf.useArrayPool then + ArrayPool.Shared.Return old member buf.AsMemory() = buf.CheckDisposed() diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index cb750676fe3..b88af5d77eb 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -170,7 +170,8 @@ type internal HashMultiMap<'Key, 'Value>(size: int, comparer: IEqualityComparer< member s.Remove(x) = match s.TryFind x.Key with | Some v -> - if Unchecked.equals v x.Value then s.Remove(x.Key) + if Unchecked.equals v x.Value then + s.Remove(x.Key) true | _ -> false diff --git a/src/Compiler/Utilities/ImmutableArray.fs b/src/Compiler/Utilities/ImmutableArray.fs index 5311efa5e0c..985799856c0 100644 --- a/src/Compiler/Utilities/ImmutableArray.fs +++ b/src/Compiler/Utilities/ImmutableArray.fs @@ -18,7 +18,8 @@ module ImmutableArray = | 0 -> ImmutableArray.Empty | 1 -> ImmutableArray.Create(f 0) | n -> - if n < 0 then invalidArg "n" "Below zero." + if n < 0 then + invalidArg "n" "Below zero." let builder = ImmutableArray.CreateBuilder(n) @@ -180,7 +181,8 @@ module ImmutableArray = let builder = ImmutableArray.CreateBuilder(arr.Length) for i = 0 to arr.Length - 1 do - if predicate arr[i] then builder.Add(arr[i]) + if predicate arr[i] then + builder.Add(arr[i]) builder.Capacity <- builder.Count builder.MoveToImmutable() @@ -199,7 +201,8 @@ module ImmutableArray = for i = 0 to arr.Length - 1 do let result = chooser arr[i] - if result.IsSome then builder.Add(result.Value) + if result.IsSome then + builder.Add(result.Value) builder.Capacity <- builder.Count builder.MoveToImmutable() diff --git a/src/Compiler/Utilities/ResizeArray.fs b/src/Compiler/Utilities/ResizeArray.fs index e96c775f972..cd6e405129c 100644 --- a/src/Compiler/Utilities/ResizeArray.fs +++ b/src/Compiler/Utilities/ResizeArray.fs @@ -26,7 +26,8 @@ module internal ResizeArray = if start2 < 0 then invalidArg "start2" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start1 + len > length arr1 then invalidArg "start1" "(start1+len) out of range" @@ -52,7 +53,8 @@ module internal ResizeArray = if start < 0 then invalidArg "start" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start + len > length arr then invalidArg "len" "length must be positive" @@ -63,7 +65,8 @@ module internal ResizeArray = if start < 0 then invalidArg "start" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start + len > length arr then invalidArg "len" "length must be positive" @@ -203,7 +206,9 @@ module internal ResizeArray = for i = 0 to length arr - 1 do let x = arr[i] - if f x then res.Add(x) + + if f x then + res.Add(x) res diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 7d99073da91..3c1172aec7d 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -199,7 +199,8 @@ module Array = let mutable i = 0 while eq && i < len do - if not (inp[i] === res[i]) then eq <- false + if not (inp[i] === res[i]) then + eq <- false i <- i + 1 @@ -1082,9 +1083,11 @@ type MemoizationTable<'T, 'U>(compute: 'T -> 'U, keyComparer: IEqualityComparer< let table = new ConcurrentDictionary<'T, 'U>(keyComparer) member t.Apply x = - if (match canMemoize with - | None -> true - | Some f -> f x) then + if + (match canMemoize with + | None -> true + | Some f -> f x) + then match table.TryGetValue x with | true, res -> res | _ -> diff --git a/src/Compiler/Utilities/range.fs b/src/Compiler/Utilities/range.fs index 035a5de80f4..bbd6a9f0673 100755 --- a/src/Compiler/Utilities/range.fs +++ b/src/Compiler/Utilities/range.fs @@ -343,9 +343,11 @@ type Range(code1: int64, code2: int64) = member m.DebugCode = let name = m.FileName - if name = unknownFileName - || name = startupFileName - || name = commandLineArgsFileName then + if + name = unknownFileName + || name = startupFileName + || name = commandLineArgsFileName + then name else @@ -460,20 +462,26 @@ module Range = else // If all identical then return m1. This preserves NotedSourceConstruct when no merging takes place - if m1.Code1 = m2.Code1 && m1.Code2 = m2.Code2 then + if + m1.Code1 = m2.Code1 && m1.Code2 = m2.Code2 + then m1 else let start = - if (m1.StartLine > m2.StartLine - || (m1.StartLine = m2.StartLine && m1.StartColumn > m2.StartColumn)) then + if + (m1.StartLine > m2.StartLine + || (m1.StartLine = m2.StartLine && m1.StartColumn > m2.StartColumn)) + then m2 else m1 let finish = - if (m1.EndLine > m2.EndLine - || (m1.EndLine = m2.EndLine && m1.EndColumn > m2.EndColumn)) then + if + (m1.EndLine > m2.EndLine + || (m1.EndLine = m2.EndLine && m1.EndColumn > m2.EndColumn)) + then m1 else m2 diff --git a/src/Compiler/Utilities/sformat.fs b/src/Compiler/Utilities/sformat.fs index 2c2a4096573..42b13e28ff9 100644 --- a/src/Compiler/Utilities/sformat.fs +++ b/src/Compiler/Utilities/sformat.fs @@ -632,7 +632,8 @@ module Display = Breaks(next + 1, outer, stack) let popBreak (Breaks (next, outer, stack)) = - if next = 0 then raise (Failure "popBreak: underflow") + if next = 0 then + raise (Failure "popBreak: underflow") let topBroke = stack[next - 1] < 0 @@ -1312,12 +1313,14 @@ module Display = let possibleKeyValueL v = let tyv = v.GetType() - if word = "map" - && (match v with - | null -> false - | _ -> true) - && tyv.IsGenericType - && tyv.GetGenericTypeDefinition() = typedefof> then + if + word = "map" + && (match v with + | null -> false + | _ -> true) + && tyv.IsGenericType + && tyv.GetGenericTypeDefinition() = typedefof> + then nestedObjL depthLim Precedence.BracketIfTuple @@ -1529,8 +1532,10 @@ module Display = "-infinity" elif Double.IsPositiveInfinity(d) then "infinity" - elif opts.FloatingPointFormat[0] = 'g' - && String.forall (fun c -> Char.IsDigit(c) || c = '-') s then + elif + opts.FloatingPointFormat[0] = 'g' + && String.forall (fun c -> Char.IsDigit(c) || c = '-') s + then s + ".0" else s @@ -1545,11 +1550,13 @@ module Display = "-infinity" elif Single.IsPositiveInfinity(d) then "infinity" - elif opts.FloatingPointFormat.Length >= 1 - && opts.FloatingPointFormat[0] = 'g' - && float32 (Int32.MinValue) < d - && d < float32 (Int32.MaxValue) - && float32 (int32 (d)) = d then + elif + opts.FloatingPointFormat.Length >= 1 + && opts.FloatingPointFormat[0] = 'g' + && float32 (Int32.MinValue) < d + && d < float32 (Int32.MaxValue) + && float32 (int32 (d)) = d + then (Convert.ToInt32 d).ToString(opts.FormatProvider) + ".0" else d.ToString(opts.FloatingPointFormat, opts.FormatProvider)) diff --git a/src/FSharp.Build/FSharpEmbedResXSource.fs b/src/FSharp.Build/FSharpEmbedResXSource.fs index 39d44f052eb..4b34660b2a8 100644 --- a/src/FSharp.Build/FSharpEmbedResXSource.fs +++ b/src/FSharp.Build/FSharpEmbedResXSource.fs @@ -41,9 +41,11 @@ module internal {1} = let sourcePath = Path.Combine(_outputPath, justFileName + ".fs") // simple up-to-date check - if File.Exists(resx) - && File.Exists(sourcePath) - && File.GetLastWriteTimeUtc(resx) <= File.GetLastWriteTimeUtc(sourcePath) then + if + File.Exists(resx) + && File.Exists(sourcePath) + && File.GetLastWriteTimeUtc(resx) <= File.GetLastWriteTimeUtc(sourcePath) + then printMessage (sprintf "Skipping generation: '%s' since it is up-to-date." sourcePath) Some(sourcePath) else diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index f9d0ffd72fb..220618ae563 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -212,7 +212,7 @@ module internal Adapters = type ConversionDescription = | TupleConv of ConversionDescription list | RecordConv of Type * ConversionDescription list - | GroupingConv (* origKeyType: *) of Type (* origElemType: *) * Type * ConversionDescription + | GroupingConv (* origKeyType: *) of Type (* origElemType: *) * Type * ConversionDescription | SeqConv of ConversionDescription | NoConv diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 1dff8103bda..8c2fa8470fa 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -17,7 +17,8 @@ open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators module Array = let inline checkNonNull argName arg = - if isNull arg then nullArg argName + if isNull arg then + nullArg argName let inline indexNotFound () = raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) @@ -1601,7 +1602,9 @@ module Array = for i = 1 to array.Length - 1 do let curr = array.[i] - if curr < acc then acc <- curr + + if curr < acc then + acc <- curr acc @@ -1636,7 +1639,9 @@ module Array = for i = 1 to array.Length - 1 do let curr = array.[i] - if curr > acc then acc <- curr + + if curr > acc then + acc <- curr acc diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 46cd93a84ee..e907040c94c 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -412,7 +412,8 @@ type AsyncActivation<'T>(contents: AsyncActivationContents<'T>) = ok <- true res finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() member ctxt.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) = let holder = contents.aux.trampolineHolder @@ -486,7 +487,8 @@ module AsyncPrimitives = result <- userCode arg ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then AsyncActivation<'T>.HijackCheckThenCall ctxt ctxt.cont result @@ -508,7 +510,8 @@ module AsyncPrimitives = result <- part2 result1 ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then Invoke result ctxt @@ -525,7 +528,8 @@ module AsyncPrimitives = res <- userCode result1 ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then res.Invoke ctxt else fake () @@ -543,7 +547,8 @@ module AsyncPrimitives = resOpt <- filterFunction (edi.GetAssociatedSourceException()) ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then match resOpt with @@ -990,7 +995,9 @@ module AsyncPrimitives = else // In this case the ResultCell has already been disposed, e.g. due to a timeout. // The result is dropped on the floor. - if disposed then + if + disposed + then [] else result <- Some res diff --git a/src/FSharp.Core/eventmodule.fs b/src/FSharp.Core/eventmodule.fs index cd9dc68a76d..fc3c2eabd64 100644 --- a/src/FSharp.Core/eventmodule.fs +++ b/src/FSharp.Core/eventmodule.fs @@ -22,7 +22,11 @@ module Event = [] let filter predicate (sourceEvent: IEvent<'Delegate, 'T>) = let ev = new Event<_>() - sourceEvent.Add(fun x -> if predicate x then ev.Trigger x) + + sourceEvent.Add(fun x -> + if predicate x then + ev.Trigger x) + ev.Publish [] diff --git a/src/FSharp.Core/list.fs b/src/FSharp.Core/list.fs index fbf8089610d..e0dff3d7adb 100644 --- a/src/FSharp.Core/list.fs +++ b/src/FSharp.Core/list.fs @@ -15,7 +15,8 @@ open System.Collections.Generic module List = let inline checkNonNull argName arg = - if isNull arg then nullArg argName + if isNull arg then + nullArg argName let inline indexNotFound () = raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) @@ -742,7 +743,8 @@ module List = let mutable acc = h for x in t do - if x > acc then acc <- x + if x > acc then + acc <- x acc @@ -771,7 +773,8 @@ module List = let mutable acc = h for x in t do - if x < acc then acc <- x + if x < acc then + acc <- x acc @@ -910,7 +913,9 @@ module List = match curr with | [] -> invalidArg "index" "index must be within bounds of the list" | h :: t -> - if i < index then coll.Add(h) //items before index we keep + if i < index then + coll.Add(h) //items before index we keep + curr <- t i <- i + 1 diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 0d510239f32..9fad005450e 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -1040,7 +1040,8 @@ and KeyCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value>) parent.ContainsKey x member _.CopyTo(arr, index) = - if isNull arr then nullArg "arr" + if isNull arr then + nullArg "arr" if index < 0 then invalidArg "index" "index must be positive" @@ -1090,7 +1091,8 @@ and ValueCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value parent.Exists(fun _ value -> Unchecked.equals value x) member _.CopyTo(arr, index) = - if isNull arr then nullArg "arr" + if isNull arr then + nullArg "arr" if index < 0 then invalidArg "index" "index must be positive" diff --git a/src/FSharp.Core/observable.fs b/src/FSharp.Core/observable.fs index d1bcd160313..eb34c62c850 100644 --- a/src/FSharp.Core/observable.fs +++ b/src/FSharp.Core/observable.fs @@ -12,11 +12,12 @@ open Microsoft.FSharp.Control module Observable = let inline protect f succeed fail = - match (try - Choice1Of2(f ()) - with e -> - Choice2Of2 e) - with + match + (try + Choice1Of2(f ()) + with e -> + Choice2Of2 e) + with | Choice1Of2 x -> (succeed x) | Choice2Of2 e -> (fail e) @@ -34,7 +35,8 @@ module Observable = interface IObserver<'T> with member x.OnNext value = - if not stopped then x.Next value + if not stopped then + x.Next value member x.OnError e = if not stopped then @@ -166,7 +168,8 @@ module Observable = source1.Subscribe { new IObserver<'T> with member x.OnNext(v) = - if not stopped then observer.OnNext v + if not stopped then + observer.OnNext v member x.OnError(e) = if not stopped then @@ -186,7 +189,8 @@ module Observable = source2.Subscribe { new IObserver<'T> with member x.OnNext(v) = - if not stopped then observer.OnNext v + if not stopped then + observer.OnNext v member x.OnError(e) = if not stopped then diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index a309d9c1816..54ca7e2e3c4 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -1469,9 +1469,11 @@ module Patterns = else // If a known-number-of-arguments-including-object-argument has been given then check that - if (match knownArgCount with - | ValueNone -> false - | ValueSome n -> n <> (if methInfo.IsStatic then 0 else 1) + nargTs) then + if + (match knownArgCount with + | ValueNone -> false + | ValueSome n -> n <> (if methInfo.IsStatic then 0 else 1) + nargTs) + then false else diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 4bc089765fb..76dbb87c490 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -1172,10 +1172,12 @@ type FSharpType = // No assembly passed therefore just get framework local version of Tuple let asm = typeof.Assembly - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType false asm types @@ -1183,10 +1185,12 @@ type FSharpType = static member MakeTupleType(asm: Assembly, types: Type[]) = checkNonNull "types" types - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType false asm types @@ -1194,10 +1198,12 @@ type FSharpType = static member MakeStructTupleType(asm: Assembly, types: Type[]) = checkNonNull "types" types - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType true asm types diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index b04ecfa3ec8..18d89ce07f7 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -214,7 +214,9 @@ module Internal = member _.Current = box (get ()) member _.MoveNext() = - if not started then started <- true + if not started then + started <- true + curr <- None while (curr.IsNone && e.MoveNext()) do @@ -244,7 +246,9 @@ module Internal = member _.MoveNext() = let rec next () = - if not started then started <- true + if not started then + started <- true + e.MoveNext() && (f e.Current || next ()) next () @@ -304,7 +308,8 @@ module Internal = current <- (Unchecked.defaultof<_>) // cache node unprimed, initialised on demand. let getCurrent () = - if index = unstarted then notStarted () + if index = unstarted then + notStarted () if index = completed then alreadyFinished () @@ -507,7 +512,8 @@ module Internal = interface System.IDisposable with member _.Dispose() = - if not finished then disposeG g + if not finished then + disposeG g // Internal type, used to optimize Enumerator/Generator chains type LazyGeneratorWrappingEnumerator<'T>(e: IEnumerator<'T>) = @@ -791,7 +797,9 @@ module Seq = while (Option.isNone res && e.MoveNext()) do let c = e.Current - if predicate c then res <- Some c + + if predicate c then + res <- Some c res @@ -1316,7 +1324,8 @@ module Seq = let hashSet = HashSet<'T>(HashIdentity.Structural<'T>) for v in source do - if hashSet.Add v then yield v + if hashSet.Add v then + yield v } [] @@ -1484,7 +1493,9 @@ module Seq = while e.MoveNext() do let curr = e.Current - if curr < acc then acc <- curr + + if curr < acc then + acc <- curr acc @@ -1522,7 +1533,9 @@ module Seq = while e.MoveNext() do let curr = e.Current - if curr > acc then acc <- curr + + if curr > acc then + acc <- curr acc @@ -1593,8 +1606,10 @@ module Seq = let mutable ok = false while e.MoveNext() do - if (latest <- e.Current - (ok || not (predicate latest))) then + if + (latest <- e.Current + (ok || not (predicate latest))) + then ok <- true yield latest } @@ -1741,11 +1756,15 @@ module Seq = if e.MoveNext() then let cached = HashSet(itemsToExclude, HashIdentity.Structural) let next = e.Current - if cached.Add next then yield next + + if cached.Add next then + yield next while e.MoveNext() do let next = e.Current - if cached.Add next then yield next + + if cached.Add next then + yield next } [] @@ -1794,7 +1813,9 @@ module Seq = let mutable i = 0 for item in source do - if i <> index then yield item + if i <> index then + yield item + i <- i + 1 if i <= index then @@ -1848,11 +1869,14 @@ module Seq = let mutable i = 0 for item in source do - if i = index then yield value + if i = index then + yield value + yield item i <- i + 1 - if i = index then yield value + if i = index then + yield value if i < index then invalidArg "index" "index must be within bounds of the array" @@ -1867,11 +1891,14 @@ module Seq = let mutable i = 0 for item in source do - if i = index then yield! values + if i = index then + yield! values + yield item i <- i + 1 - if i = index then yield! values // support inserting at the end + if i = index then + yield! values // support inserting at the end if i < index then invalidArg "index" "index must be within bounds of the array" diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs index 6d2a990efc2..8a1b526837a 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs @@ -308,7 +308,9 @@ module internal Utilities = // Use enabled feeds only (see NuGet.Commands.ListSourceRunner.Run) and strip off the flags. if source.Length > 0 && source.[0] = 'E' then let pos = source.IndexOf(" ") - if pos >= 0 then "i", source.Substring(pos).Trim() + + if pos >= 0 then + "i", source.Substring(pos).Trim() } let computeSha256HashOfBytes (bytes: byte[]) : byte[] = SHA256.Create().ComputeHash(bytes) diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 9eae6cba0e4..ebdf21af60d 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -26,8 +26,10 @@ let main (argv) = let compilerName = // the 64 bit desktop version of the compiler is name fscAnyCpu.exe, all others are fsc.exe - if Environment.Is64BitProcess - && typeof.Assembly.GetName().Name <> "System.Private.CoreLib" then + if + Environment.Is64BitProcess + && typeof.Assembly.GetName().Name <> "System.Private.CoreLib" + then "fscAnyCpu.exe" else "fsc.exe" diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 05f242990b2..b64849394d3 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -247,8 +247,10 @@ type internal ReadLineConsole() = checkLeftEdge false let writeChar (c) = - if Console.CursorTop = Console.BufferHeight - 1 - && Console.CursorLeft = Console.BufferWidth - 1 then + if + Console.CursorTop = Console.BufferHeight - 1 + && Console.CursorLeft = Console.BufferWidth - 1 + then //printf "bottom right!\n" anchor <- { anchor with top = (anchor).top - 1 } @@ -278,7 +280,8 @@ type internal ReadLineConsole() = let mutable position = -1 for i = 0 to input.Length - 1 do - if (i = curr) then position <- output.Length + if (i = curr) then + position <- output.Length let c = input.Chars(i) @@ -287,7 +290,8 @@ type internal ReadLineConsole() = else output.Append(c) |> ignore - if (curr = input.Length) then position <- output.Length + if (curr = input.Length) then + position <- output.Length // render the current text, computing a new value for "rendered" let old_rendered = rendered @@ -419,7 +423,8 @@ type internal ReadLineConsole() = if (line = "\x1A") then null else - if (line.Length > 0) then history.AddLast(line) + if (line.Length > 0) then + history.AddLast(line) line diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index b94a152c171..ae6513f00cc 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -411,8 +411,10 @@ let MainMain argv = || x = "/shadowcopyreferences+" || x = "--shadowcopyreferences+") - if AppDomain.CurrentDomain.IsDefaultAppDomain() - && argv |> Array.exists isShadowCopy then + if + AppDomain.CurrentDomain.IsDefaultAppDomain() + && argv |> Array.exists isShadowCopy + then let setupInformation = AppDomain.CurrentDomain.SetupInformation setupInformation.ShadowCopyFiles <- "true" let helper = AppDomain.CreateDomain("FSI_Domain", null, setupInformation) From b8aaf2d272ef537c4da40938147e416d376bba29 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 11 Jul 2022 20:18:51 +0100 Subject: [PATCH 032/226] Allow lower-case DU cases when RequireQualifiedAccess is specified (#13432) * Allow lower-case DU cases when RequireQualifiedAccess is specified * Fix PR suggestions and Add more testing * Protect feature under preview version * Add a NotUpperCaseConstructorWithoutRQA warning to be raised in lang version preview * Fix formatting --- src/Compiler/Checking/CheckDeclarations.fs | 30 ++++++---- src/Compiler/Checking/CheckDeclarations.fsi | 2 + src/Compiler/Driver/CompilerDiagnostics.fs | 5 ++ src/Compiler/FSComp.txt | 1 + src/Compiler/FSStrings.resx | 3 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ src/Compiler/xlf/FSStrings.cs.xlf | 5 ++ src/Compiler/xlf/FSStrings.de.xlf | 5 ++ src/Compiler/xlf/FSStrings.es.xlf | 5 ++ src/Compiler/xlf/FSStrings.fr.xlf | 5 ++ src/Compiler/xlf/FSStrings.it.xlf | 5 ++ src/Compiler/xlf/FSStrings.ja.xlf | 5 ++ src/Compiler/xlf/FSStrings.ko.xlf | 5 ++ src/Compiler/xlf/FSStrings.pl.xlf | 5 ++ src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 ++ src/Compiler/xlf/FSStrings.ru.xlf | 5 ++ src/Compiler/xlf/FSStrings.tr.xlf | 5 ++ src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 ++ src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 ++ .../E_LowercaseWhenRequireQualifiedAccess.fsx | 22 +++++++ .../LowercaseWhenRequireQualifiedAccess.fsx | 44 ++++++++++++++ .../Conformance/UnionTypes/UnionTypes.fs | 58 +++++++++++++++++++ 36 files changed, 289 insertions(+), 10 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 9fd052bdd4b..cc7de71eceb 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -378,6 +378,8 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath (env: exception NotUpperCaseConstructor of range: range +exception NotUpperCaseConstructorWithoutRQA of range: range + let CheckNamespaceModuleOrTypeName (g: TcGlobals) (id: Ident) = // type names '[]' etc. are used in fslib if not g.compilingFSharpCore && id.idText.IndexOfAny IllegalCharactersInTypeAndNamespaceNames <> -1 then @@ -453,7 +455,7 @@ module TcRecdUnionAndEnumDeclarations = // Bind other elements of type definitions (constructors etc.) //------------------------------------------------------------------------- - let CheckUnionCaseName (cenv: cenv) (id: Ident) = + let CheckUnionCaseName (cenv: cenv) (id: Ident) hasRQAAttribute = let g = cenv.g let name = id.idText if name = "Tags" then @@ -461,8 +463,13 @@ module TcRecdUnionAndEnumDeclarations = CheckNamespaceModuleOrTypeName g id - if not (String.isLeadingIdentifierCharacterUpperCase name) && name <> opNameCons && name <> opNameNil then - errorR(NotUpperCaseConstructor(id.idRange)) + if g.langVersion.SupportsFeature(LanguageFeature.LowercaseDUWhenRequireQualifiedAccess) then + + if not (String.isLeadingIdentifierCharacterUpperCase name) && not hasRQAAttribute && name <> opNameCons && name <> opNameNil then + errorR(NotUpperCaseConstructorWithoutRQA(id.idRange)) + else + if not (String.isLeadingIdentifierCharacterUpperCase name) && name <> opNameCons && name <> opNameNil then + errorR(NotUpperCaseConstructor(id.idRange)) let ValidateFieldNames (synFields: SynField list, tastFields: RecdField list) = let seen = Dictionary() @@ -479,13 +486,13 @@ module TcRecdUnionAndEnumDeclarations = | _ -> seen.Add(f.LogicalName, sf)) - let TcUnionCaseDecl (cenv: cenv) env parent thisTy thisTyInst tpenv (SynUnionCase(Attributes synAttrs, SynIdent(id, _), args, xmldoc, vis, m, _)) = + let TcUnionCaseDecl (cenv: cenv) env parent thisTy thisTyInst tpenv hasRQAAttribute (SynUnionCase(Attributes synAttrs, SynIdent(id, _), args, xmldoc, vis, m, _)) = let g = cenv.g let attrs = TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs // the attributes of a union case decl get attached to the generated "static factory" method let vis, _ = ComputeAccessAndCompPath env None m vis None parent let vis = CombineReprAccess parent vis - CheckUnionCaseName cenv id + CheckUnionCaseName cenv id hasRQAAttribute let rfields, recordTy = match args with @@ -526,8 +533,8 @@ module TcRecdUnionAndEnumDeclarations = let xmlDoc = xmldoc.ToXmlDoc(true, Some names) Construct.NewUnionCase id rfields recordTy attrs xmlDoc vis - let TcUnionCaseDecls cenv env parent (thisTy: TType) thisTyInst tpenv unionCases = - let unionCasesR = unionCases |> List.map (TcUnionCaseDecl cenv env parent thisTy thisTyInst tpenv) + let TcUnionCaseDecls (cenv: cenv) env (parent: ParentRef) (thisTy: TType) (thisTyInst: TypeInst) hasRQAAttribute tpenv unionCases = + let unionCasesR = unionCases |> List.map (TcUnionCaseDecl cenv env parent thisTy thisTyInst tpenv hasRQAAttribute) unionCasesR |> CheckDuplicates (fun uc -> uc.Id) "union case" let TcEnumDecl cenv env parent thisTy fieldTy (SynEnumCase(attributes=Attributes synAttrs; ident= SynIdent(id,_); value=v; xmlDoc=xmldoc; range=m)) = @@ -3188,7 +3195,9 @@ module EstablishTypeDefinitionCores = structLayoutAttributeCheck false noAllowNullLiteralAttributeCheck() - TcRecdUnionAndEnumDeclarations.CheckUnionCaseName cenv unionCaseName + + let hasRQAAttribute = HasFSharpAttribute cenv.g cenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + TcRecdUnionAndEnumDeclarations.CheckUnionCaseName cenv unionCaseName hasRQAAttribute let unionCase = Construct.NewUnionCase unionCaseName [] thisTy [] XmlDoc.Empty tycon.Accessibility writeFakeUnionCtorsToSink [ unionCase ] Construct.MakeUnionRepr [ unionCase ], None, NoSafeInitInfo @@ -3219,8 +3228,9 @@ module EstablishTypeDefinitionCores = noAbstractClassAttributeCheck() noAllowNullLiteralAttributeCheck() structLayoutAttributeCheck false - let unionCases = TcRecdUnionAndEnumDeclarations.TcUnionCaseDecls cenv envinner innerParent thisTy thisTyInst tpenv unionCases - + + let hasRQAAttribute = HasFSharpAttribute cenv.g cenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + let unionCases = TcRecdUnionAndEnumDeclarations.TcUnionCaseDecls cenv envinner innerParent thisTy thisTyInst hasRQAAttribute tpenv unionCases if tycon.IsStructRecordOrUnionTycon && unionCases.Length > 1 then let fieldNames = [ for uc in unionCases do for ft in uc.FieldTable.TrueInstanceFieldsAsList do yield ft.LogicalName ] if fieldNames |> List.distinct |> List.length <> fieldNames.Length then diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index c4590557ede..631e9fb5812 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -76,3 +76,5 @@ val CheckOneSigFile: Cancellable exception NotUpperCaseConstructor of range: range + +exception NotUpperCaseConstructorWithoutRQA of range: range diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index fba0a064091..f3537b7bbc0 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -124,6 +124,7 @@ let GetRangeOfDiagnostic (diagnostic: PhasedDiagnostic) = | LetRecCheckedAtRuntime m | UpperCaseIdentifierInPattern m | NotUpperCaseConstructor m + | NotUpperCaseConstructorWithoutRQA m | RecursiveUseCheckedAtRuntime (_, _, m) | LetRecEvaluatedOutOfOrder (_, _, _, m) | DiagnosticWithText (_, _, m) @@ -270,6 +271,7 @@ let GetDiagnosticNumber (diagnostic: PhasedDiagnostic) = | UseOfAddressOfOperator _ -> 51 | DefensiveCopyWarning _ -> 52 | NotUpperCaseConstructor _ -> 53 + | NotUpperCaseConstructorWithoutRQA _ -> 53 | TypeIsImplicitlyAbstract _ -> 54 // 55 cannot be reused | DeprecatedThreadStaticBindingWarning _ -> 56 @@ -435,6 +437,7 @@ let ErrorFromApplyingDefault2E () = Message("ErrorFromApplyingDefault2", "") let ErrorsFromAddingSubsumptionConstraintE () = Message("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") let UpperCaseIdentifierInPatternE () = Message("UpperCaseIdentifierInPattern", "") let NotUpperCaseConstructorE () = Message("NotUpperCaseConstructor", "") +let NotUpperCaseConstructorWithoutRQAE () = Message("NotUpperCaseConstructorWithoutRQA", "") let FunctionExpectedE () = Message("FunctionExpected", "") let BakedInMemberConstraintNameE () = Message("BakedInMemberConstraintName", "%s") let BadEventTransformationE () = Message("BadEventTransformation", "") @@ -771,6 +774,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | NotUpperCaseConstructor _ -> os.AppendString(NotUpperCaseConstructorE().Format) + | NotUpperCaseConstructorWithoutRQA _ -> os.AppendString(NotUpperCaseConstructorWithoutRQAE().Format) + | ErrorFromAddingConstraint (_, e, _) -> OutputExceptionR os e #if !NO_TYPEPROVIDERS diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a6ce206cc8f..97e24679878 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1543,6 +1543,7 @@ featureStructActivePattern,"struct representation for active patterns" featureRelaxWhitespace2,"whitespace relaxation v2" featureReallyLongList,"list literals of any size" featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute" +featureLowercaseDUWhenRequireQualifiedAccess,"Allow lowercase DU when RequireQualifiedAccess attribute" 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index bf1c66b0f29..51f172fbbea 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1107,4 +1107,7 @@ internal error: {0} + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + \ No newline at end of file diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index a0033a5d2b7..77b93032baa 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -49,6 +49,7 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management type LanguageVersion(versionText) = @@ -111,6 +112,7 @@ type LanguageVersion(versionText) = LanguageFeature.BetterExceptionPrinting, previewVersion LanguageFeature.ReallyLongLists, previewVersion LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, previewVersion + LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -210,6 +212,7 @@ type LanguageVersion(versionText) = | LanguageFeature.DelegateTypeNameResolutionFix -> FSComp.SR.featureDelegateTypeNameResolutionFix () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () + | LanguageFeature.LowercaseDUWhenRequireQualifiedAccess -> FSComp.SR.featureLowercaseDUWhenRequireQualifiedAccess () /// Get a version string associated with the given feature. member _.GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index ec884903b49..8227c947c77 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -39,6 +39,7 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 2982b373922..f006f4b4879 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -192,6 +192,11 @@ rozhraní s vícenásobným obecným vytvářením instancí + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revize kompatibility ML diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index cd9d6d81bb8..bcff666cca2 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -192,6 +192,11 @@ Schnittstellen mit mehrfacher generischer Instanziierung + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML-Kompatibilitätsrevisionen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index f833bc6e76c..f0b34cd199e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -192,6 +192,11 @@ interfaces con creación de instancias genéricas múltiples + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisiones de compatibilidad de ML diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index c949833a13a..e1faaa3ee52 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -192,6 +192,11 @@ interfaces avec plusieurs instanciations génériques + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Réviseurs de compatibilité ML diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index a9b2e133bde..bc3b6d77268 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -192,6 +192,11 @@ interfacce con più creazioni di istanze generiche + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisioni della compatibilità di Ml diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index d0637747c7a..f82dbf9c798 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -192,6 +192,11 @@ 複数のジェネリックのインスタンス化を含むインターフェイス + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 互換性のリビジョン diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index fbbfdfbf306..1095e6c1729 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -192,6 +192,11 @@ 여러 제네릭 인스턴스화가 포함된 인터페이스 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 호환성 개정 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index fbfb4f7e730..e5ad0012774 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -192,6 +192,11 @@ interfejsy z wieloma ogólnymi wystąpieniami + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Poprawki dotyczące zgodności Machine Learning diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 83b76374d27..35f58279210 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -192,6 +192,11 @@ interfaces com várias instanciações genéricas + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisões de compatibilidade de ML diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 93db1f6740a..d6d6e210791 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -192,6 +192,11 @@ интерфейсы с множественным универсальным созданием экземпляра + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Редакции совместимости ML diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index acff017e25a..5440ee40f47 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -192,6 +192,11 @@ birden çok genel örnek oluşturma içeren arabirimler + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML uyumluluk düzeltmeleri diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 778f26de5e3..c9f007f023c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -192,6 +192,11 @@ 具有多个泛型实例化的接口 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 兼容性修订 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 81e0c44f38b..d9ad22c51f4 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -192,6 +192,11 @@ 具有多個泛型具現化的介面 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 相容性修訂 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 924659eb22a..849a9018ef5 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -7,6 +7,11 @@ Nejméně jedna informační zpráva v načteném souboru\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbol ..^ diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 9462806409e..79176e0e2f1 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -7,6 +7,11 @@ Mindestens eine Informationsmeldung in der geladenen Datei.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' Symbol "..^" diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index b4b8b4531e4..8b09a7c5903 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -7,6 +7,11 @@ Uno o más mensajes informativos en el archivo cargado.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' símbolo "..^" diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 53e4eb6cff4..f88d8e7182b 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -7,6 +7,11 @@ Un ou plusieurs messages d’information dans le fichier chargé.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbole '..^' diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index d8cf6e9c21e..e46a3cb54d6 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -7,6 +7,11 @@ Uno o più messaggi informativi nel file caricato.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' simbolo '..^' diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index ad32096733b..b0a149427b1 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -7,6 +7,11 @@ 読み込まれたファイル内の 1 つ以上の情報メッセージ。\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' シンボル '..^' diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 8e112d8d28c..da9ee85444d 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -7,6 +7,11 @@ 로드된 파일에 하나 이상의 정보 메시지가 있습니다.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 기호 '..^' diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index fe6c8536f87..f89d330d272 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -7,6 +7,11 @@ Jeden lub więcej komunikatów informacyjnych w załadowanym pliku.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbol „..^” diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 8dc8c546ffc..a6f597c97aa 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -7,6 +7,11 @@ Uma ou mais mensagens informativas no arquivo carregado.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' símbolo '..^' diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 6979fe42d9f..310b7437a2e 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -7,6 +7,11 @@ Одно или несколько информационных сообщений в загруженном файле.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' символ "..^" diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 54328fdea3f..c5cbc423360 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -7,6 +7,11 @@ Yüklenen dosyada bir veya daha fazla bilgi mesajı.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' '..^' sembolü diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 95130a6391f..be3604df4bf 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -7,6 +7,11 @@ 加载文件 .\n 中有一条或多条信息性消息 + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 符号 "..^" diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 5ff1442b5c3..67e6c25370e 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -7,6 +7,11 @@ 已載入檔案中的一或多個資訊訊息。\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 符號 '..^' diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx new file mode 100644 index 00000000000..a7e7a928e36 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + + + + +type DU1 = | ``not.allowed`` + +type DU2 = ``not.allowed`` + +[] +type DU3 = | ``not.allowed`` + +[] +type DU4 = ``not.allowed`` + +type DU5 = | a + +type DU6 = a + +type du1 = du1 of string + +type du2 = | du2 of string \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx new file mode 100644 index 00000000000..e9080c19964 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + + + + +[] +type DU1 = + | a + | b + | c + +[] +type DU2 = + | a of int + | B of string + | C + +[] +type DU3 = | a + +[] +type DU4 = a + +[] +type du1 = du1 of string + +[] +type du2 = | du2 of string + +let a = DU1.a +let b = du2.du2 +let c = DU2.a(1) +let d = du2.du2("du2") +let e = du1.du1("du1") + +let f du1 = + match du1 with + | DU1.a -> () + | DU1.b -> () + | DU1.c -> () + +f DU1.c + + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index 1e27322bfbd..39f4fac3804 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -509,6 +509,64 @@ module UnionTypes = |> verifyCompileAndRun |> shouldSucceed + //SOURCE=LowercaseWhenRequireQualifiedAccess.fsx # LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``LowercaseWhenRequireQualifiedAccess_fs in langversion 6`` compilation = + compilation + |> withLangVersion60 + |> verifyCompile + |> shouldFail + + //SOURCE=LowercaseWhenRequireQualifiedAccess.fsx # LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompileAndRun + |> shouldSucceed + + //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``E_LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 6, Col 14, Line 6, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 6, Col 14, Line 6, Col 29, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 883, Line 8, Col 12, Line 8, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 8, Col 12, Line 8, Col 27, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 883, Line 11, Col 14, Line 11, Col 29, "Invalid namespace, module, type or union case name"); + (Error 883, Line 14, Col 12, Line 14, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 16, Col 14, Line 16, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 18, Col 12, Line 18, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 20, Col 12, Line 20, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 22, Col 14, Line 22, Col 17, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + ] + + //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``E_LowercaseWhenRequireQualifiedAccess_fs in langversion 6`` compilation = + compilation + |> withLangVersion60 + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 6, Col 14, Line 6, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 6, Col 14, Line 6, Col 29, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 8, Col 12, Line 8, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 8, Col 12, Line 8, Col 27, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 11, Col 14, Line 11, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 11, Col 14, Line 11, Col 29, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 14, Col 12, Line 14, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 14, Col 12, Line 14, Col 27, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 16, Col 14, Line 16, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 18, Col 12, Line 18, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 20, Col 12, Line 20, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 22, Col 14, Line 22, Col 17, "Discriminated union cases and exception labels must be uppercase identifiers") + ] + //SOURCE=W_GenericFunctionValuedStaticProp02.fs SCFLAGS="--test:ErrorRanges --warnaserror-" # W_GenericFunctionValuedStaticProp02.fs [] let ``W_GenericFunctionValuedStaticProp02_fs`` compilation = From 0c1eba0671d0edb86e97618e0a7678a7550befe4 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 11 Jul 2022 22:18:35 +0100 Subject: [PATCH 033/226] regularize some names (#13489) * normalize some names * format code * fix build --- azure-pipelines.yml | 1 + src/Compiler/AbstractIL/ilreflect.fs | 8 +- src/Compiler/AbstractIL/ilx.fs | 2 +- .../Checking/CheckComputationExpressions.fs | 14 +- src/Compiler/Checking/CheckDeclarations.fs | 64 ++-- src/Compiler/Checking/CheckExpressions.fs | 271 ++++++++------- src/Compiler/Checking/CheckExpressions.fsi | 2 +- src/Compiler/Checking/CheckFormatStrings.fs | 16 +- src/Compiler/Checking/CheckPatterns.fs | 54 +-- src/Compiler/Checking/ConstraintSolver.fs | 102 +++--- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/InfoReader.fs | 22 +- src/Compiler/Checking/InfoReader.fsi | 6 +- src/Compiler/Checking/MethodCalls.fs | 181 +++++----- src/Compiler/Checking/MethodOverrides.fs | 16 +- src/Compiler/Checking/MethodOverrides.fsi | 2 +- src/Compiler/Checking/NameResolution.fs | 16 +- src/Compiler/Checking/NicePrint.fs | 179 +++++----- src/Compiler/Checking/NicePrint.fsi | 19 +- .../Checking/PatternMatchCompilation.fs | 24 +- src/Compiler/Checking/PostInferenceChecks.fs | 41 ++- src/Compiler/Checking/QuotationTranslator.fs | 38 +- src/Compiler/Checking/SignatureConformance.fs | 24 +- src/Compiler/Checking/TypeHierarchy.fs | 42 +-- src/Compiler/Checking/TypeRelations.fs | 65 ++-- src/Compiler/Checking/import.fs | 10 +- src/Compiler/Checking/infos.fs | 34 +- src/Compiler/CodeGen/IlxGen.fs | 84 ++--- src/Compiler/Driver/CompilerDiagnostics.fs | 7 +- src/Compiler/Facilities/TextLayoutRender.fs | 2 +- src/Compiler/Interactive/fsi.fs | 6 +- src/Compiler/Optimize/Optimizer.fs | 26 +- src/Compiler/Service/FSharpCheckerResults.fs | 26 +- src/Compiler/Service/ItemKey.fs | 8 +- .../Service/SemanticClassification.fs | 4 +- .../Service/ServiceDeclarationLists.fs | 59 ++-- src/Compiler/Service/ServiceNavigation.fs | 124 +++---- .../Service/ServiceParamInfoLocations.fs | 36 +- src/Compiler/Service/ServiceParsedInputOps.fs | 4 +- src/Compiler/Service/ServiceStructure.fs | 78 ++--- src/Compiler/Symbols/Exprs.fs | 30 +- src/Compiler/Symbols/SymbolHelpers.fs | 12 +- src/Compiler/Symbols/SymbolPatterns.fs | 8 +- src/Compiler/Symbols/Symbols.fs | 45 +-- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 38 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 8 +- src/Compiler/TypedTree/TcGlobals.fs | 14 +- src/Compiler/TypedTree/TypedTree.fs | 44 +-- src/Compiler/TypedTree/TypedTree.fsi | 10 +- src/Compiler/TypedTree/TypedTreeBasics.fs | 16 +- src/Compiler/TypedTree/TypedTreeBasics.fsi | 8 +- src/Compiler/TypedTree/TypedTreeOps.fs | 327 +++++++++--------- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 +- src/Compiler/TypedTree/TypedTreePickle.fs | 8 +- src/Compiler/pars.fsy | 216 ++++++------ src/FSharp.Core/Linq.fs | 4 +- src/FSharp.Core/quotations.fs | 8 +- tests/scripts/identifierAnalysisByType.fsx | 5 +- 58 files changed, 1274 insertions(+), 1248 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa95b151619..93e24046b2d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,7 @@ trigger: exclude: - .github/* - docs/ + - tests/scripts/ - attributions.md - CODE_OF_CONDUCT.md - DEVGUIDE.md diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 2781d8a381a..a37fa6b1ae0 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -479,11 +479,11 @@ module Zmap = let equalTypes (s: Type) (t: Type) = s.Equals t -let equalTypeLists ss tt = - List.lengthsEqAndForall2 equalTypes ss tt +let equalTypeLists (tys1: Type list) (tys2: Type list) = + List.lengthsEqAndForall2 equalTypes tys1 tys2 -let equalTypeArrays ss tt = - Array.lengthsEqAndForall2 equalTypes ss tt +let equalTypeArrays (tys1: Type[]) (tys2: Type[]) = + Array.lengthsEqAndForall2 equalTypes tys1 tys2 let getGenericArgumentsOfType (typT: Type) = if typT.IsGenericType then diff --git a/src/Compiler/AbstractIL/ilx.fs b/src/Compiler/AbstractIL/ilx.fs index 4eb18649752..e91ad50d712 100644 --- a/src/Compiler/AbstractIL/ilx.fs +++ b/src/Compiler/AbstractIL/ilx.fs @@ -75,7 +75,7 @@ type IlxClosureApps = let rec instAppsAux n inst apps = match apps with | Apps_tyapp (ty, rest) -> Apps_tyapp(instILTypeAux n inst ty, instAppsAux n inst rest) - | Apps_app (dty, rest) -> Apps_app(instILTypeAux n inst dty, instAppsAux n inst rest) + | Apps_app (domainTy, rest) -> Apps_app(instILTypeAux n inst domainTy, instAppsAux n inst rest) | Apps_done retTy -> Apps_done(instILTypeAux n inst retTy) let rec instLambdasAux n inst lambdas = diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index ee42cc97fbe..c8a9501e475 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -224,10 +224,10 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol // Give bespoke error messages for the FSharp.Core "query" builder let isQuery = match stripDebugPoints interpExpr with - | Expr.Val (vf, _, m) -> - let item = Item.CustomBuilder (vf.DisplayName, vf) + | Expr.Val (vref, _, m) -> + let item = Item.CustomBuilder (vref.DisplayName, vref) CallNameResolutionSink cenv.tcSink (m, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) - valRefEq cenv.g vf cenv.g.query_value_vref + valRefEq cenv.g vref cenv.g.query_value_vref | _ -> false /// Make a builder.Method(...) call @@ -1909,8 +1909,8 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = // This transformation is visible in quotations and thus needs to remain. | (TPat_as (TPat_wild _, PatternValBinding (v, _), _), [_], - DebugPoints(Expr.App (Expr.Val (vf, _, _), _, [genEnumElemTy], [yieldExpr], _mYield), recreate)) - when valRefEq cenv.g vf cenv.g.seq_singleton_vref -> + DebugPoints(Expr.App (Expr.Val (vref, _, _), _, [genEnumElemTy], [yieldExpr], _mYield), recreate)) + when valRefEq cenv.g vref cenv.g.seq_singleton_vref -> // The debug point mFor is attached to the 'map' // The debug point mIn is attached to the lambda @@ -2051,11 +2051,11 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = error(Error(FSComp.SR.tcUseForInSequenceExpression(), m)) | SynExpr.Match (spMatch, expr, clauses, _m, _trivia) -> - let inputExpr, matchty, tpenv = TcExprOfUnknownType cenv env tpenv expr + let inputExpr, inputTy, tpenv = TcExprOfUnknownType cenv env tpenv expr let tclauses, tpenv = (tpenv, clauses) ||> List.mapFold (fun tpenv (SynMatchClause(pat, cond, innerComp, _, sp, _)) -> - let patR, condR, vspecs, envinner, tpenv = TcMatchPattern cenv matchty env tpenv pat cond + let patR, condR, vspecs, envinner, tpenv = TcMatchPattern cenv inputTy env tpenv pat cond let envinner = match sp with | DebugPointAtTarget.Yes -> { envinner with eIsControlFlow = true } diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index cc7de71eceb..b8192ef5f01 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -291,9 +291,9 @@ let OpenModuleOrNamespaceRefs tcSink g amap scopem root env mvvs openDeclaration env /// Adjust the TcEnv to account for opening a type implied by an `open type` declaration -let OpenTypeContent tcSink g amap scopem env (typ: TType) openDeclaration = +let OpenTypeContent tcSink g amap scopem env (ty: TType) openDeclaration = let env = - { env with eNameResEnv = AddTypeContentsToNameEnv g amap env.eAccessRights scopem env.eNameResEnv typ } + { env with eNameResEnv = AddTypeContentsToNameEnv g amap env.eAccessRights scopem env.eNameResEnv ty } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) CallOpenDeclarationSink tcSink openDeclaration env @@ -665,16 +665,16 @@ let TcOpenTypeDecl (cenv: cenv) mOpenDecl scopem env (synType: SynType, m) = checkLanguageFeatureError g.langVersion LanguageFeature.OpenTypeDeclaration mOpenDecl - let typ, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open env emptyUnscopedTyparEnv synType + let ty, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open env emptyUnscopedTyparEnv synType - if not (isAppTy g typ) then + if not (isAppTy g ty) then error(Error(FSComp.SR.tcNamedTypeRequired("open type"), m)) - if isByrefTy g typ then + if isByrefTy g ty then error(Error(FSComp.SR.tcIllegalByrefsInOpenTypeDeclaration(), m)) - let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.Type (synType, m), [], [typ], scopem, false) - let env = OpenTypeContent cenv.tcSink g cenv.amap scopem env typ openDecl + let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.Type (synType, m), [], [ty], scopem, false) + let env = OpenTypeContent cenv.tcSink g cenv.amap scopem env ty openDecl env, [openDecl] let TcOpenDecl (cenv: cenv) mOpenDecl scopem env target = @@ -1067,7 +1067,7 @@ module MutRecBindingChecking = Phase2BInherit (inheritsExpr, baseValOpt), innerState // Phase2B: let and let rec value and function definitions - | Phase2AIncrClassBindings (tcref, binds, isStatic, isRec, bindsm) -> + | Phase2AIncrClassBindings (tcref, binds, isStatic, isRec, mBinds) -> let envForBinding = if isStatic then envStatic else envInstance let binds, bindRs, env, tpenv = if isRec then @@ -1080,12 +1080,12 @@ module MutRecBindingChecking = else // Type check local binding - let binds, env, tpenv = TcLetBindings cenv envForBinding ExprContainerInfo (ClassLetBinding isStatic) tpenv (binds, bindsm, scopem) + let binds, env, tpenv = TcLetBindings cenv envForBinding ExprContainerInfo (ClassLetBinding isStatic) tpenv (binds, mBinds, scopem) let binds, bindRs = binds |> List.map (function | TMDefLet(bind, _) -> [bind], IncrClassBindingGroup([bind], isStatic, false) - | TMDefDo(e, _) -> [], IncrClassDo(e, isStatic, bindsm) + | TMDefDo(e, _) -> [], IncrClassDo(e, isStatic, mBinds) | _ -> error(InternalError("unexpected definition kind", tcref.Range))) |> List.unzip List.concat binds, bindRs, env, tpenv @@ -1480,7 +1480,7 @@ module MutRecBindingChecking = envForDecls) /// Phase 2: Check the members and 'let' definitions in a mutually recursive group of definitions. - let TcMutRecDefns_Phase2_Bindings (cenv: cenv) envInitial tpenv bindsm scopem mutRecNSInfo (envMutRecPrelimWithReprs: TcEnv) (mutRecDefns: MutRecDefnsPhase2Info) = + let TcMutRecDefns_Phase2_Bindings (cenv: cenv) envInitial tpenv mBinds scopem mutRecNSInfo (envMutRecPrelimWithReprs: TcEnv) (mutRecDefns: MutRecDefnsPhase2Info) = let g = cenv.g let denv = envMutRecPrelimWithReprs.DisplayEnv @@ -1608,12 +1608,12 @@ module MutRecBindingChecking = (fun morpher shape -> shape |> MutRecShapes.iterTyconsAndLets (p23 >> morpher) morpher) MutRecShape.Lets (fun morpher shape -> shape |> MutRecShapes.mapTyconsAndLets (fun (tyconOpt, fixupValueExprBinds, methodBinds) -> tyconOpt, (morpher fixupValueExprBinds @ methodBinds)) morpher) - bindsm + mBinds defnsEs, envMutRec /// Check and generalize the interface implementations, members, 'let' definitions in a mutually recursive group of definitions. -let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) = +let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) = let g = cenv.g let interfacesFromTypeDefn envForTycon tyconMembersData = let (MutRecDefnsPhase2DataForTycon(_, _, declKind, tcref, _, _, declaredTyconTypars, members, _, _, _)) = tyconMembersData @@ -1727,7 +1727,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env (intfTypes, slotImplSets) ||> List.map2 (interfaceMembersFromTypeDefn tyconData) |> List.concat MutRecDefnsPhase2InfoForTycon(tyconOpt, tcref, declaredTyconTypars, declKind, obinds @ ibinds, fixupFinalAttrs)) - MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings cenv envInitial tpenv bindsm scopem mutRecNSInfo envMutRec binds + MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings cenv envInitial tpenv mBinds scopem mutRecNSInfo envMutRec binds with exn -> errorRecovery exn scopem; [], envMutRec @@ -3436,37 +3436,37 @@ module EstablishTypeDefinitionCores = match stripTyparEqns ty with | TType_anon (_,l) | TType_tuple (_, l) -> accInAbbrevTypes l acc - | TType_ucase (UnionCaseRef(tc, _), tinst) - | TType_app (tc, tinst, _) -> - let tycon2 = tc.Deref + | TType_ucase (UnionCaseRef(tcref2, _), tinst) + | TType_app (tcref2, tinst, _) -> + let tycon2 = tcref2.Deref let acc = accInAbbrevTypes tinst acc // Record immediate recursive references if ListSet.contains (===) tycon2 tycons then (tycon, tycon2) :: acc // Expand the representation of abbreviations - elif tc.IsTypeAbbrev then - accInAbbrevType (reduceTyconRefAbbrev tc tinst) acc + elif tcref2.IsTypeAbbrev then + accInAbbrevType (reduceTyconRefAbbrev tcref2 tinst) acc // Otherwise H - explore the instantiation. else acc - | TType_fun (d, r, _) -> - accInAbbrevType d (accInAbbrevType r acc) + | TType_fun (domainTy, rangeTy, _) -> + accInAbbrevType domainTy (accInAbbrevType rangeTy acc) | TType_var _ -> acc - | TType_forall (_, r) -> accInAbbrevType r acc + | TType_forall (_, bodyTy) -> accInAbbrevType bodyTy acc - | TType_measure ms -> accInMeasure ms acc - - and accInMeasure ms acc = - match stripUnitEqns ms with - | Measure.Con tc when ListSet.contains (===) tc.Deref tycons -> - (tycon, tc.Deref) :: acc - | Measure.Con tc when tc.IsTypeAbbrev -> - accInMeasure (reduceTyconRefAbbrevMeasureable tc) acc + | TType_measure measureTy -> accInMeasure measureTy acc + + and accInMeasure measureTy acc = + match stripUnitEqns measureTy with + | Measure.Const tcref when ListSet.contains (===) tcref.Deref tycons -> + (tycon, tcref.Deref) :: acc + | Measure.Const tcref when tcref.IsTypeAbbrev -> + accInMeasure (reduceTyconRefAbbrevMeasureable tcref) acc | Measure.Prod (ms1, ms2) -> accInMeasure ms1 (accInMeasure ms2 acc) - | Measure.Inv ms -> accInMeasure ms acc + | Measure.Inv invTy -> accInMeasure invTy acc | _ -> acc and accInAbbrevTypes tys acc = @@ -3477,7 +3477,7 @@ module EstablishTypeDefinitionCores = | Some ty -> accInAbbrevType ty [] let edges = List.collect edgesFrom tycons - let graph = Graph ((fun tc -> tc.Stamp), tycons, edges) + let graph = Graph ((fun tycon -> tycon.Stamp), tycons, edges) graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index d513a326a74..7e3baef258b 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -987,28 +987,28 @@ let UnifyFunctionType extraInfo cenv denv mFunExpr ty = let ReportImplicitlyIgnoredBoolExpression denv m ty expr = let checkExpr m expr = match stripDebugPoints expr with - | Expr.App (Expr.Val (vf, _, _), _, _, exprs, _) when vf.LogicalName = opNameEquals -> + | Expr.App (Expr.Val (vref, _, _), _, _, exprs, _) when vref.LogicalName = opNameEquals -> match List.map stripDebugPoints exprs with - | Expr.App (Expr.Val (propRef, _, _), _, _, Expr.Val (vf, _, _) :: _, _) :: _ -> + | Expr.App (Expr.Val (propRef, _, _), _, _, Expr.Val (vref, _, _) :: _, _) :: _ -> if propRef.IsPropertyGetterMethod then let propertyName = propRef.PropertyName let hasCorrespondingSetter = match propRef.DeclaringEntity with | Parent entityRef -> entityRef.MembersOfFSharpTyconSorted - |> List.exists (fun valRef -> valRef.IsPropertySetterMethod && valRef.PropertyName = propertyName) + |> List.exists (fun vref -> vref.IsPropertySetterMethod && vref.PropertyName = propertyName) | _ -> false if hasCorrespondingSetter then - UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vf.DisplayName, propertyName, m) + UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vref.DisplayName, propertyName, m) else UnitTypeExpectedWithEquality (denv, ty, m) else UnitTypeExpectedWithEquality (denv, ty, m) - | Expr.Op (TOp.ILCall (_, _, _, _, _, _, _, ilMethRef, _, _, _), _, Expr.Val (vf, _, _) :: _, _) :: _ when ilMethRef.Name.StartsWithOrdinal("get_") -> - UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vf.DisplayName, ChopPropertyName(ilMethRef.Name), m) - | Expr.Val (vf, _, _) :: _ -> - UnitTypeExpectedWithPossibleAssignment (denv, ty, vf.IsMutable, vf.DisplayName, m) + | Expr.Op (TOp.ILCall (_, _, _, _, _, _, _, ilMethRef, _, _, _), _, Expr.Val (vref, _, _) :: _, _) :: _ when ilMethRef.Name.StartsWithOrdinal("get_") -> + UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vref.DisplayName, ChopPropertyName(ilMethRef.Name), m) + | Expr.Val (vref, _, _) :: _ -> + UnitTypeExpectedWithPossibleAssignment (denv, ty, vref.IsMutable, vref.DisplayName, m) | _ -> UnitTypeExpectedWithEquality (denv, ty, m) | _ -> UnitTypeExpected (denv, ty, m) @@ -1041,8 +1041,8 @@ let UnifyUnitType (cenv: cenv) (env: TcEnv) m ty expr = match env.eContextInfo with | ContextInfo.SequenceExpression seqTy -> - let lifted = mkSeqTy g ty - if typeEquiv g seqTy lifted then + let liftedTy = mkSeqTy g ty + if typeEquiv g seqTy liftedTy then warning (Error (FSComp.SR.implicitlyDiscardedInSequenceExpression(NicePrint.prettyStringOfTy denv ty), m)) else if isListTy g ty || isArrayTy g ty || typeEquiv g seqTy ty then @@ -1100,7 +1100,7 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = let _, tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Use OpenQualified env.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match tcref.TypeOrMeasureKind with | TyparKind.Type -> error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) - | TyparKind.Measure -> Measure.Con tcref + | TyparKind.Measure -> Measure.Const tcref | SynMeasure.Power(ms, exponent, _) -> Measure.RationalPower (tcMeasure ms, TcSynRationalConst exponent) | SynMeasure.Product(ms1, ms2, _) -> Measure.Prod(tcMeasure ms1, tcMeasure ms2) @@ -1114,7 +1114,7 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = | SynMeasure.Var(_, m) -> error(Error(FSComp.SR.tcNonZeroConstantCannotHaveGenericUnit(), m)) | SynMeasure.Paren(measure, _) -> tcMeasure measure - let unif expected = UnifyTypes cenv env m overallTy expected + let unif expectedTy = UnifyTypes cenv env m overallTy expectedTy let unifyMeasureArg iszero tcr = let measureTy = @@ -1312,7 +1312,7 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS // NOTE: This value is initially only set for interface implementations and those overrides // where we manage to pre-infer which abstract is overridden by the method. It is filled in // properly when we check the allImplemented implementation checks at the end of the inference scope. - ImplementedSlotSigs=implSlotTys |> List.map (fun ity -> TSlotSig(logicalName, ity, [], [], [], None)) } + ImplementedSlotSigs=implSlotTys |> List.map (fun intfTy -> TSlotSig(logicalName, intfTy, [], [], [], None)) } let isInstance = MemberIsCompiledAsInstance g tcref isExtrinsic memberInfo attrs @@ -1529,8 +1529,8 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec let vis = if MemberIsExplicitImpl g memberInfo then let slotSig = List.head memberInfo.ImplementedSlotSigs - match slotSig.ImplementedType with - | TType_app (tyconref, _, _) -> Some tyconref.Accessibility + match slotSig.DeclaringType with + | TType_app (tcref, _, _) -> Some tcref.Accessibility | _ -> None else None @@ -1714,14 +1714,14 @@ let AdjustRecType (v: Val) vscheme = /// Record the generated value expression as a place where we will have to /// adjust using AdjustAndForgetUsesOfRecValue at a letrec point. Every use of a value /// under a letrec gets used at the _same_ type instantiation. -let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vexp m = +let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vExpr m = match valRecInfo with | ValInRecScope isComplete -> - let fixupPoint = ref vexp + let fixupPoint = ref vExpr cenv.recUses <- cenv.recUses.Add (vrefTgt.Deref, (fixupPoint, m, isComplete)) Expr.Link fixupPoint | ValNotInRecScope -> - vexp + vExpr type RecursiveUseFixupPoints = RecursiveUseFixupPoints of (Expr ref * range) list @@ -2161,9 +2161,9 @@ let rec ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) e let ucref = ucinfo.UnionCaseRef CheckUnionCaseAttributes g ucref m |> CommitOperationResult CheckUnionCaseAccessible cenv.amap m ad ucref |> ignore - let gtyp2 = actualResultTyOfUnionCase ucinfo.TypeInst ucref + let resTy = actualResultTyOfUnionCase ucinfo.TypeInst ucref let inst = mkTyparInst ucref.TyconRef.TyparsNoRange ucinfo.TypeInst - UnifyTypes cenv env m overallTy gtyp2 + UnifyTypes cenv env m overallTy resTy let mkf = makerForUnionCase(ucref, ucinfo.TypeInst) mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] | _ -> invalidArg "item" "not a union case or exception reference" @@ -2346,11 +2346,11 @@ module GeneralizationHelpers = let relevantUniqueSubtypeConstraint (tp: Typar) = // Find a single subtype constraint match tp.Constraints |> List.partition (function TyparConstraint.CoercesTo _ -> true | _ -> false) with - | [TyparConstraint.CoercesTo(cxty, _)], others -> + | [TyparConstraint.CoercesTo(tgtTy, _)], others -> // Throw away null constraints if they are implied - if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeSatisfiesNullConstraint g m cxty) | _ -> true) + if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeSatisfiesNullConstraint g m tgtTy) | _ -> true) then None - else Some cxty + else Some tgtTy | _ -> None @@ -2745,8 +2745,8 @@ module EventDeclarationNormalization = let rec private RenameBindingPattern f declPattern = match declPattern with - | SynPat.FromParseError(p, _) -> RenameBindingPattern f p - | SynPat.Typed(pat', _, _) -> RenameBindingPattern f pat' + | SynPat.FromParseError(innerPat, _) -> RenameBindingPattern f innerPat + | SynPat.Typed(innerPat, _, _) -> RenameBindingPattern f innerPat | SynPat.Named (SynIdent(id,_), x2, vis2, m) -> SynPat.Named (SynIdent(ident(f id.idText, id.idRange), None), x2, vis2, m) | SynPat.InstanceMember(thisId, id, toolId, vis2, m) -> SynPat.InstanceMember(thisId, ident(f id.idText, id.idRange), toolId, vis2, m) | _ -> error(Error(FSComp.SR.tcOnlySimplePatternsInLetRec(), declPattern.Range)) @@ -2848,11 +2848,11 @@ let TcValEarlyGeneralizationConsistencyCheck cenv (env: TcEnv) (v: Val, valRecIn match valRecInfo with | ValInRecScope isComplete when isComplete && not (isNil tinst) -> cenv.css.PushPostInferenceCheck (preDefaults=false, check=fun () -> - let tpsorig, tau2 = tryDestForallTy g vTy - if not (isNil tpsorig) then - let tpsorig = NormalizeDeclaredTyparsForEquiRecursiveInference g tpsorig - let tau3 = instType (mkTyparInst tpsorig tinst) tau2 - if not (AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css m tau tau3) then + let vTypars, vTauTy = tryDestForallTy g vTy + if not (isNil vTypars) then + let vTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g vTypars + let vTauTy = instType (mkTyparInst vTypars tinst) vTauTy + if not (AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css m tau vTauTy) then let txt = buildString (fun buf -> NicePrint.outputQualifiedValSpec env.DisplayEnv cenv.infoReader buf (mkLocalValRef v)) error(Error(FSComp.SR.tcInferredGenericTypeGivesRiseToInconsistency(v.DisplayName, txt), m))) | _ -> () @@ -2933,26 +2933,26 @@ let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValR warning(Error(FSComp.SR.tcDoesNotAllowExplicitTypeArguments(v.DisplayName), m)) match valRecInfo with | ValInRecScope false -> - let tpsorig, tau = vref.GeneralizedType - let (tinst: TypeInst), tpenv = checkTys tpenv (tpsorig |> List.map (fun tp -> tp.Kind)) + let vTypars, vTauTy = vref.GeneralizedType + let tinst, tpenv = checkTys tpenv (vTypars |> List.map (fun tp -> tp.Kind)) checkInst tinst - if tpsorig.Length <> tinst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tpsorig.Length, tinst.Length), m)) + if vTypars.Length <> tinst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(vTypars.Length, tinst.Length), m)) - let tau2 = instType (mkTyparInst tpsorig tinst) tau + let vRecTauTy = instType (mkTyparInst vTypars tinst) vTauTy - (tpsorig, tinst) ||> List.iter2 (fun tp ty -> + (vTypars, tinst) ||> List.iter2 (fun tp ty -> try UnifyTypes cenv env m (mkTyparTy tp) ty - with _ -> error (Recursion(env.DisplayEnv, v.Id, tau2, tau, m))) + with _ -> error (Recursion(env.DisplayEnv, v.Id, vRecTauTy, vTauTy, m))) - tpsorig, vrefFlags, tinst, tau2, tpenv + vTypars, vrefFlags, tinst, vRecTauTy, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, tps, tpTys, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let vTypars, tps, tpTys, vTauTy = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy - let (tinst: TypeInst), tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) + let tinst, tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) checkInst tinst @@ -2960,9 +2960,9 @@ let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValR List.iter2 (UnifyTypes cenv env m) tpTys tinst - TcValEarlyGeneralizationConsistencyCheck cenv env (v, valRecInfo, tinst, vTy, tau, m) + TcValEarlyGeneralizationConsistencyCheck cenv env (v, valRecInfo, tinst, vTy, vTauTy, m) - tpsorig, vrefFlags, tinst, tau, tpenv + vTypars, vrefFlags, tinst, vTauTy, tpenv let exprForVal = Expr.Val (vref, vrefFlags, m) let exprForVal = mkTyAppExpr m (exprForVal, vTy) tinst @@ -3259,7 +3259,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = let isStruct = finfo.IsValueType let boxity = if isStruct then AsValue else AsObject let tinst = finfo.TypeInst - let fieldType = finfo.FieldType (amap, m) + let fieldTy = finfo.FieldType (amap, m) #if !NO_TYPEPROVIDERS let ty = tyOfExpr g objExpr match finfo with @@ -3269,7 +3269,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = | None -> error (Error(FSComp.SR.tcTPFieldMustBeLiteral(), m)) | Some lit -> - Expr.Const (TcFieldInit m lit, m, fieldType) + Expr.Const (TcFieldInit m lit, m, fieldTy) | _ -> #endif let wrap, objExpr, _readonly, _writeonly = mkExprAddrOfExpr g isStruct false NeverMutates objExpr None m @@ -3278,7 +3278,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = // polymorphic code, after inlining etc. * let fspec = mkILFieldSpec(fref, mkILNamedTy boxity fref.DeclaringTypeRef []) // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. - wrap (mkAsmExpr (([ mkNormalLdfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else [])), tinst, [objExpr], [fieldType], m)) + wrap (mkAsmExpr (([ mkNormalLdfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else [])), tinst, [objExpr], [fieldTy], m)) /// Checks that setting a field value does not set a literal or initonly field let private CheckFieldLiteralArg (finfo: ILFieldInfo) argExpr m = @@ -3431,28 +3431,28 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr let tryType (exprToSearchForGetEnumeratorAndItem, tyToSearchForGetEnumeratorAndItem) = match findMethInfo true m "GetEnumerator" tyToSearchForGetEnumeratorAndItem with | Exception exn -> Exception exn - | Result getEnumerator_minfo -> + | Result getEnumeratorMethInfo -> - let getEnumerator_minst = FreshenMethInfo m getEnumerator_minfo - let retTypeOfGetEnumerator = getEnumerator_minfo.GetFSharpReturnType(cenv.amap, m, getEnumerator_minst) - if hasArgs getEnumerator_minfo getEnumerator_minst then err true tyToSearchForGetEnumeratorAndItem else + let getEnumeratorMethInst = FreshenMethInfo m getEnumeratorMethInfo + let getEnumeratorRetTy = getEnumeratorMethInfo.GetFSharpReturnType(cenv.amap, m, getEnumeratorMethInst) + if hasArgs getEnumeratorMethInfo getEnumeratorMethInst then err true tyToSearchForGetEnumeratorAndItem else - match findMethInfo false m "MoveNext" retTypeOfGetEnumerator with + match findMethInfo false m "MoveNext" getEnumeratorRetTy with | Exception exn -> Exception exn - | Result moveNext_minfo -> + | Result moveNextMethInfo -> - let moveNext_minst = FreshenMethInfo m moveNext_minfo - let retTypeOfMoveNext = moveNext_minfo.GetFSharpReturnType(cenv.amap, m, moveNext_minst) - if not (typeEquiv g g.bool_ty retTypeOfMoveNext) then err false retTypeOfGetEnumerator else - if hasArgs moveNext_minfo moveNext_minst then err false retTypeOfGetEnumerator else + let moveNextMethInst = FreshenMethInfo m moveNextMethInfo + let moveNextRetTy = moveNextMethInfo.GetFSharpReturnType(cenv.amap, m, moveNextMethInst) + if not (typeEquiv g g.bool_ty moveNextRetTy) then err false getEnumeratorRetTy else + if hasArgs moveNextMethInfo moveNextMethInst then err false getEnumeratorRetTy else - match findMethInfo false m "get_Current" retTypeOfGetEnumerator with + match findMethInfo false m "get_Current" getEnumeratorRetTy with | Exception exn -> Exception exn - | Result get_Current_minfo -> + | Result getCurrentMethInfo -> - let get_Current_minst = FreshenMethInfo m get_Current_minfo - if hasArgs get_Current_minfo get_Current_minst then err false retTypeOfGetEnumerator else - let enumElemTy = get_Current_minfo.GetFSharpReturnType(cenv.amap, m, get_Current_minst) + let getCurrentMethInst = FreshenMethInfo m getCurrentMethInfo + if hasArgs getCurrentMethInfo getCurrentMethInst then err false getEnumeratorRetTy else + let enumElemTy = getCurrentMethInfo.GetFSharpReturnType(cenv.amap, m, getCurrentMethInst) // Compute the element type of the strongly typed enumerator // @@ -3496,23 +3496,23 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr else enumElemTy - let isEnumeratorTypeStruct = isStructTy g retTypeOfGetEnumerator - let originalRetTypeOfGetEnumerator = retTypeOfGetEnumerator + let isEnumeratorTypeStruct = isStructTy g getEnumeratorRetTy + let originalRetTypeOfGetEnumerator = getEnumeratorRetTy - let (enumeratorVar, enumeratorExpr), retTypeOfGetEnumerator = + let (enumeratorVar, enumeratorExpr), getEnumeratorRetTy = if isEnumeratorTypeStruct then if localAlloc then - mkMutableCompGenLocal m "enumerator" retTypeOfGetEnumerator, retTypeOfGetEnumerator + mkMutableCompGenLocal m "enumerator" getEnumeratorRetTy, getEnumeratorRetTy else - let refCellTyForRetTypeOfGetEnumerator = mkRefCellTy g retTypeOfGetEnumerator + let refCellTyForRetTypeOfGetEnumerator = mkRefCellTy g getEnumeratorRetTy let v, e = mkMutableCompGenLocal m "enumerator" refCellTyForRetTypeOfGetEnumerator - (v, mkRefCellGet g m retTypeOfGetEnumerator e), refCellTyForRetTypeOfGetEnumerator + (v, mkRefCellGet g m getEnumeratorRetTy e), refCellTyForRetTypeOfGetEnumerator else - mkCompGenLocal m "enumerator" retTypeOfGetEnumerator, retTypeOfGetEnumerator + mkCompGenLocal m "enumerator" getEnumeratorRetTy, getEnumeratorRetTy let getEnumExpr, getEnumTy = - let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumerator_minfo NormalValUse getEnumerator_minst [exprToSearchForGetEnumeratorAndItem] [] + let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumeratorMethInfo NormalValUse getEnumeratorMethInst [exprToSearchForGetEnumeratorAndItem] [] if not isEnumeratorTypeStruct || localAlloc then res else // wrap enumerators that are represented as mutable structs into ref cells @@ -3520,8 +3520,8 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr let getEnumTy = mkRefCellTy g getEnumTy getEnumExpr, getEnumTy - let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNext_minfo NormalValUse moveNext_minst [enumeratorExpr] [] - let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true get_Current_minfo NormalValUse get_Current_minst [enumeratorExpr] [] + let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNextMethInfo NormalValUse moveNextMethInst [enumeratorExpr] [] + let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true getCurrentMethInfo NormalValUse getCurrentMethInst [enumeratorExpr] [] let currentExpr = mkCoerceExpr(currentExpr, enumElemTy, currentExpr.Range, currentTy) let currentExpr, enumElemTy = // Implicitly dereference byref for expr 'for x in ...' @@ -3531,7 +3531,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr else currentExpr, enumElemTy - Result(enumeratorVar, enumeratorExpr, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, currentExpr) + Result(enumeratorVar, enumeratorExpr, getEnumeratorRetTy, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, currentExpr) // First try the original known static type match (if isArray1DTy g exprTy then Exception (Failure "") else tryType (expr, exprTy)) with @@ -3570,12 +3570,12 @@ let ConvertArbitraryExprToEnumerable (cenv: cenv) ty (env: TcEnv) (expr: Expr) = expr, enumElemTy else let enumerableVar, enumerableExpr = mkCompGenLocal m "inputSequence" ty - let enumeratorVar, _, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, _, guardExpr, guardTy, betterCurrentExpr = + let enumeratorVar, _, getEnumeratorRetTy, enumElemTy, getEnumExpr, _, guardExpr, guardTy, betterCurrentExpr = AnalyzeArbitraryExprAsEnumerable cenv env false m ty enumerableExpr let expr = mkCompGenLet m enumerableVar expr - (mkCallSeqOfFunctions g m retTypeOfGetEnumerator enumElemTy + (mkCallSeqOfFunctions g m getEnumeratorRetTy enumElemTy (mkUnitDelayLambda g m getEnumExpr) (mkLambda m enumeratorVar (guardExpr, guardTy)) (mkLambda m enumeratorVar (betterCurrentExpr, enumElemTy))) @@ -3921,28 +3921,28 @@ let buildApp cenv expr resultTy arg m = match expr, arg with // Special rule for building applications of the 'x && y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [x0], _), _), _ - when valRefEq g vf g.and_vref - || valRefEq g vf g.and2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + when valRefEq g vref g.and_vref + || valRefEq g vref g.and2_vref -> MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg), resultTy // Special rule for building applications of the 'x || y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [x0], _), _), _ - when valRefEq g vf g.or_vref - || valRefEq g vf g.or2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + when valRefEq g vref g.or_vref + || valRefEq g vref g.or2_vref -> MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ), resultTy // Special rule for building applications of the 'reraise' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.reraise_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.reraise_vref -> // exprTy is of type: "unit -> 'a". Break it and store the 'a type here, used later as return type. MakeApplicableExprNoFlex cenv (mkCompGenSequential m arg (mkReraise m resultTy)), resultTy // Special rules for NativePtr.ofByRef to generalize result. // See RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when (valRefEq g vf g.nativeptr_tobyref_vref) -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when (valRefEq g vref g.nativeptr_tobyref_vref) -> let argTy = NewInferenceType g let resultTy = mkByrefTyWithInference g argTy (NewByRefKindInferenceType g m) @@ -3952,10 +3952,10 @@ let buildApp cenv expr resultTy arg m = // address of an expression. // // See also RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.addrof_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.addrof_vref -> - let wrap, e1a', readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vf) m + let wrap, e1a', readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vref) m // Assert the result type to be readonly if we couldn't take the address let resultTy = let argTy = tyOfExpr g arg @@ -3977,11 +3977,11 @@ let buildApp cenv expr resultTy arg m = // Special rules for building applications of the &&expr' operators, which gets the // address of an expression. - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.addrof2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.addrof2_vref -> warning(UseOfAddressOfOperator m) - let wrap, e1a', _readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vf) m + let wrap, e1a', _readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vref) m MakeApplicableExprNoFlex cenv (wrap(e1a')), resultTy | _ when isByrefTy g resultTy -> @@ -4598,7 +4598,7 @@ and TcLongIdent kindOpt cenv newOk checkConstraints occ env tpenv synLongId = error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) TType_measure (NewErrorMeasure ()), tpenv | _, TyparKind.Measure -> - TType_measure (Measure.Con tcref), tpenv + TType_measure (Measure.Const tcref), tpenv | _, TyparKind.Type -> TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref tinstEnclosing [] @@ -4631,7 +4631,7 @@ and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId match args, postfix with | [arg], true -> let ms, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv arg m - TType_measure (Measure.Prod(Measure.Con tcref, ms)), tpenv + TType_measure (Measure.Prod(Measure.Const tcref, ms)), tpenv | _, _ -> errorR(Error(FSComp.SR.tcUnitsOfMeasureInvalidInTypeConstructor(), m)) @@ -5111,8 +5111,8 @@ and TcNestedTypeApplication cenv newOk checkConstraints occ env tpenv mWholeType /// This means the range of syntactic expression forms that can be used here is limited. and ConvSynPatToSynExpr synPat = match synPat with - | SynPat.FromParseError(p, _) -> - ConvSynPatToSynExpr p + | SynPat.FromParseError(innerPat, _) -> + ConvSynPatToSynExpr innerPat | SynPat.Const (c, m) -> SynExpr.Const (c, m) @@ -5120,8 +5120,8 @@ and ConvSynPatToSynExpr synPat = | SynPat.Named (SynIdent(id,_), _, None, _) -> SynExpr.Ident id - | SynPat.Typed (p, cty, m) -> - SynExpr.Typed (ConvSynPatToSynExpr p, cty, m) + | SynPat.Typed (innerPat, tgtTy, m) -> + SynExpr.Typed (ConvSynPatToSynExpr innerPat, tgtTy, m) | SynPat.LongIdent (longDotId=SynLongIdent(longId, dotms, trivia) as synLongId; argPats=args; accessibility=None; range=m) -> let args = match args with SynArgPats.Pats args -> args | _ -> failwith "impossible: active patterns can be used only with SynConstructorArgs.Pats" @@ -5135,8 +5135,8 @@ and ConvSynPatToSynExpr synPat = | SynPat.Tuple (isStruct, args, m) -> SynExpr.Tuple (isStruct, List.map ConvSynPatToSynExpr args, [], m) - | SynPat.Paren (p, _) -> - ConvSynPatToSynExpr p + | SynPat.Paren (innerPat, _) -> + ConvSynPatToSynExpr innerPat | SynPat.ArrayOrList (isArray, args, m) -> SynExpr.ArrayOrList (isArray,List.map ConvSynPatToSynExpr args, m) @@ -5151,26 +5151,26 @@ and ConvSynPatToSynExpr synPat = error(Error(FSComp.SR.tcInvalidArgForParameterizedPattern(), synPat.Range)) /// Check a long identifier 'Case' or 'Case argsR' that has been resolved to an active pattern case -and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv ty (lidRange, item, apref, args, m) = +and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv ty (mLongId, item, apref, args, m) = let g = cenv.g let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv let (APElemRef (apinfo, vref, idx, isStructRetTy)) = apref // Report information about the 'active recognizer' occurrence to IDE - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) // TOTAL/PARTIAL ACTIVE PATTERNS - let _, vexp, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m - let vexp = MakeApplicableExprWithFlex cenv env vexp - let vexpty = vexp.Type + let _, vExpr, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m + let vExpr = MakeApplicableExprWithFlex cenv env vExpr + let vExprTy = vExpr.Type let activePatArgsAsSynPats, patArg = match args with | [] -> [], SynPat.Const(SynConst.Unit, m) | _ -> // This bit of type-directed analysis ensures that parameterized partial active patterns returning unit do not need to take an argument - let dtys, retTy = stripFunTy g vexpty + let dtys, retTy = stripFunTy g vExprTy if dtys.Length = args.Length + 1 && ((isOptionTy g retTy && isUnitTy g (destOptionTy g retTy)) || @@ -5189,9 +5189,9 @@ and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv let delayed = activePatArgsAsSynExprs - |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, arg, unionRanges lidRange arg.Range)) + |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, arg, unionRanges mLongId arg.Range)) - let activePatExpr, tpenv = PropagateThenTcDelayed cenv (MustEqual activePatType) env tpenv m vexp vexpty ExprAtomicFlag.NonAtomic delayed + let activePatExpr, tpenv = PropagateThenTcDelayed cenv (MustEqual activePatType) env tpenv m vExpr vExprTy ExprAtomicFlag.NonAtomic delayed let patEnvR = TcPatLinearEnv(tpenv, names, takenNames) @@ -6264,13 +6264,13 @@ and TcExprILAssembly cenv overallTy env tpenv (ilInstrs, synTyArgs, synArgs, syn and RewriteRangeExpr synExpr = match synExpr with // a..b..c (parsed as (a..b)..c ) - | SynExpr.IndexRange(Some (SynExpr.IndexRange(Some synExpr1, _, Some synStepExpr, _, _, _)), _, Some synExpr2, _m1, _m2, wholem) -> - Some (mkSynTrifix wholem ".. .." synExpr1 synStepExpr synExpr2) + | SynExpr.IndexRange(Some (SynExpr.IndexRange(Some synExpr1, _, Some synStepExpr, _, _, _)), _, Some synExpr2, _m1, _m2, mWhole) -> + Some (mkSynTrifix mWhole ".. .." synExpr1 synStepExpr synExpr2) // a..b - | SynExpr.IndexRange (Some synExpr1, mOperator, Some synExpr2, _m1, _m2, wholem) -> + | SynExpr.IndexRange (Some synExpr1, mOperator, Some synExpr2, _m1, _m2, mWhole) -> let otherExpr = match mkSynInfix mOperator synExpr1 ".." synExpr2 with - | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, wholem) + | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, mWhole) | _ -> failwith "impossible" Some otherExpr | _ -> None @@ -7696,8 +7696,8 @@ and TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, synPat, s match stripDebugPoints enumExpr with // optimize 'for i in n .. m do' - | Expr.App (Expr.Val (vf, _, _), _, [tyarg], [startExpr;finishExpr], _) - when valRefEq g vf g.range_op_vref && typeEquiv g tyarg g.int_ty -> + | Expr.App (Expr.Val (vref, _, _), _, [tyarg], [startExpr;finishExpr], _) + when valRefEq g vref g.range_op_vref && typeEquiv g tyarg g.int_ty -> (g.int32_ty, (fun _ x -> x), id, Choice1Of3 (startExpr, finishExpr)) // optimize 'for i in arr do' @@ -7883,9 +7883,9 @@ and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableEx // See RFC FS-1053.md let isAddrOf = match expr with - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _) - when (valRefEq g vf g.addrof_vref || - valRefEq g vf g.nativeptr_tobyref_vref) -> true + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _) + when (valRefEq g vref g.addrof_vref || + valRefEq g vref g.nativeptr_tobyref_vref) -> true | _ -> false propagate isAddrOf delayedList' mExprAndArg resultTy @@ -8195,12 +8195,12 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE // will have debug points on "f expr1" and "g expr2" let env = match leftExpr with - | ApplicableExpr(_, Expr.Val (vf, _, _), _) - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [_], _), _) - when valRefEq g vf g.and_vref - || valRefEq g vf g.and2_vref - || valRefEq g vf g.or_vref - || valRefEq g vf g.or2_vref -> + | ApplicableExpr(_, Expr.Val (vref, _, _), _) + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [_], _), _) + when valRefEq g vref g.and_vref + || valRefEq g vref g.and2_vref + || valRefEq g vref g.or_vref + || valRefEq g vref g.or2_vref -> { env with eIsControlFlow = true } | _ -> env @@ -8757,7 +8757,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed vTy // Always allow subsumption on assignment to fields let expr2R, tpenv = TcExprFlex cenv true false vty2 env tpenv expr2 - let vexp = + let vExpr = if isInByrefTy g vTy then errorR(Error(FSComp.SR.writeToReadOnlyByref(), mStmt)) mkAddrSet mStmt vref expr2R @@ -8766,7 +8766,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed else mkValSet mStmt vref expr2R - PropagateThenTcDelayed cenv overallTy env tpenv mStmt (MakeApplicableExprNoFlex cenv vexp) (tyOfExpr g vexp) ExprAtomicFlag.NonAtomic otherDelayed + PropagateThenTcDelayed cenv overallTy env tpenv mStmt (MakeApplicableExprNoFlex cenv vExpr) (tyOfExpr g vExpr) ExprAtomicFlag.NonAtomic otherDelayed // Value instantiation: v ... | DelayedTypeApp(tys, _mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -8780,24 +8780,24 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed match tys with | [SynType.Var(SynTypar(id, _, false) as tp, _m)] -> let _tpR, tpenv = TcTypeOrMeasureParameter None cenv env ImplicitlyBoundTyparsAllowed.NoNewTypars tpenv tp - let vexp = TcNameOfExprResult cenv id mExprAndTypeArgs - let vexpFlex = MakeApplicableExprNoFlex cenv vexp + let vExpr = TcNameOfExprResult cenv id mExprAndTypeArgs + let vexpFlex = MakeApplicableExprNoFlex cenv vExpr PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex g.string_ty ExprAtomicFlag.Atomic otherDelayed | _ -> error (Error(FSComp.SR.expressionHasNoName(), mExprAndTypeArgs)) | _ -> let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem + let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic otherDelayed // Value get | _ -> - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution delayed = @@ -9054,8 +9054,8 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed | Item.AnonRecdField (anonInfo, tinst, n, _) -> - let tgty = TType_anon (anonInfo, tinst) - AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgty objExprTy + let tgtTy = TType_anon (anonInfo, tinst) + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgtTy objExprTy let fieldTy = List.item n tinst match delayed with | DelayedSet _ :: _otherDelayed -> @@ -9107,7 +9107,7 @@ and TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem objDetails (einf MethInfoChecks g cenv.amap true None objArgs env.eAccessRights mItem delInvokeMeth // This checks for and drops the 'object' sender - let argsTy = ArgsTypOfEventInfo cenv.infoReader mItem ad einfo + let argsTy = ArgsTypeOfEventInfo cenv.infoReader mItem ad einfo if not (slotSigHasVoidReturnTy (delInvokeMeth.GetSlotSig(cenv.amap, mItem))) then errorR (nonStandardEventError einfo.EventName mItem) let delEventTy = mkIEventType g delTy argsTy @@ -11264,14 +11264,13 @@ and AnalyzeRecursiveDecl let rec analyzeRecursiveDeclPat tpenv pat = match pat with - | SynPat.FromParseError(pat', _) -> analyzeRecursiveDeclPat tpenv pat' - | SynPat.Typed(pat', cty, _) -> - let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType envinner tpenv cty + | SynPat.FromParseError(innerPat, _) -> analyzeRecursiveDeclPat tpenv innerPat + | SynPat.Typed(innerPat, tgtTy, _) -> + let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType envinner tpenv tgtTy UnifyTypes cenv envinner mBinding ty ctyR - analyzeRecursiveDeclPat tpenv pat' - | SynPat.Attrib(_pat', _attribs, m) -> + analyzeRecursiveDeclPat tpenv innerPat + | SynPat.Attrib(_innerPat, _attribs, m) -> error(Error(FSComp.SR.tcAttributesInvalidInPatterns(), m)) - //analyzeRecursiveDeclPat pat' // This is for the construct 'let rec x = ... and do ... and y = ...' (DEPRECATED IN pars.mly ) // diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 8b5f1878532..2a83a61d50f 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -1180,7 +1180,7 @@ val TcPatLongIdentActivePatternCase: vFlags: TcPatValFlags -> patEnv: TcPatLinearEnv -> ty: TType -> - lidRange: range * item: Item * apref: ActivePatternElemRef * args: SynPat list * m: range -> + mLongId: range * item: Item * apref: ActivePatternElemRef * args: SynPat list * m: range -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv /// The pattern syntax can also represent active pattern arguments. This routine diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index fb4b4cec03a..1334b1bf54c 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -22,9 +22,9 @@ let copyAndFixupFormatTypar m tp = let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) -let mkFlexibleFormatTypar m tys dflt = +let mkFlexibleFormatTypar m tys dfltTy = let tp = Construct.NewTypar (TyparKind.Type, TyparRigidity.Rigid, SynTypar(mkSynId m "fmt",TyparStaticReq.HeadType,true),false,TyparDynamicReq.Yes,[],false,false) - tp.SetConstraints [ TyparConstraint.SimpleChoice (tys,m); TyparConstraint.DefaultsTo (lowestDefaultPriority,dflt,m)] + tp.SetConstraints [ TyparConstraint.SimpleChoice (tys,m); TyparConstraint.DefaultsTo (lowestDefaultPriority,dfltTy,m)] copyAndFixupFormatTypar m tp let mkFlexibleIntFormatTypar (g: TcGlobals) m = @@ -449,19 +449,19 @@ let parseFormatStringInternal | Some '+' -> collectSpecifierLocation fragLine fragCol 1 let i = skipPossibleInterpolationHole (i+1) - let xty = NewInferenceType g - percentATys.Add(xty) - parseLoop ((posi, xty) :: acc) (i, fragLine, fragCol+1) fragments + let aTy = NewInferenceType g + percentATys.Add(aTy) + parseLoop ((posi, aTy) :: acc) (i, fragLine, fragCol+1) fragments | Some n -> failwith (FSComp.SR.forDoesNotSupportPrefixFlag(ch.ToString(), n.ToString())) | 'a' -> checkOtherFlags ch - let xty = NewInferenceType g - let fty = mkFunTy g printerArgTy (mkFunTy g xty printerResidueTy) + let aTy = NewInferenceType g + let fTy = mkFunTy g printerArgTy (mkFunTy g aTy printerResidueTy) collectSpecifierLocation fragLine fragCol 2 let i = skipPossibleInterpolationHole (i+1) - parseLoop ((Option.map ((+)1) posi, xty) :: (posi, fty) :: acc) (i, fragLine, fragCol+1) fragments + parseLoop ((Option.map ((+)1) posi, aTy) :: (posi, fTy) :: acc) (i, fragLine, fragCol+1) fragments | 't' -> checkOtherFlags ch diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index b39d6481517..7ced746b6a1 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -503,7 +503,7 @@ and TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags (patEnv: TcPatLine | SynArgPats.Pats [] -> warnOnUpper | _ -> AllIdsOK - let lidRange = rangeOfLid longId + let mLongId = rangeOfLid longId match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver warnOnUpperForId false m ad env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> @@ -519,19 +519,19 @@ and TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags (patEnv: TcPatLine let args = GetSynArgPatterns args - TcPatLongIdentActivePatternCase warnOnUpper cenv env vFlags patEnv ty (lidRange, item, apref, args, m) + TcPatLongIdentActivePatternCase warnOnUpper cenv env vFlags patEnv ty (mLongId, item, apref, args, m) | Item.UnionCase _ | Item.ExnCase _ as item -> - TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (lidRange, item, args, m) + TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (mLongId, item, args, m) | Item.ILField finfo -> - TcPatLongIdentILField warnOnUpper cenv env vFlags patEnv ty (lidRange, finfo, args, m) + TcPatLongIdentILField warnOnUpper cenv env vFlags patEnv ty (mLongId, finfo, args, m) | Item.RecdField rfinfo -> - TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfinfo, args, m) + TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (mLongId, rfinfo, args, m) | Item.Value vref -> - TcPatLongIdentLiteral warnOnUpper cenv env vFlags patEnv ty (lidRange, vref, args, m) + TcPatLongIdentLiteral warnOnUpper cenv env vFlags patEnv ty (mLongId, vref, args, m) | _ -> error (Error(FSComp.SR.tcRequireVarConstRecogOrLiteral(), m)) @@ -577,9 +577,9 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item = let ucref = ucinfo.UnionCaseRef CheckUnionCaseAttributes g ucref m |> CommitOperationResult CheckUnionCaseAccessible cenv.amap m ad ucref |> ignore - let gtyp2 = actualResultTyOfUnionCase ucinfo.TypeInst ucref + let resTy = actualResultTyOfUnionCase ucinfo.TypeInst ucref let inst = mkTyparInst ucref.TyconRef.TyparsNoRange ucinfo.TypeInst - UnifyTypes cenv env m overallTy gtyp2 + UnifyTypes cenv env m overallTy resTy let mkf mArgs args = TPat_unioncase(ucref, ucinfo.TypeInst, args, unionRanges m mArgs) mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] @@ -587,11 +587,11 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item = invalidArg "item" "not a union case or exception reference" /// Check a long identifier 'Case' or 'Case argsR that has been resolved to a union case or F# exception constructor -and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (lidRange, item, args, m) = +and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (mLongId, item, args, m) = let g = cenv.g // Report information about the case occurrence to IDE - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) let mkf, argTys, argNames = ApplyUnionCaseOrExn m cenv env ty item let numArgTys = argTys.Length @@ -693,38 +693,38 @@ and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (l (fun values -> mkf m (List.map (fun f -> f values) argsR)), acc /// Check a long identifier that has been resolved to an IL field - valid if a literal -and TcPatLongIdentILField warnOnUpper (cenv: cenv) env vFlags patEnv ty (lidRange, finfo, args, m) = +and TcPatLongIdentILField warnOnUpper (cenv: cenv) env vFlags patEnv ty (mLongId, finfo, args, m) = let g = cenv.g - CheckILFieldInfoAccessible g cenv.amap lidRange env.AccessRights finfo + CheckILFieldInfoAccessible g cenv.amap mLongId env.AccessRights finfo if not finfo.IsStatic then - errorR (Error (FSComp.SR.tcFieldIsNotStatic finfo.FieldName, lidRange)) + errorR (Error (FSComp.SR.tcFieldIsNotStatic finfo.FieldName, mLongId)) CheckILFieldAttributes g finfo m match finfo.LiteralValue with | None -> - error (Error (FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern (), lidRange)) + error (Error (FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern (), mLongId)) | Some lit -> CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args UnifyTypes cenv env m ty (finfo.FieldType (cenv.amap, m)) - let c' = TcFieldInit lidRange lit + let c' = TcFieldInit mLongId lit let item = Item.ILField finfo - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (c', m)), acc /// Check a long identifier that has been resolved to a record field -and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfinfo, args, m) = +and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (mLongId, rfinfo, args, m) = let g = cenv.g - CheckRecdFieldInfoAccessible cenv.amap lidRange env.AccessRights rfinfo - if not rfinfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), lidRange)) - CheckRecdFieldInfoAttributes g rfinfo lidRange |> CommitOperationResult + CheckRecdFieldInfoAccessible cenv.amap mLongId env.AccessRights rfinfo + if not rfinfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), mLongId)) + CheckRecdFieldInfoAttributes g rfinfo mLongId |> CommitOperationResult match rfinfo.LiteralValue with - | None -> error (Error(FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern(), lidRange)) + | None -> error (Error(FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern(), mLongId)) | Some lit -> CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args @@ -733,26 +733,26 @@ and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfi let item = Item.RecdField rfinfo // FUTURE: can we do better than emptyTyparInst here, in order to display instantiations // of type variables in the quick info provided in the IDE. - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (lit, m)), acc /// Check a long identifier that has been resolved to an F# value that is a literal -and TcPatLongIdentLiteral warnOnUpper (cenv: cenv) env vFlags patEnv ty (lidRange, vref, args, m) = +and TcPatLongIdentLiteral warnOnUpper (cenv: cenv) env vFlags patEnv ty (mLongId, vref, args, m) = let g = cenv.g let (TcPatLinearEnv(tpenv, _, _)) = patEnv match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) | Some lit -> - let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None lidRange - CheckValAccessible lidRange env.AccessRights vref - CheckFSharpAttributes g vref.Attribs lidRange |> CommitOperationResult + let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None mLongId + CheckValAccessible mLongId env.AccessRights vref + CheckFSharpAttributes g vref.Attribs mLongId |> CommitOperationResult CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args UnifyTypes cenv env m ty vexpty let item = Item.Value vref - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (lit, m)), acc and TcPatterns warnOnUpper cenv env vFlags s argTys args = diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 7d7097dc25a..0119827bdf5 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -136,12 +136,12 @@ let FreshenTypars m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tptys = FreshenTypeInst m tpsorig - tptys + let _, _, tpTys = FreshenTypeInst m tpsorig + tpTys let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tptys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars - tptys + let _, _, tpTys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars + tpTys //------------------------------------------------------------------------- // Unification of types: solve/record equality constraints @@ -362,7 +362,7 @@ let rec occursCheck g un ty = | TType_app (_, l, _) | TType_anon(_, l) | TType_tuple (_, l) -> List.exists (occursCheck g un) l - | TType_fun (d, r, _) -> occursCheck g un d || occursCheck g un r + | TType_fun (domainTy, rangeTy, _) -> occursCheck g un domainTy || occursCheck g un rangeTy | TType_var (r, _) -> typarEq un r | TType_forall (_, tau) -> occursCheck g un tau | _ -> false @@ -787,7 +787,7 @@ let UnifyMeasureWithOne (csenv: ConstraintSolverEnv) trace ms = match FindPreferredTypar nonRigidVars with | (v, e) :: vs -> let unexpandedCons = ListMeasureConOccsWithNonZeroExponents csenv.g false ms - let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower (Measure.Con c, NegRational (DivRational e' e))) unexpandedCons + let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e))) unexpandedCons @ List.map (fun (v, e') -> Measure.RationalPower (Measure.Var v, NegRational (DivRational e' e))) (vs @ rigidVars)) SubstMeasureWarnIfRigid csenv trace v newms @@ -818,7 +818,7 @@ let SimplifyMeasure g vars ms = let newms = ProdMeasures [ for (c, e') in nonZeroCon do - Measure.RationalPower (Measure.Con c, NegRational (DivRational e' e)) + Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e)) for (v', e') in nonZeroVar do if typarEq v v' then newvarExpr @@ -841,11 +841,11 @@ let rec SimplifyMeasuresInType g resultFirst (generalizable, generalized as para | TType_anon (_,l) | TType_tuple (_, l) -> SimplifyMeasuresInTypes g param l - | TType_fun (d, r, _) -> + | TType_fun (domainTy, rangeTy, _) -> if resultFirst then - SimplifyMeasuresInTypes g param [r;d] + SimplifyMeasuresInTypes g param [rangeTy;domainTy] else - SimplifyMeasuresInTypes g param [d;r] + SimplifyMeasuresInTypes g param [domainTy;rangeTy] | TType_var _ -> param @@ -886,7 +886,7 @@ let rec GetMeasureVarGcdInType v ty = | TType_anon (_,l) | TType_tuple (_, l) -> GetMeasureVarGcdInTypes v l - | TType_fun (d, r, _) -> GcdRational (GetMeasureVarGcdInType v d) (GetMeasureVarGcdInType v r) + | TType_fun (domainTy, rangeTy, _) -> GcdRational (GetMeasureVarGcdInType v domainTy) (GetMeasureVarGcdInType v rangeTy) | TType_var _ -> ZeroRational | TType_forall (_, tau) -> GetMeasureVarGcdInType v tau | TType_measure unt -> MeasureVarExponent v unt @@ -1027,7 +1027,7 @@ and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.DefaultsTo(priority, dty, m)) | TyparConstraint.SupportsNull m2 -> SolveTypeUseSupportsNull csenv ndeep m2 trace ty - | TyparConstraint.IsEnum(underlying, m2) -> SolveTypeIsEnum csenv ndeep m2 trace ty underlying + | TyparConstraint.IsEnum(underlyingTy, m2) -> SolveTypeIsEnum csenv ndeep m2 trace ty underlyingTy | TyparConstraint.SupportsComparison(m2) -> SolveTypeSupportsComparison csenv ndeep m2 trace ty | TyparConstraint.SupportsEquality(m2) -> SolveTypeSupportsEquality csenv ndeep m2 trace ty | TyparConstraint.IsDelegate(aty, bty, m2) -> SolveTypeIsDelegate csenv ndeep m2 trace ty aty bty @@ -1054,17 +1054,17 @@ and SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalT } // Like SolveTyparEqualsType but asserts all typar equalities simultaneously instead of one by one -and SolveTyparsEqualTypes (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) tptys tys = trackErrors { - do! (tptys, tys) ||> Iterate2D (fun tpty ty -> - match tpty with +and SolveTyparsEqualTypes (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) tpTys tys = trackErrors { + do! (tpTys, tys) ||> Iterate2D (fun tpTy ty -> + match tpTy with | TType_var (r, _) | TType_measure (Measure.Var r) -> - SolveTyparEqualsTypePart1 csenv m2 trace tpty r ty + SolveTyparEqualsTypePart1 csenv m2 trace tpTy r ty | _ -> failwith "SolveTyparsEqualTypes") - do! (tptys, tys) ||> Iterate2D (fun tpty ty -> - match tpty with + do! (tpTys, tys) ||> Iterate2D (fun tpTy ty -> + match tpTy with | TType_var (r, _) | TType_measure (Measure.Var r) -> SolveTyparEqualsTypePart2 csenv ndeep m2 trace r ty @@ -1135,7 +1135,7 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr match sty1, sty2 with // type vars inside forall-types may be alpha-equivalent - | TType_var (tp1, _), TType_var (tp2, _) when typarEq tp1 tp2 || (match aenv.EquivTypars.TryFind tp1 with | Some v when typeEquiv g v ty2 -> true | _ -> false) -> + | TType_var (tp1, _), TType_var (tp2, _) when typarEq tp1 tp2 || (match aenv.EquivTypars.TryFind tp1 with | Some tpTy1 when typeEquiv g tpTy1 ty2 -> true | _ -> false) -> CompleteD // 'v1 = 'v2 @@ -1173,18 +1173,18 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2) - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - SolveFunTypeEqn csenv ndeep m2 trace None d1 d2 r1 r2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + SolveFunTypeEqn csenv ndeep m2 trace None domainTy1 domainTy2 rangeTy1 rangeTy2 | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 - | TType_forall(tps1, rty1), TType_forall(tps2, rty2) -> + | TType_forall(tps1, bodyTy1), TType_forall(tps2, bodyTy2) -> if tps1.Length <> tps2.Length then localAbortD else let aenv = aenv.BindEquivTypars tps1 tps2 let csenv = {csenv with EquivEnv = aenv } if not (typarsAEquiv g aenv tps1 tps2) then localAbortD else - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 + SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace bodyTy1 bodyTy2 | TType_ucase (uc1, l1), TType_ucase (uc2, l2) when g.unionCaseRefEq uc1 uc2 -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2 | _ -> localAbortD @@ -1214,9 +1214,9 @@ and SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln origl1 origl2 = ErrorD(ConstraintSolverTupleDiffLengths(csenv.DisplayEnv, origl1, origl2, csenv.m, m2)) loop origl1 origl2 -and SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 = trackErrors { - do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln d1 d2 - return! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln r1 r2 +and SolveFunTypeEqn csenv ndeep m2 trace cxsln domainTy1 domainTy2 rangeTy1 rangeTy2 = trackErrors { + do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln domainTy1 domainTy2 + return! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln rangeTy1 rangeTy2 } // ty1: expected @@ -1240,7 +1240,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional match sty1, sty2 with | TType_var (tp1, _), _ -> match aenv.EquivTypars.TryFind tp1 with - | Some v -> SolveTypeSubsumesType csenv ndeep m2 trace cxsln v ty2 + | Some tpTy1 -> SolveTypeSubsumesType csenv ndeep m2 trace cxsln tpTy1 ty2 | _ -> match sty2 with | TType_var (r2, _) when typarEq tp1 r2 -> CompleteD @@ -1258,8 +1258,8 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2) (* nb. can unify since no variance *) - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 (* nb. can unify since no variance *) + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + SolveFunTypeEqn csenv ndeep m2 trace cxsln domainTy1 domainTy2 rangeTy1 rangeTy2 (* nb. can unify since no variance *) | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 @@ -1306,17 +1306,17 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional // Note we don't support co-variance on array types nor // the special .NET conversions for these types match ty1 with - | AppTy g (tcr1, tinst) when + | AppTy g (tcref1, tinst1) when isArray1DTy g ty2 && - (tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IList || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_ICollection || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IReadOnlyList || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IReadOnlyCollection || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IEnumerable) -> - match tinst with - | [ty1arg] -> - let ty2arg = destArrayTy g ty2 - SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ty1arg ty2arg + (tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IList || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_ICollection || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IReadOnlyList || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IReadOnlyCollection || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IEnumerable) -> + match tinst1 with + | [elemTy1] -> + let elemTy2 = destArrayTy g ty2 + SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln elemTy1 elemTy2 | _ -> error(InternalError("destArrayTy", m)) | _ -> @@ -1525,13 +1525,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload if rankOfArrayTy g ty <> argTys.Length - 1 then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), (argTys.Length - 1)), m, m2)) - let argTys, ety = List.frontAndBack argTys + let argTys, lastTy = List.frontAndBack argTys for argTy in argTys do do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy g.int_ty - let etys = destArrayTy g ty - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys + let elemTy = destArrayTy g ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace lastTy elemTy return TTraitBuiltIn | [], _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argTy1;argTy2] @@ -1845,10 +1845,10 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = match callMethInfoOpt, callExpr with | Some methInfo, Expr.Op (TOp.ILCall (_, _, _, _, NormalValUse, _, _, ilMethRef, _, methInst, _), [], args, m) when (args, (objArgVars@allArgVars)) ||> List.lengthsEqAndForall2 (fun a b -> match a with Expr.Val (v, _, _) -> valEq v.Deref b | _ -> false) -> - let declaringType = ImportProvidedType amap m (methInfo.PApply((fun x -> x.DeclaringType), m)) - if isILAppTy g declaringType then + let declaringTy = ImportProvidedType amap m (methInfo.PApply((fun x -> x.DeclaringType), m)) + if isILAppTy g declaringTy then let extOpt = None // EXTENSION METHODS FROM TYPE PROVIDERS: for extension methods coming from the type providers we would have something here. - ILMethSln(declaringType, extOpt, ilMethRef, methInst) + ILMethSln(declaringTy, extOpt, ilMethRef, methInst) else closedExprSln | _ -> @@ -2090,8 +2090,8 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ -> true | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice (tys2, _) -> ListSet.isSubsetOf (typeEquiv g) tys1 tys2 - | TyparConstraint.DefaultsTo (priority1, dty1, _), TyparConstraint.DefaultsTo (priority2, dty2, _) -> - (priority1 = priority2) && typeEquiv g dty1 dty2 + | TyparConstraint.DefaultsTo (priority1, defaultTy1, _), TyparConstraint.DefaultsTo (priority2, defaultTy2, _) -> + (priority1 = priority2) && typeEquiv g defaultTy1 defaultTy2 | _ -> false @@ -2565,14 +2565,12 @@ and SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv and SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln ty1 ty2 id -// ty1: actual -// ty2: expected -and private SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actual expected = +and SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actualTy expectedTy = TryD - (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actual expected) + (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actualTy expectedTy) (function | AbortForFailedMemberConstraintResolution as err -> ErrorD err - | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actual, expected, res, m))) + | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actualTy, expectedTy, res, m))) and ArgsMustSubsumeOrConvert (csenv: ConstraintSolverEnv) diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index a914e61d256..93f452abd7d 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -201,7 +201,7 @@ and accDiscrim cenv env d = | DecisionTreeTest.ArrayLength(_, ty) -> accTy cenv env ty | DecisionTreeTest.Const _ | DecisionTreeTest.IsNull -> () - | DecisionTreeTest.IsInst (srcty, tgty) -> accTy cenv env srcty; accTy cenv env tgty + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> accTy cenv env srcTy; accTy cenv env tgtTy | DecisionTreeTest.ActivePatternCase (exp, tys, _, _, _, _) -> accExpr cenv env exp accTypeInst cenv env tys diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 75a4e9aa897..581cb7d0353 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -628,10 +628,10 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = keyComparer= { new System.Collections.Generic.IEqualityComparer<_> with - member _.Equals((flags1, _, typ1), (flags2, _, typ2)) = + member _.Equals((flags1, _, ty1), (flags2, _, ty2)) = // Ignoring the ranges - that's OK. flagsEq.Equals(flags1, flags2) && - match stripTyEqns g typ1, stripTyEqns g typ2 with + match stripTyEqns g ty1, stripTyEqns g ty2 with | TType_app(tcref1, [], _), TType_app(tcref2, [], _) -> tyconRefEq g tcref1 tcref2 | _ -> false member _.GetHashCode((flags, _, ty)) = @@ -910,11 +910,11 @@ type SigOfFunctionForDelegate = /// Given a delegate type work out the minfo, argument types, return type /// and F# function type by looking at the Invoke signature of the delegate. -let GetSigOfFunctionForDelegate (infoReader: InfoReader) delty m ad = +let GetSigOfFunctionForDelegate (infoReader: InfoReader) delTy m ad = let g = infoReader.g let amap = infoReader.amap let delInvokeMeth = - match GetIntrinsicMethInfosOfType infoReader (Some "Invoke") ad AllowMultiIntfInstantiations.Yes IgnoreOverrides m delty with + match GetIntrinsicMethInfosOfType infoReader (Some "Invoke") ad AllowMultiIntfInstantiations.Yes IgnoreOverrides m delTy with | [h] -> h | [] -> error(Error(FSComp.SR.noInvokeMethodsFound (), m)) | h :: _ -> warning(InternalError(FSComp.SR.moreThanOneInvokeMethodFound (), m)); h @@ -964,26 +964,26 @@ let TryDestStandardDelegateType (infoReader: InfoReader) m ad delTy = // already defined an appropriate delegate type: EventHandler. // (from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkEventsTutorial.asp) let IsStandardEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = - let dty = einfo.GetDelegateType(infoReader.amap, m) - match TryDestStandardDelegateType infoReader m ad dty with + let delTy = einfo.GetDelegateType(infoReader.amap, m) + match TryDestStandardDelegateType infoReader m ad delTy with | Some _ -> true | None -> false /// Get the (perhaps tupled) argument type accepted by an event -let ArgsTypOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = +let ArgsTypeOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = let amap = infoReader.amap - let dty = einfo.GetDelegateType(amap, m) - match TryDestStandardDelegateType infoReader m ad dty with + let delTy = einfo.GetDelegateType(amap, m) + match TryDestStandardDelegateType infoReader m ad delTy with | Some(argTys, _) -> argTys | None -> error(nonStandardEventError einfo.EventName m) /// Get the type of the event when looked at as if it is a property /// Used when displaying the property in Intellisense -let PropTypOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = +let PropTypeOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = let g = infoReader.g let amap = infoReader.amap let delTy = einfo.GetDelegateType(amap, m) - let argsTy = ArgsTypOfEventInfo infoReader m ad einfo + let argsTy = ArgsTypeOfEventInfo infoReader m ad einfo mkIEventType g delTy argsTy /// Try to find the name of the metadata file for this external definition diff --git a/src/Compiler/Checking/InfoReader.fsi b/src/Compiler/Checking/InfoReader.fsi index 5941702256a..c8cec7f82da 100644 --- a/src/Compiler/Checking/InfoReader.fsi +++ b/src/Compiler/Checking/InfoReader.fsi @@ -280,7 +280,7 @@ type SigOfFunctionForDelegate = /// Given a delegate type work out the minfo, argument types, return type /// and F# function type by looking at the Invoke signature of the delegate. val GetSigOfFunctionForDelegate: - infoReader: InfoReader -> delty: TType -> m: range -> ad: AccessorDomain -> SigOfFunctionForDelegate + infoReader: InfoReader -> delTy: TType -> m: range -> ad: AccessorDomain -> SigOfFunctionForDelegate /// Try and interpret a delegate type as a "standard" .NET delegate type associated with an event, with a "sender" parameter. val TryDestStandardDelegateType: @@ -290,9 +290,9 @@ val TryDestStandardDelegateType: /// with a sender parameter. val IsStandardEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> bool -val ArgsTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType +val ArgsTypeOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType -val PropTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType +val PropTypeOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType /// Try to find the name of the metadata file for this external definition val TryFindMetadataInfoOfExternalEntityRef: diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 6331c9a992d..7c8c07cb883 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -181,7 +181,7 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT let reqdTy2 = if isTyparTy g reqdTy then let tp = destTyparTy g reqdTy - match tp.Constraints |> List.choose (function TyparConstraint.CoercesTo (c, _) -> Some c | _ -> None) with + match tp.Constraints |> List.choose (function TyparConstraint.CoercesTo (tgtTy, _) -> Some tgtTy | _ -> None) with | [reqdTy2] when tp.Rigidity = TyparRigidity.Flexible -> reqdTy2 | _ -> reqdTy else reqdTy @@ -363,8 +363,8 @@ let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableO calledArgTy, TypeDirectedConversionUsed.No, None | _ -> let compgenId = mkSynId range0 unassignedTyparName - let tp = mkTyparTy (Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, SynTypar(compgenId, TyparStaticReq.None, true), false, TyparDynamicReq.No, [], false, false)) - tp, TypeDirectedConversionUsed.No, None + let tpTy = mkTyparTy (Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, SynTypar(compgenId, TyparStaticReq.None, true), false, TyparDynamicReq.No, [], false, false)) + tpTy, TypeDirectedConversionUsed.No, None else AdjustCalledArgTypeForTypeDirectedConversionsAndAutoQuote infoReader ad callerArgTy calledArgTy calledArg m @@ -456,7 +456,7 @@ type CalledMethArgSet<'T> = let MakeCalledArgs amap m (minfo: MethInfo) minst = // Mark up the arguments with their position, so we can sort them back into order later let paramDatas = minfo.GetParamDatas(amap, m, minst) - paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) -> + paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, calledArgTy)) -> { Position=(i,j) IsParamArray=isParamArrayArg OptArgInfo=optArgInfo @@ -465,7 +465,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst = IsOutArg=isOutArg ReflArgInfo=reflArgInfo NameOpt=nmOpt - CalledArgumentType=typeOfCalledArg }) + CalledArgumentType=calledArgTy }) /// /// Represents the syntactic matching between a caller of a method and the called method. @@ -969,7 +969,7 @@ let BuildILMethInfoCall g amap m isProp (minfo: ILMethInfo) valUseFlags minst di /// /// QUERY: this looks overly complex considering that we are doing a fundamentally simple /// thing here. -let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = +let BuildFSharpMethodApp g m (vref: ValRef) vExpr vexprty (args: Exprs) = let arities = (arityOfVal vref.Deref).AritiesOfArgs let args3, (leftover, retTy) = @@ -990,17 +990,17 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = (mkRefTupled g m tupargs tuptys), (argst, rangeOfFunTy g fty) ) if not leftover.IsEmpty then error(InternalError("Unexpected "+string(leftover.Length)+" remaining arguments in method application", m)) - mkApps g ((vexp, vexprty), [], args3, m), + mkApps g ((vExpr, vexprty), [], args3, m), retTy /// Build a call to an F# method. let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = - let vexp = Expr.Val (vref, valUseFlags, m) - let vexpty = vref.Type + let vExpr = Expr.Val (vref, valUseFlags, m) + let vExprTy = vref.Type let tpsorig, tau = vref.GeneralizedType let vtinst = argsOfAppTy g ty @ minst if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected List.length mismatch", m)) - let expr = mkTyAppExpr m (vexp, vexpty) vtinst + let expr = mkTyAppExpr m (vExpr, vExprTy) vtinst let exprTy = instType (mkTyparInst tpsorig vtinst) tau BuildFSharpMethodApp g m vref expr exprTy args @@ -1113,8 +1113,8 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA if valRefEq amap.g fsValRef amap.g.reraise_vref then mkReraise m exprTy, exprTy else - let vexp, vexpty = tcVal fsValRef valUseFlags (minfo.DeclaringTypeInst @ minst) m - BuildFSharpMethodApp g m fsValRef vexp vexpty allArgs + 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 isNewObj = isCtor && (match valUseFlags with NormalValUse -> true | _ -> false) @@ -1139,8 +1139,8 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA // Go see if this is a use of a recursive definition... Note we know the value instantiation // we want to use so we pass that in order not to create a new one. - let vexp, vexpty = tcVal vref valUseFlags (minfo.DeclaringTypeInst @ minst) m - BuildFSharpMethodApp g m vref vexp vexpty allArgs + let vExpr, vExprTy = tcVal vref valUseFlags (minfo.DeclaringTypeInst @ minst) m + BuildFSharpMethodApp g m vref vExpr vExprTy allArgs // Build a 'call' to a struct default constructor | DefaultStructCtor (g, ty) -> @@ -1793,6 +1793,7 @@ module ProvidedMethodCalls = for v, e in Seq.zip (paramVars |> Seq.map (fun x -> x.PUntaint(id, m))) (Option.toList thisArg @ allArgs) do dict.Add(v, (None, e)) dict + let rec exprToExprAndWitness top (ea: Tainted) = let fail() = error(Error(FSComp.SR.etUnsupportedProvidedExpression(ea.PUntaint((fun etree -> etree.UnderlyingExpressionString), m)), m)) match ea with @@ -1806,139 +1807,139 @@ module ProvidedMethodCalls = 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 te = mkCoerceIfNeeded g targetTy sourceTy srcExpr - None, (te, tyOfExpr g te) + 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 te = mkCallTypeTest g m targetTy srcExpr - None, (te, tyOfExpr g te) + let exprR = mkCallTypeTest g m targetTy srcExpr + None, (exprR, tyOfExpr g exprR) | ProvidedIfThenElseExpr (test, thenBranch, elseBranch) -> let test, thenBranch, elseBranch = exprType.PApply3((fun _ -> (test, thenBranch, elseBranch)), m) let testExpr = exprToExpr test let ifTrueExpr = exprToExpr thenBranch let ifFalseExpr = exprToExpr elseBranch - let te = mkCond DebugPointAtBinding.NoneAtSticky m (tyOfExpr g ifTrueExpr) testExpr ifTrueExpr ifFalseExpr - None, (te, tyOfExpr g te) + let exprR = mkCond DebugPointAtBinding.NoneAtSticky m (tyOfExpr g ifTrueExpr) testExpr ifTrueExpr ifFalseExpr + None, (exprR, tyOfExpr g exprR) | ProvidedVarExpr providedVar -> let _, vTe = varToExpr (exprType.PApply((fun _ -> providedVar), m)) None, (vTe, tyOfExpr g vTe) | ProvidedConstantExpr (obj, prType) -> - let ce = convertConstExpr g amap m (exprType.PApply((fun _ -> (obj, prType)), m)) - None, (ce, tyOfExpr g ce) + let exprR = convertConstExpr g amap m (exprType.PApply((fun _ -> (obj, prType)), m)) + None, (exprR, tyOfExpr g exprR) | ProvidedNewTupleExpr info -> let elems = exprType.PApplyArray((fun _ -> info), "GetInvokerExpression", m) - let elemsT = elems |> Array.map exprToExpr |> Array.toList - let exprT = mkRefTupledNoTypes g m elemsT - None, (exprT, tyOfExpr g exprT) + let elemsR = elems |> Array.map exprToExpr |> Array.toList + let exprR = mkRefTupledNoTypes g m elemsR + None, (exprR, tyOfExpr g exprR) | ProvidedNewArrayExpr (ty, elems) -> let ty, elems = exprType.PApply2((fun _ -> (ty, elems)), m) - let tyT = Import.ImportProvidedType amap m ty + let tyR = Import.ImportProvidedType amap m ty let elems = elems.PApplyArray(id, "GetInvokerExpression", m) - let elemsT = elems |> Array.map exprToExpr |> Array.toList - let exprT = Expr.Op (TOp.Array, [tyT], elemsT, m) - None, (exprT, tyOfExpr g exprT) + let elemsR = elems |> Array.map exprToExpr |> Array.toList + let exprR = Expr.Op (TOp.Array, [tyR], elemsR, m) + None, (exprR, tyOfExpr g exprR) | ProvidedTupleGetExpr (inp, n) -> let inp, n = exprType.PApply2((fun _ -> (inp, n)), m) - let inpT = inp |> exprToExpr + let inpR = inp |> exprToExpr // if type of expression is erased type then we need convert it to the underlying base type - let typeOfExpr = - let t = tyOfExpr g inpT + let exprTy = + let t = tyOfExpr g inpR stripTyEqnsWrtErasure EraseMeasures g t - let tupInfo, tysT = tryDestAnyTupleTy g typeOfExpr - let exprT = mkTupleFieldGet g (tupInfo, inpT, tysT, n.PUntaint(id, m), m) - None, (exprT, tyOfExpr g exprT) + let tupInfo, tysT = tryDestAnyTupleTy g exprTy + let exprR = mkTupleFieldGet g (tupInfo, inpR, tysT, n.PUntaint(id, m), m) + None, (exprR, tyOfExpr g exprR) | ProvidedLambdaExpr (v, b) -> let v, b = exprType.PApply2((fun _ -> (v, b)), m) - let vT = addVar v - let bT = exprToExpr b + let vR = addVar v + let bR = exprToExpr b removeVar v - let exprT = mkLambda m vT (bT, tyOfExpr g bT) - None, (exprT, tyOfExpr g exprT) + let exprR = mkLambda m vR (bR, tyOfExpr g bR) + None, (exprR, tyOfExpr g exprR) | ProvidedLetExpr (v, e, b) -> let v, e, b = exprType.PApply3((fun _ -> (v, e, b)), m) - let eT = exprToExpr e - let vT = addVar v - let bT = exprToExpr b + let eR = exprToExpr e + let vR = addVar v + let bR = exprToExpr b removeVar v - let exprT = mkCompGenLet m vT eT bT - None, (exprT, tyOfExpr g exprT) + let exprR = mkCompGenLet m vR eR bR + None, (exprR, tyOfExpr g exprR) | ProvidedVarSetExpr (v, e) -> let v, e = exprType.PApply2((fun _ -> (v, e)), m) - let eT = exprToExpr e - let vTopt, _ = varToExpr v - match vTopt with + let eR = exprToExpr e + let vOptR, _ = varToExpr v + match vOptR with | None -> fail() - | Some vT -> - let exprT = mkValSet m (mkLocalValRef vT) eT - None, (exprT, tyOfExpr g exprT) + | Some vR -> + 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 guardExprT = exprToExpr guardExpr - let bodyExprT = exprToExpr bodyExpr - let exprT = mkWhile g (DebugPointAtWhile.No, SpecialWhileLoopMarker.NoSpecialWhileLoopMarker, guardExprT, bodyExprT, m) - None, (exprT, tyOfExpr g exprT) + let guardExprR = exprToExpr guardExpr + let bodyExprR = exprToExpr bodyExpr + let exprR = mkWhile g (DebugPointAtWhile.No, SpecialWhileLoopMarker.NoSpecialWhileLoopMarker, guardExprR, bodyExprR, m) + None, (exprR, tyOfExpr g exprR) | ProvidedForIntegerRangeLoopExpr (v, e1, e2, e3) -> let v, e1, e2, e3 = exprType.PApply4((fun _ -> (v, e1, e2, e3)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let vT = addVar v - let e3T = exprToExpr e3 + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let vR = addVar v + let e3R = exprToExpr e3 removeVar v - let exprT = mkFastForLoop g (DebugPointAtFor.No, DebugPointAtInOrTo.No, m, vT, e1T, true, e2T, e3T) - None, (exprT, tyOfExpr g exprT) + let exprR = mkFastForLoop g (DebugPointAtFor.No, DebugPointAtInOrTo.No, m, vR, e1R, true, e2R, e3R) + None, (exprR, tyOfExpr g exprR) | ProvidedNewDelegateExpr (delegateTy, boundVars, delegateBodyExpr) -> let delegateTy, boundVars, delegateBodyExpr = exprType.PApply3((fun _ -> (delegateTy, boundVars, delegateBodyExpr)), m) - let delegateTyT = Import.ImportProvidedType amap m delegateTy + let delegateTyR = Import.ImportProvidedType amap m delegateTy let vs = boundVars.PApplyArray(id, "GetInvokerExpression", m) |> Array.toList let vsT = List.map addVar vs - let delegateBodyExprT = exprToExpr delegateBodyExpr + let delegateBodyExprR = exprToExpr delegateBodyExpr List.iter removeVar vs - let lambdaExpr = mkLambdas g m [] vsT (delegateBodyExprT, tyOfExpr g delegateBodyExprT) + let lambdaExpr = mkLambdas g m [] vsT (delegateBodyExprR, tyOfExpr g delegateBodyExprR) let lambdaExprTy = tyOfExpr g lambdaExpr let infoReader = InfoReader(g, amap) - let exprT = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyT - None, (exprT, tyOfExpr g exprT) + let exprR = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyR + None, (exprR, tyOfExpr g exprR) #if PROVIDED_ADDRESS_OF | ProvidedAddressOfExpr e -> - let eT = exprToExpr (exprType.PApply((fun _ -> e), m)) - let wrap,ce, _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates eT None m - let ce = wrap ce - None, (ce, tyOfExpr g ce) + let eR = exprToExpr (exprType.PApply((fun _ -> e), m)) + let wrap,exprR, _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates eR None m + let exprR = wrap exprR + None, (exprR, tyOfExpr g exprR) #endif | ProvidedDefaultExpr pty -> let ty = Import.ImportProvidedType amap m (exprType.PApply((fun _ -> pty), m)) - let ce = mkDefault (m, ty) - None, (ce, tyOfExpr g ce) + let exprR = mkDefault (m, ty) + None, (exprR, tyOfExpr g exprR) | ProvidedCallExpr (e1, e2, e3) -> methodCallToExpr top ea (exprType.PApply((fun _ -> (e1, e2, e3)), m)) | ProvidedSequentialExpr (e1, e2) -> let e1, e2 = exprType.PApply2((fun _ -> (e1, e2)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let ce = mkCompGenSequential m e1T e2T - None, (ce, tyOfExpr g ce) + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let exprR = mkCompGenSequential m e1R e2R + None, (exprR, tyOfExpr g exprR) | ProvidedTryFinallyExpr (e1, e2) -> let e1, e2 = exprType.PApply2((fun _ -> (e1, e2)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let ce = mkTryFinally g (e1T, e2T, m, tyOfExpr g e1T, DebugPointAtTry.No, DebugPointAtFinally.No) - None, (ce, tyOfExpr g ce) + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let exprR = mkTryFinally g (e1R, e2R, m, tyOfExpr g e1R, DebugPointAtTry.No, DebugPointAtFinally.No) + None, (exprR, tyOfExpr g exprR) | ProvidedTryWithExpr (e1, e2, e3, e4, e5) -> let info = exprType.PApply((fun _ -> (e1, e2, e3, e4, e5)), m) - let bT = exprToExpr (info.PApply((fun (x, _, _, _, _) -> x), m)) + let bR = exprToExpr (info.PApply((fun (x, _, _, _, _) -> x), m)) let v1 = info.PApply((fun (_, x, _, _, _) -> x), m) - let v1T = addVar v1 - let e1T = exprToExpr (info.PApply((fun (_, _, x, _, _) -> x), m)) + let v1R = addVar v1 + let e1R = exprToExpr (info.PApply((fun (_, _, x, _, _) -> x), m)) removeVar v1 let v2 = info.PApply((fun (_, _, _, x, _) -> x), m) - let v2T = addVar v2 - let e2T = exprToExpr (info.PApply((fun (_, _, _, _, x) -> x), m)) + let v2R = addVar v2 + let e2R = exprToExpr (info.PApply((fun (_, _, _, _, x) -> x), m)) removeVar v2 - let ce = mkTryWith g (bT, v1T, e1T, v2T, e2T, m, tyOfExpr g bT, DebugPointAtTry.No, DebugPointAtWith.No) - None, (ce, tyOfExpr g ce) + let exprR = mkTryWith g (bR, v1R, e1R, v2R, e2R, m, tyOfExpr g bR, DebugPointAtTry.No, DebugPointAtWith.No) + None, (exprR, tyOfExpr g exprR) | ProvidedNewObjectExpr (e1, e2) -> None, ctorCallToExpr (exprType.PApply((fun _ -> (e1, e2)), m)) @@ -1955,10 +1956,10 @@ 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 tyT = Import.ImportProvidedType amap m (v.PApply ((fun v -> v.Type), m)) - let vT, vTe = if mut then mkMutableCompGenLocal m nm tyT else mkCompGenLocal m nm tyT - varConv[vRaw] <- (Some vT, vTe) - vT + let tyR = Import.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 and removeVar (v: Tainted) = let vRaw = v.PUntaint (id, m) diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 9d3e6c50153..7c5e9934a77 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -160,7 +160,7 @@ module DispatchSlotChecking = let belongsToReqdTy = match overrideBy.MemberInfo.Value.ImplementedSlotSigs with | [] -> false - | ss :: _ -> isInterfaceTy g ss.ImplementedType && typeEquiv g reqdTy ss.ImplementedType + | ss :: _ -> isInterfaceTy g ss.DeclaringType && typeEquiv g reqdTy ss.DeclaringType if belongsToReqdTy then CanImplementAnyInterfaceSlot else @@ -178,7 +178,7 @@ module DispatchSlotChecking = Override(implKind, overrideBy.MemberApparentEntity, mkSynId overrideBy.Range nm, memberMethodTypars, memberToParentInst, argTys, retTy, isFakeEventProperty, overrideBy.IsCompilerGenerated) /// Get the override information for an object expression method being used to implement dispatch slots - let GetObjectExprOverrideInfo g amap (implty, id: Ident, memberFlags, ty, arityInfo, bindingAttribs, rhsExpr) = + let GetObjectExprOverrideInfo g amap (implTy, id: Ident, memberFlags, ty, arityInfo, bindingAttribs, rhsExpr) = // Dissect the type. The '0' indicates there are no enclosing generic class type parameters relevant here. let tps, _, argInfos, retTy, _ = GetMemberTypeInMemberForm g memberFlags arityInfo 0 ty id.idRange let argTys = argInfos |> List.mapSquared fst @@ -192,13 +192,13 @@ module DispatchSlotChecking = // Check for empty variable list from a () arg let vs = if List.isSingleton vs && argInfos.IsEmpty then [] else vs let implKind = - if isInterfaceTy g implty then + if isInterfaceTy g implTy then CanImplementAnyInterfaceSlot else CanImplementAnyClassHierarchySlot //CanImplementAnySlot <<----- Change to this to enable implicit interface implementation let isFakeEventProperty = CompileAsEvent g bindingAttribs - let overrideByInfo = Override(implKind, tcrefOfAppTy g implty, id, tps, [], argTys, retTy, isFakeEventProperty, false) + let overrideByInfo = Override(implKind, tcrefOfAppTy g implTy, id, tps, [], argTys, retTy, isFakeEventProperty, false) overrideByInfo, (baseValOpt, thisv, vs, bindingAttribs, rhsExpr) | _ -> error(InternalError("Unexpected shape for object expression override", id.idRange)) @@ -749,7 +749,7 @@ module DispatchSlotChecking = let amap = infoReader.amap let tcaug = tycon.TypeContents - let interfaces = tycon.ImmediateInterfacesOfFSharpTycon |> List.map (fun (ity, _compgen, m) -> (ity, m)) + let interfaces = tycon.ImmediateInterfacesOfFSharpTycon |> List.map (fun (intfTy, _compgen, m) -> (intfTy, m)) let overallTy = generalizedTyconRef g (mkLocalTyconRef tycon) @@ -780,9 +780,9 @@ module DispatchSlotChecking = | [] -> // Are we looking at the implementation of the class hierarchy? If so include all the override members not (isInterfaceTy g reqdTy) - | ss -> - ss |> List.forall (fun ss -> - let ty = ss.ImplementedType + | slotSigs -> + slotSigs |> List.forall (fun slotSig -> + let ty = slotSig.DeclaringType if isInterfaceTy g ty then // Is this a method impl listed under the reqdTy? typeEquiv g ty reqdTy diff --git a/src/Compiler/Checking/MethodOverrides.fsi b/src/Compiler/Checking/MethodOverrides.fsi index e6091626469..b93b290f5d3 100644 --- a/src/Compiler/Checking/MethodOverrides.fsi +++ b/src/Compiler/Checking/MethodOverrides.fsi @@ -89,7 +89,7 @@ module DispatchSlotChecking = val GetObjectExprOverrideInfo: g: TcGlobals -> amap: ImportMap -> - implty: TType * + implTy: TType * id: Ident * memberFlags: SynMemberFlags * ty: TType * diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index d04f9d0929d..0f3daba1d0f 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -1420,10 +1420,10 @@ and AddModuleOrNamespaceContentsToNameEnv (g: TcGlobals) amap (ad: AccessorDomai and AddModuleOrNamespaceRefsContentsToNameEnv g amap ad m root nenv modrefs = (modrefs, nenv) ||> List.foldBack (fun modref acc -> AddModuleOrNamespaceRefContentsToNameEnv g amap ad m root acc modref) -and AddTypeContentsToNameEnv g amap ad m nenv (typ: TType) = - assert (isAppTy g typ) - assert not (tcrefOfAppTy g typ).IsModuleOrNamespace - AddStaticContentOfTypeToNameEnv g amap ad m nenv typ +and AddTypeContentsToNameEnv g amap ad m nenv (ty: TType) = + assert (isAppTy g ty) + assert not (tcrefOfAppTy g ty).IsModuleOrNamespace + AddStaticContentOfTypeToNameEnv g amap ad m nenv ty and AddModuleOrNamespaceRefContentsToNameEnv g amap ad m root nenv (modref: EntityRef) = assert modref.IsModuleOrNamespace @@ -2426,8 +2426,8 @@ let TryFindUnionCaseOfType g ty nm = ValueNone /// Try to find a union case of a type, with the given name -let TryFindAnonRecdFieldOfType g typ nm = - match tryDestAnonRecdTy g typ with +let TryFindAnonRecdFieldOfType g ty nm = + match tryDestAnonRecdTy g ty with | ValueSome (anonInfo, tys) -> match anonInfo.SortedIds |> Array.tryFindIndex (fun x -> x.idText = nm) with | Some i -> Some (Item.AnonRecdField(anonInfo, tys, i, anonInfo.SortedIds[i].idRange)) @@ -4113,7 +4113,7 @@ let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMet // e.g. .. for einfo in ncenv.InfoReader.GetEventInfosOfType(Some id, ad, m, ty) do - let einfoTy = PropTypOfEventInfo ncenv.InfoReader m ad einfo + let einfoTy = PropTypeOfEventInfo ncenv.InfoReader m ad einfo yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest einfoTy // nested types @@ -4811,7 +4811,7 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta // e.g. .. for einfo in ncenv.InfoReader.GetEventInfosOfType(Some id, ad, m, ty) do - let tyinfo = PropTypOfEventInfo ncenv.InfoReader m ad einfo + let tyinfo = PropTypeOfEventInfo ncenv.InfoReader m ad einfo yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item tyinfo // nested types! diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 6d8b38c7956..a07f000c7a7 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -497,7 +497,7 @@ module PrintTypes = | _ -> itemL /// Layout a reference to a type - let layoutTyconRef denv tycon = layoutTyconRefImpl false denv tycon + let layoutTyconRef denv tcref = layoutTyconRefImpl false denv tcref /// Layout the flags of a member let layoutMemberFlags (memFlags: SynMemberFlags) = @@ -546,8 +546,8 @@ module PrintTypes = | TypeDefOfExpr denv.g ty -> LeftL.keywordTypedefof ^^ wordL (tagPunctuation "<") ^^ layoutType denv ty ^^ rightL (tagPunctuation ">") - | Expr.Op (TOp.Coerce, [tgTy;_], [arg2], _) -> - leftL (tagPunctuation "(") ^^ layoutAttribArg denv arg2 ^^ wordL (tagPunctuation ":>") ^^ layoutType denv tgTy ^^ rightL (tagPunctuation ")") + | Expr.Op (TOp.Coerce, [tgtTy;_], [arg2], _) -> + leftL (tagPunctuation "(") ^^ layoutAttribArg denv arg2 ^^ wordL (tagPunctuation ":>") ^^ layoutType denv tgtTy ^^ rightL (tagPunctuation ")") | AttribBitwiseOrExpr denv.g (arg1, arg2) -> layoutAttribArg denv arg1 ^^ wordL (tagPunctuation "|||") ^^ layoutAttribArg denv arg2 @@ -726,8 +726,8 @@ module PrintTypes = and layoutConstraintWithInfo denv env (tp, tpc) = let longConstraintPrefix l = (layoutTyparRefWithInfo denv env tp |> addColonL) ^^ l match tpc with - | TyparConstraint.CoercesTo(tpct, _) -> - [layoutTyparRefWithInfo denv env tp ^^ wordL (tagOperator ":>") --- layoutTypeWithInfo denv env tpct] + | TyparConstraint.CoercesTo(tgtTy, _) -> + [layoutTyparRefWithInfo denv env tp ^^ wordL (tagOperator ":>") --- layoutTypeWithInfo denv env tgtTy] | TyparConstraint.MayResolveMember(traitInfo, _) -> [layoutTraitWithInfo denv env traitInfo] @@ -815,8 +815,8 @@ module PrintTypes = /// Layout a unit of measure expression and layoutMeasure denv unt = - let sortVars vs = vs |> List.sortBy (fun (v: Typar, _) -> v.DisplayName) - let sortCons cs = cs |> List.sortBy (fun (c: TyconRef, _) -> c.DisplayName) + let sortVars vs = vs |> List.sortBy (fun (tp: Typar, _) -> tp.DisplayName) + let sortCons cs = cs |> List.sortBy (fun (tcref: TyconRef, _) -> tcref.DisplayName) let negvs, posvs = ListMeasureVarOccsWithNonZeroExponents unt |> sortVars |> List.partition (fun (_, e) -> SignRational e < 0) let negcs, poscs = ListMeasureConOccsWithNonZeroExponents denv.g false unt |> sortCons |> List.partition (fun (_, e) -> SignRational e < 0) let unparL uv = layoutTyparRef denv uv @@ -832,14 +832,14 @@ module PrintTypes = | _ -> prefix ^^ sepL (tagPunctuation "/") ^^ (if List.length negvs + List.length negcs > 1 then sepL (tagPunctuation "(") ^^ postfix ^^ sepL (tagPunctuation ")") else postfix) /// Layout type arguments, either NAME or (ty, ..., ty) NAME *) - and layoutTypeAppWithInfoAndPrec denv env tcL prec prefix args = + and layoutTypeAppWithInfoAndPrec denv env tcL prec prefix argTys = if prefix then - match args with + match argTys with | [] -> tcL - | [arg] -> tcL ^^ sepL (tagPunctuation "<") ^^ (layoutTypeWithInfoAndPrec denv env 4 arg) ^^ rightL (tagPunctuation">") - | args -> bracketIfL (prec <= 1) (tcL ^^ angleL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args)) + | [argTy] -> tcL ^^ sepL (tagPunctuation "<") ^^ (layoutTypeWithInfoAndPrec denv env 4 argTy) ^^ rightL (tagPunctuation">") + | _ -> bracketIfL (prec <= 1) (tcL ^^ angleL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) argTys)) else - match args with + match argTys with | [] -> tcL | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) @@ -1050,8 +1050,8 @@ module PrintTypes = prettyTyparInst, niceMethodTypars, layout - let prettyLayoutOfMemberType denv v typarInst argInfos retTy = - match PartitionValRefTypars denv.g v with + let prettyLayoutOfMemberType denv vref typarInst argInfos retTy = + match PartitionValRefTypars denv.g vref with | Some(_, _, memberMethodTypars, memberToParentInst, _) -> prettyLayoutOfMemberSigCore denv memberToParentInst (typarInst, memberMethodTypars, argInfos, retTy) | None -> @@ -1123,14 +1123,14 @@ module PrintTypes = let ty, _cxs = PrettyTypes.PrettifyType denv.g ty layoutTypeWithInfoAndPrec denv SimplifyTypes.typeSimplificationInfo0 5 ty - let layoutOfValReturnType denv (v: ValRef) = - match v.ValReprInfo with + let layoutOfValReturnType denv (vref: ValRef) = + match vref.ValReprInfo with | None -> - let tau = v.TauType + let tau = vref.TauType let _argTysl, retTy = stripFunTy denv.g tau layoutReturnType denv SimplifyTypes.typeSimplificationInfo0 retTy | Some (ValReprInfo(_typars, argInfos, _retInfo)) -> - let tau = v.TauType + let tau = vref.TauType let _c, retTy = GetTopTauTypeInFSharpForm denv.g argInfos tau Range.range0 layoutReturnType denv SimplifyTypes.typeSimplificationInfo0 retTy @@ -1147,22 +1147,22 @@ module PrintTastMemberOrVals = else nameL - let layoutMemberName (denv: DisplayEnv) (v: ValRef) niceMethodTypars tagFunction name = - let nameL = ConvertValNameToDisplayLayout v.IsBaseVal (tagFunction >> mkNav v.DefinitionRange >> wordL) name + let layoutMemberName (denv: DisplayEnv) (vref: ValRef) niceMethodTypars tagFunction name = + let nameL = ConvertValNameToDisplayLayout vref.IsBaseVal (tagFunction >> mkNav vref.DefinitionRange >> wordL) name let nameL = if denv.showMemberContainers then - layoutTyconRef denv v.MemberApparentEntity ^^ SepL.dot ^^ nameL + layoutTyconRef denv vref.MemberApparentEntity ^^ SepL.dot ^^ nameL else nameL let nameL = if denv.showTyparBinding then layoutTyparDecls denv nameL true niceMethodTypars else nameL - let nameL = layoutAccessibility denv v.Accessibility nameL + let nameL = layoutAccessibility denv vref.Accessibility nameL nameL let prettyLayoutOfMemberShortOption denv typarInst (v: Val) short = - let v = mkLocalValRef v - let membInfo = Option.get v.MemberInfo + let vref = mkLocalValRef v + let membInfo = Option.get vref.MemberInfo let stat = layoutMemberFlags membInfo.MemberFlags - let _tps, argInfos, retTy, _ = GetTypeOfMemberInFSharpForm denv.g v + let _tps, argInfos, retTy, _ = GetTypeOfMemberInFSharpForm denv.g vref if short then for argInfo in argInfos do @@ -1173,22 +1173,22 @@ module PrintTastMemberOrVals = let prettyTyparInst, memberL = match membInfo.MemberFlags.MemberKind with | SynMemberKind.Member -> - let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then tauL else - let nameL = layoutMemberName denv v niceMethodTypars tagMember v.DisplayNameCoreMangled - let nameL = if short then nameL else mkInlineL denv v.Deref nameL + let nameL = layoutMemberName denv vref niceMethodTypars tagMember vref.DisplayNameCoreMangled + let nameL = if short then nameL else mkInlineL denv vref.Deref nameL stat --- ((nameL |> addColonL) ^^ tauL) prettyTyparInst, resL | SynMemberKind.ClassConstructor | SynMemberKind.Constructor -> - let prettyTyparInst, _, tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, _, tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then tauL else - let newL = layoutAccessibility denv v.Accessibility WordL.keywordNew + let newL = layoutAccessibility denv vref.Accessibility WordL.keywordNew stat ++ (newL |> addColonL) ^^ tauL prettyTyparInst, resL @@ -1198,8 +1198,8 @@ module PrintTastMemberOrVals = | SynMemberKind.PropertyGet -> if isNil argInfos then // use error recovery because intellisense on an incomplete file will show this - errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), v.Id.idRange)) - let nameL = layoutMemberName denv v [] tagProperty v.DisplayNameCoreMangled + errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), vref.Id.idRange)) + let nameL = layoutMemberName denv vref [] tagProperty vref.DisplayNameCoreMangled let resL = if short then nameL --- (WordL.keywordWith ^^ WordL.keywordGet) else stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordGet) @@ -1209,31 +1209,31 @@ module PrintTastMemberOrVals = match argInfos with | [[(ty, _)]] when isUnitTy denv.g ty -> [] | _ -> argInfos - let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ WordL.keywordGet) else - let nameL = layoutMemberName denv v niceMethodTypars tagProperty v.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars tagProperty vref.DisplayNameCoreMangled stat --- ((nameL |> addColonL) ^^ (if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ WordL.keywordGet))) prettyTyparInst, resL | SynMemberKind.PropertySet -> if argInfos.Length <> 1 || isNil argInfos.Head then // use error recovery because intellisense on an incomplete file will show this - errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), v.Id.idRange)) - let nameL = layoutMemberName denv v [] tagProperty v.DisplayNameCoreMangled + errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), vref.Id.idRange)) + let nameL = layoutMemberName denv vref [] tagProperty vref.DisplayNameCoreMangled let resL = stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordSet) emptyTyparInst, resL else let argInfos, valueInfo = List.frontAndBack argInfos.Head - let prettyTyparInst, niceMethodTypars, tauL = prettyLayoutOfMemberType denv v typarInst (if isNil argInfos then [] else [argInfos]) (fst valueInfo) + let prettyTyparInst, niceMethodTypars, tauL = prettyLayoutOfMemberType denv vref typarInst (if isNil argInfos then [] else [argInfos]) (fst valueInfo) let resL = if short then (tauL --- (WordL.keywordWith ^^ WordL.keywordSet)) else - let nameL = layoutMemberName denv v niceMethodTypars tagProperty v.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars tagProperty vref.DisplayNameCoreMangled stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ WordL.keywordSet))) prettyTyparInst, resL @@ -1730,23 +1730,23 @@ module TastDefinitionPrinting = typewordL ^^ tpsL - let sortKey (v: MethInfo) = - (not v.IsConstructor, - not v.IsInstance, // instance first - v.DisplayNameCore, // sort by name - List.sum v.NumArgs, // sort by #curried - v.NumArgs.Length) // sort by arity + let sortKey (minfo: MethInfo) = + (not minfo.IsConstructor, + not minfo.IsInstance, // instance first + minfo.DisplayNameCore, // sort by name + List.sum minfo.NumArgs, // sort by #curried + minfo.NumArgs.Length) // sort by arity - let shouldShow (valRef: ValRef option) = - match valRef with + let shouldShow (vrefOpt: ValRef option) = + match vrefOpt with | None -> true - | Some(vr) -> - (denv.showObsoleteMembers || not (CheckFSharpAttributesForObsolete denv.g vr.Attribs)) && - (denv.showHiddenMembers || not (CheckFSharpAttributesForHidden denv.g vr.Attribs)) + | Some vref -> + (denv.showObsoleteMembers || not (CheckFSharpAttributesForObsolete denv.g vref.Attribs)) && + (denv.showHiddenMembers || not (CheckFSharpAttributesForHidden denv.g vref.Attribs)) let ctors = GetIntrinsicConstructorInfosOfType infoReader m ty - |> List.filter (fun v -> IsMethInfoAccessible amap m ad v && not v.IsClassConstructor && shouldShow v.ArbitraryValRef) + |> List.filter (fun minfo -> IsMethInfoAccessible amap m ad minfo && not minfo.IsClassConstructor && shouldShow minfo.ArbitraryValRef) let iimpls = if suppressInheritanceAndInterfacesForTyInSimplifiedDisplays g amap m ty then @@ -1760,15 +1760,15 @@ module TastDefinitionPrinting = let iimplsLs = iimpls - |> List.map (fun ity -> wordL (tagKeyword (if isInterfaceTy g ty then "inherit" else "interface")) -* layoutType denv ity) + |> List.map (fun intfTy -> wordL (tagKeyword (if isInterfaceTy g ty then "inherit" else "interface")) -* layoutType denv intfTy) let props = GetImmediateIntrinsicPropInfosOfType (None, ad) g amap m ty - |> List.filter (fun v -> shouldShow v.ArbitraryValRef) + |> List.filter (fun pinfo -> shouldShow pinfo.ArbitraryValRef) let events = infoReader.GetEventInfosOfType(None, ad, m, ty) - |> List.filter (fun v -> shouldShow v.ArbitraryValRef && typeEquiv g ty v.ApparentEnclosingType) + |> List.filter (fun einfo -> shouldShow einfo.ArbitraryValRef && typeEquiv g ty einfo.ApparentEnclosingType) let impliedNames = try @@ -1883,8 +1883,8 @@ module TastDefinitionPrinting = let inherits = [ if not (suppressInheritanceAndInterfacesForTyInSimplifiedDisplays g amap m ty) then match GetSuperTypeOfType g amap m ty with - | Some super when not (isObjTy g super) && not (isValueTypeTy g super) -> - super + | Some superTy when not (isObjTy g superTy) && not (isValueTypeTy g superTy) -> + superTy | _ -> () ] @@ -2052,8 +2052,8 @@ module TastDefinitionPrinting = |> addLhs | TNoRepr when tycon.TypeAbbrev.IsSome -> - let abbreviatedType = tycon.TypeAbbrev.Value - (lhsL ^^ WordL.equals) -* (layoutType { denv with shortTypeNames = false } abbreviatedType) + let abbreviatedTy = tycon.TypeAbbrev.Value + (lhsL ^^ WordL.equals) -* (layoutType { denv with shortTypeNames = false } abbreviatedTy) | _ when isNil allDecls -> lhsL @@ -2386,8 +2386,8 @@ module PrintData = else layoutConst denv.g ty c - | Expr.Val (v, _, _) -> - wordL (tagLocal v.DisplayName) + | Expr.Val (vref, _, _) -> + wordL (tagLocal vref.DisplayName) | Expr.Link rX -> dataExprWrapL denv isAtomic rX.Value @@ -2435,21 +2435,28 @@ let outputValOrMember denv infoReader os x = x |> PrintTastMemberOrVals.prettyLa let stringValOrMember denv infoReader x = x |> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader |> showL /// Print members with a qualification showing the type they are contained in -let layoutQualifiedValOrMember denv infoReader typarInst v = PrintTastMemberOrVals.prettyLayoutOfValOrMember { denv with showMemberContainers=true; } infoReader typarInst v +let layoutQualifiedValOrMember denv infoReader typarInst vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMember { denv with showMemberContainers=true; } infoReader typarInst vref -let outputQualifiedValOrMember denv infoReader os v = outputValOrMember { denv with showMemberContainers=true; } infoReader os v +let outputQualifiedValOrMember denv infoReader os vref = + outputValOrMember { denv with showMemberContainers=true; } infoReader os vref -let outputQualifiedValSpec denv infoReader os v = outputQualifiedValOrMember denv infoReader os v +let outputQualifiedValSpec denv infoReader os vref = + outputQualifiedValOrMember denv infoReader os vref -let stringOfQualifiedValOrMember denv infoReader v = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst { denv with showMemberContainers=true; } infoReader v |> showL +let stringOfQualifiedValOrMember denv infoReader vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst { denv with showMemberContainers=true; } infoReader vref |> showL /// Convert a MethInfo to a string -let formatMethInfoToBufferFreeStyle infoReader m denv buf d = InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf d +let formatMethInfoToBufferFreeStyle infoReader m denv buf d = + InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf d -let prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo = InfoMemberPrinting.prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo +let prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo = + InfoMemberPrinting.prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo /// Convert a PropInfo to a string -let prettyLayoutOfPropInfoFreeStyle g amap m denv d = InfoMemberPrinting.prettyLayoutOfPropInfoFreeStyle g amap m denv d +let prettyLayoutOfPropInfoFreeStyle g amap m denv d = + InfoMemberPrinting.prettyLayoutOfPropInfoFreeStyle g amap m denv d /// Convert a MethInfo to a string let stringOfMethInfo infoReader m denv minfo = @@ -2509,13 +2516,15 @@ let stringOfILAttrib denv x = x |> PrintTypes.layoutILAttrib denv |> squareAngle let layoutImpliedSignatureOfModuleOrNamespace showHeader denv infoReader ad m contents = InferredSigPrinting.layoutImpliedSignatureOfModuleOrNamespace showHeader denv infoReader ad m contents -let prettyLayoutOfValOrMember denv infoReader typarInst v = PrintTastMemberOrVals.prettyLayoutOfValOrMember denv infoReader typarInst v +let prettyLayoutOfValOrMember denv infoReader typarInst vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMember denv infoReader typarInst vref -let prettyLayoutOfValOrMemberNoInst denv infoReader v = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader v +let prettyLayoutOfValOrMemberNoInst denv infoReader vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref let prettyLayoutOfMemberNoInstShort denv v = PrintTastMemberOrVals.prettyLayoutOfMemberNoInstShort denv v -let layoutOfValReturnType denv v = v |> PrintTypes.layoutOfValReturnType denv +let layoutOfValReturnType denv vref = vref |> PrintTypes.layoutOfValReturnType denv let prettyLayoutOfInstAndSig denv x = PrintTypes.prettyLayoutOfInstAndSig denv x @@ -2523,14 +2532,14 @@ let prettyLayoutOfInstAndSig denv x = PrintTypes.prettyLayoutOfInstAndSig denv x /// /// If the output text is different without showing constraints and/or imperative type variable /// annotations and/or fully qualifying paths then don't show them! -let minimalStringsOfTwoTypes denv t1 t2= - let (t1, t2), tpcs = PrettyTypes.PrettifyTypePair denv.g (t1, t2) +let minimalStringsOfTwoTypes denv ty1 ty2 = + let (ty1, ty2), tpcs = PrettyTypes.PrettifyTypePair denv.g (ty1, ty2) // try denv + no type annotations let attempt1 = let denv = { denv with showInferenceTyparAnnotations=false; showStaticallyResolvedTyparAnnotations=false } - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, "") else None match attempt1 with @@ -2540,8 +2549,8 @@ let minimalStringsOfTwoTypes denv t1 t2= // try denv + no type annotations + show full paths let attempt2 = let denv = { denv with showInferenceTyparAnnotations=false; showStaticallyResolvedTyparAnnotations=false }.SetOpenPaths [] - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, "") else None match attempt2 with @@ -2549,8 +2558,8 @@ let minimalStringsOfTwoTypes denv t1 t2= | None -> let attempt3 = - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, stringOfTyparConstraints denv tpcs) else None match attempt3 with @@ -2561,8 +2570,8 @@ let minimalStringsOfTwoTypes denv t1 t2= // try denv + show full paths + static parameters let denv = denv.SetOpenPaths [] let denv = { denv with includeStaticParametersInTypeNames=true } - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, stringOfTyparConstraints denv tpcs) else None match attempt4 with @@ -2576,19 +2585,19 @@ let minimalStringsOfTwoTypes denv t1 t2= let assemblyName = PrintTypes.layoutAssemblyName denv t |> function | null | "" -> "" | name -> sprintf " (%s)" name sprintf "%s%s" (stringOfTy denv t) assemblyName - (makeName t1, makeName t2, stringOfTyparConstraints denv tpcs) + (makeName ty1, makeName ty2, stringOfTyparConstraints denv tpcs) // Note: Always show imperative annotations when comparing value signatures -let minimalStringsOfTwoValues denv infoReader v1 v2= +let minimalStringsOfTwoValues denv infoReader vref1 vref2 = let denvMin = { denv with showInferenceTyparAnnotations=true; showStaticallyResolvedTyparAnnotations=false } - let min1 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf v1) - let min2 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf v2) + let min1 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf vref1) + let min2 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf vref2) if min1 <> min2 then (min1, min2) else let denvMax = { denv with showInferenceTyparAnnotations=true; showStaticallyResolvedTyparAnnotations=true } - let max1 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf v1) - let max2 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf v2) + let max1 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf vref1) + let max2 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf vref2) max1, max2 let minimalStringOfType denv ty = diff --git a/src/Compiler/Checking/NicePrint.fsi b/src/Compiler/Checking/NicePrint.fsi index c9df76a87a7..523202af9b9 100644 --- a/src/Compiler/Checking/NicePrint.fsi +++ b/src/Compiler/Checking/NicePrint.fsi @@ -54,14 +54,14 @@ val layoutQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInstantiation -> - v: ValRef -> + vref: ValRef -> TyparInstantiation * Layout -val outputQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit +val outputQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> vref: ValRef -> unit -val outputQualifiedValSpec: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit +val outputQualifiedValSpec: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> vref: ValRef -> unit -val stringOfQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> string +val stringOfQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> vref: ValRef -> string val formatMethInfoToBufferFreeStyle: infoReader: InfoReader -> m: range -> denv: DisplayEnv -> buf: StringBuilder -> d: MethInfo -> unit @@ -139,22 +139,23 @@ val prettyLayoutOfValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInstantiation -> - v: ValRef -> + vref: ValRef -> TyparInstantiation * Layout -val prettyLayoutOfValOrMemberNoInst: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> Layout +val prettyLayoutOfValOrMemberNoInst: denv: DisplayEnv -> infoReader: InfoReader -> vref: ValRef -> Layout val prettyLayoutOfMemberNoInstShort: denv: DisplayEnv -> v: Val -> Layout -val layoutOfValReturnType: denv: DisplayEnv -> v: ValRef -> Layout +val layoutOfValReturnType: denv: DisplayEnv -> vref: ValRef -> Layout val prettyLayoutOfInstAndSig: denv: DisplayEnv -> TyparInstantiation * TTypes * TType -> TyparInstantiation * (TTypes * TType) * (Layout list * Layout) * Layout -val minimalStringsOfTwoTypes: denv: DisplayEnv -> t1: TType -> t2: TType -> string * string * string +val minimalStringsOfTwoTypes: denv: DisplayEnv -> ty1: TType -> ty2: TType -> string * string * string -val minimalStringsOfTwoValues: denv: DisplayEnv -> infoReader: InfoReader -> v1: ValRef -> v2: ValRef -> string * string +val minimalStringsOfTwoValues: + denv: DisplayEnv -> infoReader: InfoReader -> vref1: ValRef -> vref2: ValRef -> string * string val minimalStringOfType: denv: DisplayEnv -> ty: TType -> string diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index c38f65e307e..ec5c5488f81 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -312,8 +312,8 @@ let RefuteDiscrimSet g m path discrims = raise CannotRefute go path tm -let rec CombineRefutations g r1 r2 = - match r1, r2 with +let rec CombineRefutations g refutation1 refutation2 = + match refutation1, refutation2 with | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = "_" -> other | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = notNullText -> other | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = otherSubtypeText -> other @@ -326,9 +326,9 @@ let rec CombineRefutations g r1 r2 = Expr.Op (op1, tinst1, List.map2 (CombineRefutations g) flds1 flds2, m1) (* Choose the greater of the two ucrefs based on name ordering *) elif ucref1.CaseName < ucref2.CaseName then - r2 + refutation2 else - r1 + refutation1 | Expr.Op (op1, tinst1, flds1, m1), Expr.Op (_, _, flds2, _) -> Expr.Op (op1, tinst1, List.map2 (CombineRefutations g) flds1 flds2, m1) @@ -352,7 +352,7 @@ let rec CombineRefutations g r1 r2 = Expr.Const (c12, m1, ty1) - | _ -> r1 + | _ -> refutation1 let ShowCounterExample g denv m refuted = try @@ -592,8 +592,8 @@ let getDiscrimOfPattern (g: TcGlobals) tpinst t = match t with | TPat_null _m -> Some(DecisionTreeTest.IsNull) - | TPat_isinst (srcty, tgty, _, _m) -> - Some(DecisionTreeTest.IsInst (instType tpinst srcty, instType tpinst tgty)) + | TPat_isinst (srcTy, tgtTy, _, _m) -> + Some(DecisionTreeTest.IsInst (instType tpinst srcTy, instType tpinst tgtTy)) | TPat_exnconstr(tcref, _, _m) -> Some(DecisionTreeTest.IsInst (g.exn_ty, mkAppTy tcref [])) | TPat_const (c, _m) -> @@ -624,7 +624,7 @@ let discrimsEq (g: TcGlobals) d1 d2 = | DecisionTreeTest.ArrayLength (n1, _), DecisionTreeTest.ArrayLength(n2, _) -> (n1=n2) | DecisionTreeTest.Const c1, DecisionTreeTest.Const c2 -> (c1=c2) | DecisionTreeTest.IsNull, DecisionTreeTest.IsNull -> true - | DecisionTreeTest.IsInst (srcty1, tgty1), DecisionTreeTest.IsInst (srcty2, tgty2) -> typeEquiv g srcty1 srcty2 && typeEquiv g tgty1 tgty2 + | DecisionTreeTest.IsInst (srcTy1, tgtTy1), DecisionTreeTest.IsInst (srcTy2, tgtTy2) -> typeEquiv g srcTy1 srcTy2 && typeEquiv g tgtTy1 tgtTy2 | DecisionTreeTest.ActivePatternCase (_, _, _, vrefOpt1, n1, _), DecisionTreeTest.ActivePatternCase (_, _, _, vrefOpt2, n2, _) -> match vrefOpt1, vrefOpt2 with | Some (vref1, tinst1), Some (vref2, tinst2) -> valRefEq g vref1 vref2 && n1 = n2 && not (doesActivePatternHaveFreeTypars g vref1) && List.lengthsEqAndForall2 (typeEquiv g) tinst1 tinst2 @@ -1213,15 +1213,15 @@ let CompilePatternBasic // This is really an optimization that could be done more effectively in opt.fs // if we flowed a bit of information through - | [EdgeDiscrim(_i', DecisionTreeTest.IsInst (_srcty, tgty), m)] + | [EdgeDiscrim(_i', DecisionTreeTest.IsInst (_srcTy, tgtTy), m)] // check we can use a simple 'isinst' instruction - when isRefTy g tgty && canUseTypeTestFast g tgty && isNil origInputValTypars -> + when isRefTy g tgtTy && canUseTypeTestFast g tgtTy && isNil origInputValTypars -> - let v, vExpr = mkCompGenLocal m "typeTestResult" tgty + let v, vExpr = mkCompGenLocal m "typeTestResult" tgtTy if origInputVal.IsMemberOrModuleBinding then AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData let argExpr = GetSubExprOfInput subexpr - let appExpr = mkIsInst tgty argExpr mMatch + let appExpr = mkIsInst tgtTy argExpr mMatch Some vExpr, Some(mkInvisibleBind v appExpr) // Any match on a struct union must take the address of its input. diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 1459fc99984..d8bca9c223c 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -416,8 +416,8 @@ and CheckTypeConstraintDeep cenv f g env x = | TyparConstraint.MayResolveMember(traitInfo, _) -> CheckTraitInfoDeep cenv f g env traitInfo | TyparConstraint.DefaultsTo(_, ty, _) -> CheckTypeDeep cenv f g env true ty | TyparConstraint.SimpleChoice(tys, _) -> CheckTypesDeep cenv f g env tys - | TyparConstraint.IsEnum(uty, _) -> CheckTypeDeep cenv f g env true uty - | TyparConstraint.IsDelegate(aty, bty, _) -> CheckTypeDeep cenv f g env true aty; CheckTypeDeep cenv f g env true bty + | TyparConstraint.IsEnum(underlyingTy, _) -> CheckTypeDeep cenv f g env true underlyingTy + | TyparConstraint.IsDelegate(argTys, retTy, _) -> CheckTypeDeep cenv f g env true argTys; CheckTypeDeep cenv f g env true retTy | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -717,39 +717,42 @@ type TTypeEquality = | FeasiblyEqual | NotEqual -let compareTypesWithRegardToTypeVariablesAndMeasures g amap m typ1 typ2 = +let compareTypesWithRegardToTypeVariablesAndMeasures g amap m ty1 ty2 = - if (typeEquiv g typ1 typ2) then + if (typeEquiv g ty1 ty2) then ExactlyEqual else - if (typeEquiv g typ1 typ2 || TypesFeasiblyEquivStripMeasures g amap m typ1 typ2) then + if (typeEquiv g ty1 ty2 || TypesFeasiblyEquivStripMeasures g amap m ty1 ty2) then FeasiblyEqual else NotEqual -let CheckMultipleInterfaceInstantiations cenv (typ:TType) (interfaces:TType list) isObjectExpression m = - let keyf ty = assert isAppTy cenv.g ty; (tcrefOfAppTy cenv.g ty).Stamp - let groups = interfaces |> List.groupBy keyf +let keyTyByStamp g ty = + assert isAppTy g ty + (tcrefOfAppTy g ty).Stamp + +let CheckMultipleInterfaceInstantiations cenv (ty:TType) (interfaces:TType list) isObjectExpression m = + let groups = interfaces |> List.groupBy (keyTyByStamp cenv.g) let errors = seq { for _, items in groups do for i1 in 0 .. items.Length - 1 do for i2 in i1 + 1 .. items.Length - 1 do - let typ1 = items[i1] - let typ2 = items[i2] - let tcRef1 = tcrefOfAppTy cenv.g typ1 - match compareTypesWithRegardToTypeVariablesAndMeasures cenv.g cenv.amap m typ1 typ2 with + let ty1 = items[i1] + let ty2 = items[i2] + let tcRef1 = tcrefOfAppTy cenv.g ty1 + match compareTypesWithRegardToTypeVariablesAndMeasures cenv.g cenv.amap m ty1 ty2 with | ExactlyEqual -> () | FeasiblyEqual -> match tryLanguageFeatureErrorOption cenv.g.langVersion LanguageFeature.InterfacesWithMultipleGenericInstantiation m with | None -> () | Some exn -> exn - let typ1Str = NicePrint.minimalStringOfType cenv.denv typ1 - let typ2Str = NicePrint.minimalStringOfType cenv.denv typ2 + let typ1Str = NicePrint.minimalStringOfType cenv.denv ty1 + let typ2Str = NicePrint.minimalStringOfType cenv.denv ty2 if isObjectExpression then Error(FSComp.SR.typrelInterfaceWithConcreteAndVariableObjectExpression(tcRef1.DisplayNameWithStaticParametersAndUnderscoreTypars, typ1Str, typ2Str),m) else - let typStr = NicePrint.minimalStringOfType cenv.denv typ + let typStr = NicePrint.minimalStringOfType cenv.denv ty Error(FSComp.SR.typrelInterfaceWithConcreteAndVariable(typStr, tcRef1.DisplayNameWithStaticParametersAndUnderscoreTypars, typ1Str, typ2Str),m) | NotEqual -> @@ -1575,8 +1578,8 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) NoLimit - | TOp.Coerce, [tgty;srcty], [x] -> - if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then + | TOp.Coerce, [tgtTy;srcTy], [x] -> + if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy then CheckExpr cenv env x ctxt else CheckTypeInstNoByrefs cenv env m tyargs @@ -2279,8 +2282,8 @@ let CheckEntityDefn cenv env (tycon: Entity) = let allVirtualMethsInParent = match GetSuperTypeOfType g cenv.amap m ty with - | Some super -> - GetIntrinsicMethInfosOfType cenv.infoReader None AccessibleFromSomewhere AllowMultiIntfInstantiations.Yes IgnoreOverrides m super + | Some superTy -> + GetIntrinsicMethInfosOfType cenv.infoReader None AccessibleFromSomewhere AllowMultiIntfInstantiations.Yes IgnoreOverrides m superTy |> List.filter (fun minfo -> minfo.IsVirtual) | None -> [] diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index 044ff283f0b..089de7b4a7f 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -172,7 +172,7 @@ let (|ModuleValueOrMemberUse|_|) g expr = match stripExpr expr with | Expr.App (InnerExprPat(Expr.Val (vref, vFlags, _) as f), fty, tyargs, actualArgs, _m) when vref.IsMemberOrModuleBinding -> Some(vref, vFlags, f, fty, tyargs, actualArgs @ args) - | Expr.App (f, _fty, [], actualArgs, _) -> + | Expr.App (f, _fTy, [], actualArgs, _) -> loop f (actualArgs @ args) | Expr.Val (vref, vFlags, _m) as f when (match vref.DeclaringEntity with ParentNone -> false | _ -> true) -> let fty = tyOfExpr g f @@ -292,8 +292,8 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // Recognize applications of module functions. match expr with // Detect expression tree exprSplices - | Expr.App (InnerExprPat(Expr.Val (vf, _, _)), _, _, x0 :: rest, m) - when isSplice g vf -> + | Expr.App (InnerExprPat(Expr.Val (vref, _, _)), _, _, x0 :: rest, m) + when isSplice g vref -> let idx = cenv.exprSplices.Count let ty = tyOfExpr g expr @@ -305,7 +305,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let hole = QP.mkHole(ConvType cenv env m ty, idx) (hole, rest) ||> List.fold (fun fR arg -> QP.mkApp (fR, ConvExpr cenv env arg)) - | ModuleValueOrMemberUse g (vref, vFlags, _f, _fty, tyargs, curriedArgs) + | ModuleValueOrMemberUse g (vref, vFlags, _f, _fTy, tyargs, curriedArgs) when not (isSplice g vref) -> let m = expr.Range @@ -419,16 +419,16 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. List.fold (fun fR arg -> QP.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) -> - let rfty = applyForallTy g fty tyargs - ConvExpr cenv env (primMkApp (primMkApp (f, fty) tyargs [] m, rfty) [] args m) + | Expr.App (f, fTy, (_ :: _ as tyargs), (_ :: _ as args), m) -> + let reducedTy = applyForallTy g fTy tyargs + ConvExpr cenv env (primMkApp (primMkApp (f, fTy) tyargs [] m, reducedTy) [] args m) // Uses of possibly-polymorphic values - | Expr.App (InnerExprPat(Expr.Val (vref, _vFlags, m)), _fty, tyargs, [], _) -> + | Expr.App (InnerExprPat(Expr.Val (vref, _vFlags, m)), _fTy, tyargs, [], _) -> ConvValRef true cenv env m vref tyargs // Simple applications - | Expr.App (f, _fty, tyargs, args, m) -> + | 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 @@ -828,12 +828,12 @@ and ConvLValueExprCore cenv env expr = | TOp.UnionCaseFieldGetAddr (ucref, n, _), [e], _ -> ConvUnionFieldGet cenv env m ucref n tyargs e | TOp.ILAsm ([ I_ldflda(fspec) ], _), _, _ -> ConvLdfld cenv env m fspec tyargs args | TOp.ILAsm ([ I_ldsflda(fspec) ], _), _, _ -> ConvLdfld cenv env m fspec tyargs args - | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemty] -> + | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemTy] -> match shape.Rank, idxs with - | 1, [idx1] -> ConvExpr cenv env (mkCallArrayGet cenv.g m elemty arr idx1) - | 2, [idx1; idx2] -> ConvExpr cenv env (mkCallArray2DGet cenv.g m elemty arr idx1 idx2) - | 3, [idx1; idx2; idx3] -> ConvExpr cenv env (mkCallArray3DGet cenv.g m elemty arr idx1 idx2 idx3) - | 4, [idx1; idx2; idx3; idx4] -> ConvExpr cenv env (mkCallArray4DGet cenv.g m elemty arr idx1 idx2 idx3 idx4) + | 1, [idx1] -> ConvExpr cenv env (mkCallArrayGet cenv.g m elemTy arr idx1) + | 2, [idx1; idx2] -> ConvExpr cenv env (mkCallArray2DGet cenv.g m elemTy arr idx1 idx2) + | 3, [idx1; idx2; idx3] -> ConvExpr cenv env (mkCallArray3DGet cenv.g m elemTy arr idx1 idx2 idx3) + | 4, [idx1; idx2; idx3; idx4] -> ConvExpr cenv env (mkCallArray4DGet cenv.g m elemTy arr idx1 idx2 idx3 idx4) | _ -> ConvExpr cenv env expr | _ -> ConvExpr cenv env expr | _ -> ConvExpr cenv env expr @@ -937,15 +937,15 @@ and private ConvValRefCore holeOk cenv env m (vref: ValRef) tyargs = elif v.IsCtorThisVal && cenv.isReflectedDefinition = IsReflectedDefinition.Yes then QP.mkThisVar(ConvType cenv env m v.Type) else - let vty = v.Type + let vTy = v.Type match v.DeclaringEntity with | ParentNone -> // References to local values are embedded by value if not holeOk then wfail(Error(FSComp.SR.crefNoSetOfHole(), m)) let idx = cenv.exprSplices.Count - let liftExpr = mkCallLiftValueWithName cenv.g m vty v.LogicalName (exprForValRef m vref) + 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) + QP.mkHole(ConvType cenv env m vTy, idx) | Parent _ -> // First-class use or use of type function @@ -1106,9 +1106,9 @@ and ConvDecisionTree cenv env tgs typR x = let eqR = ConvExpr cenv env eq QP.mkCond (eqR, ConvDecisionTree cenv env tgs typR dtree, acc) - | DecisionTreeTest.IsInst (_srcty, tgty) -> + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> let e1R = ConvExpr cenv env e1 - QP.mkCond (QP.mkTypeTest (ConvType cenv env m tgty, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) + QP.mkCond (QP.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)) diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index f9d9b41b871..4a689f48a0c 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -187,26 +187,26 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = else let aenv = aenv.BindEquivTypars implTypars sigTypars - let aintfs = implTycon.ImmediateInterfaceTypesOfFSharpTycon - let fintfs = sigTycon.ImmediateInterfaceTypesOfFSharpTycon - let aintfsUser = implTycon.TypeContents.tcaug_interfaces |> List.filter (fun (_, compgen, _) -> not compgen) |> List.map p13 + let implIntfTys = implTycon.ImmediateInterfaceTypesOfFSharpTycon + let sigIntfTys = sigTycon.ImmediateInterfaceTypesOfFSharpTycon + let implUserIntfTys = implTycon.TypeContents.tcaug_interfaces |> List.filter (fun (_, compgen, _) -> not compgen) |> List.map p13 let flatten tys = tys |> List.collect (AllSuperTypesOfType g amap m AllowMultiIntfInstantiations.Yes) |> ListSet.setify (typeEquiv g) |> List.filter (isInterfaceTy g) - let aintfs = flatten aintfs - let fintfs = flatten fintfs + let implIntfTys = flatten implIntfTys + let sigIntfTys = flatten sigIntfTys - let unimpl = ListSet.subtract (fun fity aity -> typeAEquiv g aenv aity fity) fintfs aintfs - (unimpl + let unimplIntfTys = ListSet.subtract (fun sigIntfTy implIntfTy -> typeAEquiv g aenv implIntfTy sigIntfTy) sigIntfTys implIntfTys + (unimplIntfTys |> List.forall (fun ity -> let errorMessage = FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, NicePrint.minimalStringOfType denv ity) errorR (Error(errorMessage, m)); false)) && - let aintfsUser = flatten aintfsUser + let implUserIntfTys = flatten implUserIntfTys - let hidden = ListSet.subtract (typeAEquiv g aenv) aintfsUser fintfs + let hidden = ListSet.subtract (typeAEquiv g aenv) implUserIntfTys sigIntfTys let continueChecks, warningOrError = if implTycon.IsFSharpInterfaceTycon then false, errorR else true, warning (hidden |> List.forall (fun ity -> warningOrError (InterfaceNotRevealed(denv, ity, implTycon.Range)); continueChecks)) && @@ -328,12 +328,12 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = elif implVal.LiteralValue <> sigVal.LiteralValue then (err denv FSComp.SR.ValueNotContainedMutabilityLiteralConstantValuesDiffer) elif implVal.IsTypeFunction <> sigVal.IsTypeFunction then (err denv FSComp.SR.ValueNotContainedMutabilityOneIsTypeFunction) else - let implTypars, atau = implVal.GeneralizedType - let sigTypars, ftau = sigVal.GeneralizedType + let implTypars, implValTy = implVal.GeneralizedType + let sigTypars, sigValTy = sigVal.GeneralizedType if implTypars.Length <> sigTypars.Length then (err {denv with showTyparBinding=true} FSComp.SR.ValueNotContainedMutabilityParameterCountsDiffer) else let aenv = aenv.BindEquivTypars implTypars sigTypars checkTypars m aenv implTypars sigTypars && - if not (typeAEquiv g aenv atau ftau) then err denv FSComp.SR.ValueNotContainedMutabilityTypesDiffer + if not (typeAEquiv g aenv implValTy sigValTy) then err denv FSComp.SR.ValueNotContainedMutabilityTypesDiffer elif not (checkValInfo aenv (err denv) implVal sigVal) then false elif not (implVal.IsExtensionMember = sigVal.IsExtensionMember) then err denv FSComp.SR.ValueNotContainedMutabilityExtensionsDiffer elif not (checkMemberDatasConform (err denv) (implVal.Attribs, implVal, implVal.MemberInfo) (sigVal.Attribs, sigVal, sigVal.MemberInfo)) then false diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index 12572e87d10..fe44b9cf874 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -92,8 +92,8 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) match metadataOfTy g ty with #if !NO_TYPEPROVIDERS | ProvidedTypeMetadata info -> - for ity in info.ProvidedType.PApplyArray((fun st -> st.GetInterfaces()), "GetInterfaces", m) do - ImportProvidedType amap m ity + for intfTy in info.ProvidedType.PApplyArray((fun st -> st.GetInterfaces()), "GetInterfaces", m) do + ImportProvidedType amap m intfTy #endif | ILTypeMetadata (TILObjectReprData(scoref, _, tdef)) -> // ImportILType may fail for an interface if the assembly load set is incomplete and the interface @@ -103,12 +103,12 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) // succeeded with more reported. There are pathological corner cases where this // doesn't apply: e.g. for mscorlib interfaces like IComparable, but we can always // assume those are present. - for ity in tdef.Implements do - if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m ity then - RescopeAndImportILType scoref amap m tinst ity + for intfTy in tdef.Implements do + if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m intfTy then + RescopeAndImportILType scoref amap m tinst intfTy | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - for ity in tcref.ImmediateInterfaceTypesOfFSharpTycon do - instType (mkInstForAppTy g ty) ity ] + for intfTy in tcref.ImmediateInterfaceTypesOfFSharpTycon do + instType (mkInstForAppTy g ty) intfTy ] /// Collect the set of immediate declared interface types for an F# type, but do not /// traverse the type hierarchy to collect further interfaces. @@ -163,10 +163,10 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m ty = and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = [ // Report any interfaces that don't derive from IComparable<_> or IEquatable<_> - for ity in GetImmediateInterfacesOfType skipUnref g amap m reprTy do - if not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIComparable_tcref skipUnref g amap m ity) && - not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m ity) then - ity + for intfTy in GetImmediateInterfacesOfType skipUnref g amap m reprTy do + if not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIComparable_tcref skipUnref g amap m intfTy) && + not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m intfTy) then + intfTy // NOTE: we should really only report the IComparable> interface for measure-annotated types // if the original type supports IComparable somewhere in the hierarchy, likeiwse IEquatable>. @@ -181,15 +181,15 @@ and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = ] // Check for IComparable, IEquatable and interfaces that derive from these -and ExistsHeadTypeInInterfaceHierarchy target skipUnref g amap m ity = - ExistsInInterfaceHierarchy (function AppTy g (tcref,_) -> tyconRefEq g tcref target | _ -> false) skipUnref g amap m ity +and ExistsHeadTypeInInterfaceHierarchy target skipUnref g amap m intfTy = + ExistsInInterfaceHierarchy (function AppTy g (tcref,_) -> tyconRefEq g tcref target | _ -> false) skipUnref g amap m intfTy // Check for IComparable, IEquatable and interfaces that derive from these -and ExistsInInterfaceHierarchy p skipUnref g amap m ity = - match ity with +and ExistsInInterfaceHierarchy p skipUnref g amap m intfTy = + match intfTy with | AppTy g (tcref, tinst) -> - p ity || - (GetImmediateInterfacesOfMetadataType g amap m skipUnref ity tcref tinst + p intfTy || + (GetImmediateInterfacesOfMetadataType g amap m skipUnref intfTy tcref tinst |> List.exists (ExistsInInterfaceHierarchy p skipUnref g amap m)) | _ -> false @@ -369,14 +369,14 @@ let CopyTyparConstraints m tprefInst (tporig: Typar) = TyparConstraint.DefaultsTo (priority, instType tprefInst ty, m) | TyparConstraint.SupportsNull _ -> TyparConstraint.SupportsNull m - | TyparConstraint.IsEnum (uty, _) -> - TyparConstraint.IsEnum (instType tprefInst uty, m) + | TyparConstraint.IsEnum (underlyingTy, _) -> + TyparConstraint.IsEnum (instType tprefInst underlyingTy, m) | TyparConstraint.SupportsComparison _ -> TyparConstraint.SupportsComparison m | TyparConstraint.SupportsEquality _ -> TyparConstraint.SupportsEquality m - | TyparConstraint.IsDelegate(aty, bty, _) -> - TyparConstraint.IsDelegate (instType tprefInst aty, instType tprefInst bty, m) + | TyparConstraint.IsDelegate(argTys, retTy, _) -> + TyparConstraint.IsDelegate (instType tprefInst argTys, instType tprefInst retTy, m) | TyparConstraint.IsNonNullableStruct _ -> TyparConstraint.IsNonNullableStruct m | TyparConstraint.IsUnmanaged _ -> diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index b0951fd9a79..d714e1b1a60 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -46,24 +46,25 @@ let rec TypeDefinitelySubsumesTypeNoCoercion ndeep g amap m ty1 ty2 = type CanCoerce = CanCoerce | NoCoerce +let stripAll stripMeasures g ty = + if stripMeasures then + ty |> stripTyEqnsWrtErasure EraseAll g |> stripMeasuresFromTy g + else + ty |> stripTyEqns g + /// The feasible equivalence relation. Part of the language spec. let rec TypesFeasiblyEquivalent stripMeasures ndeep g amap m ty1 ty2 = if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = " + (DebugPrint.showType ty1), m)); - let stripAll ty = - if stripMeasures then - ty |> stripTyEqnsWrtErasure EraseAll g |> stripMeasuresFromTType g - else - ty |> stripTyEqns g - let ty1str = stripAll ty1 - let ty2str = stripAll ty2 + let ty1 = stripAll stripMeasures g ty1 + let ty2 = stripAll stripMeasures g ty2 - match ty1str, ty2str with + match ty1, ty2 with | TType_var _, _ | _, TType_var _ -> true - | TType_app (tc1, l1, _), TType_app (tc2, l2, _) when tyconRefEq g tc1 tc2 -> + | TType_app (tcref1, l1, _), TType_app (tcref2, l2, _) when tyconRefEq g tcref1 tcref2 -> List.lengthsEqAndForall2 (TypesFeasiblyEquivalent stripMeasures ndeep g amap m) l1 l2 | TType_anon (anonInfo1, l1),TType_anon (anonInfo2, l2) -> @@ -76,9 +77,9 @@ let rec TypesFeasiblyEquivalent stripMeasures ndeep g amap m ty1 ty2 = evalTupInfoIsStruct tupInfo1 = evalTupInfoIsStruct tupInfo2 && List.lengthsEqAndForall2 (TypesFeasiblyEquivalent stripMeasures ndeep g amap m) l1 l2 - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - TypesFeasiblyEquivalent stripMeasures ndeep g amap m d1 d2 && - TypesFeasiblyEquivalent stripMeasures ndeep g amap m r1 r2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + TypesFeasiblyEquivalent stripMeasures ndeep g amap m domainTy1 domainTy2 && + TypesFeasiblyEquivalent stripMeasures ndeep g amap m rangeTy1 rangeTy2 | TType_measure _, TType_measure _ -> true @@ -133,51 +134,51 @@ let rec TypeFeasiblySubsumesType ndeep g amap m ty1 canCoerce ty2 = /// Here x gets a generalized type "list<'T>". let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) = let m = tp.Range - let max, m = - let initial = + let maxTy, m = + let initialTy = match tp.Kind with | TyparKind.Type -> g.obj_ty | TyparKind.Measure -> TType_measure Measure.One // Loop through the constraints computing the lub - ((initial, m), tp.Constraints) ||> List.fold (fun (maxSoFar, _) tpc -> + ((initialTy, m), tp.Constraints) ||> List.fold (fun (maxTy, _) tpc -> let join m x = - if TypeFeasiblySubsumesType 0 g amap m x CanCoerce maxSoFar then maxSoFar - elif TypeFeasiblySubsumesType 0 g amap m maxSoFar CanCoerce x then x - else errorR(Error(FSComp.SR.typrelCannotResolveImplicitGenericInstantiation((DebugPrint.showType x), (DebugPrint.showType maxSoFar)), m)); maxSoFar + if TypeFeasiblySubsumesType 0 g amap m x CanCoerce maxTy then maxTy + elif TypeFeasiblySubsumesType 0 g amap m maxTy CanCoerce x then x + else errorR(Error(FSComp.SR.typrelCannotResolveImplicitGenericInstantiation((DebugPrint.showType x), (DebugPrint.showType maxTy)), m)); maxTy // Don't continue if an error occurred and we set the value eagerly - if tp.IsSolved then maxSoFar, m else + if tp.IsSolved then maxTy, m else match tpc with | TyparConstraint.CoercesTo(x, m) -> join m x, m | TyparConstraint.MayResolveMember(_traitInfo, m) -> - maxSoFar, m + maxTy, m | TyparConstraint.SimpleChoice(_, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInPrintf(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.SupportsNull m -> - maxSoFar, m + maxTy, m | TyparConstraint.SupportsComparison m -> join m g.mk_IComparable_ty, m | TyparConstraint.SupportsEquality m -> - maxSoFar, m + maxTy, m | TyparConstraint.IsEnum(_, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInEnum(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.IsDelegate(_, _, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInDelegate(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.IsNonNullableStruct m -> join m g.int_ty, m | TyparConstraint.IsUnmanaged m -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInUnmanaged(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.RequiresDefaultConstructor m -> - maxSoFar, m + maxTy, m | TyparConstraint.IsReferenceType m -> - maxSoFar, m + maxTy, m | TyparConstraint.DefaultsTo(_priority, _ty, m) -> - maxSoFar, m) - max, m + maxTy, m) + maxTy, m let ChooseTyparSolution g amap tp = let ty, _m = ChooseTyparSolutionAndRange g amap tp @@ -249,11 +250,11 @@ let tryDestTopLambda g amap (ValReprInfo (tpNames, _, _) as tvd) (e, ty) = (None, None, [], e, ty) let n = tvd.NumCurriedArgs - let tps, taue, tauty = + let tps, bodyExpr, bodyTy = match stripDebugPoints e with | Expr.TyLambda (_, tps, b, _, retTy) when not (isNil tpNames) -> tps, b, retTy | _ -> [], e, ty - let ctorThisValOpt, baseValOpt, vsl, body, retTy = startStripLambdaUpto n (taue, tauty) + let ctorThisValOpt, baseValOpt, vsl, body, retTy = startStripLambdaUpto n (bodyExpr, bodyTy) if vsl.Length <> n then None else diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index ea3dc9dbb9a..cca134f4d38 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -174,8 +174,8 @@ let rec ImportILType (env: ImportMap) m tinst ty = | ILType.Array(bounds, ty) -> let n = bounds.Rank - let elementType = ImportILType env m tinst ty - mkArrayTy env.g n elementType m + let elemTy = ImportILType env m tinst ty + mkArrayTy env.g n elemTy m | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef @@ -335,10 +335,10 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( if tp.Kind = TyparKind.Measure then let rec conv ty = match ty with - | TType_app (tcref, [t1;t2], _) when tyconRefEq g tcref g.measureproduct_tcr -> Measure.Prod (conv t1, conv t2) - | TType_app (tcref, [t1], _) when tyconRefEq g tcref g.measureinverse_tcr -> Measure.Inv (conv t1) + | TType_app (tcref, [ty1;ty2], _) when tyconRefEq g tcref g.measureproduct_tcr -> Measure.Prod (conv ty1, conv ty2) + | TType_app (tcref, [ty1], _) when tyconRefEq g tcref g.measureinverse_tcr -> Measure.Inv (conv ty1) | TType_app (tcref, [], _) when tyconRefEq g tcref g.measureone_tcr -> Measure.One - | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Con tcref + | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Const tcref | TType_app (tcref, _, _) -> errorR(Error(FSComp.SR.impInvalidMeasureArgument1(tcref.CompiledName, tp.Name), m)) Measure.One diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 28c4382f918..c5d45e95e3f 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -55,7 +55,7 @@ type ValRef with | Some membInfo -> not membInfo.MemberFlags.IsDispatchSlot && (match membInfo.ImplementedSlotSigs with - | TSlotSig(_, oty, _, _, _, _) :: _ -> isInterfaceTy g oty + | slotSig :: _ -> isInterfaceTy g slotSig.DeclaringType | [] -> false) member vref.ImplementedSlotSignatures = @@ -312,8 +312,8 @@ let OptionalArgInfoOfProvidedParameter (amap: ImportMap) m (provParam : Tainted< elif isObjTy g ty then MissingValue else DefaultValue - let pty = ImportProvidedType amap m (provParam.PApply((fun p -> p.ParameterType), m)) - CallerSide (analyze pty) + let paramTy = ImportProvidedType amap m (provParam.PApply((fun p -> p.ParameterType), m)) + CallerSide (analyze paramTy) | _ -> let v = provParam.PUntaint((fun p -> p.RawDefaultValue), m) CallerSide (Constant (ILFieldInit.FromProvidedObj m v)) @@ -1217,8 +1217,8 @@ type MethInfo = let formalRetTy = ImportReturnTypeFromMetadata amap m ilminfo.RawMetadata.Return.Type (fun _ -> ilminfo.RawMetadata.Return.CustomAttrs) ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys let formalParams = [ [ for p in ilminfo.RawMetadata.Parameters do - let paramType = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type (fun _ -> p.CustomAttrs) - yield TSlotParam(p.Name, paramType, p.IsIn, p.IsOut, p.IsOptional, []) ] ] + let paramTy = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type (fun _ -> p.CustomAttrs) + yield TSlotParam(p.Name, paramTy, p.IsIn, p.IsOut, p.IsOptional, []) ] ] formalRetTy, formalParams #if !NO_TYPEPROVIDERS | ProvidedMeth (_, mi, _, _) -> @@ -1230,9 +1230,9 @@ type MethInfo = let formalParams = [ [ for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do let paramName = p.PUntaint((fun p -> match p.Name with null -> None | s -> Some s), m) - let paramType = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) + let paramTy = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) let isIn, isOut, isOptional = p.PUntaint((fun p -> p.IsIn, p.IsOut, p.IsOptional), m) - yield TSlotParam(paramName, paramType, isIn, isOut, isOptional, []) ] ] + yield TSlotParam(paramName, paramTy, isIn, isOut, isOptional, []) ] ] formalRetTy, formalParams #endif | _ -> failwith "unreachable" @@ -1256,15 +1256,15 @@ type MethInfo = | ProvidedMeth(amap, mi, _, _) -> // A single set of tupled parameters [ [for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do - let pname = + let paramName = match p.PUntaint((fun p -> p.Name), m) with | null -> None | name -> Some (mkSynId m name) - let pty = + let paramTy = match p.PApply((fun p -> p.ParameterType), m) with | Tainted.Null -> amap.g.unit_ty | parameterType -> ImportProvidedType amap m parameterType - yield ParamNameAndType(pname, pty) ] ] + yield ParamNameAndType(paramName, paramTy) ] ] #endif @@ -1866,14 +1866,14 @@ type PropInfo = | ProvidedProp (_, pi, m) -> [ for p in pi.PApplyArray((fun pi -> pi.GetIndexParameters()), "GetIndexParameters", m) do let paramName = p.PUntaint((fun p -> match p.Name with null -> None | s -> Some (mkSynId m s)), m) - let paramType = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) - yield ParamNameAndType(paramName, paramType) ] + let paramTy = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) + yield ParamNameAndType(paramName, paramTy) ] #endif /// Get the details of the indexer parameters associated with the property member x.GetParamDatas(amap, m) = x.GetParamNamesAndTypes(amap, m) - |> List.map (fun (ParamNameAndType(nmOpt, pty)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) + |> List.map (fun (ParamNameAndType(nmOpt, paramTy)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, paramTy)) /// Get the types of the indexer parameters associated with the property member x.GetParamTypes(amap, m) = @@ -1908,14 +1908,16 @@ type PropInfo = /// Uses the same techniques as 'MethInfosUseIdenticalDefinitions'. /// Must be compatible with ItemsAreEffectivelyEqual relation. static member PropInfosUseIdenticalDefinitions x1 x2 = + let optVrefEq g = function - | Some v1, Some v2 -> valRefEq g v1 v2 + | Some vref1, Some vref2 -> valRefEq g vref1 vref2 | None, None -> true | _ -> false + match x1, x2 with | ILProp ilpinfo1, ILProp ilpinfo2 -> (ilpinfo1.RawMetadata === ilpinfo2.RawMetadata) | FSProp(g, _, vrefa1, vrefb1), FSProp(_, _, vrefa2, vrefb2) -> - (optVrefEq g (vrefa1, vrefa2)) && (optVrefEq g (vrefb1, vrefb2)) + optVrefEq g (vrefa1, vrefa2) && optVrefEq g (vrefb1, vrefb2) #if !NO_TYPEPROVIDERS | ProvidedProp(_, pi1, _), ProvidedProp(_, pi2, _) -> ProvidedPropertyInfo.TaintedEquals (pi1, pi2) #endif @@ -1927,7 +1929,7 @@ type PropInfo = | ILProp ilpinfo -> hash ilpinfo.RawMetadata.Name | FSProp(_, _, vrefOpt1, vrefOpt2) -> // Hash on string option * string option - let vth = (vrefOpt1 |> Option.map (fun vr -> vr.LogicalName), (vrefOpt2 |> Option.map (fun vr -> vr.LogicalName))) + let vth = (vrefOpt1 |> Option.map (fun vr -> vr.LogicalName), (vrefOpt2 |> Option.map (fun vref -> vref.LogicalName))) hash vth #if !NO_TYPEPROVIDERS | ProvidedProp(_, pi, _) -> ProvidedPropertyInfo.TaintedGetHashCode pi diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index c39508fc595..361f9078495 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -164,7 +164,7 @@ type AttributeDecoder(namedArgs) = let findTyconRef x = match NameMap.tryFind x nameMap with - | Some (AttribExpr (_, Expr.App (_, _, [ TType_app (tr, _, _) ], _, _))) -> Some tr + | Some (AttribExpr (_, Expr.App (_, _, [ TType_app (tcref, _, _) ], _, _))) -> Some tcref | _ -> None member _.FindInt16 x dflt = @@ -575,7 +575,7 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty member eenv.ForTycon(tycon: Tycon) = eenv.ForTypars tycon.TyparsNoRange /// Get the environment for generating a reference to items within a type definition - member eenv.ForTyconRef(tycon: TyconRef) = eenv.ForTycon tycon.Deref + member eenv.ForTyconRef(tcref: TyconRef) = eenv.ForTycon tcref.Deref //-------------------------------------------------------------------------- // Generate type references @@ -2171,16 +2171,16 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu ) let tcref = mkLocalTyconRef tycon - let typ = generalizedTyconRef g tcref + let ty = generalizedTyconRef g tcref let tcaug = tcref.TypeContents tcaug.tcaug_interfaces <- [ (g.mk_IStructuralComparable_ty, true, m) (g.mk_IComparable_ty, true, m) - (mkAppTy g.system_GenericIComparable_tcref [ typ ], true, m) + (mkAppTy g.system_GenericIComparable_tcref [ ty ], true, m) (g.mk_IStructuralEquatable_ty, true, m) - (mkAppTy g.system_GenericIEquatable_tcref [ typ ], true, m) + (mkAppTy g.system_GenericIEquatable_tcref [ ty ], true, m) ] let vspec1, vspec2 = AugmentWithHashCompare.MakeValsForEqualsAugmentation g tcref @@ -2209,7 +2209,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilInterfaceTys = [ - for ity, _, _ in tcaug.tcaug_interfaces -> GenType cenv m (TypeReprEnv.Empty.ForTypars tps) ity + for intfTy, _, _ in tcaug.tcaug_interfaces -> GenType cenv m (TypeReprEnv.Empty.ForTypars tps) intfTy ] let ilTypeDef = @@ -2973,7 +2973,7 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = match op, args, tyargs with | TOp.ExnConstr c, _, _ -> GenAllocExn cenv cgbuf eenv (c, args, m) sequel | TOp.UnionCase c, _, _ -> GenAllocUnionCase cenv cgbuf eenv (c, tyargs, args, m) sequel - | TOp.Recd (isCtor, tycon), _, _ -> GenAllocRecd cenv cgbuf eenv isCtor (tycon, tyargs, args, m) sequel + | TOp.Recd (isCtor, tcref), _, _ -> GenAllocRecd cenv cgbuf eenv isCtor (tcref, tyargs, args, m) sequel | TOp.AnonRecd anonInfo, _, _ -> GenAllocAnonRecd cenv cgbuf eenv (anonInfo, tyargs, args, m) sequel | TOp.AnonRecdGet (anonInfo, n), [ e ], _ -> GenGetAnonRecdField cenv cgbuf eenv (anonInfo, e, tyargs, n, m) sequel | TOp.TupleFieldGet (tupInfo, n), [ e ], _ -> GenGetTupleField cenv cgbuf eenv (tupInfo, e, tyargs, n, m) sequel @@ -3000,10 +3000,10 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = [] -> GenIntegerForLoop cenv cgbuf eenv (spFor, spTo, v, e1, dir, e2, e3, m) sequel | TOp.TryFinally (spTry, spFinally), [ Expr.Lambda (_, _, _, [ _ ], e1, _, _); Expr.Lambda (_, _, _, [ _ ], e2, _, _) ], - [ resty ] -> GenTryFinally cenv cgbuf eenv (e1, e2, m, resty, spTry, spFinally) sequel + [ resTy ] -> GenTryFinally cenv cgbuf eenv (e1, e2, m, resTy, spTry, spFinally) sequel | TOp.TryWith (spTry, spWith), [ Expr.Lambda (_, _, _, [ _ ], e1, _, _); Expr.Lambda (_, _, _, [ vf ], ef, _, _); Expr.Lambda (_, _, _, [ vh ], eh, _, _) ], - [ resty ] -> GenTryWith cenv cgbuf eenv (e1, vf, ef, vh, eh, m, resty, spTry, spWith) sequel + [ resTy ] -> GenTryWith cenv cgbuf eenv (e1, vf, ef, vh, eh, m, resTy, spTry, spWith) sequel | TOp.ILCall (isVirtual, _, isStruct, isCtor, valUseFlag, _, noTailCall, ilMethRef, enclTypeInst, methInst, returnTypes), args, [] -> @@ -3014,8 +3014,8 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = (isVirtual, isStruct, isCtor, valUseFlag, noTailCall, ilMethRef, enclTypeInst, methInst, args, returnTypes, m) sequel | TOp.RefAddrGet _readonly, [ e ], [ ty ] -> GenGetAddrOfRefCellField cenv cgbuf eenv (e, ty, m) sequel - | TOp.Coerce, [ e ], [ tgty; srcty ] -> GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel - | TOp.Reraise, [], [ rtnty ] -> GenReraise cenv cgbuf eenv (rtnty, m) sequel + | TOp.Coerce, [ e ], [ tgtTy; srcTy ] -> GenCoerce cenv cgbuf eenv (e, tgtTy, m, srcTy) sequel + | TOp.Reraise, [], [ retTy ] -> GenReraise cenv cgbuf eenv (retTy, m) sequel | TOp.TraitCall traitInfo, args, [] -> GenTraitCall cenv cgbuf eenv (traitInfo, args, m) expr sequel | TOp.LValueOp (LSet, v), [ e ], [] -> GenSetVal cenv cgbuf eenv (v, e, m) sequel | TOp.LValueOp (LByrefGet, v), [], [] -> GenGetByref cenv cgbuf eenv (v, m) sequel @@ -3285,17 +3285,17 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo, e, tys, n, m) sequel = if ar <= 0 then failwith "getCompiledTupleItem" elif ar < maxTuple then - let tcr' = mkCompiledTupleTyconRef g tupInfo ar - let ty = GenNamedTyApp cenv m eenv.tyenv tcr' tys + let tcref = mkCompiledTupleTyconRef g tupInfo ar + let ty = GenNamedTyApp cenv m eenv.tyenv tcref tys mkGetTupleItemN g m n ty tupInfo e tys[n] else let tysA, tysB = List.splitAfter goodTupleFields tys let tyB = mkCompiledTupleTy g tupInfo tysB - let tys' = tysA @ [ tyB ] - let tcr' = mkCompiledTupleTyconRef g tupInfo (List.length tys') - let ty' = GenNamedTyApp cenv m eenv.tyenv tcr' tys' - let n' = (min n goodTupleFields) - let elast = mkGetTupleItemN g m n' ty' tupInfo e tys'[n'] + let tysC = tysA @ [ tyB ] + let tcref = mkCompiledTupleTyconRef g tupInfo (List.length tysC) + let tyR = GenNamedTyApp cenv m eenv.tyenv tcref tysC + let nR = min n goodTupleFields + let elast = mkGetTupleItemN g m nR tyR tupInfo e tysC[nR] if n < goodTupleFields then elast @@ -3682,18 +3682,18 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = else GenNewArraySimple cenv cgbuf eenv (elems, elemTy, m) sequel -and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = +and GenCoerce cenv cgbuf eenv (e, tgtTy, m, srcTy) sequel = let g = cenv.g // Is this an upcast? if - TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty + TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy && // Do an extra check - should not be needed - TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty + TypeFeasiblySubsumesType 0 g cenv.amap m tgtTy NoCoerce srcTy then - if isInterfaceTy g tgty then + if isInterfaceTy g tgtTy then GenExpr cenv cgbuf eenv e Continue - let ilToTy = GenType cenv m eenv.tyenv tgty + let ilToTy = GenType cenv m eenv.tyenv tgtTy // Section "III.1.8.1.3 Merging stack states" of ECMA-335 implies that no unboxing // is required, but we still push the coerced type on to the code gen buffer. CG.EmitInstrs cgbuf (pop 1) (Push [ ilToTy ]) [] @@ -3703,18 +3703,18 @@ and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = else GenExpr cenv cgbuf eenv e Continue - if not (isObjTy g srcty) then - let ilFromTy = GenType cenv m eenv.tyenv srcty + if not (isObjTy g srcTy) then + let ilFromTy = GenType cenv m eenv.tyenv srcTy CG.EmitInstr cgbuf (pop 1) (Push [ g.ilg.typ_Object ]) (I_box ilFromTy) - if not (isObjTy g tgty) then - let ilToTy = GenType cenv m eenv.tyenv tgty + if not (isObjTy g tgtTy) then + let ilToTy = GenType cenv m eenv.tyenv tgtTy CG.EmitInstr cgbuf (pop 1) (Push [ ilToTy ]) (I_unbox_any ilToTy) GenSequel cenv eenv.cloc cgbuf sequel -and GenReraise cenv cgbuf eenv (rtnty, m) sequel = - let ilReturnTy = GenType cenv m eenv.tyenv rtnty +and GenReraise cenv cgbuf eenv (retTy, m) sequel = + let ilReturnTy = GenType cenv m eenv.tyenv retTy CG.EmitInstr cgbuf (pop 0) Push0 I_rethrow // [See comment related to I_throw]. // Rethrow does not return. Required to push dummy value on the stack. @@ -4538,14 +4538,14 @@ and GenNamedLocalTyFuncCall cenv (cgbuf: CodeGenBuffer) eenv ty cloinfo tyargs m actualRetTy /// Generate an indirect call, converting to an ILX callfunc instruction -and GenCurriedArgsAndIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = +and GenCurriedArgsAndIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = // Generate the curried arguments to the indirect call GenExprs cenv cgbuf eenv curriedArgs - GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel + GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel /// Generate an indirect call, converting to an ILX callfunc instruction -and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = +and GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = let g = cenv.g // Fold in the new types into the environment as we generate the formal types. @@ -4553,7 +4553,7 @@ and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = // keep only non-erased type arguments when computing indirect call let tyargs = DropErasedTyargs tyargs - let typars, formalFuncTy = tryDestForallTy g functy + let typars, formalFuncTy = tryDestForallTy g funcTy let feenv = eenv.tyenv.Add typars @@ -4568,7 +4568,7 @@ and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = List.foldBack (fun tyarg acc -> Apps_tyapp(GenType cenv m eenv.tyenv tyarg, acc)) tyargs (appBuilder ilxRetApps) - let actualRetTy = applyTys g functy (tyargs, curriedArgs) + let actualRetTy = applyTys g funcTy (tyargs, curriedArgs) let ilActualRetTy = GenType cenv m eenv.tyenv actualRetTy // Check if any byrefs are involved to make sure we don't tailcall @@ -4710,14 +4710,14 @@ and eligibleForFilter (cenv: cenv) expr = && not isTrivial && check expr -and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler: Val, handlerExpr, m, resty, spTry, spWith) sequel = +and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler: Val, handlerExpr, m, resTy, spTry, spWith) sequel = let g = cenv.g // Save the stack - gross because IL flushes the stack at the exn. handler // note: eenvinner notes spill vars are live LocalScope "trystack" cgbuf (fun scopeMarks -> let whereToSaveOpt, eenvinner, stack, tryMarks, afterHandler = - GenTry cenv cgbuf eenv scopeMarks (e1, m, resty, spTry) + GenTry cenv cgbuf eenv scopeMarks (e1, m, resTy, spTry) let seh = if cenv.options.generateFilterBlocks || eligibleForFilter cenv filterExpr then @@ -4824,13 +4824,13 @@ and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler GenSequel cenv eenv.cloc cgbuf sequel | None -> GenUnitThenSequel cenv eenv m eenv.cloc cgbuf sequel) -and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resty, spTry, spFinally) sequel = +and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resTy, spTry, spFinally) sequel = // Save the stack - needed because IL flushes the stack at the exn. handler // note: eenvinner notes spill vars are live LocalScope "trystack" cgbuf (fun scopeMarks -> let whereToSaveOpt, eenvinner, stack, tryMarks, afterHandler = - GenTry cenv cgbuf eenv scopeMarks (bodyExpr, m, resty, spTry) + GenTry cenv cgbuf eenv scopeMarks (bodyExpr, m, resTy, spTry) // Now the catch/finally block let startOfHandler = CG.GenerateMark cgbuf "startOfHandler" @@ -7520,8 +7520,8 @@ and GenDecisionTreeSwitch CG.EmitInstr cgbuf (pop 1) (Push [ g.ilg.typ_Object ]) (I_box ilFromTy) BI_brfalse - | DecisionTreeTest.IsInst (_srcty, tgty) -> - let e = mkCallTypeTest g m tgty e + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> + let e = mkCallTypeTest g m tgtTy e GenExpr cenv cgbuf eenv e Continue BI_brtrue | _ -> failwith "internal error: GenDecisionTreeSwitch" @@ -9472,7 +9472,7 @@ and AllocLocal cenv cgbuf eenv compgen (v, ty, isFixed) (scopeMarks: Mark * Mark let j, realloc = if cenv.options.localOptimizationsEnabled then cgbuf.ReallocLocal( - (fun i (_, ty', isFixed') -> not isFixed' && not isFixed && not (IntMap.mem i eenv.liveLocals) && (ty = ty')), + (fun i (_, ty2, isFixed2) -> not isFixed2 && not isFixed && not (IntMap.mem i eenv.liveLocals) && (ty = ty2)), ranges, ty, isFixed @@ -10470,7 +10470,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = for slotsig in memberInfo.ImplementedSlotSigs do - if isInterfaceTy g slotsig.ImplementedType then + if isInterfaceTy g slotsig.DeclaringType then match vref.ValReprInfo with | Some _ -> diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index f3537b7bbc0..056f2f19a78 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -900,7 +900,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | ParameterlessStructCtor _ -> os.AppendString(ParameterlessStructCtorE().Format) - | InterfaceNotRevealed (denv, ity, _) -> os.AppendString(InterfaceNotRevealedE().Format(NicePrint.minimalStringOfType denv ity)) + | InterfaceNotRevealed (denv, intfTy, _) -> + os.AppendString(InterfaceNotRevealedE().Format(NicePrint.minimalStringOfType denv intfTy)) | NotAFunctionButIndexer (_, _, name, _, _, old) -> if old then @@ -1506,7 +1507,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu |> List.exists (function | TType_app (maybeUnit, [], _) -> match maybeUnit.TypeAbbrev with - | Some ttype when isUnitTy g ttype -> true + | Some ty when isUnitTy g ty -> true | _ -> false | _ -> false) @@ -1694,7 +1695,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | PatternMatchCompilation.RuleNeverMatched _ -> os.AppendString(RuleNeverMatchedE().Format) - | ValNotMutable (_, valRef, _) -> os.AppendString(ValNotMutableE().Format(valRef.DisplayName)) + | ValNotMutable (_, vref, _) -> os.AppendString(ValNotMutableE().Format(vref.DisplayName)) | ValNotLocal _ -> os.AppendString(ValNotLocalE().Format) diff --git a/src/Compiler/Facilities/TextLayoutRender.fs b/src/Compiler/Facilities/TextLayoutRender.fs index 1b77bd9e6ae..e9b7cd8637a 100644 --- a/src/Compiler/Facilities/TextLayoutRender.fs +++ b/src/Compiler/Facilities/TextLayoutRender.fs @@ -204,5 +204,5 @@ module LayoutRender = let toArray layout = let output = ResizeArray() - renderL (taggedTextListR (fun tt -> output.Add(tt))) layout |> ignore + renderL (taggedTextListR output.Add) layout |> ignore output.ToArray() diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 936343a7036..5d8966fd9a1 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1814,9 +1814,9 @@ type internal FsiDynamicCompiler( ilTy |> Morphs.morphILTypeRefsInILType emEnv.ReverseMapTypeRef | _ -> ilTy) - ((istate, []), ilTys) ||> List.fold (fun (state, addedTypes) ilTy -> - let nextState, addedType = addTypeToEnvironment state ilTy - nextState, addedTypes @ [addedType]) + ((istate, []), ilTys) ||> List.fold (fun (state, addedTys) ilTy -> + let nextState, addedTy = addTypeToEnvironment state ilTy + nextState, addedTys @ [addedTy]) member _.DynamicAssemblies = dynamicAssemblies.ToArray() diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 90e79010ed6..f4462122337 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -606,9 +606,9 @@ let inline BindInternalValsToUnknown cenv vs env = ignore vs env -let BindTypeVar tyv typeinfo env = { env with typarInfos= (tyv, typeinfo) :: env.typarInfos } +let BindTypar tyv typeinfo env = { env with typarInfos= (tyv, typeinfo) :: env.typarInfos } -let BindTypeVarsToUnknown (tps: Typar list) env = +let BindTyparsToUnknown (tps: Typar list) env = if isNil tps then env else // The optimizer doesn't use the type values it could track. // However here we mutate to provide better names for generalized type parameters @@ -617,7 +617,7 @@ let BindTypeVarsToUnknown (tps: Typar list) env = (tps, nms) ||> List.iter2 (fun tp nm -> if PrettyTypes.NeedsPrettyTyparName tp then tp.typar_id <- ident (nm, tp.Range)) - List.fold (fun sofar arg -> BindTypeVar arg UnknownTypeValue sofar) env tps + List.fold (fun sofar arg -> BindTypar arg UnknownTypeValue sofar) env tps let BindCcu (ccu: CcuThunk) mval env (_g: TcGlobals) = { env with globalModuleInfos=env.globalModuleInfos.Add(ccu.AssemblyName, mval) } @@ -2245,8 +2245,8 @@ let TryDetectQueryQuoteAndRun cenv (expr: Expr) = match reqdResultInfo, exprIsEnumerableInfo with | Some _, Some _ | None, None -> resultExpr // the expression is a QuerySource, the result is a QuerySource, nothing to do | Some resultElemTy, None -> - let iety = TType_app(g.tcref_System_Collections_IEnumerable, [], g.knownWithoutNull) - mkCallGetQuerySourceAsEnumerable g expr.Range resultElemTy iety resultExpr + let enumerableTy = TType_app(g.tcref_System_Collections_IEnumerable, [], g.knownWithoutNull) + mkCallGetQuerySourceAsEnumerable g expr.Range resultElemTy enumerableTy resultExpr | None, Some (resultElemTy, qTy) -> mkCallNewQuerySource g expr.Range resultElemTy qTy resultExpr Some resultExprAfterConvertToResultTy @@ -2425,7 +2425,7 @@ and OptimizeMethods cenv env baseValOpt methods = and OptimizeMethod cenv env baseValOpt (TObjExprMethod(slotsig, attribs, tps, vs, e, m) as tmethod) = let env = {env with latestBoundId=Some tmethod.Id; functionVal = None} - let env = BindTypeVarsToUnknown tps env + let env = BindTyparsToUnknown tps env let env = BindInternalValsToUnknown cenv vs env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env let eR, einfo = OptimizeExpr cenv env e @@ -2508,11 +2508,11 @@ and OptimizeExprOp cenv env (op, tyargs, args, m) = // Special cases match op, tyargs, args with - | TOp.Coerce, [toty;fromty], [arg] -> + | TOp.Coerce, [tgtTy; srcTy], [arg] -> let argR, einfo = OptimizeExpr cenv env arg - if typeEquiv g toty fromty then argR, einfo + if typeEquiv g tgtTy srcTy then argR, einfo else - mkCoerceExpr(argR, toty, m, fromty), + mkCoerceExpr(argR, tgtTy, m, srcTy), { TotalSize=einfo.TotalSize + 1 FunctionSize=einfo.FunctionSize + 1 HasEffect = true @@ -3742,7 +3742,7 @@ and OptimizeLambdas (vspec: Val option) cenv env valReprInfo expr exprTy = let env = { env with functionVal = (match vspec with None -> None | Some v -> Some (v, valReprInfo)) } let env = Option.foldBack (BindInternalValToUnknown cenv) ctorThisValOpt env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env - let env = BindTypeVarsToUnknown tps env + let env = BindTyparsToUnknown tps env let env = List.foldBack (BindInternalValsToUnknown cenv) vsl env let bodyR, bodyinfo = OptimizeExpr cenv env body let exprR = mkMemberLambdas g m tps ctorThisValOpt baseValOpt vsl (bodyR, bodyTy) @@ -3977,7 +3977,7 @@ and TryOptimizeDecisionTreeTest cenv test vinfo = | DecisionTreeTest.ArrayLength _, _ -> None | DecisionTreeTest.Const c1, StripConstValue c2 -> if c1 = Const.Zero || c2 = Const.Zero then None else Some(c1=c2) | DecisionTreeTest.IsNull, StripConstValue c2 -> Some(c2=Const.Zero) - | DecisionTreeTest.IsInst (_srcty1, _tgty1), _ -> None + | DecisionTreeTest.IsInst (_srcTy1, _tgtTy1), _ -> None // These should not occur in optimization | DecisionTreeTest.ActivePatternCase _, _ -> None | _ -> None @@ -3989,8 +3989,8 @@ and OptimizeSwitch cenv env (e, cases, dflt, m) = // Replace IsInst tests by calls to the helper for type tests, which may then get optimized let e, cases = match cases with - | [ TCase(DecisionTreeTest.IsInst (_srcTy, tgTy), success)] -> - let testExpr = mkCallTypeTest g m tgTy e + | [ TCase(DecisionTreeTest.IsInst (_srcTy, tgtTy), success)] -> + let testExpr = mkCallTypeTest g m tgtTy e let testCases = [TCase(DecisionTreeTest.Const(Const.Bool true), success)] testExpr, testCases | _ -> e, cases diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index c7f4e0ce0f0..48649d1835a 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -351,13 +351,13 @@ type internal TypeCheckInfo // Find the most deeply nested enclosing scope that contains given position sResolutions.CapturedEnvs - |> ResizeArray.iter (fun (possm, env, ad) -> - if rangeContainsPos possm cursorPos then + |> ResizeArray.iter (fun (mPossible, env, ad) -> + if rangeContainsPos mPossible cursorPos then match bestSoFar with | Some (bestm, _, _) -> - if rangeContainsRange bestm possm then - bestSoFar <- Some(possm, env, ad) - | None -> bestSoFar <- Some(possm, env, ad)) + if rangeContainsRange bestm mPossible then + bestSoFar <- Some(mPossible, env, ad) + | None -> bestSoFar <- Some(mPossible, env, ad)) let mostDeeplyNestedEnclosingScope = bestSoFar @@ -370,23 +370,23 @@ type internal TypeCheckInfo let mutable bestAlmostIncludedSoFar = None sResolutions.CapturedEnvs - |> ResizeArray.iter (fun (possm, env, ad) -> + |> ResizeArray.iter (fun (mPossible, env, ad) -> // take only ranges that strictly do not include cursorPos (all ranges that touch cursorPos were processed during 'Strict Inclusion' part) - if rangeBeforePos possm cursorPos && not (posEq possm.End cursorPos) then + if rangeBeforePos mPossible cursorPos && not (posEq mPossible.End cursorPos) then let contained = match mostDeeplyNestedEnclosingScope with - | Some (bestm, _, _) -> rangeContainsRange bestm possm + | Some (bestm, _, _) -> rangeContainsRange bestm mPossible | None -> true if contained then match bestAlmostIncludedSoFar with - | Some (rightm: range, _, _) -> + | Some (mRight: range, _, _) -> if - posGt possm.End rightm.End - || (posEq possm.End rightm.End && posGt possm.Start rightm.Start) + posGt mPossible.End mRight.End + || (posEq mPossible.End mRight.End && posGt mPossible.Start mRight.Start) then - bestAlmostIncludedSoFar <- Some(possm, env, ad) - | _ -> bestAlmostIncludedSoFar <- Some(possm, env, ad)) + bestAlmostIncludedSoFar <- Some(mPossible, env, ad) + | _ -> bestAlmostIncludedSoFar <- Some(mPossible, env, ad)) let resEnv = match bestAlmostIncludedSoFar, mostDeeplyNestedEnclosingScope with diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 261d6ec094f..d2621715b10 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -241,10 +241,10 @@ and [] ItemKeyStoreBuilder() = writeString anonInfo.ILTypeRef.BasicQualifiedName tinst |> List.iter (writeType false) - | TType_fun (d, r, _) -> + | TType_fun (domainTy, rangeTy, _) -> writeString ItemKeyTags.typeFunction - writeType false d - writeType false r + writeType false domainTy + writeType false rangeTy | TType_measure ms -> if isStandalone then @@ -265,7 +265,7 @@ and [] ItemKeyStoreBuilder() = | Measure.Var typar -> writeString ItemKeyTags.typeMeasureVar writeTypar isStandalone typar - | Measure.Con tcref -> + | Measure.Const tcref -> writeString ItemKeyTags.typeMeasureCon writeEntityRef tcref | _ -> () diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index bdbc73d783a..fc4f9d21b75 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -152,8 +152,8 @@ module TcResolutionsExtensions = protectAssemblyExplorationNoReraise false false (fun () -> ExistsHeadTypeInEntireHierarchy g amap range0 vref.Type g.tcref_System_IDisposable) - let isStructTyconRef (tyconRef: TyconRef) = - let ty = generalizedTyconRef g tyconRef + let isStructTyconRef (tcref: TyconRef) = + let ty = generalizedTyconRef g tcref let underlyingTy = stripTyEqnsAndMeasureEqns g ty isStructTy g underlyingTy diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 82fc0afae36..30d024d646a 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -197,15 +197,15 @@ module DeclarationListHelpers = | Item.ActivePatternCase apref -> let v = apref.ActivePatternVal // Format the type parameters to get e.g. ('a -> 'a) rather than ('?1234 -> '?1234) - let tau = v.TauType + let vTauTy = v.TauType // REVIEW: use _cxs here - let (prettyTyparInst, ptau), _cxs = PrettyTypes.PrettifyInstAndType denv.g (item.TyparInstantiation, tau) + let (prettyTyparInst, prettyTy), _cxs = PrettyTypes.PrettifyInstAndType denv.g (item.TyparInstantiation, vTauTy) let remarks = OutputFullName displayFullName pubpathOfValRef fullDisplayTextOfValRefAsLayout v let layout = wordL (tagText (FSComp.SR.typeInfoActiveRecognizer())) ^^ wordL (tagActivePatternCase apref.Name |> mkNav v.DefinitionRange) ^^ RightL.colon ^^ - NicePrint.layoutType denv ptau + NicePrint.layoutType denv prettyTy let tpsL = FormatTyparMapping denv prettyTyparInst @@ -292,7 +292,7 @@ module DeclarationListHelpers = // .NET events | Item.Event einfo -> - let eventTy = PropTypOfEventInfo infoReader m AccessibleFromSomewhere einfo + let eventTy = PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo let eventTy, _cxs = PrettyTypes.PrettifyType g eventTy let layout = wordL (tagText (FSComp.SR.typeInfoEvent())) ^^ @@ -353,11 +353,11 @@ module DeclarationListHelpers = ToolTipElement.Single(layout, xml) // The 'fake' representation of constructors of .NET delegate types - | Item.DelegateCtor delty -> - let delty, _cxs = PrettyTypes.PrettifyType g delty - let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delty m AccessibleFromSomewhere + | Item.DelegateCtor delTy -> + let delTy, _cxs = PrettyTypes.PrettifyType g delTy + let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delTy m AccessibleFromSomewhere let layout = - NicePrint.layoutTyconRef denv (tcrefOfAppTy g delty) ^^ + NicePrint.layoutTyconRef denv (tcrefOfAppTy g delTy) ^^ LeftL.leftParen ^^ NicePrint.layoutType denv delFuncTy ^^ RightL.rightParen @@ -484,16 +484,16 @@ type MethodGroupItemParameter(name: string, canonicalTypeTextForSorting: string, module internal DescriptionListsImpl = let isFunction g ty = - let _, tau = tryDestForallTy g ty - isFunTy g tau + let _, tauTy = tryDestForallTy g ty + isFunTy g tauTy - let printCanonicalizedTypeName g (denv:DisplayEnv) tau = + let printCanonicalizedTypeName g (denv:DisplayEnv) tauTy = // get rid of F# abbreviations and such - let strippedType = stripTyEqnsWrtErasure EraseAll g tau + let strippedTy = stripTyEqnsWrtErasure EraseAll g tauTy // 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 strippedType + NicePrint.stringOfTy denv strippedTy let PrettyParamOfRecdField g denv (f: RecdField) = let display = NicePrint.prettyLayoutOfType denv f.FormalType @@ -566,12 +566,12 @@ module internal DescriptionListsImpl = // Remake the params using the prettified versions let prettyParams = - (paramInfo, prettyParamTys, prettyParamTysL) |||> List.map3 (fun (nm, isOptArg, paramPrefix) tau tyL -> + (paramInfo, prettyParamTys, prettyParamTysL) |||> List.map3 (fun (nm, isOptArg, paramPrefix) tauTy tyL -> let display = paramPrefix ^^ tyL let display = toArray display MethodGroupItemParameter( name = nm, - canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tau, + canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tauTy, display = display, isOptional=isOptArg )) @@ -587,11 +587,11 @@ module internal DescriptionListsImpl = // Remake the params using the prettified versions let parameters = (prettyParamTys, prettyParamTysL) - ||> List.map2 (fun tau tyL -> + ||> List.map2 (fun paramTy tyL -> let display = toArray tyL MethodGroupItemParameter( name = "", - canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tau, + canonicalTypeTextForSorting = printCanonicalizedTypeName g denv paramTy, display = display, isOptional=false )) @@ -635,17 +635,18 @@ module internal DescriptionListsImpl = let denv = { SimplerDisplayEnv denv with useColonForReturnType=true} match item.Item with | Item.Value vref -> + let getPrettyParamsOfTypes() = - let tau = vref.TauType - match tryDestFunTy denv.g tau with - | ValueSome(arg, rtau) -> + let vTauTy = vref.TauType + match tryDestFunTy denv.g vTauTy with + | ValueSome(arg, retTy) -> let args = tryDestRefTupleTy denv.g arg - let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfTypes g denv item.TyparInstantiation args rtau + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfTypes g denv item.TyparInstantiation args retTy // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group prettyParams, prettyRetTyL | _ -> - let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] tau + let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] vTauTy [], prettyTyL match vref.ValReprInfo with @@ -675,7 +676,7 @@ module internal DescriptionListsImpl = // Adjust the return type so it only strips the first argument let curriedRetTy = match tryDestFunTy denv.g vref.TauType with - | ValueSome(_, rtau) -> rtau + | ValueSome(_, retTy) -> retTy | _ -> lastRetTy let _prettyTyparInst, prettyFirstCurriedParams, prettyCurriedRetTyL, prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation firstCurriedParamDatas curriedRetTy @@ -695,8 +696,8 @@ module internal DescriptionListsImpl = | Item.ActivePatternCase(apref) -> let v = apref.ActivePatternVal - let tau = v.TauType - let args, resTy = stripFunTy denv.g tau + let vTauTy = v.TauType + let args, resTy = stripFunTy denv.g vTauTy let apinfo = Option.get (TryGetActivePatternInfo v) let aparity = apinfo.Names.Length @@ -726,7 +727,7 @@ module internal DescriptionListsImpl = [], prettyRetTyL | Item.Event einfo -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypOfEventInfo infoReader m AccessibleFromSomewhere einfo) + let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo) [], prettyRetTyL | Item.Property(_, pinfo :: _) -> @@ -775,11 +776,11 @@ module internal DescriptionListsImpl = let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] ty [], prettyRetTyL - | Item.DelegateCtor delty -> - let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delty m AccessibleFromSomewhere + | Item.DelegateCtor delTy -> + let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delTy m AccessibleFromSomewhere // No need to pass more generic type information in here since the instanitations have already been applied - let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation [ParamData(false, false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, delFuncTy)] delty + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation [ParamData(false, false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, delFuncTy)] delTy // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 68b7eb268f9..0751225c890 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -121,8 +121,8 @@ module NavigationImpl = |> List.fold (fun st (SynField (_, _, _, _, _, _, _, m)) -> unionRangesChecked m st) range.Zero | SynUnionCaseKind.FullType (ty, _) -> ty.Range - let bodyRange mb decls = - unionRangesChecked (rangeOfDecls decls) mb + let bodyRange mBody decls = + unionRangesChecked (rangeOfDecls decls) mBody /// Get information for implementation file let getNavigationFromImplFile (modules: SynModuleOrNamespace list) = @@ -143,18 +143,18 @@ module NavigationImpl = sprintf "%s_%d_of_%d" name idx total // Create declaration (for the left dropdown) - let createDeclLid (baseName, lid, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = + let createDeclLid (baseName, lid, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = let name = (if baseName <> "" then baseName + "." else "") + textOfLid lid - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, false, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, false, access) item, addItemName name, nested - let createDecl (baseName, id: Ident, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, isAbstract, access) = + let createDecl (baseName, id: Ident, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, isAbstract, access) = let name = (if baseName <> "" then baseName + "." else "") + id.idText - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, isAbstract, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, isAbstract, access) item, addItemName name, nested - let createTypeDecl (baseName, lid, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = - createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, bodym, nested, enclosingEntityKind, access) + let createTypeDecl (baseName, lid, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = + createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, mBody, nested, enclosingEntityKind, access) // Create member-kind-of-thing for the right dropdown let createMemberLid (lid, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = @@ -226,10 +226,10 @@ module NavigationImpl = let rec processExnDefnRepr baseName nested synExnRepr = let (SynExceptionDefnRepr (_, ucase, _, _, access, m)) = synExnRepr let (SynUnionCase (ident = SynIdent (id, _); caseType = fldspec)) = ucase - let bodym = fldspecRange fldspec + let mBody = fldspecRange fldspec [ - createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, bodym, nested, NavigationEntityKind.Exception, false, access) + createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, mBody, nested, NavigationEntityKind.Exception, false, access) ] // Process a class declaration or F# type declaration @@ -247,35 +247,35 @@ module NavigationImpl = match repr with | SynTypeDefnRepr.Exception repr -> processExnDefnRepr baseName [] repr - | SynTypeDefnRepr.ObjectModel (_, membDefns, mb) -> + | SynTypeDefnRepr.ObjectModel (_, membDefns, mBody) -> // F# class declaration let members = processMembers membDefns NavigationEntityKind.Class |> snd let nested = members @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Class, m, bodym, nested, NavigationEntityKind.Class, access) + createTypeDecl (baseName, lid, FSharpGlyph.Class, m, mBody, nested, NavigationEntityKind.Class, access) ] | SynTypeDefnRepr.Simple (simple, _) -> // F# type declaration match simple with - | SynTypeDefnSimpleRepr.Union (_, cases, mb) -> + | SynTypeDefnSimpleRepr.Union (_, cases, mBody) -> let cases = [ for SynUnionCase (ident = SynIdent (id, _); caseType = fldspec) in cases -> - let bodym = unionRanges (fldspecRange fldspec) id.idRange - createMember (id, NavigationItemKind.Other, FSharpGlyph.Struct, bodym, NavigationEntityKind.Union, false, access) + let mBody = unionRanges (fldspecRange fldspec) id.idRange + createMember (id, NavigationItemKind.Other, FSharpGlyph.Struct, mBody, NavigationEntityKind.Union, false, access) ] let nested = cases @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Union, m, bodym, nested, NavigationEntityKind.Union, access) + createTypeDecl (baseName, lid, FSharpGlyph.Union, m, mBody, nested, NavigationEntityKind.Union, access) ] - | SynTypeDefnSimpleRepr.Enum (cases, mb) -> + | SynTypeDefnSimpleRepr.Enum (cases, mBody) -> let cases = [ for SynEnumCase (ident = SynIdent (id, _); range = m) in cases -> @@ -283,13 +283,13 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, bodym, nested, NavigationEntityKind.Enum, access) + createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, mBody, nested, NavigationEntityKind.Enum, access) ] - | SynTypeDefnSimpleRepr.Record (_, fields, mb) -> + | SynTypeDefnSimpleRepr.Record (_, fields, mBody) -> let fields = [ for SynField (_, _, id, _, _, _, _, m) in fields do @@ -299,17 +299,17 @@ module NavigationImpl = ] let nested = fields @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Type, m, bodym, nested, NavigationEntityKind.Record, access) + createTypeDecl (baseName, lid, FSharpGlyph.Type, m, mBody, nested, NavigationEntityKind.Record, access) ] - | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mb) -> - let bodym = bodyRange mb topMembers + | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mBody) -> + let mBody = bodyRange mBody topMembers [ - createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, bodym, topMembers, NavigationEntityKind.Class, access) + createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, mBody, topMembers, NavigationEntityKind.Class, access) ] //| SynTypeDefnSimpleRepr.General of TyconKind * (SynType * Range * ident option) list * (valSpfn * MemberFlags) list * fieldDecls * bool * bool * Range @@ -371,8 +371,8 @@ module NavigationImpl = for decl in decls do match decl with | SynModuleDecl.ModuleAbbrev (id, lid, m) -> - let bodym = rangeOfLid lid - createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, [], NavigationEntityKind.Namespace, false, None) + let mBody = rangeOfLid lid + createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Namespace, false, None) | SynModuleDecl.NestedModule (moduleInfo = SynComponentInfo (longId = lid; accessibility = access); decls = decls; range = m) -> // Find let bindings (for the right dropdown) @@ -380,8 +380,8 @@ module NavigationImpl = let newBaseName = (if (baseName = "") then "" else baseName + ".") + (textOfLid lid) let other = processNavigationTopLevelDeclarations (newBaseName, decls) - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) - createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, nested, NavigationEntityKind.Module, access) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) + createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, nested, NavigationEntityKind.Module, access) // Get nested modules and types (for the left dropdown) yield! other @@ -414,11 +414,11 @@ module NavigationImpl = else NavigationItemKind.Namespace - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) let nm = textOfLid id let item = - NavigationItem.Create(nm, kind, FSharpGlyph.Module, m, bodym, singleTopLevel, NavigationEntityKind.Module, false, access) + NavigationItem.Create(nm, kind, FSharpGlyph.Module, m, mBody, singleTopLevel, NavigationEntityKind.Module, false, access) let decl = (item, addItemName (nm), nested) decl @@ -462,17 +462,17 @@ module NavigationImpl = sprintf "%s_%d_of_%d" name idx total // Create declaration (for the left dropdown) - let createDeclLid (baseName, lid, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = + let createDeclLid (baseName, lid, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = let name = (if baseName <> "" then baseName + "." else "") + (textOfLid lid) - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, false, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, false, access) item, addItemName name, nested - let createTypeDecl (baseName, lid, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = - createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, bodym, nested, enclosingEntityKind, access) + let createTypeDecl (baseName, lid, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = + createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, mBody, nested, enclosingEntityKind, access) - let createDecl (baseName, id: Ident, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, isAbstract, access) = + let createDecl (baseName, id: Ident, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, isAbstract, access) = let name = (if baseName <> "" then baseName + "." else "") + id.idText - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, isAbstract, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, isAbstract, access) item, addItemName name, nested let createMember (id: Ident, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = @@ -481,10 +481,10 @@ module NavigationImpl = let rec processExnRepr baseName nested inp = let (SynExceptionDefnRepr (_, SynUnionCase (ident = SynIdent (id, _); caseType = fldspec), _, _, access, m)) = inp - let bodym = fldspecRange fldspec + let mBody = fldspecRange fldspec [ - createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, bodym, nested, NavigationEntityKind.Exception, false, access) + createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, mBody, nested, NavigationEntityKind.Exception, false, access) ] and processExnSig baseName inp = @@ -501,16 +501,16 @@ module NavigationImpl = [ match repr with | SynTypeDefnSigRepr.Exception repr -> yield! processExnRepr baseName [] repr - | SynTypeDefnSigRepr.ObjectModel (_, membDefns, mb) -> + | SynTypeDefnSigRepr.ObjectModel (_, membDefns, mBody) -> // F# class declaration let members = processSigMembers membDefns let nested = members @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Class, m, bodym, nested, NavigationEntityKind.Class, access) + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Class, m, mBody, nested, NavigationEntityKind.Class, access) | SynTypeDefnSigRepr.Simple (simple, _) -> // F# type declaration match simple with - | SynTypeDefnSimpleRepr.Union (_, cases, mb) -> + | SynTypeDefnSimpleRepr.Union (_, cases, mBody) -> let cases = [ for SynUnionCase (ident = SynIdent (id, _); caseType = fldspec) in cases -> @@ -519,9 +519,9 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Union, m, bodym, nested, NavigationEntityKind.Union, access) - | SynTypeDefnSimpleRepr.Enum (cases, mb) -> + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Union, m, mBody, nested, NavigationEntityKind.Union, access) + | SynTypeDefnSimpleRepr.Enum (cases, mBody) -> let cases = [ for SynEnumCase (ident = SynIdent (id, _); range = m) in cases -> @@ -529,9 +529,9 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, bodym, nested, NavigationEntityKind.Enum, access) - | SynTypeDefnSimpleRepr.Record (_, fields, mb) -> + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, mBody, nested, NavigationEntityKind.Enum, access) + | SynTypeDefnSimpleRepr.Record (_, fields, mBody) -> let fields = [ for SynField (_, _, id, _, _, _, _, m) in fields do @@ -541,11 +541,11 @@ module NavigationImpl = ] let nested = fields @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Type, m, bodym, nested, NavigationEntityKind.Record, access) - | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mb) -> - let bodym = bodyRange mb topMembers - createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, bodym, topMembers, NavigationEntityKind.Class, access) + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Type, m, mBody, nested, NavigationEntityKind.Record, access) + | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mBody) -> + let mBody = bodyRange mBody topMembers + createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, mBody, topMembers, NavigationEntityKind.Class, access) //| SynTypeDefnSimpleRepr.General of TyconKind * (SynType * range * ident option) list * (valSpfn * MemberFlags) list * fieldDecls * bool * bool * range //| SynTypeDefnSimpleRepr.LibraryOnlyILAssembly of ILType * range @@ -581,8 +581,8 @@ module NavigationImpl = for decl in decls do match decl with | SynModuleSigDecl.ModuleAbbrev (id, lid, m) -> - let bodym = rangeOfLid lid - createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, [], NavigationEntityKind.Module, false, None) + let mBody = rangeOfLid lid + createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Module, false, None) | SynModuleSigDecl.NestedModule (moduleInfo = SynComponentInfo (longId = lid; accessibility = access); moduleDecls = decls; range = m) -> // Find let bindings (for the right dropdown) @@ -591,8 +591,8 @@ module NavigationImpl = let other = processNavigationTopLevelSigDeclarations (newBaseName, decls) // Get nested modules and types (for the left dropdown) - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) - createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, nested, NavigationEntityKind.Module, access) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) + createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, nested, NavigationEntityKind.Module, access) yield! other | SynModuleSigDecl.Types (tydefs, _) -> @@ -623,10 +623,10 @@ module NavigationImpl = else NavigationItemKind.Namespace - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) let item = - NavigationItem.Create(textOfLid id, kind, FSharpGlyph.Module, m, bodym, singleTopLevel, NavigationEntityKind.Module, false, access) + NavigationItem.Create(textOfLid id, kind, FSharpGlyph.Module, m, mBody, singleTopLevel, NavigationEntityKind.Module, false, access) let decl = (item, addItemName (textOfLid id), nested) decl diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index ff34dd392d4..b757120b628 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -73,8 +73,8 @@ module internal ParameterLocationsImpl = match synExpr with | SynExpr.Ident id -> Some([ id.idText ], id.idRange) | SynExpr.LongIdent (_, SynLongIdent ([ id ], [], [ Some _ ]), _, _) -> Some([ id.idText ], id.idRange) - | SynExpr.LongIdent (_, SynLongIdent (lid, _, _), _, lidRange) - | SynExpr.DotGet (_, _, SynLongIdent (lid, _, _), lidRange) -> Some(pathOfLid lid, lidRange) + | SynExpr.LongIdent (_, SynLongIdent (lid, _, _), _, mLongId) + | SynExpr.DotGet (_, _, SynLongIdent (lid, _, _), mLongId) -> Some(pathOfLid lid, mLongId) | SynExpr.TypeApp (synExpr, _, _synTypeList, _commas, _, _, _range) -> digOutIdentFromFuncExpr synExpr | SynExpr.Paren (expr = expr) -> digOutIdentFromFuncExpr expr | _ -> None @@ -213,14 +213,14 @@ module internal ParameterLocationsImpl = let (|StaticParameters|_|) pos (StripParenTypes synType) = match synType with | SynType.App (StripParenTypes (SynType.LongIdent (SynLongIdent (lid, _, _) as lidwd)), - Some (openm), + Some mLess, args, commas, - closemOpt, + mGreaterOpt, _pf, wholem) -> let lidm = lidwd.Range - let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End + let betweenTheBrackets = mkRange wholem.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos @@ -232,10 +232,10 @@ module internal ParameterLocationsImpl = ParameterLocations( pathOfLid lid, lidm, - openm.Start, + mLess.Start, [], commasAndCloseParen, - closemOpt.IsSome, + mGreaterOpt.IsSome, args |> List.map digOutIdentFromStaticArg ) ) @@ -281,7 +281,7 @@ module internal ParameterLocationsImpl = // EXPR< = error recovery of a form of half-written TypeApp | SynExpr.App (_, _, - SynExpr.App (_, true, SynExpr.LongIdent(longDotId = SynLongIdent(id = [ op ])), synExpr, openm), + SynExpr.App (_, true, SynExpr.LongIdent(longDotId = SynLongIdent(id = [ op ])), synExpr, mLess), SynExpr.ArbitraryAfterError _, wholem) when op.idText = "op_LessThan" -> // Look in the function expression @@ -290,13 +290,13 @@ module internal ParameterLocationsImpl = match fResult with | Some _ -> fResult | _ -> - let typeArgsm = mkRange openm.FileName openm.Start wholem.End + let typeArgsm = mkRange mLess.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos then // We found it, dig out ident match digOutIdentFromFuncExpr synExpr with - | Some (lid, lidRange) -> - Some(ParameterLocations(lid, lidRange, op.idRange.Start, [], [ wholem.End ], false, [])) + | Some (lid, mLongId) -> + Some(ParameterLocations(lid, mLongId, op.idRange.Start, [], [ wholem.End ], false, [])) | None -> None else None @@ -316,8 +316,8 @@ module internal ParameterLocationsImpl = | Found (parenLoc, argRanges, commasAndCloseParen, isThereACloseParen), _ -> // We found it, dig out ident match digOutIdentFromFuncExpr synExpr with - | Some (lid, lidRange) -> - assert (isInfix = (posLt parenLoc lidRange.End)) + | Some (lid, mLongId) -> + assert (isInfix = (posLt parenLoc mLongId.End)) if isInfix then // This seems to be an infix operator, since the start of the argument is a position earlier than the end of the long-id being applied to it. @@ -327,7 +327,7 @@ module internal ParameterLocationsImpl = Some( ParameterLocations( lid, - lidRange, + mLongId, parenLoc, argRanges, commasAndCloseParen |> List.map fst, @@ -340,11 +340,11 @@ module internal ParameterLocationsImpl = | _ -> traverseSynExpr synExpr2 // ID and error recovery of these - | SynExpr.TypeApp (synExpr, openm, tyArgs, commas, closemOpt, _, wholem) -> + | SynExpr.TypeApp (synExpr, mLess, tyArgs, commas, mGreaterOpt, _, wholem) -> match traverseSynExpr synExpr with | Some _ as r -> r | None -> - let typeArgsm = mkRange openm.FileName openm.Start wholem.End + let typeArgsm = mkRange mLess.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos @@ -364,10 +364,10 @@ module internal ParameterLocationsImpl = ParameterLocations( [ "dummy" ], synExpr.Range, - openm.Start, + mLess.Start, argRanges, commasAndCloseParen, - closemOpt.IsSome, + mGreaterOpt.IsSome, tyArgs |> List.map digOutIdentFromStaticArg ) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 757cd90a264..a7ffb760e5a 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -476,8 +476,8 @@ module ParsedInput = ] |> pick expr - | SynExpr.DotGet (exprLeft, dotm, lidwd, _m) -> - let afterDotBeforeLid = mkRange dotm.FileName dotm.End lidwd.Range.Start + | SynExpr.DotGet (exprLeft, mDot, lidwd, _m) -> + let afterDotBeforeLid = mkRange mDot.FileName mDot.End lidwd.Range.Start [ dive exprLeft exprLeft.Range traverseSynExpr diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index 995e4e4d3e9..cbc625f709b 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -364,30 +364,30 @@ module Structure = members = ms extraImpls = extraImpls newExprRange = newRange - range = wholeRange) -> + range = mWhole) -> let bindings = unionBindingAndMembers bindings ms match argOpt with | Some (args, _) -> - let collapse = Range.endToEnd args.Range wholeRange - rcheck Scope.ObjExpr Collapse.Below wholeRange collapse + let collapse = Range.endToEnd args.Range mWhole + rcheck Scope.ObjExpr Collapse.Below mWhole collapse | None -> - let collapse = Range.endToEnd newRange wholeRange - rcheck Scope.ObjExpr Collapse.Below wholeRange collapse + let collapse = Range.endToEnd newRange mWhole + rcheck Scope.ObjExpr Collapse.Below mWhole collapse parseBindings bindings parseExprInterfaces extraImpls - | SynExpr.TryWith (e, matchClauses, wholeRange, tryPoint, withPoint, _trivia) -> + | SynExpr.TryWith (e, matchClauses, mWhole, tryPoint, withPoint, _trivia) -> match tryPoint, withPoint with | DebugPointAtTry.Yes tryRange, DebugPointAtWith.Yes withRange -> - let fullrange = Range.startToEnd tryRange wholeRange - let collapse = Range.endToEnd tryRange wholeRange + let mFull = Range.startToEnd tryRange mWhole + let collapse = Range.endToEnd tryRange mWhole let collapseTry = Range.endToStart tryRange withRange let fullrangeTry = Range.startToStart tryRange withRange - let collapseWith = Range.endToEnd withRange wholeRange - let fullrangeWith = Range.startToEnd withRange wholeRange - rcheck Scope.TryWith Collapse.Below fullrange collapse + let collapseWith = Range.endToEnd withRange mWhole + let fullrangeWith = Range.startToEnd withRange mWhole + rcheck Scope.TryWith Collapse.Below mFull collapse rcheck Scope.TryInTryWith Collapse.Below fullrangeTry collapseTry rcheck Scope.WithInTryWith Collapse.Below fullrangeWith collapseWith | _ -> () @@ -399,10 +399,10 @@ module Structure = match tryPoint, finallyPoint with | DebugPointAtTry.Yes tryRange, DebugPointAtFinally.Yes finallyRange -> let collapse = Range.endToEnd tryRange finallyExpr.Range - let fullrange = Range.startToEnd tryRange finallyExpr.Range + let mFull = Range.startToEnd tryRange finallyExpr.Range let collapseFinally = Range.endToEnd finallyRange r let fullrangeFinally = Range.startToEnd finallyRange r - rcheck Scope.TryFinally Collapse.Below fullrange collapse + rcheck Scope.TryFinally Collapse.Below mFull collapse rcheck Scope.FinallyInTryFinally Collapse.Below fullrangeFinally collapseFinally | _ -> () @@ -418,9 +418,9 @@ module Structure = match spIfToThen with | DebugPointAtBinding.Yes rt -> // Outline the entire IfThenElse - let fullrange = Range.startToEnd rt r + let mFull = Range.startToEnd rt r let collapse = Range.endToEnd ifExpr.Range r - rcheck Scope.IfThenElse Collapse.Below fullrange collapse + rcheck Scope.IfThenElse Collapse.Below mFull collapse // Outline the `then` scope let thenRange = Range.endToEnd (Range.modEnd -4 trivia.IfToThenRange) thenExpr.Range let thenCollapse = Range.endToEnd trivia.IfToThenRange thenExpr.Range @@ -653,24 +653,24 @@ module Structure = | _ -> () and parseTypeDefn typeDefn = - let (SynTypeDefn (typeInfo = typeInfo; typeRepr = objectModel; members = members; range = fullrange)) = + let (SynTypeDefn (typeInfo = typeInfo; typeRepr = objectModel; members = members; range = mFull)) = typeDefn let (SynComponentInfo (typeParams = TyparDecls typeArgs; range = r)) = typeInfo let typeArgsRange = rangeOfTypeArgsElse r typeArgs - let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) fullrange + let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) mFull match objectModel with | SynTypeDefnRepr.ObjectModel (defnKind, objMembers, r) -> match defnKind with - | SynTypeDefnKind.Augmentation _ -> rcheck Scope.TypeExtension Collapse.Below fullrange collapse - | _ -> rcheck Scope.Type Collapse.Below fullrange collapse + | SynTypeDefnKind.Augmentation _ -> rcheck Scope.TypeExtension Collapse.Below mFull collapse + | _ -> rcheck Scope.Type Collapse.Below mFull collapse List.iter (parseSynMemberDefn r) objMembers // visit the members of a type extension List.iter (parseSynMemberDefn r) members | SynTypeDefnRepr.Simple (simpleRepr, r) -> - rcheck Scope.Type Collapse.Below fullrange collapse + rcheck Scope.Type Collapse.Below mFull collapse parseSimpleRepr simpleRepr List.iter (parseSynMemberDefn r) members | SynTypeDefnRepr.Exception _ -> () @@ -774,12 +774,12 @@ module Structure = let parseModuleOrNamespace (SynModuleOrNamespace (longId, _, kind, decls, _, attribs, _, r, _)) = parseAttributes attribs let idRange = longIdentRange longId - let fullrange = Range.startToEnd idRange r + let mFull = Range.startToEnd idRange r let collapse = Range.endToEnd idRange r // do not return range for top level implicit module in scripts if kind = SynModuleOrNamespaceKind.NamedModule then - rcheck Scope.Module Collapse.Below fullrange collapse + rcheck Scope.Module Collapse.Below mFull collapse collectHashDirectives decls collectOpens decls @@ -893,9 +893,9 @@ module Structure = | SynMemberSig.Member (valSigs, _, r) -> let collapse = Range.endToEnd valSigs.RangeOfId r rcheck Scope.Member Collapse.Below r collapse - | SynMemberSig.ValField (SynField (attrs, _, _, _, _, _, _, fr), fullrange) -> - let collapse = Range.endToEnd fr fullrange - rcheck Scope.Val Collapse.Below fullrange collapse + | SynMemberSig.ValField (SynField (attrs, _, _, _, _, _, _, fr), mFull) -> + let collapse = Range.endToEnd fr mFull + rcheck Scope.Val Collapse.Below mFull collapse parseAttributes attrs | SynMemberSig.Interface (tp, r) -> rcheck Scope.Interface Collapse.Below r (Range.endToEnd tp.Range r) | SynMemberSig.NestedType (typeDefSig, _r) -> parseTypeDefnSig typeDefSig @@ -913,8 +913,8 @@ module Structure = let typeArgsRange = rangeOfTypeArgsElse r typeArgs let rangeEnd = lastMemberSigRangeElse r memberSigs let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) rangeEnd - let fullrange = Range.startToEnd (longIdentRange longId) rangeEnd - fullrange, collapse + let mFull = Range.startToEnd (longIdentRange longId) rangeEnd + mFull, collapse List.iter parseSynMemberDefnSig memberSigs @@ -922,23 +922,23 @@ module Structure = // matches against a type declaration with <'T, ...> and (args, ...) | SynTypeDefnSigRepr.ObjectModel (SynTypeDefnKind.Unspecified, objMembers, _) -> List.iter parseSynMemberDefnSig objMembers - let fullrange, collapse = makeRanges objMembers - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.Type Collapse.Below mFull collapse | SynTypeDefnSigRepr.ObjectModel (kind = SynTypeDefnKind.Augmentation _; memberSigs = objMembers) -> - let fullrange, collapse = makeRanges objMembers - rcheck Scope.TypeExtension Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.TypeExtension Collapse.Below mFull collapse List.iter parseSynMemberDefnSig objMembers | SynTypeDefnSigRepr.ObjectModel (_, objMembers, _) -> - let fullrange, collapse = makeRanges objMembers - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.Type Collapse.Below mFull collapse List.iter parseSynMemberDefnSig objMembers // visit the members of a type extension | SynTypeDefnSigRepr.Simple (simpleRepr, _) -> - let fullrange, collapse = makeRanges memberSigs - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges memberSigs + rcheck Scope.Type Collapse.Below mFull collapse parseSimpleRepr simpleRepr | SynTypeDefnSigRepr.Exception _ -> () @@ -1021,8 +1021,8 @@ module Structure = let rangeEnd = lastModuleSigDeclRangeElse moduleRange decls // Outline the full scope of the module let collapse = Range.endToEnd cmpRange rangeEnd - let fullrange = Range.startToEnd moduleRange rangeEnd - rcheck Scope.Module Collapse.Below fullrange collapse + let mFull = Range.startToEnd moduleRange rangeEnd + rcheck Scope.Module Collapse.Below mFull collapse // A module's component info stores the ranges of its attributes parseAttributes attrs collectSigOpens decls @@ -1034,11 +1034,11 @@ module Structure = parseAttributes attribs let rangeEnd = lastModuleSigDeclRangeElse r decls let idrange = longIdentRange longId - let fullrange = Range.startToEnd idrange rangeEnd + let mFull = Range.startToEnd idrange rangeEnd let collapse = Range.endToEnd idrange rangeEnd if kind.IsModule then - rcheck Scope.Module Collapse.Below fullrange collapse + rcheck Scope.Module Collapse.Below mFull collapse collectSigHashDirectives decls collectSigOpens decls diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 24ffc3cb042..0de02d99948 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -348,12 +348,12 @@ module FSharpExprConvert = | TOp.UnionCaseFieldGetAddr (uref, n, _), [arg], _ -> mkUnionCaseFieldGetProvenViaExprAddr (exprOfExprAddr cenv arg, uref, tyargs, n, m) | TOp.ILAsm ([ I_ldflda fspec ], retTypes), [arg], _ -> mkAsmExpr ([ mkNormalLdfld fspec ], tyargs, [exprOfExprAddr cenv arg], retTypes, m) | TOp.ILAsm ([ I_ldsflda fspec ], retTypes), _, _ -> mkAsmExpr ([ mkNormalLdsfld fspec ], tyargs, args, retTypes, m) - | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemty] -> + | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemTy] -> match shape.Rank, idxs with - | 1, [idx1] -> mkCallArrayGet g m elemty arr idx1 - | 2, [idx1; idx2] -> mkCallArray2DGet g m elemty arr idx1 idx2 - | 3, [idx1; idx2; idx3] -> mkCallArray3DGet g m elemty arr idx1 idx2 idx3 - | 4, [idx1; idx2; idx3; idx4] -> mkCallArray4DGet g m elemty arr idx1 idx2 idx3 idx4 + | 1, [idx1] -> mkCallArrayGet g m elemTy arr idx1 + | 2, [idx1; idx2] -> mkCallArray2DGet g m elemTy arr idx1 idx2 + | 3, [idx1; idx2; idx3] -> mkCallArray3DGet g m elemTy arr idx1 idx2 idx3 + | 4, [idx1; idx2; idx3; idx4] -> mkCallArray4DGet g m elemTy arr idx1 idx2 idx3 idx4 | _ -> expr | _ -> expr | _ -> expr @@ -618,7 +618,7 @@ module FSharpExprConvert = let bodyR = ConvExpr cenv env body FSharpObjectExprOverride(sgn, tpsR, vslR, bodyR) ] let overridesR = ConvertMethods overrides - let iimplsR = List.map (fun (ity, impls) -> ConvType cenv ity, ConvertMethods impls) iimpls + let iimplsR = iimpls |> List.map (fun (intfTy, impls) -> ConvType cenv intfTy, ConvertMethods impls) E.ObjectExpr(ConvType cenv ty, basecallR, overridesR, iimplsR) @@ -702,8 +702,8 @@ module FSharpExprConvert = let argR = ConvExpr cenv env arg E.ILFieldSet(None, typR, fspec.Name, argR) - | TOp.ILAsm ([ ], [tty]), _, [arg] -> - match tty with + | TOp.ILAsm ([ ], [tgtTy]), _, [arg] -> + match tgtTy with | TTypeConvOp cenv convOp -> let ty = tyOfExpr g arg let op = convOp g m ty arg @@ -992,7 +992,7 @@ module FSharpExprConvert = let parent = ILTypeRef.Create(e.Scope, e.Enclosing.Tail, e.Enclosing.Head) Import.ImportILTypeRef cenv.amap m parent, Some e.Name - let enclosingType = generalizedTyconRef g tcref + let enclosingTy = generalizedTyconRef g tcref let makeCall minfo = ConvObjectModelCallLinear cenv env (isNewObj, minfo, enclTypeArgs, methTypeArgs, [], callArgs) id @@ -1000,7 +1000,7 @@ module FSharpExprConvert = let makeFSCall isMember (vr: ValRef) = let memOrVal = if isMember then - let minfo = MethInfo.FSMeth(g, enclosingType, vr, None) + let minfo = MethInfo.FSMeth(g, enclosingTy, vr, None) FSharpMemberOrFunctionOrValue(cenv, minfo) else FSharpMemberOrFunctionOrValue(cenv, vr) @@ -1117,7 +1117,7 @@ module FSharpExprConvert = if tcref.IsILTycon then try let mdef = resolveILMethodRefWithRescope unscopeILType tcref.ILTyconRawMetadata ilMethRef - let minfo = MethInfo.CreateILMeth(cenv.amap, m, enclosingType, mdef) + let minfo = MethInfo.CreateILMeth(cenv.amap, m, enclosingTy, mdef) FSharpMemberOrFunctionOrValue(cenv, minfo) |> makeCall |> Some with _ -> None @@ -1155,12 +1155,12 @@ module FSharpExprConvert = let argTys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadata cenv.amap m scoref tinst1 tinst2) ] let retTy = match ImportReturnTypeFromMetadata cenv.amap m ilMethRef.ReturnType (fun _ -> emptyILCustomAttrs) scoref tinst1 tinst2 with - | None -> if isCtor then enclosingType else g.unit_ty + | None -> if isCtor then enclosingTy else g.unit_ty | Some ty -> ty let linkageType = let ty = mkIteratedFunTy g (List.map (mkRefTupledTy g) argTys) retTy - let ty = if isStatic then ty else mkFunTy g enclosingType ty + let ty = if isStatic then ty else mkFunTy g enclosingTy ty mkForallTyIfNeeded (typars1 @ typars2) ty let argCount = List.sum (List.map List.length argTys) + (if isStatic then 0 else 1) @@ -1325,9 +1325,9 @@ module FSharpExprConvert = let env = { env with suppressWitnesses = true } ConvExpr cenv env eq E.IfThenElse (eqR, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) - | DecisionTreeTest.IsInst (_srcty, tgty) -> + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> let e1R = ConvExpr cenv env inpExpr - E.IfThenElse (E.TypeTest (ConvType cenv tgty, e1R) |> Mk cenv m g.bool_ty, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) + E.IfThenElse (E.TypeTest (ConvType cenv tgtTy, e1R) |> Mk cenv m g.bool_ty, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) | DecisionTreeTest.ActivePatternCase _ -> wfail("unexpected Test.ActivePatternCase test in quoted expression", m) | DecisionTreeTest.ArrayLength _ -> wfail("FSharp.Compiler.Service cannot yet return array pattern matching", m) | DecisionTreeTest.Error m -> wfail("error recovery", m) diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index f65cd4541cc..c265024fc40 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -631,9 +631,9 @@ module internal SymbolHelpers = match item with | Item.Types(_name, tys) -> match tys with - | [AppTy g (tyconRef, _typeInst)] -> - if tyconRef.IsProvidedErasedTycon || tyconRef.IsProvidedGeneratedTycon then - Some tyconRef + | [AppTy g (tcref, _typeInst)] -> + if tcref.IsProvidedErasedTycon || tcref.IsProvidedGeneratedTycon then + Some tcref else None | _ -> None @@ -644,10 +644,10 @@ module internal SymbolHelpers = match item with | Item.Types(_name, tys) -> match tys with - | [AppTy g (tyconRef, _typeInst)] -> - if tyconRef.IsProvidedErasedTycon || tyconRef.IsProvidedGeneratedTycon then + | [AppTy g (tcref, _typeInst)] -> + if tcref.IsProvidedErasedTycon || tcref.IsProvidedGeneratedTycon then let typeBeforeArguments = - match tyconRef.TypeReprInfo with + match tcref.TypeReprInfo with | TProvidedTypeRepr info -> info.ProvidedType | _ -> failwith "unreachable" let staticParameters = typeBeforeArguments.PApplyWithProvider((fun (typeBeforeArguments, provider) -> typeBeforeArguments.GetStaticParameters provider), range=m) diff --git a/src/Compiler/Symbols/SymbolPatterns.fs b/src/Compiler/Symbols/SymbolPatterns.fs index bddfe60e135..e44375cb97c 100644 --- a/src/Compiler/Symbols/SymbolPatterns.fs +++ b/src/Compiler/Symbols/SymbolPatterns.fs @@ -43,7 +43,7 @@ module FSharpSymbolPatterns = if entity.IsFSharpAbbreviation then match entity.AbbreviatedType with | TypeWithDefinition def -> getEntityAbbreviatedType def - | abbreviatedType -> entity, Some abbreviatedType + | abbreviatedTy -> entity, Some abbreviatedTy else entity, None let (|Attribute|_|) (entity: FSharpEntity) = @@ -151,12 +151,12 @@ module FSharpSymbolPatterns = | _ -> false if isMutable then Some() else None - /// Entity (originalEntity, abbreviatedEntity, abbreviatedType) + /// Entity (originalEntity, abbreviatedEntity, abbreviatedTy) let (|FSharpEntity|_|) (symbol: FSharpSymbol) = match symbol with | :? FSharpEntity as entity -> - let abbreviatedEntity, abbreviatedType = getEntityAbbreviatedType entity - Some (entity, abbreviatedEntity, abbreviatedType) + let abbreviatedEntity, abbreviatedTy = getEntityAbbreviatedType entity + Some (entity, abbreviatedEntity, abbreviatedTy) | _ -> None let (|Parameter|_|) (symbol: FSharpSymbol) = diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 6475f93a08d..602ccb7459d 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -350,7 +350,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C member sym.TryGetAttribute<'T>() = sym.Attributes |> Seq.tryFind (fun attr -> attr.IsAttribute<'T>()) -type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = +type FSharpEntity(cenv: SymbolEnv, entity: EntityRef) = inherit FSharpSymbol(cenv, (fun () -> checkEntityIsResolved entity @@ -588,8 +588,8 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = if isUnresolved() then makeReadOnlyCollection [] else let ty = generalizedTyconRef cenv.g entity DiagnosticsLogger.protectAssemblyExploration [] (fun () -> - [ for ity in GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes cenv.g cenv.amap range0 ty do - yield FSharpType(cenv, ity) ]) + [ for intfTy in GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes cenv.g cenv.amap range0 ty do + yield FSharpType(cenv, intfTy) ]) |> makeReadOnlyCollection member _.AllInterfaces = @@ -642,10 +642,13 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = else for minfo in GetImmediateIntrinsicMethInfosOfType (None, AccessibleFromSomeFSharpCode) cenv.g cenv.amap range0 entityTy do yield createMember minfo + let props = GetImmediateIntrinsicPropInfosOfType (None, AccessibleFromSomeFSharpCode) cenv.g cenv.amap range0 entityTy let events = cenv.infoReader.GetImmediateIntrinsicEventsOfType (None, AccessibleFromSomeFSharpCode, range0, entityTy) + for pinfo in props do yield FSharpMemberOrFunctionOrValue(cenv, P pinfo, Item.Property (pinfo.PropertyName, [pinfo])) + for einfo in events do yield FSharpMemberOrFunctionOrValue(cenv, E einfo, Item.Event einfo) @@ -657,8 +660,8 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = let vref = mkNestedValRef entity v yield FSharpMemberOrFunctionOrValue(cenv, V vref, Item.Value vref) match v.MemberInfo.Value.MemberFlags.MemberKind, v.ApparentEnclosingEntity with - | SynMemberKind.PropertyGet, Parent p -> - let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g p, Some vref, None) + | SynMemberKind.PropertyGet, Parent tcref -> + let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g tcref, Some vref, None) yield FSharpMemberOrFunctionOrValue(cenv, P pinfo, Item.Property (pinfo.PropertyName, [pinfo])) | SynMemberKind.PropertySet, Parent p -> let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g p, None, Some vref) @@ -1306,7 +1309,7 @@ type FSharpActivePatternGroup(cenv, apinfo:ActivePatternInfo, ty, valOpt) = |> Option.bind (fun vref -> match vref.DeclaringEntity with | ParentNone -> None - | Parent p -> Some (FSharpEntity(cenv, p))) + | Parent tcref -> Some (FSharpEntity(cenv, tcref))) type FSharpGenericParameter(cenv, v:Typar) = @@ -1411,7 +1414,7 @@ type FSharpAbstractSignature(cenv, info: SlotSig) = member _.Name = info.Name - member _.DeclaringType = FSharpType(cenv, info.ImplementedType) + member _.DeclaringType = FSharpType(cenv, info.DeclaringType) type FSharpGenericParameterMemberConstraint(cenv, info: TraitConstraintInfo) = let (TTrait(tys, nm, flags, atys, retTy, _)) = info @@ -2076,7 +2079,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | E e -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods let retTy = - try PropTypOfEventInfo cenv.infoReader range0 AccessibleFromSomewhere e + try PropTypeOfEventInfo cenv.infoReader range0 AccessibleFromSomewhere e with _ -> // For non-standard events, just use the delegate type as the ReturnParameter type e.GetDelegateType(cenv.amap, range0) @@ -2197,17 +2200,17 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = member _.IsValCompiledAsMethod = match d with - | V valRef -> IlxGen.IsFSharpValCompiledAsMethod cenv.g valRef.Deref + | V vref -> IlxGen.IsFSharpValCompiledAsMethod cenv.g vref.Deref | _ -> false member _.IsValue = match d with - | V valRef -> not (isForallFunctionTy cenv.g valRef.Type) + | V vref -> not (isForallFunctionTy cenv.g vref.Type) | _ -> false member _.IsFunction = match d with - | V valRef -> isForallFunctionTy cenv.g valRef.Type + | V vref -> isForallFunctionTy cenv.g vref.Type | _ -> false override x.Equals(other: obj) = @@ -2326,7 +2329,7 @@ type FSharpType(cenv, ty:TType) = DiagnosticsLogger.protectAssemblyExploration true <| fun () -> match stripTyparEqns ty with | TType_app (tcref, _, _) -> FSharpEntity(cenv, tcref).IsUnresolved - | TType_measure (Measure.Con tcref) -> FSharpEntity(cenv, tcref).IsUnresolved + | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref).IsUnresolved | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr).IsUnresolved | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr).IsUnresolved | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr).IsUnresolved @@ -2342,7 +2345,7 @@ type FSharpType(cenv, ty:TType) = isResolved() && protect <| fun () -> match stripTyparEqns ty with - | TType_app _ | TType_measure (Measure.Con _ | Measure.Prod _ | Measure.Inv _ | Measure.One _) -> true + | TType_app _ | TType_measure (Measure.Const _ | Measure.Prod _ | Measure.Inv _ | Measure.One _) -> true | _ -> false member _.IsTupleType = @@ -2363,7 +2366,7 @@ type FSharpType(cenv, ty:TType) = protect <| fun () -> match stripTyparEqns ty with | TType_app (tcref, _, _) -> FSharpEntity(cenv, tcref) - | TType_measure (Measure.Con tcref) -> FSharpEntity(cenv, tcref) + | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref) | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr) | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr) | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr) @@ -2375,8 +2378,8 @@ type FSharpType(cenv, ty:TType) = | TType_anon (_, tyargs) | TType_app (_, tyargs, _) | TType_tuple (_, tyargs) -> (tyargs |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection) - | TType_fun(d, r, _) -> [| FSharpType(cenv, d); FSharpType(cenv, r) |] |> makeReadOnlyCollection - | TType_measure (Measure.Con _) -> [| |] |> makeReadOnlyCollection + | TType_fun(domainTy, rangeTy, _) -> [| FSharpType(cenv, domainTy); FSharpType(cenv, rangeTy) |] |> makeReadOnlyCollection + | TType_measure (Measure.Const _) -> [| |] |> makeReadOnlyCollection | TType_measure (Measure.Prod (t1, t2)) -> [| FSharpType(cenv, TType_measure t1); FSharpType(cenv, TType_measure t2) |] |> makeReadOnlyCollection | TType_measure Measure.One -> [| |] |> makeReadOnlyCollection | TType_measure (Measure.Inv t1) -> [| FSharpType(cenv, TType_measure t1) |] |> makeReadOnlyCollection @@ -2443,8 +2446,8 @@ type FSharpType(cenv, ty:TType) = |> Option.map (fun ty -> FSharpType(cenv, ty)) member _.Instantiate(instantiation:(FSharpGenericParameter * FSharpType) list) = - let typI = instType (instantiation |> List.map (fun (tyv, ty) -> tyv.TypeParameter, ty.Type)) ty - FSharpType(cenv, typI) + let resTy = instType (instantiation |> List.map (fun (tyv, ty) -> tyv.TypeParameter, ty.Type)) ty + FSharpType(cenv, resTy) member _.Type = ty member private x.cenv = cenv @@ -2469,7 +2472,7 @@ type FSharpType(cenv, ty:TType) = | TType_app (tc1, b1, _) -> 10200 + int32 tc1.Stamp + List.sumBy hashType b1 | TType_ucase _ -> 10300 // shouldn't occur in symbols | TType_tuple (_, l1) -> 10400 + List.sumBy hashType l1 - | TType_fun (dty, rty, _) -> 10500 + hashType dty + hashType rty + | TType_fun (domainTy, rangeTy, _) -> 10500 + hashType domainTy + hashType rangeTy | TType_measure _ -> 10600 | TType_anon (_,l1) -> 10800 + List.sumBy hashType l1 hashType ty @@ -2593,9 +2596,9 @@ type FSharpStaticParameter(cenv, sp: Tainted< TypeProviders.ProvidedParameterInf inherit FSharpSymbol(cenv, (fun () -> protect <| fun () -> - let spKind = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) + let paramTy = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) let nm = sp.PUntaint((fun p -> p.Name), m) - Item.ArgName((mkSynId m nm, spKind, None))), + Item.ArgName((mkSynId m nm, paramTy, None))), (fun _ _ _ -> true)) member _.Name = diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 546a1b1ade7..1834bb0fbf7 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -373,12 +373,12 @@ let mkSynOperator (opm: range) (oper: string) = let mkSynInfix opm (l: SynExpr) oper (r: SynExpr) = let firstTwoRange = unionRanges l.Range opm - let wholeRange = unionRanges l.Range r.Range + let mWhole = unionRanges l.Range r.Range let app1 = SynExpr.App(ExprAtomicFlag.NonAtomic, true, mkSynOperator opm oper, l, firstTwoRange) - SynExpr.App(ExprAtomicFlag.NonAtomic, false, app1, r, wholeRange) + SynExpr.App(ExprAtomicFlag.NonAtomic, false, app1, r, mWhole) let mkSynBifix m oper x1 x2 = let app1 = SynExpr.App(ExprAtomicFlag.NonAtomic, true, mkSynOperator m oper, x1, m) @@ -417,17 +417,17 @@ let mkSynDotBrackGet m mDot a b = SynExpr.DotIndexedGet(a, b, mDot, m) let mkSynQMarkSet m a b c = mkSynTrifix m qmarkSet a b c -let mkSynDotParenGet lhsm dotm a b = +let mkSynDotParenGet mLhs mDot a b = match b with | SynExpr.Tuple (false, [ _; _ ], _, _) -> - errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), lhsm)) - SynExpr.Const(SynConst.Unit, lhsm) + errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), mLhs)) + SynExpr.Const(SynConst.Unit, mLhs) | SynExpr.Tuple (false, [ _; _; _ ], _, _) -> - errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), lhsm)) - SynExpr.Const(SynConst.Unit, lhsm) + errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), mLhs)) + SynExpr.Const(SynConst.Unit, mLhs) - | _ -> mkSynInfix dotm a parenGet b + | _ -> mkSynInfix mDot a parenGet b let mkSynUnit m = SynExpr.Const(SynConst.Unit, m) @@ -452,24 +452,24 @@ let mkSynAssign (l: SynExpr) (r: SynExpr) = | SynExpr.App (_, _, SynExpr.DotGet (e, _, v, _), x, _) -> SynExpr.DotNamedIndexedPropertySet(e, v, x, r, m) | l -> SynExpr.Set(l, r, m) -let mkSynDot dotm m l (SynIdent (r, rTrivia)) = +let mkSynDot mDot m l (SynIdent (r, rTrivia)) = match l with | SynExpr.LongIdent (isOpt, SynLongIdent (lid, dots, trivia), None, _) -> // REVIEW: MEMORY PERFORMANCE: This list operation is memory intensive (we create a lot of these list nodes) - SynExpr.LongIdent(isOpt, SynLongIdent(lid @ [ r ], dots @ [ dotm ], trivia @ [ rTrivia ]), None, m) - | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id; r ], [ dotm ], [ None; rTrivia ]), None, m) + SynExpr.LongIdent(isOpt, SynLongIdent(lid @ [ r ], dots @ [ mDot ], trivia @ [ rTrivia ]), None, m) + | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id; r ], [ mDot ], [ None; rTrivia ]), None, m) | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) - SynExpr.DotGet(e, dm, SynLongIdent(lid @ [ r ], dots @ [ dotm ], trivia @ [ rTrivia ]), m) - | expr -> SynExpr.DotGet(expr, dotm, SynLongIdent([ r ], [], [ rTrivia ]), m) + SynExpr.DotGet(e, dm, SynLongIdent(lid @ [ r ], dots @ [ mDot ], trivia @ [ rTrivia ]), m) + | expr -> SynExpr.DotGet(expr, mDot, SynLongIdent([ r ], [], [ rTrivia ]), m) -let mkSynDotMissing dotm m l = +let mkSynDotMissing mDot m l = match l with | SynExpr.LongIdent (isOpt, SynLongIdent (lid, dots, trivia), None, _) -> // REVIEW: MEMORY PERFORMANCE: This list operation is memory intensive (we create a lot of these list nodes) - SynExpr.LongIdent(isOpt, SynLongIdent(lid, dots @ [ dotm ], trivia), None, m) - | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ dotm ], []), None, m) - | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> SynExpr.DotGet(e, dm, SynLongIdent(lid, dots @ [ dotm ], trivia), m) // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) + SynExpr.LongIdent(isOpt, SynLongIdent(lid, dots @ [ mDot ], trivia), None, m) + | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ mDot ], []), None, m) + | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> SynExpr.DotGet(e, dm, SynLongIdent(lid, dots @ [ mDot ], trivia), m) // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) | expr -> SynExpr.DiscardAfterMissingQualificationAfterDot(expr, m) let mkSynFunMatchLambdas synArgNameGenerator isMember wholem ps arrow e = @@ -974,9 +974,9 @@ let (|ParsedHashDirectiveArguments|) (input: ParsedHashDirectiveArgument list) = | ParsedHashDirectiveArgument.SourceIdentifier (_, v, _) -> v) input -let prependIdentInLongIdentWithTrivia (SynIdent (ident, identTrivia)) dotm lid = +let prependIdentInLongIdentWithTrivia (SynIdent (ident, identTrivia)) mDot lid = match lid with - | SynLongIdent (lid, dots, trivia) -> SynLongIdent(ident :: lid, dotm :: dots, identTrivia :: trivia) + | SynLongIdent (lid, dots, trivia) -> SynLongIdent(ident :: lid, mDot :: dots, identTrivia :: trivia) let mkDynamicArgExpr expr = match expr with diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index edda8d21d5b..0c7010b40fa 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -143,7 +143,7 @@ val mkSynQMarkSet: m: range -> a: SynExpr -> b: SynExpr -> c: SynExpr -> SynExpr //val mkSynDotBrackSeqSliceGet: m:range -> mDot:range -> arr:SynExpr -> argsList:SynIndexerArg list -> SynExpr -val mkSynDotParenGet: lhsm: range -> dotm: range -> a: SynExpr -> b: SynExpr -> SynExpr +val mkSynDotParenGet: mLhs: range -> mDot: range -> a: SynExpr -> b: SynExpr -> SynExpr val mkSynUnit: m: range -> SynExpr @@ -153,9 +153,9 @@ val mkSynDelay: m: range -> e: SynExpr -> SynExpr val mkSynAssign: l: SynExpr -> r: SynExpr -> SynExpr -val mkSynDot: dotm: range -> m: range -> l: SynExpr -> r: SynIdent -> SynExpr +val mkSynDot: mDot: range -> m: range -> l: SynExpr -> r: SynIdent -> SynExpr -val mkSynDotMissing: dotm: range -> m: range -> l: SynExpr -> SynExpr +val mkSynDotMissing: mDot: range -> m: range -> l: SynExpr -> SynExpr val mkSynFunMatchLambdas: synArgNameGenerator: SynArgNameGenerator -> @@ -337,7 +337,7 @@ val (|SynPipeRight2|_|): SynExpr -> (SynExpr * SynExpr * SynExpr) option /// 'e1 |||> e2' val (|SynPipeRight3|_|): SynExpr -> (SynExpr * SynExpr * SynExpr * SynExpr) option -val prependIdentInLongIdentWithTrivia: ident: SynIdent -> dotm: range -> lid: SynLongIdent -> SynLongIdent +val prependIdentInLongIdentWithTrivia: ident: SynIdent -> mDot: range -> lid: SynLongIdent -> SynLongIdent val mkDynamicArgExpr: expr: SynExpr -> SynExpr diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 51060755e80..cf248940c9a 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -564,8 +564,8 @@ type TcGlobals( let tryDecodeTupleTy tupInfo l = match l with - | [t1;t2;t3;t4;t5;t6;t7;marker] -> - match marker with + | [t1;t2;t3;t4;t5;t6;t7;markerTy] -> + match markerTy with | TType_app(tcref, [t8], _) when tyconRefEq tcref v_ref_tuple1_tcr -> mkRawRefTupleTy [t1;t2;t3;t4;t5;t6;t7;t8] |> Some | TType_app(tcref, [t8], _) when tyconRefEq tcref v_struct_tuple1_tcr -> mkRawStructTupleTy [t1;t2;t3;t4;t5;t6;t7;t8] |> Some | TType_tuple (_structness2, t8plus) -> TType_tuple (tupInfo, [t1;t2;t3;t4;t5;t6;t7] @ t8plus) |> Some @@ -1832,11 +1832,11 @@ type TcGlobals( let info = makeOtherIntrinsicValRef (fslib_MFOperators_nleref, lower, None, Some nm, [vara], ([[varaTy]], varaTy)) let tyargs = [aty] Some (info, tyargs, argExprs) - | "get_Item", [arrTy; _], Some rty, [_; _] when isArrayTy g arrTy -> - Some (g.array_get_info, [rty], argExprs) - | "set_Item", [arrTy; _; ety], _, [_; _; _] when isArrayTy g arrTy -> - Some (g.array_set_info, [ety], argExprs) - | "get_Item", [sty; _; _], _, [_; _] when isStringTy g sty -> + | "get_Item", [arrTy; _], Some retTy, [_; _] when isArrayTy g arrTy -> + Some (g.array_get_info, [retTy], argExprs) + | "set_Item", [arrTy; _; elemTy], _, [_; _; _] when isArrayTy g arrTy -> + Some (g.array_set_info, [elemTy], argExprs) + | "get_Item", [stringTy; _; _], _, [_; _] when isStringTy g stringTy -> Some (g.getstring_info, [], argExprs) | "op_UnaryPlus", [aty], _, [_] -> // Call Operators.id diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 2d3f8c0943f..d71fd222745 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -1156,7 +1156,7 @@ type Entity = member x.MembersOfFSharpTyconSorted = x.TypeContents.tcaug_adhoc |> NameMultiMap.rangeReversingEachBucket - |> List.filter (fun v -> not v.IsCompilerGenerated) + |> List.filter (fun vref -> not vref.IsCompilerGenerated) /// Gets all immediate members of an F# type definition keyed by name, including compiler-generated ones. /// Note: result is a indexed table, and for each name the results are in reverse declaration order @@ -1179,16 +1179,16 @@ type Entity = member x.AllGeneratedValues = [ match x.GeneratedCompareToValues with | None -> () - | Some (v1, v2) -> yield v1; yield v2 + | Some (vref1, vref2) -> yield vref1; yield vref2 match x.GeneratedCompareToWithComparerValues with | None -> () | Some v -> yield v match x.GeneratedHashAndEqualsValues with | None -> () - | Some (v1, v2) -> yield v1; yield v2 + | Some (vref1, vref2) -> yield vref1; yield vref2 match x.GeneratedHashAndEqualsWithComparerValues with | None -> () - | Some (v1, v2, v3) -> yield v1; yield v2; yield v3 ] + | Some (vref1, vref2, vref3) -> yield vref1; yield vref2; yield vref3 ] /// Gets the data indicating the compiled representation of a type or module in terms of Abstract IL data structures. @@ -3720,32 +3720,32 @@ type ValRef = member x.ResolvedTarget = x.binding /// Dereference the ValRef to a Val. - member vr.Deref = - if obj.ReferenceEquals(vr.binding, null) then + member x.Deref = + if obj.ReferenceEquals(x.binding, null) then let res = - let nlr = vr.nlr + let nlr = x.nlr let e = nlr.EnclosingEntity.Deref let possible = e.ModuleOrNamespaceType.TryLinkVal(nlr.EnclosingEntity.nlr.Ccu, nlr.ItemKey) match possible with | ValueNone -> error (InternalUndefinedItemRef (FSComp.SR.tastUndefinedItemRefVal, e.DisplayNameWithStaticParameters, nlr.AssemblyName, sprintf "%+A" nlr.ItemKey.PartialKey)) | ValueSome h -> h - vr.binding <- nullableSlotFull res + x.binding <- nullableSlotFull res res - else vr.binding + else x.binding /// Dereference the ValRef to a Val option. - member vr.TryDeref = - if obj.ReferenceEquals(vr.binding, null) then + member x.TryDeref = + if obj.ReferenceEquals(x.binding, null) then let resOpt = - match vr.nlr.EnclosingEntity.TryDeref with + match x.nlr.EnclosingEntity.TryDeref with | ValueNone -> ValueNone - | ValueSome e -> e.ModuleOrNamespaceType.TryLinkVal(vr.nlr.EnclosingEntity.nlr.Ccu, vr.nlr.ItemKey) + | ValueSome e -> e.ModuleOrNamespaceType.TryLinkVal(x.nlr.EnclosingEntity.nlr.Ccu, x.nlr.ItemKey) match resOpt with | ValueNone -> () | ValueSome res -> - vr.binding <- nullableSlotFull res + x.binding <- nullableSlotFull res resOpt - else ValueSome vr.binding + else ValueSome x.binding /// The type of the value. May be a TType_forall for a generic value. /// May be a type variable or type containing type variables during type inference. @@ -3942,7 +3942,7 @@ type ValRef = /// Represents a reference to a case of a union type [] type UnionCaseRef = - | UnionCaseRef of TyconRef * string + | UnionCaseRef of tyconRef: TyconRef * caseName: string /// Get a reference to the type containing this union case member x.TyconRef = let (UnionCaseRef(tcref, _)) = x in tcref @@ -4001,7 +4001,7 @@ type UnionCaseRef = /// Represents a reference to a field in a record, class or struct [] type RecdFieldRef = - | RecdFieldRef of tcref: TyconRef * id: string + | RecdFieldRef of tyconRef: TyconRef * fieldName: string /// Get a reference to the type containing this union case member x.TyconRef = let (RecdFieldRef(tcref, _)) = x in tcref @@ -4098,7 +4098,7 @@ type TType = | TType_anon (anonInfo, _tinst) -> defaultArg anonInfo.Assembly.QualifiedName "" | TType_fun _ -> "" | TType_measure _ -> "" - | TType_var (tp, _) -> tp.Solution |> function Some sln -> sln.GetAssemblyName() | None -> "" + | TType_var (tp, _) -> tp.Solution |> function Some slnTy -> slnTy.GetAssemblyName() | None -> "" | TType_ucase (_uc, _tinst) -> let (TILObjectReprData(scope, _nesting, _definition)) = _uc.Tycon.ILTyconInfo scope.QualifiedName @@ -4120,7 +4120,7 @@ type TType = | TupInfo.Const false -> "" | TupInfo.Const true -> "struct ") + "{|" + String.concat "," (Seq.map2 (fun nm ty -> nm + " " + string ty + ";") anonInfo.SortedNames tinst) + ")" + "|}" - | TType_fun (d, r, _) -> "(" + string d + " -> " + string r + ")" + | TType_fun (domainTy, retTy, _) -> "(" + string domainTy + " -> " + string retTy + ")" | TType_ucase (uc, tinst) -> "ucase " + uc.CaseName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") | TType_var (tp, _) -> match tp.Solution with @@ -4197,7 +4197,7 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Con of tyconRef: TyconRef + | Const of tyconRef: TyconRef /// A product of two units of measure | Prod of measure1: Measure * measure2: Measure @@ -5061,7 +5061,7 @@ type ObjExprMethod = type SlotSig = | TSlotSig of methodName: string * - implementedType: TType * + declaringType: TType * classTypars: Typars * methodTypars: Typars * formalParams: SlotParam list list * @@ -5071,7 +5071,7 @@ type SlotSig = member ss.Name = let (TSlotSig(nm, _, _, _, _, _)) = ss in nm /// The (instantiated) type which the slot is logically a part of - member ss.ImplementedType = let (TSlotSig(_, ty, _, _, _, _)) = ss in ty + member ss.DeclaringType = let (TSlotSig(_, ty, _, _, _, _)) = ss in ty /// The class type parameters of the slot member ss.ClassTypars = let (TSlotSig(_, _, ctps, _, _, _)) = ss in ctps diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index cdcf93e4518..57037ba27d8 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -2818,7 +2818,7 @@ type ValRef = /// Represents a reference to a case of a union type [] type UnionCaseRef = - | UnionCaseRef of TyconRef * string + | UnionCaseRef of tyconRef: TyconRef * caseName: string /// Get a field of the union case by index member FieldByIndex: n: int -> RecdField @@ -2867,7 +2867,7 @@ type UnionCaseRef = /// Represents a reference to a field in a record, class or struct [] type RecdFieldRef = - | RecdFieldRef of tcref: TyconRef * id: string + | RecdFieldRef of tyconRef: TyconRef * fieldName: string override ToString: unit -> string @@ -2990,7 +2990,7 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Con of tyconRef: TyconRef + | Const of tyconRef: TyconRef /// A product of two units of measure | Prod of measure1: Measure * measure2: Measure @@ -3688,7 +3688,7 @@ type ObjExprMethod = type SlotSig = | TSlotSig of methodName: string * - implementedType: TType * + declaringType: TType * classTypars: Typars * methodTypars: Typars * formalParams: SlotParam list list * @@ -3709,7 +3709,7 @@ type SlotSig = member FormalReturnType: TType option /// The (instantiated) type which the slot is logically a part of - member ImplementedType: TType + member DeclaringType: TType /// The method type parameters of the slot member MethodTypars: Typars diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 1ec0b619604..63a45fb9b9a 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -93,24 +93,24 @@ let mkRawStructTupleTy tys = TType_tuple (tupInfoStruct, tys) // Equality relations on locally defined things //--------------------------------------------------------------------------- -let typarEq (lv1: Typar) (lv2: Typar) = (lv1.Stamp = lv2.Stamp) +let typarEq (tp1: Typar) (tp2: Typar) = (tp1.Stamp = tp2.Stamp) /// Equality on type variables, implemented as reference equality. This should be equivalent to using typarEq. let typarRefEq (tp1: Typar) (tp2: Typar) = (tp1 === tp2) /// Equality on value specs, implemented as reference equality -let valEq (lv1: Val) (lv2: Val) = (lv1 === lv2) +let valEq (v1: Val) (v2: Val) = (v1 === v2) /// Equality on CCU references, implemented as reference equality except when unresolved -let ccuEq (mv1: CcuThunk) (mv2: CcuThunk) = - (mv1 === mv2) || - (if mv1.IsUnresolvedReference || mv2.IsUnresolvedReference then - mv1.AssemblyName = mv2.AssemblyName +let ccuEq (ccu1: CcuThunk) (ccu2: CcuThunk) = + (ccu1 === ccu2) || + (if ccu1.IsUnresolvedReference || ccu2.IsUnresolvedReference then + ccu1.AssemblyName = ccu2.AssemblyName else - mv1.Contents === mv2.Contents) + ccu1.Contents === ccu2.Contents) /// For dereferencing in the middle of a pattern -let (|ValDeref|) (vr: ValRef) = vr.Deref +let (|ValDeref|) (vref: ValRef) = vref.Deref //-------------------------------------------------------------------------- // Make references to TAST items diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index fe4930a71d7..e739aec4062 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -61,19 +61,19 @@ val mkRawRefTupleTy: tys: TTypes -> TType val mkRawStructTupleTy: tys: TTypes -> TType -val typarEq: lv1: Typar -> lv2: Typar -> bool +val typarEq: tp1: Typar -> tp2: Typar -> bool /// Equality on type variables, implemented as reference equality. This should be equivalent to using typarEq. val typarRefEq: tp1: Typar -> tp2: Typar -> bool /// Equality on value specs, implemented as reference equality -val valEq: lv1: Val -> lv2: Val -> bool +val valEq: v1: Val -> v2: Val -> bool /// Equality on CCU references, implemented as reference equality except when unresolved -val ccuEq: mv1: CcuThunk -> mv2: CcuThunk -> bool +val ccuEq: ccu1: CcuThunk -> ccu2: CcuThunk -> bool /// For dereferencing in the middle of a pattern -val (|ValDeref|): vr: ValRef -> Val +val (|ValDeref|): vref: ValRef -> Val val mkRecdFieldRef: tcref: TyconRef -> f: string -> RecdFieldRef diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index cef7fe70b74..8229107c74a 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -45,32 +45,32 @@ type TyparMap<'T> = | TPMap of StampMap<'T> member tm.Item - with get (v: Typar) = + with get (tp: Typar) = let (TPMap m) = tm - m[v.Stamp] + m[tp.Stamp] - member tm.ContainsKey (v: Typar) = + member tm.ContainsKey (tp: Typar) = let (TPMap m) = tm - m.ContainsKey(v.Stamp) + m.ContainsKey(tp.Stamp) - member tm.TryFind (v: Typar) = + member tm.TryFind (tp: Typar) = let (TPMap m) = tm - m.TryFind(v.Stamp) + m.TryFind(tp.Stamp) - member tm.Add (v: Typar, x) = + member tm.Add (tp: Typar, x) = let (TPMap m) = tm - TPMap (m.Add(v.Stamp, x)) + TPMap (m.Add(tp.Stamp, x)) static member Empty: TyparMap<'T> = TPMap Map.empty [] type TyconRefMap<'T>(imap: StampMap<'T>) = - member m.Item with get (v: TyconRef) = imap[v.Stamp] - member m.TryFind (v: TyconRef) = imap.TryFind v.Stamp - member m.ContainsKey (v: TyconRef) = imap.ContainsKey v.Stamp - member m.Add (v: TyconRef) x = TyconRefMap (imap.Add (v.Stamp, x)) - member m.Remove (v: TyconRef) = TyconRefMap (imap.Remove v.Stamp) - member m.IsEmpty = imap.IsEmpty + member _.Item with get (tcref: TyconRef) = imap[tcref.Stamp] + member _.TryFind (tcref: TyconRef) = imap.TryFind tcref.Stamp + member _.ContainsKey (tcref: TyconRef) = imap.ContainsKey tcref.Stamp + member _.Add (tcref: TyconRef) x = TyconRefMap (imap.Add (tcref.Stamp, x)) + member _.Remove (tcref: TyconRef) = TyconRefMap (imap.Remove tcref.Stamp) + member _.IsEmpty = imap.IsEmpty static member Empty: TyconRefMap<'T> = TyconRefMap Map.empty static member OfList vs = (vs, TyconRefMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) @@ -79,14 +79,14 @@ type TyconRefMap<'T>(imap: StampMap<'T>) = [] type ValMap<'T>(imap: StampMap<'T>) = - member m.Contents = imap - member m.Item with get (v: Val) = imap[v.Stamp] - member m.TryFind (v: Val) = imap.TryFind v.Stamp - member m.ContainsVal (v: Val) = imap.ContainsKey v.Stamp - member m.Add (v: Val) x = ValMap (imap.Add(v.Stamp, x)) - member m.Remove (v: Val) = ValMap (imap.Remove(v.Stamp)) + member _.Contents = imap + member _.Item with get (v: Val) = imap[v.Stamp] + member _.TryFind (v: Val) = imap.TryFind v.Stamp + member _.ContainsVal (v: Val) = imap.ContainsKey v.Stamp + member _.Add (v: Val) x = ValMap (imap.Add(v.Stamp, x)) + member _.Remove (v: Val) = ValMap (imap.Remove(v.Stamp)) static member Empty = ValMap<'T> Map.empty - member m.IsEmpty = imap.IsEmpty + member _.IsEmpty = imap.IsEmpty static member OfList vs = (vs, ValMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) //-------------------------------------------------------------------------- @@ -207,11 +207,11 @@ let rec remapTypeAux (tyenv: Remap) (ty: TType) = if tupInfo === tupInfoR && l === lR then ty else TType_tuple (tupInfoR, lR) - | TType_fun (d, r, flags) as ty -> - let dR = remapTypeAux tyenv d - let rR = remapTypeAux tyenv r - if d === dR && r === rR then ty else - TType_fun (dR, rR, flags) + | TType_fun (domainTy, rangeTy, flags) as ty -> + let domainTyR = remapTypeAux tyenv domainTy + let retTyR = remapTypeAux tyenv rangeTy + if domainTy === domainTyR && rangeTy === retTyR then ty else + TType_fun (domainTyR, retTyR, flags) | TType_forall (tps, ty) -> let tpsR, tyenv = copyAndRemapAndBindTypars tyenv tps @@ -224,9 +224,9 @@ let rec remapTypeAux (tyenv: Remap) (ty: TType) = and remapMeasureAux tyenv unt = match unt with | Measure.One -> unt - | Measure.Con tcref -> + | Measure.Const tcref -> match tyenv.tyconRefRemap.TryFind tcref with - | Some tcref -> Measure.Con tcref + | Some tcref -> Measure.Const tcref | None -> unt | Measure.Prod(u1, u2) -> Measure.Prod(remapMeasureAux tyenv u1, remapMeasureAux tyenv u2) | Measure.RationalPower(u, q) -> Measure.RationalPower(remapMeasureAux tyenv u, q) @@ -235,8 +235,8 @@ and remapMeasureAux tyenv unt = match tp.Solution with | None -> match ListAssoc.tryFind typarEq tp tyenv.tpinst with - | Some v -> - match v with + | Some tpTy -> + match tpTy with | TType_measure unt -> unt | _ -> failwith "remapMeasureAux: incorrect kinds" | None -> unt @@ -257,10 +257,10 @@ and remapTyparConstraintsAux tyenv cs = Some(TyparConstraint.MayResolveMember (remapTraitInfo tyenv traitInfo, m)) | TyparConstraint.DefaultsTo(priority, ty, m) -> Some(TyparConstraint.DefaultsTo(priority, remapTypeAux tyenv ty, m)) - | TyparConstraint.IsEnum(uty, m) -> - Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty, m)) - | TyparConstraint.IsDelegate(uty1, uty2, m) -> - Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1, remapTypeAux tyenv uty2, m)) + | TyparConstraint.IsEnum(underlyingTy, m) -> + Some(TyparConstraint.IsEnum(remapTypeAux tyenv underlyingTy, m)) + | TyparConstraint.IsDelegate(argTys, retTy, m) -> + Some(TyparConstraint.IsDelegate(remapTypeAux tyenv argTys, remapTypeAux tyenv retTy, m)) | TyparConstraint.SimpleChoice(tys, m) -> Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys, m)) | TyparConstraint.SupportsComparison _ @@ -443,7 +443,7 @@ let reduceTyconRefAbbrevMeasureable (tcref: TyconRef) = let rec stripUnitEqnsFromMeasureAux canShortcut unt = match stripUnitEqnsAux canShortcut unt with - | Measure.Con tcref when tcref.IsTypeAbbrev -> + | Measure.Const tcref when tcref.IsTypeAbbrev -> stripUnitEqnsFromMeasureAux canShortcut (reduceTyconRefAbbrevMeasureable tcref) | m -> m @@ -456,7 +456,7 @@ let stripUnitEqnsFromMeasure m = stripUnitEqnsFromMeasureAux false m /// What is the contribution of unit-of-measure constant ucref to unit-of-measure expression measure? let rec MeasureExprConExponent g abbrev ucref unt = match (if abbrev then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Con ucrefR -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational + | Measure.Const ucrefR -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureExprConExponent g abbrev ucref untR) | Measure.Prod(unt1, unt2) -> AddRational(MeasureExprConExponent g abbrev ucref unt1) (MeasureExprConExponent g abbrev ucref unt2) | Measure.RationalPower(untR, q) -> MulRational (MeasureExprConExponent g abbrev ucref untR) q @@ -466,7 +466,7 @@ let rec MeasureExprConExponent g abbrev ucref unt = /// after remapping tycons? let rec MeasureConExponentAfterRemapping g r ucref unt = match stripUnitEqnsFromMeasure unt with - | Measure.Con ucrefR -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational + | Measure.Const ucrefR -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureConExponentAfterRemapping g r ucref untR) | Measure.Prod(unt1, unt2) -> AddRational(MeasureConExponentAfterRemapping g r ucref unt1) (MeasureConExponentAfterRemapping g r ucref unt2) | Measure.RationalPower(untR, q) -> MulRational (MeasureConExponentAfterRemapping g r ucref untR) q @@ -511,7 +511,7 @@ let ListMeasureVarOccsWithNonZeroExponents untexpr = let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let rec gather acc unt = match (if eraseAbbrevs then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Con c -> + | Measure.Const c -> if List.exists (fun (cR, _) -> tyconRefEq g c cR) acc then acc else let e = MeasureExprConExponent g eraseAbbrevs c untexpr if e = ZeroRational then acc else (c, e) :: acc @@ -526,7 +526,7 @@ let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let ListMeasureConOccsAfterRemapping g r unt = let rec gather acc unt = match stripUnitEqnsFromMeasure unt with - | Measure.Con c -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc + | Measure.Const c -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 | Measure.RationalPower(untR, _) -> gather acc untR | Measure.Inv untR -> gather acc untR @@ -552,8 +552,8 @@ let ProdMeasures ms = | [] -> Measure.One | m :: ms -> List.foldBack MeasureProdOpt ms m -let isDimensionless g tyarg = - match stripTyparEqns tyarg with +let isDimensionless g ty = + match stripTyparEqns ty with | TType_measure unt -> isNil (ListMeasureVarOccsWithNonZeroExponents unt) && isNil (ListMeasureConOccsWithNonZeroExponents g true unt) @@ -581,7 +581,7 @@ let normalizeMeasure g ms = match vs, cs with | [], [] -> Measure.One | [(v, e)], [] when e = OneRational -> Measure.Var v - | vs, cs -> List.foldBack (fun (v, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Var v, e), m)) vs (List.foldBack (fun (c, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Con c, e), m)) cs Measure.One) + | vs, cs -> List.foldBack (fun (v, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Var v, e), m)) vs (List.foldBack (fun (c, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Const c, e), m)) cs Measure.One) let tryNormalizeMeasureInType g ty = match ty with @@ -789,8 +789,8 @@ let rec stripTyEqnsAndErase eraseFuncAndTuple (g: TcGlobals) ty = else ty - | TType_fun(a, b, flags) when eraseFuncAndTuple -> - TType_app(g.fastFunc_tcr, [ a; b ], flags) + | TType_fun(domainTy, rangeTy, flags) when eraseFuncAndTuple -> + TType_app(g.fastFunc_tcr, [ domainTy; rangeTy ], flags) | TType_tuple(tupInfo, l) when eraseFuncAndTuple -> mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) l @@ -816,7 +816,7 @@ let rec stripExnEqns (eref: TyconRef) = let primDestForallTy g ty = ty |> stripTyEqns g |> (function TType_forall (tyvs, tau) -> (tyvs, tau) | _ -> failwith "primDestForallTy: not a forall type") -let destFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau, _) -> (tyv, tau) | _ -> failwith "destFunTy: not a function type") +let destFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (domainTy, rangeTy, _) -> (domainTy, rangeTy) | _ -> failwith "destFunTy: not a function type") let destAnyTupleTy g ty = ty |> stripTyEqns g |> (function TType_tuple (tupInfo, l) -> tupInfo, l | _ -> failwith "destAnyTupleTy: not a tuple type") @@ -880,7 +880,7 @@ let argsOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(_, tinst, _) - let tryDestTyparTy g ty = ty |> stripTyEqns g |> (function TType_var (v, _) -> ValueSome v | _ -> ValueNone) -let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau, _) -> ValueSome(tyv, tau) | _ -> ValueNone) +let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (domainTy, rangeTy, _) -> ValueSome(domainTy, rangeTy) | _ -> ValueNone) let tryTcrefOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _, _) -> ValueSome tcref | _ -> ValueNone) @@ -900,14 +900,14 @@ let tryNiceEntityRefOfTy ty = let ty = stripTyparEqnsAux false ty match ty with | TType_app (tcref, _, _) -> ValueSome tcref - | TType_measure (Measure.Con tcref) -> ValueSome tcref + | TType_measure (Measure.Const tcref) -> ValueSome tcref | _ -> ValueNone let tryNiceEntityRefOfTyOption ty = let ty = stripTyparEqnsAux false ty match ty with | TType_app (tcref, _, _) -> Some tcref - | TType_measure (Measure.Con tcref) -> Some tcref + | TType_measure (Measure.Const tcref) -> Some tcref | _ -> None let mkInstForAppTy g ty = @@ -931,12 +931,12 @@ let convertToTypeWithMetadataIfPossible g ty = // TType modifications //--------------------------------------------------------------------------- -let stripMeasuresFromTType g tt = - match tt with - | TType_app(a, b, flags) -> - let bR = b |> List.filter (isMeasureTy g >> not) - TType_app(a, bR, flags) - | _ -> tt +let stripMeasuresFromTy g ty = + match ty with + | TType_app(tcref, tinst, flags) -> + let tinstR = tinst |> List.filter (isMeasureTy g >> not) + TType_app(tcref, tinstR, flags) + | _ -> ty //--------------------------------------------------------------------------- // Equivalence of types up to alpha-equivalence @@ -990,30 +990,29 @@ and traitKeysAEquivAux erasureFlag g aenv witnessInfo1 witnessInfo2 = and returnTypesAEquivAux erasureFlag g aenv retTy retTy2 = match retTy, retTy2 with | None, None -> true - | Some t1, Some t2 -> typeAEquivAux erasureFlag g aenv t1 t2 + | Some ty1, Some ty2 -> typeAEquivAux erasureFlag g aenv ty1 ty2 | _ -> false - and typarConstraintsAEquivAux erasureFlag g aenv tpc1 tpc2 = match tpc1, tpc2 with - | TyparConstraint.CoercesTo(acty, _), - TyparConstraint.CoercesTo(fcty, _) -> - typeAEquivAux erasureFlag g aenv acty fcty + | TyparConstraint.CoercesTo(tgtTy1, _), + TyparConstraint.CoercesTo(tgtTy2, _) -> + typeAEquivAux erasureFlag g aenv tgtTy1 tgtTy2 | TyparConstraint.MayResolveMember(trait1, _), TyparConstraint.MayResolveMember(trait2, _) -> traitsAEquivAux erasureFlag g aenv trait1 trait2 - | TyparConstraint.DefaultsTo(_, acty, _), - TyparConstraint.DefaultsTo(_, fcty, _) -> - typeAEquivAux erasureFlag g aenv acty fcty + | TyparConstraint.DefaultsTo(_, dfltTy1, _), + TyparConstraint.DefaultsTo(_, dfltTy2, _) -> + typeAEquivAux erasureFlag g aenv dfltTy1 dfltTy2 - | TyparConstraint.IsEnum(uty1, _), TyparConstraint.IsEnum(uty2, _) -> - typeAEquivAux erasureFlag g aenv uty1 uty2 + | TyparConstraint.IsEnum(underlyingTy1, _), TyparConstraint.IsEnum(underlyingTy2, _) -> + typeAEquivAux erasureFlag g aenv underlyingTy1 underlyingTy2 - | TyparConstraint.IsDelegate(aty1, bty1, _), TyparConstraint.IsDelegate(aty2, bty2, _) -> - typeAEquivAux erasureFlag g aenv aty1 aty2 && - typeAEquivAux erasureFlag g aenv bty1 bty2 + | TyparConstraint.IsDelegate(argTys1, retTy1, _), TyparConstraint.IsDelegate(argTys2, retTy2, _) -> + typeAEquivAux erasureFlag g aenv argTys1 argTys2 && + typeAEquivAux erasureFlag g aenv retTy1 retTy2 | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice(tys2, _) -> ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 @@ -1036,9 +1035,9 @@ and typarsAEquivAux erasureFlag g (aenv: TypeEquivEnv) tps1 tps2 = let aenv = aenv.BindEquivTypars tps1 tps2 List.forall2 (typarConstraintSetsAEquivAux erasureFlag g aenv) tps1 tps2 -and tcrefAEquiv g aenv tc1 tc2 = - tyconRefEq g tc1 tc2 || - (match aenv.EquivTycons.TryFind tc1 with Some v -> tyconRefEq g v tc2 | None -> false) +and tcrefAEquiv g aenv tcref1 tcref2 = + tyconRefEq g tcref1 tcref2 || + (match aenv.EquivTycons.TryFind tcref1 with Some v -> tyconRefEq g v tcref2 | None -> false) and typeAEquivAux erasureFlag g aenv ty1 ty2 = let ty1 = stripTyEqnsWrtErasure erasureFlag g ty1 @@ -1052,27 +1051,27 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = | TType_var (tp1, _), _ -> match aenv.EquivTypars.TryFind tp1 with - | Some v -> typeEquivAux erasureFlag g v ty2 + | Some tpTy1 -> typeEquivAux erasureFlag g tpTy1 ty2 | None -> false - | TType_app (tc1, b1, _), TType_app (tc2, b2, _) -> - tcrefAEquiv g aenv tc1 tc2 && - typesAEquivAux erasureFlag g aenv b1 b2 + | TType_app (tcref1, tinst1, _), TType_app (tcref2, tinst2, _) -> + tcrefAEquiv g aenv tcref1 tcref2 && + typesAEquivAux erasureFlag g aenv tinst1 tinst2 - | TType_ucase (UnionCaseRef(tc1, n1), b1), TType_ucase (UnionCaseRef(tc2, n2), b2) -> - n1=n2 && - tcrefAEquiv g aenv tc1 tc2 && - typesAEquivAux erasureFlag g aenv b1 b2 + | TType_ucase (UnionCaseRef(tcref1, ucase1), tinst1), TType_ucase (UnionCaseRef(tcref2, ucase2), tinst2) -> + ucase1=ucase2 && + tcrefAEquiv g aenv tcref1 tcref2 && + typesAEquivAux erasureFlag g aenv tinst1 tinst2 - | TType_tuple (s1, l1), TType_tuple (s2, l2) -> - structnessAEquiv s1 s2 && typesAEquivAux erasureFlag g aenv l1 l2 + | TType_tuple (tupInfo1, l1), TType_tuple (tupInfo2, l2) -> + structnessAEquiv tupInfo1 tupInfo2 && typesAEquivAux erasureFlag g aenv l1 l2 | TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) -> anonInfoEquiv anonInfo1 anonInfo2 && typesAEquivAux erasureFlag g aenv l1 l2 - | TType_fun (dtys1, rty1, _), TType_fun (dtys2, retTy2, _) -> - typeAEquivAux erasureFlag g aenv dtys1 dtys2 && typeAEquivAux erasureFlag g aenv rty1 retTy2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + typeAEquivAux erasureFlag g aenv domainTy1 domainTy2 && typeAEquivAux erasureFlag g aenv rangeTy1 rangeTy2 | TType_measure m1, TType_measure m2 -> match erasureFlag with @@ -1081,7 +1080,6 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = | _ -> false - and anonInfoEquiv (anonInfo1: AnonRecdTypeInfo) (anonInfo2: AnonRecdTypeInfo) = ccuEq anonInfo1.Assembly anonInfo2.Assembly && structnessAEquiv anonInfo1.TupInfo anonInfo2.TupInfo && @@ -1094,7 +1092,7 @@ and structnessAEquiv un1 un2 = and measureAEquiv g aenv un1 un2 = let vars1 = ListMeasureVarOccs un1 let trans tp1 = if aenv.EquivTypars.ContainsKey tp1 then destAnyParTy g aenv.EquivTypars[tp1] else tp1 - let remapTyconRef tc = if aenv.EquivTycons.ContainsKey tc then aenv.EquivTycons[tc] else tc + let remapTyconRef tcref = if aenv.EquivTycons.ContainsKey tcref then aenv.EquivTycons[tcref] else tcref let vars1R = List.map trans vars1 let vars2 = ListSet.subtract typarEq (ListMeasureVarOccs un2) vars1R let cons1 = ListMeasureConOccsAfterRemapping g remapTyconRef un1 @@ -1161,7 +1159,9 @@ let rec getErasedTypes g ty = //--------------------------------------------------------------------------- let valOrder = { new IComparer with member _.Compare(v1, v2) = compare v1.Stamp v2.Stamp } -let tyconOrder = { new IComparer with member _.Compare(tc1, tc2) = compare tc1.Stamp tc2.Stamp } + +let tyconOrder = { new IComparer with member _.Compare(tycon1, tycon2) = compare tycon1.Stamp tycon2.Stamp } + let recdFieldRefOrder = { new IComparer with member _.Compare(RecdFieldRef(tcref1, nm1), RecdFieldRef(tcref2, nm2)) = @@ -1180,8 +1180,8 @@ let unionCaseRefOrder = // Make some common types //--------------------------------------------------------------------------- -let mkFunTy (g: TcGlobals) d r = - TType_fun (d, r, g.knownWithoutNull) +let mkFunTy (g: TcGlobals) domainTy rangeTy = + TType_fun (domainTy, rangeTy, g.knownWithoutNull) let mkForallTy d r = TType_forall (d, r) @@ -1396,7 +1396,7 @@ let NormalizeDeclaredTyparsForEquiRecursiveInference g tps = type GeneralizedType = GeneralizedType of Typars * TType let mkGenericBindRhs g m generalizedTyparsForRecursiveBlock typeScheme bodyExpr = - let (GeneralizedType(generalizedTypars, tauType)) = typeScheme + let (GeneralizedType(generalizedTypars, tauTy)) = typeScheme // Normalize the generalized typars let generalizedTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g generalizedTypars @@ -1414,7 +1414,7 @@ let mkGenericBindRhs g m generalizedTyparsForRecursiveBlock typeScheme bodyExpr // We record an expression node that indicates that a free choice can be made // for these. This expression node effectively binds the type variables. let freeChoiceTypars = ListSet.subtract typarEq generalizedTyparsForRecursiveBlock generalizedTypars - mkTypeLambda m generalizedTypars (mkTypeChoose m freeChoiceTypars bodyExpr, tauType) + mkTypeLambda m generalizedTypars (mkTypeChoose m freeChoiceTypars bodyExpr, tauTy) let isBeingGeneralized tp typeScheme = let (GeneralizedType(generalizedTypars, _)) = typeScheme @@ -1512,36 +1512,36 @@ let mkExnCaseFieldGet (e1, ecref, j, m) = let mkExnCaseFieldSet (e1, ecref, j, e2, m) = Expr.Op (TOp.ExnFieldSet (ecref, j), [], [e1;e2], m) -let mkDummyLambda (g: TcGlobals) (e: Expr, ety) = - let m = e.Range - mkLambda m (fst (mkCompGenLocal m "unitVar" g.unit_ty)) (e, ety) +let mkDummyLambda (g: TcGlobals) (bodyExpr: Expr, bodyExprTy) = + let m = bodyExpr.Range + mkLambda m (fst (mkCompGenLocal m "unitVar" g.unit_ty)) (bodyExpr, bodyExprTy) -let mkWhile (g: TcGlobals) (spWhile, marker, e1, e2, m) = - Expr.Op (TOp.While (spWhile, marker), [], [mkDummyLambda g (e1, g.bool_ty);mkDummyLambda g (e2, g.unit_ty)], m) +let mkWhile (g: TcGlobals) (spWhile, marker, guardExpr, bodyExpr, m) = + Expr.Op (TOp.While (spWhile, marker), [], [mkDummyLambda g (guardExpr, g.bool_ty);mkDummyLambda g (bodyExpr, g.unit_ty)], m) -let mkIntegerForLoop (g: TcGlobals) (spFor, spIn, v, e1, dir, e2, e3: Expr, m) = - Expr.Op (TOp.IntegerForLoop (spFor, spIn, dir), [], [mkDummyLambda g (e1, g.int_ty) ;mkDummyLambda g (e2, g.int_ty);mkLambda e3.Range v (e3, g.unit_ty)], m) +let mkIntegerForLoop (g: TcGlobals) (spFor, spIn, v, startExpr, dir, finishExpr, bodyExpr: Expr, m) = + Expr.Op (TOp.IntegerForLoop (spFor, spIn, dir), [], [mkDummyLambda g (startExpr, g.int_ty) ;mkDummyLambda g (finishExpr, g.int_ty);mkLambda bodyExpr.Range v (bodyExpr, g.unit_ty)], m) -let mkTryWith g (e1, vf, ef: Expr, vh, eh: Expr, m, ty, spTry, spWith) = - Expr.Op (TOp.TryWith (spTry, spWith), [ty], [mkDummyLambda g (e1, ty);mkLambda ef.Range vf (ef, ty);mkLambda eh.Range vh (eh, ty)], m) +let mkTryWith g (bodyExpr, filterVal, filterExpr: Expr, handlerVal, handlerExpr: Expr, m, ty, spTry, spWith) = + Expr.Op (TOp.TryWith (spTry, spWith), [ty], [mkDummyLambda g (bodyExpr, ty);mkLambda filterExpr.Range filterVal (filterExpr, ty);mkLambda handlerExpr.Range handlerVal (handlerExpr, ty)], m) -let mkTryFinally (g: TcGlobals) (e1, e2, m, ty, spTry, spFinally) = - Expr.Op (TOp.TryFinally (spTry, spFinally), [ty], [mkDummyLambda g (e1, ty);mkDummyLambda g (e2, g.unit_ty)], m) +let mkTryFinally (g: TcGlobals) (bodyExpr, finallyExpr, m, ty, spTry, spFinally) = + Expr.Op (TOp.TryFinally (spTry, spFinally), [ty], [mkDummyLambda g (bodyExpr, ty);mkDummyLambda g (finallyExpr, g.unit_ty)], m) let mkDefault (m, ty) = Expr.Const (Const.Zero, m, ty) -let mkValSet m v e = - Expr.Op (TOp.LValueOp (LSet, v), [], [e], m) +let mkValSet m vref e = + Expr.Op (TOp.LValueOp (LSet, vref), [], [e], m) -let mkAddrSet m v e = - Expr.Op (TOp.LValueOp (LByrefSet, v), [], [e], m) +let mkAddrSet m vref e = + Expr.Op (TOp.LValueOp (LByrefSet, vref), [], [e], m) -let mkAddrGet m v = - Expr.Op (TOp.LValueOp (LByrefGet, v), [], [], m) +let mkAddrGet m vref = + Expr.Op (TOp.LValueOp (LByrefGet, vref), [], [], m) -let mkValAddr m readonly v = - Expr.Op (TOp.LValueOp (LAddrOf readonly, v), [], [], m) +let mkValAddr m readonly vref = + Expr.Op (TOp.LValueOp (LAddrOf readonly, vref), [], [], m) //-------------------------------------------------------------------------- // Maps tracking extra information for values @@ -1682,9 +1682,9 @@ let tryDestForallTy g ty = let rec stripFunTy g ty = if isFunTy g ty then - let d, r = destFunTy g ty - let more, rty = stripFunTy g r - d :: more, rty + let domainTy, rangeTy = destFunTy g ty + let more, retTy = stripFunTy g rangeTy + domainTy :: more, retTy else [], ty let applyForallTy g ty tyargs = @@ -1696,23 +1696,24 @@ let reduceIteratedFunTy g ty args = if not (isFunTy g ty) then failwith "reduceIteratedFunTy" snd (destFunTy g ty)) ty args -let applyTyArgs g functy tyargs = - if isForallTy g functy then applyForallTy g functy tyargs else functy +let applyTyArgs g ty tyargs = + if isForallTy g ty then applyForallTy g ty tyargs else ty -let applyTys g functy (tyargs, argTys) = - let afterTyappTy = applyTyArgs g functy tyargs +let applyTys g funcTy (tyargs, argTys) = + let afterTyappTy = applyTyArgs g funcTy tyargs reduceIteratedFunTy g afterTyappTy argTys -let formalApplyTys g functy (tyargs, args) = +let formalApplyTys g funcTy (tyargs, args) = reduceIteratedFunTy g - (if isNil tyargs then functy else snd (destForallTy g functy)) + (if isNil tyargs then funcTy else snd (destForallTy g funcTy)) args let rec stripFunTyN g n ty = assert (n >= 0) if n > 0 && isFunTy g ty then let d, r = destFunTy g ty - let more, rty = stripFunTyN g (n-1) r in d :: more, rty + let more, retTy = stripFunTyN g (n-1) r + d :: more, retTy else [], ty let tryDestAnyTupleTy g ty = @@ -1796,10 +1797,10 @@ let destListTy (g: TcGlobals) ty = | ValueSome (tcref, [ty]) when tyconRefEq g tcref g.list_tcr_canon -> ty | _ -> failwith "destListTy" -let tyconRefEqOpt g tcOpt tc = - match tcOpt with +let tyconRefEqOpt g tcrefOpt tcref = + match tcrefOpt with | None -> false - | Some tc2 -> tyconRefEq g tc2 tc + | Some tcref2 -> tyconRefEq g tcref2 tcref let isStringTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _, _) -> tyconRefEq g tcref g.system_String_tcref | _ -> false) @@ -1830,13 +1831,13 @@ let isByrefTy g ty = let isInByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, [], _) -> tyconRefEq g g.byrefkind_In_tcr tcref | _ -> false) let isInByrefTy g ty = ty |> stripTyEqns g |> (function - | TType_app(tcref, [_; tag], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isInByrefTag g tag + | TType_app(tcref, [_; tagTy], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isInByrefTag g tagTy | _ -> false) let isOutByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, [], _) -> tyconRefEq g g.byrefkind_Out_tcr tcref | _ -> false) let isOutByrefTy g ty = ty |> stripTyEqns g |> (function - | TType_app(tcref, [_; tag], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isOutByrefTag g tag + | TType_app(tcref, [_; tagTy], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isOutByrefTag g tagTy | _ -> false) #if !NO_TYPEPROVIDERS @@ -2059,7 +2060,7 @@ let MemberIsExplicitImpl g (membInfo: ValMemberInfo) = membInfo.MemberFlags.IsOverrideOrExplicitImpl && match membInfo.ImplementedSlotSigs with | [] -> false - | slotsigs -> slotsigs |> List.forall (fun slotsig -> isInterfaceTy g slotsig.ImplementedType) + | slotsigs -> slotsigs |> List.forall (fun slotsig -> isInterfaceTy g slotsig.DeclaringType) let ValIsExplicitImpl g (v: Val) = match v.MemberInfo with @@ -2239,8 +2240,8 @@ and accFreeInTyparConstraint opts tpc acc = | TyparConstraint.MayResolveMember (traitInfo, _) -> accFreeInTrait opts traitInfo acc | TyparConstraint.DefaultsTo(_, defaultTy, _) -> accFreeInType opts defaultTy acc | TyparConstraint.SimpleChoice(tys, _) -> accFreeInTypes opts tys acc - | TyparConstraint.IsEnum(uty, _) -> accFreeInType opts uty acc - | TyparConstraint.IsDelegate(aty, bty, _) -> accFreeInType opts aty (accFreeInType opts bty acc) + | TyparConstraint.IsEnum(underlyingTy, _) -> accFreeInType opts underlyingTy acc + | TyparConstraint.IsDelegate(argTys, retTy, _) -> accFreeInType opts argTys (accFreeInType opts retTy acc) | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -2302,18 +2303,18 @@ and accFreeInType opts ty acc = | TType_anon (anonInfo, l) -> accFreeInTypes opts l (accFreeInTupInfo opts anonInfo.TupInfo acc) - | TType_app (tc, tinst, _) -> - let acc = accFreeTycon opts tc acc + | TType_app (tcref, tinst, _) -> + let acc = accFreeTycon opts tcref acc match tinst with | [] -> acc // optimization to avoid unneeded call | [h] -> accFreeInType opts h acc // optimization to avoid unneeded call | _ -> accFreeInTypes opts tinst acc - | TType_ucase (UnionCaseRef(tc, _), tinst) -> - accFreeInTypes opts tinst (accFreeTycon opts tc acc) + | TType_ucase (UnionCaseRef(tcref, _), tinst) -> + accFreeInTypes opts tinst (accFreeTycon opts tcref acc) - | TType_fun (d, r, _) -> - accFreeInType opts d (accFreeInType opts r acc) + | TType_fun (domainTy, rangeTy, _) -> + accFreeInType opts domainTy (accFreeInType opts rangeTy acc) | TType_var (r, _) -> accFreeTyparRef opts r acc @@ -2375,10 +2376,10 @@ and accFreeInTyparConstraintLeftToRight g cxFlag thruFlag acc tpc = accFreeInTypeLeftToRight g cxFlag thruFlag acc defaultTy | TyparConstraint.SimpleChoice(tys, _) -> accFreeInTypesLeftToRight g cxFlag thruFlag acc tys - | TyparConstraint.IsEnum(uty, _) -> - accFreeInTypeLeftToRight g cxFlag thruFlag acc uty - | TyparConstraint.IsDelegate(aty, bty, _) -> - accFreeInTypeLeftToRight g cxFlag thruFlag (accFreeInTypeLeftToRight g cxFlag thruFlag acc aty) bty + | TyparConstraint.IsEnum(underlyingTy, _) -> + accFreeInTypeLeftToRight g cxFlag thruFlag acc underlyingTy + | TyparConstraint.IsDelegate(argTys, retTy, _) -> + accFreeInTypeLeftToRight g cxFlag thruFlag (accFreeInTypeLeftToRight g cxFlag thruFlag acc argTys) retTy | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -2419,9 +2420,9 @@ and accFreeInTypeLeftToRight g cxFlag thruFlag acc ty = | TType_ucase (_, tinst) -> accFreeInTypesLeftToRight g cxFlag thruFlag acc tinst - | TType_fun (d, r, _) -> - let dacc = accFreeInTypeLeftToRight g cxFlag thruFlag acc d - accFreeInTypeLeftToRight g cxFlag thruFlag dacc r + | TType_fun (domainTy, rangeTy, _) -> + let dacc = accFreeInTypeLeftToRight g cxFlag thruFlag acc domainTy + accFreeInTypeLeftToRight g cxFlag thruFlag dacc rangeTy | TType_var (r, _) -> accFreeTyparRefLeftToRight g cxFlag thruFlag acc r @@ -2546,12 +2547,12 @@ let GetMemberTypeInMemberForm g memberFlags valReprInfo numEnclosingTypars ty m let paramArgInfos = match paramArgInfos, valReprInfo.ArgInfos with // static member and module value unit argument elimination - | [[(argType, _)]], [[]] -> - assert isUnitTy g argType + | [[(argTy, _)]], [[]] -> + assert isUnitTy g argTy [[]] // instance member unit argument elimination - | [[(argType, _)]], [[_objArg];[]] -> - assert isUnitTy g argType + | [[(argTy, _)]], [[_objArg];[]] -> + assert isUnitTy g argTy [[]] | _ -> paramArgInfos @@ -2770,10 +2771,10 @@ module PrettyTypes = let niceTypars, renaming = NewPrettyTypars [] ftps names // strip universal types for printing - let getTauStayTau t = - match t with + let getTauStayTau ty = + match ty with | TType_forall (_, tau) -> tau - | _ -> t + | _ -> ty let tauThings = mapTys getTauStayTau things let prettyThings = mapTys (instType renaming) tauThings @@ -2858,8 +2859,8 @@ module SimplifyTypes = let ty = stripTyparEqns ty let z = f z ty match ty with - | TType_forall (_, body) -> - foldTypeButNotConstraints f z body + | TType_forall (_, bodyTy) -> + foldTypeButNotConstraints f z bodyTy | TType_app (_, tys, _) | TType_ucase (_, tys) @@ -2867,8 +2868,8 @@ module SimplifyTypes = | TType_tuple (_, tys) -> List.fold (foldTypeButNotConstraints f) z tys - | TType_fun (s, t, _) -> - foldTypeButNotConstraints f (foldTypeButNotConstraints f z s) t + | TType_fun (domainTy, rangeTy, _) -> + foldTypeButNotConstraints f (foldTypeButNotConstraints f z domainTy) rangeTy | TType_var _ -> z @@ -3184,7 +3185,7 @@ let tyconRefToFullName (tcref:TyconRef) = seq { yield! namespaceParts; yield tcref.DisplayName } |> String.concat "." let rec qualifiedInterfaceImplementationNameAux g (x:TType) : string = - match stripMeasuresFromTType g (stripTyEqnsAndErase true g x) with + match stripMeasuresFromTy g (stripTyEqnsAndErase true g x) with | TType_app (a, [], _) -> tyconRefToFullName a @@ -3203,8 +3204,8 @@ let rec qualifiedInterfaceImplementationNameAux g (x:TType) : string = failwithf "unexpected: expected TType_app but got %O" (x.GetType()) /// for types in the global namespace, `global is prepended (note the backtick) -let qualifiedInterfaceImplementationName g (tt:TType) memberName = - let interfaceName = tt |> qualifiedInterfaceImplementationNameAux g +let qualifiedInterfaceImplementationName g (ty: TType) memberName = + let interfaceName = ty |> qualifiedInterfaceImplementationNameAux g sprintf "%s.%s" interfaceName memberName let qualifiedMangledNameOfTyconRef tcref nm = @@ -4951,7 +4952,7 @@ and accFreeInTest (opts: FreeVarOptions) discrim acc = | DecisionTreeTest.ArrayLength(_, ty) -> accFreeVarsInTy opts ty acc | DecisionTreeTest.Const _ | DecisionTreeTest.IsNull -> acc - | DecisionTreeTest.IsInst (srcty, tgty) -> accFreeVarsInTy opts srcty (accFreeVarsInTy opts tgty acc) + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> accFreeVarsInTy opts srcTy (accFreeVarsInTy opts tgtTy acc) | DecisionTreeTest.ActivePatternCase (exp, tys, _, activePatIdentity, _, _) -> accFreeInExpr opts exp (accFreeVarsInTys opts tys @@ -5826,7 +5827,7 @@ and remapDecisionTree ctxt compgen tmenv x = | DecisionTreeTest.UnionCase (uc, tinst) -> DecisionTreeTest.UnionCase(remapUnionCaseRef tmenv.tyconRefRemap uc, remapTypes tmenv tinst) | DecisionTreeTest.ArrayLength (n, ty) -> DecisionTreeTest.ArrayLength(n, remapType tmenv ty) | DecisionTreeTest.Const _ -> test - | DecisionTreeTest.IsInst (srcty, tgty) -> DecisionTreeTest.IsInst (remapType tmenv srcty, remapType tmenv tgty) + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> DecisionTreeTest.IsInst (remapType tmenv srcTy, remapType tmenv tgtTy) | DecisionTreeTest.IsNull -> DecisionTreeTest.IsNull | DecisionTreeTest.ActivePatternCase _ -> failwith "DecisionTreeTest.ActivePatternCase should only be used during pattern match compilation" | DecisionTreeTest.Error(m) -> DecisionTreeTest.Error(m) @@ -8597,8 +8598,8 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = else sprintf "System.Tuple%s"(tyargsEnc g (gtpsType, gtpsMethod) tys) - | TType_fun (f, x, _) -> - "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [f;x] + | TType_fun (domainTy, rangeTy, _) -> + "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [domainTy; rangeTy] | TType_var (typar, _) -> typarEnc g (gtpsType, gtpsMethod) typar @@ -8869,22 +8870,22 @@ let canUseUnboxFast g m ty = // // No sequence point is generated for this expression form as this function is only // used for compiler-generated code. -let mkIsInstConditional g m tgty vinputExpr v e2 e3 = +let mkIsInstConditional g m tgtTy vinputExpr v e2 e3 = - if canUseTypeTestFast g tgty && isRefTy g tgty then + if canUseTypeTestFast g tgtTy && isRefTy g tgtTy then let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) let tg2 = mbuilder.AddResultTarget(e2) let tg3 = mbuilder.AddResultTarget(e3) let dtree = TDSwitch(exprForVal m v, [TCase(DecisionTreeTest.IsNull, tg3)], Some tg2, m) let expr = mbuilder.Close(dtree, m, tyOfExpr g e2) - mkCompGenLet m v (mkIsInst tgty vinputExpr m) expr + mkCompGenLet m v (mkIsInst tgtTy vinputExpr m) expr else let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) - let tg2 = TDSuccess([mkCallUnbox g m tgty vinputExpr], mbuilder.AddTarget(TTarget([v], e2, None))) + let tg2 = TDSuccess([mkCallUnbox g m tgtTy vinputExpr], mbuilder.AddTarget(TTarget([v], e2, None))) let tg3 = mbuilder.AddResultTarget(e3) - let dtree = TDSwitch(vinputExpr, [TCase(DecisionTreeTest.IsInst(tyOfExpr g vinputExpr, tgty), tg2)], Some tg3, m) + let dtree = TDSwitch(vinputExpr, [TCase(DecisionTreeTest.IsInst(tyOfExpr g vinputExpr, tgtTy), tg2)], Some tg3, m) let expr = mbuilder.Close(dtree, m, tyOfExpr g e2) expr @@ -10114,7 +10115,7 @@ let (|ResumableCodeInvoke|_|) g expr = let ComputeUseMethodImpl g (v: Val) = v.ImplementedSlotSigs |> List.exists (fun slotsig -> - let oty = slotsig.ImplementedType + let oty = slotsig.DeclaringType let otcref = tcrefOfAppTy g oty let tcref = v.MemberApparentEntity diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 1a89375f930..5d27bff7fbc 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -845,7 +845,7 @@ val isDimensionless: TcGlobals -> TType -> bool // TType modifications and comparisons //--------------------------------------------------------------------------- -val stripMeasuresFromTType: TcGlobals -> TType -> TType +val stripMeasuresFromTy: TcGlobals -> TType -> TType //------------------------------------------------------------------------- // Equivalence of types (up to substitution of type variables in the left-hand type) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 3f5ba37afde..57c557d2b8a 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1575,7 +1575,7 @@ let p_measure_one = p_byte 4 // Pickle a unit-of-measure variable or constructor let p_measure_varcon unt st = match unt with - | Measure.Con tcref -> p_measure_con tcref st + | Measure.Const tcref -> p_measure_con tcref st | Measure.Var v -> p_measure_var v st | _ -> pfailwith st "p_measure_varcon: expected measure variable or constructor" @@ -1604,7 +1604,7 @@ let rec p_measure_power unt q st = let rec p_normalized_measure unt st = let unt = stripUnitEqnsAux false unt match unt with - | Measure.Con tcref -> p_measure_con tcref st + | Measure.Const tcref -> p_measure_con tcref st | Measure.Inv x -> p_byte 1 st; p_normalized_measure x st | Measure.Prod(x1, x2) -> p_byte 2 st; p_normalized_measure x1 st; p_normalized_measure x2 st | Measure.Var v -> p_measure_var v st @@ -1625,7 +1625,7 @@ let u_rational st = let rec u_measure_expr st = let tag = u_byte st match tag with - | 0 -> let a = u_tcref st in Measure.Con a + | 0 -> let a = u_tcref st in Measure.Const a | 1 -> let a = u_measure_expr st in Measure.Inv a | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod (a, b) | 3 -> let a = u_tpref st in Measure.Var a @@ -2437,7 +2437,7 @@ and p_dtree_discrim x st = | DecisionTreeTest.UnionCase (ucref, tinst) -> p_byte 0 st; p_tup2 p_ucref p_tys (ucref, tinst) st | DecisionTreeTest.Const c -> p_byte 1 st; p_const c st | DecisionTreeTest.IsNull -> p_byte 2 st - | DecisionTreeTest.IsInst (srcty, tgty) -> p_byte 3 st; p_ty srcty st; p_ty tgty st + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> p_byte 3 st; p_ty srcTy st; p_ty tgtTy st | DecisionTreeTest.ArrayLength (n, ty) -> p_byte 4 st; p_tup2 p_int p_ty (n, ty) st | DecisionTreeTest.ActivePatternCase _ -> pfailwith st "DecisionTreeTest.ActivePatternCase: only used during pattern match compilation" | DecisionTreeTest.Error _ -> pfailwith st "DecisionTreeTest.Error: only used during pattern match compilation" diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index ebc1d2cb28c..2238c89041b 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -141,15 +141,15 @@ type BindingSet = BindingSetPreAttrs of range * bool * bool * (SynAttributes -> let mkClassMemberLocalBindings(isStatic, initialRangeOpt, attrs, vis, BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, bindingSetRange)) = let ignoredFreeAttrs, decls = declsPreAttrs attrs vis - let wholeRange = + let mWhole = match initialRangeOpt with | None -> bindingSetRange | Some m -> unionRanges m bindingSetRange // decls could have a leading attribute |> fun m -> (m, decls) ||> unionRangeWithListBy (fun (SynBinding(range = m)) -> m) - if not (isNil ignoredFreeAttrs) then warning(Error(FSComp.SR.parsAttributesIgnored(), wholeRange)); - if isUse then errorR(Error(FSComp.SR.parsUseBindingsIllegalInImplicitClassConstructors(), wholeRange)) - SynMemberDefn.LetBindings (decls, isStatic, isRec, wholeRange) + if not (isNil ignoredFreeAttrs) then warning(Error(FSComp.SR.parsAttributesIgnored(), mWhole)); + if isUse then errorR(Error(FSComp.SR.parsUseBindingsIllegalInImplicitClassConstructors(), mWhole)) + SynMemberDefn.LetBindings (decls, isStatic, isRec, mWhole) let mkLocalBindings (mWhole, BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, _), mIn, body: SynExpr) = let ignoredFreeAttrs, decls = declsPreAttrs [] None @@ -830,12 +830,12 @@ moduleSpfn: _xmlDoc.MarkAsInvalid() let attrs = $1 @ cas let xmlDoc = grabXmlDoc(parseState, $1, 1) - let mTc = + let mDefn = (d3, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRanges range |> unionRangeWithXmlDoc xmlDoc - let tc = (SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, mTc)) - let m = (mTc, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) + let tc = SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, mDefn) + let m = (mDefn, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) SynModuleSigDecl.Types (tc :: $5, m) } | opt_attributes opt_declVisibility exconSpfn @@ -844,8 +844,8 @@ moduleSpfn: let xmlDoc = grabXmlDoc(parseState, $1, 1) let mDefnReprWithAttributes = (d2, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mWhole = (mDefnReprWithAttributes, members) ||> unionRangeWithListBy (fun (m: SynMemberSig) -> m.Range) - let ec = SynExceptionSig(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, mDefnReprWithAttributes), withKeyword, members, mWhole) - SynModuleSigDecl.Exception(ec, mWhole) } + let synExnDefn = SynExceptionSig(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, mDefnReprWithAttributes), withKeyword, members, mWhole) + SynModuleSigDecl.Exception(synExnDefn, mWhole) } | openDecl { SynModuleSigDecl.Open($1, (rhs parseState 1)) } @@ -901,7 +901,8 @@ tyconSpfnList: | AND tyconSpfn tyconSpfnList { let xmlDoc = grabXmlDoc(parseState, [], 1) let tyconSpfn = - let (SynTypeDefnSig(SynComponentInfo (a, typars, c, lid, _xmlDoc, fixity, vis, rangeOfLid) as componentInfo, equalsRange, typeRepr, withKeyword, members, range)) = $2 + let (SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range)) = $2 + let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then $2 else let range = unionRangeWithXmlDoc _xmlDoc range @@ -910,7 +911,8 @@ tyconSpfnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - SynTypeDefnSig(SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, rangeOfLid), equalsRange, typeRepr, withKeyword, members, range) + let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range) tyconSpfn :: $3 } | @@ -920,9 +922,9 @@ tyconSpfnList: /* A type definition in a signature */ tyconSpfn: | typeNameInfo EQUALS tyconSpfnRhsBlock - { let lhsm = rhs parseState 1 + { let mLhs = rhs parseState 1 let mEquals = rhs parseState 2 - $3 lhsm $1 (Some mEquals) } + $3 mLhs $1 (Some mEquals) } | typeNameInfo opt_classSpfn { let mWithKwd, members = $2 let (SynComponentInfo(range=range)) = $1 @@ -949,22 +951,22 @@ tyconSpfnRhsBlock: /* representation. */ | OBLOCKBEGIN tyconSpfnRhs opt_OBLOCKSEP classSpfnMembers opt_classSpfn oblockend opt_classSpfn { let m = lhs parseState - (fun lhsm nameInfo mEquals -> + (fun mLhs nameInfo mEquals -> let members = $4 @ (snd $5) - $2 lhsm nameInfo mEquals (checkForMultipleAugmentations m members (snd $7))) } + $2 mLhs nameInfo mEquals (checkForMultipleAugmentations m members (snd $7))) } | tyconSpfnRhs opt_classSpfn { let m = lhs parseState - (fun lhsm nameInfo mEquals -> + (fun mLhs nameInfo mEquals -> let _, members = $2 - $1 lhsm nameInfo mEquals members) } + $1 mLhs nameInfo mEquals members) } /* The right-hand-side of a type definition in a signature */ tyconSpfnRhs: | tyconDefnOrSpfnSimpleRepr - { (fun lhsm nameInfo mEquals augmentation -> - let declRange = unionRanges lhsm $1.Range + { (fun mLhs nameInfo mEquals augmentation -> + let declRange = unionRanges mLhs $1.Range let mWhole = (declRange, augmentation) ||> unionRangeWithListBy (fun (mem: SynMemberSig) -> mem.Range) SynTypeDefnSig(nameInfo, mEquals, SynTypeDefnSigRepr.Simple ($1, $1.Range), None, augmentation, mWhole)) } @@ -1063,7 +1065,7 @@ classMemberSpfn: let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = $4, grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 let mWith, getSetRangeOpt, getSet = $10 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet - let wholeRange = + let mWhole = let m = rhs parseState 3 match getSetRangeOpt with | None -> unionRanges m ty.Range @@ -1074,9 +1076,9 @@ classMemberSpfn: match optLiteralValue with | None -> m | Some e -> unionRanges m e.Range - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, wholeRange, { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals }) + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals }) let _, flags = $3 - SynMemberSig.Member(valSpfn, flags (getSetAdjuster arity), wholeRange) } + SynMemberSig.Member(valSpfn, flags (getSetAdjuster arity), mWhole) } | opt_attributes opt_declVisibility interfaceMember appType { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) @@ -1087,18 +1089,18 @@ classMemberSpfn: SynMemberSig.Inherit ($4, unionRanges (rhs parseState 3) ($4).Range) } | opt_attributes opt_declVisibility VAL fieldDecl - { let wholeRange = rhs2 parseState 1 4 + { let mWhole = rhs2 parseState 1 4 if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $4 $1 false wholeRange - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynMemberSig.ValField (field, wholeRange) } + let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $4 $1 false mWhole + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynMemberSig.ValField (field, mWhole) } | opt_attributes opt_declVisibility STATIC VAL fieldDecl - { let wholeRange = rhs2 parseState 1 5 + { let mWhole = rhs2 parseState 1 5 if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $5 $1 true wholeRange - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynMemberSig.ValField(field, wholeRange) } + let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $5 $1 true mWhole + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynMemberSig.ValField(field, mWhole) } | opt_attributes opt_declVisibility STATIC typeKeyword tyconSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) @@ -1374,9 +1376,9 @@ moduleDefn: let (SynTypeDefn(SynComponentInfo(cas, a, cs, b, _xmlDoc, d, d2, d3), e, f, g, h, trivia)) = $4 _xmlDoc.MarkAsInvalid() let attrs = $1@cas - let mTc = (h, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRangeWithXmlDoc xmlDoc + let mDefn = (h, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mType = rhs parseState 3 - let tc = (SynTypeDefn(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), e, f, g, mTc, { trivia with TypeKeyword = Some mType })) + let tc = SynTypeDefn(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), e, f, g, mDefn, { trivia with TypeKeyword = Some mType }) let types = tc :: $5 [ SynModuleDecl.Types(types, (rhs parseState 3, types) ||> unionRangeWithListBy (fun t -> t.Range) ) ] } @@ -1387,8 +1389,8 @@ moduleDefn: let xmlDoc = grabXmlDoc(parseState, $1, 1) let defnReprRange = (d2, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mWhole = (f, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc - let ec = (SynExceptionDefn(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, defnReprRange), withKeyword, e, mWhole)) - [ SynModuleDecl.Exception(ec, mWhole) ] } + let synExnDefn = SynExceptionDefn(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, defnReprRange), withKeyword, e, mWhole) + [ SynModuleDecl.Exception(synExnDefn, mWhole) ] } /* 'module' definitions */ | opt_attributes opt_declVisibility moduleIntro EQUALS namedModuleDefnBlock @@ -1614,7 +1616,8 @@ tyconDefnList: | AND tyconDefn tyconDefnList { let xmlDoc = grabXmlDoc(parseState, [], 1) let tyconDefn = - let (SynTypeDefn(SynComponentInfo (a, typars, c, lid, _xmlDoc, fixity, vis, rangeOfLid) as componentInfo, typeRepr, members, implicitConstructor, range, trivia)) = $2 + let (SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia)) = $2 + let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then $2 else let range = unionRangeWithXmlDoc _xmlDoc range @@ -1623,7 +1626,8 @@ tyconDefnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - SynTypeDefn(SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, rangeOfLid), typeRepr, members, implicitConstructor, range, trivia) + let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia) tyconDefn :: $3 } | { [] } @@ -1910,15 +1914,15 @@ classDefnMember: let isInline, doc, id, explicitValTyparDecls = $4, grabXmlDoc(parseState, $1, 1), $5, $6 let mWith, getSetRangeOpt, getSet = $9 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet - let wholeRange = + let mWhole = let m = rhs parseState 1 match getSetRangeOpt with | None -> unionRanges m ty.Range | Some m2 -> unionRanges m m2 |> unionRangeWithXmlDoc doc - if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), wholeRange)) - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, wholeRange, { ValKeyword = None; WithKeyword = mWith; EqualsRange = None }) - [ SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags $3 (getSetAdjuster arity), wholeRange) ] } + if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = None }) + [ SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags $3 (getSetAdjuster arity), mWhole) ] } | opt_attributes opt_declVisibility inheritsDefn { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalOnInherit(), rhs parseState 1)) @@ -1998,13 +2002,13 @@ atomicPatternLongIdent: raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolDot()) let underscore = ident("_", rhs parseState 1) - let dotm = rhs parseState 2 - None, prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) dotm $3 } + let mDot = rhs parseState 2 + None, prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $3 } | GLOBAL DOT pathOp { let globalIdent = ident(MangledGlobalName, rhs parseState 1) - let dotm = rhs parseState 2 - None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, None)) dotm $3 } + let mDot = rhs parseState 2 + None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, None)) mDot $3 } | pathOp { (None, $1) } @@ -2014,8 +2018,8 @@ atomicPatternLongIdent: raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedSymbolDot()) let underscore = ident("_", rhs parseState 2) - let dotm = rhs parseState 3 - Some($1), prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) dotm $4 } + let mDot = rhs parseState 3 + Some($1), prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $4 } | access pathOp { (Some($1), $2) } @@ -2184,7 +2188,7 @@ tyconDefnOrSpfnSimpleRepr: /* A union type definition */ | opt_attributes opt_declVisibility unionTypeRepr { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalHere(), rhs parseState 1)) - let rangesOf3 = $3 |> List.map (function |Choice1Of2(ec)->ec.Range | Choice2Of2(uc)->uc.Range) + let rangesOf3 = $3 |> List.map (function Choice1Of2 ec -> ec.Range | Choice2Of2 uc -> uc.Range) let mWhole = (rhs2 parseState 1 2, rangesOf3) ||> List.fold unionRanges if $3 |> List.exists (function Choice1Of2 _ -> true | _ -> false) then ( if Option.isSome $2 then errorR(Error(FSComp.SR.parsEnumTypesCannotHaveVisibilityDeclarations(), rhs parseState 2)); @@ -2207,12 +2211,12 @@ tyconDefnOrSpfnSimpleRepr: /* An inline-assembly type definition, for FSharp.Core library only */ | opt_attributes opt_declVisibility LPAREN HASH string HASH rparen { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalHere(), rhs parseState 1)) - let lhsm = lhs parseState - if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError lhsm + let mLhs = lhs parseState + if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError mLhs if Option.isSome $2 then errorR(Error(FSComp.SR.parsInlineAssemblyCannotHaveVisibilityDeclarations(), rhs parseState 2)) let s, _ = $5 let ilType = ParseAssemblyCodeType s parseState.LexBuffer.ReportLibraryOnlyFeatures parseState.LexBuffer.LanguageVersion (rhs parseState 5) - SynTypeDefnSimpleRepr.LibraryOnlyILAssembly (box ilType, lhsm) } + SynTypeDefnSimpleRepr.LibraryOnlyILAssembly (box ilType, mLhs) } /* The core of a record type definition */ @@ -2513,8 +2517,8 @@ unionCaseReprElements: unionCaseReprElement: | ident COLON appType { let xmlDoc = grabXmlDoc(parseState, [], 1) - let wholeRange = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc - mkSynNamedField ($1, $3, xmlDoc, wholeRange) } + let mWhole = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc + mkSynNamedField ($1, $3, xmlDoc, mWhole) } | appType { let xmlDoc = grabXmlDoc(parseState, [], 1) @@ -2539,19 +2543,19 @@ recdFieldDeclList: /* A field declaration in a record type */ recdFieldDecl: | opt_attributes fieldDecl - { let wholeRange = rhs2 parseState 1 2 - let fld = $2 $1 false wholeRange - let (SynField (a, b, c, d, e, xmlDoc, vis, wholeRange)) = fld + { let mWhole = rhs2 parseState 1 2 + let fld = $2 $1 false mWhole + let (SynField (a, b, c, d, e, xmlDoc, vis, mWhole)) = fld if Option.isSome vis then errorR (Error (FSComp.SR.parsRecordFieldsCannotHaveVisibilityDeclarations (), rhs parseState 2)) - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynField (a, b, c, d, e, xmlDoc, None, wholeRange) } + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynField (a, b, c, d, e, xmlDoc, None, mWhole) } /* Part of a field or val declaration in a record type or object type */ fieldDecl: | opt_mutable opt_access ident COLON typ - { fun attrs stat wholeRange -> - let xmlDoc = grabXmlDocAtRangeStart(parseState, attrs, wholeRange) - SynField(attrs, stat, Some $3, $5, $1, xmlDoc, $2, wholeRange) } + { fun attrs stat mWhole -> + let xmlDoc = grabXmlDocAtRangeStart(parseState, attrs, mWhole) + SynField(attrs, stat, Some $3, $5, $1, xmlDoc, $2, mWhole) } /* An exception definition */ exconDefn: @@ -3322,12 +3326,12 @@ parenPattern: { SynPat.Ands(List.rev $1, rhs2 parseState 1 3) } | parenPattern COLON typeWithTypeConstraints %prec paren_pat_colon - { let lhsm = lhs parseState - SynPat.Typed($1, $3, lhsm) } + { let mLhs = lhs parseState + SynPat.Typed($1, $3, mLhs) } | attributes parenPattern %prec paren_pat_attribs - { let lhsm = lhs parseState - SynPat.Attrib($2, $1, lhsm) } + { let mLhs = lhs parseState + SynPat.Attrib($2, $1, mLhs) } | parenPattern COLON_COLON parenPattern { SynPat.LongIdent (SynLongIdent(mkSynCaseName (rhs parseState 2) opNameCons, [], [ Some (IdentTrivia.OriginalNotation "::") ]), None, None, SynArgPats.Pats [ SynPat.Tuple (false, [$1;$3], rhs2 parseState 1 3) ], None, lhs parseState) } @@ -3990,18 +3994,18 @@ declExpr: | declExpr DOT_DOT declExpr { let wholem = rhs2 parseState 1 3 - let opm = rhs parseState 2 - SynExpr.IndexRange(Some $1, opm, Some $3, rhs parseState 1, rhs parseState 3, wholem) } + let mOperator = rhs parseState 2 + SynExpr.IndexRange(Some $1, mOperator, Some $3, rhs parseState 1, rhs parseState 3, wholem) } | declExpr DOT_DOT %prec open_range_expr { let wholem = rhs2 parseState 1 2 - let opm = rhs parseState 2 - SynExpr.IndexRange(Some $1, opm, None, rhs parseState 1, opm, wholem) } + let mOperator = rhs parseState 2 + SynExpr.IndexRange(Some $1, mOperator, None, rhs parseState 1, mOperator, wholem) } | DOT_DOT declExpr %prec open_range_expr { let wholem = rhs2 parseState 1 2 - let opm = rhs parseState 1 - SynExpr.IndexRange(None, opm, Some $2, opm, rhs parseState 2, wholem) } + let mOperator = rhs parseState 1 + SynExpr.IndexRange(None, mOperator, Some $2, mOperator, rhs parseState 2, wholem) } | STAR { let m = rhs parseState 1 @@ -4351,61 +4355,61 @@ atomicExpr: atomicExprQualification: | identOrOp { let idm = rhs parseState 1 - (fun e lhsm dotm -> mkSynDot dotm lhsm e $1) } + (fun e mLhs mDot -> mkSynDot mDot mLhs e $1) } | GLOBAL - { (fun e lhsm dotm -> + { (fun e mLhs mDot -> reportParseErrorAt (rhs parseState 3) (FSComp.SR.nrGlobalUsedOnlyAsFirstName()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' - mkSynDotMissing dotm fixedLhsm e) } + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' + mkSynDotMissing mDot fixedLhsm e) } | /* empty */ - { (fun e lhsm dotm -> - reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' - mkSynDotMissing dotm fixedLhsm e) } + { (fun e mLhs mDot -> + reportParseErrorAt mDot (FSComp.SR.parsMissingQualificationAfterDot()) + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' + mkSynDotMissing mDot fixedLhsm e) } | recover - { (fun e lhsm dotm -> - reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' + { (fun e mLhs mDot -> + reportParseErrorAt mDot (FSComp.SR.parsMissingQualificationAfterDot()) + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' // Include 'e' in the returned expression but throw it away SynExpr.DiscardAfterMissingQualificationAfterDot (e, fixedLhsm)) } | LPAREN COLON_COLON rparen DOT INT32 - { (fun e lhsm dotm -> + { (fun e mLhs mDot -> if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError(lhs parseState) - SynExpr.LibraryOnlyUnionCaseFieldGet (e, mkSynCaseName lhsm opNameCons, (fst $5), lhsm)) } + SynExpr.LibraryOnlyUnionCaseFieldGet (e, mkSynCaseName mLhs opNameCons, (fst $5), mLhs)) } | LPAREN typedSequentialExpr rparen { let lpr = rhs parseState 1 let rpr = rhs parseState 3 - (fun e lhsm dotm -> + (fun e mLhs mDot -> // Check for expr.( * ) // Note that "*" is parsed as an expression (it is allowed in "foo.[3,*]") match $2 with - | SynExpr.IndexRange (None, opm, None, _m1, _m2, _) -> - mkSynDot dotm lhsm e (SynIdent(ident(CompileOpName "*", opm), Some(IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr)))) + | SynExpr.IndexRange (None, mOperator, None, _m1, _m2, _) -> + mkSynDot mDot mLhs e (SynIdent(ident(CompileOpName "*", mOperator), Some(IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr)))) | _ -> if parseState.LexBuffer.SupportsFeature LanguageFeature.MLCompatRevisions then mlCompatError (FSComp.SR.mlCompatMultiPrefixTyparsNoLongerSupported()) (lhs parseState) else mlCompatWarning (FSComp.SR.parsParenFormIsForML()) (lhs parseState) - mkSynDotParenGet lhsm dotm e $2) } + mkSynDotParenGet mLhs mDot e $2) } | LBRACK typedSequentialExpr RBRACK - { (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e $2) } + { (fun e mLhs mDot -> mkSynDotBrackGet mLhs mDot e $2) } | LBRACK typedSequentialExpr recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e $2)) } + (fun e mLhs mDot -> exprFromParseError (mkSynDotBrackGet mLhs mDot e $2)) } | LBRACK error RBRACK { let mArg = rhs2 parseState 1 3 - (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr1", mArg))) } + (fun e mLhs mDot -> mkSynDotBrackGet mLhs mDot e (arbExpr("indexerExpr1", mArg))) } | LBRACK recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) let mArg = (rhs parseState 1).EndRange - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr2", mArg)))) } + (fun e mLhs mDot -> exprFromParseError (mkSynDotBrackGet mLhs mDot e (arbExpr("indexerExpr2", mArg)))) } /* the start of atomicExprAfterType must not overlap with the valid postfix tokens of the type syntax, e.g. new List(...) */ atomicExprAfterType: @@ -4499,8 +4503,8 @@ parenExpr: | LPAREN parenExprBody ends_other_than_rparen_coming_soon_or_recover { if not $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).End - SynExpr.Paren (exprFromParseError ($2 lhsm), rhs parseState 1, None, lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).End + SynExpr.Paren (exprFromParseError ($2 mLhs), rhs parseState 1, None, mLhs) } | LPAREN error rparen { // silent recovery @@ -4508,18 +4512,18 @@ parenExpr: | LPAREN TYPE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2tcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2tcs", mLhs) } | LPAREN MODULE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2mcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2mcs", mLhs) } | LPAREN RBRACE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2rbcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2rbcs", mLhs) } | LPAREN OBLOCKEND_COMING_SOON { let lparenRange = (rhs parseState 1) @@ -4534,8 +4538,8 @@ parenExpr: // to extend all the way over the "recover", to the end of the file if necessary // // let mLeftParen = rhs parseState 1 - //let lhsm = if $2 then unionRangeWithPos mLeftParen (rhs parseState 2).Start else mLeftParen - //arbExpr("parenExpr2", lhsm) } + //let mLhs = if $2 then unionRangeWithPos mLeftParen (rhs parseState 2).Start else mLeftParen + //arbExpr("parenExpr2", mLhs) } parenExprBody: | staticallyKnownHeadTypars COLON LPAREN classMemberSpfn rparen typedSequentialExpr @@ -4596,21 +4600,21 @@ braceExprBody: listExprElements: | sequentialExpr - { (fun lhsm -> SynExpr.ArrayOrListComputed (false, $1, lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrListComputed (false, $1, mLhs)) } | - { (fun lhsm -> SynExpr.ArrayOrList (false, [ ], lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrList (false, [ ], mLhs)) } arrayExprElements: | sequentialExpr - { (fun lhsm -> SynExpr.ArrayOrListComputed (true, $1, lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrListComputed (true, $1, mLhs)) } | - { (fun lhsm -> SynExpr.ArrayOrList (true, [ ], lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrList (true, [ ], mLhs)) } computationExpr: | sequentialExpr - { $1.Range, (fun lhsm -> SynExpr.ComputationExpr (false, $1, lhsm)) } + { $1.Range, (fun mLhs -> SynExpr.ComputationExpr (false, $1, mLhs)) } arrowThenExprR: | RARROW typedSequentialExprBlockR diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 5b383f2c3d2..7093d0c72d4 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -593,11 +593,11 @@ module LeafExpressionConverter = | NullableConstruction arg -> Expression.Convert(ConvExprToLinqInContext env arg, x.Type) |> asExpr | _ -> Expression.New(ctorInfo, ConvExprsToLinq env args) |> asExpr - | Patterns.NewDelegate(dty, vs, b) -> + | Patterns.NewDelegate(delegateTy, vs, b) -> let vsP = List.map ConvVarToLinq vs let env = {env with varEnv = List.foldBack2 (fun (v:Var) vP -> Map.add v (vP |> asExpr)) vs vsP env.varEnv } let bodyP = ConvExprToLinqInContext env b - Expression.Lambda(dty, bodyP, vsP) |> asExpr + Expression.Lambda(delegateTy, bodyP, vsP) |> asExpr | Patterns.NewTuple args -> let tupTy = diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 54ca7e2e3c4..44c625de5f5 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -1408,11 +1408,11 @@ module Patterns = | Unique of 'T | Ambiguous of 'R - let typeEquals (s: Type) (t: Type) = - s.Equals t + let typeEquals (ty1: Type) (ty2: Type) = + ty1.Equals ty2 - let typesEqual (ss: Type list) (tt: Type list) = - (ss.Length = tt.Length) && List.forall2 typeEquals ss tt + let typesEqual (tys1: Type list) (tys2: Type list) = + (tys1.Length = tys2.Length) && List.forall2 typeEquals tys1 tys2 let instFormal (typarEnv: Type[]) (ty: Instantiable<'T>) = ty (fun i -> typarEnv.[i]) diff --git a/tests/scripts/identifierAnalysisByType.fsx b/tests/scripts/identifierAnalysisByType.fsx index 7ac8de7a20b..d3b5c4e9415 100644 --- a/tests/scripts/identifierAnalysisByType.fsx +++ b/tests/scripts/identifierAnalysisByType.fsx @@ -60,7 +60,7 @@ symbols |> Array.filter (fun (v, _) -> v.GenericParameters.Count = 0) |> Array.filter (fun (v, _) -> v.CurriedParameterGroups.Count = 0) |> Array.filter (fun (v, _) -> not v.FullType.IsGenericParameter) -|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse) +|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse.ToString()) |> Array.filter (fun (vTypeText, v, _) -> match vTypeText with | "System.String" -> false @@ -77,6 +77,7 @@ symbols |> Array.map (fun (key, g) -> key, (g + |> Array.distinctBy (fun (_, _, vUse) -> vUse) |> Array.groupBy (fun (_, v, _) -> v.DisplayName) |> Array.sortByDescending (snd >> Array.length))) |> Array.filter (fun (_, g) -> g.Length > 1) @@ -87,7 +88,7 @@ symbols for (nm, entries) in g do printfn " %s (%d times)" nm (Array.length entries) for (_, _, vUse) in entries do - printfn " %s" (vUse.ToString()) + printfn " %s" vUse printfn "") (* From 795248acf16bc1a8e169d0e759c375a43bac7e8b Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 12 Jul 2022 07:42:24 -0700 Subject: [PATCH 034/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1866071 (#13444) (#13476) * Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1865104 * Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1865320 Co-authored-by: Kevin Ransom (msft) Co-authored-by: Kevin Ransom (msft) --- src/Compiler/xlf/FSComp.txt.cs.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.de.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.es.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.fr.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.it.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ja.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ko.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.pl.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.ru.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.tr.xlf | 6 +++--- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 4 ++-- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 9d4c5a11d53..a35ece58510 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Byl očekáván výraz. @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Toto není platný číselný literál. Mezi platné číselné literály patří 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index f2ab77d258a..82283fe4ef5 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Ausdruck wird erwartet @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - Die Datei mit Quelllinkinformationen, die in die portierbare PDB-Datei eingebettet werden soll + Die Datei mit Informationen zur Quellverknüpfung, die in die portierbare PDB-Datei eingebettet werden soll @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Dies ist kein gültiges numerisches Literal. Unter anderem sind die folgenden numerischen Literale gültig: 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 155775b3641..e886d028615 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Se espera una expresión @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Este literal numérico no es válido. Entre los literales numéricos válidos se incluyen 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal) y 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 648d7d4bf73..4990250d81c 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Expression attendue @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - Fichier d'informations sur le lien source à incorporer dans le fichier PDB portable + Fichier d'informations Source Link à incorporer dans le fichier PDB portable @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Littéral numérique non valide. Littéraux numériques valides : 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index ee8dd3fe6e0..f32f9891d15 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Prevista espressione. @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Questo non è un valore letterale numerico valido. I valori letterali numerici validi includono 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index a1c7469c781..082c4e84a92 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + 式を指定してください @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - これは有効な数値リテラルではありません。有効な数値リテラルの例には、1、0x1、0o1、0b1、1l (int)、1u (uint32)、1L (int64)、1UL (uint64)、1s (int16)、1y (sbyte)、1uy (byte)、1.0 (float)、1.0f (float32)、1.0m (decimal)、1I (BigInteger) などがあります。 + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 814daf648a5..06669718825 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + 식이 필요함 @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - 유효한 숫자 리터럴이 아닙니다. 유효한 숫자 리터럴로는 1, 0x1, 0o1, 0b1, 1l(int), 1u(uint32), 1L(int64), 1UL(uint64), 1s(int16), 1y(sbyte), 1uy(byte), 1.0(float), 1.0f(float32), 1.0m(decimal), 1I(BigInteger) 등이 있습니다. + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index fe4e3483e0c..911efdac74d 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Oczekiwanie na wyrażenie @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - Plik informacji o linku kodu źródłowego do osadzenia w przenośnym pliku PDB + Plik informacji o linku do źródła do osadzenia w przenośnym pliku PDB @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Jest to nieprawidłowy literał liczbowy. Do prawidłowych literałów liczbowych należą: 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 73ff934d074..22bb59aa8bd 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Esperando uma expressão @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - O arquivo de informações do link de origem para inserir em um arquivo PDB portátil + O arquivo de informações do Source Link para inserir em um arquivo PDB portátil @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Este não é um literal numérico válido. Literais numéricos válidos incluem 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 3b8b2d7feea..30563882224 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + Ожидается выражение @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - Файл со сведениями о компоновке источников, внедряемый в переносимый PDB-файл + Файл со сведениями об исходной ссылке, внедряемой в переносимый PDB-файл @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Это не является допустимым числовым литералом. Допустимые числовые литералы: 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index d280a4cbbc3..94f5f37e105 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + İfade bekleniyor @@ -5069,7 +5069,7 @@ Source link information file to embed in the portable PDB file - Taşınabilir PDB dosyasına eklenecek kaynak bağlantı bilgileri dosyası + Taşınabilir PDB dosyasına eklenecek kaynak bağlantısı bilgileri dosyası @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - Bu geçerli bir sayısal sabit değer değil. Geçerli sayısal sabit değerler şunları içerir: 1, 0x1, 0o1, 0b1, 1l (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 8218cb9b37b..71f44423b0c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + 应为表达式 @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - 这不是有效的数字文本。有效的数字文本包括 1、0x1、0o1、0b1、1l (int)、1u (uint32)、1L (int64)、1UL (uint64)、1s (int16)、1y (sbyte)、1uy (byte)、1.0 (float)、1.0f (float32)、1.0m (decimal)、1I (BigInteger)。 + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 47ccd3f0e3d..8788739eb7c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -519,7 +519,7 @@ Expecting expression - Expecting expression + 必須是運算式 @@ -5829,7 +5829,7 @@ This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). - 這不是有效的數值常值。有效的數值常值包括 1、0x1、0o1、0b1、1l (int)、1u (uint32)、1L (int64)、1UL (uint64)、1s (int16)、1y (sbyte)、1uy (byte)、1.0 (float)、1.0f (float32)、1.0m (decimal)、1I (BigInteger)。 + This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0o1, 0b1, 1l (int/int32), 1u (uint/uint32), 1L (int64), 1UL (uint64), 1s (int16), 1us (uint16), 1y (int8/sbyte), 1uy (uint8/byte), 1.0 (float/double), 1.0f (float32/single), 1.0m (decimal), 1I (bigint). From f89e6518d167705d5c0bae534dfb49c6a9a39f85 Mon Sep 17 00:00:00 2001 From: Hadrian Tang Date: Tue, 12 Jul 2022 22:58:17 +0800 Subject: [PATCH 035/226] Subtraction of two chars, new conversions, and fixes for dynamic operator invocations and QuotationToExpression (#11681) Co-authored-by: Vlad Zarytovskii Co-authored-by: Don Syme --- src/Compiler/Checking/ConstraintSolver.fs | 33 +- src/Compiler/TypedTree/TcGlobals.fs | 2 +- src/Compiler/pars.fsy | 2 +- src/FSharp.Core/Linq.fs | 488 ++-- src/FSharp.Core/Linq.fsi | 2 +- src/FSharp.Core/Query.fs | 15 +- src/FSharp.Core/prim-types.fs | 650 +++-- src/FSharp.Core/prim-types.fsi | 4 + .../FSharp.Core.UnitTests.fsproj | 1 + .../FSharp.Core/OperatorsModule1.fs | 98 +- .../FSharp.Core/OperatorsModule2.fs | 119 +- .../FSharp.Core/OperatorsModuleChecked.fs | 34 +- .../FSharp.Core/OperatorsModuleDynamic.fs | 1105 ++++++++ tests/FSharp.Core.UnitTests/SurfaceArea.fs | 1 + tests/fsharp/core/libtest/test.fsx | 40 + tests/fsharp/core/quotes/test.fsx | 2314 +++++++++++++++-- tests/fsharp/tools/eval/test.fsx | 33 +- tests/service/ExprTests.fs | 46 +- 18 files changed, 4288 insertions(+), 699 deletions(-) create mode 100644 tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 0119827bdf5..dd9fd013553 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -428,7 +428,7 @@ let isFpTy g ty = /// decimal or decimal<_> let isDecimalTy g ty = - typeEquivAux EraseMeasures g g.decimal_ty ty + typeEquivAux EraseMeasures g g.decimal_ty ty let IsNonDecimalNumericOrIntegralEnumType g ty = IsIntegerOrIntegerEnumTy g ty || isFpTy g ty @@ -443,7 +443,7 @@ let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty /// Checks the argument type for a built-in solution to an op_Addition, op_Subtraction or op_Modulus constraint. -let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) +let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) || (nm = "op_Subtraction" && isCharTy g ty) /// Checks the argument type for a built-in solution to a bitwise operator constraint let IsBitwiseOpType g ty = IsIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) @@ -1601,25 +1601,30 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy argTy return TTraitBuiltIn - | _, _, false, "op_Explicit", [argTy] - when (// The input type. + // Conversions from non-decimal numbers / strings / chars to non-decimal numbers / chars are built-in + | _, _, false, "op_Explicit", [argTy] + when (// The input type. (IsNonDecimalNumericOrIntegralEnumType g argTy || isStringTy g argTy || isCharTy g argTy) && // The output type - (IsNonDecimalNumericOrIntegralEnumType g retTy || isCharTy g retTy) && - // Exclusion: IntPtr and UIntPtr do not support .Parse() from string - not (isStringTy g argTy && isNativeIntegerTy g retTy) && - // Exclusion: No conversion from char to decimal - not (isCharTy g argTy && isDecimalTy g retTy)) -> + (IsNonDecimalNumericOrIntegralEnumType g retTy || isCharTy g retTy)) -> return TTraitBuiltIn - - | _, _, false, "op_Explicit", [argTy] - when (// The input type. - (IsNumericOrIntegralEnumType g argTy || isStringTy g argTy) && + // Conversions from (including decimal) numbers / strings / chars to decimals are built-in + | _, _, false, "op_Explicit", [argTy] + when (// The input type. + (IsNumericOrIntegralEnumType g argTy || isStringTy g argTy || isCharTy g argTy) && // The output type - (isDecimalTy g retTy)) -> + (isDecimalTy g retTy)) -> + return TTraitBuiltIn + // Conversions from decimal numbers to native integers are built-in + // The rest of decimal conversions are handled via op_Explicit lookup on System.Decimal (which also looks for op_Implicit) + | _, _, false, "op_Explicit", [argTy] + when (// The input type. + (isDecimalTy g argTy) && + // The output type + (isNativeIntegerTy g retTy)) -> return TTraitBuiltIn | [], _, false, "Pow", [argTy1; argTy2] diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index cf248940c9a..5075d68b504 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1779,7 +1779,7 @@ type TcGlobals( [ arg0Ty; arg1Ty ], Some retTy -> [vara; varb; varc], [ varaTy; varbTy ], varcTy, [ arg0Ty; arg1Ty; retTy ] - | ("UnaryNegationDynamic" | "CheckedUnaryNegationDynamic" | "LogicalNotDynamic" | "ExplicitDynamic"), + | ("UnaryNegationDynamic" | "CheckedUnaryNegationDynamic" | "LogicalNotDynamic" | "ExplicitDynamic" | "CheckedExplicitDynamic"), [ arg0Ty ], Some retTy -> [vara; varb ], [ varaTy ], varbTy, [ arg0Ty; retTy ] diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 2238c89041b..a21e22dc891 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -1493,7 +1493,7 @@ namedModuleDefnBlock: { Choice1Of2 $1.LongIdent } -/* A module definition that inccludes a 'begin'...'end' (rarely used in F# with #light syntax) */ +/* A module definition that includes a 'begin'...'end' (rarely used in F# with #light syntax) */ wrappedNamedModuleDefn: | structOrBegin moduleDefnsOrExprPossiblyEmpty END { $2 } diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 7093d0c72d4..33a1dd18265 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -75,7 +75,170 @@ module LeafExpressionConverter = let NullableConstructor = typedefof>.GetConstructors().[0] - + + let getNonNullableType typ = match Nullable.GetUnderlyingType typ with null -> typ | t -> t + + // https://github.com/dotnet/runtime/blob/fa779e8cb2b5868a0ac2fd4215f39ffb91f0dab0/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L72 + /// Can LINQ Expressions' BinaryExpression's (Left/Right)Shift construct a SimpleBinaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsInteger typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Byte + | TypeCode.SByte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/fa779e8cb2b5868a0ac2fd4215f39ffb91f0dab0/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L2226 + /// Can LINQ Expressions' BinaryExpression's (Left/Right)Shift construct a SimpleBinaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsSimpleShift left right = + isLinqExpressionsInteger left && getNonNullableType right = typeof + + // https://github.com/dotnet/runtime/blob/cf7e7a46f8a4a6225a8f1e059a846ccdebf0454c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L110 + /// Can LINQ Expressions' (UnaryExpression/BinaryExpression)'s arithmetic operations construct a (SimpleBinaryExpression/UnaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsArithmeticType typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.Double + | TypeCode.Single + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L132 + /// Can LINQ Expressions' UnaryExpression.(Checked)Negate construct a UnaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsArithmeticTypeButNotUnsignedInt typ = + isLinqExpressionsArithmeticType typ && + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> false + | _ -> true + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L149 + /// Can LINQ Expressions' (UnaryExpression.Not/BinaryExpression.Binary(And/Or/ExclusiveOr)) construct a (UnaryExpression/SimpleBinaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsIntegerOrBool typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Int64 + | TypeCode.Int32 + | TypeCode.Int16 + | TypeCode.UInt64 + | TypeCode.UInt32 + | TypeCode.UInt16 + | TypeCode.Boolean + | TypeCode.SByte + | TypeCode.Byte -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L47 + /// Can LINQ Expressions' BinaryExpression's comparison operations construct a (SimpleBinaryExpression/LogicalBinaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsNumeric typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Char + | TypeCode.SByte + | TypeCode.Byte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.Double + | TypeCode.Single + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/afaf666eff08435123eb649ac138419f4c9b9344/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L1047 + /// Can LINQ Expressions' BinaryExpression's equality operations provide built-in structural equality from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsStructurallyEquatable typ = + isLinqExpressionsNumeric typ || typ = typeof || getNonNullableType(typ).IsEnum + + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L1221 + /// Can LINQ Expressions' BinaryExpression's comparison operations provide built-in comparison from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsComparable = isLinqExpressionsNumeric + + /// Can LINQ Expressions' BinaryExpression's equality operations provide built-in equality from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsEquatable typ = + isLinqExpressionsStructurallyEquatable typ || typ = typeof + + /// Can LINQ Expressions' BinaryExpression's conversion operations provide built-in conversion from source to dest? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsConvertible source dest = + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs#L757 + // expression.Type.HasIdentityPrimitiveOrNullableConversionTo(type) || expression.Type.HasReferenceConversionTo(type)) + // In other words, source.HasIdentityPrimitiveOrNullableConversionTo dest || source.HasReferenceConversionTo dest + + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L532 + let isConvertible typ = + let typ = getNonNullableType typ + typ.IsEnum || + match Type.GetTypeCode typ with + | TypeCode.Boolean + | TypeCode.Byte + | TypeCode.SByte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 + | TypeCode.Single + | TypeCode.Double + | TypeCode.Char -> true + | _ -> false + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L229 + // HasIdentityPrimitiveOrNullableConversionTo + getNonNullableType(source).IsEquivalentTo dest + || dest.IsEquivalentTo(getNonNullableType source) + || isConvertible source && isConvertible dest + && (getNonNullableType dest <> typeof || source.IsEnum && source.GetEnumUnderlyingType() = typeof) + + || + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L458 + // IsLegalExplicitVariantDelegateConversion + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L260 + // HasReferenceConversionTo + let rec hasReferenceConversionTo source dest = + + // { if (source == typeof(void) || dest == typeof(void)) return false; } invalidates an identity conversion. This is handled by the IsEquivalentTo check above. + let nnSourceType, nnDestType = getNonNullableType source, getNonNullableType dest + + // Down conversion + nnSourceType.IsAssignableFrom nnDestType + // Up conversion + || nnDestType.IsAssignableFrom nnSourceType + + // Interface conversion + || source.IsInterface || dest.IsInterface + + // The following part shouldn't be needed for our usage of isLinqExpressionsConvertible here because we only use this for potentially nullable built-in numeric types +(* + // Variant delegate conversion + if (IsLegalExplicitVariantDelegateConversion(source, dest)) + { + return true; + } + + // Object conversion handled by assignable above. + Debug.Assert(source != typeof(object) && dest != typeof(object)); + + return (source.IsArray || dest.IsArray) && StrictHasReferenceConversionTo(source, dest, true); +*) + hasReferenceConversionTo source dest let SpecificCallToMethodInfo (minfo: System.Reflection.MethodInfo) = let isg1 = minfo.IsGenericMethod let gmd = if isg1 then minfo.GetGenericMethodDefinition() else null @@ -87,19 +250,20 @@ module LeafExpressionConverter = if isg1 then minfo2.IsGenericMethod && gmd = minfo2.GetGenericMethodDefinition() else minfo = minfo2 ) -> - Some (obj, (minfo2.GetGenericArguments() |> Array.toList), args) + Some (obj, minfo2, args) | _ -> None) - - let (|SpecificCallToMethod|_|) (mhandle: System.RuntimeMethodHandle) = + let (|SpecificCallToMethod|_|) (mhandle: RuntimeMethodHandle) = let minfo = (System.Reflection.MethodInfo.GetMethodFromHandle mhandle) :?> MethodInfo SpecificCallToMethodInfo minfo + let (|GenericArgs|) (minfo: MethodInfo) = minfo.GetGenericArguments() + let (|PhysicalEqualityQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> LanguagePrimitives.PhysicalEquality x y)) let (|GenericEqualityQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> LanguagePrimitives.GenericEquality x y)) let (|EqualsQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x = y)) let (|GreaterQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x > y)) let (|GreaterEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x >= y)) - let (|LessQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x < y)) + let (|LessQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x < y)) let (|LessEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x <= y)) let (|NotEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x <> y)) @@ -185,6 +349,8 @@ module LeafExpressionConverter = let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint16 x)) let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint32 x)) let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint64 x)) + let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.nativeint x)) + let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.unativeint x)) let (|ConvInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToSByte")) let (|ConvUInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToByte")) @@ -208,10 +374,8 @@ module LeafExpressionConverter = let (|ConvNullableUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint16 x)) let (|ConvNullableUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint32 x)) let (|ConvNullableUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint64 x)) - // LINQ expressions can't do native integer operations, so we don't convert these - //let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.nativeint x)) - //let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.unativeint x)) - + let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.nativeint x)) + let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.unativeint x)) let (|UnboxGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.UnboxGeneric x)) let (|TypeTestGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.TypeTestGeneric x)) @@ -226,6 +390,8 @@ module LeafExpressionConverter = let (|CheckedConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint16 x)) let (|CheckedConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint32 x)) let (|CheckedConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint64 x)) + let (|CheckedConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.nativeint x)) + let (|CheckedConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.unativeint x)) let (|ImplicitExpressionConversionHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> ImplicitExpressionConversionHelper x)) let (|MemberInitializationHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> MemberInitializationHelper x)) let (|NewAnonymousObjectHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> NewAnonymousObjectHelper x)) @@ -287,7 +453,7 @@ module LeafExpressionConverter = | Patterns.Value(x, ty) -> Expression.Constant(x, ty) |> asExpr - | UnboxGeneric(_, [toTy], [x]) + | UnboxGeneric(_, GenericArgs [|toTy|], [x]) | Patterns.Coerce(x, toTy) -> let converted = ConvExprToLinqInContext env x @@ -299,7 +465,7 @@ module LeafExpressionConverter = | Patterns.TypeTest(x, toTy) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr - | TypeTestGeneric(_, [toTy], [x]) -> + | TypeTestGeneric(_, GenericArgs [|toTy|], [x]) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr // Expr.*Get @@ -355,147 +521,115 @@ module LeafExpressionConverter = let props = ctor.DeclaringType.GetProperties() Expression.New(ctor, argsR, [| for p in props -> (p :> MemberInfo) |]) |> asExpr - // Do the same thing as C# compiler for string addition - | PlusQ (_, [ty1; ty2; ty3], [x1; x2]) when (ty1 = typeof) && (ty2 = typeof) && (ty3 = typeof) -> + | PlusQ (_, GenericArgs [|ty1; ty2; ty3|], [x1; x2]) when ty1 = typeof && ty2 = typeof && ty3 = typeof -> Expression.Add(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2, StringConcat) |> asExpr - | GenericEqualityQ _ - | EqualsQ _ -> transBinOp inp env false args false Expression.Equal - | NotEqQ _ -> transBinOp inp env false args false Expression.NotEqual - | GreaterQ _ -> transBinOp inp env false args false Expression.GreaterThan - | GreaterEqQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | LessQ _ -> transBinOp inp env false args false Expression.LessThan - | LessEqQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual - | NotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr - - | StaticEqualsQ _ -> transBinOp inp env false args false Expression.Equal - | StaticNotEqQ _ -> transBinOp inp env false args false Expression.NotEqual - | StaticGreaterQ _ -> transBinOp inp env false args false Expression.GreaterThan - | StaticGreaterEqQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | StaticLessQ _ -> transBinOp inp env false args false Expression.LessThan - | StaticLessEqQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual - - | NullableEqualsQ _ -> transBinOp inp env false args true Expression.Equal - | NullableNotEqQ _ -> transBinOp inp env false args true Expression.NotEqual - | NullableGreaterQ _ -> transBinOp inp env false args true Expression.GreaterThan - | NullableGreaterEqQ _ -> transBinOp inp env false args true Expression.GreaterThanOrEqual - | NullableLessQ _ -> transBinOp inp env false args true Expression.LessThan - | NullableLessEqQ _ -> transBinOp inp env false args true Expression.LessThanOrEqual - - | EqualsNullableQ _ -> transBinOp inp env true args false Expression.Equal - | NotEqNullableQ _ -> transBinOp inp env true args false Expression.NotEqual - | GreaterNullableQ _ -> transBinOp inp env true args false Expression.GreaterThan - | GreaterEqNullableQ _ -> transBinOp inp env true args false Expression.GreaterThanOrEqual - | LessNullableQ _ -> transBinOp inp env true args false Expression.LessThan - | LessEqNullableQ _ -> transBinOp inp env true args false Expression.LessThanOrEqual - - | NullableEqualsNullableQ _ -> transBinOp inp env false args false Expression.Equal - | NullableNotEqNullableQ _ -> transBinOp inp env false args false Expression.NotEqual - | NullableGreaterNullableQ _ -> transBinOp inp env false args false Expression.GreaterThan - | NullableGreaterEqNullableQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | NullableLessNullableQ _ -> transBinOp inp env false args false Expression.LessThan - | NullableLessEqNullableQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual + // LanguagePrimitives.PhysicalEquality's generic constraint of both sides being the same reference type is already sufficient for Linq Expressions' requirements + | PhysicalEqualityQ (_, m, [x1; x2]) -> transBoolOpNoWitness (fun _ -> true) env false x1 x2 false (fun (l, r, _, _) -> Expression.ReferenceEqual(l, r)) m + | GenericEqualityQ (_, m, [x1; x2]) + | EqualsQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.Equal m + | NotEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.NotEqual m + | GreaterQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThan m + | GreaterEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThanOrEqual m + | LessQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThan m + | LessEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThanOrEqual m + | NotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr + + | StaticEqualsQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsEquatable inp env x1 x2 Expression.Equal (methodhandleof (fun (x, y) -> LanguagePrimitives.EqualityDynamic x y)) + | StaticNotEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsEquatable inp env x1 x2 Expression.NotEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.InequalityDynamic x y)) + | StaticGreaterQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.GreaterThan (methodhandleof (fun (x, y) -> LanguagePrimitives.GreaterThanDynamic x y)) + | StaticGreaterEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.GreaterThanOrEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.GreaterThanOrEqualDynamic x y)) + | StaticLessQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.LessThan (methodhandleof (fun (x, y) -> LanguagePrimitives.LessThanDynamic x y)) + | StaticLessEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.LessThanOrEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.LessThanOrEqualDynamic x y)) + + | NullableEqualsQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 true Expression.Equal m + | NullableNotEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 true Expression.NotEqual m + | NullableGreaterQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.GreaterThan m + | NullableGreaterEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.GreaterThanOrEqual m + | NullableLessQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.LessThan m + | NullableLessEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.LessThanOrEqual m + + | EqualsNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env true x1 x2 false Expression.Equal m + | NotEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env true x1 x2 false Expression.NotEqual m + | GreaterNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.GreaterThan m + | GreaterEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.GreaterThanOrEqual m + | LessNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.LessThan m + | LessEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.LessThanOrEqual m + + | NullableEqualsNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.Equal m + | NullableNotEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.NotEqual m + | NullableGreaterNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThan m + | NullableGreaterEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThanOrEqual m + | NullableLessNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThan m + | NullableLessEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThanOrEqual m // 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 - | NegQ (_, _, [x1]) -> Expression.Negate(ConvExprToLinqInContext env x1) |> asExpr - | PlusQ _ -> transBinOp inp env false args false Expression.Add - | DivideQ _ -> transBinOp inp env false args false Expression.Divide - | MinusQ _ -> transBinOp inp env false args false Expression.Subtract - | MultiplyQ _ -> transBinOp inp env false args false Expression.Multiply - | ModuloQ _ -> transBinOp inp env false args false Expression.Modulo - - | ShiftLeftQ _ -> transBinOp inp env false args false Expression.LeftShift - | ShiftRightQ _ -> transBinOp inp env false args false Expression.RightShift - | BitwiseAndQ _ -> transBinOp inp env false args false Expression.And - | BitwiseOrQ _ -> transBinOp inp env false args false Expression.Or - | BitwiseXorQ _ -> transBinOp inp env false args false Expression.ExclusiveOr - | BitwiseNotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr + | NegQ (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.Negate (methodhandleof (fun x -> LanguagePrimitives.UnaryNegationDynamic x)) + | 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)) + | DivideQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | ModuloQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + + | ShiftLeftQ (_, _, [x1; x2]) -> transShiftOp inp env false x1 x2 false Expression.LeftShift (methodhandleof (fun (x, y) -> LanguagePrimitives.LeftShiftDynamic x y)) + | ShiftRightQ (_, _, [x1; x2]) -> transShiftOp inp env false x1 x2 false Expression.RightShift (methodhandleof (fun (x, y) -> LanguagePrimitives.RightShiftDynamic x y)) + | 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 (fun x -> LanguagePrimitives.LogicalNotDynamic x)) - | CheckedNeg (_, _, [x1]) -> Expression.NegateChecked(ConvExprToLinqInContext env x1) |> asExpr - | CheckedPlusQ _ -> transBinOp inp env false args false Expression.AddChecked - | CheckedMinusQ _ -> transBinOp inp env false args false Expression.SubtractChecked - | CheckedMultiplyQ _ -> transBinOp inp env false args false Expression.MultiplyChecked + | 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)) + | CheckedMinusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.SubtractChecked (methodhandleof (fun (x, y) -> LanguagePrimitives.CheckedSubtractionDynamic x y)) + | CheckedMultiplyQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.MultiplyChecked (methodhandleof (fun (x, y) -> LanguagePrimitives.CheckedMultiplyDynamic x y)) - | NullablePlusQ _ -> transBinOp inp env false args true Expression.Add - | PlusNullableQ _ -> transBinOp inp env true args false Expression.Add - | NullablePlusNullableQ _ -> transBinOp inp env false args false Expression.Add + | NullablePlusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) + | PlusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) + | NullablePlusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) - | NullableMinusQ _ -> transBinOp inp env false args true Expression.Subtract - | MinusNullableQ _ -> transBinOp inp env true args false Expression.Subtract - | NullableMinusNullableQ _ -> transBinOp inp env false args false Expression.Subtract + | NullableMinusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) + | MinusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) + | NullableMinusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) - | NullableMultiplyQ _ -> transBinOp inp env false args true Expression.Multiply - | MultiplyNullableQ _ -> transBinOp inp env true args false Expression.Multiply - | NullableMultiplyNullableQ _ -> transBinOp inp env false args false Expression.Multiply + | NullableMultiplyQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) + | MultiplyNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) + | NullableMultiplyNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) - | NullableDivideQ _ -> transBinOp inp env false args true Expression.Divide - | DivideNullableQ _ -> transBinOp inp env true args false Expression.Divide - | NullableDivideNullableQ _ -> transBinOp inp env false args false Expression.Divide + | NullableDivideQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | DivideNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | NullableDivideNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) - | NullableModuloQ _ -> transBinOp inp env false args true Expression.Modulo - | ModuloNullableQ _ -> transBinOp inp env true args false Expression.Modulo - | NullableModuloNullableQ _ -> transBinOp inp env false args false Expression.Modulo - - | ConvNullableCharQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableDecimalQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableFloatQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableDoubleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableFloat32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableSingleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableSByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableIntQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - // LINQ expressions can't do native integer operations, so we don't convert these - //| ConvNullableIntPtrQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - //| ConvNullableUIntPtrQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - - | ConvCharQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvDecimalQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvFloatQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvDoubleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvFloat32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvSingleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvSByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvIntQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - - | CheckedConvCharQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvSByteQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt8Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt16Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt32Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt64Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvByteQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt8Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt16Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt32Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt64Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ArrayLookupQ (_, [_; _; _], [x1; x2]) -> + | NullableModuloQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + | ModuloNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + | NullableModuloNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + + | ConvNullableCharQ (_, _, [x]) | ConvNullableDecimalQ (_, _, [x]) | ConvNullableFloatQ (_, _, [x]) | ConvNullableDoubleQ (_, _, [x]) -> transConv inp env false x + | ConvNullableFloat32Q (_, _, [x]) | ConvNullableSingleQ (_, _, [x]) | ConvNullableSByteQ (_, _, [x]) | ConvNullableInt8Q (_, _, [x]) -> transConv inp env false x + | ConvNullableInt16Q (_, _, [x]) | ConvNullableInt32Q (_, _, [x]) | ConvNullableIntQ (_, _, [x]) | ConvNullableInt64Q (_, _, [x]) -> transConv inp env false x + | ConvNullableByteQ (_, _, [x]) | ConvNullableUInt8Q (_, _, [x]) | ConvNullableUInt16Q (_, _, [x]) | ConvNullableUInt32Q (_, _, [x]) -> transConv inp env false x + | ConvNullableUInt64Q (_, _, [x]) | ConvNullableIntPtrQ (_, _, [x]) | ConvNullableUIntPtrQ (_, _, [x]) -> transConv inp env false x + + | ConvCharQ (_, _, [x]) | ConvDecimalQ (_, _, [x]) | ConvFloatQ (_, _, [x]) | ConvDoubleQ (_, _, [x]) -> transConv inp env false x + | ConvFloat32Q (_, _, [x]) | ConvSingleQ (_, _, [x]) | ConvSByteQ (_, _, [x]) | ConvInt8Q (_, _, [x]) -> transConv inp env false x + | ConvInt16Q (_, _, [x]) | ConvInt32Q (_, _, [x]) | ConvIntQ (_, _, [x]) | ConvInt64Q (_, _, [x]) -> transConv inp env false x + | ConvByteQ (_, _, [x]) | ConvUInt8Q (_, _, [x]) | ConvUInt16Q (_, _, [x]) | ConvUInt32Q (_, _, [x]) -> transConv inp env false x + | ConvUInt64Q (_, _, [x]) | ConvIntPtrQ (_, _, [x]) | ConvUIntPtrQ (_, _, [x]) -> transConv inp env false x + + | CheckedConvCharQ (_, _, [x]) | CheckedConvSByteQ (_, _, [x]) | CheckedConvInt8Q (_, _, [x]) | CheckedConvInt16Q (_, _, [x]) -> transConv inp env true x + | CheckedConvInt32Q (_, _, [x]) | CheckedConvInt64Q (_, _, [x]) | CheckedConvByteQ (_, _, [x]) | CheckedConvUInt8Q (_, _, [x]) -> transConv inp env true x + | CheckedConvUInt16Q (_, _, [x]) | CheckedConvUInt32Q (_, _, [x]) | CheckedConvUInt64Q (_, _, [x]) | CheckedConvIntPtrQ (_, _, [x]) -> transConv inp env true x + | CheckedConvUIntPtrQ (_, _, [x]) -> transConv inp env true x + + | ArrayLookupQ (_, GenericArgs [|_; _; _|], [x1; x2]) -> Expression.ArrayIndex(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2) |> asExpr // Throw away markers inserted to satisfy C#'s design where they pass an argument // or type T to an argument expecting Expression. - | ImplicitExpressionConversionHelperQ (_, [_], [x1]) -> ConvExprToLinqInContext env x1 + | ImplicitExpressionConversionHelperQ (_, GenericArgs [|_|], [x1]) -> ConvExprToLinqInContext env x1 // Use witnesses if they are available | CallWithWitnesses (objArgOpt, _, minfo2, witnessArgs, args) -> @@ -665,15 +799,79 @@ module LeafExpressionConverter = 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()))) - and transBinOp inp env addConvertLeft args addConvertRight (exprErasedConstructor : _ * _ -> _) = - match args with - | [x1; x2] -> - let e1 = ConvExprToLinqInContext env x1 - let e2 = ConvExprToLinqInContext env x2 - let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 - let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 - exprErasedConstructor(e1, e2) |> asExpr - | _ -> failConvert inp + /// Translate a unary operator + and transUnaryOp linqExpressionsCondition inp env x (exprErasedConstructor: _ * _ -> _) fallback = + let e = ConvExprToLinqInContext env x + if linqExpressionsCondition e.Type then + exprErasedConstructor(e, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a shift operator + and transShiftOp inp env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1.Type = e2.Type && isLinqExpressionsSimpleShift e1.Type e2.Type then + exprErasedConstructor(e1, e2, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a non-shift binary operator that does not return a boolean + and transBinOp linqExpressionsCondition inp env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1.Type = e2.Type && linqExpressionsCondition e1.Type then + exprErasedConstructor(e1, e2, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + // The F# boolean structural equality / comparison operators do not take witnesses and the referenced methods are callable directly + /// Translate a non-shift binary operator without witnesses that does not return a boolean + and transBoolOpNoWitness linqExpressionsCondition env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ * _ -> _) method = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1' = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2' = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1'.Type = e2'.Type && linqExpressionsCondition e1.Type then + // 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 + exprErasedConstructor(e1, e2, false, method) + |> asExpr + + // But the static boolean operators do take witnesses! + /// Translate a non-shift binary operator that returns a boolean + and transBoolOp linqExpressionsCondition inp env x1 x2 (exprErasedConstructor: _ * _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + if e1.Type = e2.Type && linqExpressionsCondition e1.Type then + // 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 + exprErasedConstructor(e1, e2, false, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a conversion operator + and transConv (inp: Expr) env isChecked x = + let e = ConvExprToLinqInContext env x + let exprErasedConstructor: _ * _ * _ -> _ = if isChecked then Expression.ConvertChecked else Expression.Convert + if isLinqExpressionsConvertible e.Type inp.Type then + exprErasedConstructor(e, inp.Type, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof (fun x -> LanguagePrimitives.CheckedExplicitDynamic x) else methodhandleof (fun x -> LanguagePrimitives.ExplicitDynamic x)) :?> Reflection.MethodInfo + exprErasedConstructor(e, inp.Type, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) + |> asExpr and ConvObjArg env objOpt coerceTo : Expression = match objOpt with @@ -716,6 +914,4 @@ module LeafExpressionConverter = d.DynamicInvoke [| box () |] with :? System.Reflection.TargetInvocationException as exn -> raise exn.InnerException -#endif - - +#endif \ No newline at end of file diff --git a/src/FSharp.Core/Linq.fsi b/src/FSharp.Core/Linq.fsi index cfe61b4d1eb..13f3fa4187e 100644 --- a/src/FSharp.Core/Linq.fsi +++ b/src/FSharp.Core/Linq.fsi @@ -88,4 +88,4 @@ module LeafExpressionConverter = val SubstHelperRaw: Expr * Var[] * obj[] -> Expr val internal (|SpecificCallToMethod|_|): - System.RuntimeMethodHandle -> (Expr -> (Expr option * Type list * Expr list) option) + System.RuntimeMethodHandle -> (Expr -> (Expr option * Reflection.MethodInfo * Expr list) option) diff --git a/src/FSharp.Core/Query.fs b/src/FSharp.Core/Query.fs index 2701df53b1c..ae11d3835a1 100644 --- a/src/FSharp.Core/Query.fs +++ b/src/FSharp.Core/Query.fs @@ -314,26 +314,27 @@ module Query = match prop.GetGetMethod true with | null -> None | v -> Some v + let (|GenericArgs|) (minfo: MethodInfo) = minfo.GetGenericArguments() |> Array.toList // Match 'f x' let (|SpecificCall1|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1]) -> Some(builderObj, tyargs, arg1) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1]) -> Some(builderObj, tyargs, arg1) | _ -> None // Match 'f x y' or 'f (x, y)' let (|SpecificCall2|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1; arg2]) -> Some(builderObj, tyargs, arg1, arg2) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1; arg2]) -> Some(builderObj, tyargs, arg1, arg2) | _ -> None // Match 'f x y z' or 'f (x, y, z)' let (|SpecificCall3|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1; arg2; arg3]) -> Some(builderObj, tyargs, arg1, arg2, arg3) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1; arg2; arg3]) -> Some(builderObj, tyargs, arg1, arg2, arg3) | _ -> None /// (fun (x, y) -> z) is represented as 'fun p -> let x = p#0 let y = p#1' etc. @@ -1286,7 +1287,7 @@ module Query = // rewrite has had the custom operator translation mechanism applied. In this case, the // body of the "for" will simply contain "yield". - | CallQueryBuilderFor (_, [_; qTy; immutResElemTy; _], [immutSource; Lambda(immutSelectorVar, immutSelector) ]) -> + | CallQueryBuilderFor (_, GenericArgs [_; qTy; immutResElemTy; _], [immutSource; Lambda(immutSelectorVar, immutSelector) ]) -> let mutSource, sourceConv = TransInner CanEliminate.Yes check immutSource @@ -1467,7 +1468,7 @@ module Query = | _ -> GroupingConv (immutKeySelector.Type, immutElementSelector.Type, selectorConv) TransInnerResult.Other(MakeGroupValBy(qTyIsIQueryable qTy, mutVar1.Type, mutKeySelector.Type, mutElementSelector.Type, mutSource, mutVar2, mutKeySelector, mutVar1, mutElementSelector)), conv - | CallJoin(_, [_; qTy; _; _; _], + | CallJoin(_, GenericArgs [_; qTy; _; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) @@ -1491,7 +1492,7 @@ module Query = TransInnerResult.Other joinExpr, elementSelectorConv | CallGroupJoin - (_, [_; qTy; _; _; _], + (_, GenericArgs [_; qTy; _; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) @@ -1517,7 +1518,7 @@ module Query = TransInnerResult.Other joinExpr, elementSelectorConv | CallLeftOuterJoin - (_, [ _; qTy; immutInnerSourceTy; _; _], + (_, GenericArgs [ _; qTy; immutInnerSourceTy; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 40b4941045b..1d5dcc28d05 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -2518,7 +2518,6 @@ namespace Microsoft.FSharp.Core // this condition is used whenever ^T is resolved to a nominal type when ^T : ^T = (^T : (static member Zero : ^T) ()) - let inline GenericOne< ^T when ^T : (static member One : ^T) > : ^T = GenericOneDynamic<(^T)>() when ^T : int32 = 1 @@ -2541,10 +2540,21 @@ namespace Microsoft.FSharp.Core when ^T : ^T = (^T : (static member One : ^T) ()) type Type with - + /// Gets a single static non-conversion operator or method by types member inline this.GetSingleStaticMethodByTypes(name: string, parameterTypes: Type[]) = - let staticBindingFlags = (# "" 0b111000 : BindingFlags #) // BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic - this.GetMethod(name, staticBindingFlags, null, parameterTypes, null ) + let staticBindingFlags = (# "" 0b111000 : BindingFlags #) // BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic + this.GetMethod(name, staticBindingFlags, null, parameterTypes, null ) + + // Logic based on https://github.com/dotnet/runtime/blob/f66b142980b2b0df738158457458e003944dc7f6/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L662 + /// Gets a single static conversion operator by types + member inline this.GetSingleStaticConversionOperatorByTypes(fromType : Type, toType : Type) = + 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")) && + (let p = mi.GetParameters() in p.Length = 1 && (get p 0).ParameterType.IsEquivalentTo fromType) && mi.ReturnType.IsEquivalentTo toType then + ret <- mi + ret let UnaryDynamicImpl nm : ('T -> 'U) = let aty = typeof<'T> @@ -2567,7 +2577,14 @@ namespace Microsoft.FSharp.Core match meth with | null -> - let ameth = aty.GetSingleStaticMethodByTypes(opName, [| aty |]) + let ameth = + if System.String.Equals(opName, "op_Explicit") then + let aty2 = typeof<'U> + match aty.GetSingleStaticConversionOperatorByTypes(aty, aty2) with + | null -> aty2.GetSingleStaticConversionOperatorByTypes(aty, aty2) + | ameth -> ameth + else + aty.GetSingleStaticMethodByTypes(opName, [| aty |]) match ameth with | null -> raise (NotSupportedException (SR.GetString(SR.dyInvOpAddCoerce))) | res -> @@ -2633,6 +2650,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.u2" (# "sub" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.i1" (# "sub" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.u1" (# "sub" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.u1" (# "sub" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, decimal> then convPrim<_,'U> (Decimal.op_Subtraction(convPrim<_,decimal> x, convPrim<_,decimal> y)) else BinaryOpDynamicImplTable.Invoke "op_Subtraction" x y @@ -2715,7 +2733,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, unativeint> then convPrim<_,'U> (# "add.ovf.un" (convPrim<_,unativeint> x) (convPrim<_,unativeint> y) : unativeint #) elif type3eq<'T1, 'T2, 'U, int16> then convPrim<_,'U> (# "conv.ovf.i2" (# "add.ovf" (convPrim<_,int16> x) (convPrim<_,int16> y) : int32 #) : int16 #) elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) - elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : uint16 #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.ovf.i1" (# "add.ovf" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.ovf.u1.un" (# "add.ovf.un" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) elif type3eq<'T1, 'T2, 'U, string> then convPrim<_,'U> (String.Concat(convPrim<_,string> x, convPrim<_,string> y)) @@ -2735,6 +2753,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, unativeint> then convPrim<_,'U> (# "sub.ovf.un" (convPrim<_,unativeint> x) (convPrim<_,unativeint> y) : unativeint #) elif type3eq<'T1, 'T2, 'U, int16> then convPrim<_,'U> (# "conv.ovf.i2" (# "sub.ovf" (convPrim<_,int16> x) (convPrim<_,int16> y) : int32 #) : int16 #) elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "sub.ovf.un" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "sub.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.ovf.i1" (# "sub.ovf" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.ovf.u1.un" (# "sub.ovf.un" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) elif type3eq<'T1, 'T2, 'U, decimal> then convPrim<_,'U> (Decimal.op_Subtraction(convPrim<_,decimal> x, convPrim<_,decimal> y)) @@ -2866,7 +2885,7 @@ namespace Microsoft.FSharp.Core let ExplicitDynamic<'T, 'U> (value: 'T) : 'U = if typeeq<'U, byte> then if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.u1" (convPrim<_,sbyte> value) : byte #) - elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.u1" (convPrim<_,byte> value) : byte #) + elif typeeq<'T, byte> then convPrim<_,'U> value elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u1" (convPrim<_,int16> value) : byte #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u1" (convPrim<_,uint16> value) : byte #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u1" (convPrim<_,int32> value) : byte #) @@ -2881,7 +2900,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, string> then convPrim<_,'U> (ParseByte (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, sbyte> then - if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.i1" (convPrim<_,sbyte> value) : sbyte #) + if typeeq<'T, sbyte> then convPrim<_,'U> value elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i1" (convPrim<_,byte> value) : sbyte #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i1" (convPrim<_,int16> value) : sbyte #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i1" (convPrim<_,uint16> value) : sbyte #) @@ -2900,7 +2919,7 @@ namespace Microsoft.FSharp.Core if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.u2" (convPrim<_,sbyte> value) : uint16 #) elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.u2" (convPrim<_,byte> value) : uint16 #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int16> value) : uint16 #) - elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u2" (convPrim<_,uint16> value) : uint16 #) + elif typeeq<'T, uint16> then convPrim<_,'U> value elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int32> value) : uint16 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,uint32> value) : uint16 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int64> value) : uint16 #) @@ -2909,13 +2928,13 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u2" (convPrim<_,unativeint> value) : uint16 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float> value) : uint16 #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float32> value) : uint16 #) - elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u2" (convPrim<_,char> value) : uint16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "" (convPrim<_,char> value) : uint16 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt16 (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, int16> then if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.i2" (convPrim<_,sbyte> value) : int16 #) elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i2" (convPrim<_,byte> value) : int16 #) - elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i2" (convPrim<_,int16> value) : int16 #) + elif typeeq<'T, int16> then convPrim<_,'U> value elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i2" (convPrim<_,uint16> value) : int16 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i2" (convPrim<_,int32> value) : int16 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.i2" (convPrim<_,uint32> value) : int16 #) @@ -2934,7 +2953,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int16> value) : uint32 #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint16> value) : uint32 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int32> value) : uint32 #) - elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint32> value) : uint32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> value elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int64> value) : uint32 #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint64> value) : uint32 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.u4" (convPrim<_,nativeint> value) : uint32 #) @@ -2949,8 +2968,8 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i4" (convPrim<_,byte> value) : int32 #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int16> value) : int32 #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint16> value) : int32 #) - elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int32> value) : int32 #) - elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint32> value) : int32 #) + elif typeeq<'T, int32> then convPrim<_,'U> value + elif typeeq<'T, uint32> then convPrim<_,'U> (# "" (convPrim<_,uint32> value) : int32 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int64> value) : int32 #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint64> value) : int32 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i4" (convPrim<_,nativeint> value) : int32 #) @@ -2968,7 +2987,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,int32> value) : uint64 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint32> value) : uint64 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "" (convPrim<_,int64> value) : uint64 #) - elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.i8" (convPrim<_,uint64> value) : uint64 #) + elif typeeq<'T, uint64> then convPrim<_,'U> value elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i8" (convPrim<_,nativeint> value) : uint64 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float> value) : uint64 #) @@ -2983,12 +3002,12 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint16> value) : int64 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,int32> value) : int64 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint32> value) : int64 #) - elif typeeq<'T, int64> then convPrim<_,'U> (convPrim<_,int64> value) + elif typeeq<'T, int64> then convPrim<_,'U> value elif typeeq<'T, uint64> then convPrim<_,'U> (# "" (convPrim<_,uint64> value) : int64 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i8" (convPrim<_,nativeint> value) : int64 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u8" (convPrim<_,unativeint> value) : int64 #) - elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float> value) : int64 #) - elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float32> value) : int64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.i8" (convPrim<_,float> value) : int64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,float32> value) : int64 #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u8" (convPrim<_,char> value) : int64 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseInt64 (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value @@ -3004,6 +3023,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r4" (convPrim<_,nativeint> value) : float32 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,unativeint> value) : float32 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float> value) : float32 #) + // NOTE: float32 should convert its argument to 32-bit float even when applied to a higher precision float stored in a register. See devdiv2#49888. elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float32> value) : float32 #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,char> value) : float32 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseSingle (convPrim<_,string> value)) @@ -3019,6 +3039,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint64> value) : float #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r8" (convPrim<_,nativeint> value) : float #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,unativeint> value) : float #) + // NOTE: float should convert its argument to 64-bit float even when applied to a higher precision float stored in a register. See devdiv2#49888. elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float> value) : float #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float32> value) : float #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,char> value) : float #) @@ -3035,10 +3056,11 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i" (convPrim<_,int64> value) : unativeint #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint64> value) : unativeint #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "" (convPrim<_,nativeint> value) : unativeint #) - elif typeeq<'T, unativeint> then convPrim<_,'U> (# "" (convPrim<_,unativeint> value) : unativeint #) + elif typeeq<'T, unativeint> then convPrim<_,'U> value elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u" (convPrim<_,float> value) : unativeint #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u" (convPrim<_,float32> value) : unativeint #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u" (convPrim<_,char> value) : unativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.u" (Decimal.op_Explicit (convPrim<_,decimal> value) : uint64) : unativeint #) elif typeeq<'T, string> then convPrim<_,'U> (ParseUIntPtr (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, nativeint> then @@ -3050,11 +3072,12 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint32> value) : nativeint #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i" (convPrim<_,int64> value) : nativeint #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint64> value) : nativeint #) - elif typeeq<'T, nativeint> then convPrim<_,'U> (# "" (convPrim<_,nativeint> value) : nativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> value elif typeeq<'T, unativeint> then convPrim<_,'U> (# "" (convPrim<_,unativeint> value) : nativeint #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.i" (convPrim<_,float> value) : nativeint #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.i" (convPrim<_,float32> value) : nativeint #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u" (convPrim<_,char> value) : nativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.i" (Decimal.op_Explicit (convPrim<_,decimal> value) : int64) : nativeint #) elif typeeq<'T, string> then convPrim<_,'U> (ParseIntPtr (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, char> then @@ -3070,7 +3093,8 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u2" (convPrim<_,unativeint> value) : char #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float> value) : char #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float32> value) : char #) - elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u2" (convPrim<_,char> 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> (Char.Parse (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, decimal> then @@ -3086,7 +3110,240 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #)) elif typeeq<'T, float> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float> value)) elif typeeq<'T, float32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float32> value)) - elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,char> value)) + elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (# "" (convPrim<_,char> value) : uint16 #)) + elif typeeq<'T, decimal> then convPrim<_,'U> value + elif typeeq<'T, string> then convPrim<_,'U> (Decimal.Parse(convPrim<_,string> value, NumberStyles.Float,CultureInfo.InvariantCulture)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + else + UnaryOpDynamicImplTable.Invoke "op_Explicit" value + + let CheckedExplicitDynamic<'T, 'U> (value: 'T) : 'U = + if typeeq<'U, byte> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,sbyte> value) : byte #) + elif typeeq<'T, byte> then convPrim<_,'U> value + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int16> value) : byte #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint16> value) : byte #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int32> value) : byte #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint32> value) : byte #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int64> value) : byte #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint64> value) : byte #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,nativeint> value) : byte #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,unativeint> value) : byte #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,float> value) : byte #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,float32> value) : byte #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,char> value) : byte #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseByte (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, sbyte> then + if typeeq<'T, sbyte> then convPrim<_,'U> value + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,byte> value) : sbyte #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int16> value) : sbyte #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint16> value) : sbyte #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int32> value) : sbyte #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint32> value) : sbyte #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int64> value) : sbyte #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint64> value) : sbyte #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,nativeint> value) : sbyte #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,unativeint> value) : sbyte #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,float> value) : sbyte #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,float32> value) : sbyte #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,char> value) : sbyte #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseSByte (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint16> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,sbyte> value) : uint16 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,byte> value) : uint16 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int16> value) : uint16 #) + elif typeeq<'T, uint16> then convPrim<_,'U> value + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int32> value) : uint16 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint32> value) : uint16 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int64> value) : uint16 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint64> value) : uint16 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,nativeint> value) : uint16 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,unativeint> value) : uint16 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float> value) : uint16 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float32> value) : uint16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "" (convPrim<_,char> value) : uint16 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt16 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int16> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,sbyte> value) : int16 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,byte> value) : int16 #) + elif typeeq<'T, int16> then convPrim<_,'U> value + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint16> value) : int16 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,int32> value) : int16 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint32> value) : int16 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,int64> value) : int16 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint64> value) : int16 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,nativeint> value) : int16 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,unativeint> value) : int16 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,float> value) : int16 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,float32> value) : int16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,char> value) : int16 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt16 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,sbyte> value) : uint32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,byte> value) : uint32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int16> value) : uint32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,uint16> value) : uint32 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int32> value) : uint32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> value + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int64> value) : uint32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,uint64> value) : uint32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,nativeint> value) : uint32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,unativeint> value) : uint32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,float> value) : uint32 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,float32> value) : uint32 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,char> value) : uint32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt32 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,sbyte> value) : int32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,byte> value) : int32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,int16> value) : int32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint16> value) : int32 #) + elif typeeq<'T, int32> then convPrim<_,'U> value + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint32> value) : int32 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,int64> value) : int32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint64> value) : int32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,nativeint> value) : int32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,unativeint> value) : int32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,float> value) : int32 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,float32> value) : int32 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,char> value) : int32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt32 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint64> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,sbyte> value) : uint64 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,byte> value) : uint64 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int16> value) : uint64 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,uint16> value) : uint64 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int32> value) : uint64 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,uint32> value) : uint64 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int64> value) : uint64 #) + elif typeeq<'T, uint64> then convPrim<_,'U> value + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,nativeint> value) : uint64 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,unativeint> value) : uint64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,float> value) : uint64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,float32> value) : uint64 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,char> value) : uint64 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt64 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int64> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,sbyte> value) : int64 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,byte> value) : int64 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,int16> value) : int64 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint16> value) : int64 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,int32> value) : int64 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint32> value) : int64 #) + elif typeeq<'T, int64> then convPrim<_,'U> value + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint64> value) : int64 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,nativeint> value) : int64 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,unativeint> value) : int64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,float> value) : int64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,float32> value) : int64 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,char> value) : int64 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt64 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, float32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.r4" (convPrim<_,sbyte> value) : float32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,byte> value) : float32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int16> value) : float32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint16> value) : float32 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int32> value) : float32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint32> value) : float32 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int64> value) : float32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint64> value) : float32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r4" (convPrim<_,nativeint> value) : float32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,unativeint> value) : float32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float> value) : float32 #) + elif typeeq<'T, float32> then convPrim<_,'U> value + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,char> value) : float32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseSingle (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, float> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.r8" (convPrim<_,sbyte> value) : float #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,byte> value) : float #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int16> value) : float #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint16> value) : float #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int32> value) : float #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint32> value) : float #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int64> value) : float #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint64> value) : float #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r8" (convPrim<_,nativeint> value) : float #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,unativeint> value) : float #) + elif typeeq<'T, float> then convPrim<_,'U> value + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float32> value) : float #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,char> value) : float #) + elif typeeq<'T, decimal> then convPrim<_,'U> (Convert.ToDouble(convPrim<_,decimal> value)) + elif typeeq<'T, string> then convPrim<_,'U> (ParseDouble (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, unativeint> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,sbyte> value) : unativeint #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,byte> value) : unativeint #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int16> value) : unativeint #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint16> value) : unativeint #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int32> value) : unativeint #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint32> value) : unativeint #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int64> value) : unativeint #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint64> value) : unativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,nativeint> value) : unativeint #) + elif typeeq<'T, unativeint> then convPrim<_,'U> value + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,float> value) : unativeint #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,float32> value) : unativeint #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,char> value) : unativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.ovf.u" (Decimal.op_Explicit (convPrim<_,decimal> value) : uint64) : unativeint #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUIntPtr (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, nativeint> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,sbyte> value) : nativeint #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,byte> value) : nativeint #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int16> value) : nativeint #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint16> value) : nativeint #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int32> value) : nativeint #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint32> value) : nativeint #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int64> value) : nativeint #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint64> value) : nativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> value + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,unativeint> value) : nativeint #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,float> value) : nativeint #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,float32> value) : nativeint #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,char> value) : nativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.ovf.i" (Decimal.op_Explicit (convPrim<_,decimal> value) : int64) : nativeint #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseIntPtr (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, char> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,sbyte> value) : char #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,byte> value) : char #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int16> value) : char #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "" (convPrim<_,uint16> value) : char #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int32> value) : char #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint32> value) : char #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int64> value) : char #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint64> value) : char #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,nativeint> value) : char #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,unativeint> value) : char #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float> value) : char #) + 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)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, decimal> then + if typeeq<'T, sbyte> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,sbyte> value)) + elif typeeq<'T, byte> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,byte> value)) + elif typeeq<'T, int16> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int16> value)) + elif typeeq<'T, uint16> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint16> value)) + elif typeeq<'T, int32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int32> value)) + elif typeeq<'T, uint32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint32> value)) + elif typeeq<'T, int64> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int64> value)) + elif typeeq<'T, uint64> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint64> value)) + elif typeeq<'T, nativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.i8" (convPrim<_,nativeint> value) : int64 #)) + elif typeeq<'T, unativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #)) + elif typeeq<'T, float> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float> value)) + elif typeeq<'T, float32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float32> value)) + elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (# "" (convPrim<_,char> value) : uint16 #)) elif typeeq<'T, decimal> then convPrim<'T,'U> value elif typeeq<'T, string> then convPrim<_,'U> (Decimal.Parse(convPrim<_,string> value, NumberStyles.Float,CultureInfo.InvariantCulture)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value @@ -3211,7 +3468,7 @@ namespace Microsoft.FSharp.Core elif type2eq<'T1, 'T2, char> && typeeq<'U, bool> then convPrim<_,'U> (not (# "ceq" (convPrim<_,char> x) (convPrim<_,char> y) : bool #)) elif type2eq<'T1, 'T2, decimal> && typeeq<'U, bool> then convPrim<_,'U> (Decimal.op_Inequality (convPrim<_,decimal> x, convPrim<_,decimal> y)) elif type2eq<'T1, 'T2, string> && typeeq<'U, bool> then convPrim<_,'U> (not (String.Equals (convPrim<_,string> x, convPrim<_,string> y))) - else BinaryOpDynamicImplTable.Invoke "op_Inequality" x y + else BinaryOpDynamicImplTable.Invoke "op_Inequality" x y type DivideByIntInfo = class end @@ -4054,6 +4311,7 @@ namespace Microsoft.FSharp.Core when ^T : unativeint and ^U : unativeint = (# "sub" x y : unativeint #) when ^T : int16 and ^U : int16 = (# "conv.i2" (# "sub" x y : int32 #) : int16 #) when ^T : uint16 and ^U : uint16 = (# "conv.u2" (# "sub" x y : uint32 #) : uint16 #) + when ^T : char and ^U : char = (# "conv.u2" (# "sub" x y : uint32 #) : char #) when ^T : sbyte and ^U : sbyte = (# "conv.i1" (# "sub" x y : int32 #) : sbyte #) when ^T : byte and ^U : byte = (# "conv.u1" (# "sub" x y : uint32 #) : byte #) when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) @@ -4283,7 +4541,7 @@ namespace Microsoft.FSharp.Core when ^T : uint16 = (# "conv.u1" value : byte #) when ^T : char = (# "conv.u1" value : byte #) when ^T : unativeint = (# "conv.u1" value : byte #) - when ^T : byte = (# "conv.u1" value : byte #) + when ^T : byte = (# "" value : byte #) // According to the somewhat subtle rules of static optimizations, // this condition is used whenever ^T is resolved to a nominal type or witnesses are available when ^T : ^T = (^T : (static member op_Explicit: ^T -> byte) (value)) @@ -4299,11 +4557,11 @@ namespace Microsoft.FSharp.Core when ^T : int32 = (# "conv.i1" value : sbyte #) when ^T : int16 = (# "conv.i1" value : sbyte #) when ^T : nativeint = (# "conv.i1" value : sbyte #) - when ^T : sbyte = (# "conv.i1" value : sbyte #) - when ^T : uint64 = (# "conv.i1" value : sbyte #) - when ^T : uint32 = (# "conv.i1" value : sbyte #) - when ^T : uint16 = (# "conv.i1" value : sbyte #) - when ^T : char = (# "conv.i1" value : sbyte #) + when ^T : sbyte = (# "" value : sbyte #) + when ^T : uint64 = (# "conv.i1" value : sbyte #) + when ^T : uint32 = (# "conv.i1" value : sbyte #) + when ^T : uint16 = (# "conv.i1" value : sbyte #) + when ^T : char = (# "conv.i1" value : sbyte #) when ^T : unativeint = (# "conv.i1" value : sbyte #) when ^T : byte = (# "conv.i1" value : sbyte #) // According to the somewhat subtle rules of static optimizations, @@ -4322,10 +4580,10 @@ namespace Microsoft.FSharp.Core when ^T : int16 = (# "conv.u2" value : uint16 #) when ^T : nativeint = (# "conv.u2" value : uint16 #) when ^T : sbyte = (# "conv.u2" value : uint16 #) - when ^T : uint64 = (# "conv.u2" value : uint16 #) - when ^T : uint32 = (# "conv.u2" value : uint16 #) - when ^T : uint16 = (# "conv.u2" value : uint16 #) - when ^T : char = (# "conv.u2" value : uint16 #) + when ^T : uint64 = (# "conv.u2" value : uint16 #) + when ^T : uint32 = (# "conv.u2" value : uint16 #) + when ^T : uint16 = (# "" value : uint16 #) + when ^T : char = (# "" value : uint16 #) when ^T : unativeint = (# "conv.u2" value : uint16 #) when ^T : byte = (# "conv.u2" value : uint16 #) // According to the somewhat subtle rules of static optimizations, @@ -4341,7 +4599,7 @@ namespace Microsoft.FSharp.Core when ^T : float32 = (# "conv.i2" value : int16 #) when ^T : int64 = (# "conv.i2" value : int16 #) when ^T : int32 = (# "conv.i2" value : int16 #) - when ^T : int16 = (# "conv.i2" value : int16 #) + when ^T : int16 = (# "" value : int16 #) when ^T : nativeint = (# "conv.i2" value : int16 #) when ^T : sbyte = (# "conv.i2" value : int16 #) when ^T : uint64 = (# "conv.i2" value : int16 #) @@ -4368,10 +4626,10 @@ namespace Microsoft.FSharp.Core when ^T : int32 = (# "" value : uint32 #) when ^T : int16 = (# "" value : uint32 #) when ^T : sbyte = (# "" value : uint32 #) - when ^T : uint64 = (# "conv.u4" value : uint32 #) - when ^T : uint32 = (# "conv.u4" value : uint32 #) - when ^T : uint16 = (# "conv.u4" value : uint32 #) - when ^T : char = (# "conv.u4" value : uint32 #) + when ^T : uint64 = (# "conv.u4" value : uint32 #) + when ^T : uint32 = (# "" value : uint32 #) + when ^T : uint16 = (# "conv.u4" value : uint32 #) + when ^T : char = (# "conv.u4" value : uint32 #) when ^T : unativeint = (# "conv.u4" value : uint32 #) when ^T : byte = (# "conv.u4" value : uint32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint32) (value)) @@ -4453,7 +4711,7 @@ namespace Microsoft.FSharp.Core when ^T : string = ParseInt64 (castToString value) when ^T : float = (# "conv.i8" value : int64 #) when ^T : float32 = (# "conv.i8" value : int64 #) - when ^T : int64 = (# "conv.i8" value : int64 #) + when ^T : int64 = (# "" value : int64 #) when ^T : int32 = (# "conv.i8" value : int64 #) when ^T : int16 = (# "conv.i8" value : int64 #) when ^T : nativeint = (# "conv.i8" value : int64 #) @@ -4517,18 +4775,19 @@ namespace Microsoft.FSharp.Core let inline decimal (value: ^T) = ExplicitDynamic<(^T), decimal> value when ^T : string = (Decimal.Parse(castToString value,NumberStyles.Float,CultureInfo.InvariantCulture)) - when ^T : float = (Convert.ToDecimal((# "" value : float #))) - when ^T : float32 = (Convert.ToDecimal((# "" value : float32 #))) - when ^T : int64 = (Convert.ToDecimal((# "" value : int64 #))) - when ^T : int32 = (Convert.ToDecimal((# "" value : int32 #))) - when ^T : int16 = (Convert.ToDecimal((# "" value : int16 #))) - when ^T : nativeint = (Convert.ToDecimal(int64 (# "" value : nativeint #))) - when ^T : sbyte = (Convert.ToDecimal((# "" value : sbyte #))) - when ^T : uint64 = (Convert.ToDecimal((# "" value : uint64 #))) - when ^T : uint32 = (Convert.ToDecimal((# "" value : uint32 #))) - when ^T : uint16 = (Convert.ToDecimal((# "" value : uint16 #))) - when ^T : unativeint = (Convert.ToDecimal(uint64 (# "" value : unativeint #))) - when ^T : byte = (Convert.ToDecimal((# "" value : byte #))) + when ^T : float = (Convert.ToDecimal((# "" value : float #))) + when ^T : float32 = (Convert.ToDecimal((# "" value : float32 #))) + when ^T : int64 = (Convert.ToDecimal((# "" value : int64 #))) + when ^T : int32 = (Convert.ToDecimal((# "" value : int32 #))) + when ^T : int16 = (Convert.ToDecimal((# "" value : int16 #))) + when ^T : nativeint = (Convert.ToDecimal(int64 (# "" value : nativeint #))) + when ^T : sbyte = (Convert.ToDecimal((# "" value : sbyte #))) + when ^T : uint64 = (Convert.ToDecimal((# "" value : uint64 #))) + when ^T : uint32 = (Convert.ToDecimal((# "" value : uint32 #))) + when ^T : uint16 = (Convert.ToDecimal((# "" value : uint16 #))) + when ^T : unativeint = (Convert.ToDecimal(uint64 (# "" value : unativeint #))) + when ^T : byte = (Convert.ToDecimal((# "" value : byte #))) + when ^T : char = (Convert.ToDecimal((# "" value : uint16 #))) // Don't use the char overload which unconditionally raises an exception when ^T : decimal = (# "" value : decimal #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> decimal) (value)) @@ -4553,7 +4812,8 @@ namespace Microsoft.FSharp.Core when ^T : uint16 = (# "conv.u" value : unativeint #) when ^T : char = (# "conv.u" value : unativeint #) when ^T : unativeint = (# "" value : unativeint #) - when ^T : byte = (# "conv.u" value : unativeint #) + when ^T : byte = (# "conv.u" value : unativeint #) + when ^T : decimal = (# "conv.u" (uint64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> unativeint) (value)) [] @@ -4566,7 +4826,7 @@ namespace Microsoft.FSharp.Core when ^T : int64 = (# "conv.i" value : nativeint #) when ^T : int32 = (# "conv.i" value : nativeint #) when ^T : int16 = (# "conv.i" value : nativeint #) - when ^T : nativeint = (# "conv.i" value : nativeint #) + when ^T : nativeint = (# "" value : nativeint #) when ^T : sbyte = (# "conv.i" value : nativeint #) // Narrower unsigned types we zero-extend. // Same length unsigned types we leave as such (so unsigned MaxValue (all-bits-set) gets reinterpreted as -1). @@ -4578,6 +4838,7 @@ namespace Microsoft.FSharp.Core when ^T : char = (# "conv.u" value : nativeint #) when ^T : unativeint = (# "" value : nativeint #) when ^T : byte = (# "conv.i" value : nativeint #) + when ^T : decimal = (# "conv.i" (int64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) [] @@ -4651,8 +4912,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.u2" value : char #) when ^T : uint64 = (# "conv.u2" value : char #) when ^T : uint32 = (# "conv.u2" value : char #) - when ^T : uint16 = (# "conv.u2" value : char #) - when ^T : char = (# "conv.u2" value : char #) + when ^T : uint16 = (# "" value : char #) + when ^T : char = (# "" value : char #) when ^T : unativeint = (# "conv.u2" value : char #) when ^T : byte = (# "conv.u2" value : char #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> char) (value)) @@ -4980,11 +5241,12 @@ namespace Microsoft.FSharp.Core when ^T : uint32 and ^U : uint32 = (# "sub.ovf.un" x y : uint32 #) when ^T : nativeint and ^U : nativeint = (# "sub.ovf" x y : nativeint #) when ^T : unativeint and ^U : unativeint = (# "sub.ovf.un" x y : unativeint #) - when ^T : int16 and ^U : int16 = (# "conv.ovf.i2" (# "sub.ovf" x y : int32 #) : int16 #) - when ^T : uint16 and ^U : uint16 = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : uint16 #) - when ^T : sbyte and ^U : sbyte = (# "conv.ovf.i1" (# "sub.ovf" x y : int32 #) : sbyte #) - when ^T : byte and ^U : byte = (# "conv.ovf.u1.un" (# "sub.ovf.un" x y : uint32 #) : byte #) - when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) + when ^T : int16 and ^U : int16 = (# "conv.ovf.i2" (# "sub.ovf" x y : int32 #) : int16 #) + when ^T : uint16 and ^U : uint16 = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : uint16 #) + when ^T : char and ^U : char = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : char #) + when ^T : sbyte and ^U : sbyte = (# "conv.ovf.i1" (# "sub.ovf" x y : int32 #) : sbyte #) + when ^T : byte and ^U : byte = (# "conv.ovf.u1.un" (# "sub.ovf.un" x y : uint32 #) : byte #) + when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) when ^T : ^T = ((^T or ^U): (static member (-) : ^T * ^U -> ^V) (x,y)) [] @@ -5023,47 +5285,47 @@ namespace Microsoft.FSharp.Core [] [] let inline byte (value: ^T) = - ExplicitDynamic<(^T),byte> value - when ^T : string = ParseByte (castToString value) - when ^T : float = (# "conv.ovf.u1" value : byte #) - when ^T : float32 = (# "conv.ovf.u1" value : byte #) - when ^T : int64 = (# "conv.ovf.u1" value : byte #) - when ^T : int32 = (# "conv.ovf.u1" value : byte #) - when ^T : int16 = (# "conv.ovf.u1" value : byte #) - when ^T : nativeint = (# "conv.ovf.u1" value : byte #) - when ^T : sbyte = (# "conv.ovf.u1" value : byte #) - when ^T : uint64 = (# "conv.ovf.u1.un" value : byte #) - when ^T : uint32 = (# "conv.ovf.u1.un" value : byte #) - when ^T : uint16 = (# "conv.ovf.u1.un" value : byte #) - when ^T : char = (# "conv.ovf.u1.un" value : byte #) + CheckedExplicitDynamic<(^T),byte> value + when ^T : string = ParseByte (castToString value) + when ^T : float = (# "conv.ovf.u1" value : byte #) + when ^T : float32 = (# "conv.ovf.u1" value : byte #) + when ^T : int64 = (# "conv.ovf.u1" value : byte #) + when ^T : int32 = (# "conv.ovf.u1" value : byte #) + when ^T : int16 = (# "conv.ovf.u1" value : byte #) + when ^T : nativeint = (# "conv.ovf.u1" value : byte #) + when ^T : sbyte = (# "conv.ovf.u1" value : byte #) + when ^T : uint64 = (# "conv.ovf.u1.un" value : byte #) + when ^T : uint32 = (# "conv.ovf.u1.un" value : byte #) + when ^T : uint16 = (# "conv.ovf.u1.un" value : byte #) + when ^T : char = (# "conv.ovf.u1.un" value : byte #) when ^T : unativeint = (# "conv.ovf.u1.un" value : byte #) - when ^T : byte = (# "conv.ovf.u1.un" value : byte #) + when ^T : byte = (# "" value : byte #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> byte) (value)) [] [] let inline sbyte (value: ^T) = - ExplicitDynamic<(^T),sbyte> value - when ^T : string = ParseSByte (castToString value) - when ^T : float = (# "conv.ovf.i1" value : sbyte #) - when ^T : float32 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int64 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int32 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int16 = (# "conv.ovf.i1" value : sbyte #) - when ^T : nativeint = (# "conv.ovf.i1" value : sbyte #) - when ^T : sbyte = (# "conv.ovf.i1" value : sbyte #) - when ^T : uint64 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : uint32 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : uint16 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : char = (# "conv.ovf.i1.un" value : sbyte #) + CheckedExplicitDynamic<(^T),sbyte> value + when ^T : string = ParseSByte (castToString value) + when ^T : float = (# "conv.ovf.i1" value : sbyte #) + when ^T : float32 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int64 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int32 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int16 = (# "conv.ovf.i1" value : sbyte #) + when ^T : nativeint = (# "conv.ovf.i1" value : sbyte #) + when ^T : sbyte = (# "" value : sbyte #) + when ^T : uint64 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : uint32 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : uint16 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : char = (# "conv.ovf.i1.un" value : sbyte #) when ^T : unativeint = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : byte = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : byte = (# "conv.ovf.i1.un" value : sbyte #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> sbyte) (value)) [] [] let inline uint16 (value: ^T) = - ExplicitDynamic<(^T),uint16> value + CheckedExplicitDynamic<(^T),uint16> value when ^T : string = ParseUInt16 (castToString value) when ^T : float = (# "conv.ovf.u2" value : uint16 #) when ^T : float32 = (# "conv.ovf.u2" value : uint16 #) @@ -5074,8 +5336,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.ovf.u2" value : uint16 #) when ^T : uint64 = (# "conv.ovf.u2.un" value : uint16 #) when ^T : uint32 = (# "conv.ovf.u2.un" value : uint16 #) - when ^T : uint16 = (# "conv.ovf.u2.un" value : uint16 #) - when ^T : char = (# "conv.ovf.u2.un" value : uint16 #) + when ^T : uint16 = (# "" value : uint16 #) + when ^T : char = (# "" value : uint16 #) when ^T : unativeint = (# "conv.ovf.u2.un" value : uint16 #) when ^T : byte = (# "conv.ovf.u2.un" value : uint16 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint16) (value)) @@ -5083,7 +5345,7 @@ namespace Microsoft.FSharp.Core [] [] let inline char (value: ^T) = - ExplicitDynamic<(^T), char> value + CheckedExplicitDynamic<(^T), char> value when ^T : string = (Char.Parse(castToString value)) when ^T : float = (# "conv.ovf.u2" value : char #) when ^T : float32 = (# "conv.ovf.u2" value : char #) @@ -5094,8 +5356,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.ovf.u2" value : char #) when ^T : uint64 = (# "conv.ovf.u2.un" value : char #) when ^T : uint32 = (# "conv.ovf.u2.un" value : char #) - when ^T : uint16 = (# "conv.ovf.u2.un" value : char #) - when ^T : char = (# "conv.ovf.u2.un" value : char #) + when ^T : uint16 = (# "" value : char #) + when ^T : char = (# "" value : char #) when ^T : unativeint = (# "conv.ovf.u2.un" value : char #) when ^T : byte = (# "conv.ovf.u2.un" value : char #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> char) (value)) @@ -5103,61 +5365,61 @@ namespace Microsoft.FSharp.Core [] [] let inline int16 (value: ^T) = - ExplicitDynamic<(^T), int16> value - when ^T : string = ParseInt16 (castToString value) - when ^T : float = (# "conv.ovf.i2" value : int16 #) - when ^T : float32 = (# "conv.ovf.i2" value : int16 #) - when ^T : int64 = (# "conv.ovf.i2" value : int16 #) - when ^T : int32 = (# "conv.ovf.i2" value : int16 #) - when ^T : int16 = (# "conv.ovf.i2" value : int16 #) - when ^T : nativeint = (# "conv.ovf.i2" value : int16 #) - when ^T : sbyte = (# "conv.ovf.i2" value : int16 #) - when ^T : uint64 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : uint32 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : uint16 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : char = (# "conv.ovf.i2.un" value : int16 #) + CheckedExplicitDynamic<(^T), int16> value + when ^T : string = ParseInt16 (castToString value) + when ^T : float = (# "conv.ovf.i2" value : int16 #) + when ^T : float32 = (# "conv.ovf.i2" value : int16 #) + when ^T : int64 = (# "conv.ovf.i2" value : int16 #) + when ^T : int32 = (# "conv.ovf.i2" value : int16 #) + when ^T : int16 = (# "" value : int16 #) + when ^T : nativeint = (# "conv.ovf.i2" value : int16 #) + when ^T : sbyte = (# "conv.ovf.i2" value : int16 #) + when ^T : uint64 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : uint32 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : uint16 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : char = (# "conv.ovf.i2.un" value : int16 #) when ^T : unativeint = (# "conv.ovf.i2.un" value : int16 #) - when ^T : byte = (# "conv.ovf.i2.un" value : int16 #) + when ^T : byte = (# "conv.ovf.i2.un" value : int16 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int16) (value)) [] [] let inline uint32 (value: ^T) = - ExplicitDynamic<(^T), uint32> value - when ^T : string = ParseUInt32 (castToString value) - when ^T : float = (# "conv.ovf.u4" value : uint32 #) - when ^T : float32 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int64 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int32 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int16 = (# "conv.ovf.u4" value : uint32 #) - when ^T : nativeint = (# "conv.ovf.u4" value : uint32 #) - when ^T : sbyte = (# "conv.ovf.u4" value : uint32 #) - when ^T : uint64 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : uint32 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : uint16 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : char = (# "conv.ovf.u4.un" value : uint32 #) + CheckedExplicitDynamic<(^T), uint32> value + when ^T : string = ParseUInt32 (castToString value) + when ^T : float = (# "conv.ovf.u4" value : uint32 #) + when ^T : float32 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int64 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int32 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int16 = (# "conv.ovf.u4" value : uint32 #) + when ^T : nativeint = (# "conv.ovf.u4" value : uint32 #) + when ^T : sbyte = (# "conv.ovf.u4" value : uint32 #) + when ^T : uint64 = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : uint32 = (# "" value : uint32 #) + when ^T : uint16 = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : char = (# "conv.ovf.u4.un" value : uint32 #) when ^T : unativeint = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : byte = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : byte = (# "conv.ovf.u4.un" value : uint32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint32) (value)) [] [] let inline int32 (value: ^T) = - ExplicitDynamic<(^T), int32> value - when ^T : string = ParseInt32 (castToString value) - when ^T : float = (# "conv.ovf.i4" value : int32 #) - when ^T : float32 = (# "conv.ovf.i4" value : int32 #) - when ^T : int64 = (# "conv.ovf.i4" value : int32 #) - when ^T : int32 = (# "conv.ovf.i4" value : int32 #) - when ^T : int16 = (# "conv.ovf.i4" value : int32 #) - when ^T : nativeint = (# "conv.ovf.i4" value : int32 #) - when ^T : sbyte = (# "conv.ovf.i4" value : int32 #) - when ^T : uint64 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : uint32 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : uint16 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : char = (# "conv.ovf.i4.un" value : int32 #) + CheckedExplicitDynamic<(^T), int32> value + when ^T : string = ParseInt32 (castToString value) + when ^T : float = (# "conv.ovf.i4" value : int32 #) + when ^T : float32 = (# "conv.ovf.i4" value : int32 #) + when ^T : int64 = (# "conv.ovf.i4" value : int32 #) + when ^T : int32 = (# "" value : int32 #) + when ^T : int16 = (# "conv.ovf.i4" value : int32 #) + when ^T : nativeint = (# "conv.ovf.i4" value : int32 #) + when ^T : sbyte = (# "conv.ovf.i4" value : int32 #) + when ^T : uint64 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : uint32 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : uint16 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : char = (# "conv.ovf.i4.un" value : int32 #) when ^T : unativeint = (# "conv.ovf.i4.un" value : int32 #) - when ^T : byte = (# "conv.ovf.i4.un" value : int32 #) + when ^T : byte = (# "conv.ovf.i4.un" value : int32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int32) (value)) [] @@ -5166,81 +5428,83 @@ namespace Microsoft.FSharp.Core [] [] let inline uint64 (value: ^T) = - ExplicitDynamic<(^T), uint64> value - when ^T : string = ParseUInt64 (castToString value) - when ^T : float = (# "conv.ovf.u8" value : uint64 #) - when ^T : float32 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int64 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int32 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int16 = (# "conv.ovf.u8" value : uint64 #) - when ^T : nativeint = (# "conv.ovf.u8" value : uint64 #) - when ^T : sbyte = (# "conv.ovf.u8" value : uint64 #) - when ^T : uint64 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : uint32 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : uint16 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : char = (# "conv.ovf.u8.un" value : uint64 #) + CheckedExplicitDynamic<(^T), uint64> value + when ^T : string = ParseUInt64 (castToString value) + when ^T : float = (# "conv.ovf.u8" value : uint64 #) + when ^T : float32 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int64 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int32 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int16 = (# "conv.ovf.u8" value : uint64 #) + when ^T : nativeint = (# "conv.ovf.u8" value : uint64 #) + when ^T : sbyte = (# "conv.ovf.u8" value : uint64 #) + when ^T : uint64 = (# "" value : uint64 #) + when ^T : uint32 = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : uint16 = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : char = (# "conv.ovf.u8.un" value : uint64 #) when ^T : unativeint = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : byte = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : byte = (# "conv.ovf.u8.un" value : uint64 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint64) (value)) [] [] let inline int64 (value: ^T) = - ExplicitDynamic<(^T), int64> value - when ^T : string = ParseInt64 (castToString value) - when ^T : float = (# "conv.ovf.i8" value : int64 #) - when ^T : float32 = (# "conv.ovf.i8" value : int64 #) - when ^T : int64 = (# "conv.ovf.i8" value : int64 #) - when ^T : int32 = (# "conv.ovf.i8" value : int64 #) - when ^T : int16 = (# "conv.ovf.i8" value : int64 #) - when ^T : nativeint = (# "conv.ovf.i8" value : int64 #) - when ^T : sbyte = (# "conv.ovf.i8" value : int64 #) - when ^T : uint64 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : uint32 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : uint16 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : char = (# "conv.ovf.i8.un" value : int64 #) + CheckedExplicitDynamic<(^T), int64> value + when ^T : string = ParseInt64 (castToString value) + when ^T : float = (# "conv.ovf.i8" value : int64 #) + when ^T : float32 = (# "conv.ovf.i8" value : int64 #) + when ^T : int64 = (# "" value : int64 #) + when ^T : int32 = (# "conv.ovf.i8" value : int64 #) + when ^T : int16 = (# "conv.ovf.i8" value : int64 #) + when ^T : nativeint = (# "conv.ovf.i8" value : int64 #) + when ^T : sbyte = (# "conv.ovf.i8" value : int64 #) + when ^T : uint64 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : uint32 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : uint16 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : char = (# "conv.ovf.i8.un" value : int64 #) when ^T : unativeint = (# "conv.ovf.i8.un" value : int64 #) - when ^T : byte = (# "conv.ovf.i8.un" value : int64 #) + when ^T : byte = (# "conv.ovf.i8.un" value : int64 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int64) (value)) [] [] let inline unativeint (value: ^T) = - ExplicitDynamic<(^T), unativeint> value - when ^T : string = ParseUIntPtr (castToString value) - when ^T : float = (# "conv.ovf.u" value : unativeint #) - when ^T : float32 = (# "conv.ovf.u" value : unativeint #) - when ^T : int64 = (# "conv.ovf.u" value : unativeint #) - when ^T : int32 = (# "conv.ovf.u" value : unativeint #) - when ^T : int16 = (# "conv.ovf.u" value : unativeint #) - when ^T : nativeint = (# "conv.ovf.u" value : unativeint #) - when ^T : sbyte = (# "conv.ovf.u" value : unativeint #) - when ^T : uint64 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : uint32 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : uint16 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : char = (# "conv.ovf.u.un" value : unativeint #) - when ^T : unativeint = (# "conv.ovf.u.un" value : unativeint #) - when ^T : byte = (# "conv.ovf.u.un" value : unativeint #) + CheckedExplicitDynamic<(^T), unativeint> value + when ^T : string = ParseUIntPtr (castToString value) + when ^T : float = (# "conv.ovf.u" value : unativeint #) + when ^T : float32 = (# "conv.ovf.u" value : unativeint #) + when ^T : int64 = (# "conv.ovf.u" value : unativeint #) + when ^T : int32 = (# "conv.ovf.u" value : unativeint #) + when ^T : int16 = (# "conv.ovf.u" value : unativeint #) + when ^T : nativeint = (# "conv.ovf.u" value : unativeint #) + when ^T : sbyte = (# "conv.ovf.u" value : unativeint #) + when ^T : uint64 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : uint32 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : uint16 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : char = (# "conv.ovf.u.un" value : unativeint #) + when ^T : unativeint = (# "" value : unativeint #) + when ^T : byte = (# "conv.ovf.u.un" value : unativeint #) + when ^T : decimal = (# "conv.ovf.u.un" (uint64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> unativeint) (value)) [] [] let inline nativeint (value: ^T) = - ExplicitDynamic<(^T), nativeint> value - when ^T : string = ParseIntPtr (castToString value) - when ^T : float = (# "conv.ovf.i" value : nativeint #) - when ^T : float32 = (# "conv.ovf.i" value : nativeint #) - when ^T : int64 = (# "conv.ovf.i" value : nativeint #) - when ^T : int32 = (# "conv.ovf.i" value : nativeint #) - when ^T : int16 = (# "conv.ovf.i" value : nativeint #) - when ^T : nativeint = (# "conv.ovf.i" value : nativeint #) - when ^T : sbyte = (# "conv.ovf.i" value : nativeint #) - when ^T : uint64 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : uint32 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : uint16 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : char = (# "conv.ovf.i.un" value : nativeint #) + CheckedExplicitDynamic<(^T), nativeint> value + when ^T : string = ParseIntPtr (castToString value) + when ^T : float = (# "conv.ovf.i" value : nativeint #) + when ^T : float32 = (# "conv.ovf.i" value : nativeint #) + when ^T : int64 = (# "conv.ovf.i" value : nativeint #) + when ^T : int32 = (# "conv.ovf.i" value : nativeint #) + when ^T : int16 = (# "conv.ovf.i" value : nativeint #) + when ^T : nativeint = (# "" value : nativeint #) + when ^T : sbyte = (# "conv.ovf.i" value : nativeint #) + when ^T : uint64 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : uint32 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : uint16 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : char = (# "conv.ovf.i.un" value : nativeint #) when ^T : unativeint = (# "conv.ovf.i.un" value : nativeint #) - when ^T : byte = (# "conv.ovf.i.un" value : nativeint #) + when ^T : byte = (# "conv.ovf.i.un" value : nativeint #) + when ^T : decimal = (# "conv.ovf.i" (int64 (# "" value : decimal #)) : nativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) module OperatorIntrinsics = diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 70ee63e0c2d..a2c03fa1025 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -1542,6 +1542,10 @@ namespace Microsoft.FSharp.Core [] val ExplicitDynamic: value: 'T -> 'U + /// A compiler intrinsic that implements dynamic invocations related to checked conversion operators. + [] + val CheckedExplicitDynamic : value:'T -> 'U + /// A compiler intrinsic that implements dynamic invocations related to the '<' operator. [] val LessThanDynamic: x: 'T1 -> y: 'T2 -> 'U diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 42a431f2c27..9c0017aaed1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -42,6 +42,7 @@ + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs index 62db48e2ec9..a7672d9925f 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs @@ -246,10 +246,10 @@ type OperatorsModule1() = Assert.AreEqual(1, intbox) // string value - let stringlbox = Operators.box "string" - Assert.AreEqual("string", stringlbox) + let stringbox = Operators.box "string" + Assert.AreEqual("string", stringbox) - // null value + // null value let nullbox = Operators.box null CheckThrowsNullRefException(fun () -> nullbox.ToString() |> ignore) @@ -275,6 +275,14 @@ type OperatorsModule1() = let result = Operators.byte Int64.MinValue Assert.AreEqual(0uy, result) + // Overflow + let result = Operators.byte Single.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MaxValue + Assert.AreEqual(0uy, result) + // Overflow let result = Operators.byte Double.MinValue Assert.AreEqual(0uy, result) @@ -292,7 +300,7 @@ type OperatorsModule1() = Assert.AreEqual(4uy, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.byte Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.byte Decimal.MinValue |> ignore) [] member _.ceil() = @@ -301,18 +309,44 @@ type OperatorsModule1() = Assert.AreEqual(1.0, minceil) // normal value - let normalceil = Operators.ceil 100.0 - Assert.AreEqual(100.0, normalceil) + let normalceil = Operators.ceil 100.1 + Assert.AreEqual(101.0, normalceil) // max value let maxceil = Operators.ceil 1.7E+308 Assert.AreEqual(1.7E+308, maxceil) + // float32 value + let float32ceil = Operators.ceil 100.1f + Assert.AreEqual(101f, float32ceil) + + // decimal value + let decimalceil = Operators.ceil 100.1m + Assert.AreEqual(101m, decimalceil) + [] member _.char() = // int type - let intchar = Operators.char 48 - Assert.AreEqual('0', intchar) + Assert.AreEqual('0', Operators.char 48) + Assert.AreEqual('0', Operators.char 48u) + Assert.AreEqual('0', Operators.char 48s) + Assert.AreEqual('0', Operators.char 48us) + Assert.AreEqual('0', Operators.char 48y) + Assert.AreEqual('0', Operators.char 48uy) + Assert.AreEqual('0', Operators.char 48L) + Assert.AreEqual('0', Operators.char 48uL) + Assert.AreEqual('0', Operators.char 48n) + Assert.AreEqual('0', Operators.char 48un) + Assert.AreEqual('0', Operators.char 48f) + Assert.AreEqual('0', Operators.char 48.) + Assert.AreEqual('0', Operators.char 48m) + + // Overflow + Assert.AreEqual('\000', Operators.char Single.MinValue) + Assert.AreEqual('\000', Operators.char Double.MinValue) + Assert.AreEqual('\000', Operators.char Single.MaxValue) + Assert.AreEqual('\000', Operators.char Double.MaxValue) + CheckThrowsOverflowException(fun () -> Operators.char Decimal.MinValue |> ignore) // string type let stringchar = Operators.char " " @@ -366,12 +400,24 @@ type OperatorsModule1() = member _.decimal () = // int value - let mindecimal = Operators.decimal (1) - Assert.AreEqual(1M, mindecimal) + let intdecimal = Operators.decimal (1) + Assert.AreEqual(1M, intdecimal) + + // nativeint value + let nativeintdecimal = Operators.decimal 1n + Assert.AreEqual(1M, nativeintdecimal) + + // unativeint value + let unativeintdecimal = Operators.decimal 1un + Assert.AreEqual(1M, unativeintdecimal) + + // char value + let chardecimal = Operators.decimal '\001' + Assert.AreEqual(1M, chardecimal) - // float value - let maxdecimal = Operators.decimal (1.0) - Assert.AreEqual(1M, maxdecimal) + // float value + let floatdecimal = Operators.decimal (1.0) + Assert.AreEqual(1M, floatdecimal) [] member _.decr() = @@ -416,6 +462,10 @@ type OperatorsModule1() = // char type let chardouble = Operators.float '0' Assert.AreEqual(48.0, chardouble) + + // decimal type + let decimaldouble = Operators.float 100m + Assert.AreEqual(100.0, decimaldouble) [] member _.enum() = @@ -424,7 +474,7 @@ type OperatorsModule1() = let intenum = Operators.enum intarg Assert.AreEqual(System.ConsoleColor.Black, intenum) - // big number + // big number let bigarg : int32 = 15 let charenum = Operators.enum bigarg Assert.AreEqual(System.ConsoleColor.White, charenum) @@ -488,6 +538,10 @@ type OperatorsModule1() = let charfloat = Operators.float '0' Assert.AreEqual((float)48, charfloat) + // decimal type + let intfloat = Operators.float 100m + Assert.AreEqual((float)100, intfloat) + [] member _.float32() = // int type @@ -497,16 +551,24 @@ type OperatorsModule1() = // char type let charfloat32 = Operators.float32 '0' Assert.AreEqual((float32)48, charfloat32) + + // decimal type + let intfloat32 = Operators.float32 100m + Assert.AreEqual((float32)100, intfloat32) [] member _.floor() = // float type - let intfloor = Operators.floor 100.9 - Assert.AreEqual(100.0, intfloor) + let floatfloor = Operators.floor 100.9 + Assert.AreEqual(100.0, floatfloor) // float32 type - let charfloor = Operators.floor ((float32)100.9) - Assert.AreEqual(100.0f, charfloor) + let float32floor = Operators.floor 100.9f + Assert.AreEqual(100.0f, float32floor) + + // decimal type + let decimalfloor = Operators.floor 100.9m + Assert.AreEqual(100m, decimalfloor) [] member _.fst() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs index 3abdeee4121..d4197529ea6 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs @@ -51,6 +51,14 @@ type OperatorsModule2() = let result = Operators.int 0 Assert.AreEqual(0, result) + // Overflow. + let result = Operators.int Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + // Overflow let result = Operators.int Double.MaxValue Assert.AreEqual(Int32.MinValue, result) @@ -72,7 +80,7 @@ type OperatorsModule2() = Assert.AreEqual(Int32.MinValue, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int Decimal.MinValue |> ignore) [] member _.int16() = @@ -96,6 +104,14 @@ type OperatorsModule2() = let result = Operators.int16 "10" Assert.AreEqual(10s, result) + // Overflow. + let result = Operators.int16 Single.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Single.MinValue + Assert.AreEqual(0s, result) + // Overflow let result = Operators.int16 Double.MaxValue Assert.AreEqual(0s, result) @@ -116,7 +132,7 @@ type OperatorsModule2() = Assert.AreEqual(Int16.MinValue, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int16 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int16 Decimal.MinValue |> ignore) [] member _.int32() = @@ -140,6 +156,14 @@ type OperatorsModule2() = let result = Operators.int32 "10" Assert.AreEqual(10, result) + // Overflow. + let result = Operators.int32 Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + // Overflow let result = Operators.int32 Double.MaxValue Assert.AreEqual(Int32.MinValue, result) @@ -161,7 +185,7 @@ type OperatorsModule2() = Assert.AreEqual(Int32.MinValue + 4, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int32 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int32 Decimal.MinValue |> ignore) [] member _.int64() = @@ -185,6 +209,14 @@ type OperatorsModule2() = let result = Operators.int64 "10" Assert.AreEqual(10L, result) + // Overflow. + let result = Operators.int64 Single.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Single.MinValue + Assert.AreEqual(Int64.MinValue, result) + // Overflow. let result = Operators.int64 Double.MaxValue Assert.AreEqual(Int64.MinValue, result) @@ -202,11 +234,11 @@ type OperatorsModule2() = Assert.AreEqual(9223372036854775807L, Int64.MaxValue) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int64 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int64 Decimal.MinValue |> ignore) [] member _.invalidArg() = - CheckThrowsArgumentException(fun() -> Operators.invalidArg "A" "B" |>ignore ) + CheckThrowsArgumentException(fun () -> Operators.invalidArg "A" "B" |>ignore ) [] @@ -328,6 +360,22 @@ type OperatorsModule2() = let result = Operators.nativeint 0 Assert.AreEqual(0n, result) + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Single.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes let result = Operators.nativeint Double.MaxValue if Info.isX86Runtime then @@ -396,7 +444,7 @@ type OperatorsModule2() = [] member _.nullArg() = - CheckThrowsArgumentNullException(fun() -> Operators.nullArg "A" |> ignore) + CheckThrowsArgumentNullException(fun () -> Operators.nullArg "A" |> ignore) [] @@ -429,11 +477,11 @@ type OperatorsModule2() = let result = Operators.pown System.Double.MaxValue System.Int32.MaxValue Assert.AreEqual(Double.PositiveInfinity, result) - CheckThrowsOverflowException(fun() -> Operators.pown System.Int32.MaxValue System.Int32.MaxValue |>ignore) + CheckThrowsOverflowException(fun () -> Operators.pown System.Int32.MaxValue System.Int32.MaxValue |>ignore) [] member _.raise() = - CheckThrowsArgumentException(fun()-> Operators.raise <| new ArgumentException("Invalid Argument ") |> ignore) + CheckThrowsArgumentException(fun () -> Operators.raise <| new ArgumentException("Invalid Argument ") |> ignore) [] @@ -559,7 +607,7 @@ type OperatorsModule2() = Assert.AreEqual(-128y, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.sbyte Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.sbyte Decimal.MinValue |> ignore) [] member _.sign() = @@ -694,6 +742,10 @@ type OperatorsModule2() = let result = Operators.sizeof Assert.AreEqual(8, result) + // custom struct + let result = Operators.sizeof + Assert.AreEqual(12, result) + // reference type should have the same size as the IntPtr let result = Operators.sizeof Assert.AreEqual(IntPtr.Size, result) @@ -899,9 +951,25 @@ type OperatorsModule2() = // decimal let result = Operators.uint16 100M Assert.AreEqual(100us, result) + + // Overflow + let result = Operators.uint16 Single.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Single.MinValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MinValue + Assert.AreEqual(0us, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint16 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint16 Decimal.MinValue |> ignore) [] member _.uint32() = @@ -917,6 +985,14 @@ type OperatorsModule2() = let result = Operators.uint32 100M Assert.AreEqual(100u, result) + // Overflow + let result = Operators.uint32 Single.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Single.MinValue + Assert.AreEqual(0u, result) + // Overflow let result = Operators.uint32 Double.MaxValue Assert.AreEqual(0u, result) @@ -943,7 +1019,7 @@ type OperatorsModule2() = Assert.AreEqual(84ul, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint32 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint32 Decimal.MinValue |> ignore) [] member _.uint64() = @@ -959,6 +1035,14 @@ type OperatorsModule2() = let result = Operators.uint64 100M Assert.AreEqual(100UL, result) + // Overflow + let result = Operators.uint64 Single.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Single.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + // Overflow let result = Operators.uint64 Double.MaxValue Assert.AreEqual(0UL, result) @@ -980,7 +1064,7 @@ type OperatorsModule2() = Assert.AreEqual(4UL, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint64 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint64 Decimal.MinValue |> ignore) [] member _.unativeint() = @@ -993,6 +1077,17 @@ type OperatorsModule2() = let result = Operators.unativeint 100.0 Assert.AreEqual(100un, result) + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Single.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes let result = Operators.unativeint Double.MaxValue Assert.AreEqual(0un, result) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs index bcd16f54e27..54da228aca6 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs @@ -21,12 +21,14 @@ type OperatorsModuleChecked() = let charByte = Operators.Checked.byte '0' Assert.AreEqual(48uy, charByte) - // boundary value + // boundary value let boundByte = Operators.Checked.byte 255.0 Assert.AreEqual(255uy, boundByte) // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256f |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256. |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> 255uy + 1uy |> ignore) @@ -51,6 +53,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.char (int64 Char.MaxValue + 1L) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> '\uFFFF' + '\u0001' |> ignore) @@ -72,7 +76,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(32767, boundInt) // overflow exception - CheckThrowsOverflowException(fun() -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) @@ -97,6 +103,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.int16 32768.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int16.MaxValue + 1s |> ignore) @@ -121,6 +129,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.int32 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) @@ -150,7 +160,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(-9223372036854775808L, boundInt64) // overflow exception - CheckThrowsOverflowException(fun() -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int64.MaxValue + 1L |> ignore) @@ -179,6 +191,8 @@ type OperatorsModuleChecked() = Operators.Checked.nativeint 2147483648.0 |> ignore else Operators.Checked.nativeint 9223372036854775808.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Double.MaxValue |> ignore) [] @@ -198,6 +212,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte -256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> SByte.MaxValue + 1y |> ignore) @@ -220,7 +236,9 @@ type OperatorsModuleChecked() = let bounduint16 = Operators.Checked.uint16 65535.0 Assert.AreEqual(65535us, bounduint16) - CheckThrowsOverflowException(fun() -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt16.MaxValue + 1us |> ignore) @@ -244,7 +262,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(429496729u, bounduint32) // overflow exception - CheckThrowsOverflowException(fun () -> Operators.Checked.uint32(float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 (float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt32.MaxValue + 1u |> ignore) @@ -269,6 +289,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 (float System.UInt64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt64.MaxValue + 1UL |> ignore) @@ -302,5 +324,7 @@ type OperatorsModuleChecked() = else Operators.Checked.unativeint (float UInt64.MaxValue + 1.0) |> ignore ) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Double.MaxValue |> ignore) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs new file mode 100644 index 00000000000..9af581dca52 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs @@ -0,0 +1,1105 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Sync test content with OperatorsModule1.fs, OperatorsModule2.fs, and OperatorsModuleDynamic.fs + +namespace FSharp.Core.UnitTests.Operators + +open System +open Xunit + +#nowarn "1204" // CompilerMessage: This function is for use by dynamic invocations of F# code and should not be used directly +module OperatorsModuleDynamic = + + /// Check that the lambda throws an exception of the given type. Otherwise + /// calls Assert.Fail() + // Sync implementation with FSharp.Core.UnitTests.LibraryTestFx.CheckThrowsExn + let CheckThrowsExn<'a when 'a :> exn> (f : unit -> unit) = + try + let _ = f () + sprintf "Expected %O exception, got no exception" typeof<'a> |> Assert.Fail + with + | :? 'a -> () + | :? Reflection.TargetInvocationException as r when (r.InnerException :? 'a) -> () + | e -> sprintf "Expected %O or TargetInvocationException containing it, got: %O" typeof<'a> e |> Assert.Fail + let CheckThrowsOverflowException = CheckThrowsExn + + module Operators = + let byte<'T> = LanguagePrimitives.ExplicitDynamic<'T, byte> + let char<'T> = LanguagePrimitives.ExplicitDynamic<'T, char> + let double<'T> = LanguagePrimitives.ExplicitDynamic<'T, double> + let decimal<'T> = LanguagePrimitives.ExplicitDynamic<'T, decimal> + let float<'T> = LanguagePrimitives.ExplicitDynamic<'T, float> + let float32<'T> = LanguagePrimitives.ExplicitDynamic<'T, float32> + let nativeint<'T> = LanguagePrimitives.ExplicitDynamic<'T, nativeint> + let int<'T> = LanguagePrimitives.ExplicitDynamic<'T, int> + let int8<'T> = LanguagePrimitives.ExplicitDynamic<'T, int8> + let int16<'T> = LanguagePrimitives.ExplicitDynamic<'T, int16> + let int32<'T> = LanguagePrimitives.ExplicitDynamic<'T, int32> + let int64<'T> = LanguagePrimitives.ExplicitDynamic<'T, int64> + let sbyte<'T> = LanguagePrimitives.ExplicitDynamic<'T, sbyte> + let single<'T> = LanguagePrimitives.ExplicitDynamic<'T, single> + let uint<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint> + let uint8<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint8> + let uint16<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint16> + let uint32<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint32> + let uint64<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint64> + let unativeint<'T> = LanguagePrimitives.ExplicitDynamic<'T, unativeint> + module Checked = + let byte<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, byte> + let char<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, char> + let double<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, double> + let decimal<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, decimal> + let float<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, float> + let float32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, float32> + let nativeint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, nativeint> + let int<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int> + let int8<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int8> + let int16<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int16> + let int32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int32> + let int64<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int64> + let sbyte<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, sbyte> + let single<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, single> + let uint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint> + let uint8<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint8> + let uint16<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint16> + let uint32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint32> + let uint64<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint64> + let unativeint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, unativeint> + + [] + let byte() = + // int type + let intByte = Operators.byte 100 + Assert.AreEqual(100uy, intByte) + + // char type + let charByte = Operators.byte '0' + Assert.AreEqual(48uy, charByte) + + // boundary value + let boundByte = Operators.byte 255.0 + Assert.AreEqual(255uy, boundByte) + + // Overflow + let result = Operators.byte Int64.MaxValue + Assert.AreEqual(Byte.MaxValue, result) + + // Overflow + let result = Operators.byte Int64.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MaxValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MaxValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte (Int64.MaxValue * 8L) + Assert.AreEqual(248uy, result) // bit-complement + + // Overflow + let result = 255uy + 5uy + Assert.AreEqual(4uy, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.byte Decimal.MinValue |> ignore) + + [] + let char() = + // int type + Assert.AreEqual('0', Operators.char 48) + Assert.AreEqual('0', Operators.char 48u) + Assert.AreEqual('0', Operators.char 48s) + Assert.AreEqual('0', Operators.char 48us) + Assert.AreEqual('0', Operators.char 48y) + Assert.AreEqual('0', Operators.char 48uy) + Assert.AreEqual('0', Operators.char 48L) + Assert.AreEqual('0', Operators.char 48uL) + Assert.AreEqual('0', Operators.char 48n) + Assert.AreEqual('0', Operators.char 48un) + Assert.AreEqual('0', Operators.char 48f) + Assert.AreEqual('0', Operators.char 48.) + Assert.AreEqual('0', Operators.char 48m) + + // Overflow + Assert.AreEqual('\000', Operators.char Single.MinValue) + Assert.AreEqual('\000', Operators.char Double.MinValue) + Assert.AreEqual('\000', Operators.char Single.MaxValue) + Assert.AreEqual('\000', Operators.char Double.MaxValue) + CheckThrowsOverflowException(fun () -> Operators.char Decimal.MinValue |> ignore) + + // string type + let stringchar = Operators.char " " + Assert.AreEqual(' ', stringchar) + + + [] + let decimal () = + + // int value + let intdecimal = Operators.decimal (1) + Assert.AreEqual(1M, intdecimal) + + // nativeint value + let nativeintdecimal = Operators.decimal 1n + Assert.AreEqual(1M, nativeintdecimal) + + // unativeint value + let unativeintdecimal = Operators.decimal 1un + Assert.AreEqual(1M, unativeintdecimal) + + // char value + let chardecimal = Operators.decimal '\001' + Assert.AreEqual(1M, chardecimal) + + // float value + let floatdecimal = Operators.decimal (1.0) + Assert.AreEqual(1M, floatdecimal) + + [] + let double() = + // int type + let intdouble = Operators.float 100 + Assert.AreEqual(100.0, intdouble) + + // char type + let chardouble = Operators.float '0' + Assert.AreEqual(48.0, chardouble) + + // decimal type + let decimaldouble = Operators.float 100m + Assert.AreEqual(100.0, decimaldouble) + + [] + let float() = + // int type + let intfloat = Operators.float 100 + Assert.AreEqual((float)100, intfloat) + + // char type + let charfloat = Operators.float '0' + Assert.AreEqual((float)48, charfloat) + + // decimal type + let intfloat = Operators.float 100m + Assert.AreEqual((float)100, intfloat) + + [] + let float32() = + // int type + let intfloat32 = Operators.float32 100 + Assert.AreEqual((float32)100, intfloat32) + + // char type + let charfloat32 = Operators.float32 '0' + Assert.AreEqual((float32)48, charfloat32) + + // decimal type + let intfloat32 = Operators.float32 100m + Assert.AreEqual((float32)100, intfloat32) + + [] + let int() = + // int + let result = Operators.int 10 + Assert.AreEqual(10, result) + + // string + let result = Operators.int "10" + Assert.AreEqual(10, result) + + // double + let result = Operators.int 10.0 + Assert.AreEqual(10, result) + + // negative + let result = Operators.int -10 + Assert.AreEqual(-10, result) + + // zero + let result = Operators.int 0 + Assert.AreEqual(0, result) + + // Overflow + let result = Operators.int Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 1 + Assert.AreEqual(Int32.MinValue, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int Decimal.MinValue |> ignore) + + [] + let int16() = + // int + let result = Operators.int16 10 + Assert.AreEqual(10s, result) + + // double + let result = Operators.int16 10.0 + Assert.AreEqual(10s, result) + + // negative + let result = Operators.int16 -10 + Assert.AreEqual(-10s, result) + + // zero + let result = Operators.int16 0 + Assert.AreEqual(0s, result) + + // string + let result = Operators.int16 "10" + Assert.AreEqual(10s, result) + + // Overflow + let result = Operators.int16 Single.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Single.MinValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Double.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Double.MinValue + Assert.AreEqual(0s, result) + + let result = Operators.int16 Int64.MaxValue + Assert.AreEqual(-1s, result) + + // Overflow + let result = Operators.int16 Int64.MinValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Int16.MaxValue + 1s + Assert.AreEqual(Int16.MinValue, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int16 Decimal.MinValue |> ignore) + + [] + let int32() = + // int + let result = Operators.int32 10 + Assert.AreEqual(10, result) + + // double + let result = Operators.int32 10.0 + Assert.AreEqual(10, result) + + // negative + let result = Operators.int32 -10 + Assert.AreEqual(-10, result) + + // zero + let result = Operators.int32 0 + Assert.AreEqual(0, result) + + // string + let result = Operators.int32 "10" + Assert.AreEqual(10, result) + + // Overflow + let result = Operators.int32 Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int32 Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 5 + Assert.AreEqual(Int32.MinValue + 4, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int32 Decimal.MinValue |> ignore) + + [] + let int64() = + // int + let result = Operators.int64 10 + Assert.AreEqual(10L, result) + + // double + let result = Operators.int64 10.0 + Assert.AreEqual(10L, result) + + // negative + let result = Operators.int64 -10 + Assert.AreEqual(-10L, result) + + // zero + let result = Operators.int64 0 + Assert.AreEqual(0L, result) + + // string + let result = Operators.int64 "10" + Assert.AreEqual(10L, result) + + // Overflow. + let result = Operators.int64 Single.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Single.MinValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow. + let result = Operators.int64 Double.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Double.MinValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 UInt64.MaxValue + Assert.AreEqual(-1L, result) + + // max and min value as literals (this breaks compilation if the lexer fails) + Assert.AreEqual(-9223372036854775808L, Int64.MinValue) + Assert.AreEqual(9223372036854775807L, Int64.MaxValue) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int64 Decimal.MinValue |> ignore) + + + [] + let nativeint() = + // int + let result = Operators.nativeint 10 + Assert.AreEqual(10n, result) + + // double + let result = Operators.nativeint 10.0 + Assert.AreEqual(10n, result) + + // int64 + let result = Operators.nativeint 10L + Assert.AreEqual(10n, result) + + // negative + let result = Operators.nativeint -10 + Assert.AreEqual(-10n, result) + + // zero + let result = Operators.nativeint 0 + Assert.AreEqual(0n, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Single.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + if Info.isX86Runtime then + let result = nativeint Int32.MaxValue + 5n + Assert.AreEqual(-2147483644n, result) + else + let result = nativeint Int64.MaxValue + 5n + Assert.AreEqual(-9223372036854775804n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint System.Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) + + let result = Operators.nativeint System.Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) + + // Max and min value as literals (this breaks compilation if the lexer fails). + // The following tests ensure that the proper value is parsed, which is similar to `nativeint Int64.MaxValue` etc. + if Info.isX86Runtime then + Assert.AreEqual("0", string -9223372036854775808n) // same as int32 -9223372036854775808L + Assert.AreEqual("-1", string 9223372036854775807n) // same as int32 9223372036854775807L + else + Assert.AreEqual("-9223372036854775808", string -9223372036854775808n) + Assert.AreEqual("9223372036854775807", string 9223372036854775807n) + + + [] + let sbyte() = + // int + let result = Operators.sbyte 10 + Assert.AreEqual(10y, result) + + // double + let result = Operators.sbyte 10.0 + Assert.AreEqual(10y, result) + + // negative + let result = Operators.sbyte -10 + Assert.AreEqual(-10y, result) + + // zero + let result = Operators.sbyte 0 + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Int64.MaxValue + Assert.AreEqual(-1y, result) + + // Overflow + let result = Operators.sbyte Int64.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Single.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Single.MaxValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MaxValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte (Int64.MaxValue * 8L) + Assert.AreEqual(-8y, result) // bit-complement + + // Overflow + let result = 127y + 1y + Assert.AreEqual(-128y, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.sbyte Decimal.MinValue |> ignore) + + [] + let single() = + // int + let result = Operators.float32 10 + Assert.AreEqual(10f, result) + + // double + let result = Operators.float32 10.0 + Assert.AreEqual(10f, result) + + // string + let result = Operators.float32 "10" + Assert.AreEqual(10f, result) + + + [] + let uint16() = + // int + let result = Operators.uint16 100 + Assert.AreEqual(100us, result) + + // double + let result = Operators.uint16 (100.0:double) + Assert.AreEqual(100us, result) + + // decimal + let result = Operators.uint16 100M + Assert.AreEqual(100us, result) + + // Overflow + let result = Operators.uint16 Single.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Single.MinValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MinValue + Assert.AreEqual(0us, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint16 Decimal.MinValue |> ignore) + + [] + let uint32() = + // int + let result = Operators.uint32 100 + Assert.AreEqual(100u, result) + + // double + let result = Operators.uint32 (100.0:double) + Assert.AreEqual(100u, result) + + // decimal + let result = Operators.uint32 100M + Assert.AreEqual(100u, result) + + // Overflow + let result = Operators.uint32 Single.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Single.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Double.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Double.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Int64.MaxValue + Assert.AreEqual(UInt32.MaxValue, result) + + // Overflow + let result = Operators.uint32 Int64.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = UInt32.MaxValue + 5u + Assert.AreEqual(4u, result) + + // both 'u' and 'ul' are valid numeric suffixes for UInt32 + let result = 42u + 42ul + Assert.AreEqual(84u, result) + Assert.AreEqual(84ul, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint32 Decimal.MinValue |> ignore) + + [] + let uint64() = + // int + let result = Operators.uint64 100 + Assert.AreEqual(100UL, result) + + // double + let result = Operators.uint64 100.0 + Assert.AreEqual(100UL, result) + + // decimal + let result = Operators.uint64 100M + Assert.AreEqual(100UL, result) + + // Overflow + let result = Operators.uint64 Single.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Single.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + + // Overflow + let result = Operators.uint64 Double.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Double.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + + // Overflow + let result = Operators.uint64 Int64.MinValue + Assert.AreEqual(9223372036854775808UL, result) + + // Overflow + let result = Operators.uint64 SByte.MinValue + Assert.AreEqual(UInt64.MaxValue - 127UL, result) + + // Overflow + let result = UInt64.MaxValue + 5UL + Assert.AreEqual(4UL, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint64 Decimal.MinValue |> ignore) + + [] + let unativeint() = + // int + let result = Operators.unativeint 100 + let x: unativeint = 12un + Assert.AreEqual(100un, result) + + // double + let result = Operators.unativeint 100.0 + Assert.AreEqual(100un, result) + + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Single.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Double.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + + // Overflow (depends on pointer size) + let result = Operators.unativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) + + // Overflow (depends on pointer size) + let result = 0un - 1un + if Info.isX86Runtime then + Assert.AreEqual(4294967295un, result) + else + Assert.AreEqual(18446744073709551615un, result) + + open Operators.Checked + + [] + let Checkedbyte() = + // int type + let intByte = Operators.Checked.byte 100 + Assert.AreEqual(100uy, intByte) + + // char type + let charByte = Operators.Checked.byte '0' + Assert.AreEqual(48uy, charByte) + + // boundary value + let boundByte = Operators.Checked.byte 255.0 + Assert.AreEqual(255uy, boundByte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256f |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256. |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 255uy + 1uy |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 0uy - 1uy |> ignore) + + [] + let Checkedchar() = + + // number + let numberChar = Operators.Checked.char 48 + Assert.AreEqual('0', numberChar) + + // letter + let letterChar = Operators.Checked.char 65 + Assert.AreEqual('A', letterChar) + + // boundary value + let boundchar = Operators.Checked.char 126 + Assert.AreEqual('~', boundchar) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.char (int64 Char.MaxValue + 1L) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> '\uFFFF' + '\u0001' |> ignore) + + + [] + let CheckedInt() = + + // char + let charInt = Operators.Checked.int '0' + Assert.AreEqual(48, charInt) + + // float + let floatInt = Operators.Checked.int 10.0 + Assert.AreEqual(10, floatInt) + + // boundary value + let boundInt = Operators.Checked.int 32767.0 + Assert.AreEqual(32767, boundInt) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + let CheckedInt16() = + + // char + let charInt16 = Operators.Checked.int16 '0' + Assert.AreEqual(48s, charInt16) + + // float + let floatInt16 = Operators.Checked.int16 10.0 + Assert.AreEqual(10s, floatInt16) + + // boundary value + let boundInt16 = Operators.Checked.int16 32767.0 + Assert.AreEqual(32767s, boundInt16) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 32768.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MaxValue + 1s |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MinValue - 1s |> ignore) + + [] + let CheckedInt32() = + + // char + let charInt32 = Operators.Checked.int32 '0' + Assert.AreEqual(48, charInt32) + + // float + let floatInt32 = Operators.Checked.int32 10.0 + Assert.AreEqual(10, floatInt32) + + // boundary value + let boundInt32 = Operators.Checked.int32 2147483647.0 + Assert.AreEqual(2147483647, boundInt32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + let CheckedInt64() = + + // char + let charInt64 = Operators.Checked.int64 '0' + Assert.AreEqual(48L, charInt64) + + // float + let floatInt64 = Operators.Checked.int64 10.0 + Assert.AreEqual(10L, floatInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 9223372036854775807I + let _ = 9223372036854775807L + Assert.AreEqual(9223372036854775807L, boundInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 -9223372036854775808I + let _ = -9223372036854775808L + Assert.AreEqual(-9223372036854775808L, boundInt64) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MaxValue + 1L |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MinValue - 1L |> ignore) + + [] + let CheckedNativeint() = + + // char + let charnativeint = Operators.Checked.nativeint '0' + Assert.AreEqual(48n, charnativeint) + + // float + let floatnativeint = Operators.Checked.nativeint 10.0 + Assert.AreEqual(10n, floatnativeint) + + // boundary value + let boundnativeint = Operators.Checked.nativeint 32767.0 + Assert.AreEqual(32767n, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun () -> + if Info.isX86Runtime then + Operators.Checked.nativeint 2147483648.0 |> ignore + else + Operators.Checked.nativeint 9223372036854775808.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Double.MaxValue |> ignore) + + + [] + let Checkedsbyte() = + + // char + let charsbyte = Operators.Checked.sbyte '0' + Assert.AreEqual(48y, charsbyte) + + // float + let floatsbyte = Operators.Checked.sbyte -10.0 + Assert.AreEqual(-10y, floatsbyte) + + // boundary value + let boundsbyte = Operators.Checked.sbyte -127.0 + Assert.AreEqual(-127y, boundsbyte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte -256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MaxValue + 1y |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MinValue - 1y |> ignore) + + [] + let Checkeduint16() = + + // char + let charuint16 = Operators.Checked.uint16 '0' + Assert.AreEqual(48us, charuint16) + + // float + let floatuint16 = Operators.Checked.uint16 10.0 + Assert.AreEqual(10us, floatuint16) + + // boundary value + let bounduint16 = Operators.Checked.uint16 65535.0 + Assert.AreEqual(65535us, bounduint16) + + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MaxValue + 1us |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MinValue - 1us |> ignore) + + [] + let Checkeduint32() = + + // char + let charuint32 = Operators.Checked.uint32 '0' + Assert.AreEqual(48u, charuint32) + + // float + let floatuint32 = Operators.Checked.uint32 10.0 + Assert.AreEqual(10u, floatuint32) + + // boundary value + let bounduint32 = Operators.Checked.uint32 429496729.0 + Assert.AreEqual(429496729u, bounduint32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 (float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MaxValue + 1u |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MinValue - 1u |> ignore) + + [] + let Checkeduint64() = + + // char + let charuint64 = Operators.Checked.uint64 '0' + Assert.AreEqual(48UL, charuint64) + + // float + let floatuint64 = Operators.Checked.uint64 10.0 + Assert.AreEqual(10UL, floatuint64) + + // boundary value + let bounduint64 = Operators.Checked.uint64 429496729.0 + Assert.AreEqual(429496729UL, bounduint64) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 (float System.UInt64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MaxValue + 1UL |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MinValue - 1UL |> ignore) + + [] + let Checkedunativeint() = + + // char + let charunativeint = Operators.Checked.unativeint '0' + Assert.AreEqual(48un, charunativeint) + + // float + let floatunativeint = Operators.Checked.unativeint 10.0 + Assert.AreEqual(10un, floatunativeint) + + // boundary value (dependent on pointer size) + if Info.isX86Runtime then + let boundunativeint = Operators.Checked.unativeint 4294967295.0 + Assert.AreEqual(4294967295un, boundunativeint) + else + let boundnativeint = Operators.Checked.unativeint 1.84467440737095505E+19 // 64 bit max value cannot be expressed exactly as double + Assert.AreEqual(18446744073709549568un, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun () -> + if Info.isX86Runtime then + Operators.Checked.unativeint (float UInt32.MaxValue + 1.0) |> ignore + else + Operators.Checked.unativeint (float UInt64.MaxValue + 1.0) |> ignore + ) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Double.MaxValue |> ignore) + + type A = A + type B() = + static member op_Equality(_: B, _: B) = false + static member op_Inequality(_: B, _: B) = true + type [] C = + static member op_Equality(_: C, _: C) = true + static member op_Inequality(_: C, _: C) = true + static member op_Explicit(_: A) = C() // Explicit from another type + static member op_Explicit(_: C) = B() // Explicit to another type + static member op_Implicit(_: D) = C() // Duplicated implicit conversion + static member op_Explicit(_: C) = { D = 0 } // Duplicated explicit conversion + and D = { D : int } with + static member op_Implicit(_: A) = { D = 0 } // Implicit from another type + static member op_Implicit(_: D) = B() // Implicit to another type + static member op_Implicit(_: D) = C() // Duplicated implicit conversion + static member op_Explicit(_: C) = { D = 0 } // Duplicated explicit conversion + let [] Equality_ExplicitDynamicTests() = + Assert.False(LanguagePrimitives.EqualityDynamic(B())(B()) : bool) + Assert.True(LanguagePrimitives.InequalityDynamic(B())(B()) : bool) + Assert.True(LanguagePrimitives.EqualityDynamic(C())(C()) : bool) + Assert.True(LanguagePrimitives.InequalityDynamic(C())(C()) : bool) + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : C) + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : C) // Explicit from another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : B) // Explicit to another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : C) // Duplicated implicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : D) // Duplicated explicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : D) // Implicit from another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : B) // Implicit to another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : C) // Duplicated implicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : D) // Duplicated explicit conversion \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.fs index 31d2fa41d15..c214e76daf7 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.fs @@ -1486,6 +1486,7 @@ Microsoft.FSharp.Core.LanguagePrimitives: TResult AdditionDynamic[T1,T2,TResult] Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseAndDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseOrDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedAdditionDynamic[T1,T2,TResult](T1, T2) +Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedExplicitDynamic[T,TResult](T) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedMultiplyDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedSubtractionDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedUnaryNegationDynamic[T,TResult](T) diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index bf58ea27d08..a2cdb2fd60f 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -3657,6 +3657,46 @@ module Optimiations = begin let _ = check "opt.oi20c77tb" (0x8000000000000000L >>> 63) (0xFFFFFFFFFFFFFFFFL) let _ = check "opt.oi20c77yb" (0x8000000000000000L >>> 64) (0x8000000000000000L) + let _ = check "opt.oi20c77qc" ('a' + '\025') ('z') + let _ = check "opt.oi20c77wc" ('z' - '\025') ('a') + let _ = check "opt.oi20c77ec" (nativeint -3m) (-3n) + let _ = check "opt.oi20c77rc" (nativeint 3m) (3n) + let _ = check "opt.oi20c77tc" (unativeint 3m) (3un) + let _ = check "opt.oi20c77yc" (char 65535m) ('\uFFFF') + let _ = check "opt.oi20c77uc" (decimal '\uFFFF') (65535m) + let _ = check "opt.oi20c77ic" (nativeint "3") (3n) + let _ = check "opt.oi20c77oc" (nativeint "-3") (-3n) + let _ = check "opt.oi20c77pc" (unativeint "3") (3un) + let _ = check "opt.oi20c77ac" (Checked.(+) 'a' '\025') ('z') + let _ = check "opt.oi20c77sc" (Checked.(-) 'z' '\025') ('a') + let _ = check "opt.oi20c77dc" (Checked.nativeint -3m) (-3n) + let _ = check "opt.oi20c77fc" (Checked.nativeint 3m) (3n) + let _ = check "opt.oi20c77gc" (Checked.unativeint 3m) (3un) + let _ = check "opt.oi20c77hc" (Checked.char 65535m) ('\uFFFF') + let _ = check "opt.oi20c77jc" (Checked.nativeint "3") (3n) + let _ = check "opt.oi20c77kc" (Checked.nativeint "-3") (-3n) + let _ = check "opt.oi20c77lc" (Checked.unativeint "3") (3un) + let _ = check "opt.oi20c77zc" (int8 3.9m) (3y) + let _ = check "opt.oi20c77xc" (uint8 3.9m) (3uy) + let _ = check "opt.oi20c77cc" (int16 3.9m) (3s) + let _ = check "opt.oi20c77vc" (uint16 3.9m) (3us) + let _ = check "opt.oi20c77bc" (int32 3.9m) (3l) + let _ = check "opt.oi20c77nc" (uint32 3.9m) (3ul) + let _ = check "opt.oi20c77mc" (int64 3.9m) (3L) + let _ = check "opt.oi20c77,c" (uint64 3.9m) (3uL) + let _ = check "opt.oi20c77.c" (nativeint 3.9m) (3n) + let _ = check "opt.oi20c77/c" (unativeint 3.9m) (3un) + let _ = check "opt.oi20c77zc'" (Checked.int8 3.9m) (3y) + let _ = check "opt.oi20c77xc'" (Checked.uint8 3.9m) (3uy) + let _ = check "opt.oi20c77cc'" (Checked.int16 3.9m) (3s) + let _ = check "opt.oi20c77vc'" (Checked.uint16 3.9m) (3us) + let _ = check "opt.oi20c77bc'" (Checked.int32 3.9m) (3l) + let _ = check "opt.oi20c77nc'" (Checked.uint32 3.9m) (3ul) + let _ = check "opt.oi20c77mc'" (Checked.int64 3.9m) (3L) + let _ = check "opt.oi20c77,c'" (Checked.uint64 3.9m) (3uL) + let _ = check "opt.oi20c77.c'" (Checked.nativeint 3.9m) (3n) + let _ = check "opt.oi20c77/c'" (Checked.unativeint 3.9m) (3un) + end diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index e394597f052..cc85cf23ad6 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -1543,7 +1543,7 @@ module MoreQuotationsTests = [Coerce (enumerator, Object)])), Dispose, []), Value ()))))""" - let t9() = <@@ try failwith "test" with Failure _ -> 0 @@> + let t9() = <@@ try failwith "test" with Failure _ -> 0 @@> checkStrings "vwewvwewe9" (sprintf "%A" (t9())) """TryWith (Call (None, FailWith, [Value ("test")]), matchValue, Let (activePatternResult1557, Call (None, FailurePattern, [matchValue]), @@ -3257,9 +3257,11 @@ module TestMatchBang = module WitnessTests = open FSharp.Data.UnitSystems.SI.UnitSymbols + open FSharp.Linq + open FSharp.Linq.NullableOperators test "check CallWithWitness" - (<@ 1 + 1 @> + (<@ 1 + 1 @> |> function | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> minfo1.Name = "op_Addition" && @@ -3380,287 +3382,2045 @@ module WitnessTests = false | _ -> false) - test "check CallWithWitnesses all operators)" + test "check CallWithWitnesses all operators" (let tests = - [ <@@ sin 1.0 @@>, true - <@@ sin 1.0f @@>, true - <@@ sign 1.0f @@>, true - <@@ sqrt 1.0f @@>, true - <@@ 2.0f ** 2.0f @@>, true - <@@ atan2 3.0 4.0 @@>, true - <@@ 1.0f + 4.0f @@>, true - <@@ 1.0f - 4.0f @@>, true - <@@ 1.0f * 4.0f @@>, true - <@@ 1.0M * 4.0M @@>, true - <@@ 1.0f / 4.0f @@>, true - <@@ 1 % 4 @@>, true - <@@ -(4.0M) @@>, true - - <@@ 1y <<< 3 @@>, true - <@@ 1uy <<< 3 @@>, true - <@@ 1s <<< 3 @@>, true - <@@ 1us <<< 3 @@>, true - <@@ 1 <<< 3 @@>, true - <@@ 1u <<< 3 @@>, true - <@@ 1L <<< 3 @@>, true - <@@ 1UL <<< 3 @@>, true - <@@ LanguagePrimitives.GenericOne <<< 3 @@>, false - <@@ LanguagePrimitives.GenericOne <<< 3 @@>, false - - <@@ 1y >>> 3 @@>, true - <@@ 1uy >>> 3 @@>, true - <@@ 1s >>> 3 @@>, true - <@@ 1us >>> 3 @@>, true - <@@ 1 >>> 3 @@>, true - <@@ 1u >>> 3 @@>, true - <@@ 1L >>> 3 @@>, true - <@@ 1UL >>> 3 @@>, true - <@@ LanguagePrimitives.GenericOne >>> 3 @@>, false - <@@ LanguagePrimitives.GenericOne >>> 3 @@>, false + [|<@@ sin 1.0 @@>, box 0x3FEAED548F090CEELF // Around 0.841470984807897 + <@@ sin 1.0f @@>, box 0x3F576AA4lf // = 0.841471f + <@@ sign 1.0f @@>, box 1 + <@@ sqrt 1.0f @@>, box 1f + <@@ atan2 3.0 4.0 @@>, box 0x3FE4978FA3269EE1LF // Around 0.643501108793284 + <@@ atan2 3.0 4.0 @@>, box 0x3FE4978FA3269EE1LF // Around 0.643501108793284 - <@@ 1y &&& 3y @@>, true - <@@ 1uy &&& 3uy @@>, true - <@@ 1s &&& 3s @@>, true - <@@ 1us &&& 3us @@>, true - <@@ 1 &&& 3 @@>, true - <@@ 1u &&& 3u @@>, true - <@@ 1L &&& 3L @@>, true - <@@ 1UL &&& 3UL @@>, true - <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, false - - <@@ 1y ||| 3y @@>, true - <@@ 1uy ||| 3uy @@>, true - <@@ 1s ||| 3s @@>, true - <@@ 1us ||| 3us @@>, true - <@@ 1 ||| 3 @@>, true - <@@ 1u ||| 3u @@>, true - <@@ 1L ||| 3L @@>, true - <@@ 1UL ||| 3UL @@>, true - <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, false - - <@@ 1y ^^^ 3y @@>, true - <@@ 1uy ^^^ 3uy @@>, true - <@@ 1s ^^^ 3s @@>, true - <@@ 1us ^^^ 3us @@>, true - <@@ 1 ^^^ 3 @@>, true - <@@ 1u ^^^ 3u @@>, true - <@@ 1L ^^^ 3L @@>, true - <@@ 1UL ^^^ 3UL @@>, true - <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, false - - <@@ ~~~3y @@>, true - <@@ ~~~3uy @@>, true - <@@ ~~~3s @@>, true - <@@ ~~~3us @@>, true - <@@ ~~~3 @@>, true - <@@ ~~~3u @@>, true - <@@ ~~~3L @@>, true - <@@ ~~~3UL @@>, true - <@@ ~~~LanguagePrimitives.GenericOne @@>, false - <@@ ~~~LanguagePrimitives.GenericOne @@>, false - - <@@ byte 3uy @@>, true - <@@ byte 3y @@>, true - <@@ byte 3s @@>, true - <@@ byte 3us @@>, true - <@@ byte 3 @@>, true - <@@ byte 3u @@>, true - <@@ byte 3L @@>, true - <@@ byte 3UL @@>, true - <@@ byte 3.0f @@>, true - <@@ byte 3.0 @@>, true - <@@ byte LanguagePrimitives.GenericOne @@>, false - <@@ byte LanguagePrimitives.GenericOne @@>, false - <@@ byte 3.0M @@>, true - <@@ byte "3" @@>, false - - <@@ sbyte 3uy @@>, true - <@@ sbyte 3y @@>, true - <@@ sbyte 3s @@>, true - <@@ sbyte 3us @@>, true - <@@ sbyte 3 @@>, true - <@@ sbyte 3u @@>, true - <@@ sbyte 3L @@>, true - <@@ sbyte 3UL @@>, true - <@@ sbyte 3.0f @@>, true - <@@ sbyte 3.0 @@>, true - <@@ sbyte LanguagePrimitives.GenericOne @@>, false - <@@ sbyte LanguagePrimitives.GenericOne @@>, false - <@@ sbyte 3.0M @@>, true - <@@ sbyte "3" @@>, false - - <@@ int16 3uy @@>, true - <@@ int16 3y @@>, true - <@@ int16 3s @@>, true - <@@ int16 3us @@>, true - <@@ int16 3 @@>, true - <@@ int16 3u @@>, true - <@@ int16 3L @@>, true - <@@ int16 3UL @@>, true - <@@ int16 3.0f @@>, true - <@@ int16 3.0 @@>, true - <@@ int16 LanguagePrimitives.GenericOne @@>, false - <@@ int16 LanguagePrimitives.GenericOne @@>, false - <@@ int16 3.0M @@>, true - <@@ int16 "3" @@>, false - - <@@ uint16 3uy @@>, true - <@@ uint16 3y @@>, true - <@@ uint16 3s @@>, true - <@@ uint16 3us @@>, true - <@@ uint16 3 @@>, true - <@@ uint16 3u @@>, true - <@@ uint16 3L @@>, true - <@@ uint16 3UL @@>, true - <@@ uint16 3.0f @@>, true - <@@ uint16 3.0 @@>, true - <@@ uint16 LanguagePrimitives.GenericOne @@>, false - <@@ uint16 LanguagePrimitives.GenericOne @@>, false - <@@ uint16 3.0M @@>, true - <@@ uint16 "3" @@>, false - - <@@ int32 3uy @@>, true - <@@ int32 3y @@>, true - <@@ int32 3s @@>, true - <@@ int32 3us @@>, true - <@@ int32 3 @@>, true - <@@ int32 3u @@>, true - <@@ int32 3L @@>, true - <@@ int32 3UL @@>, true - <@@ int32 3.0f @@>, true - <@@ int32 3.0 @@>, true - <@@ int32 LanguagePrimitives.GenericOne @@>, false - <@@ int32 LanguagePrimitives.GenericOne @@>, false - <@@ int32 3.0M @@>, true - <@@ int32 "3" @@>, false - - <@@ uint32 3uy @@>, true - <@@ uint32 3y @@>, true - <@@ uint32 3s @@>, true - <@@ uint32 3us @@>, true - <@@ uint32 3 @@>, true - <@@ uint32 3u @@>, true - <@@ uint32 3L @@>, true - <@@ uint32 3UL @@>, true - <@@ uint32 3.0f @@>, true - <@@ uint32 3.0 @@>, true - <@@ uint32 LanguagePrimitives.GenericOne @@>, false - <@@ uint32 LanguagePrimitives.GenericOne @@>, false - <@@ uint32 3.0M @@>, true - <@@ uint32 "3" @@>, false - - <@@ int64 3uy @@>, true - <@@ int64 3y @@>, true - <@@ int64 3s @@>, true - <@@ int64 3us @@>, true - <@@ int64 3 @@>, true - <@@ int64 3u @@>, true - <@@ int64 3L @@>, true - <@@ int64 3UL @@>, true - <@@ int64 3.0f @@>, true - <@@ int64 3.0 @@>, true - <@@ int64 LanguagePrimitives.GenericOne @@>, false - <@@ int64 LanguagePrimitives.GenericOne @@>, false - <@@ int64 3.0M @@>, true - <@@ int64 "3" @@>, false + <@@ 1y + 4y @@>, box 5y + <@@ 1uy + 4uy @@>, box 5uy + <@@ 1s + 4s @@>, box 5s + <@@ 1us + 4us @@>, box 5us + <@@ 1 + 4 @@>, box 5 + <@@ 1u + 4u @@>, box 5u + <@@ 1L + 4L @@>, box 5L + <@@ 1uL + 4uL @@>, box 5uL + <@@ 1.0f + 4.0f @@>, box 5f + <@@ 1.0 + 4.0 @@>, box 5. + <@@ 1m + 4m @@>, box 5m + <@@ 1m + 4m @@>, box 5m + <@@ 1I + 4I @@>, box 5I + <@@ '1' + '\004' @@>, box '5' + <@@ "abc" + "def" @@>, box "abcdef" + <@@ LanguagePrimitives.GenericOne + LanguagePrimitives.GenericOne @@>, box 2n + <@@ LanguagePrimitives.GenericOne + LanguagePrimitives.GenericOne @@>, box 2un + <@@ Checked.(+) 1y 4y @@>, box 5y + <@@ Checked.(+) 1uy 4uy @@>, box 5uy + <@@ Checked.(+) 1s 4s @@>, box 5s + <@@ Checked.(+) 1us 4us @@>, box 5us + <@@ Checked.(+) 1 4 @@>, box 5 + <@@ Checked.(+) 1u 4u @@>, box 5u + <@@ Checked.(+) 1L 4L @@>, box 5L + <@@ Checked.(+) 1uL 4uL @@>, box 5uL + <@@ Checked.(+) 1.0f 4.0f @@>, box 5f + <@@ Checked.(+) 1.0 4.0 @@>, box 5. + <@@ Checked.(+) 1m 4m @@>, box 5m + <@@ Checked.(+) 1m 4m @@>, box 5m + <@@ Checked.(+) 1I 4I @@>, box 5I + <@@ Checked.(+) '1' '\004' @@>, box '5' + <@@ Checked.(+) "abc" "def" @@>, box "abcdef" + <@@ Checked.(+) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 2n + <@@ Checked.(+) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 2un + + <@@ 4y - 1y @@>, box 3y + <@@ 4uy - 1uy @@>, box 3uy + <@@ 4s - 1s @@>, box 3s + <@@ 4us - 1us @@>, box 3us + <@@ 4 - 1 @@>, box 3 + <@@ 4u - 1u @@>, box 3u + <@@ 4L - 1L @@>, box 3L + <@@ 4uL - 1uL @@>, box 3uL + <@@ 4.0f - 1.0f @@>, box 3f + <@@ 4.0 - 1.0 @@>, box 3. + <@@ 4m - 1m @@>, box 3m + <@@ 4m - 1m @@>, box 3m + <@@ 4I - 1I @@>, box 3I + <@@ '4' - '\001' @@>, box '3' + <@@ LanguagePrimitives.GenericOne - LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne - LanguagePrimitives.GenericOne @@>, box 0un + <@@ Checked.(-) 4y 1y @@>, box 3y + <@@ Checked.(-) 4uy 1uy @@>, box 3uy + <@@ Checked.(-) 4s 1s @@>, box 3s + <@@ Checked.(-) 4us 1us @@>, box 3us + <@@ Checked.(-) 4 1 @@>, box 3 + <@@ Checked.(-) 4u 1u @@>, box 3u + <@@ Checked.(-) 4L 1L @@>, box 3L + <@@ Checked.(-) 4uL 1uL @@>, box 3uL + <@@ Checked.(-) 4.0f 1.0f @@>, box 3f + <@@ Checked.(-) 4.0 1.0 @@>, box 3. + <@@ Checked.(-) 4m 1m @@>, box 3m + <@@ Checked.(-) 4m 1m @@>, box 3m + <@@ Checked.(-) 4I 1I @@>, box 3I + <@@ Checked.(-) '4' '\001' @@>, box '3' + <@@ Checked.(-) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 0n + <@@ Checked.(-) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 2y * 4y @@>, box 8y + <@@ 2uy * 4uy @@>, box 8uy + <@@ 2s * 4s @@>, box 8s + <@@ 2us * 4us @@>, box 8us + <@@ 2 * 4 @@>, box 8 + <@@ 2u * 4u @@>, box 8u + <@@ 2L * 4L @@>, box 8L + <@@ 2uL * 4uL @@>, box 8uL + <@@ 2.0f * 4.0f @@>, box 8f + <@@ 2.0 * 4.0 @@>, box 8. + <@@ 2m * 4m @@>, box 8m + <@@ 2m * 4m @@>, box 8m + <@@ 2I * 4I @@>, box 8I + <@@ LanguagePrimitives.GenericOne * LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne * LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.(*) 2y 4y @@>, box 8y + <@@ Checked.(*) 2uy 4uy @@>, box 8uy + <@@ Checked.(*) 2s 4s @@>, box 8s + <@@ Checked.(*) 2us 4us @@>, box 8us + <@@ Checked.(*) 2 4 @@>, box 8 + <@@ Checked.(*) 2u 4u @@>, box 8u + <@@ Checked.(*) 2L 4L @@>, box 8L + <@@ Checked.(*) 2uL 4uL @@>, box 8uL + <@@ Checked.(*) 2.0f 4.0f @@>, box 8f + <@@ Checked.(*) 2.0 4.0 @@>, box 8. + <@@ Checked.(*) 2m 4m @@>, box 8m + <@@ Checked.(*) 2m 4m @@>, box 8m + <@@ Checked.(*) 2I 4I @@>, box 8I + <@@ Checked.(*) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.(*) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 6y / 3y @@>, box 2y + <@@ 6uy / 3uy @@>, box 2uy + <@@ 6s / 3s @@>, box 2s + <@@ 6us / 3us @@>, box 2us + <@@ 6 / 3 @@>, box 2 + <@@ 6u / 3u @@>, box 2u + <@@ 6L / 3L @@>, box 2L + <@@ 6uL / 3uL @@>, box 2uL + <@@ 6.0f / 3.0f @@>, box 2f + <@@ 6.0 / 3.0 @@>, box 2. + <@@ 6m / 3m @@>, box 2m + <@@ 6m / 3m @@>, box 2m + <@@ 6I / 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne / LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne / LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 9y % 4y @@>, box 1y + <@@ 9uy % 4uy @@>, box 1uy + <@@ 9s % 4s @@>, box 1s + <@@ 9us % 4us @@>, box 1us + <@@ 9 % 4 @@>, box 1 + <@@ 9u % 4u @@>, box 1u + <@@ 9L % 4L @@>, box 1L + <@@ 9uL % 4uL @@>, box 1uL + <@@ 9.0f % 4.0f @@>, box 1f + <@@ 9.0 % 4.0 @@>, box 1. + <@@ 9m % 4m @@>, box 1m + <@@ 9m % 4m @@>, box 1m + <@@ 9I % 4I @@>, box 1I + <@@ LanguagePrimitives.GenericOne % LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne % LanguagePrimitives.GenericOne @@>, box 0un + + <@@ +(1y) @@>, box 1y + <@@ +(1uy) @@>, box 1uy + <@@ +(1s) @@>, box 1s + <@@ +(1us) @@>, box 1us + <@@ +(1) @@>, box 1 + <@@ +(1u) @@>, box 1u + <@@ +(1L) @@>, box 1L + <@@ +(1uL) @@>, box 1uL + <@@ +(1f) @@>, box 1f + <@@ +(1.) @@>, box 1. + <@@ +(1m) @@>, box 1m + <@@ +(1m) @@>, box 1m + <@@ +(1I) @@>, box 1I + <@@ +(LanguagePrimitives.GenericOne) @@>, box 1n + <@@ +(LanguagePrimitives.GenericOne) @@>, box 1un + + <@@ -(1y) @@>, box -1y + <@@ -(1s) @@>, box -1s + <@@ -(1) @@>, box -1 + <@@ -(1L) @@>, box -1L + <@@ -(1f) @@>, box -1f + <@@ -(1.) @@>, box -1. + <@@ -(1m) @@>, box -1m + <@@ -(1m) @@>, box -1m + <@@ -(1I) @@>, box -1I + <@@ -(LanguagePrimitives.GenericOne) @@>, box -1n + <@@ Checked.(~-) (1y) @@>, box -1y + <@@ Checked.(~-) (1s) @@>, box -1s + <@@ Checked.(~-) (1) @@>, box -1 + <@@ Checked.(~-) (1L) @@>, box -1L + <@@ Checked.(~-) (1f) @@>, box -1f + <@@ Checked.(~-) (1.) @@>, box -1. + <@@ Checked.(~-) (1m) @@>, box -1m + <@@ Checked.(~-) (1m) @@>, box -1m + <@@ Checked.(~-) (1I) @@>, box -1I + <@@ Checked.(~-) (LanguagePrimitives.GenericOne) @@>, box -1n + + <@@ 4f ** 3f @@>, box 64f + <@@ 4. ** 3. @@>, box 64. + <@@ 4I ** 3 @@>, box 64I + + <@@ 1y <<< 3 @@>, box 8y + <@@ 1uy <<< 3 @@>, box 8uy + <@@ 1s <<< 3 @@>, box 8s + <@@ 1us <<< 3 @@>, box 8us + <@@ 1 <<< 3 @@>, box 8 + <@@ 1u <<< 3 @@>, box 8u + <@@ 1L <<< 3 @@>, box 8L + <@@ 1UL <<< 3 @@>, box 8UL + <@@ 1I <<< 3 @@>, box 8I + <@@ LanguagePrimitives.GenericOne <<< 3 @@>, box 8n + <@@ LanguagePrimitives.GenericOne <<< 3 @@>, box 8un + + <@@ 1y >>> 3 @@>, box 0y + <@@ 1uy >>> 3 @@>, box 0uy + <@@ 1s >>> 3 @@>, box 0s + <@@ 1us >>> 3 @@>, box 0us + <@@ 1 >>> 3 @@>, box 0 + <@@ 1u >>> 3 @@>, box 0u + <@@ 1L >>> 3 @@>, box 0L + <@@ 1UL >>> 3 @@>, box 0UL + <@@ 1I >>> 3 @@>, box 0I + <@@ LanguagePrimitives.GenericOne >>> 3 @@>, box 0n + <@@ LanguagePrimitives.GenericOne >>> 3 @@>, box 0un - <@@ uint64 3uy @@>, true - <@@ uint64 3y @@>, true - <@@ uint64 3s @@>, true - <@@ uint64 3us @@>, true - <@@ uint64 3 @@>, true - <@@ uint64 3u @@>, true - <@@ uint64 3L @@>, true - <@@ uint64 3UL @@>, true - <@@ uint64 3.0f @@>, true - <@@ uint64 3.0 @@>, true - <@@ uint64 LanguagePrimitives.GenericOne @@>, false - <@@ uint64 LanguagePrimitives.GenericOne @@>, false - <@@ uint64 3.0M @@>, true - <@@ uint64 "3" @@>, false - - <@@ nativeint 3uy @@>, true - <@@ nativeint 3y @@>, true - <@@ nativeint 3s @@>, true - <@@ nativeint 3us @@>, true - <@@ nativeint 3 @@>, true - <@@ nativeint 3u @@>, true - <@@ nativeint 3L @@>, true - <@@ nativeint 3UL @@>, true - <@@ nativeint 3.0f @@>, true - <@@ nativeint 3.0 @@>, true - <@@ nativeint LanguagePrimitives.GenericOne @@>, false - <@@ nativeint LanguagePrimitives.GenericOne @@>, false - //<@@ nativeint 3.0M @@>, false - //<@@ nativeint "3" @@>, false - - <@@ unativeint 3uy @@>, true - <@@ unativeint 3y @@>, true - <@@ unativeint 3s @@>, true - <@@ unativeint 3us @@>, true - <@@ unativeint 3 @@>, true - <@@ unativeint 3u @@>, true - <@@ unativeint 3L @@>, true - <@@ unativeint 3UL @@>, true - <@@ unativeint 3.0f @@>, true - <@@ unativeint 3.0 @@>, true - <@@ unativeint LanguagePrimitives.GenericOne @@>, false - <@@ unativeint LanguagePrimitives.GenericOne @@>, false - //<@@ unativeint 3.0M @@>, true - //<@@ unativeint "3" @@>, true - - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ List.sum [ 1; 2 ] @@>, true - <@@ List.sum [ 1.0f; 2.0f ] @@>, true - <@@ List.sum [ 1.0; 2.0 ] @@>, true - <@@ List.sum [ 1.0M; 2.0M ] @@>, true - <@@ List.average [ 1.0; 2.0 ] @@>, true - <@@ List.average [ 1.0f; 2.0f ] @@>, true - <@@ List.average [ 1.0M; 2.0M ] @@>, true - ] - - tests |> List.forall (fun (test, canEval) -> - if canEval then - printfn "--> checking we can evaluate %A" test - FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test |> ignore - printfn "<-- evaluated!" - else - printfn "skipping evaluation of %A because LinqExpressionConverter can't handle it" test - printfn "checking %A" test + <@@ 1y &&& 3y @@>, box 1y + <@@ 1uy &&& 3uy @@>, box 1uy + <@@ 1s &&& 3s @@>, box 1s + <@@ 1us &&& 3us @@>, box 1us + <@@ 1 &&& 3 @@>, box 1 + <@@ 1u &&& 3u @@>, box 1u + <@@ 1L &&& 3L @@>, box 1L + <@@ 1UL &&& 3UL @@>, box 1UL + <@@ 1I &&& 3I @@>, box 1I + <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 1y ||| 3y @@>, box 3y + <@@ 1uy ||| 3uy @@>, box 3uy + <@@ 1s ||| 3s @@>, box 3s + <@@ 1us ||| 3us @@>, box 3us + <@@ 1 ||| 3 @@>, box 3 + <@@ 1u ||| 3u @@>, box 3u + <@@ 1L ||| 3L @@>, box 3L + <@@ 1UL ||| 3UL @@>, box 3UL + <@@ 1I ||| 3I @@>, box 3I + <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 1y ^^^ 3y @@>, box 2y + <@@ 1uy ^^^ 3uy @@>, box 2uy + <@@ 1s ^^^ 3s @@>, box 2s + <@@ 1us ^^^ 3us @@>, box 2us + <@@ 1 ^^^ 3 @@>, box 2 + <@@ 1u ^^^ 3u @@>, box 2u + <@@ 1L ^^^ 3L @@>, box 2L + <@@ 1UL ^^^ 3UL @@>, box 2UL + <@@ 1I ^^^ 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, box 0un + + <@@ ~~~3y @@>, box -4y + <@@ ~~~3uy @@>, box 252uy + <@@ ~~~3s @@>, box -4s + <@@ ~~~3us @@>, box 65532us + <@@ ~~~3 @@>, box -4 + <@@ ~~~3u @@>, box 4294967292u + <@@ ~~~3L @@>, box -4L + <@@ ~~~3UL @@>, box 18446744073709551612UL + <@@ ~~~LanguagePrimitives.GenericOne @@>, box ~~~1n + <@@ ~~~LanguagePrimitives.GenericOne @@>, box ~~~1un + + <@@ byte 3uy @@>, box 3uy + <@@ byte 3y @@>, box 3uy + <@@ byte 3s @@>, box 3uy + <@@ byte 3us @@>, box 3uy + <@@ byte 3 @@>, box 3uy + <@@ byte 3u @@>, box 3uy + <@@ byte 3L @@>, box 3uy + <@@ byte 3UL @@>, box 3uy + <@@ byte '\003' @@>, box 3uy + <@@ byte 3.0f @@>, box 3uy + <@@ byte 3.0 @@>, box 3uy + <@@ byte 3.0 @@>, box 3uy + <@@ byte 3I @@>, box 3uy + <@@ byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ byte 3.0M @@>, box 3uy + <@@ byte "3" @@>, box 3uy + <@@ uint8 3uy @@>, box 3uy + <@@ uint8 3y @@>, box 3uy + <@@ uint8 3s @@>, box 3uy + <@@ uint8 3us @@>, box 3uy + <@@ uint8 3 @@>, box 3uy + <@@ uint8 3u @@>, box 3uy + <@@ uint8 3L @@>, box 3uy + <@@ uint8 3UL @@>, box 3uy + <@@ uint8 '\003' @@>, box 3uy + <@@ uint8 3.0f @@>, box 3uy + <@@ uint8 3.0 @@>, box 3uy + <@@ uint8 3.0 @@>, box 3uy + <@@ uint8 3I @@>, box 3uy + <@@ uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ uint8 3.0M @@>, box 3uy + <@@ uint8 "3" @@>, box 3uy + <@@ Checked.byte 3uy @@>, box 3uy + <@@ Checked.byte 3y @@>, box 3uy + <@@ Checked.byte 3s @@>, box 3uy + <@@ Checked.byte 3us @@>, box 3uy + <@@ Checked.byte 3 @@>, box 3uy + <@@ Checked.byte 3u @@>, box 3uy + <@@ Checked.byte 3L @@>, box 3uy + <@@ Checked.byte 3UL @@>, box 3uy + <@@ Checked.byte '\003' @@>, box 3uy + <@@ Checked.byte 3.0f @@>, box 3uy + <@@ Checked.byte 3.0 @@>, box 3uy + <@@ Checked.byte 3.0 @@>, box 3uy + <@@ Checked.byte 3I @@>, box 3uy + <@@ Checked.byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.byte 3.0M @@>, box 3uy + <@@ Checked.byte "3" @@>, box 3uy + <@@ Checked.uint8 3uy @@>, box 3uy + <@@ Checked.uint8 3y @@>, box 3uy + <@@ Checked.uint8 3s @@>, box 3uy + <@@ Checked.uint8 3us @@>, box 3uy + <@@ Checked.uint8 3 @@>, box 3uy + <@@ Checked.uint8 3u @@>, box 3uy + <@@ Checked.uint8 3L @@>, box 3uy + <@@ Checked.uint8 3UL @@>, box 3uy + <@@ Checked.uint8 '\003' @@>, box 3uy + <@@ Checked.uint8 3.0f @@>, box 3uy + <@@ Checked.uint8 3.0 @@>, box 3uy + <@@ Checked.uint8 3.0 @@>, box 3uy + <@@ Checked.uint8 3I @@>, box 3uy + <@@ Checked.uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.uint8 3.0M @@>, box 3uy + <@@ Checked.uint8 "3" @@>, box 3uy + + <@@ sbyte 3uy @@>, box 3y + <@@ sbyte 3y @@>, box 3y + <@@ sbyte 3s @@>, box 3y + <@@ sbyte 3us @@>, box 3y + <@@ sbyte 3 @@>, box 3y + <@@ sbyte 3u @@>, box 3y + <@@ sbyte 3L @@>, box 3y + <@@ sbyte 3UL @@>, box 3y + <@@ sbyte '\003' @@>, box 3y + <@@ sbyte 3.0f @@>, box 3y + <@@ sbyte 3.0 @@>, box 3y + <@@ sbyte 3.0 @@>, box 3y + <@@ sbyte 3I @@>, box 3y + <@@ sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ sbyte 3.0M @@>, box 3y + <@@ sbyte "3" @@>, box 3y + <@@ int8 3uy @@>, box 3y + <@@ int8 3y @@>, box 3y + <@@ int8 3s @@>, box 3y + <@@ int8 3us @@>, box 3y + <@@ int8 3 @@>, box 3y + <@@ int8 3u @@>, box 3y + <@@ int8 3L @@>, box 3y + <@@ int8 3UL @@>, box 3y + <@@ int8 '\003' @@>, box 3y + <@@ int8 3.0f @@>, box 3y + <@@ int8 3.0 @@>, box 3y + <@@ int8 3.0 @@>, box 3y + <@@ int8 3I @@>, box 3y + <@@ int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ int8 3.0M @@>, box 3y + <@@ int8 "3" @@>, box 3y + <@@ Checked.sbyte 3uy @@>, box 3y + <@@ Checked.sbyte 3y @@>, box 3y + <@@ Checked.sbyte 3s @@>, box 3y + <@@ Checked.sbyte 3us @@>, box 3y + <@@ Checked.sbyte 3 @@>, box 3y + <@@ Checked.sbyte 3u @@>, box 3y + <@@ Checked.sbyte 3L @@>, box 3y + <@@ Checked.sbyte 3UL @@>, box 3y + <@@ Checked.sbyte '\003' @@>, box 3y + <@@ Checked.sbyte 3.0f @@>, box 3y + <@@ Checked.sbyte 3.0 @@>, box 3y + <@@ Checked.sbyte 3.0 @@>, box 3y + <@@ Checked.sbyte 3I @@>, box 3y + <@@ Checked.sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.sbyte 3.0M @@>, box 3y + <@@ Checked.sbyte "3" @@>, box 3y + <@@ Checked.int8 3uy @@>, box 3y + <@@ Checked.int8 3y @@>, box 3y + <@@ Checked.int8 3s @@>, box 3y + <@@ Checked.int8 3us @@>, box 3y + <@@ Checked.int8 3 @@>, box 3y + <@@ Checked.int8 3u @@>, box 3y + <@@ Checked.int8 3L @@>, box 3y + <@@ Checked.int8 3UL @@>, box 3y + <@@ Checked.int8 '\003' @@>, box 3y + <@@ Checked.int8 3.0f @@>, box 3y + <@@ Checked.int8 3.0 @@>, box 3y + <@@ Checked.int8 3.0 @@>, box 3y + <@@ Checked.int8 3I @@>, box 3y + <@@ Checked.int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.int8 3.0M @@>, box 3y + <@@ Checked.int8 "3" @@>, box 3y + + <@@ int16 3uy @@>, box 3s + <@@ int16 3y @@>, box 3s + <@@ int16 3s @@>, box 3s + <@@ int16 3us @@>, box 3s + <@@ int16 3 @@>, box 3s + <@@ int16 3u @@>, box 3s + <@@ int16 3L @@>, box 3s + <@@ int16 3UL @@>, box 3s + <@@ int16 '\003' @@>, box 3s + <@@ int16 3.0f @@>, box 3s + <@@ int16 3.0 @@>, box 3s + <@@ int16 3.0 @@>, box 3s + <@@ int16 3I @@>, box 3s + <@@ int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ int16 3.0M @@>, box 3s + <@@ int16 "3" @@>, box 3s + <@@ Checked.int16 3uy @@>, box 3s + <@@ Checked.int16 3y @@>, box 3s + <@@ Checked.int16 3s @@>, box 3s + <@@ Checked.int16 3us @@>, box 3s + <@@ Checked.int16 3 @@>, box 3s + <@@ Checked.int16 3u @@>, box 3s + <@@ Checked.int16 3L @@>, box 3s + <@@ Checked.int16 3UL @@>, box 3s + <@@ Checked.int16 '\003' @@>, box 3s + <@@ Checked.int16 3.0f @@>, box 3s + <@@ Checked.int16 3.0 @@>, box 3s + <@@ Checked.int16 3.0 @@>, box 3s + <@@ Checked.int16 3I @@>, box 3s + <@@ Checked.int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ Checked.int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ Checked.int16 3.0M @@>, box 3s + <@@ Checked.int16 "3" @@>, box 3s + + <@@ uint16 3uy @@>, box 3us + <@@ uint16 3y @@>, box 3us + <@@ uint16 3s @@>, box 3us + <@@ uint16 3us @@>, box 3us + <@@ uint16 3 @@>, box 3us + <@@ uint16 3u @@>, box 3us + <@@ uint16 3L @@>, box 3us + <@@ uint16 3UL @@>, box 3us + <@@ uint16 '\003' @@>, box 3us + <@@ uint16 3.0f @@>, box 3us + <@@ uint16 3.0 @@>, box 3us + <@@ uint16 3.0 @@>, box 3us + <@@ uint16 3I @@>, box 3us + <@@ uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ uint16 3.0M @@>, box 3us + <@@ uint16 "3" @@>, box 3us + <@@ Checked.uint16 3uy @@>, box 3us + <@@ Checked.uint16 3y @@>, box 3us + <@@ Checked.uint16 3s @@>, box 3us + <@@ Checked.uint16 3us @@>, box 3us + <@@ Checked.uint16 3 @@>, box 3us + <@@ Checked.uint16 3u @@>, box 3us + <@@ Checked.uint16 3L @@>, box 3us + <@@ Checked.uint16 3UL @@>, box 3us + <@@ Checked.uint16 '\003' @@>, box 3us + <@@ Checked.uint16 3.0f @@>, box 3us + <@@ Checked.uint16 3.0 @@>, box 3us + <@@ Checked.uint16 3.0 @@>, box 3us + <@@ Checked.uint16 3I @@>, box 3us + <@@ Checked.uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ Checked.uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ Checked.uint16 3.0M @@>, box 3us + <@@ Checked.uint16 "3" @@>, box 3us + + <@@ int 3uy @@>, box 3 + <@@ int 3y @@>, box 3 + <@@ int 3s @@>, box 3 + <@@ int 3us @@>, box 3 + <@@ int 3 @@>, box 3 + <@@ int 3u @@>, box 3 + <@@ int 3L @@>, box 3 + <@@ int 3UL @@>, box 3 + <@@ int '\003' @@>, box 3 + <@@ int 3.0f @@>, box 3 + <@@ int 3.0 @@>, box 3 + <@@ int 3.0 @@>, box 3 + <@@ int 3I @@>, box 3 + <@@ int LanguagePrimitives.GenericOne @@>, box 1 + <@@ int LanguagePrimitives.GenericOne @@>, box 1 + <@@ int 3.0M @@>, box 3 + <@@ int "3" @@>, box 3 + <@@ int32 3uy @@>, box 3 + <@@ int32 3y @@>, box 3 + <@@ int32 3s @@>, box 3 + <@@ int32 3us @@>, box 3 + <@@ int32 3 @@>, box 3 + <@@ int32 3u @@>, box 3 + <@@ int32 3L @@>, box 3 + <@@ int32 3UL @@>, box 3 + <@@ int32 '\003' @@>, box 3 + <@@ int32 3.0f @@>, box 3 + <@@ int32 3.0 @@>, box 3 + <@@ int32 3.0 @@>, box 3 + <@@ int32 3I @@>, box 3 + <@@ int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ int32 3.0M @@>, box 3 + <@@ int32 "3" @@>, box 3 + <@@ Checked.int 3uy @@>, box 3 + <@@ Checked.int 3y @@>, box 3 + <@@ Checked.int 3s @@>, box 3 + <@@ Checked.int 3us @@>, box 3 + <@@ Checked.int 3 @@>, box 3 + <@@ Checked.int 3u @@>, box 3 + <@@ Checked.int 3L @@>, box 3 + <@@ Checked.int 3UL @@>, box 3 + <@@ Checked.int '\003' @@>, box 3 + <@@ Checked.int 3.0f @@>, box 3 + <@@ Checked.int 3.0 @@>, box 3 + <@@ Checked.int 3.0 @@>, box 3 + <@@ Checked.int 3I @@>, box 3 + <@@ Checked.int LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int 3.0M @@>, box 3 + <@@ Checked.int "3" @@>, box 3 + <@@ Checked.int32 3uy @@>, box 3 + <@@ Checked.int32 3y @@>, box 3 + <@@ Checked.int32 3s @@>, box 3 + <@@ Checked.int32 3us @@>, box 3 + <@@ Checked.int32 3 @@>, box 3 + <@@ Checked.int32 3u @@>, box 3 + <@@ Checked.int32 3L @@>, box 3 + <@@ Checked.int32 3UL @@>, box 3 + <@@ Checked.int32 '\003' @@>, box 3 + <@@ Checked.int32 3.0f @@>, box 3 + <@@ Checked.int32 3.0 @@>, box 3 + <@@ Checked.int32 3.0 @@>, box 3 + <@@ Checked.int32 3I @@>, box 3 + <@@ Checked.int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int32 3.0M @@>, box 3 + <@@ Checked.int32 "3" @@>, box 3 + + <@@ uint 3uy @@>, box 3u + <@@ uint 3y @@>, box 3u + <@@ uint 3s @@>, box 3u + <@@ uint 3us @@>, box 3u + <@@ uint 3 @@>, box 3u + <@@ uint 3u @@>, box 3u + <@@ uint 3L @@>, box 3u + <@@ uint 3UL @@>, box 3u + <@@ uint '\003' @@>, box 3u + <@@ uint 3.0f @@>, box 3u + <@@ uint 3.0 @@>, box 3u + <@@ uint 3.0 @@>, box 3u + <@@ uint 3I @@>, box 3u + <@@ uint LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint 3.0M @@>, box 3u + <@@ uint "3" @@>, box 3u + <@@ uint32 3uy @@>, box 3u + <@@ uint32 3y @@>, box 3u + <@@ uint32 3s @@>, box 3u + <@@ uint32 3us @@>, box 3u + <@@ uint32 3 @@>, box 3u + <@@ uint32 3u @@>, box 3u + <@@ uint32 3L @@>, box 3u + <@@ uint32 3UL @@>, box 3u + <@@ uint32 '\003' @@>, box 3u + <@@ uint32 3.0f @@>, box 3u + <@@ uint32 3.0 @@>, box 3u + <@@ uint32 3.0 @@>, box 3u + <@@ uint32 3I @@>, box 3u + <@@ uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint32 3.0M @@>, box 3u + <@@ uint32 "3" @@>, box 3u + <@@ Checked.uint32 3uy @@>, box 3u + <@@ Checked.uint32 3y @@>, box 3u + <@@ Checked.uint32 3s @@>, box 3u + <@@ Checked.uint32 3us @@>, box 3u + <@@ Checked.uint32 3 @@>, box 3u + <@@ Checked.uint32 3u @@>, box 3u + <@@ Checked.uint32 3L @@>, box 3u + <@@ Checked.uint32 3UL @@>, box 3u + <@@ Checked.uint32 '\003' @@>, box 3u + <@@ Checked.uint32 3.0f @@>, box 3u + <@@ Checked.uint32 3.0 @@>, box 3u + <@@ Checked.uint32 3.0 @@>, box 3u + <@@ Checked.uint32 3I @@>, box 3u + <@@ Checked.uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ Checked.uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ Checked.uint32 3.0M @@>, box 3u + <@@ Checked.uint32 "3" @@>, box 3u + + <@@ int64 3uy @@>, box 3L + <@@ int64 3y @@>, box 3L + <@@ int64 3s @@>, box 3L + <@@ int64 3us @@>, box 3L + <@@ int64 3 @@>, box 3L + <@@ int64 3u @@>, box 3L + <@@ int64 3L @@>, box 3L + <@@ int64 3UL @@>, box 3L + <@@ int64 '\003' @@>, box 3L + <@@ int64 3.0f @@>, box 3L + <@@ int64 3.0 @@>, box 3L + <@@ int64 3.0 @@>, box 3L + <@@ int64 3I @@>, box 3L + <@@ int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ int64 3.0M @@>, box 3L + <@@ int64 "3" @@>, box 3L + <@@ Checked.int64 3uy @@>, box 3L + <@@ Checked.int64 3y @@>, box 3L + <@@ Checked.int64 3s @@>, box 3L + <@@ Checked.int64 3us @@>, box 3L + <@@ Checked.int64 3 @@>, box 3L + <@@ Checked.int64 3u @@>, box 3L + <@@ Checked.int64 3L @@>, box 3L + <@@ Checked.int64 3UL @@>, box 3L + <@@ Checked.int64 '\003' @@>, box 3L + <@@ Checked.int64 3.0f @@>, box 3L + <@@ Checked.int64 3.0 @@>, box 3L + <@@ Checked.int64 3.0 @@>, box 3L + <@@ Checked.int64 3I @@>, box 3L + <@@ Checked.int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ Checked.int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ Checked.int64 3.0M @@>, box 3L + <@@ Checked.int64 "3" @@>, box 3L + + <@@ uint64 3uy @@>, box 3UL + <@@ uint64 3y @@>, box 3UL + <@@ uint64 3s @@>, box 3UL + <@@ uint64 3us @@>, box 3UL + <@@ uint64 3 @@>, box 3UL + <@@ uint64 3u @@>, box 3UL + <@@ uint64 3L @@>, box 3UL + <@@ uint64 3UL @@>, box 3UL + <@@ uint64 '\003' @@>, box 3UL + <@@ uint64 3.0f @@>, box 3UL + <@@ uint64 3.0 @@>, box 3UL + <@@ uint64 3.0 @@>, box 3UL + <@@ uint64 3I @@>, box 3UL + <@@ uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ uint64 3.0M @@>, box 3UL + <@@ uint64 "3" @@>, box 3UL + <@@ Checked.uint64 3uy @@>, box 3UL + <@@ Checked.uint64 3y @@>, box 3UL + <@@ Checked.uint64 3s @@>, box 3UL + <@@ Checked.uint64 3us @@>, box 3UL + <@@ Checked.uint64 3 @@>, box 3UL + <@@ Checked.uint64 3u @@>, box 3UL + <@@ Checked.uint64 3L @@>, box 3UL + <@@ Checked.uint64 3UL @@>, box 3UL + <@@ Checked.uint64 '\003' @@>, box 3UL + <@@ Checked.uint64 3.0f @@>, box 3UL + <@@ Checked.uint64 3.0 @@>, box 3UL + <@@ Checked.uint64 3.0 @@>, box 3UL + <@@ Checked.uint64 3I @@>, box 3UL + <@@ Checked.uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ Checked.uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ Checked.uint64 3.0M @@>, box 3UL + <@@ Checked.uint64 "3" @@>, box 3UL + + <@@ char 51uy @@>, box '3' + <@@ char 51y @@>, box '3' + <@@ char 51s @@>, box '3' + <@@ char 51us @@>, box '3' + <@@ char 51 @@>, box '3' + <@@ char 51u @@>, box '3' + <@@ char 51L @@>, box '3' + <@@ char 51UL @@>, box '3' + <@@ char '3' @@>, box '3' + <@@ char 51.0f @@>, box '3' + <@@ char 51.0 @@>, box '3' + <@@ char 51.0 @@>, box '3' + <@@ char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ char 51.0M @@>, box '3' + <@@ char "3" @@>, box '3' + <@@ Checked.char 51uy @@>, box '3' + <@@ Checked.char 51y @@>, box '3' + <@@ Checked.char 51s @@>, box '3' + <@@ Checked.char 51us @@>, box '3' + <@@ Checked.char 51 @@>, box '3' + <@@ Checked.char 51u @@>, box '3' + <@@ Checked.char 51L @@>, box '3' + <@@ Checked.char 51UL @@>, box '3' + <@@ Checked.char '3' @@>, box '3' + <@@ Checked.char 51.0f @@>, box '3' + <@@ Checked.char 51.0 @@>, box '3' + <@@ Checked.char 51.0 @@>, box '3' + <@@ Checked.char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ Checked.char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ Checked.char 51.0M @@>, box '3' + <@@ Checked.char "3" @@>, box '3' + + <@@ nativeint 3uy @@>, box 3n + <@@ nativeint 3y @@>, box 3n + <@@ nativeint 3s @@>, box 3n + <@@ nativeint 3us @@>, box 3n + <@@ nativeint 3 @@>, box 3n + <@@ nativeint 3u @@>, box 3n + <@@ nativeint 3L @@>, box 3n + <@@ nativeint 3UL @@>, box 3n + <@@ nativeint '\003' @@>, box 3n + <@@ nativeint 3.0f @@>, box 3n + <@@ nativeint 3.0 @@>, box 3n + <@@ nativeint 3.0 @@>, box 3n + <@@ nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ nativeint 3.0M @@>, box 3n + <@@ nativeint "3" @@>, box 3n + <@@ Checked.nativeint 3uy @@>, box 3n + <@@ Checked.nativeint 3y @@>, box 3n + <@@ Checked.nativeint 3s @@>, box 3n + <@@ Checked.nativeint 3us @@>, box 3n + <@@ Checked.nativeint 3 @@>, box 3n + <@@ Checked.nativeint 3u @@>, box 3n + <@@ Checked.nativeint 3L @@>, box 3n + <@@ Checked.nativeint 3UL @@>, box 3n + <@@ Checked.nativeint '\003' @@>, box 3n + <@@ Checked.nativeint 3.0f @@>, box 3n + <@@ Checked.nativeint 3.0 @@>, box 3n + <@@ Checked.nativeint 3.0 @@>, box 3n + <@@ Checked.nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.nativeint 3.0M @@>, box 3n + <@@ Checked.nativeint "3" @@>, box 3n + + <@@ unativeint 3uy @@>, box 3un + <@@ unativeint 3y @@>, box 3un + <@@ unativeint 3s @@>, box 3un + <@@ unativeint 3us @@>, box 3un + <@@ unativeint 3 @@>, box 3un + <@@ unativeint 3u @@>, box 3un + <@@ unativeint 3L @@>, box 3un + <@@ unativeint 3UL @@>, box 3un + <@@ unativeint '\003' @@>, box 3un + <@@ unativeint 3.0f @@>, box 3un + <@@ unativeint 3.0 @@>, box 3un + <@@ unativeint 3.0 @@>, box 3un + <@@ unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ unativeint 3.0M @@>, box 3un + <@@ unativeint "3" @@>, box 3un + <@@ Checked.unativeint 3uy @@>, box 3un + <@@ Checked.unativeint 3y @@>, box 3un + <@@ Checked.unativeint 3s @@>, box 3un + <@@ Checked.unativeint 3us @@>, box 3un + <@@ Checked.unativeint 3 @@>, box 3un + <@@ Checked.unativeint 3u @@>, box 3un + <@@ Checked.unativeint 3L @@>, box 3un + <@@ Checked.unativeint 3UL @@>, box 3un + <@@ Checked.unativeint '\003' @@>, box 3un + <@@ Checked.unativeint 3.0f @@>, box 3un + <@@ Checked.unativeint 3.0 @@>, box 3un + <@@ Checked.unativeint 3.0 @@>, box 3un + <@@ Checked.unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.unativeint 3.0M @@>, box 3un + <@@ Checked.unativeint "3" @@>, box 3un + + <@@ single 3uy @@>, box 3f + <@@ single 3y @@>, box 3f + <@@ single 3s @@>, box 3f + <@@ single 3us @@>, box 3f + <@@ single 3 @@>, box 3f + <@@ single 3u @@>, box 3f + <@@ single 3L @@>, box 3f + <@@ single 3UL @@>, box 3f + <@@ single '\003' @@>, box 3f + <@@ single 3.0f @@>, box 3f + <@@ single 3.0 @@>, box 3f + <@@ single 3.0 @@>, box 3f + <@@ single 3I @@>, box 3f + <@@ single LanguagePrimitives.GenericOne @@>, box 1f + <@@ single LanguagePrimitives.GenericOne @@>, box 1f + <@@ single 3.0M @@>, box 3f + <@@ single "3" @@>, box 3f + <@@ float32 3uy @@>, box 3f + <@@ float32 3y @@>, box 3f + <@@ float32 3s @@>, box 3f + <@@ float32 3us @@>, box 3f + <@@ float32 3 @@>, box 3f + <@@ float32 3u @@>, box 3f + <@@ float32 3L @@>, box 3f + <@@ float32 3UL @@>, box 3f + <@@ float32 '\003' @@>, box 3f + <@@ float32 3.0f @@>, box 3f + <@@ float32 3.0 @@>, box 3f + <@@ float32 3.0 @@>, box 3f + <@@ float32 3I @@>, box 3f + <@@ float32 LanguagePrimitives.GenericOne @@>, box 1f + <@@ float32 LanguagePrimitives.GenericOne @@>, box 1f + <@@ float32 3.0M @@>, box 3f + <@@ float32 "3" @@>, box 3f + + <@@ double 3uy @@>, box 3. + <@@ double 3y @@>, box 3. + <@@ double 3s @@>, box 3. + <@@ double 3us @@>, box 3. + <@@ double 3 @@>, box 3. + <@@ double 3u @@>, box 3. + <@@ double 3L @@>, box 3. + <@@ double 3UL @@>, box 3. + <@@ double '\003' @@>, box 3. + <@@ double 3.0f @@>, box 3. + <@@ double 3.0 @@>, box 3. + <@@ double 3.0 @@>, box 3. + <@@ double 3I @@>, box 3. + <@@ double LanguagePrimitives.GenericOne @@>, box 1. + <@@ double LanguagePrimitives.GenericOne @@>, box 1. + <@@ double 3.0M @@>, box 3. + <@@ double "3" @@>, box 3. + <@@ float 3uy @@>, box 3. + <@@ float 3y @@>, box 3. + <@@ float 3s @@>, box 3. + <@@ float 3us @@>, box 3. + <@@ float 3 @@>, box 3. + <@@ float 3u @@>, box 3. + <@@ float 3L @@>, box 3. + <@@ float 3UL @@>, box 3. + <@@ float '\003' @@>, box 3. + <@@ float 3.0f @@>, box 3. + <@@ float 3.0 @@>, box 3. + <@@ float 3.0 @@>, box 3. + <@@ float 3I @@>, box 3. + <@@ float LanguagePrimitives.GenericOne @@>, box 1. + <@@ float LanguagePrimitives.GenericOne @@>, box 1. + <@@ float 3.0M @@>, box 3. + <@@ float "3" @@>, box 3. + + <@@ decimal 3uy @@>, box 3m + <@@ decimal 3y @@>, box 3m + <@@ decimal 3s @@>, box 3m + <@@ decimal 3us @@>, box 3m + <@@ decimal 3 @@>, box 3m + <@@ decimal 3u @@>, box 3m + <@@ decimal 3L @@>, box 3m + <@@ decimal 3UL @@>, box 3m + <@@ decimal '\003' @@>, box 3m + <@@ decimal 3.0f @@>, box 3m + <@@ decimal 3.0 @@>, box 3m + <@@ decimal 3.0 @@>, box 3m + <@@ decimal 3I @@>, box 3m + <@@ decimal LanguagePrimitives.GenericOne @@>, box 1m + <@@ decimal LanguagePrimitives.GenericOne @@>, box 1m + <@@ decimal 3.0M @@>, box 3m + <@@ decimal "3" @@>, box 3m + + <@@ LanguagePrimitives.GenericZero @@>, box 0uy + <@@ LanguagePrimitives.GenericZero @@>, box 0uy + <@@ LanguagePrimitives.GenericZero @@>, box 0y + <@@ LanguagePrimitives.GenericZero @@>, box 0y + <@@ LanguagePrimitives.GenericZero @@>, box 0s + <@@ LanguagePrimitives.GenericZero @@>, box 0us + <@@ LanguagePrimitives.GenericZero @@>, box 0 + <@@ LanguagePrimitives.GenericZero @@>, box 0 + <@@ LanguagePrimitives.GenericZero @@>, box 0u + <@@ LanguagePrimitives.GenericZero @@>, box 0u + <@@ LanguagePrimitives.GenericZero @@>, box 0L + <@@ LanguagePrimitives.GenericZero @@>, box 0UL + <@@ LanguagePrimitives.GenericZero @@>, box 0I + <@@ LanguagePrimitives.GenericZero @@>, box '\000' + <@@ LanguagePrimitives.GenericZero @@>, box 0n + <@@ LanguagePrimitives.GenericZero @@>, box 0un + <@@ LanguagePrimitives.GenericZero @@>, box 0f + <@@ LanguagePrimitives.GenericZero @@>, box 0. + <@@ LanguagePrimitives.GenericZero @@>, box 0m + <@@ LanguagePrimitives.GenericZero> @@>, box 0m + + <@@ LanguagePrimitives.GenericOne @@>, box 1uy + <@@ LanguagePrimitives.GenericOne @@>, box 1uy + <@@ LanguagePrimitives.GenericOne @@>, box 1y + <@@ LanguagePrimitives.GenericOne @@>, box 1y + <@@ LanguagePrimitives.GenericOne @@>, box 1s + <@@ LanguagePrimitives.GenericOne @@>, box 1us + <@@ LanguagePrimitives.GenericOne @@>, box 1 + <@@ LanguagePrimitives.GenericOne @@>, box 1 + <@@ LanguagePrimitives.GenericOne @@>, box 1u + <@@ LanguagePrimitives.GenericOne @@>, box 1u + <@@ LanguagePrimitives.GenericOne @@>, box 1L + <@@ LanguagePrimitives.GenericOne @@>, box 1UL + <@@ LanguagePrimitives.GenericOne @@>, box 1I + <@@ LanguagePrimitives.GenericOne @@>, box '\001' + <@@ LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne @@>, box 1un + <@@ LanguagePrimitives.GenericOne @@>, box 1f + <@@ LanguagePrimitives.GenericOne @@>, box 1. + <@@ LanguagePrimitives.GenericOne @@>, box 1m + //<@@ LanguagePrimitives.GenericOne> @@>, box 1m // Doesn't typecheck + + <@@ List.sum [ 1; 2 ] @@>, box 3 + <@@ List.sum [ 1I; 2I ] @@>, box 3I + <@@ List.sum [ 1.0f; 2.0f ] @@>, box 3f + <@@ List.sum [ 1.0; 2.0 ] @@>, box 3. + <@@ List.sum [ 1.0M; 2.0M ] @@>, box 3m + <@@ List.sum [ 1.0M; 2.0M ] @@>, box 3m + <@@ List.average [ 1.0; 2.0 ] @@>, box 1.5 + <@@ List.average [ 1.0f; 2.0f ] @@>, box 1.5f + <@@ List.average [ 1.0M; 2.0M ] @@>, box 1.5m + <@@ List.average [ 1.0M; 2.0M ] @@>, box 1.5m + + <@@ Nullable.byte (Nullable<_> 3uy) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3y) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3s) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3us) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3u) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3L) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3UL) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> '\003') @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0f) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3I) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.byte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.byte (Nullable<_> 3.0M) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3uy) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3y) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3s) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3us) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3u) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3L) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3UL) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> '\003') @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0f) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3I) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.uint8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.uint8 (Nullable<_> 3.0M) @@>, box 3uy + + <@@ Nullable.sbyte (Nullable<_> 3uy) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3y) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3s) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3us) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3u) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3L) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3UL) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> '\003') @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0f) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3I) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.sbyte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.sbyte (Nullable<_> 3.0M) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3uy) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3y) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3s) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3us) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3u) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3L) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3UL) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> '\003') @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0f) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3I) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.int8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.int8 (Nullable<_> 3.0M) @@>, box 3y + + <@@ Nullable.int16 (Nullable<_> 3uy) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3y) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3s) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3us) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3u) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3L) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3UL) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> '\003') @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0f) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3I) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1s + <@@ Nullable.int16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1s + <@@ Nullable.int16 (Nullable<_> 3.0M) @@>, box 3s + + <@@ Nullable.uint16 (Nullable<_> 3uy) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3y) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3s) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3us) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3u) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3L) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3UL) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> '\003') @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0f) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3I) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1us + <@@ Nullable.uint16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1us + <@@ Nullable.uint16 (Nullable<_> 3.0M) @@>, box 3us + + <@@ Nullable.int (Nullable<_> 3uy) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3y) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3s) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3us) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3u) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3L) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3UL) @@>, box 3 + <@@ Nullable.int (Nullable<_> '\003') @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0f) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3I) @@>, box 3 + <@@ Nullable.int (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int (Nullable<_> 3.0M) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3uy) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3y) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3s) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3us) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3u) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3L) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3UL) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> '\003') @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0f) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3I) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int32 (Nullable<_> 3.0M) @@>, box 3 + + <@@ Nullable.uint (Nullable<_> 3uy) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3y) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3s) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3us) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3u) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3L) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3UL) @@>, box 3u + <@@ Nullable.uint (Nullable<_> '\003') @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0f) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3I) @@>, box 3u + <@@ Nullable.uint (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint (Nullable<_> 3.0M) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3uy) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3y) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3s) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3us) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3u) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3L) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3UL) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> '\003') @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0f) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3I) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint32 (Nullable<_> 3.0M) @@>, box 3u + + <@@ Nullable.int64 (Nullable<_> 3uy) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3y) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3s) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3us) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3u) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3L) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3UL) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> '\003') @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0f) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3I) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1L + <@@ Nullable.int64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1L + <@@ Nullable.int64 (Nullable<_> 3.0M) @@>, box 3L + + <@@ Nullable.uint64 (Nullable<_> 3uy) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3y) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3s) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3us) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3u) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3L) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3UL) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> '\003') @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0f) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3I) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1UL + <@@ Nullable.uint64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1UL + <@@ Nullable.uint64 (Nullable<_> 3.0M) @@>, box 3UL + + <@@ Nullable.char (Nullable<_> 51uy) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51y) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51s) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51us) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51u) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51L) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51UL) @@>, box '3' + <@@ Nullable.char (Nullable<_> '3') @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0f) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0) @@>, box '3' + <@@ Nullable.char (Nullable<_> LanguagePrimitives.GenericOne) @@>, box '\001' + <@@ Nullable.char (Nullable<_> LanguagePrimitives.GenericOne) @@>, box '\001' + <@@ Nullable.char (Nullable<_> 51.0M) @@>, box '3' + + <@@ Nullable.single (Nullable<_> 3uy) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3y) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3s) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3us) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3u) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3L) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3UL) @@>, box 3f + <@@ Nullable.single (Nullable<_> '\003') @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0f) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3I) @@>, box 3f + <@@ Nullable.single (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.single (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.single (Nullable<_> 3.0M) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3uy) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3y) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3s) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3us) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3u) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3L) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3UL) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> '\003') @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0f) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3I) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.float32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.float32 (Nullable<_> 3.0M) @@>, box 3f + + <@@ Nullable.double (Nullable<_> 3uy) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3y) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3s) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3us) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3u) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3L) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3UL) @@>, box 3. + <@@ Nullable.double (Nullable<_> '\003') @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0f) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3I) @@>, box 3. + <@@ Nullable.double (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.double (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.double (Nullable<_> 3.0M) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3uy) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3y) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3s) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3us) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3u) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3L) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3UL) @@>, box 3. + <@@ Nullable.float (Nullable<_> '\003') @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0f) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3I) @@>, box 3. + <@@ Nullable.float (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.float (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.float (Nullable<_> 3.0M) @@>, box 3. + + <@@ Nullable.decimal (Nullable<_> 3uy) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3y) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3s) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3us) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3u) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3L) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3UL) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> '\003') @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0f) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3I) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1m + <@@ Nullable.decimal (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1m + <@@ Nullable.decimal (Nullable<_> 3.0M) @@>, box 3m + + <@@ Nullable<_> 1y ?+ 4y @@>, box 5y + <@@ Nullable<_> 1uy ?+ 4uy @@>, box 5uy + <@@ Nullable<_> 1s ?+ 4s @@>, box 5s + <@@ Nullable<_> 1us ?+ 4us @@>, box 5us + <@@ Nullable<_> 1 ?+ 4 @@>, box 5 + <@@ Nullable<_> 1u ?+ 4u @@>, box 5u + <@@ Nullable<_> 1L ?+ 4L @@>, box 5L + <@@ Nullable<_> 1uL ?+ 4uL @@>, box 5uL + <@@ Nullable<_> 1.0f ?+ 4.0f @@>, box 5f + <@@ Nullable<_> 1.0 ?+ 4.0 @@>, box 5. + <@@ Nullable<_> 1m ?+ 4m @@>, box 5m + <@@ Nullable<_> 1m ?+ 4m @@>, box 5m + <@@ Nullable<_> 1I ?+ 4I @@>, box 5I + <@@ Nullable<_> '1' ?+ '\004' @@>, box '5' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+ LanguagePrimitives.GenericOne @@>, box 2n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+ LanguagePrimitives.GenericOne @@>, box 2un + + <@@ 1y +? Nullable<_> 4y @@>, box 5y + <@@ 1uy +? Nullable<_> 4uy @@>, box 5uy + <@@ 1s +? Nullable<_> 4s @@>, box 5s + <@@ 1us +? Nullable<_> 4us @@>, box 5us + <@@ 1 +? Nullable<_> 4 @@>, box 5 + <@@ 1u +? Nullable<_> 4u @@>, box 5u + <@@ 1L +? Nullable<_> 4L @@>, box 5L + <@@ 1uL +? Nullable<_> 4uL @@>, box 5uL + <@@ 1.0f +? Nullable<_> 4.0f @@>, box 5f + <@@ 1.0 +? Nullable<_> 4.0 @@>, box 5. + <@@ 1m +? Nullable<_> 4m @@>, box 5m + <@@ 1m +? Nullable<_> 4m @@>, box 5m + <@@ 1I +? Nullable<_> 4I @@>, box 5I + <@@ '1' +? Nullable<_> '\004' @@>, box '5' + <@@ LanguagePrimitives.GenericOne +? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2n + <@@ LanguagePrimitives.GenericOne +? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2un + + <@@ Nullable<_> 1y ?+? Nullable<_> 4y @@>, box 5y + <@@ Nullable<_> 1uy ?+? Nullable<_> 4uy @@>, box 5uy + <@@ Nullable<_> 1s ?+? Nullable<_> 4s @@>, box 5s + <@@ Nullable<_> 1us ?+? Nullable<_> 4us @@>, box 5us + <@@ Nullable<_> 1 ?+? Nullable<_> 4 @@>, box 5 + <@@ Nullable<_> 1u ?+? Nullable<_> 4u @@>, box 5u + <@@ Nullable<_> 1L ?+? Nullable<_> 4L @@>, box 5L + <@@ Nullable<_> 1uL ?+? Nullable<_> 4uL @@>, box 5uL + <@@ Nullable<_> 1.0f ?+? Nullable<_> 4.0f @@>, box 5f + <@@ Nullable<_> 1.0 ?+? Nullable<_> 4.0 @@>, box 5. + <@@ Nullable<_> 1m ?+? Nullable<_> 4m @@>, box 5m + <@@ Nullable<_> 1m ?+? Nullable<_> 4m @@>, box 5m + <@@ Nullable<_> 1I ?+? Nullable<_> 4I @@>, box 5I + <@@ Nullable<_> '1' ?+? Nullable<_> '\004' @@>, box '5' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2un + + <@@ Nullable<_> 4y ?- 1y @@>, box 3y + <@@ Nullable<_> 4uy ?- 1uy @@>, box 3uy + <@@ Nullable<_> 4s ?- 1s @@>, box 3s + <@@ Nullable<_> 4us ?- 1us @@>, box 3us + <@@ Nullable<_> 4 ?- 1 @@>, box 3 + <@@ Nullable<_> 4u ?- 1u @@>, box 3u + <@@ Nullable<_> 4L ?- 1L @@>, box 3L + <@@ Nullable<_> 4uL ?- 1uL @@>, box 3uL + <@@ Nullable<_> 4.0f ?- 1.0f @@>, box 3f + <@@ Nullable<_> 4.0 ?- 1.0 @@>, box 3. + <@@ Nullable<_> 4m ?- 1m @@>, box 3m + <@@ Nullable<_> 4m ?- 1m @@>, box 3m + <@@ Nullable<_> 4I ?- 1I @@>, box 3I + <@@ Nullable<_> '4' ?- '\001' @@>, box '3' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?- LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?- LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 4y -? Nullable<_> 1y @@>, box 3y + <@@ 4uy -? Nullable<_> 1uy @@>, box 3uy + <@@ 4s -? Nullable<_> 1s @@>, box 3s + <@@ 4us -? Nullable<_> 1us @@>, box 3us + <@@ 4 -? Nullable<_> 1 @@>, box 3 + <@@ 4u -? Nullable<_> 1u @@>, box 3u + <@@ 4L -? Nullable<_> 1L @@>, box 3L + <@@ 4uL -? Nullable<_> 1uL @@>, box 3uL + <@@ 4.0f -? Nullable<_> 1.0f @@>, box 3f + <@@ 4.0 -? Nullable<_> 1.0 @@>, box 3. + <@@ 4m -? Nullable<_> 1m @@>, box 3m + <@@ 4m -? Nullable<_> 1m @@>, box 3m + <@@ 4I -? Nullable<_> 1I @@>, box 3I + <@@ '4' -? Nullable<_> '\001' @@>, box '3' + <@@ LanguagePrimitives.GenericOne -? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne -? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 4y ?-? Nullable<_> 1y @@>, box 3y + <@@ Nullable<_> 4uy ?-? Nullable<_> 1uy @@>, box 3uy + <@@ Nullable<_> 4s ?-? Nullable<_> 1s @@>, box 3s + <@@ Nullable<_> 4us ?-? Nullable<_> 1us @@>, box 3us + <@@ Nullable<_> 4 ?-? Nullable<_> 1 @@>, box 3 + <@@ Nullable<_> 4u ?-? Nullable<_> 1u @@>, box 3u + <@@ Nullable<_> 4L ?-? Nullable<_> 1L @@>, box 3L + <@@ Nullable<_> 4uL ?-? Nullable<_> 1uL @@>, box 3uL + <@@ Nullable<_> 4.0f ?-? Nullable<_> 1.0f @@>, box 3f + <@@ Nullable<_> 4.0 ?-? Nullable<_> 1.0 @@>, box 3. + <@@ Nullable<_> 4m ?-? Nullable<_> 1m @@>, box 3m + <@@ Nullable<_> 4m ?-? Nullable<_> 1m @@>, box 3m + <@@ Nullable<_> 4I ?-? Nullable<_> 1I @@>, box 3I + <@@ Nullable<_> '4' ?-? Nullable<_> '\001' @@>, box '3' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?-? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?-? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 2y ?* 4y @@>, box 8y + <@@ Nullable<_> 2uy ?* 4uy @@>, box 8uy + <@@ Nullable<_> 2s ?* 4s @@>, box 8s + <@@ Nullable<_> 2us ?* 4us @@>, box 8us + <@@ Nullable<_> 2 ?* 4 @@>, box 8 + <@@ Nullable<_> 2u ?* 4u @@>, box 8u + <@@ Nullable<_> 2L ?* 4L @@>, box 8L + <@@ Nullable<_> 2uL ?* 4uL @@>, box 8uL + <@@ Nullable<_> 2.0f ?* 4.0f @@>, box 8f + <@@ Nullable<_> 2.0 ?* 4.0 @@>, box 8. + <@@ Nullable<_> 2m ?* 4m @@>, box 8m + <@@ Nullable<_> 2m ?* 4m @@>, box 8m + <@@ Nullable<_> 2I ?* 4I @@>, box 8I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?* LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?* LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 2y *? Nullable<_> 4y @@>, box 8y + <@@ 2uy *? Nullable<_> 4uy @@>, box 8uy + <@@ 2s *? Nullable<_> 4s @@>, box 8s + <@@ 2us *? Nullable<_> 4us @@>, box 8us + <@@ 2 *? Nullable<_> 4 @@>, box 8 + <@@ 2u *? Nullable<_> 4u @@>, box 8u + <@@ 2L *? Nullable<_> 4L @@>, box 8L + <@@ 2uL *? Nullable<_> 4uL @@>, box 8uL + <@@ 2.0f *? Nullable<_> 4.0f @@>, box 8f + <@@ 2.0 *? Nullable<_> 4.0 @@>, box 8. + <@@ 2m *? Nullable<_> 4m @@>, box 8m + <@@ 2m *? Nullable<_> 4m @@>, box 8m + <@@ 2I *? Nullable<_> 4I @@>, box 8I + <@@ LanguagePrimitives.GenericOne *? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne *? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 2y ?*? Nullable<_> 4y @@>, box 8y + <@@ Nullable<_> 2uy ?*? Nullable<_> 4uy @@>, box 8uy + <@@ Nullable<_> 2s ?*? Nullable<_> 4s @@>, box 8s + <@@ Nullable<_> 2us ?*? Nullable<_> 4us @@>, box 8us + <@@ Nullable<_> 2 ?*? Nullable<_> 4 @@>, box 8 + <@@ Nullable<_> 2u ?*? Nullable<_> 4u @@>, box 8u + <@@ Nullable<_> 2L ?*? Nullable<_> 4L @@>, box 8L + <@@ Nullable<_> 2uL ?*? Nullable<_> 4uL @@>, box 8uL + <@@ Nullable<_> 2.0f ?*? Nullable<_> 4.0f @@>, box 8f + <@@ Nullable<_> 2.0 ?*? Nullable<_> 4.0 @@>, box 8. + <@@ Nullable<_> 2m ?*? Nullable<_> 4m @@>, box 8m + <@@ Nullable<_> 2m ?*? Nullable<_> 4m @@>, box 8m + <@@ Nullable<_> 2I ?*? Nullable<_> 4I @@>, box 8I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?*? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?*? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 6y ?/ 3y @@>, box 2y + <@@ Nullable<_> 6uy ?/ 3uy @@>, box 2uy + <@@ Nullable<_> 6s ?/ 3s @@>, box 2s + <@@ Nullable<_> 6us ?/ 3us @@>, box 2us + <@@ Nullable<_> 6 ?/ 3 @@>, box 2 + <@@ Nullable<_> 6u ?/ 3u @@>, box 2u + <@@ Nullable<_> 6L ?/ 3L @@>, box 2L + <@@ Nullable<_> 6uL ?/ 3uL @@>, box 2uL + <@@ Nullable<_> 6.0f ?/ 3.0f @@>, box 2f + <@@ Nullable<_> 6.0 ?/ 3.0 @@>, box 2. + <@@ Nullable<_> 6m ?/ 3m @@>, box 2m + <@@ Nullable<_> 6m ?/ 3m @@>, box 2m + <@@ Nullable<_> 6I ?/ 3I @@>, box 2I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/ LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/ LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 6y /? Nullable<_> 3y @@>, box 2y + <@@ 6uy /? Nullable<_> 3uy @@>, box 2uy + <@@ 6s /? Nullable<_> 3s @@>, box 2s + <@@ 6us /? Nullable<_> 3us @@>, box 2us + <@@ 6 /? Nullable<_> 3 @@>, box 2 + <@@ 6u /? Nullable<_> 3u @@>, box 2u + <@@ 6L /? Nullable<_> 3L @@>, box 2L + <@@ 6uL /? Nullable<_> 3uL @@>, box 2uL + <@@ 6.0f /? Nullable<_> 3.0f @@>, box 2f + <@@ 6.0 /? Nullable<_> 3.0 @@>, box 2. + <@@ 6m /? Nullable<_> 3m @@>, box 2m + <@@ 6m /? Nullable<_> 3m @@>, box 2m + <@@ 6I /? Nullable<_> 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne /? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne /? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 6y ?/? Nullable<_> 3y @@>, box 2y + <@@ Nullable<_> 6uy ?/? Nullable<_> 3uy @@>, box 2uy + <@@ Nullable<_> 6s ?/? Nullable<_> 3s @@>, box 2s + <@@ Nullable<_> 6us ?/? Nullable<_> 3us @@>, box 2us + <@@ Nullable<_> 6 ?/? Nullable<_> 3 @@>, box 2 + <@@ Nullable<_> 6u ?/? Nullable<_> 3u @@>, box 2u + <@@ Nullable<_> 6L ?/? Nullable<_> 3L @@>, box 2L + <@@ Nullable<_> 6uL ?/? Nullable<_> 3uL @@>, box 2uL + <@@ Nullable<_> 6.0f ?/? Nullable<_> 3.0f @@>, box 2f + <@@ Nullable<_> 6.0 ?/? Nullable<_> 3.0 @@>, box 2. + <@@ Nullable<_> 6m ?/? Nullable<_> 3m @@>, box 2m + <@@ Nullable<_> 6m ?/? Nullable<_> 3m @@>, box 2m + <@@ Nullable<_> 6I ?/? Nullable<_> 3I @@>, box 2I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 9y ?% 4y @@>, box 1y + <@@ Nullable<_> 9uy ?% 4uy @@>, box 1uy + <@@ Nullable<_> 9s ?% 4s @@>, box 1s + <@@ Nullable<_> 9us ?% 4us @@>, box 1us + <@@ Nullable<_> 9 ?% 4 @@>, box 1 + <@@ Nullable<_> 9u ?% 4u @@>, box 1u + <@@ Nullable<_> 9L ?% 4L @@>, box 1L + <@@ Nullable<_> 9uL ?% 4uL @@>, box 1uL + <@@ Nullable<_> 9.0f ?% 4.0f @@>, box 1f + <@@ Nullable<_> 9.0 ?% 4.0 @@>, box 1. + <@@ Nullable<_> 9m ?% 4m @@>, box 1m + <@@ Nullable<_> 9m ?% 4m @@>, box 1m + <@@ Nullable<_> 9I ?% 4I @@>, box 1I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?% LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?% LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 9y %? Nullable<_> 4y @@>, box 1y + <@@ 9uy %? Nullable<_> 4uy @@>, box 1uy + <@@ 9s %? Nullable<_> 4s @@>, box 1s + <@@ 9us %? Nullable<_> 4us @@>, box 1us + <@@ 9 %? Nullable<_> 4 @@>, box 1 + <@@ 9u %? Nullable<_> 4u @@>, box 1u + <@@ 9L %? Nullable<_> 4L @@>, box 1L + <@@ 9uL %? Nullable<_> 4uL @@>, box 1uL + <@@ 9.0f %? Nullable<_> 4.0f @@>, box 1f + <@@ 9.0 %? Nullable<_> 4.0 @@>, box 1. + <@@ 9m %? Nullable<_> 4m @@>, box 1m + <@@ 9m %? Nullable<_> 4m @@>, box 1m + <@@ 9I %? Nullable<_> 4I @@>, box 1I + <@@ LanguagePrimitives.GenericOne %? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne %? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 9y ?%? Nullable<_> 4y @@>, box 1y + <@@ Nullable<_> 9uy ?%? Nullable<_> 4uy @@>, box 1uy + <@@ Nullable<_> 9s ?%? Nullable<_> 4s @@>, box 1s + <@@ Nullable<_> 9us ?%? Nullable<_> 4us @@>, box 1us + <@@ Nullable<_> 9 ?%? Nullable<_> 4 @@>, box 1 + <@@ Nullable<_> 9u ?%? Nullable<_> 4u @@>, box 1u + <@@ Nullable<_> 9L ?%? Nullable<_> 4L @@>, box 1L + <@@ Nullable<_> 9uL ?%? Nullable<_> 4uL @@>, box 1uL + <@@ Nullable<_> 9.0f ?%? Nullable<_> 4.0f @@>, box 1f + <@@ Nullable<_> 9.0 ?%? Nullable<_> 4.0 @@>, box 1. + <@@ Nullable<_> 9m ?%? Nullable<_> 4m @@>, box 1m + <@@ Nullable<_> 9m ?%? Nullable<_> 4m @@>, box 1m + <@@ Nullable<_> 9I ?%? Nullable<_> 4I @@>, box 1I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?%? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?%? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ NonStructuralComparison.(=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(=) 3 3 @@>, box true + <@@ NonStructuralComparison.(=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(<>) 3y 3y @@>, box false + <@@ NonStructuralComparison.(<>) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(<>) 3s 3s @@>, box false + <@@ NonStructuralComparison.(<>) 3us 3us @@>, box false + <@@ NonStructuralComparison.(<>) 3 3 @@>, box false + <@@ NonStructuralComparison.(<>) 3u 3u @@>, box false + <@@ NonStructuralComparison.(<>) 3L 3L @@>, box false + <@@ NonStructuralComparison.(<>) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(<>) '3' '3' @@>, box false + <@@ NonStructuralComparison.(<>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<>) 3f 3f @@>, box false + <@@ NonStructuralComparison.(<>) 3. 3. @@>, box false + <@@ NonStructuralComparison.(<>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<>) 3I 3I @@>, box false + <@@ NonStructuralComparison.(<>) "3" "3" @@>, box false + + <@@ NonStructuralComparison.(<=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(<=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(<=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(<=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(<=) 3 3 @@>, box true + <@@ NonStructuralComparison.(<=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(<=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(<=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(<=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(<=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(<=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(<=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(<=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(<=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(<=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(<=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(<=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(<) 3y 3y @@>, box false + <@@ NonStructuralComparison.(<) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(<) 3s 3s @@>, box false + <@@ NonStructuralComparison.(<) 3us 3us @@>, box false + <@@ NonStructuralComparison.(<) 3 3 @@>, box false + <@@ NonStructuralComparison.(<) 3u 3u @@>, box false + <@@ NonStructuralComparison.(<) 3L 3L @@>, box false + <@@ NonStructuralComparison.(<) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(<) '3' '3' @@>, box false + <@@ NonStructuralComparison.(<) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<) 3f 3f @@>, box false + <@@ NonStructuralComparison.(<) 3. 3. @@>, box false + <@@ NonStructuralComparison.(<) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<) 3I 3I @@>, box false + <@@ NonStructuralComparison.(<) "3" "3" @@>, box false + + <@@ NonStructuralComparison.(>=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(>=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(>=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(>=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(>=) 3 3 @@>, box true + <@@ NonStructuralComparison.(>=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(>=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(>=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(>=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(>=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(>=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(>=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(>=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(>=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(>=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(>=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(>=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(>) 3y 3y @@>, box false + <@@ NonStructuralComparison.(>) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(>) 3s 3s @@>, box false + <@@ NonStructuralComparison.(>) 3us 3us @@>, box false + <@@ NonStructuralComparison.(>) 3 3 @@>, box false + <@@ NonStructuralComparison.(>) 3u 3u @@>, box false + <@@ NonStructuralComparison.(>) 3L 3L @@>, box false + <@@ NonStructuralComparison.(>) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(>) '3' '3' @@>, box false + <@@ NonStructuralComparison.(>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(>) 3f 3f @@>, box false + <@@ NonStructuralComparison.(>) 3. 3. @@>, box false + <@@ NonStructuralComparison.(>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(>) 3I 3I @@>, box false + <@@ NonStructuralComparison.(>) "3" "3" @@>, box false + |] + + tests |> Array.map (fun (test, eval) -> + begin + printfn "--> Checking we can evaluate %A" test + let res = FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test + let b = res = eval + if b then printfn "--- Success, it is %A which is equal to %A" res eval + else printfn "!!! FAILURE, it is %A which is not equal to %A" res eval + b + end + && match test with - | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> - minfo1.IsStatic && - minfo2.IsStatic && - minfo2.Name = minfo1.Name + "$W" && + | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> + minfo1.IsStatic && + minfo2.IsStatic && + minfo2.Name = minfo1.Name + "$W" && (* - (printfn "checking minfo2.GetParameters().Length = %d..." (minfo2.GetParameters().Length); true) && - minfo2.GetParameters().Length = 3 && - (printfn "checking witnessArgs.Length..."; true) && - witnessArgs.Length = 1 && - (printfn "checking args.Length..."; true) && - args.Length = 2 && - (printfn "witnessArgs..."; true) && - (match witnessArgs with [ Lambda _ ] -> true | _ -> false) && - (printfn "args..."; true) && - (match args with [ _; _ ] -> true | _ -> false) - *) - true - | _ -> false)) + (printfn "checking minfo2.GetParameters().Length = %d..." (minfo2.GetParameters().Length); true) && + minfo2.GetParameters().Length = 3 && + (printfn "checking witnessArgs.Length..."; true) && + witnessArgs.Length = 1 && + (printfn "checking args.Length..."; true) && + args.Length = 2 && + (printfn "witnessArgs..."; true) && + (match witnessArgs with [ Lambda _ ] -> true | _ -> false) && + (printfn "args..."; true) && + (match args with [ _; _ ] -> true | _ -> false) + *) + (printfn "<-- Successfully checked with Quotations.Patterns.(|CallWithWitnesses|_|)"; true) + || (printfn "<-- FAILURE, failed after matching with Quotations.Patterns.(|CallWithWitnesses|_|)"; true) + | _ -> + printfn " Array.forall id) // Don't short circuit on a failed test + + test "check non-CallWithWitnesses operators" + (let tests = [| + <@@ LanguagePrimitives.PhysicalEquality [|3|] [|3|] @@>, box false + <@@ let x = [|3|] in LanguagePrimitives.PhysicalEquality x x @@>, box true + <@@ LanguagePrimitives.PhysicalEquality (seq { 3 }) (seq { 3 }) @@>, box false + <@@ let x = seq { 3 } in LanguagePrimitives.PhysicalEquality x x @@>, box true + <@@ LanguagePrimitives.PhysicalEquality (obj()) (obj()) @@>, box false + <@@ let x = obj() in LanguagePrimitives.PhysicalEquality x x @@>, box true + + <@@ 3y = 3y @@>, box true + <@@ 3uy = 3uy @@>, box true + <@@ 3s = 3s @@>, box true + <@@ 3us = 3us @@>, box true + <@@ 3 = 3 @@>, box true + <@@ 3u = 3u @@>, box true + <@@ 3L = 3L @@>, box true + <@@ 3UL = 3UL @@>, box true + <@@ '3' = '3' @@>, box true + <@@ LanguagePrimitives.GenericOne = LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne = LanguagePrimitives.GenericOne @@>, box true + <@@ 3f = 3f @@>, box true + <@@ 3. = 3. @@>, box true + <@@ 3m = 3m @@>, box true + <@@ 3m = 3m @@>, box true + <@@ 3I = 3I @@>, box true + <@@ "3" = "3" @@>, box true + <@@ [3] = [3] @@>, box true + <@@ [|3|] = [|3|] @@>, box true + <@@ seq { 3 } = seq { 3 } @@>, box false // Reference equality + <@@ let x = seq { 3 } in x = x @@>, box true + <@@ obj() = obj() @@>, box false + <@@ let x = obj() in x = x @@>, box true + + <@@ 3y <> 3y @@>, box false + <@@ 3uy <> 3uy @@>, box false + <@@ 3s <> 3s @@>, box false + <@@ 3us <> 3us @@>, box false + <@@ 3 <> 3 @@>, box false + <@@ 3u <> 3u @@>, box false + <@@ 3L <> 3L @@>, box false + <@@ 3UL <> 3UL @@>, box false + <@@ '3' <> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne <> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne <> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f <> 3f @@>, box false + <@@ 3. <> 3. @@>, box false + <@@ 3m <> 3m @@>, box false + <@@ 3m <> 3m @@>, box false + <@@ 3I <> 3I @@>, box false + <@@ "3" <> "3" @@>, box false + <@@ [3] <> [3] @@>, box false + <@@ [|3|] <> [|3|] @@>, box false + <@@ seq { 3 } <> seq { 3 } @@>, box true // Reference equality + <@@ let x = seq { 3 } in x <> x @@>, box false + <@@ obj() <> obj() @@>, box true + <@@ let x = obj() in x <> x @@>, box false + + <@@ 3y <= 3y @@>, box true + <@@ 3uy <= 3uy @@>, box true + <@@ 3s <= 3s @@>, box true + <@@ 3us <= 3us @@>, box true + <@@ 3 <= 3 @@>, box true + <@@ 3u <= 3u @@>, box true + <@@ 3L <= 3L @@>, box true + <@@ 3UL <= 3UL @@>, box true + <@@ '3' <= '3' @@>, box true + <@@ LanguagePrimitives.GenericOne <= LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne <= LanguagePrimitives.GenericOne @@>, box true + <@@ 3f <= 3f @@>, box true + <@@ 3. <= 3. @@>, box true + <@@ 3m <= 3m @@>, box true + <@@ 3m <= 3m @@>, box true + <@@ 3I <= 3I @@>, box true + <@@ "3" <= "3" @@>, box true + <@@ [3] <= [3] @@>, box true + <@@ [|3|] <= [|3|] @@>, box true + + <@@ 3y < 3y @@>, box false + <@@ 3uy < 3uy @@>, box false + <@@ 3s < 3s @@>, box false + <@@ 3us < 3us @@>, box false + <@@ 3 < 3 @@>, box false + <@@ 3u < 3u @@>, box false + <@@ 3L < 3L @@>, box false + <@@ 3UL < 3UL @@>, box false + <@@ '3' < '3' @@>, box false + <@@ LanguagePrimitives.GenericOne < LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne < LanguagePrimitives.GenericOne @@>, box false + <@@ 3f < 3f @@>, box false + <@@ 3. < 3. @@>, box false + <@@ 3m < 3m @@>, box false + <@@ 3m < 3m @@>, box false + <@@ 3I < 3I @@>, box false + <@@ "3" < "3" @@>, box false + <@@ [3] < [3] @@>, box false + <@@ [|3|] < [|3|] @@>, box false + + <@@ 3y >= 3y @@>, box true + <@@ 3uy >= 3uy @@>, box true + <@@ 3s >= 3s @@>, box true + <@@ 3us >= 3us @@>, box true + <@@ 3 >= 3 @@>, box true + <@@ 3u >= 3u @@>, box true + <@@ 3L >= 3L @@>, box true + <@@ 3UL >= 3UL @@>, box true + <@@ '3' >= '3' @@>, box true + <@@ LanguagePrimitives.GenericOne >= LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne >= LanguagePrimitives.GenericOne @@>, box true + <@@ 3f >= 3f @@>, box true + <@@ 3. >= 3. @@>, box true + <@@ 3m >= 3m @@>, box true + <@@ 3m >= 3m @@>, box true + <@@ 3I >= 3I @@>, box true + <@@ "3" >= "3" @@>, box true + <@@ [3] >= [3] @@>, box true + <@@ [|3|] >= [|3|] @@>, box true + + <@@ 3y > 3y @@>, box false + <@@ 3uy > 3uy @@>, box false + <@@ 3s > 3s @@>, box false + <@@ 3us > 3us @@>, box false + <@@ 3 > 3 @@>, box false + <@@ 3u > 3u @@>, box false + <@@ 3L > 3L @@>, box false + <@@ 3UL > 3UL @@>, box false + <@@ '3' > '3' @@>, box false + <@@ LanguagePrimitives.GenericOne > LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne > LanguagePrimitives.GenericOne @@>, box false + <@@ 3f > 3f @@>, box false + <@@ 3. > 3. @@>, box false + <@@ 3m > 3m @@>, box false + <@@ 3m > 3m @@>, box false + <@@ 3I > 3I @@>, box false + <@@ "3" > "3" @@>, box false + <@@ [3] > [3] @@>, box false + <@@ [|3|] > [|3|] @@>, box false + + <@@ Nullable<_> 1y ?= 1y @@>, box true + <@@ Nullable<_> 1uy ?= 1uy @@>, box true + <@@ Nullable<_> 1s ?= 1s @@>, box true + <@@ Nullable<_> 1us ?= 1us @@>, box true + <@@ Nullable<_> 1 ?= 1 @@>, box true + <@@ Nullable<_> 1u ?= 1u @@>, box true + <@@ Nullable<_> 1L ?= 1L @@>, box true + <@@ Nullable<_> 1uL ?= 1uL @@>, box true + <@@ Nullable<_> 1.0f ?= 1.0f @@>, box true + <@@ Nullable<_> 1.0 ?= 1.0 @@>, box true + <@@ Nullable<_> 1m ?= 1m @@>, box true + <@@ Nullable<_> 1m ?= 1m @@>, box true + <@@ Nullable<_> 1I ?= 1I @@>, box true + <@@ Nullable<_> '1' ?= '1' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?= LanguagePrimitives.GenericOne @@>, box true + + <@@ 1y =? Nullable<_> 1y @@>, box true + <@@ 1uy =? Nullable<_> 1uy @@>, box true + <@@ 1s =? Nullable<_> 1s @@>, box true + <@@ 1us =? Nullable<_> 1us @@>, box true + <@@ 1 =? Nullable<_> 1 @@>, box true + <@@ 1u =? Nullable<_> 1u @@>, box true + <@@ 1L =? Nullable<_> 1L @@>, box true + <@@ 1uL =? Nullable<_> 1uL @@>, box true + <@@ 1.0f =? Nullable<_> 1.0f @@>, box true + <@@ 1.0 =? Nullable<_> 1.0 @@>, box true + <@@ 1m =? Nullable<_> 1m @@>, box true + <@@ 1m =? Nullable<_> 1m @@>, box true + <@@ 1I =? Nullable<_> 1I @@>, box true + <@@ '1' =? Nullable<_> '1' @@>, box true + <@@ LanguagePrimitives.GenericOne =? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne =? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + + <@@ Nullable<_> 1y ?=? Nullable<_> 1y @@>, box true + <@@ Nullable<_> 1uy ?=? Nullable<_> 1uy @@>, box true + <@@ Nullable<_> 1s ?=? Nullable<_> 1s @@>, box true + <@@ Nullable<_> 1us ?=? Nullable<_> 1us @@>, box true + <@@ Nullable<_> 1 ?=? Nullable<_> 1 @@>, box true + <@@ Nullable<_> 1u ?=? Nullable<_> 1u @@>, box true + <@@ Nullable<_> 1L ?=? Nullable<_> 1L @@>, box true + <@@ Nullable<_> 1uL ?=? Nullable<_> 1uL @@>, box true + <@@ Nullable<_> 1.0f ?=? Nullable<_> 1.0f @@>, box true + <@@ Nullable<_> 1.0 ?=? Nullable<_> 1.0 @@>, box true + <@@ Nullable<_> 1m ?=? Nullable<_> 1m @@>, box true + <@@ Nullable<_> 1m ?=? Nullable<_> 1m @@>, box true + <@@ Nullable<_> 1I ?=? Nullable<_> 1I @@>, box true + <@@ Nullable<_> '1' ?=? Nullable<_> '1' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + + <@@ Nullable<_> 3y ?<> 3y @@>, box false + <@@ Nullable<_> 3uy ?<> 3uy @@>, box false + <@@ Nullable<_> 3s ?<> 3s @@>, box false + <@@ Nullable<_> 3us ?<> 3us @@>, box false + <@@ Nullable<_> 3 ?<> 3 @@>, box false + <@@ Nullable<_> 3u ?<> 3u @@>, box false + <@@ Nullable<_> 3L ?<> 3L @@>, box false + <@@ Nullable<_> 3UL ?<> 3UL @@>, box false + <@@ Nullable<_> '3' ?<> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?<> 3f @@>, box false + <@@ Nullable<_> 3. ?<> 3. @@>, box false + <@@ Nullable<_> 3m ?<> 3m @@>, box false + <@@ Nullable<_> 3m ?<> 3m @@>, box false + <@@ Nullable<_> 3I ?<> 3I @@>, box false + + <@@ 3y <>? Nullable<_> 3y @@>, box false + <@@ 3uy <>? Nullable<_> 3uy @@>, box false + <@@ 3s <>? Nullable<_> 3s @@>, box false + <@@ 3us <>? Nullable<_> 3us @@>, box false + <@@ 3 <>? Nullable<_> 3 @@>, box false + <@@ 3u <>? Nullable<_> 3u @@>, box false + <@@ 3L <>? Nullable<_> 3L @@>, box false + <@@ 3UL <>? Nullable<_> 3UL @@>, box false + <@@ '3' <>? Nullable<_> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne <>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne <>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f <>? Nullable<_> 3f @@>, box false + <@@ 3. <>? Nullable<_> 3. @@>, box false + <@@ 3m <>? Nullable<_> 3m @@>, box false + <@@ 3m <>? Nullable<_> 3m @@>, box false + <@@ 3I <>? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?<>? Nullable<_> 3y @@>, box false + <@@ Nullable<_> 3uy ?<>? Nullable<_> 3uy @@>, box false + <@@ Nullable<_> 3s ?<>? Nullable<_> 3s @@>, box false + <@@ Nullable<_> 3us ?<>? Nullable<_> 3us @@>, box false + <@@ Nullable<_> 3 ?<>? Nullable<_> 3 @@>, box false + <@@ Nullable<_> 3u ?<>? Nullable<_> 3u @@>, box false + <@@ Nullable<_> 3L ?<>? Nullable<_> 3L @@>, box false + <@@ Nullable<_> 3UL ?<>? Nullable<_> 3UL @@>, box false + <@@ Nullable<_> '3' ?<>? Nullable<_> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?<>? Nullable<_> 3f @@>, box false + <@@ Nullable<_> 3. ?<>? Nullable<_> 3. @@>, box false + <@@ Nullable<_> 3m ?<>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3m ?<>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3I ?<>? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?<= 3y @@>, box true + <@@ Nullable<_> 3uy ?<= 3uy @@>, box true + <@@ Nullable<_> 3s ?<= 3s @@>, box true + <@@ Nullable<_> 3us ?<= 3us @@>, box true + <@@ Nullable<_> 3 ?<= 3 @@>, box true + <@@ Nullable<_> 3u ?<= 3u @@>, box true + <@@ Nullable<_> 3L ?<= 3L @@>, box true + <@@ Nullable<_> 3UL ?<= 3UL @@>, box true + <@@ Nullable<_> '3' ?<= '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?<= 3f @@>, box true + <@@ Nullable<_> 3. ?<= 3. @@>, box true + <@@ Nullable<_> 3m ?<= 3m @@>, box true + <@@ Nullable<_> 3m ?<= 3m @@>, box true + <@@ Nullable<_> 3I ?<= 3I @@>, box true + + <@@ 3y <=? Nullable<_> 3y @@>, box true + <@@ 3uy <=? Nullable<_> 3uy @@>, box true + <@@ 3s <=? Nullable<_> 3s @@>, box true + <@@ 3us <=? Nullable<_> 3us @@>, box true + <@@ 3 <=? Nullable<_> 3 @@>, box true + <@@ 3u <=? Nullable<_> 3u @@>, box true + <@@ 3L <=? Nullable<_> 3L @@>, box true + <@@ 3UL <=? Nullable<_> 3UL @@>, box true + <@@ '3' <=? Nullable<_> '3' @@>, box true + <@@ LanguagePrimitives.GenericOne <=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne <=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ 3f <=? Nullable<_> 3f @@>, box true + <@@ 3. <=? Nullable<_> 3. @@>, box true + <@@ 3m <=? Nullable<_> 3m @@>, box true + <@@ 3m <=? Nullable<_> 3m @@>, box true + <@@ 3I <=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?<=? Nullable<_> 3y @@>, box true + <@@ Nullable<_> 3uy ?<=? Nullable<_> 3uy @@>, box true + <@@ Nullable<_> 3s ?<=? Nullable<_> 3s @@>, box true + <@@ Nullable<_> 3us ?<=? Nullable<_> 3us @@>, box true + <@@ Nullable<_> 3 ?<=? Nullable<_> 3 @@>, box true + <@@ Nullable<_> 3u ?<=? Nullable<_> 3u @@>, box true + <@@ Nullable<_> 3L ?<=? Nullable<_> 3L @@>, box true + <@@ Nullable<_> 3UL ?<=? Nullable<_> 3UL @@>, box true + <@@ Nullable<_> '3' ?<=? Nullable<_> '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?<=? Nullable<_> 3f @@>, box true + <@@ Nullable<_> 3. ?<=? Nullable<_> 3. @@>, box true + <@@ Nullable<_> 3m ?<=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3m ?<=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3I ?<=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?< 3y @@>, box false + <@@ Nullable<_> 3uy ?< 3uy @@>, box false + <@@ Nullable<_> 3s ?< 3s @@>, box false + <@@ Nullable<_> 3us ?< 3us @@>, box false + <@@ Nullable<_> 3 ?< 3 @@>, box false + <@@ Nullable<_> 3u ?< 3u @@>, box false + <@@ Nullable<_> 3L ?< 3L @@>, box false + <@@ Nullable<_> 3UL ?< 3UL @@>, box false + <@@ Nullable<_> '3' ?< '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?< LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?< LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?< 3f @@>, box false + <@@ Nullable<_> 3. ?< 3. @@>, box false + <@@ Nullable<_> 3m ?< 3m @@>, box false + <@@ Nullable<_> 3m ?< 3m @@>, box false + <@@ Nullable<_> 3I ?< 3I @@>, box false + + <@@ 3y 3y @@>, box false + <@@ 3uy 3uy @@>, box false + <@@ 3s 3s @@>, box false + <@@ 3us 3us @@>, box false + <@@ 3 3 @@>, box false + <@@ 3u 3u @@>, box false + <@@ 3L 3L @@>, box false + <@@ 3UL 3UL @@>, box false + <@@ '3' '3' @@>, box false + <@@ LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ 3f 3f @@>, box false + <@@ 3. 3. @@>, box false + <@@ 3m 3m @@>, box false + <@@ 3m 3m @@>, box false + <@@ 3I 3I @@>, box false + + <@@ Nullable<_> 3y ? 3y @@>, box false + <@@ Nullable<_> 3uy ? 3uy @@>, box false + <@@ Nullable<_> 3s ? 3s @@>, box false + <@@ Nullable<_> 3us ? 3us @@>, box false + <@@ Nullable<_> 3 ? 3 @@>, box false + <@@ Nullable<_> 3u ? 3u @@>, box false + <@@ Nullable<_> 3L ? 3L @@>, box false + <@@ Nullable<_> 3UL ? 3UL @@>, box false + <@@ Nullable<_> '3' ? '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ? LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ? LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ? 3f @@>, box false + <@@ Nullable<_> 3. ? 3. @@>, box false + <@@ Nullable<_> 3m ? 3m @@>, box false + <@@ Nullable<_> 3m ? 3m @@>, box false + <@@ Nullable<_> 3I ? 3I @@>, box false + + <@@ Nullable<_> 3y ?>= 3y @@>, box true + <@@ Nullable<_> 3uy ?>= 3uy @@>, box true + <@@ Nullable<_> 3s ?>= 3s @@>, box true + <@@ Nullable<_> 3us ?>= 3us @@>, box true + <@@ Nullable<_> 3 ?>= 3 @@>, box true + <@@ Nullable<_> 3u ?>= 3u @@>, box true + <@@ Nullable<_> 3L ?>= 3L @@>, box true + <@@ Nullable<_> 3UL ?>= 3UL @@>, box true + <@@ Nullable<_> '3' ?>= '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?>= 3f @@>, box true + <@@ Nullable<_> 3. ?>= 3. @@>, box true + <@@ Nullable<_> 3m ?>= 3m @@>, box true + <@@ Nullable<_> 3m ?>= 3m @@>, box true + <@@ Nullable<_> 3I ?>= 3I @@>, box true + + <@@ 3y >=? Nullable<_> 3y @@>, box true + <@@ 3uy >=? Nullable<_> 3uy @@>, box true + <@@ 3s >=? Nullable<_> 3s @@>, box true + <@@ 3us >=? Nullable<_> 3us @@>, box true + <@@ 3 >=? Nullable<_> 3 @@>, box true + <@@ 3u >=? Nullable<_> 3u @@>, box true + <@@ 3L >=? Nullable<_> 3L @@>, box true + <@@ 3UL >=? Nullable<_> 3UL @@>, box true + <@@ '3' >=? Nullable<_> '3' @@>, box true + <@@ LanguagePrimitives.GenericOne >=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne >=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ 3f >=? Nullable<_> 3f @@>, box true + <@@ 3. >=? Nullable<_> 3. @@>, box true + <@@ 3m >=? Nullable<_> 3m @@>, box true + <@@ 3m >=? Nullable<_> 3m @@>, box true + <@@ 3I >=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?>=? Nullable<_> 3y @@>, box true + <@@ Nullable<_> 3uy ?>=? Nullable<_> 3uy @@>, box true + <@@ Nullable<_> 3s ?>=? Nullable<_> 3s @@>, box true + <@@ Nullable<_> 3us ?>=? Nullable<_> 3us @@>, box true + <@@ Nullable<_> 3 ?>=? Nullable<_> 3 @@>, box true + <@@ Nullable<_> 3u ?>=? Nullable<_> 3u @@>, box true + <@@ Nullable<_> 3L ?>=? Nullable<_> 3L @@>, box true + <@@ Nullable<_> 3UL ?>=? Nullable<_> 3UL @@>, box true + <@@ Nullable<_> '3' ?>=? Nullable<_> '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?>=? Nullable<_> 3f @@>, box true + <@@ Nullable<_> 3. ?>=? Nullable<_> 3. @@>, box true + <@@ Nullable<_> 3m ?>=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3m ?>=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3I ?>=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?> 3y @@>, box false + <@@ Nullable<_> 3uy ?> 3uy @@>, box false + <@@ Nullable<_> 3s ?> 3s @@>, box false + <@@ Nullable<_> 3us ?> 3us @@>, box false + <@@ Nullable<_> 3 ?> 3 @@>, box false + <@@ Nullable<_> 3u ?> 3u @@>, box false + <@@ Nullable<_> 3L ?> 3L @@>, box false + <@@ Nullable<_> 3UL ?> 3UL @@>, box false + <@@ Nullable<_> '3' ?> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?> 3f @@>, box false + <@@ Nullable<_> 3. ?> 3. @@>, box false + <@@ Nullable<_> 3m ?> 3m @@>, box false + <@@ Nullable<_> 3m ?> 3m @@>, box false + <@@ Nullable<_> 3I ?> 3I @@>, box false + + <@@ 3y >? Nullable<_> 3y @@>, box false + <@@ 3uy >? Nullable<_> 3uy @@>, box false + <@@ 3s >? Nullable<_> 3s @@>, box false + <@@ 3us >? Nullable<_> 3us @@>, box false + <@@ 3 >? Nullable<_> 3 @@>, box false + <@@ 3u >? Nullable<_> 3u @@>, box false + <@@ 3L >? Nullable<_> 3L @@>, box false + <@@ 3UL >? Nullable<_> 3UL @@>, box false + <@@ '3' >? Nullable<_> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne >? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne >? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f >? Nullable<_> 3f @@>, box false + <@@ 3. >? Nullable<_> 3. @@>, box false + <@@ 3m >? Nullable<_> 3m @@>, box false + <@@ 3m >? Nullable<_> 3m @@>, box false + <@@ 3I >? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?>? Nullable<_> 3y @@>, box false + <@@ Nullable<_> 3uy ?>? Nullable<_> 3uy @@>, box false + <@@ Nullable<_> 3s ?>? Nullable<_> 3s @@>, box false + <@@ Nullable<_> 3us ?>? Nullable<_> 3us @@>, box false + <@@ Nullable<_> 3 ?>? Nullable<_> 3 @@>, box false + <@@ Nullable<_> 3u ?>? Nullable<_> 3u @@>, box false + <@@ Nullable<_> 3L ?>? Nullable<_> 3L @@>, box false + <@@ Nullable<_> 3UL ?>? Nullable<_> 3UL @@>, box false + <@@ Nullable<_> '3' ?>? Nullable<_> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?>? Nullable<_> 3f @@>, box false + <@@ Nullable<_> 3. ?>? Nullable<_> 3. @@>, box false + <@@ Nullable<_> 3m ?>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3m ?>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3I ?>? Nullable<_> 3I @@>, box false + |] + tests |> Array.map (fun (test, eval) -> + begin + printfn "--> Checking we can evaluate %A" test + let res = FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test + let b = res = eval + if b then printfn "--- Success, it is %A which is equal to %A" res eval + else printfn "!!! FAILURE, it is %A which is not equal to %A" res eval + b + end + && + match test with + | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> + printfn " + printfn "<-- Success, it did not match Quotations.Patterns.(|CallWithWitnesses|_|)" + true) |> Array.forall id) // Don't short circuit on a failed test module MoreWitnessTests = open System.Runtime.CompilerServices diff --git a/tests/fsharp/tools/eval/test.fsx b/tests/fsharp/tools/eval/test.fsx index a289c17794a..f6a669653ce 100644 --- a/tests/fsharp/tools/eval/test.fsx +++ b/tests/fsharp/tools/eval/test.fsx @@ -1236,6 +1236,7 @@ module EvaluationTests = check "vroievr097q" (LanguagePrimitives.AdditionDynamic 3.0 4.0) 7.0 check "vroievr097w" (LanguagePrimitives.AdditionDynamic 3.0f 4.0f) 7.0f check "vroievr097e" (LanguagePrimitives.AdditionDynamic 3.0M 4.0M) 7.0M + check "vroievr097n" (LanguagePrimitives.AdditionDynamic '3' '\004') '7' check "vroievr097r" (LanguagePrimitives.CheckedAdditionDynamic 3y 4y) 7y check "vroievr097t" (LanguagePrimitives.CheckedAdditionDynamic 3s 4s) 7s @@ -1250,6 +1251,37 @@ module EvaluationTests = check "vroievr097f" (LanguagePrimitives.CheckedAdditionDynamic 3.0 4.0) 7.0 check "vroievr097g" (LanguagePrimitives.CheckedAdditionDynamic 3.0f 4.0f) 7.0f check "vroievr097h" (LanguagePrimitives.CheckedAdditionDynamic 3.0M 4.0M) 7.0M + check "vroievr097u" (LanguagePrimitives.CheckedAdditionDynamic '3' '\004') '7' + + check "vroievr0981" (LanguagePrimitives.SubtractionDynamic 7y 4y) 3y + check "vroievr0982" (LanguagePrimitives.SubtractionDynamic 7s 4s) 3s + check "vroievr0983" (LanguagePrimitives.SubtractionDynamic 7 4) 3 + check "vroievr0984" (LanguagePrimitives.SubtractionDynamic 7L 4L) 3L + check "vroievr0985" (LanguagePrimitives.SubtractionDynamic 7n 4n) 3n + check "vroievr0986" (LanguagePrimitives.SubtractionDynamic 7uy 4uy) 3uy + check "vroievr0987" (LanguagePrimitives.SubtractionDynamic 7us 4us) 3us + check "vroievr0988" (LanguagePrimitives.SubtractionDynamic 7u 4u) 3u + check "vroievr0989" (LanguagePrimitives.SubtractionDynamic 7UL 4UL) 3UL + check "vroievr0980" (LanguagePrimitives.SubtractionDynamic 7un 4un) 3un + check "vroievr098q" (LanguagePrimitives.SubtractionDynamic 7.0 4.0) 3.0 + check "vroievr098w" (LanguagePrimitives.SubtractionDynamic 7.0f 4.0f) 3.0f + check "vroievr098e" (LanguagePrimitives.SubtractionDynamic 7.0M 4.0M) 3.0M + check "vroievr098n" (LanguagePrimitives.SubtractionDynamic '7' '\004') '3' + + check "vroievr098r" (LanguagePrimitives.CheckedSubtractionDynamic 7y 4y) 3y + check "vroievr098t" (LanguagePrimitives.CheckedSubtractionDynamic 7s 4s) 3s + check "vroievr098y" (LanguagePrimitives.CheckedSubtractionDynamic 7 4) 3 + check "vroievr098u" (LanguagePrimitives.CheckedSubtractionDynamic 7L 4L) 3L + check "vroievr098i" (LanguagePrimitives.CheckedSubtractionDynamic 7n 4n) 3n + check "vroievr098o" (LanguagePrimitives.CheckedSubtractionDynamic 7uy 4uy) 3uy + check "vroievr098p" (LanguagePrimitives.CheckedSubtractionDynamic 7us 4us) 3us + check "vroievr098a" (LanguagePrimitives.CheckedSubtractionDynamic 7u 4u) 3u + check "vroievr098s" (LanguagePrimitives.CheckedSubtractionDynamic 7UL 4UL) 3UL + check "vroievr098d" (LanguagePrimitives.CheckedSubtractionDynamic 7un 4un) 3un + check "vroievr098f" (LanguagePrimitives.CheckedSubtractionDynamic 7.0 4.0) 3.0 + check "vroievr098g" (LanguagePrimitives.CheckedSubtractionDynamic 7.0f 4.0f) 3.0f + check "vroievr098h" (LanguagePrimitives.CheckedSubtractionDynamic 7.0M 4.0M) 3.0M + check "vroievr098u" (LanguagePrimitives.CheckedSubtractionDynamic '7' '\004') '3' check "vroievr0912q" (LanguagePrimitives.MultiplyDynamic 3y 4y) 12y check "vroievr0912w" (LanguagePrimitives.MultiplyDynamic 3s 4s) 12s @@ -1265,7 +1297,6 @@ module EvaluationTests = check "vroievr0912s" (LanguagePrimitives.MultiplyDynamic 3.0f 4.0f) 12.0f check "vroievr0912d" (LanguagePrimitives.MultiplyDynamic 3.0M 4.0M) 12.0M - check "vroievr0912f" (LanguagePrimitives.CheckedMultiplyDynamic 3y 4y) 12y check "vroievr0912g" (LanguagePrimitives.CheckedMultiplyDynamic 3s 4s) 12s check "vroievr0912h" (LanguagePrimitives.CheckedMultiplyDynamic 3 4) 12 diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 05b42f7a67d..9a1f6d6bb56 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1184,7 +1184,7 @@ let ``Test Operator Declarations for Byte`` () = [], "let testByteAdditionChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2)) @ (24,53--24,70)" [], "let testByteSubtractionChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2)) @ (25,53--25,70)" [], "let testByteMultiplyChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Multiply (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2)) @ (26,53--26,70)" - [], "let testByteToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,43--29,58)" + [], "let testByteToByteChecked(e1) = e1 @ (29,56--29,58)" [], "let testByteToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,43--30,59)" [], "let testByteToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,43--31,59)" [], "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" @@ -1195,7 +1195,7 @@ let ``Test Operator Declarations for Byte`` () = [], "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,43--37,60)" [], "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,43--38,63)" [], "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,43--39,64)" - [], "let testByteToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,43--41,50)" + [], "let testByteToByteOperator(e1) = e1 @ (41,48--41,50)" [], "let testByteToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,43--42,51)" [], "let testByteToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,43--43,51)" [], "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,43--44,52)" @@ -1296,7 +1296,7 @@ let ``Test Operator Declarations for SByte`` () = [], "let testSByteMultiplyChecked(e1) (e2) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Multiply (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2)) @ (26,56--26,73)" [], "let testSByteUnaryNegChecked(e1) = Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),0,e1) @ (27,45--27,60)" [], "let testSByteToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,45--29,60)" - [], "let testSByteToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" + [], "let testSByteToSByteChecked(e1) = e1 @ (30,59--30,61)" [], "let testSByteToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" [], "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" [], "let testSByteToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" @@ -1307,7 +1307,7 @@ let ``Test Operator Declarations for SByte`` () = [], "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,45--38,65)" [], "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" [], "let testSByteToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,45--41,52)" - [], "let testSByteToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,45--42,53)" + [], "let testSByteToSByteOperator(e1) = e1 @ (42,51--42,53)" [], "let testSByteToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,45--43,53)" [], "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,45--44,54)" [], "let testSByteToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" @@ -1406,7 +1406,7 @@ let ``Test Operator Declarations for Int16`` () = [], "let testInt16UnaryNegChecked(e1) = Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),0,e1) @ (27,45--27,60)" [], "let testInt16ToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,45--29,60)" [], "let testInt16ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" - [], "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" + [], "let testInt16ToInt16Checked(e1) = e1 @ (31,59--31,61)" [], "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" [], "let testInt16ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" [], "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" @@ -1417,7 +1417,7 @@ let ``Test Operator Declarations for Int16`` () = [], "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" [], "let testInt16ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,45--41,52)" [], "let testInt16ToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,45--42,53)" - [], "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,45--43,53)" + [], "let testInt16ToInt16Operator(e1) = e1 @ (43,51--43,53)" [], "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,45--44,54)" [], "let testInt16ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" [], "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,45--46,53)" @@ -1515,7 +1515,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,47--29,62)" [], "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,47--30,63)" [], "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,47--31,63)" - [], "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,47--32,64)" + [], "let testUInt16ToUInt16Checked(e1) = e1 @ (32,62--32,64)" [], "let testUInt16ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,47--33,61)" [], "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" [], "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" @@ -1526,7 +1526,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,47--41,54)" [], "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,47--42,55)" [], "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,47--43,55)" - [], "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,47--44,56)" + [], "let testUInt16ToUInt16Operator(e1) = e1 @ (44,54--44,56)" [], "let testUInt16ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,47--45,53)" [], "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,47--46,55)" [], "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,47--47,56)" @@ -1537,7 +1537,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (52,47--52,57)" [], "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (53,47--53,55)" [], "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)" - [], "let testUInt16ToCharOperator(e1) = Operators.ToChar (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,47--55,54)" + [], "let testUInt16ToCharOperator(e1) = e1 @ (55,47--55,54)" [FC47; FC50], "let testUInt16ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint16 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] @@ -1625,8 +1625,8 @@ let ``Test Operator Declarations for Int`` () = [], "let testIntToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,41--30,57)" [], "let testIntToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,41--31,57)" [], "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,41--32,58)" - [], "let testIntToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,41--33,55)" - [], "let testIntToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,41--34,57)" + [], "let testIntToIntChecked(e1) = e1 @ (33,53--33,55)" + [], "let testIntToInt32Checked(e1) = e1 @ (34,55--34,57)" [], "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,41--35,58)" [], "let testIntToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,41--36,57)" [], "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,41--37,58)" @@ -1734,8 +1734,8 @@ let ``Test Operator Declarations for Int32`` () = [], "let testInt32ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" [], "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" [], "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" - [], "let testInt32ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" - [], "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" + [], "let testInt32ToIntChecked(e1) = e1 @ (33,57--33,59)" + [], "let testInt32ToInt32Checked(e1) = e1 @ (34,59--34,61)" [], "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,45--35,62)" [], "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,45--36,61)" [], "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,45--37,62)" @@ -1845,7 +1845,7 @@ let ``Test Operator Declarations for UInt32`` () = [], "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,47--32,64)" [], "let testUInt32ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,47--33,61)" [], "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" - [], "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" + [], "let testUInt32ToUInt32Checked(e1) = e1 @ (35,62--35,64)" [], "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,47--36,63)" [], "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,47--37,64)" [], "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,47--38,67)" @@ -1856,7 +1856,7 @@ let ``Test Operator Declarations for UInt32`` () = [], "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,47--44,56)" [], "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,47--45,53)" [], "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,47--46,55)" - [], "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,47--47,56)" + [], "let testUInt32ToUInt32Operator(e1) = e1 @ (47,54--47,56)" [], "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,47--48,55)" [], "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,47--49,56)" [], "let testUInt32ToIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,47--50,59)" @@ -1955,7 +1955,7 @@ let ``Test Operator Declarations for Int64`` () = [], "let testInt64ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" [], "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" [], "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,45--35,62)" - [], "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,45--36,61)" + [], "let testInt64ToInt64Checked(e1) = e1 @ (36,59--36,61)" [], "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,45--37,62)" [], "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,45--38,65)" [], "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" @@ -1966,7 +1966,7 @@ let ``Test Operator Declarations for Int64`` () = [], "let testInt64ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" [], "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,45--46,53)" [], "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,45--47,54)" - [], "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,45--48,53)" + [], "let testInt64ToInt64Operator(e1) = e1 @ (48,51--48,53)" [], "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,45--49,54)" [], "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,45--50,57)" [], "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,45--51,58)" @@ -2065,7 +2065,7 @@ let ``Test Operator Declarations for UInt64`` () = [], "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" [], "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" [], "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,47--36,63)" - [], "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,47--37,64)" + [], "let testUInt64ToUInt64Checked(e1) = e1 @ (37,62--37,64)" [], "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,47--38,67)" [], "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,47--39,68)" [], "let testUInt64ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,47--41,54)" @@ -2175,7 +2175,7 @@ let ``Test Operator Declarations for IntPtr`` () = [], "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,50--35,67)" [], "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,50--36,66)" [], "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,50--37,67)" - [], "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,50--38,70)" + [], "let testIntPtrToIntPtrChecked(e1) = e1 @ (38,68--38,70)" [], "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,50--39,71)" [], "let testIntPtrToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,50--41,57)" [], "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,50--42,58)" @@ -2186,7 +2186,7 @@ let ``Test Operator Declarations for IntPtr`` () = [], "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,50--47,59)" [], "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,50--48,58)" [], "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,50--49,59)" - [], "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,50--50,62)" + [], "let testIntPtrToIntPtrOperator(e1) = e1 @ (50,60--50,62)" [], "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,50--51,63)" [], "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,50--52,60)" [], "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,50--53,58)" @@ -2284,7 +2284,7 @@ let ``Test Operator Declarations for UIntPtr`` () = [], "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,52--36,68)" [], "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,52--37,69)" [], "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,52--38,72)" - [], "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,52--39,73)" + [], "let testUIntPtrToUIntPtrChecked(e1) = e1 @ (39,71--39,73)" [], "let testUIntPtrToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,52--41,59)" [], "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,52--42,60)" [], "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,52--43,60)" @@ -2870,7 +2870,7 @@ let ``Test Operator Declarations for Char`` () = [], "let testCharToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,43--29,58)" [], "let testCharToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,43--30,59)" [], "let testCharToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,43--31,59)" - [], "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" + [], "let testCharToUInt16Checked(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" [], "let testCharToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,43--33,57)" [], "let testCharToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,43--34,59)" [], "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,43--35,60)" @@ -2891,7 +2891,7 @@ let ``Test Operator Declarations for Char`` () = [], "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,43--51,56)" [], "let testCharToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (52,43--52,53)" [], "let testCharToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (53,43--53,51)" - [], "let testCharToCharOperator(e1) = Operators.ToChar (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,43--55,50)" + [], "let testCharToCharOperator(e1) = e1 @ (55,48--55,50)" [FC47; FC50], "let testCharToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.char = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] From 205b9a8908e71e5c158cc211af41b3bc7b1c1cf3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 12 Jul 2022 16:48:04 +0100 Subject: [PATCH 036/226] Mark backing fields as CompilerGenerated (fixes serialization of fields in FSI multiemit) (#13494) --- VisualFSharp.sln | 10 +- src/Compiler/CodeGen/IlxGen.fs | 8 +- .../GenericComparison/Compare06.fsx.il.bsl | 2 + .../GenericComparison/Equals05.fsx.il.bsl | 2 + .../GenericComparison/Hash08.fsx.il.bsl | 2 + .../EmittedIL/Misc/AnonRecd.fs.il.bsl | 2 + .../TestFunction17.fs.il.debug.bsl | 2 + .../TestFunction17.fs.il.release.bsl | 2 + .../TestFunction24.fs.il.debug.bsl | 2 + .../TestFunction24.fs.il.release.bsl | 2 + tests/FSharp.Test.Utilities/TestFramework.fs | 4 +- .../core/printing/output.1000.stdout.bsl | 53 +++++++++ .../core/printing/output.200.stdout.bsl | 53 +++++++++ .../fsharp/core/printing/output.47.stderr.bsl | 108 ++++++++++++++++++ .../fsharp/core/printing/output.47.stdout.bsl | 2 +- .../core/printing/output.multiemit.stdout.bsl | 53 +++++++++ .../core/printing/output.off.stdout.bsl | 53 +++++++++ .../core/printing/output.quiet.stdout.bsl | 3 + tests/fsharp/core/printing/output.stdout.bsl | 53 +++++++++ tests/fsharp/core/printing/test.fsx | 40 +++++++ tests/fsharp/tests.fs | 11 +- 21 files changed, 456 insertions(+), 11 deletions(-) diff --git a/VisualFSharp.sln b/VisualFSharp.sln index c99c08c29c5..fa4c376c818 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -84,6 +84,14 @@ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Test.Utilities", "tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" + ProjectSection(ProjectDependencies) = postProject + {0973C362-585C-4838-9459-D7E45C6B784B} = {0973C362-585C-4838-9459-D7E45C6B784B} + {37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} = {37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} + {511C95D9-3BA6-451F-B6F8-F033F40878A5} = {511C95D9-3BA6-451F-B6F8-F033F40878A5} + {597D9896-4B90-4E9E-9C99-445C2CB9FF60} = {597D9896-4B90-4E9E-9C99-445C2CB9FF60} + {E54456F4-D51A-4334-B225-92EBBED92B40} = {E54456F4-D51A-4334-B225-92EBBED92B40} + {EB015235-1E07-4CDA-9CC6-3FBCC27910D1} = {EB015235-1E07-4CDA-9CC6-3FBCC27910D1} + EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}" EndProject @@ -149,8 +157,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", " EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA}" ProjectSection(ProjectDependencies) = postProject - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} = {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} + {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpDebug", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpDebug.csproj", "{A422D673-8E3B-4924-821B-DD3174173426}" diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 361f9078495..63c543cfed2 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -2073,7 +2073,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu mkILFields [ for _, fldName, fldTy in flds -> - // Don't hide fields when splitting to multiple assemblies. + let access = if cenv.options.isInteractive && cenv.options.fsiMultiAssemblyEmit then ILMemberAccess.Public @@ -2081,7 +2081,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu ILMemberAccess.Private let fdef = mkILInstanceField (fldName, fldTy, None, access) - fdef.With(customAttrs = mkILCustomAttrs [ g.DebuggerBrowsableNeverAttribute ]) + let attrs = [ g.CompilerGeneratedAttribute; g.DebuggerBrowsableNeverAttribute ] + fdef.With(customAttrs = mkILCustomAttrs attrs) ] // Generate property definitions for the fields compiled as properties @@ -10676,7 +10677,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let extraAttribs = match tyconRepr with - | TFSharpRecdRepr _ when not useGenuineField -> [ g.DebuggerBrowsableNeverAttribute ] // hide fields in records in debug display + | TFSharpRecdRepr _ when not useGenuineField -> + [ g.CompilerGeneratedAttribute; g.DebuggerBrowsableNeverAttribute ] | _ -> [] // don't hide fields in classes in debug display let access = ComputeMemberAccess isFieldHidden diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl index 30f333f36c8..b7aea842a83 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl index 78d4df8f587..34ab1b1e85c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl index b23967fe77b..c94a00b3427 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl index 0b4d87cf293..31112ecefe0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl @@ -99,8 +99,10 @@ .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.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .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.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .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, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl index ded94e51adc..de3a5062203 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl @@ -62,8 +62,10 @@ { .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 assembly int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl index d34dc778f67..17ff542c4ed 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl @@ -62,8 +62,10 @@ { .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 assembly int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl index 1139c1cdb0d..6047356613b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl @@ -62,8 +62,10 @@ { .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 public int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field public int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl index 51afb9c71dd..97404f6bb4a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl @@ -62,8 +62,10 @@ { .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 public int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field public int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index f2d93c0513c..60aac52400a 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -652,8 +652,8 @@ let diff normalize path1 path2 = if x >= 0 then line.Substring(x+cwd.Length) else line else line - let line1 = normalizePath lines1[i] - let line2 = normalizePath lines2[i] + let line1 = lines1[i] |> normalizePath + let line2 = lines2[i] |> normalizePath if line1 <> line2 then append <| sprintf "diff between [%s] and [%s]" path1 path2 diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index cc3eaef035e..cdf91519c8d 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -2764,4 +2764,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 6d1b4c6dfc9..cb22322c94a 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -2009,4 +2009,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.47.stderr.bsl b/tests/fsharp/core/printing/output.47.stderr.bsl index 4d3209ca246..3e98bca2fc4 100644 --- a/tests/fsharp/core/printing/output.47.stderr.bsl +++ b/tests/fsharp/core/printing/output.47.stderr.bsl @@ -334,3 +334,111 @@ stdin(838,6): error FS1210: Active pattern '|A|B|' has a result type containing stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function + + #r "nuget:Newtonsoft.Json, 13.0.1" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +stdin(1117,1): error FS3302: The 'package management' feature requires language version 5.0 or above + + + JsonConvert.SerializeObject { ImmutableField0 = 7 } + ^^^^^^^^^^^ + +stdin(1122,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject { MutableField1 = 8 } |> printfn "%s";; + ^^^^^^^^^^^ + +stdin(1126,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject { MutableField1 = 9 } + ^^^^^^^^^^^ + +stdin(1128,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject {| AnonRecordField2 = 10 |} |> printfn "%s";; + ^^^^^^^^^^^ + +stdin(1131,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject {| AnonRecordField2 = 11 |} + ^^^^^^^^^^^ + +stdin(1133,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + #r "nuget: System.Text.Json" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +stdin(1136,1): error FS3302: The 'package management' feature requires language version 5.0 or above + + + let test3b = JsonSerializer.Deserialize test3a;; + -------------^^^^^^^^^^^^^^ + +stdin(1140,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test3c = JsonSerializer.Serialize { ImmutableField3 = 13 };; + -------------^^^^^^^^^^^^^^ + +stdin(1141,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test3d = JsonSerializer.Deserialize test3c;; + -------------^^^^^^^^^^^^^^ + +stdin(1142,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4a = JsonSerializer.Serialize { MutableField4 = 15 };; + -------------^^^^^^^^^^^^^^ + +stdin(1145,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4b = JsonSerializer.Deserialize test4a;; + -------------^^^^^^^^^^^^^^ + +stdin(1146,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4c = JsonSerializer.Serialize { MutableField4 = 16 };; + -------------^^^^^^^^^^^^^^ + +stdin(1147,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4d = JsonSerializer.Deserialize test4c;; + -------------^^^^^^^^^^^^^^ + +stdin(1148,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5a = JsonSerializer.Serialize {| AnonRecordField5 = 17 |};; + -------------^^^^^^^^^^^^^^ + +stdin(1151,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5b = JsonSerializer.Deserialize test5a;; + -------------^^^^^^^^^^^^^^ + +stdin(1152,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5c = JsonSerializer.Serialize {| AnonRecordField5 = 18 |};; + -------------^^^^^^^^^^^^^^ + +stdin(1153,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5d = JsonSerializer.Deserialize test5c;; + -------------^^^^^^^^^^^^^^ + +stdin(1154,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index af2d597eaad..b6f38074b36 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -6309,4 +6309,4 @@ val ShortName: string = "hi" > val list2: int list = [1] -> > > +> > > > > > > > > > > > > > > > > > > > > diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index acdcf6c63d8..9183285f872 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -6311,4 +6311,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0316. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0323.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 2bd43f77f8f..586d7a58860 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1778,4 +1778,57 @@ val ShortName: string = "hi" > val list2: int list +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string + +> val test3b: R3 + +> val test3c: string + +> val test3d: R3 + +> type R4 = + { mutable MutableField4: int } +val test4a: string + +> val test4b: R4 + +> val test4c: string + +> val test4d: R4 + +> type R5 = {| AnonRecordField5: int |} +val test5a: string + +> val test5b: R5 + +> val test5c: string + +> val test5d: R5 + > > > diff --git a/tests/fsharp/core/printing/output.quiet.stdout.bsl b/tests/fsharp/core/printing/output.quiet.stdout.bsl index 26683b52103..d8d778aca70 100644 --- a/tests/fsharp/core/printing/output.quiet.stdout.bsl +++ b/tests/fsharp/core/printing/output.quiet.stdout.bsl @@ -11,3 +11,6 @@ [Building 5 3...done] Expect ABC = ABC Expect ABC = ABC +{"ImmutableField0":6} +{"MutableField1":8} +{"AnonRecordField2":10} diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index acdcf6c63d8..9183285f872 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -6311,4 +6311,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0316. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0323.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/test.fsx b/tests/fsharp/core/printing/test.fsx index 1bd15e348f8..c0943540b49 100644 --- a/tests/fsharp/core/printing/test.fsx +++ b/tests/fsharp/core/printing/test.fsx @@ -1114,6 +1114,46 @@ let list = [{ A = 1; B = "a" }];; let list2 = [ for x in list do x.A ];; +#r "nuget:Newtonsoft.Json, 13.0.1" +type R1 = { ImmutableField0: int } +open Newtonsoft.Json +JsonConvert.SerializeObject { ImmutableField0 = 6 } |> printfn "%s";; + +JsonConvert.SerializeObject { ImmutableField0 = 7 } +|> JsonConvert.DeserializeObject;; + +type R2 = { mutable MutableField1: int } +JsonConvert.SerializeObject { MutableField1 = 8 } |> printfn "%s";; + +JsonConvert.SerializeObject { MutableField1 = 9 } +|> JsonConvert.DeserializeObject;; + +JsonConvert.SerializeObject {| AnonRecordField2 = 10 |} |> printfn "%s";; + +JsonConvert.SerializeObject {| AnonRecordField2 = 11 |} +|> JsonConvert.DeserializeObject<{| AnonRecordField2 :int |}>;; + +#r "nuget: System.Text.Json" +open System.Text.Json +type R3 = { ImmutableField3: int } +let test3a = JsonSerializer.Serialize { ImmutableField3 = 12 };; +let test3b = JsonSerializer.Deserialize test3a;; +let test3c = JsonSerializer.Serialize { ImmutableField3 = 13 };; +let test3d = JsonSerializer.Deserialize test3c;; + +type R4 = { mutable MutableField4: int } +let test4a = JsonSerializer.Serialize { MutableField4 = 15 };; +let test4b = JsonSerializer.Deserialize test4a;; +let test4c = JsonSerializer.Serialize { MutableField4 = 16 };; +let test4d = JsonSerializer.Deserialize test4c;; + +type R5 = {| AnonRecordField5: int |} +let test5a = JsonSerializer.Serialize {| AnonRecordField5 = 17 |};; +let test5b = JsonSerializer.Deserialize test5a;; +let test5c = JsonSerializer.Serialize {| AnonRecordField5 = 18 |};; +let test5d = JsonSerializer.Deserialize test5c;; + + ;; (* ;; needed, to isolate error regressions *) ;;exit 0;; (* piped in to enable error regressions *) \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index d8c4bd79cc2..d4da2adaf94 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1060,10 +1060,13 @@ module CoreTests = let rawFileErr = tryCreateTemporaryFileName () ``fsi b 2>c`` "%s --nologo --preferreduilang:en-US %s" fsc_flags_errors_ok flag ("test.fsx", rawFileOut, rawFileErr) - // REM REVIEW: want to normalise CWD paths, not suppress them. - let ``findstr /v`` text = Seq.filter (fun (s: string) -> not <| s.Contains(text)) - let removeCDandHelp from' to' = - File.ReadLines from' |> (``findstr /v`` cfg.Directory) |> (``findstr /v`` "--help' for options") |> (fun lines -> File.WriteAllLines(getfullpath cfg to', lines)) + let removeCDandHelp fromFile toFile = + File.ReadAllLines fromFile + |> Array.filter (fun s -> not (s.Contains(cfg.Directory))) + |> Array.filter (fun s -> not (s.Contains("--help' for options"))) + |> Array.filter (fun s -> not (s.Contains("[Loading"))) + |> Array.filter (fun s -> not (s.Contains("Binding session"))) + |> (fun lines -> File.WriteAllLines(getfullpath cfg toFile, lines)) removeCDandHelp rawFileOut diffFileOut removeCDandHelp rawFileErr diffFileErr From 65643c1e4bb6f59a3ddf14c96df9ed7039a0d5c4 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 12 Jul 2022 12:50:30 -0700 Subject: [PATCH 037/226] Merge main to release/dev17.4 (#13492) * ValRepInfoForDisplay added for improved quick info for functions defined in expressions * Update * Update QuickInfoTests.fs * Update QuickInfoTests.fs * Update * add identifier analysis script (#13486) * add identifier analysis script * add identifier analysis script * Update fantomas alpha 11 (#13481) Co-authored-by: Don Syme Co-authored-by: Peter Semkin Co-authored-by: Don Syme Co-authored-by: Florian Verdonck Co-authored-by: Petr Semkin --- .config/dotnet-tools.json | 2 +- src/Compiler/AbstractIL/il.fs | 62 ++-- src/Compiler/AbstractIL/ilnativeres.fs | 12 +- src/Compiler/AbstractIL/ilprint.fs | 60 ++-- src/Compiler/AbstractIL/ilread.fs | 81 +++--- src/Compiler/AbstractIL/ilreflect.fs | 57 ++-- src/Compiler/AbstractIL/ilsupp.fs | 6 +- src/Compiler/AbstractIL/ilsupp.fsi | 12 +- src/Compiler/AbstractIL/ilwritepdb.fs | 22 +- src/Compiler/AbstractIL/ilx.fs | 2 +- src/Compiler/AbstractIL/ilx.fsi | 2 +- src/Compiler/Checking/CheckExpressions.fs | 52 ++-- src/Compiler/Checking/CheckExpressions.fsi | 3 +- .../Checking/CheckIncrementalClasses.fs | 8 +- src/Compiler/Checking/NicePrint.fs | 3 +- src/Compiler/CodeGen/EraseClosures.fs | 16 +- src/Compiler/CodeGen/EraseUnions.fs | 17 +- src/Compiler/CodeGen/IlxGen.fs | 275 +++++++++++------- src/Compiler/Driver/CompilerConfig.fs | 26 +- src/Compiler/Driver/CompilerDiagnostics.fs | 13 +- src/Compiler/Driver/CompilerImports.fs | 29 +- src/Compiler/Driver/CompilerOptions.fs | 17 +- src/Compiler/Driver/CreateILModule.fs | 25 +- src/Compiler/Driver/FxResolver.fs | 24 +- src/Compiler/Driver/OptimizeInputs.fs | 6 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 3 +- src/Compiler/Driver/ScriptClosure.fs | 3 +- src/Compiler/Driver/StaticLinking.fs | 13 +- src/Compiler/Driver/XmlDocFileWriter.fs | 7 +- src/Compiler/Driver/fsc.fs | 40 ++- src/Compiler/Service/FSharpCheckerResults.fs | 24 +- .../Service/FSharpParseFileResults.fs | 13 +- src/Compiler/Service/ItemKey.fs | 8 +- .../Service/SemanticClassification.fs | 20 +- src/Compiler/Service/ServiceAnalysis.fs | 15 +- .../Service/ServiceInterfaceStubGenerator.fs | 34 ++- src/Compiler/Service/ServiceLexing.fs | 6 +- src/Compiler/Service/ServiceNavigation.fs | 8 +- .../Service/ServiceParamInfoLocations.fs | 12 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 21 +- src/Compiler/Service/ServiceParsedInputOps.fs | 8 +- src/Compiler/Service/ServiceStructure.fs | 30 +- src/Compiler/Service/service.fs | 10 +- src/Compiler/SyntaxTree/LexHelpers.fs | 14 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 2 +- src/Compiler/SyntaxTree/PrettyNaming.fs | 8 +- src/Compiler/SyntaxTree/XmlDoc.fs | 5 +- src/Compiler/TypedTree/TypedTree.fs | 19 ++ src/Compiler/TypedTree/TypedTree.fsi | 13 + src/Compiler/TypedTree/TypedTreeBasics.fs | 20 +- src/Compiler/TypedTree/TypedTreeBasics.fsi | 4 + src/Compiler/TypedTree/TypedTreeOps.fs | 3 +- src/Compiler/TypedTree/TypedTreePickle.fs | 1 + src/Compiler/Utilities/FileSystem.fs | 18 +- src/Compiler/Utilities/HashMultiMap.fs | 3 +- src/Compiler/Utilities/ImmutableArray.fs | 9 +- src/Compiler/Utilities/ResizeArray.fs | 13 +- src/Compiler/Utilities/illib.fs | 11 +- src/Compiler/Utilities/range.fs | 24 +- src/Compiler/Utilities/sformat.fs | 35 ++- src/FSharp.Build/FSharpEmbedResXSource.fs | 8 +- src/FSharp.Core/QueryExtensions.fs | 2 +- src/FSharp.Core/array.fs | 11 +- src/FSharp.Core/async.fs | 19 +- src/FSharp.Core/eventmodule.fs | 6 +- src/FSharp.Core/list.fs | 13 +- src/FSharp.Core/map.fs | 6 +- src/FSharp.Core/observable.fs | 20 +- src/FSharp.Core/quotations.fs | 8 +- src/FSharp.Core/reflect.fs | 30 +- src/FSharp.Core/seq.fs | 61 ++-- .../FSharp.DependencyManager.Utilities.fs | 4 +- src/fsc/fscmain.fs | 6 +- src/fsi/console.fs | 15 +- src/fsi/fsimain.fs | 6 +- tests/scripts/identifierAnalysisByType.fsx | 152 ++++++++++ .../tests/UnitTests/QuickInfoTests.fs | 41 +-- 77 files changed, 1147 insertions(+), 570 deletions(-) create mode 100644 tests/scripts/identifierAnalysisByType.fsx diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b56be5549a4..98702f25d91 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "5.0.0-alpha-008", + "version": "5.0.0-alpha-011", "commands": [ "fantomas" ] diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index ed951e0a03b..3600b0e2cf4 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -25,7 +25,9 @@ open Internal.Utilities let logging = false -let _ = if logging then dprintn "* warning: Il.logging is on" +let _ = + if logging then + dprintn "* warning: Il.logging is on" let int_order = LanguagePrimitives.FastGenericComparer @@ -68,11 +70,13 @@ let memoizeNamespaceRightTable = let memoizeNamespacePartTable = ConcurrentDictionary() let splitNameAt (nm: string) idx = - if idx < 0 then failwith "splitNameAt: idx < 0" + if idx < 0 then + failwith "splitNameAt: idx < 0" let last = nm.Length - 1 - if idx > last then failwith "splitNameAt: idx > last" + if idx > last then + failwith "splitNameAt: idx > last" (nm.Substring(0, idx)), (if idx < last then nm.Substring(idx + 1, last - idx) else "") @@ -551,7 +555,8 @@ type ILAssemblyRef(data) = addC (convDigit (int32 v / 16)) addC (convDigit (int32 v % 16)) // retargetable can be true only for system assemblies that definitely have Version - if aref.Retargetable then add ", Retargetable=Yes" + if aref.Retargetable then + add ", Retargetable=Yes" b.ToString() @@ -2497,8 +2502,10 @@ let typeKindOfFlags nm (super: ILType option) flags = if name = "System.Enum" then ILTypeDefKind.Enum - elif (name = "System.Delegate" && nm <> "System.MulticastDelegate") - || name = "System.MulticastDelegate" then + elif + (name = "System.Delegate" && nm <> "System.MulticastDelegate") + || name = "System.MulticastDelegate" + then ILTypeDefKind.Delegate elif name = "System.ValueType" && nm <> "System.Enum" then ILTypeDefKind.ValueType @@ -3925,7 +3932,8 @@ let cdef_cctorCode2CodeOrCreate tag imports f (cd: ILTypeDef) = [| yield f cctor for md in mdefs do - if md.Name <> ".cctor" then yield md + if md.Name <> ".cctor" then + yield md |]) cd.With(methods = methods) @@ -4888,7 +4896,8 @@ type ILTypeSigParser(tstring: string) = // Does the type name start with a leading '['? If so, ignore it // (if the specialization type is in another module, it will be wrapped in bracket) - if here () = '[' then drop () + if here () = '[' then + drop () // 1. Iterate over beginning of type, grabbing the type name and determining if it's generic or an array let typeName = @@ -4947,8 +4956,11 @@ type ILTypeSigParser(tstring: string) = let scope = if (here () = ',' || here () = ' ') && (peek () <> '[' && peekN 2 <> '[') then let grabScopeComponent () = - if here () = ',' then drop () // ditch the ',' - if here () = ' ' then drop () // ditch the ' ' + if here () = ',' then + drop () // ditch the ',' + + if here () = ' ' then + drop () // ditch the ' ' while (peek () <> ',' && peek () <> ']' && peek () <> nil) do step () @@ -4969,8 +4981,11 @@ type ILTypeSigParser(tstring: string) = ILScopeRef.Local // strip any extraneous trailing brackets or commas - if (here () = ']') then drop () - if (here () = ',') then drop () + if (here () = ']') then + drop () + + if (here () = ',') then + drop () // build the IL type let tref = mkILTyRef (scope, typeName) @@ -5549,17 +5564,18 @@ let resolveILMethodRefWithRescope r (td: ILTypeDef) (mref: ILMethodRef) = let argTypes = mref.ArgTypes |> List.map r let retType: ILType = r mref.ReturnType - match possibles - |> List.filter (fun md -> - mref.CallingConv = md.CallingConv - && - // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct - (md.Parameters, argTypes) - ||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) - && - // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct - r md.Return.Type = retType) - with + match + possibles + |> List.filter (fun md -> + mref.CallingConv = md.CallingConv + && + // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct + (md.Parameters, argTypes) + ||> List.lengthsEqAndForall2 (fun p1 p2 -> r p1.Type = p2) + && + // REVIEW: this uses equality on ILType. For CMOD_OPTIONAL this is not going to be correct + r md.Return.Type = retType) + with | [] -> failwith ( "no method named " diff --git a/src/Compiler/AbstractIL/ilnativeres.fs b/src/Compiler/AbstractIL/ilnativeres.fs index 3c0752ea8db..70846577d68 100644 --- a/src/Compiler/AbstractIL/ilnativeres.fs +++ b/src/Compiler/AbstractIL/ilnativeres.fs @@ -96,8 +96,10 @@ type CvtResFile() = reader.Read(pAdditional.data, 0, pAdditional.data.Length) |> ignore stream.Position <- stream.Position + 3L &&& ~~~ 3L - if pAdditional.pstringType.theString = Unchecked.defaultof<_> - && (pAdditional.pstringType.Ordinal = uint16 CvtResFile.RT_DLGINCLUDE) then + if + pAdditional.pstringType.theString = Unchecked.defaultof<_> + && (pAdditional.pstringType.Ordinal = uint16 CvtResFile.RT_DLGINCLUDE) + then () (* ERROR ContinueNotSupported *) else resourceNames.Add pAdditional @@ -454,7 +456,8 @@ type VersionHelper() = doBreak <- false () (* ERROR ContinueNotSupported *) (* ERROR BreakNotSupported *) - if not breakLoop then i <- i + 1 + if not breakLoop then + i <- i + 1 if hasWildcard then let mutable (i: int) = lastExplicitValue @@ -1149,7 +1152,8 @@ type NativeResourceWriter() = if id >= 0 then writer.WriteInt32 id else - if name = Unchecked.defaultof<_> then name <- String.Empty + if name = Unchecked.defaultof<_> then + name <- String.Empty writer.WriteUInt32(nameOffset ||| 0x80000000u) dataWriter.WriteUInt16(uint16 name.Length) diff --git a/src/Compiler/AbstractIL/ilprint.fs b/src/Compiler/AbstractIL/ilprint.fs index a9f95cbc1b0..1c777f278b9 100644 --- a/src/Compiler/AbstractIL/ilprint.fs +++ b/src/Compiler/AbstractIL/ilprint.fs @@ -661,16 +661,20 @@ let goutput_fdef _tref env os (fd: ILFieldDef) = output_member_access os fd.Access output_string os " " - if fd.IsStatic then output_string os " static " + if fd.IsStatic then + output_string os " static " - if fd.IsLiteral then output_string os " literal " + if fd.IsLiteral then + output_string os " literal " if fd.IsSpecialName then output_string os " specialname rtspecialname " - if fd.IsInitOnly then output_string os " initonly " + if fd.IsInitOnly then + output_string os " initonly " - if fd.NotSerialized then output_string os " notserialized " + if fd.NotSerialized then + output_string os " notserialized " goutput_typ env os fd.FieldType output_string os " " @@ -740,7 +744,8 @@ let output_code_label os lab = output_string os (formatCodeLabel lab) let goutput_local env os (l: ILLocal) = goutput_typ env os l.Type - if l.IsPinned then output_string os " pinned" + if l.IsPinned then + output_string os " pinned" let goutput_param env os (l: ILParameter) = match l.Name with @@ -985,7 +990,8 @@ let rec goutput_instr env os inst = let rank = shape.Rank output_parens (output_array ", " (goutput_typ env)) os (Array.create rank PrimaryAssemblyILGlobals.typ_Int32) | I_ldelema (ro, _, shape, tok) -> - if ro = ReadonlyAddress then output_string os "readonly. " + if ro = ReadonlyAddress then + output_string os "readonly. " if shape = ILArrayShape.SingleDimensional then output_string os "ldelema " @@ -1034,7 +1040,8 @@ let rec goutput_instr env os inst = | _ -> output_string os "" let goutput_ilmbody env os (il: ILMethodBody) = - if il.IsZeroInit then output_string os " .zeroinit\n" + if il.IsZeroInit then + output_string os " .zeroinit\n" output_string os " .maxstack " output_i32 os il.MaxStack @@ -1067,7 +1074,8 @@ let goutput_mbody is_entrypoint env os (md: ILMethodDef) = | MethodBody.IL il -> goutput_ilmbody env os il.Value | _ -> () - if is_entrypoint then output_string os " .entrypoint" + if is_entrypoint then + output_string os " .entrypoint" output_string os "\n" output_string os "}\n" @@ -1125,11 +1133,14 @@ let goutput_mdef env os (md: ILMethodDef) = let menv = ppenv_enter_method (List.length md.GenericParams) env output_string os " .method " - if md.IsHideBySig then output_string os "hidebysig " + if md.IsHideBySig then + output_string os "hidebysig " - if md.IsReqSecObj then output_string os "reqsecobj " + if md.IsReqSecObj then + output_string os "reqsecobj " - if md.IsSpecialName then output_string os "specialname " + if md.IsSpecialName then + output_string os "specialname " if md.IsUnmanagedExport then output_string os "unmanagedexp " @@ -1149,13 +1160,17 @@ let goutput_mdef env os (md: ILMethodDef) = (goutput_params menv) os md.Parameters output_string os " " - if md.IsSynchronized then output_string os "synchronized " + if md.IsSynchronized then + output_string os "synchronized " - if md.IsMustRun then output_string os "/* mustrun */ " + if md.IsMustRun then + output_string os "/* mustrun */ " - if md.IsPreserveSig then output_string os "preservesig " + if md.IsPreserveSig then + output_string os "preservesig " - if md.IsNoInline then output_string os "noinlining " + if md.IsNoInline then + output_string os "noinlining " if md.IsAggressiveInline then output_string os "aggressiveinlining " @@ -1255,13 +1270,17 @@ let rec goutput_tdef enc env contents os (cd: ILTypeDef) = output_string os layout_attr output_string os " " - if cd.IsSealed then output_string os "sealed " + if cd.IsSealed then + output_string os "sealed " - if cd.IsAbstract then output_string os "abstract " + if cd.IsAbstract then + output_string os "abstract " - if cd.IsSerializable then output_string os "serializable " + if cd.IsSerializable then + output_string os "serializable " - if cd.IsComInterop then output_string os "import " + if cd.IsComInterop then + output_string os "import " output_sqstring os cd.Name goutput_gparams env os cd.GenericParams @@ -1339,7 +1358,8 @@ let output_assemblyRef os (aref: ILAssemblyRef) = output_string os " .assembly extern " output_sqstring os aref.Name - if aref.Retargetable then output_string os " retargetable " + if aref.Retargetable then + output_string os " retargetable " output_string os " { " output_option output_hash os aref.Hash diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 3b536d891fd..6ec589b3115 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1379,7 +1379,8 @@ let seekReadGuidIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadId let seekReadBlobIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadIdx ctxt.blobsBigness mdv &addr let seekReadModuleRow (ctxt: ILMetadataReader) mdv idx = - if idx = 0 then failwith "cannot read Module table row 0" + if idx = 0 then + failwith "cannot read Module table row 0" let mutable addr = ctxt.rowAddr TableNames.Module idx let generation = seekReadUInt16Adv mdv &addr @@ -1846,7 +1847,9 @@ let getDataEndPointsDelayed (pectxt: PEReader) ctxtH = |> List.sort let rvaToData (ctxt: ILMetadataReader) (pectxt: PEReader) nm rva = - if rva = 0x0 then failwith "rva is zero" + if rva = 0x0 then + failwith "rva is zero" + let start = pectxt.anyV2P (nm, rva) let endPoints = (Lazy.force ctxt.dataEndPoints) @@ -2565,7 +2568,8 @@ and sigptrGetTy (ctxt: ILMetadataReader) numTypars bytes sigptr = let ccByte, sigptr = sigptrGetByte bytes sigptr let generic, cc = byteAsCallConv ccByte - if generic then failwith "fptr sig may not be generic" + if generic then + failwith "fptr sig may not be generic" let struct (numparams, sigptr) = sigptrGetZInt32 bytes sigptr let retTy, sigptr = sigptrGetTy ctxt numTypars bytes sigptr @@ -3082,16 +3086,15 @@ and seekReadEvents (ctxt: ILMetadataReader) numTypars tidx = let mdv = ctxt.mdfile.GetView() match - seekReadOptionalIndexedRow - ( - ctxt.getNumRows TableNames.EventMap, - (fun i -> i, seekReadEventMapRow ctxt mdv i), - (fun (_, row) -> fst row), - compare tidx, - false, - (fun (i, row) -> (i, snd row)) - ) - with + seekReadOptionalIndexedRow ( + ctxt.getNumRows TableNames.EventMap, + (fun i -> i, seekReadEventMapRow ctxt mdv i), + (fun (_, row) -> fst row), + compare tidx, + false, + (fun (i, row) -> (i, snd row)) + ) + with | None -> [] | Some (rowNum, beginEventIdx) -> let endEventIdx = @@ -3150,16 +3153,15 @@ and seekReadProperties (ctxt: ILMetadataReader) numTypars tidx = let mdv = ctxt.mdfile.GetView() match - seekReadOptionalIndexedRow - ( - ctxt.getNumRows TableNames.PropertyMap, - (fun i -> i, seekReadPropertyMapRow ctxt mdv i), - (fun (_, row) -> fst row), - compare tidx, - false, - (fun (i, row) -> (i, snd row)) - ) - with + seekReadOptionalIndexedRow ( + ctxt.getNumRows TableNames.PropertyMap, + (fun i -> i, seekReadPropertyMapRow ctxt mdv i), + (fun (_, row) -> fst row), + compare tidx, + false, + (fun (i, row) -> (i, snd row)) + ) + with | None -> [] | Some (rowNum, beginPropIdx) -> let endPropIdx = @@ -3592,17 +3594,21 @@ and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start s curr <- curr + 4 (* REVIEW: this incorrectly labels all MemberRef tokens as ILMethod's: we should go look at the MemberRef sig to determine if it is a field or method *) let token_info = - if tab = TableNames.Method - || tab = TableNames.MemberRef (* REVIEW: generics or tab = TableNames.MethodSpec *) then + if + tab = TableNames.Method + || tab = TableNames.MemberRef (* REVIEW: generics or tab = TableNames.MethodSpec *) + then let (MethodData (enclTy, cc, nm, argTys, retTy, methInst)) = seekReadMethodDefOrRefNoVarargs ctxt numTypars (uncodedTokenToMethodDefOrRef (tab, idx)) ILToken.ILMethod(mkILMethSpecInTy (enclTy, cc, nm, argTys, retTy, methInst)) elif tab = TableNames.Field then ILToken.ILField(seekReadFieldDefAsFieldSpec ctxt idx) - elif tab = TableNames.TypeDef - || tab = TableNames.TypeRef - || tab = TableNames.TypeSpec then + elif + tab = TableNames.TypeDef + || tab = TableNames.TypeRef + || tab = TableNames.TypeSpec + then ILToken.ILType(seekReadTypeDefOrRef ctxt numTypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec (tab, idx))) else failwith "bad token for ldtoken" @@ -3680,7 +3686,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int let isFatFormat = (b &&& e_CorILMethod_FormatMask) = e_CorILMethod_FatFormat if not isTinyFormat && not isFatFormat then - if logging then failwith "unknown format" + if logging then + failwith "unknown format" MethodBody.Abstract else @@ -3924,7 +3931,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int nextSectionBase <- sectionBase + sectionSize // Convert the linear code format to the nested code format - if logging then dprintn "doing localPdbInfos2" + if logging then + dprintn "doing localPdbInfos2" let localPdbInfos2 = List.map (fun f -> f raw2nextLab) localPdbInfos @@ -3933,7 +3941,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int let code = buildILCode nm lab2pc instrs seh localPdbInfos2 - if logging then dprintn "done checking code." + if logging then + dprintn "done checking code." { IsZeroInit = initlocals @@ -4254,10 +4263,10 @@ let openMetadataReader | Some positions -> positions let tablesStreamPhysLoc, _tablesStreamSize = - match tryFindStream [| 0x23; 0x7e |] (* #~ *) with + match tryFindStream [| 0x23; 0x7e |] (* #~ *) with | Some res -> res | None -> - match tryFindStream [| 0x23; 0x2d |] (* #-: at least one DLL I've seen uses this! *) with + match tryFindStream [| 0x23; 0x2d |] (* #-: at least one DLL I've seen uses this! *) with | Some res -> res | None -> let firstStreamOffset = seekReadInt32 mdv (streamHeadersStart + 0) @@ -5073,8 +5082,10 @@ let stableFileHeuristicApplies fileName = let createByteFileChunk opts fileName chunk = // If we're trying to reduce memory usage then we are willing to go back and re-read the binary, so we can use // a weakly-held handle to an array of bytes. - if opts.reduceMemoryUsage = ReduceMemoryFlag.Yes - && stableFileHeuristicApplies fileName then + if + opts.reduceMemoryUsage = ReduceMemoryFlag.Yes + && stableFileHeuristicApplies fileName + then WeakByteFile(fileName, chunk) :> BinaryFile else let bytes = diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 06e2fc67a35..2781d8a381a 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -638,11 +638,13 @@ let envUpdateCreatedTypeRef emEnv (tref: ILTypeRef) = // of objects. We use System.Runtime.Serialization.FormatterServices.GetUninitializedObject to do // the fake allocation - this creates an "empty" object, even if the object doesn't have // a constructor. It is not usable in partial trust code. - if runningOnMono - && ty.IsClass - && not ty.IsAbstract - && not ty.IsGenericType - && not ty.IsGenericTypeDefinition then + if + runningOnMono + && ty.IsClass + && not ty.IsAbstract + && not ty.IsGenericType + && not ty.IsGenericTypeDefinition + then try System.Runtime.Serialization.FormatterServices.GetUninitializedObject ty |> ignore @@ -972,7 +974,9 @@ let convFieldSpec cenv emEnv fspec = nonQueryableTypeGetField parentTI fieldB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let fieldInfo = queryableTypeGetField emEnv parentT fref nonQueryableTypeGetField parentTI fieldInfo @@ -1009,10 +1013,12 @@ let queryableTypeGetMethodBySearch cenv emEnv parentT (mref: ILMethodRef) = | Some a -> if // obvious case - p.IsAssignableFrom a then + p.IsAssignableFrom a + then true elif - p.IsGenericType && a.IsGenericType + p.IsGenericType + && a.IsGenericType // non obvious due to contravariance: Action where T: IFoo accepts Action (for FooImpl: IFoo) && p.GetGenericTypeDefinition().IsAssignableFrom(a.GetGenericTypeDefinition()) then @@ -1124,8 +1130,10 @@ let queryableTypeGetMethod cenv emEnv parentT (mref: ILMethodRef) : MethodInfo = queryableTypeGetMethodBySearch cenv emEnv parentT mref let nonQueryableTypeGetMethod (parentTI: Type) (methInfo: MethodInfo) : MethodInfo MaybeNull = - if (parentTI.IsGenericType - && not (equalTypes parentTI (getTypeConstructor parentTI))) then + if + (parentTI.IsGenericType + && not (equalTypes parentTI (getTypeConstructor parentTI))) + then TypeBuilder.GetMethod(parentTI, methInfo) else methInfo @@ -1141,7 +1149,9 @@ let convMethodRef cenv emEnv (parentTI: Type) (mref: ILMethodRef) = nonQueryableTypeGetMethod parentTI methB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let methInfo = queryableTypeGetMethod cenv emEnv parentT mref nonQueryableTypeGetMethod parentTI methInfo @@ -1216,7 +1226,9 @@ let convConstructorSpec cenv emEnv (mspec: ILMethodSpec) = nonQueryableTypeGetConstructor parentTI consB else // Prior type. - if typeIsNotQueryable parentTI then + if + typeIsNotQueryable parentTI + then let parentT = getTypeConstructor parentTI let ctorG = queryableTypeGetConstructor cenv emEnv parentT mref nonQueryableTypeGetConstructor parentTI ctorG @@ -2134,9 +2146,11 @@ let buildFieldPass2 cenv tref (typB: TypeBuilder) emEnv (fdef: ILFieldDef) = match fdef.LiteralValue with | None -> emEnv | Some initial -> - if not fieldT.IsEnum - // it is ok to init fields with type = enum that are defined in other assemblies - || not fieldT.Assembly.IsDynamic then + if + not fieldT.IsEnum + // it is ok to init fields with type = enum that are defined in other assemblies + || not fieldT.Assembly.IsDynamic + then fieldB.SetConstant(initial.AsObject()) emEnv else @@ -2267,9 +2281,10 @@ let typeAttributesOfTypeLayout cenv emEnv x = if p.Size = None && p.Pack = None then None else - match cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.StructLayoutAttribute", - cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.LayoutKind" - with + match + cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.StructLayoutAttribute", + cenv.tryFindSysILTypeRef "System.Runtime.InteropServices.LayoutKind" + with | Some tref1, Some tref2 -> Some( convCustomAttr @@ -2564,7 +2579,8 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t match emEnv.emTypMap.TryFind typeRef with | Some (_, tb, _, _) -> - if not (tb.IsCreated()) then tb.CreateTypeAndLog() |> ignore + if not (tb.IsCreated()) then + tb.CreateTypeAndLog() |> ignore tb.Assembly | None -> null) @@ -2590,7 +2606,8 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t traverseTypeRef tref let rec buildTypeDefPass4 (visited, created) nesting emEnv (tdef: ILTypeDef) = - if verbose2 then dprintf "buildTypeDefPass4 %s\n" tdef.Name + if verbose2 then + dprintf "buildTypeDefPass4 %s\n" tdef.Name let tref = mkRefForNestedILTypeDef ILScopeRef.Local (nesting, tdef) createTypeRef (visited, created) emEnv tref diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index 1db894b1801..fea9a764487 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -611,7 +611,8 @@ type ResFormatNode(tid: int32, nid: int32, lid: int32, dataOffset: int32, pbLink let bNil = Bytes.zeroCreate 3 // Align remaining fields on DWORD (nb. poor bit twiddling code taken from ildasm's dres.cpp) - if (dwFiller &&& 0x1) <> 0 then SaveChunk(bNil, 2) + if (dwFiller &&& 0x1) <> 0 then + SaveChunk(bNil, 2) //---- Constant part of the header: DWORD, WORD, WORD, DWORD, DWORD SaveChunk(dwToBytes resHdr.DataVersion) @@ -627,7 +628,8 @@ type ResFormatNode(tid: int32, nid: int32, lid: int32, dataOffset: int32, pbLink dwFiller <- dataEntry.Size &&& 0x3 - if dwFiller <> 0 then SaveChunk(bNil, 4 - dwFiller) + if dwFiller <> 0 then + SaveChunk(bNil, 4 - dwFiller) size diff --git a/src/Compiler/AbstractIL/ilsupp.fsi b/src/Compiler/AbstractIL/ilsupp.fsi index a7b9ddefcfe..e0aa2785471 100644 --- a/src/Compiler/AbstractIL/ilsupp.fsi +++ b/src/Compiler/AbstractIL/ilsupp.fsi @@ -48,14 +48,14 @@ type PdbDebugPoint = pdbSeqPointEndLine: int pdbSeqPointEndColumn: int } -val pdbReadOpen: string (* module *) -> string (* path *) -> PdbReader +val pdbReadOpen: string (* module *) -> string (* path *) -> PdbReader val pdbReadClose: PdbReader -> unit -val pdbReaderGetMethod: PdbReader -> int32 (* token *) -> PdbMethod -val pdbReaderGetMethodFromDocumentPosition: PdbReader -> PdbDocument -> int (* line *) -> int (* col *) -> PdbMethod +val pdbReaderGetMethod: PdbReader -> int32 (* token *) -> PdbMethod +val pdbReaderGetMethodFromDocumentPosition: PdbReader -> PdbDocument -> int (* line *) -> int (* col *) -> PdbMethod val pdbReaderGetDocuments: PdbReader -> PdbDocument array val pdbReaderGetDocument: - PdbReader -> string (* url *) -> byte (* guid *) [] -> byte (* guid *) [] -> byte (* guid *) [] -> PdbDocument + PdbReader -> string (* url *) -> byte (* guid *) [] -> byte (* guid *) [] -> byte (* guid *) [] -> PdbDocument val pdbDocumentGetURL: PdbDocument -> string val pdbDocumentGetType: PdbDocument -> byte (* guid *) [] @@ -72,7 +72,7 @@ val pdbScopeGetLocals: PdbMethodScope -> PdbVariable array val pdbVariableGetName: PdbVariable -> string val pdbVariableGetSignature: PdbVariable -> byte[] -val pdbVariableGetAddressAttributes: PdbVariable -> int32 (* kind *) * int32 (* addrField1 *) +val pdbVariableGetAddressAttributes: PdbVariable -> int32 (* kind *) * int32 (* addrField1 *) #endif #if !FX_NO_PDB_WRITER @@ -89,7 +89,7 @@ type idd = iddType: int32 iddData: byte[] } -val pdbInitialize: string (* .exe/.dll already written and closed *) -> string (* .pdb to write *) -> PdbWriter +val pdbInitialize: string (* .exe/.dll already written and closed *) -> string (* .pdb to write *) -> PdbWriter val pdbClose: PdbWriter -> string -> string -> unit val pdbCloseDocument: PdbDocumentWriter -> unit val pdbSetUserEntryPoint: PdbWriter -> int32 -> unit diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index c81cfc23ad3..55b23795bbc 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -751,10 +751,12 @@ type PortablePdbGenerator builder.WriteCompressedInteger offsetDelta // Check for hidden-sequence-point-record - if startLine = 0xfeefee - || endLine = 0xfeefee - || (startColumn = 0 && endColumn = 0) - || ((endLine - startLine) = 0 && (endColumn - startColumn) = 0) then + if + startLine = 0xfeefee + || endLine = 0xfeefee + || (startColumn = 0 && endColumn = 0) + || ((endLine - startLine) = 0 && (endColumn - startColumn) = 0) + then // Hidden-sequence-point-record builder.WriteCompressedInteger 0 builder.WriteCompressedInteger 0 @@ -1008,14 +1010,16 @@ let writePdbInfo showTimes outfile pdbfile info cvChunk = | Some p -> sco.StartOffset <> p.StartOffset || sco.EndOffset <> p.EndOffset | None -> true - if nested then pdbOpenScope pdbw sco.StartOffset + if nested then + pdbOpenScope pdbw sco.StartOffset sco.Locals |> Array.iter (fun v -> pdbDefineLocalVariable pdbw v.Name v.Signature v.Index) sco.Children |> Array.iter (writePdbScope (if nested then Some sco else parent)) - if nested then pdbCloseScope pdbw sco.EndOffset) + if nested then + pdbCloseScope pdbw sco.EndOffset) match minfo.RootScope with | None -> () @@ -1242,8 +1246,10 @@ and allNamesOfScopes acc (scopes: PdbMethodScope[]) = let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[]) (scope: PdbMethodScope) = stackGuard.Guard(fun () -> // Check if child scopes are properly nested - if scope.Children - |> Array.forall (fun child -> child.StartOffset >= scope.StartOffset && child.EndOffset <= scope.EndOffset) then + if + scope.Children + |> Array.forall (fun child -> child.StartOffset >= scope.StartOffset && child.EndOffset <= scope.EndOffset) + then let children = scope.Children |> Array.sortWith scopeSorter diff --git a/src/Compiler/AbstractIL/ilx.fs b/src/Compiler/AbstractIL/ilx.fs index 6a7adab880b..4eb18649752 100644 --- a/src/Compiler/AbstractIL/ilx.fs +++ b/src/Compiler/AbstractIL/ilx.fs @@ -39,7 +39,7 @@ type IlxUnionHasHelpers = | SpecialFSharpListHelpers | SpecialFSharpOptionHelpers -type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers +type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers type IlxUnionSpec = | IlxUnionSpec of IlxUnionRef * ILGenericArgs diff --git a/src/Compiler/AbstractIL/ilx.fsi b/src/Compiler/AbstractIL/ilx.fsi index 901117867b7..a6a008434be 100644 --- a/src/Compiler/AbstractIL/ilx.fsi +++ b/src/Compiler/AbstractIL/ilx.fsi @@ -39,7 +39,7 @@ type IlxUnionRef = boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * - bool (* IsNullPermitted *) * + bool (* IsNullPermitted *) * IlxUnionHasHelpers (* HasHelpers *) type IlxUnionSpec = diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 0de950283e7..d513a326a74 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -578,6 +578,7 @@ type ValScheme = id: Ident * typeScheme: GeneralizedType * valReprInfo: ValReprInfo option * + valReprInfoForDisplay: ValReprInfo option * memberInfo: PrelimMemberInfo option * isMutable: bool * inlineInfo: ValInline * @@ -1500,7 +1501,7 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec let g = cenv.g - let (ValScheme(id, typeScheme, valReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme + let (ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme let ty = GeneralizedTypeForTypeScheme typeScheme @@ -1608,6 +1609,10 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec xmlDoc, isTopBinding, isExtrinsic, isIncrClass, isTyFunc, (hasDeclaredTypars || inSig), isGeneratedEventVal, konst, actualParent) + match valReprInfoForDisplay with + | Some info when not (ValReprInfo.IsEmpty info) -> + vspec.SetValReprInfoForDisplay valReprInfoForDisplay + | _ -> () CheckForAbnormalOperatorNames cenv id.idRange vspec.DisplayNameCoreMangled memberInfoOpt @@ -1641,10 +1646,11 @@ let MakeAndPublishVals cenv env (altActualParent, inSig, declKind, valRecInfo, v valSchemes Map.empty +/// Create a Val node for "base" in a class let MakeAndPublishBaseVal cenv env baseIdOpt ty = baseIdOpt |> Option.map (fun (id: Ident) -> - let valscheme = ValScheme(id, NonGenericTypeScheme ty, None, None, false, ValInline.Never, BaseVal, None, false, false, false, false) + let valscheme = ValScheme(id, NonGenericTypeScheme ty, None, None, None, false, ValInline.Never, BaseVal, None, false, false, false, false) MakeAndPublishVal cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valscheme, [], XmlDoc.Empty, None, false)) // Make the "delayed reference" value where the this pointer will reside after calling the base class constructor @@ -1657,7 +1663,7 @@ let MakeAndPublishSafeThisVal (cenv: cenv) env (thisIdOpt: Ident option) thisTy if not (isFSharpObjModelTy g thisTy) then errorR(Error(FSComp.SR.tcStructsCanOnlyBindThisAtMemberDeclaration(), thisId.idRange)) - let valScheme = ValScheme(thisId, NonGenericTypeScheme(mkRefCellTy g thisTy), None, None, false, ValInline.Never, CtorThisVal, None, false, false, false, false) + let valScheme = ValScheme(thisId, NonGenericTypeScheme(mkRefCellTy g thisTy), None, None, None, false, ValInline.Never, CtorThisVal, None, false, false, false, false) Some(MakeAndPublishVal cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valScheme, [], XmlDoc.Empty, None, false)) | None -> @@ -1742,11 +1748,11 @@ let ChooseCanonicalDeclaredTyparsAfterInference g denv declaredTypars m = declaredTypars let ChooseCanonicalValSchemeAfterInference g denv vscheme m = - let (ValScheme(id, typeScheme, arityInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme + let (ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars)) = vscheme let (GeneralizedType(generalizedTypars, ty)) = typeScheme let generalizedTypars = ChooseCanonicalDeclaredTyparsAfterInference g denv generalizedTypars m let typeScheme = GeneralizedType(generalizedTypars, ty) - let valscheme = ValScheme(id, typeScheme, arityInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars) + let valscheme = ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, isIncrClass, isTyFunc, hasDeclaredTypars) valscheme let PlaceTyparsInDeclarationOrder declaredTypars generalizedTypars = @@ -1817,10 +1823,11 @@ let ComputeIsTyFunc(id: Ident, hasDeclaredTypars, arityInfo: ValReprInfo option) | Some info -> info.NumCurriedArgs = 0) let UseSyntacticArity declKind typeScheme prelimValReprInfo = + let valReprInfo = InferGenericArityFromTyScheme typeScheme prelimValReprInfo if DeclKind.MustHaveArity declKind then - Some(InferGenericArityFromTyScheme typeScheme prelimValReprInfo) + Some valReprInfo, None else - None + None, Some valReprInfo /// Combine the results of InferSynValData and InferArityOfExpr. // @@ -1855,18 +1862,17 @@ let UseSyntacticArity declKind typeScheme prelimValReprInfo = // { new Base with // member x.M(v: unit) = () } // -let CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme = +let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = let (PrelimVal2(_, typeScheme, partialValReprInfoOpt, memberInfoOpt, isMutable, _, _, ArgAndRetAttribs(argAttribs, retAttribs), _, _, _)) = prelimScheme - match partialValReprInfoOpt, DeclKind.MustHaveArity declKind with - | _, false -> None - | None, true -> Some(PrelimValReprInfo([], ValReprInfo.unnamedRetVal)) + match partialValReprInfoOpt with + | None -> Some(PrelimValReprInfo([], ValReprInfo.unnamedRetVal)) // Don't use any expression information for members, where syntax dictates the arity completely | _ when memberInfoOpt.IsSome -> partialValReprInfoOpt // Don't use any expression information for 'let' bindings where return attributes are present | _ when retAttribs.Length > 0 -> partialValReprInfoOpt - | Some partialValReprInfoFromSyntax, true -> + | Some partialValReprInfoFromSyntax -> let (PrelimValReprInfo(curriedArgInfosFromSyntax, retInfoFromSyntax)) = partialValReprInfoFromSyntax let partialArityInfo = if isMutable then @@ -1899,16 +1905,20 @@ let CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme = let BuildValScheme declKind partialArityInfoOpt prelimScheme = let (PrelimVal2(id, typeScheme, _, memberInfoOpt, isMutable, inlineFlag, baseOrThis, _, vis, isCompGen, hasDeclaredTypars)) = prelimScheme - let valReprInfo = + let valReprInfoOpt = + partialArityInfoOpt + |> Option.map (InferGenericArityFromTyScheme typeScheme) + + let valReprInfo, valReprInfoForDisplay = if DeclKind.MustHaveArity declKind then - Option.map (InferGenericArityFromTyScheme typeScheme) partialArityInfoOpt + valReprInfoOpt, None else - None + None, valReprInfoOpt let isTyFunc = ComputeIsTyFunc(id, hasDeclaredTypars, valReprInfo) - ValScheme(id, typeScheme, valReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, false, isTyFunc, hasDeclaredTypars) + ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, false, isTyFunc, hasDeclaredTypars) let UseCombinedArity g declKind rhsExpr prelimScheme = - let partialArityInfoOpt = CombineSyntacticAndInferredArities g declKind rhsExpr prelimScheme + let partialArityInfoOpt = CombineSyntacticAndInferredArities g rhsExpr prelimScheme BuildValScheme declKind partialArityInfoOpt prelimScheme let UseNoArity prelimScheme = @@ -10229,7 +10239,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt | [] -> valSynData | {Range=mHead} :: _ -> let (SynValData(valMf, SynValInfo(args, SynArgInfo(attrs, opt, retId)), valId)) = valSynData - in SynValData(valMf, SynValInfo(args, SynArgInfo({Attributes=rotRetSynAttrs; Range=mHead} :: attrs, opt, retId)), valId) + SynValData(valMf, SynValInfo(args, SynArgInfo({Attributes=rotRetSynAttrs; Range=mHead} :: attrs, opt, retId)), valId) retAttribs, valAttribs, valSynData let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute valAttribs @@ -10779,7 +10789,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds // If the overall declaration is declaring statics or a module value, then force the patternInputTmp to also // have representation as module value. - if (DeclKind.MustHaveArity declKind) then + if DeclKind.MustHaveArity declKind then AdjustValToTopVal tmp altActualParent (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes tmp rhsExpr) tmp, checkedPat @@ -11355,9 +11365,9 @@ and AnalyzeAndMakeAndPublishRecursiveValue // NOTE: top arity, type and typars get fixed-up after inference let prelimTyscheme = GeneralizedType(enclosingDeclaredTypars@declaredTypars, ty) let prelimValReprInfo = TranslateSynValInfo mBinding (TcAttributes cenv envinner) valSynInfo - let valReprInfo = UseSyntacticArity declKind prelimTyscheme prelimValReprInfo + let valReprInfo, valReprInfoForDisplay = UseSyntacticArity declKind prelimTyscheme prelimValReprInfo let hasDeclaredTypars = not (List.isEmpty declaredTypars) - let prelimValScheme = ValScheme(bindingId, prelimTyscheme, valReprInfo, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) + let prelimValScheme = ValScheme(bindingId, prelimTyscheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) // Check the literal r.h.s., if any let _, literalValue = TcLiteral cenv ty envinner tpenv (bindingAttribs, bindingExpr) diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 831a4cf9b20..8b5f1878532 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -584,12 +584,13 @@ type RecursiveBindingInfo = [] type CheckedBindingInfo -/// Represnts the results of the second phase of checking simple values +/// Represents the results of the second phase of checking simple values type ValScheme = | ValScheme of id: Ident * typeScheme: GeneralizedType * valReprInfo: ValReprInfo option * + valReprInfoForDisplay: ValReprInfo option * memberInfo: PrelimMemberInfo option * isMutable: bool * inlineInfo: ValInline * diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index f4371e3c925..f225a9927e8 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -133,7 +133,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, ctorTy) let isComplete = ComputeIsComplete copyOfTyconTypars [] ctorTy let varReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let ctorValScheme = ValScheme(id, prelimTyschemeG, Some varReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) + let ctorValScheme = ValScheme(id, prelimTyschemeG, Some varReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, vis, false, true, false, false) let paramNames = varReprInfo.ArgNames let xmlDoc = xmlDoc.ToXmlDoc(true, Some paramNames) let ctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValInRecScope isComplete, ctorValScheme, attribs, xmlDoc, None, false) @@ -154,7 +154,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let prelimValReprInfo = TranslateSynValInfo m (TcAttributes cenv env) valSynData let prelimTyschemeG = GeneralizedType(copyOfTyconTypars, cctorTy) let valReprInfo = InferGenericArityFromTyScheme prelimTyschemeG prelimValReprInfo - let cctorValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) + let cctorValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, Some (SynAccess.Private Range.Zero), false, true, false, false) let cctorVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, cctorValScheme, [(* no attributes*)], XmlDoc.Empty, None, false) cctorArgs, cctorVal, cctorValScheme @@ -162,7 +162,7 @@ let TcImplicitCtorLhs_Phase2A(cenv: cenv, env, tpenv, tcref: TyconRef, vis, attr let thisVal = // --- Create this for use inside constructor let thisId = ident ("this", m) - let thisValScheme = ValScheme(thisId, NonGenericTypeScheme thisTy, None, None, false, ValInline.Never, CtorThisVal, None, true, false, false, false) + let thisValScheme = ValScheme(thisId, NonGenericTypeScheme thisTy, None, None, None, false, ValInline.Never, CtorThisVal, None, true, false, false, false) let thisVal = MakeAndPublishVal cenv env (ParentNone, false, ClassLetBinding false, ValNotInRecScope, thisValScheme, [], XmlDoc.Empty, None, false) thisVal @@ -350,7 +350,7 @@ type IncrClassReprInfo = // NOTE: putting isCompilerGenerated=true here is strange. The method is not public, nor is // it a "member" in the F# sense, but the F# spec says it is generated and it is reasonable to reflect on it. - let memberValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) + let memberValScheme = ValScheme(id, prelimTyschemeG, Some valReprInfo, None, Some memberInfo, false, ValInline.Never, NormalVal, None, true (* isCompilerGenerated *), true (* isIncrClass *), false, false) let methodVal = MakeAndPublishVal cenv env (Parent tcref, false, ModuleOrMemberBinding, ValNotInRecScope, memberValScheme, v.Attribs, XmlDoc.Empty, None, false) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 3a398620de9..6d8b38c7956 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1270,7 +1270,8 @@ module PrintTastMemberOrVals = let layoutNonMemberVal denv (tps, v: Val, tau, cxs) = let env = SimplifyTypes.CollectInfo true [tau] cxs let cxs = env.postfixConstraints - let argInfos, retTy = GetTopTauTypeInFSharpForm denv.g (arityOfVal v).ArgInfos tau v.Range + let valReprInfo = arityOfValForDisplay v + let argInfos, retTy = GetTopTauTypeInFSharpForm denv.g valReprInfo.ArgInfos tau v.Range let nameL = let tagF = diff --git a/src/Compiler/CodeGen/EraseClosures.fs b/src/Compiler/CodeGen/EraseClosures.fs index 6f6646177a5..5ba6c4b50a0 100644 --- a/src/Compiler/CodeGen/EraseClosures.fs +++ b/src/Compiler/CodeGen/EraseClosures.fs @@ -500,9 +500,11 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = // nb. should combine the term and type abstraction cases for // to allow for term and type variables to be mixed in a single // application. - if (match laterStruct with - | Lambdas_return _ -> false - | _ -> true) then + if + (match laterStruct with + | Lambdas_return _ -> false + | _ -> true) + then let nowStruct = List.foldBack (fun x y -> Lambdas_forall(x, y)) tyargsl (Lambdas_return nowReturnTy) @@ -622,9 +624,11 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let nowReturnTy = mkTyOfLambdas cenv laterStruct // CASE 2a - Too Many Term Arguments or Remaining Type arguments - Split the Closure Class in Two - if (match laterStruct with - | Lambdas_return _ -> false - | _ -> true) then + if + (match laterStruct with + | Lambdas_return _ -> false + | _ -> true) + then let nowStruct = List.foldBack (fun l r -> Lambdas_lambda(l, r)) nowParams (Lambdas_return nowReturnTy) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 1e4b3c1f591..626ddd49758 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -76,7 +76,8 @@ type UnionReprDecisions<'Union, 'Alt, 'Type> if alts.Length = 1 then SingleCase elif - not (isStruct cu) && alts.Length < TaggingThresholdFixedConstant + not (isStruct cu) + && alts.Length < TaggingThresholdFixedConstant && not (repr.RepresentAllAlternativesAsConstantFieldsInRootClass cu) then RuntimeTypes @@ -1280,12 +1281,14 @@ let mkClassUnionDef ] let ctorMeths = - if (List.isEmpty selfFields - && List.isEmpty tagFieldsInObject - && not (List.isEmpty selfMeths)) - || isStruct - || cud.UnionCases - |> Array.forall (fun alt -> repr.RepresentAlternativeAsFreshInstancesOfRootClass(info, alt)) then + if + (List.isEmpty selfFields + && List.isEmpty tagFieldsInObject + && not (List.isEmpty selfMeths)) + || isStruct + || cud.UnionCases + |> Array.forall (fun alt -> repr.RepresentAlternativeAsFreshInstancesOfRootClass(info, alt)) + then [] (* no need for a second ctor in these cases *) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 1bf87805a0b..c39508fc595 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -210,7 +210,11 @@ let ReportStatistics (oc: TextWriter) = reports oc let NewCounter nm = let mutable count = 0 - AddReport(fun oc -> if count <> 0 then oc.WriteLine(string count + " " + nm)) + + AddReport(fun oc -> + if count <> 0 then + oc.WriteLine(string count + " " + nm)) + (fun () -> count <- count + 1) let CountClosure = NewCounter "closures" @@ -653,9 +657,11 @@ and GenNamedTyAppAux (cenv: cenv) m (tyenv: TypeReprEnv) ptrsOK tcref tinst = | _ -> let tinst = DropErasedTyargs tinst // See above note on ptrsOK - if ptrsOK = PtrTypesOK - && tyconRefEq g tcref g.nativeptr_tcr - && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty then + if + ptrsOK = PtrTypesOK + && tyconRefEq g tcref g.nativeptr_tcr + && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty + then GenNamedTyAppAux cenv m tyenv ptrsOK g.ilsigptr_tcr tinst else #if !NO_TYPEPROVIDERS @@ -1910,7 +1916,8 @@ type TypeDefBuilder(tdef: ILTypeDef, tdefDiscards) = | Some (mdefDiscard, _) -> mdefDiscard ilMethodDef | None -> false - if not discard then gmethods.Add ilMethodDef + if not discard then + gmethods.Add ilMethodDef member _.NestedTypeDefs = gnested @@ -1924,7 +1931,8 @@ type TypeDefBuilder(tdef: ILTypeDef, tdefDiscards) = | Some (_, pdefDiscard) -> pdefDiscard pdef | None -> false - if not discard then AddPropertyDefToHash m gproperties pdef + if not discard then + AddPropertyDefToHash m gproperties pdef member _.PrependInstructionsToSpecificMethodDef(cond, instrs, tag, imports) = match ResizeArray.tryFindIndex cond gmethods with @@ -2138,7 +2146,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu lmtyp ) - if isStruct then tycon.SetIsStructRecordOrUnion true + if isStruct then + tycon.SetIsStructRecordOrUnion true tycon.entity_tycon_repr <- TFSharpRecdRepr( @@ -2470,10 +2479,12 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs member private _.EnsureNopBetweenDebugPoints() = // Always add a nop between debug points to help .NET get the stepping right // Don't do this after a FeeFee marker for hidden code - if (codebuf.Count > 0 - && (match codebuf[codebuf.Count - 1] with - | I_seqpoint sm when sm.Line <> FeeFee mgbuf.cenv -> true - | _ -> false)) then + if + (codebuf.Count > 0 + && (match codebuf[codebuf.Count - 1] with + | I_seqpoint sm when sm.Line <> FeeFee mgbuf.cenv -> true + | _ -> false)) + then codebuf.Add(AI_nop) @@ -2599,11 +2610,13 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs let instrs = instrs |> Array.mapi (fun idx i2 -> - if idx = 0 - && (match i2 with - | AI_nop -> true - | _ -> false) - && anyDocument.IsSome then + if + idx = 0 + && (match i2 with + | AI_nop -> true + | _ -> false) + && anyDocument.IsSome + then // This special dummy debug point says skip the start of the method hasDebugPoints <- true FeeFeeInstr mgbuf.cenv anyDocument.Value @@ -2842,7 +2855,8 @@ 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 yield k.Name + if Range.equals m k.Range then + yield k.Name ] |> String.concat "," @@ -3553,9 +3567,11 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = // InitializeArray is a JIT intrinsic that will result in invalid runtime CodeGen when initializing an array // of enum types. Until bug 872799 is fixed, we'll need to generate arrays the "simple" way for enum types // Also note - C# never uses InitializeArray for enum types, so this change puts us on equal footing with them. - if elems.Length <= 5 - || not cenv.options.emitConstantArraysUsingStaticDataBlobs - || (isEnumTy cenv.g elemTy) then + if + elems.Length <= 5 + || not cenv.options.emitConstantArraysUsingStaticDataBlobs + || (isEnumTy cenv.g elemTy) + then GenNewArraySimple cenv cgbuf eenv (elems, elemTy, m) sequel else // Try to emit a constant byte-blob array @@ -3648,10 +3664,12 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = | _ -> false), (fun _ _ -> failwith "unreachable") - if elemsArray - |> Array.forall (function - | Expr.Const (c, _, _) -> test c - | _ -> false) then + if + elemsArray + |> Array.forall (function + | Expr.Const (c, _, _) -> test c + | _ -> false) + then let ilElemTy = GenType cenv m eenv.tyenv elemTy GenConstArray cenv cgbuf eenv ilElemTy elemsArray (fun buf -> @@ -3667,10 +3685,12 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = let g = cenv.g // Is this an upcast? - if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty - && - // Do an extra check - should not be needed - TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty then + if + TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty + && + // Do an extra check - should not be needed + TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty + then if isInterfaceTy g tgty then GenExpr cenv cgbuf eenv e Continue let ilToTy = GenType cenv m eenv.tyenv tgty @@ -3838,8 +3858,10 @@ and GenFieldGet isStatic cenv cgbuf eenv (rfref: RecdFieldRef, tyargs, m) = let fspec = GenRecdFieldRef m cenv eenv.tyenv rfref tyargs let vol = if rfref.RecdField.IsVolatile then Volatile else Nonvolatile - if useGenuineField rfref.Tycon rfref.RecdField - || entityRefInThisAssembly cenv.g.compilingFSharpCore rfref.TyconRef then + if + useGenuineField rfref.Tycon rfref.RecdField + || entityRefInThisAssembly cenv.g.compilingFSharpCore rfref.TyconRef + then let instr = if isStatic then I_ldsfld(vol, fspec) @@ -4306,9 +4328,11 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = // When generating debug code, generate a 'nop' after a 'call' that returns 'void' // This is what C# does, as it allows the call location to be maintained correctly in the stack frame - if cenv.options.generateDebugSymbols - && mustGenerateUnitAfterCall - && (isTailCall = Normalcall) then + if + cenv.options.generateDebugSymbols + && mustGenerateUnitAfterCall + && (isTailCall = Normalcall) + then CG.EmitInstr cgbuf (pop 0) Push0 AI_nop if isNil laterArgs then @@ -4352,22 +4376,24 @@ and CanTailcall // Can't tailcall with a struct object arg since it involves a byref // Can't tailcall with a .NET 2.0 generic constrained call since it involves a byref - if not hasStructObjArg - && Option.isNone ccallInfo - && not withinSEH - && not hasByrefArg - && not isDllImport - && not isSelfInit - && not makesNoCriticalTailcalls - && - - // We can tailcall even if we need to generate "unit", as long as we're about to throw the value away anyway as par of the return. - // We can tailcall if we don't need to generate "unit", as long as we're about to return. - (match sequelIgnoreEndScopes sequel with - | ReturnVoid - | Return -> not mustGenerateUnitAfterCall - | DiscardThen ReturnVoid -> mustGenerateUnitAfterCall - | _ -> false) then + if + not hasStructObjArg + && Option.isNone ccallInfo + && not withinSEH + && not hasByrefArg + && not isDllImport + && not isSelfInit + && not makesNoCriticalTailcalls + && + + // We can tailcall even if we need to generate "unit", as long as we're about to throw the value away anyway as par of the return. + // We can tailcall if we don't need to generate "unit", as long as we're about to return. + (match sequelIgnoreEndScopes sequel with + | ReturnVoid + | Return -> not mustGenerateUnitAfterCall + | DiscardThen ReturnVoid -> mustGenerateUnitAfterCall + | _ -> false) + then Tailcall else Normalcall @@ -5562,9 +5588,11 @@ 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 (System.Char.IsLower nm[1])) then + elif + nm.Length >= 1 + && nm[0] = 'T' + && (nm.Length = 1 || not (System.Char.IsLower nm[1])) + then nm else "T" + (String.capitalize nm) @@ -5874,14 +5902,13 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel let finfo = match - infoReader.GetRecordOrClassFieldsOfType - ( - Some fieldName, - AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, - m, - templateStructTy - ) - with + infoReader.GetRecordOrClassFieldsOfType( + Some fieldName, + AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, + m, + templateStructTy + ) + with | [ finfo ] -> finfo | _ -> error (InternalError(sprintf "expected class field %s not found" fieldName, m)) @@ -5894,14 +5921,13 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel let finfo = match - infoReader.GetRecordOrClassFieldsOfType - ( - Some fieldName, - AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, - m, - templateStructTy - ) - with + infoReader.GetRecordOrClassFieldsOfType( + Some fieldName, + AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere, + m, + templateStructTy + ) + with | [ finfo ] -> finfo | _ -> error (InternalError(sprintf "expected class field %s not found" fieldName, m)) @@ -5939,7 +5965,7 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere imethName interfaceTy - with + with | [ meth ] when meth.IsInstance -> meth | _ -> error (InternalError(sprintf "expected method %s not found" imethName, m)) @@ -5989,7 +6015,7 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel AccessibilityLogic.AccessorDomain.AccessibleFromSomewhere imethName interfaceTy - with + with | [ meth ] when meth.IsInstance -> meth | _ -> error (InternalError(sprintf "expected method %s not found" imethName, m)) @@ -8093,9 +8119,11 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = // Workaround for .NET and Visual Studio restriction w.r.t debugger type proxys // Mark internal constructors in internal classes as public. let access = - if access = ILMemberAccess.Assembly - && vspec.IsConstructor - && IsHiddenTycon eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref then + if + access = ILMemberAccess.Assembly + && vspec.IsConstructor + && IsHiddenTycon eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref + then ILMemberAccess.Public else access @@ -8488,8 +8516,10 @@ and GenMarshal cenv attribs = match decoder.FindTypeName "SafeArrayUserDefinedSubType" "" with | "" -> None | res -> - if (safeArraySubType = ILNativeVariant.IDispatch) - || (safeArraySubType = ILNativeVariant.IUnknown) then + if + (safeArraySubType = ILNativeVariant.IDispatch) + || (safeArraySubType = ILNativeVariant.IUnknown) + then Some res else None @@ -8856,8 +8886,10 @@ and GenMethodForBinding |> AddStorageForLocalVals cenv.g (List.mapi (fun i v -> (v, Arg(numArgsUsed + i))) nonUnitNonSelfMethodVars) let eenvForMeth = - if eenvForMeth.initLocals - && HasFSharpAttribute g g.attrib_SkipLocalsInitAttribute v.Attribs then + if + eenvForMeth.initLocals + && HasFSharpAttribute g g.attrib_SkipLocalsInitAttribute v.Attribs + then { eenvForMeth with initLocals = false } else eenvForMeth @@ -8905,8 +8937,10 @@ and GenMethodForBinding let attr = TryFindFSharpBoolAttributeAssumeFalse cenv.g cenv.g.attrib_NoDynamicInvocationAttribute v.Attribs - if (not generateWitnessArgs && attr.IsSome) - || (generateWitnessArgs && attr = Some false) then + if + (not generateWitnessArgs && attr.IsSome) + || (generateWitnessArgs && attr = Some false) + then let exnArg = mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported (v.CompiledName g.CompilerGlobalState)) @@ -8939,7 +8973,7 @@ and GenMethodForBinding match v.Attribs |> List.tryFind (IsMatchingFSharpAttribute g g.attrib_CompiledNameAttribute) - with + with | Some (Attrib (_, _, [ AttribStringArg b ], _, _, _, _)) -> [ mkCompilationSourceNameAttr g v.LogicalName ], Some b | _ -> [], None @@ -9010,9 +9044,11 @@ and GenMethodForBinding -> let useMethodImpl = - if compileAsInstance - && ((memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) - || memberInfo.MemberFlags.IsOverrideOrExplicitImpl) then + if + compileAsInstance + && ((memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) + || memberInfo.MemberFlags.IsOverrideOrExplicitImpl) + then let useMethodImpl = ComputeUseMethodImpl cenv.g v @@ -9068,8 +9104,10 @@ and GenMethodForBinding if not compileAsInstance then mkILStaticMethod (ilMethTypars, mspec.Name, access, ilParams, ilReturn, ilMethodBody) - elif (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) - || memberInfo.MemberFlags.IsOverrideOrExplicitImpl then + elif + (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) + || memberInfo.MemberFlags.IsOverrideOrExplicitImpl + then let flagFixups = ComputeFlagFixupsForMemberBinding cenv v @@ -9197,7 +9235,8 @@ and GenMethodForBinding mdef.Name.StartsWithOrdinal("|") || // event add/remove method - v.val_flags.IsGeneratedEventVal then + v.val_flags.IsGeneratedEventVal + then mdef.WithSpecialName else mdef @@ -9763,7 +9802,8 @@ and GenTypeDefForCompLoc (cenv, eenv, mgbuf: AssemblyBuilder, cloc, hidden, attr TypeNameForImplicitMainMethod cloc TypeNameForInitClass cloc TypeNameForPrivateImplementationDetails cloc - ] then + ] + then [] else [ mkCompilationMappingAttr g (int SourceConstructFlags.Module) ]) @@ -9899,10 +9939,12 @@ and GenModuleBinding cenv (cgbuf: CodeGenBuffer) (qname: QualifiedNameOfFile) la // If the module has a .cctor for some mutable fields, we need to ensure that when // those fields are "touched" the InitClass .cctor is forced. The InitClass .cctor will // then fill in the value of the mutable fields. - if not mspec.IsNamespace - && (cgbuf.mgbuf.GetCurrentFields(TypeRefForCompLoc eenvinner.cloc) - |> Seq.isEmpty - |> not) then + if + not mspec.IsNamespace + && (cgbuf.mgbuf.GetCurrentFields(TypeRefForCompLoc eenvinner.cloc) + |> Seq.isEmpty + |> not) + then GenForceWholeFileInitializationAsPartOfCCtor cenv cgbuf.mgbuf @@ -10386,11 +10428,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // HOWEVER, if the type doesn't override Object.Equals already. let augmentOverrideMethodDefs = - (if Option.isNone tycon.GeneratedCompareToValues - && Option.isNone tycon.GeneratedHashAndEqualsValues - && tycon.HasInterface g g.mk_IComparable_ty - && not (tycon.HasOverride g "Equals" [ g.obj_ty ]) - && not tycon.IsFSharpInterfaceTycon then + (if + Option.isNone tycon.GeneratedCompareToValues + && Option.isNone tycon.GeneratedHashAndEqualsValues + && tycon.HasInterface g g.mk_IComparable_ty + && not (tycon.HasOverride g "Equals" [ g.obj_ty ]) + && not tycon.IsFSharpInterfaceTycon + then [ GenEqualsOverrideCallingIComparable cenv (tcref, ilThisTy, ilThisTy) ] else []) @@ -10602,7 +10646,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = [ // If using a field then all the attributes go on the field // See also FSharp 1.0 Bug 4727: once we start compiling them as real mutable fields, you should not be able to target both "property" for "val mutable" fields in classes - if useGenuineField then yield! fspec.PropertyAttribs + if useGenuineField then + yield! fspec.PropertyAttribs yield! fspec.FieldAttribs ] @@ -10866,9 +10911,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // FSharp 1.0 bug 1988: Explicitly setting the ComVisible(true) attribute on an F# type causes an F# record to be emitted in a way that enables mutation for COM interop scenarios // FSharp 3.0 feature: adding CLIMutable to a record type causes emit of default constructor, and all fields get property setters // Records that are value types do not create a default constructor with CLIMutable or ComVisible - if not isStructRecord - && (isCLIMutable - || (TryFindFSharpBoolAttribute g g.attrib_ComVisibleAttribute tycon.Attribs = Some true)) then + if + not isStructRecord + && (isCLIMutable + || (TryFindFSharpBoolAttribute g g.attrib_ComVisibleAttribute tycon.Attribs = Some true)) + then yield mkILSimpleStorageCtor (Some g.ilg.typ_Object.TypeSpec, ilThisTy, [], [], reprAccess, None, eenv.imports) if not (tycon.HasMember g "ToString" []) then @@ -11034,11 +11081,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // All structs are sequential by default // Structs with no instance fields get size 1, pack 0 - if tycon.AllFieldsArray |> Array.exists (fun f -> not f.IsStatic) - || - // Reflection emit doesn't let us emit 'pack' and 'size' for generic structs. - // In that case we generate a dummy field instead - (cenv.options.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) then + if + tycon.AllFieldsArray |> Array.exists (fun f -> not f.IsStatic) + || + // Reflection emit doesn't let us emit 'pack' and 'size' for generic structs. + // In that case we generate a dummy field instead + (cenv.options.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) + then ILTypeDefLayout.Sequential { Size = None; Pack = None }, ILDefaultPInvokeEncoding.Ansi else ILTypeDefLayout.Sequential { Size = Some 1; Pack = Some 0us }, ILDefaultPInvokeEncoding.Ansi @@ -11103,9 +11152,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let layout = if isStructTy g thisTy then - if (match ilTypeDefKind with - | ILTypeDefKind.ValueType -> true - | _ -> false) then + if + (match ilTypeDefKind with + | ILTypeDefKind.ValueType -> true + | _ -> false) + then // Structs with no instance fields get size 1, pack 0 ILTypeDefLayout.Sequential { Size = Some 1; Pack = Some 0us } else @@ -11206,9 +11257,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // order in the sequential initialization of the file. // // In this case, the .cctor for this type must force the .cctor of the backing static class for the file. - if tycon.TyparsNoRange.IsEmpty - && tycon.MembersOfFSharpTyconSorted - |> List.exists (fun vref -> vref.Deref.IsClassConstructor) then + if + tycon.TyparsNoRange.IsEmpty + && tycon.MembersOfFSharpTyconSorted + |> List.exists (fun vref -> vref.Deref.IsClassConstructor) + then GenForceWholeFileInitializationAsPartOfCCtor cenv mgbuf lazyInitInfo tref eenv.imports m /// Generate the type for an F# exception declaration. diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index b1bca1b6092..2786e30e9a3 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -859,7 +859,8 @@ type TcConfigBuilder = | None -> () | Some n -> // nowarn:62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- true + if n = 62 then + tcConfigB.mlCompatibility <- true tcConfigB.diagnosticsOptions <- { tcConfigB.diagnosticsOptions with @@ -873,7 +874,8 @@ type TcConfigBuilder = | None -> () | Some n -> // warnon 62 turns on mlCompatibility, e.g. shows ML compat items in intellisense menus - if n = 62 then tcConfigB.mlCompatibility <- false + if n = 62 then + tcConfigB.mlCompatibility <- false tcConfigB.diagnosticsOptions <- { tcConfigB.diagnosticsOptions with @@ -941,11 +943,10 @@ type TcConfigBuilder = if FileSystem.IsInvalidPathShim path then warning (Error(FSComp.SR.buildInvalidAssemblyName (path), m)) elif - not - ( - tcConfigB.referencedDLLs - |> List.exists (fun ar2 -> equals m ar2.Range && path = ar2.Text) - ) + not ( + tcConfigB.referencedDLLs + |> List.exists (fun ar2 -> equals m ar2.Range && path = ar2.Text) + ) then // NOTE: We keep same paths if range is different. let projectReference = tcConfigB.projectReferences @@ -1052,9 +1053,10 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = else None - match data.referencedDLLs - |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) - with + match + data.referencedDLLs + |> List.filter (fun assemblyReference -> assemblyReference.SimpleAssemblyNameIs libraryName) + with | [] -> defaultCoreLibraryReference, None | [ r ] | r :: _ -> nameOfDll r @@ -1179,7 +1181,9 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = let frameworkRootVersion = Path.Combine(frameworkRoot, targetFrameworkVersionValue) yield frameworkRootVersion let facades = Path.Combine(frameworkRootVersion, "Facades") - if FileSystem.DirectoryExistsShim facades then yield facades + + if FileSystem.DirectoryExistsShim facades then + yield facades match data.FxResolver.GetFrameworkRefsPackDirectory() with | Some path when FileSystem.DirectoryExistsShim(path) -> yield path diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index f8fd613b267..fba0a064091 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1673,7 +1673,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Some (cex, false) -> os.AppendString(MatchIncomplete2E().Format cex) | Some (cex, true) -> os.AppendString(MatchIncomplete3E().Format cex) - if isComp then os.AppendString(MatchIncomplete4E().Format) + if isComp then + os.AppendString(MatchIncomplete4E().Format) | PatternMatchCompilation.EnumMatchIncomplete (isComp, cexOpt, _) -> os.AppendString(EnumMatchIncomplete1E().Format) @@ -1683,7 +1684,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Some (cex, false) -> os.AppendString(MatchIncomplete2E().Format cex) | Some (cex, true) -> os.AppendString(MatchIncomplete3E().Format cex) - if isComp then os.AppendString(MatchIncomplete4E().Format) + if isComp then + os.AppendString(MatchIncomplete4E().Format) | PatternMatchCompilation.RuleNeverMatched _ -> os.AppendString(RuleNeverMatchedE().Format) @@ -1695,7 +1697,9 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | ObsoleteWarning (s, _) -> os.AppendString(Obsolete1E().Format) - if s <> "" then os.AppendString(Obsolete2E().Format s) + + if s <> "" then + os.AppendString(Obsolete2E().Format s) | Experimental (s, _) -> os.AppendString(ExperimentalE().Format s) @@ -1990,7 +1994,8 @@ let CollectFormattedDiagnostics // Show prefix only for real files. Otherwise, we just want a truncated error like: // parse error FS0031: blah blah if - not (equals m range0) && not (equals m rangeStartup) + not (equals m range0) + && not (equals m rangeStartup) && not (equals m rangeCmdArgs) then let file = file.Replace("/", "\\") diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 515bb1b3868..1e63aa45dd5 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -402,7 +402,8 @@ type TcConfig with seq { yield! tcConfig.GetSearchPathsForLibraryFiles() - if isHashRReference m then Path.GetDirectoryName(m.FileName) + if isHashRReference m then + Path.GetDirectoryName(m.FileName) } let resolved = TryResolveFileUsingPaths(searchPaths, m, nm) @@ -592,8 +593,10 @@ type TcConfig with // O(N^2) here over a small set of referenced assemblies. let IsResolved (originalName: string) = - if resultingResolutions - |> List.exists (fun resolution -> resolution.originalReference.Text = originalName) then + if + resultingResolutions + |> List.exists (fun resolution -> resolution.originalReference.Text = originalName) + then true else // MSBuild resolution may have unified the result of two duplicate references. Try to re-resolve now. @@ -615,8 +618,10 @@ type TcConfig with // If mode=Speculative, then we haven't reported any errors. // We report the error condition by returning an empty list of resolutions - if mode = ResolveAssemblyReferenceMode.Speculative - && unresolvedReferences.Length > 0 then + if + mode = ResolveAssemblyReferenceMode.Speculative + && unresolvedReferences.Length > 0 + then [], unresolved else resultingResolutions, unresolved @@ -736,7 +741,8 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, resolutions.Length = 1 - if found then asm + if found then + asm if tcConfig.implicitlyReferenceDotNetAssemblies then let references, _useDotNetFramework = @@ -1097,7 +1103,9 @@ and [] TcImports let mutable disposed = false // this doesn't need locking, it's only for debugging let mutable tcGlobals = None // this doesn't need locking, it's set during construction of the TcImports - let CheckDisposed () = if disposed then assert false + let CheckDisposed () = + if disposed then + assert false let dispose () = CheckDisposed() @@ -1116,8 +1124,11 @@ and [] TcImports let unsuccessful = [ for ccuThunk, func in contents do - if ccuThunk.IsUnresolvedReference then func () - if ccuThunk.IsUnresolvedReference then (ccuThunk, func) + if ccuThunk.IsUnresolvedReference then + func () + + if ccuThunk.IsUnresolvedReference then + (ccuThunk, func) ] ccuThunks <- ResizeArray unsuccessful) diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index e33e311eb86..b8fbfbe4f91 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -288,9 +288,11 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler let getSwitchOpt (opt: string) = // if opt is a switch, strip the '+' or '-' - if opt <> "--" - && opt.Length > 1 - && (opt.EndsWithOrdinal("+") || opt.EndsWithOrdinal("-")) then + if + opt <> "--" + && opt.Length > 1 + && (opt.EndsWithOrdinal("+") || opt.EndsWithOrdinal("-")) + then opt[0 .. opt.Length - 2] else opt @@ -368,7 +370,10 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler | CompilerOption (s, _, OptionString f, d, _) as compilerOption :: _ when optToken = s -> reportDeprecatedOption d let oa = getOptionArg compilerOption argString - if oa <> "" then f (getOptionArg compilerOption oa) + + if oa <> "" then + f (getOptionArg compilerOption oa) + t | CompilerOption (s, _, OptionInt f, d, _) as compilerOption :: _ when optToken = s -> reportDeprecatedOption d @@ -1234,7 +1239,9 @@ let noFrameworkFlag isFsc tcConfigB = tagNone, OptionUnit(fun () -> tcConfigB.implicitlyReferenceDotNetAssemblies <- false - if isFsc then tcConfigB.implicitlyResolveAssemblies <- false), + + if isFsc then + tcConfigB.implicitlyResolveAssemblies <- false), None, Some(FSComp.SR.optsNoframework ()) ) diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 9039453478c..55ec3ad40a1 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -195,9 +195,10 @@ module MainModuleBuilder = "System.Runtime.Numerics" let numericsAssemblyRef = - match tcImports.GetImportedAssemblies() - |> List.tryFind (fun a -> a.FSharpViewOfMetadata.AssemblyName = refNumericsDllName) - with + match + tcImports.GetImportedAssemblies() + |> List.tryFind (fun a -> a.FSharpViewOfMetadata.AssemblyName = refNumericsDllName) + with | Some asm -> match asm.ILScopeRef with | ILScopeRef.Assembly aref -> Some aref @@ -581,10 +582,12 @@ module MainModuleBuilder = tcConfig.win32manifest // 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.win32res = "") - || runningOnMono then + elif + not (tcConfig.target.IsExe) + || not (tcConfig.includewin32manifest) + || not (tcConfig.win32res = "") + || runningOnMono + then "" // otherwise, include the default manifest else @@ -617,9 +620,11 @@ module MainModuleBuilder = tcConfig.target = CompilerTarget.Dll )) |] - if tcConfig.win32res = "" - && tcConfig.win32icon <> "" - && tcConfig.target <> CompilerTarget.Dll then + if + tcConfig.win32res = "" + && tcConfig.win32icon <> "" + && tcConfig.target <> CompilerTarget.Dll + then use ms = new MemoryStream() use iconStream = FileSystem.OpenFileForReadShim(tcConfig.win32icon) Win32ResourceConversions.AppendIconToResourceStream(ms, iconStream) diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index 2d1eb4ce7ae..d769b36678e 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -492,13 +492,14 @@ type internal FxResolver defaultMscorlibVersion // Get the ProductVersion of this framework compare with table compatible monikers - match desktopProductVersionMonikers - |> Array.tryFind (fun (major, minor, build, revision, _) -> - (majorPart >= major) - && (minorPart >= minor) - && (buildPart >= build) - && (privatePart >= revision)) - with + match + desktopProductVersionMonikers + |> Array.tryFind (fun (major, minor, build, revision, _) -> + (majorPart >= major) + && (minorPart >= minor) + && (buildPart >= build) + && (privatePart >= revision)) + with | Some (_, _, _, _, moniker) -> moniker | None -> // no TFM could be found, assume latest stable? @@ -653,7 +654,8 @@ type internal FxResolver "System.Configuration" getFSharpCoreLibraryName - if useFsiAuxLib then fsiLibraryName + if useFsiAuxLib then + fsiLibraryName // always include a default reference to System.ValueTuple.dll in scripts and out-of-project sources match getSystemValueTupleImplementationReference () with @@ -687,7 +689,8 @@ type internal FxResolver [ yield! Directory.GetFiles(implDir, "*.dll") getFSharpCoreImplementationReference () - if useFsiAuxLib then getFsiLibraryImplementationReference () + if useFsiAuxLib then + getFsiLibraryImplementationReference () ] (getDependenciesOf roots).Values |> Seq.toList @@ -979,7 +982,8 @@ type internal FxResolver [ yield! Directory.GetFiles(path, "*.dll") getFSharpCoreImplementationReference () - if useFsiAuxLib then getFsiLibraryImplementationReference () + if useFsiAuxLib then + getFsiLibraryImplementationReference () ] |> List.filter (fun f -> systemAssemblies.Contains(Path.GetFileNameWithoutExtension(f))) diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index bd8a76ab674..fc276a711a0 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -232,8 +232,10 @@ let GenerateIlxCode ) = let mainMethodInfo = - if (tcConfig.target = CompilerTarget.Dll) - || (tcConfig.target = CompilerTarget.Module) then + if + (tcConfig.target = CompilerTarget.Dll) + || (tcConfig.target = CompilerTarget.Module) + then None else Some topAttrs.mainMethodAttrs diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 3470f97a8af..6d764f264dd 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -617,7 +617,8 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam ) // Report the statistics for testing purposes - if tcConfig.reportNumDecls then ReportParsingStatistics res + if tcConfig.reportNumDecls then + ReportParsingStatistics res res) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 67adfb1e8de..868a9f80cae 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -98,7 +98,8 @@ module ScriptPreprocessClosure = let seen = Dictionary<_, bool>() member _.SetSeen check = - if not (seen.ContainsKey check) then seen.Add(check, true) + if not (seen.ContainsKey check) then + seen.Add(check, true) member _.HaveSeen check = seen.ContainsKey check diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index 6c23eb9b024..5ad9ff15f40 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -304,8 +304,10 @@ let FindDependentILModulesForStaticLinking (ctok, tcConfig: TcConfig, tcImports: let ilAssemRef = List.head remaining remaining <- List.tail remaining - if assumedIndependentSet.Contains ilAssemRef.Name - || (ilAssemRef.PublicKey = Some ecmaPublicKey) then + if + assumedIndependentSet.Contains ilAssemRef.Name + || (ilAssemRef.PublicKey = Some ecmaPublicKey) + then depModuleTable[ilAssemRef.Name] <- dummyEntry ilAssemRef.Name else if not (depModuleTable.ContainsKey ilAssemRef.Name) then match tcImports.TryFindDllInfo(ctok, rangeStartup, ilAssemRef.Name, lookupOnly = false) with @@ -502,10 +504,11 @@ let StaticLink (ctok, tcConfig: TcConfig, tcImports: TcImports, ilGlobals: ILGlo | Some provAssemStaticLinkInfo -> (importedBinary, provAssemStaticLinkInfo) ] #endif - if not tcConfig.standalone - && tcConfig.extraStaticLinkRoots.IsEmpty + if + not tcConfig.standalone + && tcConfig.extraStaticLinkRoots.IsEmpty #if !NO_TYPEPROVIDERS - && providerGeneratedAssemblies.IsEmpty + && providerGeneratedAssemblies.IsEmpty #endif then id diff --git a/src/Compiler/Driver/XmlDocFileWriter.fs b/src/Compiler/Driver/XmlDocFileWriter.fs index 97125744ace..fe6ac2a3fac 100644 --- a/src/Compiler/Driver/XmlDocFileWriter.fs +++ b/src/Compiler/Driver/XmlDocFileWriter.fs @@ -63,7 +63,8 @@ module XmlDocWriter = let ptext = defaultArg path "" - if mspec.IsModule then doModuleMemberSig ptext mspec + if mspec.IsModule then + doModuleMemberSig ptext mspec let vals = mtype.AllValsAndMembers @@ -116,7 +117,9 @@ module XmlDocWriter = let rec doModule (mspec: ModuleOrNamespace) = let mtype = mspec.ModuleOrNamespaceType - if mspec.IsModule then modulMember mspec + + if mspec.IsModule then + modulMember mspec let vals = mtype.AllValsAndMembers diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index b0519d50a8d..84fd4742d6d 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -149,7 +149,8 @@ type ConsoleLoggerProvider() = /// Notify the exiter if any error has occurred let AbortOnError (diagnosticsLogger: DiagnosticsLogger, exiter: Exiter) = - if diagnosticsLogger.ErrorCount > 0 then exiter.Exit 1 + if diagnosticsLogger.ErrorCount > 0 then + exiter.Exit 1 let TypeCheck ( @@ -382,7 +383,8 @@ module InterfaceFileWriter = for impl in declaredImpls do writeToFile os impl - if tcConfig.printSignatureFile <> "" then os.Dispose() + if tcConfig.printSignatureFile <> "" then + os.Dispose() let extensionForFile (filePath: string) = if (List.exists (FileSystemUtils.checkSuffix filePath) FSharpMLCompatFileSuffixes) then @@ -489,11 +491,13 @@ let main1 // See Bug 735819 let lcidFromCodePage = - if (Console.OutputEncoding.CodePage <> 65001) - && (Console.OutputEncoding.CodePage - <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) - && (Console.OutputEncoding.CodePage - <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) then + if + (Console.OutputEncoding.CodePage <> 65001) + && (Console.OutputEncoding.CodePage + <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) + && (Console.OutputEncoding.CodePage + <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + then Thread.CurrentThread.CurrentUICulture <- CultureInfo("en-US") Some 1033 else @@ -553,7 +557,8 @@ let main1 tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines // Display the banner text, if necessary - if not bannerAlreadyPrinted then DisplayBannerText tcConfigB + if not bannerAlreadyPrinted then + DisplayBannerText tcConfigB // Create tcGlobals and frameworkTcImports let outfile, pdbfile, assemblyName = @@ -633,7 +638,8 @@ let main1 printfn "%+A" input printf "\n" - if tcConfig.parseOnly then exiter.Exit 0 + if tcConfig.parseOnly then + exiter.Exit 0 if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) @@ -659,7 +665,8 @@ let main1 if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) - if tcConfig.importAllReferencesOnly then exiter.Exit 0 + if tcConfig.importAllReferencesOnly then + exiter.Exit 0 // Build the initial type checking environment ReportTime tcConfig "Typecheck" @@ -912,7 +919,8 @@ let main2 ilSourceDocs)) = - if tcConfig.typeCheckOnly then exiter.Exit 0 + if tcConfig.typeCheckOnly then + exiter.Exit 0 generatedCcu.Contents.SetAttribs(generatedCcu.Contents.Attribs @ topAttrs.assemblyAttrs) @@ -945,7 +953,7 @@ let main2 "AssemblyVersionAttribute" topAttrs.assemblyAttrs tcConfig.deterministic - with + with | Some v -> match tcConfig.version with | VersionNone -> Some v @@ -1351,9 +1359,11 @@ let main6 AbortOnError(diagnosticsLogger, exiter) // Don't copy referenced FSharp.core.dll if we are building FSharp.Core.dll - if (tcConfig.copyFSharpCore = CopyFSharpCoreFlag.Yes) - && not tcConfig.compilingFSharpCore - && not tcConfig.standalone then + if + (tcConfig.copyFSharpCore = CopyFSharpCoreFlag.Yes) + && not tcConfig.compilingFSharpCore + && not tcConfig.standalone + then CopyFSharpCore(outfile, tcConfig.referencedDLLs) ReportTime tcConfig "Exiting" diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index d11ae3d895b..c7f4e0ce0f0 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -381,8 +381,10 @@ type internal TypeCheckInfo if contained then match bestAlmostIncludedSoFar with | Some (rightm: range, _, _) -> - if posGt possm.End rightm.End - || (posEq possm.End rightm.End && posGt possm.Start rightm.Start) then + if + posGt possm.End rightm.End + || (posEq possm.End rightm.End && posGt possm.Start rightm.Start) + then bestAlmostIncludedSoFar <- Some(possm, env, ad) | _ -> bestAlmostIncludedSoFar <- Some(possm, env, ad)) @@ -914,9 +916,10 @@ type internal TypeCheckInfo match TryToResolveLongIdentAsType ncenv nenv m plid with | Some x -> tryTcrefOfAppTy g x | None -> - match lastDotPos - |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) - with + match + lastDotPos + |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) + with | Some p when lineStr[p] = '.' -> match FindFirstNonWhitespacePosition lineStr (p - 1) with | Some colAtEndOfNames -> @@ -1154,7 +1157,7 @@ type internal TypeCheckInfo match GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid, false) |> toCompletionItems - with + with | [], _, _ -> // no record fields found, return completion list as if we were outside any computation expression GetDeclaredItems( @@ -2395,19 +2398,22 @@ module internal ParseAndCheckFile = let errors = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Error then err + if severity = FSharpDiagnosticSeverity.Error then + err ] let warnings = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Warning then err + if severity = FSharpDiagnosticSeverity.Warning then + err ] let infos = [ for err, severity in diagnostics do - if severity = FSharpDiagnosticSeverity.Info then err + if severity = FSharpDiagnosticSeverity.Info then + err ] let message = HashLoadedSourceHasIssues(infos, warnings, errors, rangeOfHashLoad) diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index 3959c84da3f..c2ee71a022e 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -498,7 +498,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, let findBreakPoints () = let checkRange m = [ - if isMatchRange m && not m.IsSynthetic then yield m + if isMatchRange m && not m.IsSynthetic then + yield m ] let walkBindSeqPt sp = @@ -559,7 +560,8 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | _ -> false // This extends the range of the implicit debug point for 'do expr' range to include the 'do' - if extendDebugPointForDo then yield! checkRange m + if extendDebugPointForDo then + yield! checkRange m let useImplicitDebugPoint = match spInfo with @@ -944,9 +946,10 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, if pos.Column = 0 then // we have a breakpoint that was set with mouse at line start - match locations - |> List.filter (fun m -> m.StartLine = m.EndLine && pos.Line = m.StartLine) - with + match + locations + |> List.filter (fun m -> m.StartLine = m.EndLine && pos.Line = m.StartLine) + with | [] -> match locations |> List.filter (fun m -> rangeContainsPos m pos) with | [] -> diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 2854da14a25..261d6ec094f 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -150,7 +150,9 @@ type ItemKeyStore(mmf: MemoryMappedFile, length) = while reader.Offset < reader.Length do let m = this.ReadRange &reader let keyString2 = this.ReadKeyString &reader - if keyString1.SequenceEqual keyString2 then results.Add m + + if keyString1.SequenceEqual keyString2 then + results.Add m results :> range seq @@ -271,7 +273,9 @@ and [] ItemKeyStoreBuilder() = and writeTypar (isStandalone: bool) (typar: Typar) = match typar.Solution with | Some ty -> writeType isStandalone ty - | _ -> if isStandalone then writeInt64 typar.Stamp + | _ -> + if isStandalone then + writeInt64 typar.Stamp let writeValRef (vref: ValRef) = match vref.MemberInfo with diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index c95195db8ff..bdbc73d783a 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -93,12 +93,14 @@ module TcResolutionsExtensions = | _ -> None let (|KeywordIntrinsicValue|_|) (vref: ValRef) = - if valRefEq g g.raise_vref vref - || valRefEq g g.reraise_vref vref - || valRefEq g g.typeof_vref vref - || valRefEq g g.typedefof_vref vref - || valRefEq g g.sizeof_vref vref - || valRefEq g g.nameof_vref vref then + if + valRefEq g g.raise_vref vref + || valRefEq g g.reraise_vref vref + || valRefEq g g.typeof_vref vref + || valRefEq g g.typedefof_vref vref + || valRefEq g g.sizeof_vref vref + || valRefEq g g.nameof_vref vref + then Some() else None @@ -257,8 +259,10 @@ module TcResolutionsExtensions = match minfos with | [] -> add m SemanticClassificationType.Method | _ -> - if minfos - |> List.forall (fun minfo -> minfo.IsExtensionMember || minfo.IsCSharpStyleExtensionMember) then + if + minfos + |> List.forall (fun minfo -> minfo.IsExtensionMember || minfo.IsCSharpStyleExtensionMember) + then add m SemanticClassificationType.ExtensionMethod else add m SemanticClassificationType.Method diff --git a/src/Compiler/Service/ServiceAnalysis.fs b/src/Compiler/Service/ServiceAnalysis.fs index 09e3545e8ad..38af8f7156c 100644 --- a/src/Compiler/Service/ServiceAnalysis.fs +++ b/src/Compiler/Service/ServiceAnalysis.fs @@ -40,7 +40,8 @@ module UnusedOpens = // fv.IsExtensionMember is always false for C# extension methods returning by `MembersFunctionsAndValues`, // so we have to check Extension attribute instead. // (note: fv.IsExtensionMember has proper value for symbols returning by GetAllUsesOfAllSymbolsInFile though) - if fv.HasAttribute() then fv + if fv.HasAttribute() then + fv for apCase in entity.ActivePatternCases do apCase @@ -429,11 +430,13 @@ module UnusedDeclarations = symbolsUses |> Seq.distinctBy (fun su -> su.Range) // Account for "hidden" uses, like a val in a member val definition. These aren't relevant |> Seq.choose (fun (su: FSharpSymbolUse) -> - if su.IsFromDefinition - && su.Symbol.DeclarationLocation.IsSome - && (isScript || su.IsPrivateToFile) - && not (su.Symbol.DisplayName.StartsWith "_") - && isPotentiallyUnusedDeclaration su.Symbol then + if + su.IsFromDefinition + && su.Symbol.DeclarationLocation.IsSome + && (isScript || su.IsPrivateToFile) + && not (su.Symbol.DisplayName.StartsWith "_") + && isPotentiallyUnusedDeclaration su.Symbol + then Some(su, usages.Contains su.Symbol.DeclarationLocation.Value) else None) diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs index 5458e129ffd..410d02dc786 100644 --- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs +++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs @@ -206,9 +206,11 @@ module InterfaceStubGenerator = let nm = match arg.Name with | None -> - if arg.Type.HasTypeDefinition - && arg.Type.TypeDefinition.CompiledName = "unit" - && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" then + if + arg.Type.HasTypeDefinition + && arg.Type.TypeDefinition.CompiledName = "unit" + && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" + then "()" else sprintf "arg%d" (namesWithIndices |> Map.toSeq |> Seq.map snd |> Seq.sumBy Set.count |> max 1) @@ -303,8 +305,10 @@ module InterfaceStubGenerator = let internal normalizePropertyName (v: FSharpMemberOrFunctionOrValue) = let displayName = v.DisplayName - if (v.IsPropertyGetterMethod && displayName.StartsWithOrdinal("get_")) - || (v.IsPropertySetterMethod && displayName.StartsWithOrdinal("set_")) then + if + (v.IsPropertyGetterMethod && displayName.StartsWithOrdinal("get_")) + || (v.IsPropertySetterMethod && displayName.StartsWithOrdinal("set_")) + then displayName[4..] else displayName @@ -362,7 +366,8 @@ module InterfaceStubGenerator = [ if v.InlineAnnotation = FSharpInlineAnnotation.AlwaysInline then yield "inline" - if v.Accessibility.IsInternal then yield "internal" + if v.Accessibility.IsInternal then + yield "internal" ] let argInfos, retType = getArgTypes ctx v @@ -371,9 +376,13 @@ module InterfaceStubGenerator = // A couple of helper methods for emitting close declarations of members and stub method bodies. let closeDeclaration (returnType: string) (writer: ColumnIndentedTextWriter) = - if verboseMode then writer.Write(": {0}", returnType) + if verboseMode then + writer.Write(": {0}", returnType) + writer.Write(" = ", returnType) - if verboseMode then writer.WriteLine("") + + if verboseMode then + writer.WriteLine("") let writeImplementation (ctx: Context) (writer: ColumnIndentedTextWriter) = match verboseMode, ctx.MethodBody with @@ -435,7 +444,10 @@ module InterfaceStubGenerator = let closeDeclaration = closeDeclaration retType let writeImplementation = writeImplementation ctx let writer = ctx.Writer - if isEventMember v then writer.WriteLine("[]") + + if isEventMember v then + writer.WriteLine("[]") + writer.Write("member ") for modifier in modifiers do @@ -464,7 +476,9 @@ module InterfaceStubGenerator = writer.Write(")") writer.Write(" = ") - if verboseMode then writer.WriteLine("") + + if verboseMode then + writer.WriteLine("") writer |> writeImplementation writer.Unindent ctx.Indentation diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 9ecdbb823a4..9f14d717af2 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -683,8 +683,10 @@ module internal LexerStateEncoding = let kind2 = ((nestingValue &&& 0b000000000011) >>> 0) [ - if tag1 then i1, decodeStringStyle kind1, range0 - if tag2 then i2, decodeStringStyle kind2, range0 + if tag1 then + i1, decodeStringStyle kind1, range0 + if tag2 then + i2, decodeStringStyle kind2, range0 ] (colorState, ncomments, pos, ifDefs, hardwhite, stringKind, stringNest) diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index f162076d44e..68b7eb268f9 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -831,7 +831,9 @@ module NavigateTo = and walkSynModuleOrNamespaceSig (inp: SynModuleOrNamespaceSig) container = let (SynModuleOrNamespaceSig (longId = lid; kind = kind; decls = decls)) = inp let isModule = kind.IsModule - if isModule then addModule lid true container + + if isModule then + addModule lid true container let container = { @@ -900,7 +902,9 @@ module NavigateTo = and walkSynModuleOrNamespace inp container = let (SynModuleOrNamespace (longId = lid; kind = kind; decls = decls)) = inp let isModule = kind.IsModule - if isModule then addModule lid false container + + if isModule then + addModule lid false container let container = { diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index 35b4b777d8a..ff34dd392d4 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -222,8 +222,10 @@ module internal ParameterLocationsImpl = let lidm = lidwd.Range let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End - if SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos - && args |> List.forall isStaticArg then + if + SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos + && args |> List.forall isStaticArg + then let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ] Some( @@ -344,8 +346,10 @@ module internal ParameterLocationsImpl = | None -> let typeArgsm = mkRange openm.FileName openm.Start wholem.End - if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos - && tyArgs |> List.forall isStaticArg then + if + SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos + && tyArgs |> List.forall isStaticArg + then let commasAndCloseParen = [ for c in commas -> c.End ] @ [ wholem.End ] let argRanges = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 32e20db6486..e2eedc9ba47 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -246,14 +246,15 @@ module SyntaxTraversal = else None) diveResults - with + with | [] -> // No entity's range contained the desired position. However the ranges in the parse tree only span actual characters present in the file. // The cursor may be at whitespace between entities or after everything, so find the nearest entity with the range left of the position. let mutable e = diveResults.Head for r in diveResults do - if posGt pos (fst r).Start then e <- r + if posGt pos (fst r).Start then + e <- r snd (e) () | [ x ] -> x () @@ -396,9 +397,11 @@ module SyntaxTraversal = // special-case:caret is located in the offside position below inherit // inherit A() // $ - if not (rangeContainsPos expr.Range pos) - && sepOpt.IsNone - && pos.Column = inheritRange.StartColumn then + if + not (rangeContainsPos expr.Range pos) + && sepOpt.IsNone + && pos.Column = inheritRange.StartColumn + then visitor.VisitRecordField(path, None, None) else traverseSynExpr expr) @@ -451,9 +454,11 @@ module SyntaxTraversal = // special case: caret is below field binding // field x = 5 // $ - if not (rangeContainsPos e.Range pos) - && sepOpt.IsNone - && pos.Column = offsideColumn then + if + not (rangeContainsPos e.Range pos) + && sepOpt.IsNone + && pos.Column = offsideColumn + then visitor.VisitRecordField(path, copyOpt, None) else traverseSynExpr expr) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index f61893d0eaf..757cd90a264 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -1539,7 +1539,9 @@ module ParsedInput = None override this.VisitModuleOrNamespace(_, SynModuleOrNamespace (longId = longId; range = range)) = - if rangeContainsPos range pos then path <- path @ longId + if rangeContainsPos range pos then + path <- path @ longId + None // we should traverse the rest of the AST to find the smallest module } @@ -1916,7 +1918,9 @@ module ParsedInput = List.iter walkAttribute attrs List.iter walkTyparDecl typars List.iter walkTypeConstraint constraints - if isTypeExtensionOrAlias then addLongIdent longIdent + + if isTypeExtensionOrAlias then + addLongIdent longIdent and walkTypeDefnRepr inp = match inp with diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index 8e3a96112ca..995e4e4d3e9 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -319,24 +319,28 @@ module Structure = | SynExpr.App (atomicFlag, isInfix, funcExpr, argExpr, r) -> // seq exprs, custom operators, etc - if ExprAtomicFlag.NonAtomic = atomicFlag - && not isInfix - && (match funcExpr with - | SynExpr.Ident _ -> true - | _ -> false) - && (match argExpr with - | SynExpr.ComputationExpr _ -> false - | _ -> true) then + if + ExprAtomicFlag.NonAtomic = atomicFlag + && not isInfix + && (match funcExpr with + | SynExpr.Ident _ -> true + | _ -> false) + && (match argExpr with + | SynExpr.ComputationExpr _ -> false + | _ -> true) + then // if the argExpr is a computation expression another match will handle the outlining // these cases must be removed to prevent creating unnecessary tags for the same scope let collapse = Range.endToEnd funcExpr.Range r rcheck Scope.SpecialFunc Collapse.Below r collapse - elif ExprAtomicFlag.NonAtomic = atomicFlag - && (not isInfix) - && (match argExpr with - | SynExpr.ComputationExpr _ -> true - | _ -> false) then + elif + ExprAtomicFlag.NonAtomic = atomicFlag + && (not isInfix) + && (match argExpr with + | SynExpr.ComputationExpr _ -> true + | _ -> false) + then let collapse = Range.startToEnd argExpr.Range r let collapse = Range.modBoth 1 1 collapse rcheck Scope.ComputationExpr Collapse.Same r collapse diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 023c0ddfe2a..20fd5956c43 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -334,11 +334,13 @@ type BackgroundCompiler // these cross-project references to FSharp.Core are VisualFSharp.sln and FSharp.sln. The ramification // of this is that you need to build FSharp.Core to get intellisense in those projects. - if (try + if + (try Path.GetFileNameWithoutExtension(nm) - with _ -> - "") - <> GetFSharpCoreLibraryName() then + with _ -> + "") + <> GetFSharpCoreLibraryName() + then { new IProjectReference with member x.EvaluateRawContents() = node { diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index c9b201b9445..67f6c78f558 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -211,7 +211,8 @@ let stringBufferIsBytes (buf: ByteBuffer) = let mutable ok = true for i = 0 to bytes.Length / 2 - 1 do - if bytes.Span[i * 2 + 1] <> 0uy then ok <- false + if bytes.Span[i * 2 + 1] <> 0uy then + ok <- false ok @@ -237,15 +238,20 @@ let hexdigit d = else failwith "hexdigit" let unicodeGraphShort (s: string) = - if s.Length <> 4 then failwith "unicodegraph" + if s.Length <> 4 then + failwith "unicodegraph" + uint16 (hexdigit s[0] * 4096 + hexdigit s[1] * 256 + hexdigit s[2] * 16 + hexdigit s[3]) let hexGraphShort (s: string) = - if s.Length <> 2 then failwith "hexgraph" + if s.Length <> 2 then + failwith "hexgraph" + uint16 (hexdigit s[0] * 16 + hexdigit s[1]) let unicodeGraphLong (s: string) = - if s.Length <> 8 then failwith "unicodeGraphLong" + if s.Length <> 8 then + failwith "unicodeGraphLong" let high = hexdigit s[0] * 4096 + hexdigit s[1] * 256 + hexdigit s[2] * 16 + hexdigit s[3] in diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index bcaebd20b92..ff7a44e98a4 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -25,7 +25,7 @@ open Internal.Utilities.Text.Parsing /// information about the grammar at the point where the error occurred, e.g. what tokens /// are valid to shift next at that point in the grammar. This information is processed in CompileOps.fs. [] -exception SyntaxError of obj (* ParseErrorContext<_> *) * range: range +exception SyntaxError of obj (* ParseErrorContext<_> *) * range: range exception IndentationProblem of string * range diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index ad02a04b1b7..6e25b5c6360 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -527,7 +527,8 @@ let DoesIdentifierNeedBackticks (name: string) : bool = /// A utility to help determine if an identifier needs to be quoted let AddBackticksToIdentifierIfNeeded (name: string) : string = if - DoesIdentifierNeedBackticks name && not (name.StartsWithOrdinal("`")) + DoesIdentifierNeedBackticks name + && not (name.StartsWithOrdinal("`")) && not (name.EndsWithOrdinal("`")) then "``" + name + "``" @@ -820,7 +821,10 @@ let TryDemangleGenericNameAndPos (n: string) = while res && i < n.Length do let char = n[i] - if not (char >= '0' && char <= '9') then res <- false + + if not (char >= '0' && char <= '9') then + res <- false + i <- i + 1 if res then ValueSome pos else ValueNone diff --git a/src/Compiler/SyntaxTree/XmlDoc.fs b/src/Compiler/SyntaxTree/XmlDoc.fs index 81dbde3ca22..72c657d2911 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fs +++ b/src/Compiler/SyntaxTree/XmlDoc.fs @@ -262,7 +262,10 @@ type PreXmlDoc = let lines = Array.map fst preLines let m = Array.reduce unionRanges (Array.map snd preLines) let doc = XmlDoc(lines, m) - if check then doc.Check(paramNamesOpt) + + if check then + doc.Check(paramNamesOpt) + doc member internal x.Range = diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 3b328134868..2d3f8c0943f 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2488,6 +2488,9 @@ type ValOptionalData = /// Used to implement [] mutable val_defn: Expr option + /// Records the "extra information" for a value compiled as a method (rather + /// than a closure or a local), including argument names, attributes etc. + // // MUTABILITY CLEANUP: mutability of this field is used by // -- adjustAllUsesOfRecValue // -- TLR optimizations @@ -2497,6 +2500,10 @@ type ValOptionalData = // type-checked expression. mutable val_repr_info: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). + mutable val_repr_info_for_display: ValReprInfo option + /// How visible is this? /// MUTABILITY: for unpickle linkage mutable val_access: Accessibility @@ -2556,6 +2563,7 @@ type Val = val_const = None val_defn = None val_repr_info = None + val_repr_info_for_display = None val_access = TAccess [] val_xmldoc = XmlDoc.Empty val_member_info = None @@ -2620,6 +2628,11 @@ type Val = | Some optData -> optData.val_repr_info | _ -> None + member x.ValReprInfoForDisplay: ValReprInfo option = + match x.val_opt_data with + | Some optData -> optData.val_repr_info_for_display + | _ -> None + member x.Id = ident(x.LogicalName, x.Range) /// Is this represented as a "top level" static binding (i.e. a static field, static member, @@ -2998,6 +3011,11 @@ type Val = | Some optData -> optData.val_repr_info <- info | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info = info } + member x.SetValReprInfoForDisplay info = + match x.val_opt_data with + | Some optData -> optData.val_repr_info_for_display <- info + | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_repr_info_for_display = info } + member x.SetType ty = x.val_type <- ty member x.SetOtherRange m = @@ -3055,6 +3073,7 @@ type Val = val_other_range = tg.val_other_range val_const = tg.val_const val_defn = tg.val_defn + val_repr_info_for_display = tg.val_repr_info_for_display val_repr_info = tg.val_repr_info val_access = tg.val_access val_xmldoc = tg.val_xmldoc diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index d2a23e73038..cdcf93e4518 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1777,8 +1777,15 @@ type ValOptionalData = /// What is the original, unoptimized, closed-term definition, if any? /// Used to implement [] mutable val_defn: Expr option + + /// Records the "extra information" for a value compiled as a method (rather + /// than a closure or a local), including argument names, attributes etc. mutable val_repr_info: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). + mutable val_repr_info_for_display: ValReprInfo option + /// How visible is this? /// MUTABILITY: for unpickle linkage mutable val_access: Accessibility @@ -1888,6 +1895,8 @@ type Val = member SetValReprInfo: info: ValReprInfo option -> unit + member SetValReprInfoForDisplay: info: ValReprInfo option -> unit + override ToString: unit -> string /// How visible is this value, function or member? @@ -2134,6 +2143,10 @@ type Val = /// represent as "top level" bindings. member ValReprInfo: ValReprInfo option + /// Records the "extra information" for display purposes for expression-level function definitions + /// that may be compiled as closures (that is are not necessarily compiled as top-level methods). + member ValReprInfoForDisplay: ValReprInfo option + /// Get the declared documentation for the value member XmlDoc: XmlDoc diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index b0020664ff7..1ec0b619604 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -26,7 +26,7 @@ let getNameOfScopeRef sref = | ILScopeRef.Assembly aref -> aref.Name | ILScopeRef.PrimaryAssembly -> "" -/// Metadata on values (names of arguments etc. +/// Metadata on values (names of arguments etc.) module ValReprInfo = let unnamedTopArg1: ArgReprInfo = { Attribs=[]; Name=None } @@ -41,6 +41,11 @@ module ValReprInfo = let emptyValData = ValReprInfo([], [], unnamedRetVal) + let IsEmpty info = + match info with + | ValReprInfo([], [], { Attribs = []; Name=None }) -> true + | _ -> false + let InferTyparInfo (tps: Typar list) = tps |> List.map (fun tp -> TyparReprInfo(tp.Id, tp.Kind)) let InferArgReprInfo (v: Val) : ArgReprInfo = { Attribs = []; Name= Some v.Id } @@ -59,7 +64,18 @@ let typesOfVals (v: Val list) = v |> List.map (fun v -> v.Type) let nameOfVal (v: Val) = v.LogicalName -let arityOfVal (v: Val) = (match v.ValReprInfo with None -> ValReprInfo.emptyValData | Some arities -> arities) +let arityOfVal (v: Val) = + match v.ValReprInfo with + | None -> ValReprInfo.emptyValData + | Some info -> info + +let arityOfValForDisplay (v: Val) = + match v.ValReprInfoForDisplay with + | Some info -> info + | None -> + match v.ValReprInfo with + | None -> ValReprInfo.emptyValData + | Some info -> info let tupInfoRef = TupInfo.Const false diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index 246a9e74baa..fe4930a71d7 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -29,6 +29,8 @@ module ValReprInfo = val emptyValData: ValReprInfo + val IsEmpty: ValReprInfo -> bool + val InferTyparInfo: tps: Typar list -> TyparReprInfo list val InferArgReprInfo: v: Val -> ArgReprInfo @@ -45,6 +47,8 @@ val nameOfVal: v: Val -> string val arityOfVal: v: Val -> ValReprInfo +val arityOfValForDisplay: v: Val -> ValReprInfo + val tupInfoRef: TupInfo val tupInfoStruct: TupInfo diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index fd00a1f94bd..cef7fe70b74 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -5359,7 +5359,8 @@ let InferArityOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttri (ids, attribs) ||> List.map2 (fun id attribs -> { Name = id; Attribs = attribs }: ArgReprInfo )) let retInfo: ArgReprInfo = { Attribs = retAttribs; Name = None } - ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) + let info = ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) + if ValReprInfo.IsEmpty info then ValReprInfo.emptyValData else info let InferArityOfExprBinding g allowTypeDirectedDetupling (v: Val) expr = match v.ValReprInfo with diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index eda40c33fb5..3f5ba37afde 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -2353,6 +2353,7 @@ and u_ValData st = val_other_range = (match x1a with None -> None | Some(_, b) -> Some(b, true)) val_defn = None val_repr_info = x10 + val_repr_info_for_display = None val_const = x14 val_access = x13 val_xmldoc = defaultArg x15 XmlDoc.Empty diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index 465adeac51d..bdd64e87b69 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -127,7 +127,8 @@ type ByteArrayMemory(bytes: byte[], offset, length) = ByteArrayMemory(Array.empty, 0, 0) :> ByteMemory override _.CopyTo stream = - if length > 0 then stream.Write(bytes, offset, length) + if length > 0 then + stream.Write(bytes, offset, length) override _.Copy(srcOffset, dest, destOffset, count) = checkCount count @@ -412,7 +413,8 @@ module internal FileSystemUtils = let checkSuffix (path: string) (suffix: string) = path.EndsWithOrdinalIgnoreCase(suffix) let hasExtensionWithValidate (validate: bool) (s: string) = - if validate then (checkPathForIllegalChars s) + if validate then + (checkPathForIllegalChars s) let sLen = s.Length @@ -437,7 +439,8 @@ module internal FileSystemUtils = Path.GetFileName(path) let fileNameWithoutExtensionWithValidate (validate: bool) path = - if validate then checkPathForIllegalChars path + if validate then + checkPathForIllegalChars path Path.GetFileNameWithoutExtension(path) @@ -563,7 +566,8 @@ type DefaultFileSystem() as this = let stream = new MemoryMappedStream(mmf, length) - if not stream.CanRead then invalidOp "Cannot read file" + if not stream.CanRead then + invalidOp "Cannot read file" stream :> Stream @@ -881,7 +885,8 @@ type internal ByteStream = } member b.ReadByte() = - if b.pos >= b.max then failwith "end of stream" + if b.pos >= b.max then + failwith "end of stream" let res = b.bytes[b.pos] b.pos <- b.pos + 1 @@ -948,7 +953,8 @@ type internal ByteBuffer = Bytes.blit old 0 buf.bbArray 0 buf.bbCurrent - if buf.useArrayPool then ArrayPool.Shared.Return old + if buf.useArrayPool then + ArrayPool.Shared.Return old member buf.AsMemory() = buf.CheckDisposed() diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index cb750676fe3..b88af5d77eb 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -170,7 +170,8 @@ type internal HashMultiMap<'Key, 'Value>(size: int, comparer: IEqualityComparer< member s.Remove(x) = match s.TryFind x.Key with | Some v -> - if Unchecked.equals v x.Value then s.Remove(x.Key) + if Unchecked.equals v x.Value then + s.Remove(x.Key) true | _ -> false diff --git a/src/Compiler/Utilities/ImmutableArray.fs b/src/Compiler/Utilities/ImmutableArray.fs index 5311efa5e0c..985799856c0 100644 --- a/src/Compiler/Utilities/ImmutableArray.fs +++ b/src/Compiler/Utilities/ImmutableArray.fs @@ -18,7 +18,8 @@ module ImmutableArray = | 0 -> ImmutableArray.Empty | 1 -> ImmutableArray.Create(f 0) | n -> - if n < 0 then invalidArg "n" "Below zero." + if n < 0 then + invalidArg "n" "Below zero." let builder = ImmutableArray.CreateBuilder(n) @@ -180,7 +181,8 @@ module ImmutableArray = let builder = ImmutableArray.CreateBuilder(arr.Length) for i = 0 to arr.Length - 1 do - if predicate arr[i] then builder.Add(arr[i]) + if predicate arr[i] then + builder.Add(arr[i]) builder.Capacity <- builder.Count builder.MoveToImmutable() @@ -199,7 +201,8 @@ module ImmutableArray = for i = 0 to arr.Length - 1 do let result = chooser arr[i] - if result.IsSome then builder.Add(result.Value) + if result.IsSome then + builder.Add(result.Value) builder.Capacity <- builder.Count builder.MoveToImmutable() diff --git a/src/Compiler/Utilities/ResizeArray.fs b/src/Compiler/Utilities/ResizeArray.fs index e96c775f972..cd6e405129c 100644 --- a/src/Compiler/Utilities/ResizeArray.fs +++ b/src/Compiler/Utilities/ResizeArray.fs @@ -26,7 +26,8 @@ module internal ResizeArray = if start2 < 0 then invalidArg "start2" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start1 + len > length arr1 then invalidArg "start1" "(start1+len) out of range" @@ -52,7 +53,8 @@ module internal ResizeArray = if start < 0 then invalidArg "start" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start + len > length arr then invalidArg "len" "length must be positive" @@ -63,7 +65,8 @@ module internal ResizeArray = if start < 0 then invalidArg "start" "index must be positive" - if len < 0 then invalidArg "len" "length must be positive" + if len < 0 then + invalidArg "len" "length must be positive" if start + len > length arr then invalidArg "len" "length must be positive" @@ -203,7 +206,9 @@ module internal ResizeArray = for i = 0 to length arr - 1 do let x = arr[i] - if f x then res.Add(x) + + if f x then + res.Add(x) res diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 7d99073da91..3c1172aec7d 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -199,7 +199,8 @@ module Array = let mutable i = 0 while eq && i < len do - if not (inp[i] === res[i]) then eq <- false + if not (inp[i] === res[i]) then + eq <- false i <- i + 1 @@ -1082,9 +1083,11 @@ type MemoizationTable<'T, 'U>(compute: 'T -> 'U, keyComparer: IEqualityComparer< let table = new ConcurrentDictionary<'T, 'U>(keyComparer) member t.Apply x = - if (match canMemoize with - | None -> true - | Some f -> f x) then + if + (match canMemoize with + | None -> true + | Some f -> f x) + then match table.TryGetValue x with | true, res -> res | _ -> diff --git a/src/Compiler/Utilities/range.fs b/src/Compiler/Utilities/range.fs index 035a5de80f4..bbd6a9f0673 100755 --- a/src/Compiler/Utilities/range.fs +++ b/src/Compiler/Utilities/range.fs @@ -343,9 +343,11 @@ type Range(code1: int64, code2: int64) = member m.DebugCode = let name = m.FileName - if name = unknownFileName - || name = startupFileName - || name = commandLineArgsFileName then + if + name = unknownFileName + || name = startupFileName + || name = commandLineArgsFileName + then name else @@ -460,20 +462,26 @@ module Range = else // If all identical then return m1. This preserves NotedSourceConstruct when no merging takes place - if m1.Code1 = m2.Code1 && m1.Code2 = m2.Code2 then + if + m1.Code1 = m2.Code1 && m1.Code2 = m2.Code2 + then m1 else let start = - if (m1.StartLine > m2.StartLine - || (m1.StartLine = m2.StartLine && m1.StartColumn > m2.StartColumn)) then + if + (m1.StartLine > m2.StartLine + || (m1.StartLine = m2.StartLine && m1.StartColumn > m2.StartColumn)) + then m2 else m1 let finish = - if (m1.EndLine > m2.EndLine - || (m1.EndLine = m2.EndLine && m1.EndColumn > m2.EndColumn)) then + if + (m1.EndLine > m2.EndLine + || (m1.EndLine = m2.EndLine && m1.EndColumn > m2.EndColumn)) + then m1 else m2 diff --git a/src/Compiler/Utilities/sformat.fs b/src/Compiler/Utilities/sformat.fs index 2c2a4096573..42b13e28ff9 100644 --- a/src/Compiler/Utilities/sformat.fs +++ b/src/Compiler/Utilities/sformat.fs @@ -632,7 +632,8 @@ module Display = Breaks(next + 1, outer, stack) let popBreak (Breaks (next, outer, stack)) = - if next = 0 then raise (Failure "popBreak: underflow") + if next = 0 then + raise (Failure "popBreak: underflow") let topBroke = stack[next - 1] < 0 @@ -1312,12 +1313,14 @@ module Display = let possibleKeyValueL v = let tyv = v.GetType() - if word = "map" - && (match v with - | null -> false - | _ -> true) - && tyv.IsGenericType - && tyv.GetGenericTypeDefinition() = typedefof> then + if + word = "map" + && (match v with + | null -> false + | _ -> true) + && tyv.IsGenericType + && tyv.GetGenericTypeDefinition() = typedefof> + then nestedObjL depthLim Precedence.BracketIfTuple @@ -1529,8 +1532,10 @@ module Display = "-infinity" elif Double.IsPositiveInfinity(d) then "infinity" - elif opts.FloatingPointFormat[0] = 'g' - && String.forall (fun c -> Char.IsDigit(c) || c = '-') s then + elif + opts.FloatingPointFormat[0] = 'g' + && String.forall (fun c -> Char.IsDigit(c) || c = '-') s + then s + ".0" else s @@ -1545,11 +1550,13 @@ module Display = "-infinity" elif Single.IsPositiveInfinity(d) then "infinity" - elif opts.FloatingPointFormat.Length >= 1 - && opts.FloatingPointFormat[0] = 'g' - && float32 (Int32.MinValue) < d - && d < float32 (Int32.MaxValue) - && float32 (int32 (d)) = d then + elif + opts.FloatingPointFormat.Length >= 1 + && opts.FloatingPointFormat[0] = 'g' + && float32 (Int32.MinValue) < d + && d < float32 (Int32.MaxValue) + && float32 (int32 (d)) = d + then (Convert.ToInt32 d).ToString(opts.FormatProvider) + ".0" else d.ToString(opts.FloatingPointFormat, opts.FormatProvider)) diff --git a/src/FSharp.Build/FSharpEmbedResXSource.fs b/src/FSharp.Build/FSharpEmbedResXSource.fs index 39d44f052eb..4b34660b2a8 100644 --- a/src/FSharp.Build/FSharpEmbedResXSource.fs +++ b/src/FSharp.Build/FSharpEmbedResXSource.fs @@ -41,9 +41,11 @@ module internal {1} = let sourcePath = Path.Combine(_outputPath, justFileName + ".fs") // simple up-to-date check - if File.Exists(resx) - && File.Exists(sourcePath) - && File.GetLastWriteTimeUtc(resx) <= File.GetLastWriteTimeUtc(sourcePath) then + if + File.Exists(resx) + && File.Exists(sourcePath) + && File.GetLastWriteTimeUtc(resx) <= File.GetLastWriteTimeUtc(sourcePath) + then printMessage (sprintf "Skipping generation: '%s' since it is up-to-date." sourcePath) Some(sourcePath) else diff --git a/src/FSharp.Core/QueryExtensions.fs b/src/FSharp.Core/QueryExtensions.fs index f9d0ffd72fb..220618ae563 100644 --- a/src/FSharp.Core/QueryExtensions.fs +++ b/src/FSharp.Core/QueryExtensions.fs @@ -212,7 +212,7 @@ module internal Adapters = type ConversionDescription = | TupleConv of ConversionDescription list | RecordConv of Type * ConversionDescription list - | GroupingConv (* origKeyType: *) of Type (* origElemType: *) * Type * ConversionDescription + | GroupingConv (* origKeyType: *) of Type (* origElemType: *) * Type * ConversionDescription | SeqConv of ConversionDescription | NoConv diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 1dff8103bda..8c2fa8470fa 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -17,7 +17,8 @@ open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators module Array = let inline checkNonNull argName arg = - if isNull arg then nullArg argName + if isNull arg then + nullArg argName let inline indexNotFound () = raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) @@ -1601,7 +1602,9 @@ module Array = for i = 1 to array.Length - 1 do let curr = array.[i] - if curr < acc then acc <- curr + + if curr < acc then + acc <- curr acc @@ -1636,7 +1639,9 @@ module Array = for i = 1 to array.Length - 1 do let curr = array.[i] - if curr > acc then acc <- curr + + if curr > acc then + acc <- curr acc diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 46cd93a84ee..e907040c94c 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -412,7 +412,8 @@ type AsyncActivation<'T>(contents: AsyncActivationContents<'T>) = ok <- true res finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() member ctxt.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) = let holder = contents.aux.trampolineHolder @@ -486,7 +487,8 @@ module AsyncPrimitives = result <- userCode arg ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then AsyncActivation<'T>.HijackCheckThenCall ctxt ctxt.cont result @@ -508,7 +510,8 @@ module AsyncPrimitives = result <- part2 result1 ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then Invoke result ctxt @@ -525,7 +528,8 @@ module AsyncPrimitives = res <- userCode result1 ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then res.Invoke ctxt else fake () @@ -543,7 +547,8 @@ module AsyncPrimitives = resOpt <- filterFunction (edi.GetAssociatedSourceException()) ok <- true finally - if not ok then ctxt.OnExceptionRaised() + if not ok then + ctxt.OnExceptionRaised() if ok then match resOpt with @@ -990,7 +995,9 @@ module AsyncPrimitives = else // In this case the ResultCell has already been disposed, e.g. due to a timeout. // The result is dropped on the floor. - if disposed then + if + disposed + then [] else result <- Some res diff --git a/src/FSharp.Core/eventmodule.fs b/src/FSharp.Core/eventmodule.fs index cd9dc68a76d..fc3c2eabd64 100644 --- a/src/FSharp.Core/eventmodule.fs +++ b/src/FSharp.Core/eventmodule.fs @@ -22,7 +22,11 @@ module Event = [] let filter predicate (sourceEvent: IEvent<'Delegate, 'T>) = let ev = new Event<_>() - sourceEvent.Add(fun x -> if predicate x then ev.Trigger x) + + sourceEvent.Add(fun x -> + if predicate x then + ev.Trigger x) + ev.Publish [] diff --git a/src/FSharp.Core/list.fs b/src/FSharp.Core/list.fs index fbf8089610d..e0dff3d7adb 100644 --- a/src/FSharp.Core/list.fs +++ b/src/FSharp.Core/list.fs @@ -15,7 +15,8 @@ open System.Collections.Generic module List = let inline checkNonNull argName arg = - if isNull arg then nullArg argName + if isNull arg then + nullArg argName let inline indexNotFound () = raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) @@ -742,7 +743,8 @@ module List = let mutable acc = h for x in t do - if x > acc then acc <- x + if x > acc then + acc <- x acc @@ -771,7 +773,8 @@ module List = let mutable acc = h for x in t do - if x < acc then acc <- x + if x < acc then + acc <- x acc @@ -910,7 +913,9 @@ module List = match curr with | [] -> invalidArg "index" "index must be within bounds of the list" | h :: t -> - if i < index then coll.Add(h) //items before index we keep + if i < index then + coll.Add(h) //items before index we keep + curr <- t i <- i + 1 diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 0d510239f32..9fad005450e 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -1040,7 +1040,8 @@ and KeyCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value>) parent.ContainsKey x member _.CopyTo(arr, index) = - if isNull arr then nullArg "arr" + if isNull arr then + nullArg "arr" if index < 0 then invalidArg "index" "index must be positive" @@ -1090,7 +1091,8 @@ and ValueCollection<'Key, 'Value when 'Key: comparison>(parent: Map<'Key, 'Value parent.Exists(fun _ value -> Unchecked.equals value x) member _.CopyTo(arr, index) = - if isNull arr then nullArg "arr" + if isNull arr then + nullArg "arr" if index < 0 then invalidArg "index" "index must be positive" diff --git a/src/FSharp.Core/observable.fs b/src/FSharp.Core/observable.fs index d1bcd160313..eb34c62c850 100644 --- a/src/FSharp.Core/observable.fs +++ b/src/FSharp.Core/observable.fs @@ -12,11 +12,12 @@ open Microsoft.FSharp.Control module Observable = let inline protect f succeed fail = - match (try - Choice1Of2(f ()) - with e -> - Choice2Of2 e) - with + match + (try + Choice1Of2(f ()) + with e -> + Choice2Of2 e) + with | Choice1Of2 x -> (succeed x) | Choice2Of2 e -> (fail e) @@ -34,7 +35,8 @@ module Observable = interface IObserver<'T> with member x.OnNext value = - if not stopped then x.Next value + if not stopped then + x.Next value member x.OnError e = if not stopped then @@ -166,7 +168,8 @@ module Observable = source1.Subscribe { new IObserver<'T> with member x.OnNext(v) = - if not stopped then observer.OnNext v + if not stopped then + observer.OnNext v member x.OnError(e) = if not stopped then @@ -186,7 +189,8 @@ module Observable = source2.Subscribe { new IObserver<'T> with member x.OnNext(v) = - if not stopped then observer.OnNext v + if not stopped then + observer.OnNext v member x.OnError(e) = if not stopped then diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index a309d9c1816..54ca7e2e3c4 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -1469,9 +1469,11 @@ module Patterns = else // If a known-number-of-arguments-including-object-argument has been given then check that - if (match knownArgCount with - | ValueNone -> false - | ValueSome n -> n <> (if methInfo.IsStatic then 0 else 1) + nargTs) then + if + (match knownArgCount with + | ValueNone -> false + | ValueSome n -> n <> (if methInfo.IsStatic then 0 else 1) + nargTs) + then false else diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 4bc089765fb..76dbb87c490 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -1172,10 +1172,12 @@ type FSharpType = // No assembly passed therefore just get framework local version of Tuple let asm = typeof.Assembly - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType false asm types @@ -1183,10 +1185,12 @@ type FSharpType = static member MakeTupleType(asm: Assembly, types: Type[]) = checkNonNull "types" types - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType false asm types @@ -1194,10 +1198,12 @@ type FSharpType = static member MakeStructTupleType(asm: Assembly, types: Type[]) = checkNonNull "types" types - if types - |> Array.exists (function - | null -> true - | _ -> false) then + if + types + |> Array.exists (function + | null -> true + | _ -> false) + then invalidArg "types" (SR.GetString(SR.nullsNotAllowedInArray)) mkTupleType true asm types diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index b04ecfa3ec8..18d89ce07f7 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -214,7 +214,9 @@ module Internal = member _.Current = box (get ()) member _.MoveNext() = - if not started then started <- true + if not started then + started <- true + curr <- None while (curr.IsNone && e.MoveNext()) do @@ -244,7 +246,9 @@ module Internal = member _.MoveNext() = let rec next () = - if not started then started <- true + if not started then + started <- true + e.MoveNext() && (f e.Current || next ()) next () @@ -304,7 +308,8 @@ module Internal = current <- (Unchecked.defaultof<_>) // cache node unprimed, initialised on demand. let getCurrent () = - if index = unstarted then notStarted () + if index = unstarted then + notStarted () if index = completed then alreadyFinished () @@ -507,7 +512,8 @@ module Internal = interface System.IDisposable with member _.Dispose() = - if not finished then disposeG g + if not finished then + disposeG g // Internal type, used to optimize Enumerator/Generator chains type LazyGeneratorWrappingEnumerator<'T>(e: IEnumerator<'T>) = @@ -791,7 +797,9 @@ module Seq = while (Option.isNone res && e.MoveNext()) do let c = e.Current - if predicate c then res <- Some c + + if predicate c then + res <- Some c res @@ -1316,7 +1324,8 @@ module Seq = let hashSet = HashSet<'T>(HashIdentity.Structural<'T>) for v in source do - if hashSet.Add v then yield v + if hashSet.Add v then + yield v } [] @@ -1484,7 +1493,9 @@ module Seq = while e.MoveNext() do let curr = e.Current - if curr < acc then acc <- curr + + if curr < acc then + acc <- curr acc @@ -1522,7 +1533,9 @@ module Seq = while e.MoveNext() do let curr = e.Current - if curr > acc then acc <- curr + + if curr > acc then + acc <- curr acc @@ -1593,8 +1606,10 @@ module Seq = let mutable ok = false while e.MoveNext() do - if (latest <- e.Current - (ok || not (predicate latest))) then + if + (latest <- e.Current + (ok || not (predicate latest))) + then ok <- true yield latest } @@ -1741,11 +1756,15 @@ module Seq = if e.MoveNext() then let cached = HashSet(itemsToExclude, HashIdentity.Structural) let next = e.Current - if cached.Add next then yield next + + if cached.Add next then + yield next while e.MoveNext() do let next = e.Current - if cached.Add next then yield next + + if cached.Add next then + yield next } [] @@ -1794,7 +1813,9 @@ module Seq = let mutable i = 0 for item in source do - if i <> index then yield item + if i <> index then + yield item + i <- i + 1 if i <= index then @@ -1848,11 +1869,14 @@ module Seq = let mutable i = 0 for item in source do - if i = index then yield value + if i = index then + yield value + yield item i <- i + 1 - if i = index then yield value + if i = index then + yield value if i < index then invalidArg "index" "index must be within bounds of the array" @@ -1867,11 +1891,14 @@ module Seq = let mutable i = 0 for item in source do - if i = index then yield! values + if i = index then + yield! values + yield item i <- i + 1 - if i = index then yield! values // support inserting at the end + if i = index then + yield! values // support inserting at the end if i < index then invalidArg "index" "index must be within bounds of the array" diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs index 6d2a990efc2..8a1b526837a 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs @@ -308,7 +308,9 @@ module internal Utilities = // Use enabled feeds only (see NuGet.Commands.ListSourceRunner.Run) and strip off the flags. if source.Length > 0 && source.[0] = 'E' then let pos = source.IndexOf(" ") - if pos >= 0 then "i", source.Substring(pos).Trim() + + if pos >= 0 then + "i", source.Substring(pos).Trim() } let computeSha256HashOfBytes (bytes: byte[]) : byte[] = SHA256.Create().ComputeHash(bytes) diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 9eae6cba0e4..ebdf21af60d 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -26,8 +26,10 @@ let main (argv) = let compilerName = // the 64 bit desktop version of the compiler is name fscAnyCpu.exe, all others are fsc.exe - if Environment.Is64BitProcess - && typeof.Assembly.GetName().Name <> "System.Private.CoreLib" then + if + Environment.Is64BitProcess + && typeof.Assembly.GetName().Name <> "System.Private.CoreLib" + then "fscAnyCpu.exe" else "fsc.exe" diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 05f242990b2..b64849394d3 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -247,8 +247,10 @@ type internal ReadLineConsole() = checkLeftEdge false let writeChar (c) = - if Console.CursorTop = Console.BufferHeight - 1 - && Console.CursorLeft = Console.BufferWidth - 1 then + if + Console.CursorTop = Console.BufferHeight - 1 + && Console.CursorLeft = Console.BufferWidth - 1 + then //printf "bottom right!\n" anchor <- { anchor with top = (anchor).top - 1 } @@ -278,7 +280,8 @@ type internal ReadLineConsole() = let mutable position = -1 for i = 0 to input.Length - 1 do - if (i = curr) then position <- output.Length + if (i = curr) then + position <- output.Length let c = input.Chars(i) @@ -287,7 +290,8 @@ type internal ReadLineConsole() = else output.Append(c) |> ignore - if (curr = input.Length) then position <- output.Length + if (curr = input.Length) then + position <- output.Length // render the current text, computing a new value for "rendered" let old_rendered = rendered @@ -419,7 +423,8 @@ type internal ReadLineConsole() = if (line = "\x1A") then null else - if (line.Length > 0) then history.AddLast(line) + if (line.Length > 0) then + history.AddLast(line) line diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index b94a152c171..ae6513f00cc 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -411,8 +411,10 @@ let MainMain argv = || x = "/shadowcopyreferences+" || x = "--shadowcopyreferences+") - if AppDomain.CurrentDomain.IsDefaultAppDomain() - && argv |> Array.exists isShadowCopy then + if + AppDomain.CurrentDomain.IsDefaultAppDomain() + && argv |> Array.exists isShadowCopy + then let setupInformation = AppDomain.CurrentDomain.SetupInformation setupInformation.ShadowCopyFiles <- "true" let helper = AppDomain.CreateDomain("FSI_Domain", null, setupInformation) diff --git a/tests/scripts/identifierAnalysisByType.fsx b/tests/scripts/identifierAnalysisByType.fsx new file mode 100644 index 00000000000..7ac8de7a20b --- /dev/null +++ b/tests/scripts/identifierAnalysisByType.fsx @@ -0,0 +1,152 @@ +// Print some stats about identifiers grouped by type +// + +#r "nuget: Ionide.ProjInfo" +#I @"..\..\artifacts\bin\fsc\Debug\net6.0\" +#r "FSharp.Compiler.Service.dll" + +open System +open System.IO +open Ionide.ProjInfo +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols +open Ionide.ProjInfo.Types + +let argv = fsi.CommandLineArgs + +if argv.Length = 1 then + eprintfn "usage:" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx " + eprintfn "" + eprintfn "examples:" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx src/FSharp.Build/FSharp.Build.fsproj" + eprintfn " dotnet fsi tests/scripts/identifierAnalysisByType.fsx src/Compiler/FSharp.Compiler.Service.fsproj" + eprintfn "" + eprintfn "Sample output is at https://gist.github.com/dsyme/abfa11bebf0713251418906d55c08804" + +//let projectFile = Path.Combine(__SOURCE_DIRECTORY__, @"..\..\src\Compiler\FSharp.Compiler.Service.fsproj") +//let projectFile = Path.Combine(__SOURCE_DIRECTORY__, @"..\..\src\FSharp.Build\FSharp.Build.fsproj") +let projectFile = Path.GetFullPath(argv[1]) + +let cwd = System.Environment.CurrentDirectory |> System.IO.DirectoryInfo + +let _toolsPath = Init.init cwd None + +printfn "Cracking project options...." +let opts = + match ProjectLoader.getProjectInfo projectFile [] BinaryLogGeneration.Off [] with + | Result.Ok res -> res + | Result.Error err -> failwithf "%s" err + +let checker = FSharpChecker.Create() + +let checkerOpts = checker.GetProjectOptionsFromCommandLineArgs(projectFile, [| yield! opts.SourceFiles; yield! opts.OtherOptions |] ) + +printfn "Checking project...." +let results = checker.ParseAndCheckProject(checkerOpts) |> Async.RunSynchronously + +printfn "Grouping symbol uses...." +let symbols = results.GetAllUsesOfAllSymbols() + +let rec stripTy (ty: FSharpType) = + if ty.IsAbbreviation then stripTy ty.AbbreviatedType else ty + +let getTypeText (sym: FSharpMemberOrFunctionOrValue) = + let ty = stripTy sym.FullType + FSharpType.Prettify(ty).Format(FSharpDisplayContext.Empty) + +symbols +|> Array.choose (fun vUse -> match vUse.Symbol with :? FSharpMemberOrFunctionOrValue as v -> Some (v, vUse.Range) | _ -> None) +|> Array.filter (fun (v, _) -> v.GenericParameters.Count = 0) +|> Array.filter (fun (v, _) -> v.CurriedParameterGroups.Count = 0) +|> Array.filter (fun (v, _) -> not v.FullType.IsGenericParameter) +|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse) +|> Array.filter (fun (vTypeText, v, _) -> + match vTypeText with + | "System.String" -> false + | "System.Boolean" -> false + | "System.Int32" -> false + | "System.Int64" -> false + | "System.Object" -> false + | "Microsoft.FSharp.Collections.List" -> false + | "Microsoft.FSharp.Core.Option" -> false + | s when s.EndsWith(" Microsoft.FSharp.Core.[]") -> false // for now filter array types + | _ when v.DisplayName.StartsWith "_" -> false + | _ -> true) +|> Array.groupBy (fun (vTypeText, _, _) -> vTypeText) +|> Array.map (fun (key, g) -> + key, + (g + |> Array.groupBy (fun (_, v, _) -> v.DisplayName) + |> Array.sortByDescending (snd >> Array.length))) +|> Array.filter (fun (_, g) -> g.Length > 1) +|> Array.sortByDescending (fun (key, g) -> Array.length g) +|> Array.iter (fun (key, g) -> + let key = key.Replace("Microsoft.FSharp", "FSharp").Replace("FSharp.Core.", "") + printfn "Type: %s" key + for (nm, entries) in g do + printfn " %s (%d times)" nm (Array.length entries) + for (_, _, vUse) in entries do + printfn " %s" (vUse.ToString()) + printfn "") + +(* +let isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + +let dotnet = + if isWindows then + "dotnet.exe" + else + "dotnet" +let fileExists pathToFile = + try + File.Exists(pathToFile) + with _ -> + false +// Look for global install of dotnet sdk +let getDotnetGlobalHostPath () = + let pf = Environment.GetEnvironmentVariable("ProgramW6432") + + let pf = + if String.IsNullOrEmpty(pf) then + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + else + pf + + let candidate = Path.Combine(pf, "dotnet", dotnet) + + if fileExists candidate then + Some candidate + else + // Can't find it --- give up + None + +let getDotnetHostPath () = + let probePathForDotnetHost () = + let paths = + let p = Environment.GetEnvironmentVariable("PATH") + + if not (isNull p) then + p.Split(Path.PathSeparator) + else + [||] + + paths |> Array.tryFind (fun f -> fileExists (Path.Combine(f, dotnet))) + + match (Environment.GetEnvironmentVariable("DOTNET_HOST_PATH")) with + // Value set externally + | value when not (String.IsNullOrEmpty(value)) && fileExists value -> Some value + | _ -> + // Probe for netsdk install, dotnet. and dotnet.exe is a constant offset from the location of System.Int32 + let candidate = + let assemblyLocation = Path.GetDirectoryName(typeof.Assembly.Location) + Path.GetFullPath(Path.Combine(assemblyLocation, "..", "..", "..", dotnet)) + + if fileExists candidate then + Some candidate + else + match probePathForDotnetHost () with + | Some f -> Some(Path.Combine(f, dotnet)) + | None -> getDotnetGlobalHostPath () +let dotnetExe = getDotnetHostPath () |> Option.map System.IO.FileInfo +*) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index d255f0f3d34..0e65489a70d 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -428,48 +428,35 @@ module Test = Assert.AreEqual(expected, quickInfo) () -[] -let ``Automation.LetBindings.InsideModule``() = - let code = """ +[] -let ``Automation.LetBindings.InsideType.Instance``() = - let code = """ +""">] +[] -let ``Automation.LetBindings.InsideType.Static``() = - let code = """ +""">] +[] +[] +let ``Automation.LetBindings`` code = let expectedSignature = "val func: x: 'a -> unit" let tooltip = GetQuickInfoTextFromCode code From 873eefc2680ec21e86ed8c84be037cec1c29682b Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 12 Jul 2022 14:11:25 -0700 Subject: [PATCH 038/226] Merge main to release/dev17.4 (#13499) * ValRepInfoForDisplay added for improved quick info for functions defined in expressions * Update * Update QuickInfoTests.fs * Update QuickInfoTests.fs * Update * add identifier analysis script (#13486) * add identifier analysis script * add identifier analysis script * Update fantomas alpha 11 (#13481) * Allow lower-case DU cases when RequireQualifiedAccess is specified (#13432) * Allow lower-case DU cases when RequireQualifiedAccess is specified * Fix PR suggestions and Add more testing * Protect feature under preview version * Add a NotUpperCaseConstructorWithoutRQA warning to be raised in lang version preview * Fix formatting * regularize some names (#13489) * normalize some names * format code * fix build * Subtraction of two chars, new conversions, and fixes for dynamic operator invocations and QuotationToExpression (#11681) Co-authored-by: Vlad Zarytovskii Co-authored-by: Don Syme * Mark backing fields as CompilerGenerated (fixes serialization of fields in FSI multiemit) (#13494) Co-authored-by: Don Syme Co-authored-by: Peter Semkin Co-authored-by: Don Syme Co-authored-by: Florian Verdonck Co-authored-by: Petr Semkin Co-authored-by: Edgar Gonzalez Co-authored-by: Hadrian Tang Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- VisualFSharp.sln | 10 +- azure-pipelines.yml | 1 + src/Compiler/AbstractIL/ilreflect.fs | 8 +- src/Compiler/AbstractIL/ilx.fs | 2 +- .../Checking/CheckComputationExpressions.fs | 14 +- src/Compiler/Checking/CheckDeclarations.fs | 94 +- src/Compiler/Checking/CheckDeclarations.fsi | 2 + src/Compiler/Checking/CheckExpressions.fs | 271 +- src/Compiler/Checking/CheckExpressions.fsi | 2 +- src/Compiler/Checking/CheckFormatStrings.fs | 16 +- src/Compiler/Checking/CheckPatterns.fs | 54 +- src/Compiler/Checking/ConstraintSolver.fs | 135 +- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/InfoReader.fs | 22 +- src/Compiler/Checking/InfoReader.fsi | 6 +- src/Compiler/Checking/MethodCalls.fs | 181 +- src/Compiler/Checking/MethodOverrides.fs | 16 +- src/Compiler/Checking/MethodOverrides.fsi | 2 +- src/Compiler/Checking/NameResolution.fs | 16 +- src/Compiler/Checking/NicePrint.fs | 179 +- src/Compiler/Checking/NicePrint.fsi | 19 +- .../Checking/PatternMatchCompilation.fs | 24 +- src/Compiler/Checking/PostInferenceChecks.fs | 41 +- src/Compiler/Checking/QuotationTranslator.fs | 38 +- src/Compiler/Checking/SignatureConformance.fs | 24 +- src/Compiler/Checking/TypeHierarchy.fs | 42 +- src/Compiler/Checking/TypeRelations.fs | 65 +- src/Compiler/Checking/import.fs | 10 +- src/Compiler/Checking/infos.fs | 34 +- src/Compiler/CodeGen/IlxGen.fs | 92 +- src/Compiler/Driver/CompilerDiagnostics.fs | 12 +- src/Compiler/FSComp.txt | 1 + src/Compiler/FSStrings.resx | 3 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/Facilities/TextLayoutRender.fs | 2 +- src/Compiler/Interactive/fsi.fs | 6 +- src/Compiler/Optimize/Optimizer.fs | 26 +- src/Compiler/Service/FSharpCheckerResults.fs | 16 +- src/Compiler/Service/ItemKey.fs | 8 +- .../Service/SemanticClassification.fs | 4 +- .../Service/ServiceDeclarationLists.fs | 59 +- src/Compiler/Service/ServiceNavigation.fs | 124 +- .../Service/ServiceParamInfoLocations.fs | 36 +- src/Compiler/Service/ServiceParsedInputOps.fs | 4 +- src/Compiler/Service/ServiceStructure.fs | 78 +- src/Compiler/Symbols/Exprs.fs | 30 +- src/Compiler/Symbols/SymbolHelpers.fs | 12 +- src/Compiler/Symbols/SymbolPatterns.fs | 8 +- src/Compiler/Symbols/Symbols.fs | 45 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 38 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 8 +- src/Compiler/TypedTree/TcGlobals.fs | 16 +- src/Compiler/TypedTree/TypedTree.fs | 44 +- src/Compiler/TypedTree/TypedTree.fsi | 10 +- src/Compiler/TypedTree/TypedTreeBasics.fs | 16 +- src/Compiler/TypedTree/TypedTreeBasics.fsi | 8 +- src/Compiler/TypedTree/TypedTreeOps.fs | 327 +-- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 +- src/Compiler/TypedTree/TypedTreePickle.fs | 8 +- src/Compiler/pars.fsy | 218 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + src/Compiler/xlf/FSStrings.cs.xlf | 5 + src/Compiler/xlf/FSStrings.de.xlf | 5 + src/Compiler/xlf/FSStrings.es.xlf | 5 + src/Compiler/xlf/FSStrings.fr.xlf | 5 + src/Compiler/xlf/FSStrings.it.xlf | 5 + src/Compiler/xlf/FSStrings.ja.xlf | 5 + src/Compiler/xlf/FSStrings.ko.xlf | 5 + src/Compiler/xlf/FSStrings.pl.xlf | 5 + src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 + src/Compiler/xlf/FSStrings.ru.xlf | 5 + src/Compiler/xlf/FSStrings.tr.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 + src/FSharp.Core/Linq.fs | 492 ++-- src/FSharp.Core/Linq.fsi | 2 +- src/FSharp.Core/Query.fs | 15 +- src/FSharp.Core/prim-types.fs | 650 +++-- src/FSharp.Core/prim-types.fsi | 4 + src/FSharp.Core/quotations.fs | 8 +- .../E_LowercaseWhenRequireQualifiedAccess.fsx | 22 + .../LowercaseWhenRequireQualifiedAccess.fsx | 44 + .../Conformance/UnionTypes/UnionTypes.fs | 58 + .../GenericComparison/Compare06.fsx.il.bsl | 2 + .../GenericComparison/Equals05.fsx.il.bsl | 2 + .../GenericComparison/Hash08.fsx.il.bsl | 2 + .../EmittedIL/Misc/AnonRecd.fs.il.bsl | 2 + .../TestFunction17.fs.il.debug.bsl | 2 + .../TestFunction17.fs.il.release.bsl | 2 + .../TestFunction24.fs.il.debug.bsl | 2 + .../TestFunction24.fs.il.release.bsl | 2 + .../FSharp.Core.UnitTests.fsproj | 1 + .../FSharp.Core/OperatorsModule1.fs | 98 +- .../FSharp.Core/OperatorsModule2.fs | 119 +- .../FSharp.Core/OperatorsModuleChecked.fs | 34 +- .../FSharp.Core/OperatorsModuleDynamic.fs | 1105 ++++++++ tests/FSharp.Core.UnitTests/SurfaceArea.fs | 1 + tests/FSharp.Test.Utilities/TestFramework.fs | 4 +- tests/fsharp/core/libtest/test.fsx | 40 + .../core/printing/output.1000.stdout.bsl | 53 + .../core/printing/output.200.stdout.bsl | 53 + .../fsharp/core/printing/output.47.stderr.bsl | 108 + .../fsharp/core/printing/output.47.stdout.bsl | 2 +- .../core/printing/output.multiemit.stdout.bsl | 53 + .../core/printing/output.off.stdout.bsl | 53 + .../core/printing/output.quiet.stdout.bsl | 3 + tests/fsharp/core/printing/output.stdout.bsl | 53 + tests/fsharp/core/printing/test.fsx | 40 + tests/fsharp/core/quotes/test.fsx | 2314 +++++++++++++++-- tests/fsharp/tests.fs | 11 +- tests/fsharp/tools/eval/test.fsx | 33 +- tests/scripts/identifierAnalysisByType.fsx | 5 +- tests/service/ExprTests.fs | 46 +- 126 files changed, 6302 insertions(+), 1963 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx create mode 100644 tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs diff --git a/VisualFSharp.sln b/VisualFSharp.sln index c99c08c29c5..fa4c376c818 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -84,6 +84,14 @@ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Test.Utilities", "tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" + ProjectSection(ProjectDependencies) = postProject + {0973C362-585C-4838-9459-D7E45C6B784B} = {0973C362-585C-4838-9459-D7E45C6B784B} + {37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} = {37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} + {511C95D9-3BA6-451F-B6F8-F033F40878A5} = {511C95D9-3BA6-451F-B6F8-F033F40878A5} + {597D9896-4B90-4E9E-9C99-445C2CB9FF60} = {597D9896-4B90-4E9E-9C99-445C2CB9FF60} + {E54456F4-D51A-4334-B225-92EBBED92B40} = {E54456F4-D51A-4334-B225-92EBBED92B40} + {EB015235-1E07-4CDA-9CC6-3FBCC27910D1} = {EB015235-1E07-4CDA-9CC6-3FBCC27910D1} + EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}" EndProject @@ -149,8 +157,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", " EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA}" ProjectSection(ProjectDependencies) = postProject - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} = {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} + {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpDebug", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpDebug.csproj", "{A422D673-8E3B-4924-821B-DD3174173426}" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 01abb29a8a0..ad5a8657625 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,7 @@ trigger: exclude: - .github/* - docs/ + - tests/scripts/ - attributions.md - CODE_OF_CONDUCT.md - DEVGUIDE.md diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 2781d8a381a..a37fa6b1ae0 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -479,11 +479,11 @@ module Zmap = let equalTypes (s: Type) (t: Type) = s.Equals t -let equalTypeLists ss tt = - List.lengthsEqAndForall2 equalTypes ss tt +let equalTypeLists (tys1: Type list) (tys2: Type list) = + List.lengthsEqAndForall2 equalTypes tys1 tys2 -let equalTypeArrays ss tt = - Array.lengthsEqAndForall2 equalTypes ss tt +let equalTypeArrays (tys1: Type[]) (tys2: Type[]) = + Array.lengthsEqAndForall2 equalTypes tys1 tys2 let getGenericArgumentsOfType (typT: Type) = if typT.IsGenericType then diff --git a/src/Compiler/AbstractIL/ilx.fs b/src/Compiler/AbstractIL/ilx.fs index 4eb18649752..e91ad50d712 100644 --- a/src/Compiler/AbstractIL/ilx.fs +++ b/src/Compiler/AbstractIL/ilx.fs @@ -75,7 +75,7 @@ type IlxClosureApps = let rec instAppsAux n inst apps = match apps with | Apps_tyapp (ty, rest) -> Apps_tyapp(instILTypeAux n inst ty, instAppsAux n inst rest) - | Apps_app (dty, rest) -> Apps_app(instILTypeAux n inst dty, instAppsAux n inst rest) + | Apps_app (domainTy, rest) -> Apps_app(instILTypeAux n inst domainTy, instAppsAux n inst rest) | Apps_done retTy -> Apps_done(instILTypeAux n inst retTy) let rec instLambdasAux n inst lambdas = diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index ee42cc97fbe..c8a9501e475 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -224,10 +224,10 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol // Give bespoke error messages for the FSharp.Core "query" builder let isQuery = match stripDebugPoints interpExpr with - | Expr.Val (vf, _, m) -> - let item = Item.CustomBuilder (vf.DisplayName, vf) + | Expr.Val (vref, _, m) -> + let item = Item.CustomBuilder (vref.DisplayName, vref) CallNameResolutionSink cenv.tcSink (m, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) - valRefEq cenv.g vf cenv.g.query_value_vref + valRefEq cenv.g vref cenv.g.query_value_vref | _ -> false /// Make a builder.Method(...) call @@ -1909,8 +1909,8 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = // This transformation is visible in quotations and thus needs to remain. | (TPat_as (TPat_wild _, PatternValBinding (v, _), _), [_], - DebugPoints(Expr.App (Expr.Val (vf, _, _), _, [genEnumElemTy], [yieldExpr], _mYield), recreate)) - when valRefEq cenv.g vf cenv.g.seq_singleton_vref -> + DebugPoints(Expr.App (Expr.Val (vref, _, _), _, [genEnumElemTy], [yieldExpr], _mYield), recreate)) + when valRefEq cenv.g vref cenv.g.seq_singleton_vref -> // The debug point mFor is attached to the 'map' // The debug point mIn is attached to the lambda @@ -2051,11 +2051,11 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m = error(Error(FSComp.SR.tcUseForInSequenceExpression(), m)) | SynExpr.Match (spMatch, expr, clauses, _m, _trivia) -> - let inputExpr, matchty, tpenv = TcExprOfUnknownType cenv env tpenv expr + let inputExpr, inputTy, tpenv = TcExprOfUnknownType cenv env tpenv expr let tclauses, tpenv = (tpenv, clauses) ||> List.mapFold (fun tpenv (SynMatchClause(pat, cond, innerComp, _, sp, _)) -> - let patR, condR, vspecs, envinner, tpenv = TcMatchPattern cenv matchty env tpenv pat cond + let patR, condR, vspecs, envinner, tpenv = TcMatchPattern cenv inputTy env tpenv pat cond let envinner = match sp with | DebugPointAtTarget.Yes -> { envinner with eIsControlFlow = true } diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 9fd052bdd4b..b8192ef5f01 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -291,9 +291,9 @@ let OpenModuleOrNamespaceRefs tcSink g amap scopem root env mvvs openDeclaration env /// Adjust the TcEnv to account for opening a type implied by an `open type` declaration -let OpenTypeContent tcSink g amap scopem env (typ: TType) openDeclaration = +let OpenTypeContent tcSink g amap scopem env (ty: TType) openDeclaration = let env = - { env with eNameResEnv = AddTypeContentsToNameEnv g amap env.eAccessRights scopem env.eNameResEnv typ } + { env with eNameResEnv = AddTypeContentsToNameEnv g amap env.eAccessRights scopem env.eNameResEnv ty } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) CallOpenDeclarationSink tcSink openDeclaration env @@ -378,6 +378,8 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath (env: exception NotUpperCaseConstructor of range: range +exception NotUpperCaseConstructorWithoutRQA of range: range + let CheckNamespaceModuleOrTypeName (g: TcGlobals) (id: Ident) = // type names '[]' etc. are used in fslib if not g.compilingFSharpCore && id.idText.IndexOfAny IllegalCharactersInTypeAndNamespaceNames <> -1 then @@ -453,7 +455,7 @@ module TcRecdUnionAndEnumDeclarations = // Bind other elements of type definitions (constructors etc.) //------------------------------------------------------------------------- - let CheckUnionCaseName (cenv: cenv) (id: Ident) = + let CheckUnionCaseName (cenv: cenv) (id: Ident) hasRQAAttribute = let g = cenv.g let name = id.idText if name = "Tags" then @@ -461,8 +463,13 @@ module TcRecdUnionAndEnumDeclarations = CheckNamespaceModuleOrTypeName g id - if not (String.isLeadingIdentifierCharacterUpperCase name) && name <> opNameCons && name <> opNameNil then - errorR(NotUpperCaseConstructor(id.idRange)) + if g.langVersion.SupportsFeature(LanguageFeature.LowercaseDUWhenRequireQualifiedAccess) then + + if not (String.isLeadingIdentifierCharacterUpperCase name) && not hasRQAAttribute && name <> opNameCons && name <> opNameNil then + errorR(NotUpperCaseConstructorWithoutRQA(id.idRange)) + else + if not (String.isLeadingIdentifierCharacterUpperCase name) && name <> opNameCons && name <> opNameNil then + errorR(NotUpperCaseConstructor(id.idRange)) let ValidateFieldNames (synFields: SynField list, tastFields: RecdField list) = let seen = Dictionary() @@ -479,13 +486,13 @@ module TcRecdUnionAndEnumDeclarations = | _ -> seen.Add(f.LogicalName, sf)) - let TcUnionCaseDecl (cenv: cenv) env parent thisTy thisTyInst tpenv (SynUnionCase(Attributes synAttrs, SynIdent(id, _), args, xmldoc, vis, m, _)) = + let TcUnionCaseDecl (cenv: cenv) env parent thisTy thisTyInst tpenv hasRQAAttribute (SynUnionCase(Attributes synAttrs, SynIdent(id, _), args, xmldoc, vis, m, _)) = let g = cenv.g let attrs = TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs // the attributes of a union case decl get attached to the generated "static factory" method let vis, _ = ComputeAccessAndCompPath env None m vis None parent let vis = CombineReprAccess parent vis - CheckUnionCaseName cenv id + CheckUnionCaseName cenv id hasRQAAttribute let rfields, recordTy = match args with @@ -526,8 +533,8 @@ module TcRecdUnionAndEnumDeclarations = let xmlDoc = xmldoc.ToXmlDoc(true, Some names) Construct.NewUnionCase id rfields recordTy attrs xmlDoc vis - let TcUnionCaseDecls cenv env parent (thisTy: TType) thisTyInst tpenv unionCases = - let unionCasesR = unionCases |> List.map (TcUnionCaseDecl cenv env parent thisTy thisTyInst tpenv) + let TcUnionCaseDecls (cenv: cenv) env (parent: ParentRef) (thisTy: TType) (thisTyInst: TypeInst) hasRQAAttribute tpenv unionCases = + let unionCasesR = unionCases |> List.map (TcUnionCaseDecl cenv env parent thisTy thisTyInst tpenv hasRQAAttribute) unionCasesR |> CheckDuplicates (fun uc -> uc.Id) "union case" let TcEnumDecl cenv env parent thisTy fieldTy (SynEnumCase(attributes=Attributes synAttrs; ident= SynIdent(id,_); value=v; xmlDoc=xmldoc; range=m)) = @@ -658,16 +665,16 @@ let TcOpenTypeDecl (cenv: cenv) mOpenDecl scopem env (synType: SynType, m) = checkLanguageFeatureError g.langVersion LanguageFeature.OpenTypeDeclaration mOpenDecl - let typ, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open env emptyUnscopedTyparEnv synType + let ty, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open env emptyUnscopedTyparEnv synType - if not (isAppTy g typ) then + if not (isAppTy g ty) then error(Error(FSComp.SR.tcNamedTypeRequired("open type"), m)) - if isByrefTy g typ then + if isByrefTy g ty then error(Error(FSComp.SR.tcIllegalByrefsInOpenTypeDeclaration(), m)) - let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.Type (synType, m), [], [typ], scopem, false) - let env = OpenTypeContent cenv.tcSink g cenv.amap scopem env typ openDecl + let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.Type (synType, m), [], [ty], scopem, false) + let env = OpenTypeContent cenv.tcSink g cenv.amap scopem env ty openDecl env, [openDecl] let TcOpenDecl (cenv: cenv) mOpenDecl scopem env target = @@ -1060,7 +1067,7 @@ module MutRecBindingChecking = Phase2BInherit (inheritsExpr, baseValOpt), innerState // Phase2B: let and let rec value and function definitions - | Phase2AIncrClassBindings (tcref, binds, isStatic, isRec, bindsm) -> + | Phase2AIncrClassBindings (tcref, binds, isStatic, isRec, mBinds) -> let envForBinding = if isStatic then envStatic else envInstance let binds, bindRs, env, tpenv = if isRec then @@ -1073,12 +1080,12 @@ module MutRecBindingChecking = else // Type check local binding - let binds, env, tpenv = TcLetBindings cenv envForBinding ExprContainerInfo (ClassLetBinding isStatic) tpenv (binds, bindsm, scopem) + let binds, env, tpenv = TcLetBindings cenv envForBinding ExprContainerInfo (ClassLetBinding isStatic) tpenv (binds, mBinds, scopem) let binds, bindRs = binds |> List.map (function | TMDefLet(bind, _) -> [bind], IncrClassBindingGroup([bind], isStatic, false) - | TMDefDo(e, _) -> [], IncrClassDo(e, isStatic, bindsm) + | TMDefDo(e, _) -> [], IncrClassDo(e, isStatic, mBinds) | _ -> error(InternalError("unexpected definition kind", tcref.Range))) |> List.unzip List.concat binds, bindRs, env, tpenv @@ -1473,7 +1480,7 @@ module MutRecBindingChecking = envForDecls) /// Phase 2: Check the members and 'let' definitions in a mutually recursive group of definitions. - let TcMutRecDefns_Phase2_Bindings (cenv: cenv) envInitial tpenv bindsm scopem mutRecNSInfo (envMutRecPrelimWithReprs: TcEnv) (mutRecDefns: MutRecDefnsPhase2Info) = + let TcMutRecDefns_Phase2_Bindings (cenv: cenv) envInitial tpenv mBinds scopem mutRecNSInfo (envMutRecPrelimWithReprs: TcEnv) (mutRecDefns: MutRecDefnsPhase2Info) = let g = cenv.g let denv = envMutRecPrelimWithReprs.DisplayEnv @@ -1601,12 +1608,12 @@ module MutRecBindingChecking = (fun morpher shape -> shape |> MutRecShapes.iterTyconsAndLets (p23 >> morpher) morpher) MutRecShape.Lets (fun morpher shape -> shape |> MutRecShapes.mapTyconsAndLets (fun (tyconOpt, fixupValueExprBinds, methodBinds) -> tyconOpt, (morpher fixupValueExprBinds @ methodBinds)) morpher) - bindsm + mBinds defnsEs, envMutRec /// Check and generalize the interface implementations, members, 'let' definitions in a mutually recursive group of definitions. -let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) = +let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) = let g = cenv.g let interfacesFromTypeDefn envForTycon tyconMembersData = let (MutRecDefnsPhase2DataForTycon(_, _, declKind, tcref, _, _, declaredTyconTypars, members, _, _, _)) = tyconMembersData @@ -1720,7 +1727,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial bindsm scopem mutRecNSInfo (env (intfTypes, slotImplSets) ||> List.map2 (interfaceMembersFromTypeDefn tyconData) |> List.concat MutRecDefnsPhase2InfoForTycon(tyconOpt, tcref, declaredTyconTypars, declKind, obinds @ ibinds, fixupFinalAttrs)) - MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings cenv envInitial tpenv bindsm scopem mutRecNSInfo envMutRec binds + MutRecBindingChecking.TcMutRecDefns_Phase2_Bindings cenv envInitial tpenv mBinds scopem mutRecNSInfo envMutRec binds with exn -> errorRecovery exn scopem; [], envMutRec @@ -3188,7 +3195,9 @@ module EstablishTypeDefinitionCores = structLayoutAttributeCheck false noAllowNullLiteralAttributeCheck() - TcRecdUnionAndEnumDeclarations.CheckUnionCaseName cenv unionCaseName + + let hasRQAAttribute = HasFSharpAttribute cenv.g cenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + TcRecdUnionAndEnumDeclarations.CheckUnionCaseName cenv unionCaseName hasRQAAttribute let unionCase = Construct.NewUnionCase unionCaseName [] thisTy [] XmlDoc.Empty tycon.Accessibility writeFakeUnionCtorsToSink [ unionCase ] Construct.MakeUnionRepr [ unionCase ], None, NoSafeInitInfo @@ -3219,8 +3228,9 @@ module EstablishTypeDefinitionCores = noAbstractClassAttributeCheck() noAllowNullLiteralAttributeCheck() structLayoutAttributeCheck false - let unionCases = TcRecdUnionAndEnumDeclarations.TcUnionCaseDecls cenv envinner innerParent thisTy thisTyInst tpenv unionCases - + + let hasRQAAttribute = HasFSharpAttribute cenv.g cenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + let unionCases = TcRecdUnionAndEnumDeclarations.TcUnionCaseDecls cenv envinner innerParent thisTy thisTyInst hasRQAAttribute tpenv unionCases if tycon.IsStructRecordOrUnionTycon && unionCases.Length > 1 then let fieldNames = [ for uc in unionCases do for ft in uc.FieldTable.TrueInstanceFieldsAsList do yield ft.LogicalName ] if fieldNames |> List.distinct |> List.length <> fieldNames.Length then @@ -3426,37 +3436,37 @@ module EstablishTypeDefinitionCores = match stripTyparEqns ty with | TType_anon (_,l) | TType_tuple (_, l) -> accInAbbrevTypes l acc - | TType_ucase (UnionCaseRef(tc, _), tinst) - | TType_app (tc, tinst, _) -> - let tycon2 = tc.Deref + | TType_ucase (UnionCaseRef(tcref2, _), tinst) + | TType_app (tcref2, tinst, _) -> + let tycon2 = tcref2.Deref let acc = accInAbbrevTypes tinst acc // Record immediate recursive references if ListSet.contains (===) tycon2 tycons then (tycon, tycon2) :: acc // Expand the representation of abbreviations - elif tc.IsTypeAbbrev then - accInAbbrevType (reduceTyconRefAbbrev tc tinst) acc + elif tcref2.IsTypeAbbrev then + accInAbbrevType (reduceTyconRefAbbrev tcref2 tinst) acc // Otherwise H - explore the instantiation. else acc - | TType_fun (d, r, _) -> - accInAbbrevType d (accInAbbrevType r acc) + | TType_fun (domainTy, rangeTy, _) -> + accInAbbrevType domainTy (accInAbbrevType rangeTy acc) | TType_var _ -> acc - | TType_forall (_, r) -> accInAbbrevType r acc + | TType_forall (_, bodyTy) -> accInAbbrevType bodyTy acc - | TType_measure ms -> accInMeasure ms acc - - and accInMeasure ms acc = - match stripUnitEqns ms with - | Measure.Con tc when ListSet.contains (===) tc.Deref tycons -> - (tycon, tc.Deref) :: acc - | Measure.Con tc when tc.IsTypeAbbrev -> - accInMeasure (reduceTyconRefAbbrevMeasureable tc) acc + | TType_measure measureTy -> accInMeasure measureTy acc + + and accInMeasure measureTy acc = + match stripUnitEqns measureTy with + | Measure.Const tcref when ListSet.contains (===) tcref.Deref tycons -> + (tycon, tcref.Deref) :: acc + | Measure.Const tcref when tcref.IsTypeAbbrev -> + accInMeasure (reduceTyconRefAbbrevMeasureable tcref) acc | Measure.Prod (ms1, ms2) -> accInMeasure ms1 (accInMeasure ms2 acc) - | Measure.Inv ms -> accInMeasure ms acc + | Measure.Inv invTy -> accInMeasure invTy acc | _ -> acc and accInAbbrevTypes tys acc = @@ -3467,7 +3477,7 @@ module EstablishTypeDefinitionCores = | Some ty -> accInAbbrevType ty [] let edges = List.collect edgesFrom tycons - let graph = Graph ((fun tc -> tc.Stamp), tycons, edges) + let graph = Graph ((fun tycon -> tycon.Stamp), tycons, edges) graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index c4590557ede..631e9fb5812 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -76,3 +76,5 @@ val CheckOneSigFile: Cancellable exception NotUpperCaseConstructor of range: range + +exception NotUpperCaseConstructorWithoutRQA of range: range diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index d513a326a74..7e3baef258b 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -987,28 +987,28 @@ let UnifyFunctionType extraInfo cenv denv mFunExpr ty = let ReportImplicitlyIgnoredBoolExpression denv m ty expr = let checkExpr m expr = match stripDebugPoints expr with - | Expr.App (Expr.Val (vf, _, _), _, _, exprs, _) when vf.LogicalName = opNameEquals -> + | Expr.App (Expr.Val (vref, _, _), _, _, exprs, _) when vref.LogicalName = opNameEquals -> match List.map stripDebugPoints exprs with - | Expr.App (Expr.Val (propRef, _, _), _, _, Expr.Val (vf, _, _) :: _, _) :: _ -> + | Expr.App (Expr.Val (propRef, _, _), _, _, Expr.Val (vref, _, _) :: _, _) :: _ -> if propRef.IsPropertyGetterMethod then let propertyName = propRef.PropertyName let hasCorrespondingSetter = match propRef.DeclaringEntity with | Parent entityRef -> entityRef.MembersOfFSharpTyconSorted - |> List.exists (fun valRef -> valRef.IsPropertySetterMethod && valRef.PropertyName = propertyName) + |> List.exists (fun vref -> vref.IsPropertySetterMethod && vref.PropertyName = propertyName) | _ -> false if hasCorrespondingSetter then - UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vf.DisplayName, propertyName, m) + UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vref.DisplayName, propertyName, m) else UnitTypeExpectedWithEquality (denv, ty, m) else UnitTypeExpectedWithEquality (denv, ty, m) - | Expr.Op (TOp.ILCall (_, _, _, _, _, _, _, ilMethRef, _, _, _), _, Expr.Val (vf, _, _) :: _, _) :: _ when ilMethRef.Name.StartsWithOrdinal("get_") -> - UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vf.DisplayName, ChopPropertyName(ilMethRef.Name), m) - | Expr.Val (vf, _, _) :: _ -> - UnitTypeExpectedWithPossibleAssignment (denv, ty, vf.IsMutable, vf.DisplayName, m) + | Expr.Op (TOp.ILCall (_, _, _, _, _, _, _, ilMethRef, _, _, _), _, Expr.Val (vref, _, _) :: _, _) :: _ when ilMethRef.Name.StartsWithOrdinal("get_") -> + UnitTypeExpectedWithPossiblePropertySetter (denv, ty, vref.DisplayName, ChopPropertyName(ilMethRef.Name), m) + | Expr.Val (vref, _, _) :: _ -> + UnitTypeExpectedWithPossibleAssignment (denv, ty, vref.IsMutable, vref.DisplayName, m) | _ -> UnitTypeExpectedWithEquality (denv, ty, m) | _ -> UnitTypeExpected (denv, ty, m) @@ -1041,8 +1041,8 @@ let UnifyUnitType (cenv: cenv) (env: TcEnv) m ty expr = match env.eContextInfo with | ContextInfo.SequenceExpression seqTy -> - let lifted = mkSeqTy g ty - if typeEquiv g seqTy lifted then + let liftedTy = mkSeqTy g ty + if typeEquiv g seqTy liftedTy then warning (Error (FSComp.SR.implicitlyDiscardedInSequenceExpression(NicePrint.prettyStringOfTy denv ty), m)) else if isListTy g ty || isArrayTy g ty || typeEquiv g seqTy ty then @@ -1100,7 +1100,7 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = let _, tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.Use OpenQualified env.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match tcref.TypeOrMeasureKind with | TyparKind.Type -> error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) - | TyparKind.Measure -> Measure.Con tcref + | TyparKind.Measure -> Measure.Const tcref | SynMeasure.Power(ms, exponent, _) -> Measure.RationalPower (tcMeasure ms, TcSynRationalConst exponent) | SynMeasure.Product(ms1, ms2, _) -> Measure.Prod(tcMeasure ms1, tcMeasure ms2) @@ -1114,7 +1114,7 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = | SynMeasure.Var(_, m) -> error(Error(FSComp.SR.tcNonZeroConstantCannotHaveGenericUnit(), m)) | SynMeasure.Paren(measure, _) -> tcMeasure measure - let unif expected = UnifyTypes cenv env m overallTy expected + let unif expectedTy = UnifyTypes cenv env m overallTy expectedTy let unifyMeasureArg iszero tcr = let measureTy = @@ -1312,7 +1312,7 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS // NOTE: This value is initially only set for interface implementations and those overrides // where we manage to pre-infer which abstract is overridden by the method. It is filled in // properly when we check the allImplemented implementation checks at the end of the inference scope. - ImplementedSlotSigs=implSlotTys |> List.map (fun ity -> TSlotSig(logicalName, ity, [], [], [], None)) } + ImplementedSlotSigs=implSlotTys |> List.map (fun intfTy -> TSlotSig(logicalName, intfTy, [], [], [], None)) } let isInstance = MemberIsCompiledAsInstance g tcref isExtrinsic memberInfo attrs @@ -1529,8 +1529,8 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec let vis = if MemberIsExplicitImpl g memberInfo then let slotSig = List.head memberInfo.ImplementedSlotSigs - match slotSig.ImplementedType with - | TType_app (tyconref, _, _) -> Some tyconref.Accessibility + match slotSig.DeclaringType with + | TType_app (tcref, _, _) -> Some tcref.Accessibility | _ -> None else None @@ -1714,14 +1714,14 @@ let AdjustRecType (v: Val) vscheme = /// Record the generated value expression as a place where we will have to /// adjust using AdjustAndForgetUsesOfRecValue at a letrec point. Every use of a value /// under a letrec gets used at the _same_ type instantiation. -let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vexp m = +let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vExpr m = match valRecInfo with | ValInRecScope isComplete -> - let fixupPoint = ref vexp + let fixupPoint = ref vExpr cenv.recUses <- cenv.recUses.Add (vrefTgt.Deref, (fixupPoint, m, isComplete)) Expr.Link fixupPoint | ValNotInRecScope -> - vexp + vExpr type RecursiveUseFixupPoints = RecursiveUseFixupPoints of (Expr ref * range) list @@ -2161,9 +2161,9 @@ let rec ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) e let ucref = ucinfo.UnionCaseRef CheckUnionCaseAttributes g ucref m |> CommitOperationResult CheckUnionCaseAccessible cenv.amap m ad ucref |> ignore - let gtyp2 = actualResultTyOfUnionCase ucinfo.TypeInst ucref + let resTy = actualResultTyOfUnionCase ucinfo.TypeInst ucref let inst = mkTyparInst ucref.TyconRef.TyparsNoRange ucinfo.TypeInst - UnifyTypes cenv env m overallTy gtyp2 + UnifyTypes cenv env m overallTy resTy let mkf = makerForUnionCase(ucref, ucinfo.TypeInst) mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] | _ -> invalidArg "item" "not a union case or exception reference" @@ -2346,11 +2346,11 @@ module GeneralizationHelpers = let relevantUniqueSubtypeConstraint (tp: Typar) = // Find a single subtype constraint match tp.Constraints |> List.partition (function TyparConstraint.CoercesTo _ -> true | _ -> false) with - | [TyparConstraint.CoercesTo(cxty, _)], others -> + | [TyparConstraint.CoercesTo(tgtTy, _)], others -> // Throw away null constraints if they are implied - if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeSatisfiesNullConstraint g m cxty) | _ -> true) + if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeSatisfiesNullConstraint g m tgtTy) | _ -> true) then None - else Some cxty + else Some tgtTy | _ -> None @@ -2745,8 +2745,8 @@ module EventDeclarationNormalization = let rec private RenameBindingPattern f declPattern = match declPattern with - | SynPat.FromParseError(p, _) -> RenameBindingPattern f p - | SynPat.Typed(pat', _, _) -> RenameBindingPattern f pat' + | SynPat.FromParseError(innerPat, _) -> RenameBindingPattern f innerPat + | SynPat.Typed(innerPat, _, _) -> RenameBindingPattern f innerPat | SynPat.Named (SynIdent(id,_), x2, vis2, m) -> SynPat.Named (SynIdent(ident(f id.idText, id.idRange), None), x2, vis2, m) | SynPat.InstanceMember(thisId, id, toolId, vis2, m) -> SynPat.InstanceMember(thisId, ident(f id.idText, id.idRange), toolId, vis2, m) | _ -> error(Error(FSComp.SR.tcOnlySimplePatternsInLetRec(), declPattern.Range)) @@ -2848,11 +2848,11 @@ let TcValEarlyGeneralizationConsistencyCheck cenv (env: TcEnv) (v: Val, valRecIn match valRecInfo with | ValInRecScope isComplete when isComplete && not (isNil tinst) -> cenv.css.PushPostInferenceCheck (preDefaults=false, check=fun () -> - let tpsorig, tau2 = tryDestForallTy g vTy - if not (isNil tpsorig) then - let tpsorig = NormalizeDeclaredTyparsForEquiRecursiveInference g tpsorig - let tau3 = instType (mkTyparInst tpsorig tinst) tau2 - if not (AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css m tau tau3) then + let vTypars, vTauTy = tryDestForallTy g vTy + if not (isNil vTypars) then + let vTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g vTypars + let vTauTy = instType (mkTyparInst vTypars tinst) vTauTy + if not (AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css m tau vTauTy) then let txt = buildString (fun buf -> NicePrint.outputQualifiedValSpec env.DisplayEnv cenv.infoReader buf (mkLocalValRef v)) error(Error(FSComp.SR.tcInferredGenericTypeGivesRiseToInconsistency(v.DisplayName, txt), m))) | _ -> () @@ -2933,26 +2933,26 @@ let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValR warning(Error(FSComp.SR.tcDoesNotAllowExplicitTypeArguments(v.DisplayName), m)) match valRecInfo with | ValInRecScope false -> - let tpsorig, tau = vref.GeneralizedType - let (tinst: TypeInst), tpenv = checkTys tpenv (tpsorig |> List.map (fun tp -> tp.Kind)) + let vTypars, vTauTy = vref.GeneralizedType + let tinst, tpenv = checkTys tpenv (vTypars |> List.map (fun tp -> tp.Kind)) checkInst tinst - if tpsorig.Length <> tinst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(tpsorig.Length, tinst.Length), m)) + if vTypars.Length <> tinst.Length then error(Error(FSComp.SR.tcTypeParameterArityMismatch(vTypars.Length, tinst.Length), m)) - let tau2 = instType (mkTyparInst tpsorig tinst) tau + let vRecTauTy = instType (mkTyparInst vTypars tinst) vTauTy - (tpsorig, tinst) ||> List.iter2 (fun tp ty -> + (vTypars, tinst) ||> List.iter2 (fun tp ty -> try UnifyTypes cenv env m (mkTyparTy tp) ty - with _ -> error (Recursion(env.DisplayEnv, v.Id, tau2, tau, m))) + with _ -> error (Recursion(env.DisplayEnv, v.Id, vRecTauTy, vTauTy, m))) - tpsorig, vrefFlags, tinst, tau2, tpenv + vTypars, vrefFlags, tinst, vRecTauTy, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, tps, tpTys, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let vTypars, tps, tpTys, vTauTy = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy - let (tinst: TypeInst), tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) + let tinst, tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) checkInst tinst @@ -2960,9 +2960,9 @@ let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValR List.iter2 (UnifyTypes cenv env m) tpTys tinst - TcValEarlyGeneralizationConsistencyCheck cenv env (v, valRecInfo, tinst, vTy, tau, m) + TcValEarlyGeneralizationConsistencyCheck cenv env (v, valRecInfo, tinst, vTy, vTauTy, m) - tpsorig, vrefFlags, tinst, tau, tpenv + vTypars, vrefFlags, tinst, vTauTy, tpenv let exprForVal = Expr.Val (vref, vrefFlags, m) let exprForVal = mkTyAppExpr m (exprForVal, vTy) tinst @@ -3259,7 +3259,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = let isStruct = finfo.IsValueType let boxity = if isStruct then AsValue else AsObject let tinst = finfo.TypeInst - let fieldType = finfo.FieldType (amap, m) + let fieldTy = finfo.FieldType (amap, m) #if !NO_TYPEPROVIDERS let ty = tyOfExpr g objExpr match finfo with @@ -3269,7 +3269,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = | None -> error (Error(FSComp.SR.tcTPFieldMustBeLiteral(), m)) | Some lit -> - Expr.Const (TcFieldInit m lit, m, fieldType) + Expr.Const (TcFieldInit m lit, m, fieldTy) | _ -> #endif let wrap, objExpr, _readonly, _writeonly = mkExprAddrOfExpr g isStruct false NeverMutates objExpr None m @@ -3278,7 +3278,7 @@ let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = // polymorphic code, after inlining etc. * let fspec = mkILFieldSpec(fref, mkILNamedTy boxity fref.DeclaringTypeRef []) // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. - wrap (mkAsmExpr (([ mkNormalLdfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else [])), tinst, [objExpr], [fieldType], m)) + wrap (mkAsmExpr (([ mkNormalLdfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else [])), tinst, [objExpr], [fieldTy], m)) /// Checks that setting a field value does not set a literal or initonly field let private CheckFieldLiteralArg (finfo: ILFieldInfo) argExpr m = @@ -3431,28 +3431,28 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr let tryType (exprToSearchForGetEnumeratorAndItem, tyToSearchForGetEnumeratorAndItem) = match findMethInfo true m "GetEnumerator" tyToSearchForGetEnumeratorAndItem with | Exception exn -> Exception exn - | Result getEnumerator_minfo -> + | Result getEnumeratorMethInfo -> - let getEnumerator_minst = FreshenMethInfo m getEnumerator_minfo - let retTypeOfGetEnumerator = getEnumerator_minfo.GetFSharpReturnType(cenv.amap, m, getEnumerator_minst) - if hasArgs getEnumerator_minfo getEnumerator_minst then err true tyToSearchForGetEnumeratorAndItem else + let getEnumeratorMethInst = FreshenMethInfo m getEnumeratorMethInfo + let getEnumeratorRetTy = getEnumeratorMethInfo.GetFSharpReturnType(cenv.amap, m, getEnumeratorMethInst) + if hasArgs getEnumeratorMethInfo getEnumeratorMethInst then err true tyToSearchForGetEnumeratorAndItem else - match findMethInfo false m "MoveNext" retTypeOfGetEnumerator with + match findMethInfo false m "MoveNext" getEnumeratorRetTy with | Exception exn -> Exception exn - | Result moveNext_minfo -> + | Result moveNextMethInfo -> - let moveNext_minst = FreshenMethInfo m moveNext_minfo - let retTypeOfMoveNext = moveNext_minfo.GetFSharpReturnType(cenv.amap, m, moveNext_minst) - if not (typeEquiv g g.bool_ty retTypeOfMoveNext) then err false retTypeOfGetEnumerator else - if hasArgs moveNext_minfo moveNext_minst then err false retTypeOfGetEnumerator else + let moveNextMethInst = FreshenMethInfo m moveNextMethInfo + let moveNextRetTy = moveNextMethInfo.GetFSharpReturnType(cenv.amap, m, moveNextMethInst) + if not (typeEquiv g g.bool_ty moveNextRetTy) then err false getEnumeratorRetTy else + if hasArgs moveNextMethInfo moveNextMethInst then err false getEnumeratorRetTy else - match findMethInfo false m "get_Current" retTypeOfGetEnumerator with + match findMethInfo false m "get_Current" getEnumeratorRetTy with | Exception exn -> Exception exn - | Result get_Current_minfo -> + | Result getCurrentMethInfo -> - let get_Current_minst = FreshenMethInfo m get_Current_minfo - if hasArgs get_Current_minfo get_Current_minst then err false retTypeOfGetEnumerator else - let enumElemTy = get_Current_minfo.GetFSharpReturnType(cenv.amap, m, get_Current_minst) + let getCurrentMethInst = FreshenMethInfo m getCurrentMethInfo + if hasArgs getCurrentMethInfo getCurrentMethInst then err false getEnumeratorRetTy else + let enumElemTy = getCurrentMethInfo.GetFSharpReturnType(cenv.amap, m, getCurrentMethInst) // Compute the element type of the strongly typed enumerator // @@ -3496,23 +3496,23 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr else enumElemTy - let isEnumeratorTypeStruct = isStructTy g retTypeOfGetEnumerator - let originalRetTypeOfGetEnumerator = retTypeOfGetEnumerator + let isEnumeratorTypeStruct = isStructTy g getEnumeratorRetTy + let originalRetTypeOfGetEnumerator = getEnumeratorRetTy - let (enumeratorVar, enumeratorExpr), retTypeOfGetEnumerator = + let (enumeratorVar, enumeratorExpr), getEnumeratorRetTy = if isEnumeratorTypeStruct then if localAlloc then - mkMutableCompGenLocal m "enumerator" retTypeOfGetEnumerator, retTypeOfGetEnumerator + mkMutableCompGenLocal m "enumerator" getEnumeratorRetTy, getEnumeratorRetTy else - let refCellTyForRetTypeOfGetEnumerator = mkRefCellTy g retTypeOfGetEnumerator + let refCellTyForRetTypeOfGetEnumerator = mkRefCellTy g getEnumeratorRetTy let v, e = mkMutableCompGenLocal m "enumerator" refCellTyForRetTypeOfGetEnumerator - (v, mkRefCellGet g m retTypeOfGetEnumerator e), refCellTyForRetTypeOfGetEnumerator + (v, mkRefCellGet g m getEnumeratorRetTy e), refCellTyForRetTypeOfGetEnumerator else - mkCompGenLocal m "enumerator" retTypeOfGetEnumerator, retTypeOfGetEnumerator + mkCompGenLocal m "enumerator" getEnumeratorRetTy, getEnumeratorRetTy let getEnumExpr, getEnumTy = - let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumerator_minfo NormalValUse getEnumerator_minst [exprToSearchForGetEnumeratorAndItem] [] + let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumeratorMethInfo NormalValUse getEnumeratorMethInst [exprToSearchForGetEnumeratorAndItem] [] if not isEnumeratorTypeStruct || localAlloc then res else // wrap enumerators that are represented as mutable structs into ref cells @@ -3520,8 +3520,8 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr let getEnumTy = mkRefCellTy g getEnumTy getEnumExpr, getEnumTy - let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNext_minfo NormalValUse moveNext_minst [enumeratorExpr] [] - let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true get_Current_minfo NormalValUse get_Current_minst [enumeratorExpr] [] + let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNextMethInfo NormalValUse moveNextMethInst [enumeratorExpr] [] + let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true getCurrentMethInfo NormalValUse getCurrentMethInst [enumeratorExpr] [] let currentExpr = mkCoerceExpr(currentExpr, enumElemTy, currentExpr.Range, currentTy) let currentExpr, enumElemTy = // Implicitly dereference byref for expr 'for x in ...' @@ -3531,7 +3531,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr else currentExpr, enumElemTy - Result(enumeratorVar, enumeratorExpr, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, currentExpr) + Result(enumeratorVar, enumeratorExpr, getEnumeratorRetTy, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, currentExpr) // First try the original known static type match (if isArray1DTy g exprTy then Exception (Failure "") else tryType (expr, exprTy)) with @@ -3570,12 +3570,12 @@ let ConvertArbitraryExprToEnumerable (cenv: cenv) ty (env: TcEnv) (expr: Expr) = expr, enumElemTy else let enumerableVar, enumerableExpr = mkCompGenLocal m "inputSequence" ty - let enumeratorVar, _, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, _, guardExpr, guardTy, betterCurrentExpr = + let enumeratorVar, _, getEnumeratorRetTy, enumElemTy, getEnumExpr, _, guardExpr, guardTy, betterCurrentExpr = AnalyzeArbitraryExprAsEnumerable cenv env false m ty enumerableExpr let expr = mkCompGenLet m enumerableVar expr - (mkCallSeqOfFunctions g m retTypeOfGetEnumerator enumElemTy + (mkCallSeqOfFunctions g m getEnumeratorRetTy enumElemTy (mkUnitDelayLambda g m getEnumExpr) (mkLambda m enumeratorVar (guardExpr, guardTy)) (mkLambda m enumeratorVar (betterCurrentExpr, enumElemTy))) @@ -3921,28 +3921,28 @@ let buildApp cenv expr resultTy arg m = match expr, arg with // Special rule for building applications of the 'x && y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [x0], _), _), _ - when valRefEq g vf g.and_vref - || valRefEq g vf g.and2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + when valRefEq g vref g.and_vref + || valRefEq g vref g.and2_vref -> MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg), resultTy // Special rule for building applications of the 'x || y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [x0], _), _), _ - when valRefEq g vf g.or_vref - || valRefEq g vf g.or2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + when valRefEq g vref g.or_vref + || valRefEq g vref g.or2_vref -> MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ), resultTy // Special rule for building applications of the 'reraise' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.reraise_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.reraise_vref -> // exprTy is of type: "unit -> 'a". Break it and store the 'a type here, used later as return type. MakeApplicableExprNoFlex cenv (mkCompGenSequential m arg (mkReraise m resultTy)), resultTy // Special rules for NativePtr.ofByRef to generalize result. // See RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when (valRefEq g vf g.nativeptr_tobyref_vref) -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when (valRefEq g vref g.nativeptr_tobyref_vref) -> let argTy = NewInferenceType g let resultTy = mkByrefTyWithInference g argTy (NewByRefKindInferenceType g m) @@ -3952,10 +3952,10 @@ let buildApp cenv expr resultTy arg m = // address of an expression. // // See also RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.addrof_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.addrof_vref -> - let wrap, e1a', readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vf) m + let wrap, e1a', readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vref) m // Assert the result type to be readonly if we couldn't take the address let resultTy = let argTy = tyOfExpr g arg @@ -3977,11 +3977,11 @@ let buildApp cenv expr resultTy arg m = // Special rules for building applications of the &&expr' operators, which gets the // address of an expression. - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _), _ - when valRefEq g vf g.addrof2_vref -> + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + when valRefEq g vref g.addrof2_vref -> warning(UseOfAddressOfOperator m) - let wrap, e1a', _readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vf) m + let wrap, e1a', _readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vref) m MakeApplicableExprNoFlex cenv (wrap(e1a')), resultTy | _ when isByrefTy g resultTy -> @@ -4598,7 +4598,7 @@ and TcLongIdent kindOpt cenv newOk checkConstraints occ env tpenv synLongId = error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) TType_measure (NewErrorMeasure ()), tpenv | _, TyparKind.Measure -> - TType_measure (Measure.Con tcref), tpenv + TType_measure (Measure.Const tcref), tpenv | _, TyparKind.Type -> TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref tinstEnclosing [] @@ -4631,7 +4631,7 @@ and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId match args, postfix with | [arg], true -> let ms, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv arg m - TType_measure (Measure.Prod(Measure.Con tcref, ms)), tpenv + TType_measure (Measure.Prod(Measure.Const tcref, ms)), tpenv | _, _ -> errorR(Error(FSComp.SR.tcUnitsOfMeasureInvalidInTypeConstructor(), m)) @@ -5111,8 +5111,8 @@ and TcNestedTypeApplication cenv newOk checkConstraints occ env tpenv mWholeType /// This means the range of syntactic expression forms that can be used here is limited. and ConvSynPatToSynExpr synPat = match synPat with - | SynPat.FromParseError(p, _) -> - ConvSynPatToSynExpr p + | SynPat.FromParseError(innerPat, _) -> + ConvSynPatToSynExpr innerPat | SynPat.Const (c, m) -> SynExpr.Const (c, m) @@ -5120,8 +5120,8 @@ and ConvSynPatToSynExpr synPat = | SynPat.Named (SynIdent(id,_), _, None, _) -> SynExpr.Ident id - | SynPat.Typed (p, cty, m) -> - SynExpr.Typed (ConvSynPatToSynExpr p, cty, m) + | SynPat.Typed (innerPat, tgtTy, m) -> + SynExpr.Typed (ConvSynPatToSynExpr innerPat, tgtTy, m) | SynPat.LongIdent (longDotId=SynLongIdent(longId, dotms, trivia) as synLongId; argPats=args; accessibility=None; range=m) -> let args = match args with SynArgPats.Pats args -> args | _ -> failwith "impossible: active patterns can be used only with SynConstructorArgs.Pats" @@ -5135,8 +5135,8 @@ and ConvSynPatToSynExpr synPat = | SynPat.Tuple (isStruct, args, m) -> SynExpr.Tuple (isStruct, List.map ConvSynPatToSynExpr args, [], m) - | SynPat.Paren (p, _) -> - ConvSynPatToSynExpr p + | SynPat.Paren (innerPat, _) -> + ConvSynPatToSynExpr innerPat | SynPat.ArrayOrList (isArray, args, m) -> SynExpr.ArrayOrList (isArray,List.map ConvSynPatToSynExpr args, m) @@ -5151,26 +5151,26 @@ and ConvSynPatToSynExpr synPat = error(Error(FSComp.SR.tcInvalidArgForParameterizedPattern(), synPat.Range)) /// Check a long identifier 'Case' or 'Case argsR' that has been resolved to an active pattern case -and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv ty (lidRange, item, apref, args, m) = +and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv ty (mLongId, item, apref, args, m) = let g = cenv.g let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv let (APElemRef (apinfo, vref, idx, isStructRetTy)) = apref // Report information about the 'active recognizer' occurrence to IDE - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) // TOTAL/PARTIAL ACTIVE PATTERNS - let _, vexp, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m - let vexp = MakeApplicableExprWithFlex cenv env vexp - let vexpty = vexp.Type + let _, vExpr, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m + let vExpr = MakeApplicableExprWithFlex cenv env vExpr + let vExprTy = vExpr.Type let activePatArgsAsSynPats, patArg = match args with | [] -> [], SynPat.Const(SynConst.Unit, m) | _ -> // This bit of type-directed analysis ensures that parameterized partial active patterns returning unit do not need to take an argument - let dtys, retTy = stripFunTy g vexpty + let dtys, retTy = stripFunTy g vExprTy if dtys.Length = args.Length + 1 && ((isOptionTy g retTy && isUnitTy g (destOptionTy g retTy)) || @@ -5189,9 +5189,9 @@ and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv let delayed = activePatArgsAsSynExprs - |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, arg, unionRanges lidRange arg.Range)) + |> List.map (fun arg -> DelayedApp(ExprAtomicFlag.NonAtomic, false, None, arg, unionRanges mLongId arg.Range)) - let activePatExpr, tpenv = PropagateThenTcDelayed cenv (MustEqual activePatType) env tpenv m vexp vexpty ExprAtomicFlag.NonAtomic delayed + let activePatExpr, tpenv = PropagateThenTcDelayed cenv (MustEqual activePatType) env tpenv m vExpr vExprTy ExprAtomicFlag.NonAtomic delayed let patEnvR = TcPatLinearEnv(tpenv, names, takenNames) @@ -6264,13 +6264,13 @@ and TcExprILAssembly cenv overallTy env tpenv (ilInstrs, synTyArgs, synArgs, syn and RewriteRangeExpr synExpr = match synExpr with // a..b..c (parsed as (a..b)..c ) - | SynExpr.IndexRange(Some (SynExpr.IndexRange(Some synExpr1, _, Some synStepExpr, _, _, _)), _, Some synExpr2, _m1, _m2, wholem) -> - Some (mkSynTrifix wholem ".. .." synExpr1 synStepExpr synExpr2) + | SynExpr.IndexRange(Some (SynExpr.IndexRange(Some synExpr1, _, Some synStepExpr, _, _, _)), _, Some synExpr2, _m1, _m2, mWhole) -> + Some (mkSynTrifix mWhole ".. .." synExpr1 synStepExpr synExpr2) // a..b - | SynExpr.IndexRange (Some synExpr1, mOperator, Some synExpr2, _m1, _m2, wholem) -> + | SynExpr.IndexRange (Some synExpr1, mOperator, Some synExpr2, _m1, _m2, mWhole) -> let otherExpr = match mkSynInfix mOperator synExpr1 ".." synExpr2 with - | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, wholem) + | SynExpr.App (a, b, c, d, _) -> SynExpr.App (a, b, c, d, mWhole) | _ -> failwith "impossible" Some otherExpr | _ -> None @@ -7696,8 +7696,8 @@ and TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, synPat, s match stripDebugPoints enumExpr with // optimize 'for i in n .. m do' - | Expr.App (Expr.Val (vf, _, _), _, [tyarg], [startExpr;finishExpr], _) - when valRefEq g vf g.range_op_vref && typeEquiv g tyarg g.int_ty -> + | Expr.App (Expr.Val (vref, _, _), _, [tyarg], [startExpr;finishExpr], _) + when valRefEq g vref g.range_op_vref && typeEquiv g tyarg g.int_ty -> (g.int32_ty, (fun _ x -> x), id, Choice1Of3 (startExpr, finishExpr)) // optimize 'for i in arr do' @@ -7883,9 +7883,9 @@ and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableEx // See RFC FS-1053.md let isAddrOf = match expr with - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [], _), _) - when (valRefEq g vf g.addrof_vref || - valRefEq g vf g.nativeptr_tobyref_vref) -> true + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _) + when (valRefEq g vref g.addrof_vref || + valRefEq g vref g.nativeptr_tobyref_vref) -> true | _ -> false propagate isAddrOf delayedList' mExprAndArg resultTy @@ -8195,12 +8195,12 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE // will have debug points on "f expr1" and "g expr2" let env = match leftExpr with - | ApplicableExpr(_, Expr.Val (vf, _, _), _) - | ApplicableExpr(_, Expr.App (Expr.Val (vf, _, _), _, _, [_], _), _) - when valRefEq g vf g.and_vref - || valRefEq g vf g.and2_vref - || valRefEq g vf g.or_vref - || valRefEq g vf g.or2_vref -> + | ApplicableExpr(_, Expr.Val (vref, _, _), _) + | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [_], _), _) + when valRefEq g vref g.and_vref + || valRefEq g vref g.and2_vref + || valRefEq g vref g.or_vref + || valRefEq g vref g.or2_vref -> { env with eIsControlFlow = true } | _ -> env @@ -8757,7 +8757,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed vTy // Always allow subsumption on assignment to fields let expr2R, tpenv = TcExprFlex cenv true false vty2 env tpenv expr2 - let vexp = + let vExpr = if isInByrefTy g vTy then errorR(Error(FSComp.SR.writeToReadOnlyByref(), mStmt)) mkAddrSet mStmt vref expr2R @@ -8766,7 +8766,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed else mkValSet mStmt vref expr2R - PropagateThenTcDelayed cenv overallTy env tpenv mStmt (MakeApplicableExprNoFlex cenv vexp) (tyOfExpr g vexp) ExprAtomicFlag.NonAtomic otherDelayed + PropagateThenTcDelayed cenv overallTy env tpenv mStmt (MakeApplicableExprNoFlex cenv vExpr) (tyOfExpr g vExpr) ExprAtomicFlag.NonAtomic otherDelayed // Value instantiation: v ... | DelayedTypeApp(tys, _mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -8780,24 +8780,24 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed match tys with | [SynType.Var(SynTypar(id, _, false) as tp, _m)] -> let _tpR, tpenv = TcTypeOrMeasureParameter None cenv env ImplicitlyBoundTyparsAllowed.NoNewTypars tpenv tp - let vexp = TcNameOfExprResult cenv id mExprAndTypeArgs - let vexpFlex = MakeApplicableExprNoFlex cenv vexp + let vExpr = TcNameOfExprResult cenv id mExprAndTypeArgs + let vexpFlex = MakeApplicableExprNoFlex cenv vExpr PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex g.string_ty ExprAtomicFlag.Atomic otherDelayed | _ -> error (Error(FSComp.SR.expressionHasNoName(), mExprAndTypeArgs)) | _ -> let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem + let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic otherDelayed // Value get | _ -> - let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution delayed = @@ -9054,8 +9054,8 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed | Item.AnonRecdField (anonInfo, tinst, n, _) -> - let tgty = TType_anon (anonInfo, tinst) - AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgty objExprTy + let tgtTy = TType_anon (anonInfo, tinst) + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgtTy objExprTy let fieldTy = List.item n tinst match delayed with | DelayedSet _ :: _otherDelayed -> @@ -9107,7 +9107,7 @@ and TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem objDetails (einf MethInfoChecks g cenv.amap true None objArgs env.eAccessRights mItem delInvokeMeth // This checks for and drops the 'object' sender - let argsTy = ArgsTypOfEventInfo cenv.infoReader mItem ad einfo + let argsTy = ArgsTypeOfEventInfo cenv.infoReader mItem ad einfo if not (slotSigHasVoidReturnTy (delInvokeMeth.GetSlotSig(cenv.amap, mItem))) then errorR (nonStandardEventError einfo.EventName mItem) let delEventTy = mkIEventType g delTy argsTy @@ -11264,14 +11264,13 @@ and AnalyzeRecursiveDecl let rec analyzeRecursiveDeclPat tpenv pat = match pat with - | SynPat.FromParseError(pat', _) -> analyzeRecursiveDeclPat tpenv pat' - | SynPat.Typed(pat', cty, _) -> - let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType envinner tpenv cty + | SynPat.FromParseError(innerPat, _) -> analyzeRecursiveDeclPat tpenv innerPat + | SynPat.Typed(innerPat, tgtTy, _) -> + let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType envinner tpenv tgtTy UnifyTypes cenv envinner mBinding ty ctyR - analyzeRecursiveDeclPat tpenv pat' - | SynPat.Attrib(_pat', _attribs, m) -> + analyzeRecursiveDeclPat tpenv innerPat + | SynPat.Attrib(_innerPat, _attribs, m) -> error(Error(FSComp.SR.tcAttributesInvalidInPatterns(), m)) - //analyzeRecursiveDeclPat pat' // This is for the construct 'let rec x = ... and do ... and y = ...' (DEPRECATED IN pars.mly ) // diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 8b5f1878532..2a83a61d50f 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -1180,7 +1180,7 @@ val TcPatLongIdentActivePatternCase: vFlags: TcPatValFlags -> patEnv: TcPatLinearEnv -> ty: TType -> - lidRange: range * item: Item * apref: ActivePatternElemRef * args: SynPat list * m: range -> + mLongId: range * item: Item * apref: ActivePatternElemRef * args: SynPat list * m: range -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv /// The pattern syntax can also represent active pattern arguments. This routine diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index fb4b4cec03a..1334b1bf54c 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -22,9 +22,9 @@ let copyAndFixupFormatTypar m tp = let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) -let mkFlexibleFormatTypar m tys dflt = +let mkFlexibleFormatTypar m tys dfltTy = let tp = Construct.NewTypar (TyparKind.Type, TyparRigidity.Rigid, SynTypar(mkSynId m "fmt",TyparStaticReq.HeadType,true),false,TyparDynamicReq.Yes,[],false,false) - tp.SetConstraints [ TyparConstraint.SimpleChoice (tys,m); TyparConstraint.DefaultsTo (lowestDefaultPriority,dflt,m)] + tp.SetConstraints [ TyparConstraint.SimpleChoice (tys,m); TyparConstraint.DefaultsTo (lowestDefaultPriority,dfltTy,m)] copyAndFixupFormatTypar m tp let mkFlexibleIntFormatTypar (g: TcGlobals) m = @@ -449,19 +449,19 @@ let parseFormatStringInternal | Some '+' -> collectSpecifierLocation fragLine fragCol 1 let i = skipPossibleInterpolationHole (i+1) - let xty = NewInferenceType g - percentATys.Add(xty) - parseLoop ((posi, xty) :: acc) (i, fragLine, fragCol+1) fragments + let aTy = NewInferenceType g + percentATys.Add(aTy) + parseLoop ((posi, aTy) :: acc) (i, fragLine, fragCol+1) fragments | Some n -> failwith (FSComp.SR.forDoesNotSupportPrefixFlag(ch.ToString(), n.ToString())) | 'a' -> checkOtherFlags ch - let xty = NewInferenceType g - let fty = mkFunTy g printerArgTy (mkFunTy g xty printerResidueTy) + let aTy = NewInferenceType g + let fTy = mkFunTy g printerArgTy (mkFunTy g aTy printerResidueTy) collectSpecifierLocation fragLine fragCol 2 let i = skipPossibleInterpolationHole (i+1) - parseLoop ((Option.map ((+)1) posi, xty) :: (posi, fty) :: acc) (i, fragLine, fragCol+1) fragments + parseLoop ((Option.map ((+)1) posi, aTy) :: (posi, fTy) :: acc) (i, fragLine, fragCol+1) fragments | 't' -> checkOtherFlags ch diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index b39d6481517..7ced746b6a1 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -503,7 +503,7 @@ and TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags (patEnv: TcPatLine | SynArgPats.Pats [] -> warnOnUpper | _ -> AllIdsOK - let lidRange = rangeOfLid longId + let mLongId = rangeOfLid longId match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver warnOnUpperForId false m ad env.NameEnv TypeNameResolutionInfo.Default longId with | Item.NewDef id -> @@ -519,19 +519,19 @@ and TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags (patEnv: TcPatLine let args = GetSynArgPatterns args - TcPatLongIdentActivePatternCase warnOnUpper cenv env vFlags patEnv ty (lidRange, item, apref, args, m) + TcPatLongIdentActivePatternCase warnOnUpper cenv env vFlags patEnv ty (mLongId, item, apref, args, m) | Item.UnionCase _ | Item.ExnCase _ as item -> - TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (lidRange, item, args, m) + TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (mLongId, item, args, m) | Item.ILField finfo -> - TcPatLongIdentILField warnOnUpper cenv env vFlags patEnv ty (lidRange, finfo, args, m) + TcPatLongIdentILField warnOnUpper cenv env vFlags patEnv ty (mLongId, finfo, args, m) | Item.RecdField rfinfo -> - TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfinfo, args, m) + TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (mLongId, rfinfo, args, m) | Item.Value vref -> - TcPatLongIdentLiteral warnOnUpper cenv env vFlags patEnv ty (lidRange, vref, args, m) + TcPatLongIdentLiteral warnOnUpper cenv env vFlags patEnv ty (mLongId, vref, args, m) | _ -> error (Error(FSComp.SR.tcRequireVarConstRecogOrLiteral(), m)) @@ -577,9 +577,9 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item = let ucref = ucinfo.UnionCaseRef CheckUnionCaseAttributes g ucref m |> CommitOperationResult CheckUnionCaseAccessible cenv.amap m ad ucref |> ignore - let gtyp2 = actualResultTyOfUnionCase ucinfo.TypeInst ucref + let resTy = actualResultTyOfUnionCase ucinfo.TypeInst ucref let inst = mkTyparInst ucref.TyconRef.TyparsNoRange ucinfo.TypeInst - UnifyTypes cenv env m overallTy gtyp2 + UnifyTypes cenv env m overallTy resTy let mkf mArgs args = TPat_unioncase(ucref, ucinfo.TypeInst, args, unionRanges m mArgs) mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] @@ -587,11 +587,11 @@ and ApplyUnionCaseOrExn m (cenv: cenv) env overallTy item = invalidArg "item" "not a union case or exception reference" /// Check a long identifier 'Case' or 'Case argsR that has been resolved to a union case or F# exception constructor -and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (lidRange, item, args, m) = +and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (mLongId, item, args, m) = let g = cenv.g // Report information about the case occurrence to IDE - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.eAccessRights) let mkf, argTys, argNames = ApplyUnionCaseOrExn m cenv env ty item let numArgTys = argTys.Length @@ -693,38 +693,38 @@ and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (l (fun values -> mkf m (List.map (fun f -> f values) argsR)), acc /// Check a long identifier that has been resolved to an IL field - valid if a literal -and TcPatLongIdentILField warnOnUpper (cenv: cenv) env vFlags patEnv ty (lidRange, finfo, args, m) = +and TcPatLongIdentILField warnOnUpper (cenv: cenv) env vFlags patEnv ty (mLongId, finfo, args, m) = let g = cenv.g - CheckILFieldInfoAccessible g cenv.amap lidRange env.AccessRights finfo + CheckILFieldInfoAccessible g cenv.amap mLongId env.AccessRights finfo if not finfo.IsStatic then - errorR (Error (FSComp.SR.tcFieldIsNotStatic finfo.FieldName, lidRange)) + errorR (Error (FSComp.SR.tcFieldIsNotStatic finfo.FieldName, mLongId)) CheckILFieldAttributes g finfo m match finfo.LiteralValue with | None -> - error (Error (FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern (), lidRange)) + error (Error (FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern (), mLongId)) | Some lit -> CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args UnifyTypes cenv env m ty (finfo.FieldType (cenv.amap, m)) - let c' = TcFieldInit lidRange lit + let c' = TcFieldInit mLongId lit let item = Item.ILField finfo - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (c', m)), acc /// Check a long identifier that has been resolved to a record field -and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfinfo, args, m) = +and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (mLongId, rfinfo, args, m) = let g = cenv.g - CheckRecdFieldInfoAccessible cenv.amap lidRange env.AccessRights rfinfo - if not rfinfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), lidRange)) - CheckRecdFieldInfoAttributes g rfinfo lidRange |> CommitOperationResult + CheckRecdFieldInfoAccessible cenv.amap mLongId env.AccessRights rfinfo + if not rfinfo.IsStatic then errorR (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), mLongId)) + CheckRecdFieldInfoAttributes g rfinfo mLongId |> CommitOperationResult match rfinfo.LiteralValue with - | None -> error (Error(FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern(), lidRange)) + | None -> error (Error(FSComp.SR.tcFieldNotLiteralCannotBeUsedInPattern(), mLongId)) | Some lit -> CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args @@ -733,26 +733,26 @@ and TcPatLongIdentRecdField warnOnUpper cenv env vFlags patEnv ty (lidRange, rfi let item = Item.RecdField rfinfo // FUTURE: can we do better than emptyTyparInst here, in order to display instantiations // of type variables in the quick info provided in the IDE. - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (lit, m)), acc /// Check a long identifier that has been resolved to an F# value that is a literal -and TcPatLongIdentLiteral warnOnUpper (cenv: cenv) env vFlags patEnv ty (lidRange, vref, args, m) = +and TcPatLongIdentLiteral warnOnUpper (cenv: cenv) env vFlags patEnv ty (mLongId, vref, args, m) = let g = cenv.g let (TcPatLinearEnv(tpenv, _, _)) = patEnv match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) | Some lit -> - let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None lidRange - CheckValAccessible lidRange env.AccessRights vref - CheckFSharpAttributes g vref.Attribs lidRange |> CommitOperationResult + let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None mLongId + CheckValAccessible mLongId env.AccessRights vref + CheckFSharpAttributes g vref.Attribs mLongId |> CommitOperationResult CheckNoArgsForLiteral args m let _, acc = TcArgPats warnOnUpper cenv env vFlags patEnv args UnifyTypes cenv env m ty vexpty let item = Item.Value vref - CallNameResolutionSink cenv.tcSink (lidRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) + CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurence.Pattern, env.AccessRights) (fun _ -> TPat_const (lit, m)), acc and TcPatterns warnOnUpper cenv env vFlags s argTys args = diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 7d7097dc25a..dd9fd013553 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -136,12 +136,12 @@ let FreshenTypars m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tptys = FreshenTypeInst m tpsorig - tptys + let _, _, tpTys = FreshenTypeInst m tpsorig + tpTys let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tptys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars - tptys + let _, _, tpTys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars + tpTys //------------------------------------------------------------------------- // Unification of types: solve/record equality constraints @@ -362,7 +362,7 @@ let rec occursCheck g un ty = | TType_app (_, l, _) | TType_anon(_, l) | TType_tuple (_, l) -> List.exists (occursCheck g un) l - | TType_fun (d, r, _) -> occursCheck g un d || occursCheck g un r + | TType_fun (domainTy, rangeTy, _) -> occursCheck g un domainTy || occursCheck g un rangeTy | TType_var (r, _) -> typarEq un r | TType_forall (_, tau) -> occursCheck g un tau | _ -> false @@ -428,7 +428,7 @@ let isFpTy g ty = /// decimal or decimal<_> let isDecimalTy g ty = - typeEquivAux EraseMeasures g g.decimal_ty ty + typeEquivAux EraseMeasures g g.decimal_ty ty let IsNonDecimalNumericOrIntegralEnumType g ty = IsIntegerOrIntegerEnumTy g ty || isFpTy g ty @@ -443,7 +443,7 @@ let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g let IsCharOrStringType g ty = isCharTy g ty || isStringTy g ty /// Checks the argument type for a built-in solution to an op_Addition, op_Subtraction or op_Modulus constraint. -let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) +let IsAddSubModType nm g ty = IsNumericOrIntegralEnumType g ty || (nm = "op_Addition" && IsCharOrStringType g ty) || (nm = "op_Subtraction" && isCharTy g ty) /// Checks the argument type for a built-in solution to a bitwise operator constraint let IsBitwiseOpType g ty = IsIntegerOrIntegerEnumTy g ty || (isEnumTy g ty) @@ -787,7 +787,7 @@ let UnifyMeasureWithOne (csenv: ConstraintSolverEnv) trace ms = match FindPreferredTypar nonRigidVars with | (v, e) :: vs -> let unexpandedCons = ListMeasureConOccsWithNonZeroExponents csenv.g false ms - let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower (Measure.Con c, NegRational (DivRational e' e))) unexpandedCons + let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e))) unexpandedCons @ List.map (fun (v, e') -> Measure.RationalPower (Measure.Var v, NegRational (DivRational e' e))) (vs @ rigidVars)) SubstMeasureWarnIfRigid csenv trace v newms @@ -818,7 +818,7 @@ let SimplifyMeasure g vars ms = let newms = ProdMeasures [ for (c, e') in nonZeroCon do - Measure.RationalPower (Measure.Con c, NegRational (DivRational e' e)) + Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e)) for (v', e') in nonZeroVar do if typarEq v v' then newvarExpr @@ -841,11 +841,11 @@ let rec SimplifyMeasuresInType g resultFirst (generalizable, generalized as para | TType_anon (_,l) | TType_tuple (_, l) -> SimplifyMeasuresInTypes g param l - | TType_fun (d, r, _) -> + | TType_fun (domainTy, rangeTy, _) -> if resultFirst then - SimplifyMeasuresInTypes g param [r;d] + SimplifyMeasuresInTypes g param [rangeTy;domainTy] else - SimplifyMeasuresInTypes g param [d;r] + SimplifyMeasuresInTypes g param [domainTy;rangeTy] | TType_var _ -> param @@ -886,7 +886,7 @@ let rec GetMeasureVarGcdInType v ty = | TType_anon (_,l) | TType_tuple (_, l) -> GetMeasureVarGcdInTypes v l - | TType_fun (d, r, _) -> GcdRational (GetMeasureVarGcdInType v d) (GetMeasureVarGcdInType v r) + | TType_fun (domainTy, rangeTy, _) -> GcdRational (GetMeasureVarGcdInType v domainTy) (GetMeasureVarGcdInType v rangeTy) | TType_var _ -> ZeroRational | TType_forall (_, tau) -> GetMeasureVarGcdInType v tau | TType_measure unt -> MeasureVarExponent v unt @@ -1027,7 +1027,7 @@ and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.DefaultsTo(priority, dty, m)) | TyparConstraint.SupportsNull m2 -> SolveTypeUseSupportsNull csenv ndeep m2 trace ty - | TyparConstraint.IsEnum(underlying, m2) -> SolveTypeIsEnum csenv ndeep m2 trace ty underlying + | TyparConstraint.IsEnum(underlyingTy, m2) -> SolveTypeIsEnum csenv ndeep m2 trace ty underlyingTy | TyparConstraint.SupportsComparison(m2) -> SolveTypeSupportsComparison csenv ndeep m2 trace ty | TyparConstraint.SupportsEquality(m2) -> SolveTypeSupportsEquality csenv ndeep m2 trace ty | TyparConstraint.IsDelegate(aty, bty, m2) -> SolveTypeIsDelegate csenv ndeep m2 trace ty aty bty @@ -1054,17 +1054,17 @@ and SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalT } // Like SolveTyparEqualsType but asserts all typar equalities simultaneously instead of one by one -and SolveTyparsEqualTypes (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) tptys tys = trackErrors { - do! (tptys, tys) ||> Iterate2D (fun tpty ty -> - match tpty with +and SolveTyparsEqualTypes (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) tpTys tys = trackErrors { + do! (tpTys, tys) ||> Iterate2D (fun tpTy ty -> + match tpTy with | TType_var (r, _) | TType_measure (Measure.Var r) -> - SolveTyparEqualsTypePart1 csenv m2 trace tpty r ty + SolveTyparEqualsTypePart1 csenv m2 trace tpTy r ty | _ -> failwith "SolveTyparsEqualTypes") - do! (tptys, tys) ||> Iterate2D (fun tpty ty -> - match tpty with + do! (tpTys, tys) ||> Iterate2D (fun tpTy ty -> + match tpTy with | TType_var (r, _) | TType_measure (Measure.Var r) -> SolveTyparEqualsTypePart2 csenv ndeep m2 trace r ty @@ -1135,7 +1135,7 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr match sty1, sty2 with // type vars inside forall-types may be alpha-equivalent - | TType_var (tp1, _), TType_var (tp2, _) when typarEq tp1 tp2 || (match aenv.EquivTypars.TryFind tp1 with | Some v when typeEquiv g v ty2 -> true | _ -> false) -> + | TType_var (tp1, _), TType_var (tp2, _) when typarEq tp1 tp2 || (match aenv.EquivTypars.TryFind tp1 with | Some tpTy1 when typeEquiv g tpTy1 ty2 -> true | _ -> false) -> CompleteD // 'v1 = 'v2 @@ -1173,18 +1173,18 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2) - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - SolveFunTypeEqn csenv ndeep m2 trace None d1 d2 r1 r2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + SolveFunTypeEqn csenv ndeep m2 trace None domainTy1 domainTy2 rangeTy1 rangeTy2 | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 - | TType_forall(tps1, rty1), TType_forall(tps2, rty2) -> + | TType_forall(tps1, bodyTy1), TType_forall(tps2, bodyTy2) -> if tps1.Length <> tps2.Length then localAbortD else let aenv = aenv.BindEquivTypars tps1 tps2 let csenv = {csenv with EquivEnv = aenv } if not (typarsAEquiv g aenv tps1 tps2) then localAbortD else - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 + SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace bodyTy1 bodyTy2 | TType_ucase (uc1, l1), TType_ucase (uc2, l2) when g.unionCaseRefEq uc1 uc2 -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2 | _ -> localAbortD @@ -1214,9 +1214,9 @@ and SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln origl1 origl2 = ErrorD(ConstraintSolverTupleDiffLengths(csenv.DisplayEnv, origl1, origl2, csenv.m, m2)) loop origl1 origl2 -and SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 = trackErrors { - do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln d1 d2 - return! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln r1 r2 +and SolveFunTypeEqn csenv ndeep m2 trace cxsln domainTy1 domainTy2 rangeTy1 rangeTy2 = trackErrors { + do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln domainTy1 domainTy2 + return! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln rangeTy1 rangeTy2 } // ty1: expected @@ -1240,7 +1240,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional match sty1, sty2 with | TType_var (tp1, _), _ -> match aenv.EquivTypars.TryFind tp1 with - | Some v -> SolveTypeSubsumesType csenv ndeep m2 trace cxsln v ty2 + | Some tpTy1 -> SolveTypeSubsumesType csenv ndeep m2 trace cxsln tpTy1 ty2 | _ -> match sty2 with | TType_var (r2, _) when typarEq tp1 r2 -> CompleteD @@ -1258,8 +1258,8 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2) (* nb. can unify since no variance *) - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 (* nb. can unify since no variance *) + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + SolveFunTypeEqn csenv ndeep m2 trace cxsln domainTy1 domainTy2 rangeTy1 rangeTy2 (* nb. can unify since no variance *) | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 @@ -1306,17 +1306,17 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional // Note we don't support co-variance on array types nor // the special .NET conversions for these types match ty1 with - | AppTy g (tcr1, tinst) when + | AppTy g (tcref1, tinst1) when isArray1DTy g ty2 && - (tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IList || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_ICollection || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IReadOnlyList || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IReadOnlyCollection || - tyconRefEq g tcr1 g.tcref_System_Collections_Generic_IEnumerable) -> - match tinst with - | [ty1arg] -> - let ty2arg = destArrayTy g ty2 - SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ty1arg ty2arg + (tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IList || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_ICollection || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IReadOnlyList || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IReadOnlyCollection || + tyconRefEq g tcref1 g.tcref_System_Collections_Generic_IEnumerable) -> + match tinst1 with + | [elemTy1] -> + let elemTy2 = destArrayTy g ty2 + SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln elemTy1 elemTy2 | _ -> error(InternalError("destArrayTy", m)) | _ -> @@ -1525,13 +1525,13 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload if rankOfArrayTy g ty <> argTys.Length - 1 then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), (argTys.Length - 1)), m, m2)) - let argTys, ety = List.frontAndBack argTys + let argTys, lastTy = List.frontAndBack argTys for argTy in argTys do do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy g.int_ty - let etys = destArrayTy g ty - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys + let elemTy = destArrayTy g ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace lastTy elemTy return TTraitBuiltIn | [], _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argTy1;argTy2] @@ -1601,25 +1601,30 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy argTy return TTraitBuiltIn - | _, _, false, "op_Explicit", [argTy] - when (// The input type. + // Conversions from non-decimal numbers / strings / chars to non-decimal numbers / chars are built-in + | _, _, false, "op_Explicit", [argTy] + when (// The input type. (IsNonDecimalNumericOrIntegralEnumType g argTy || isStringTy g argTy || isCharTy g argTy) && // The output type - (IsNonDecimalNumericOrIntegralEnumType g retTy || isCharTy g retTy) && - // Exclusion: IntPtr and UIntPtr do not support .Parse() from string - not (isStringTy g argTy && isNativeIntegerTy g retTy) && - // Exclusion: No conversion from char to decimal - not (isCharTy g argTy && isDecimalTy g retTy)) -> + (IsNonDecimalNumericOrIntegralEnumType g retTy || isCharTy g retTy)) -> return TTraitBuiltIn - - | _, _, false, "op_Explicit", [argTy] - when (// The input type. - (IsNumericOrIntegralEnumType g argTy || isStringTy g argTy) && + // Conversions from (including decimal) numbers / strings / chars to decimals are built-in + | _, _, false, "op_Explicit", [argTy] + when (// The input type. + (IsNumericOrIntegralEnumType g argTy || isStringTy g argTy || isCharTy g argTy) && // The output type - (isDecimalTy g retTy)) -> + (isDecimalTy g retTy)) -> + return TTraitBuiltIn + // Conversions from decimal numbers to native integers are built-in + // The rest of decimal conversions are handled via op_Explicit lookup on System.Decimal (which also looks for op_Implicit) + | _, _, false, "op_Explicit", [argTy] + when (// The input type. + (isDecimalTy g argTy) && + // The output type + (isNativeIntegerTy g retTy)) -> return TTraitBuiltIn | [], _, false, "Pow", [argTy1; argTy2] @@ -1845,10 +1850,10 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = match callMethInfoOpt, callExpr with | Some methInfo, Expr.Op (TOp.ILCall (_, _, _, _, NormalValUse, _, _, ilMethRef, _, methInst, _), [], args, m) when (args, (objArgVars@allArgVars)) ||> List.lengthsEqAndForall2 (fun a b -> match a with Expr.Val (v, _, _) -> valEq v.Deref b | _ -> false) -> - let declaringType = ImportProvidedType amap m (methInfo.PApply((fun x -> x.DeclaringType), m)) - if isILAppTy g declaringType then + let declaringTy = ImportProvidedType amap m (methInfo.PApply((fun x -> x.DeclaringType), m)) + if isILAppTy g declaringTy then let extOpt = None // EXTENSION METHODS FROM TYPE PROVIDERS: for extension methods coming from the type providers we would have something here. - ILMethSln(declaringType, extOpt, ilMethRef, methInst) + ILMethSln(declaringTy, extOpt, ilMethRef, methInst) else closedExprSln | _ -> @@ -2090,8 +2095,8 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ -> true | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice (tys2, _) -> ListSet.isSubsetOf (typeEquiv g) tys1 tys2 - | TyparConstraint.DefaultsTo (priority1, dty1, _), TyparConstraint.DefaultsTo (priority2, dty2, _) -> - (priority1 = priority2) && typeEquiv g dty1 dty2 + | TyparConstraint.DefaultsTo (priority1, defaultTy1, _), TyparConstraint.DefaultsTo (priority2, defaultTy2, _) -> + (priority1 = priority2) && typeEquiv g defaultTy1 defaultTy2 | _ -> false @@ -2565,14 +2570,12 @@ and SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv and SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln ty1 ty2 id -// ty1: actual -// ty2: expected -and private SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actual expected = +and SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actualTy expectedTy = TryD - (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actual expected) + (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actualTy expectedTy) (function | AbortForFailedMemberConstraintResolution as err -> ErrorD err - | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actual, expected, res, m))) + | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actualTy, expectedTy, res, m))) and ArgsMustSubsumeOrConvert (csenv: ConstraintSolverEnv) diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index a914e61d256..93f452abd7d 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -201,7 +201,7 @@ and accDiscrim cenv env d = | DecisionTreeTest.ArrayLength(_, ty) -> accTy cenv env ty | DecisionTreeTest.Const _ | DecisionTreeTest.IsNull -> () - | DecisionTreeTest.IsInst (srcty, tgty) -> accTy cenv env srcty; accTy cenv env tgty + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> accTy cenv env srcTy; accTy cenv env tgtTy | DecisionTreeTest.ActivePatternCase (exp, tys, _, _, _, _) -> accExpr cenv env exp accTypeInst cenv env tys diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 75a4e9aa897..581cb7d0353 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -628,10 +628,10 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = keyComparer= { new System.Collections.Generic.IEqualityComparer<_> with - member _.Equals((flags1, _, typ1), (flags2, _, typ2)) = + member _.Equals((flags1, _, ty1), (flags2, _, ty2)) = // Ignoring the ranges - that's OK. flagsEq.Equals(flags1, flags2) && - match stripTyEqns g typ1, stripTyEqns g typ2 with + match stripTyEqns g ty1, stripTyEqns g ty2 with | TType_app(tcref1, [], _), TType_app(tcref2, [], _) -> tyconRefEq g tcref1 tcref2 | _ -> false member _.GetHashCode((flags, _, ty)) = @@ -910,11 +910,11 @@ type SigOfFunctionForDelegate = /// Given a delegate type work out the minfo, argument types, return type /// and F# function type by looking at the Invoke signature of the delegate. -let GetSigOfFunctionForDelegate (infoReader: InfoReader) delty m ad = +let GetSigOfFunctionForDelegate (infoReader: InfoReader) delTy m ad = let g = infoReader.g let amap = infoReader.amap let delInvokeMeth = - match GetIntrinsicMethInfosOfType infoReader (Some "Invoke") ad AllowMultiIntfInstantiations.Yes IgnoreOverrides m delty with + match GetIntrinsicMethInfosOfType infoReader (Some "Invoke") ad AllowMultiIntfInstantiations.Yes IgnoreOverrides m delTy with | [h] -> h | [] -> error(Error(FSComp.SR.noInvokeMethodsFound (), m)) | h :: _ -> warning(InternalError(FSComp.SR.moreThanOneInvokeMethodFound (), m)); h @@ -964,26 +964,26 @@ let TryDestStandardDelegateType (infoReader: InfoReader) m ad delTy = // already defined an appropriate delegate type: EventHandler. // (from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkEventsTutorial.asp) let IsStandardEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = - let dty = einfo.GetDelegateType(infoReader.amap, m) - match TryDestStandardDelegateType infoReader m ad dty with + let delTy = einfo.GetDelegateType(infoReader.amap, m) + match TryDestStandardDelegateType infoReader m ad delTy with | Some _ -> true | None -> false /// Get the (perhaps tupled) argument type accepted by an event -let ArgsTypOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = +let ArgsTypeOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = let amap = infoReader.amap - let dty = einfo.GetDelegateType(amap, m) - match TryDestStandardDelegateType infoReader m ad dty with + let delTy = einfo.GetDelegateType(amap, m) + match TryDestStandardDelegateType infoReader m ad delTy with | Some(argTys, _) -> argTys | None -> error(nonStandardEventError einfo.EventName m) /// Get the type of the event when looked at as if it is a property /// Used when displaying the property in Intellisense -let PropTypOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = +let PropTypeOfEventInfo (infoReader: InfoReader) m ad (einfo: EventInfo) = let g = infoReader.g let amap = infoReader.amap let delTy = einfo.GetDelegateType(amap, m) - let argsTy = ArgsTypOfEventInfo infoReader m ad einfo + let argsTy = ArgsTypeOfEventInfo infoReader m ad einfo mkIEventType g delTy argsTy /// Try to find the name of the metadata file for this external definition diff --git a/src/Compiler/Checking/InfoReader.fsi b/src/Compiler/Checking/InfoReader.fsi index 5941702256a..c8cec7f82da 100644 --- a/src/Compiler/Checking/InfoReader.fsi +++ b/src/Compiler/Checking/InfoReader.fsi @@ -280,7 +280,7 @@ type SigOfFunctionForDelegate = /// Given a delegate type work out the minfo, argument types, return type /// and F# function type by looking at the Invoke signature of the delegate. val GetSigOfFunctionForDelegate: - infoReader: InfoReader -> delty: TType -> m: range -> ad: AccessorDomain -> SigOfFunctionForDelegate + infoReader: InfoReader -> delTy: TType -> m: range -> ad: AccessorDomain -> SigOfFunctionForDelegate /// Try and interpret a delegate type as a "standard" .NET delegate type associated with an event, with a "sender" parameter. val TryDestStandardDelegateType: @@ -290,9 +290,9 @@ val TryDestStandardDelegateType: /// with a sender parameter. val IsStandardEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> bool -val ArgsTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType +val ArgsTypeOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType -val PropTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType +val PropTypeOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType /// Try to find the name of the metadata file for this external definition val TryFindMetadataInfoOfExternalEntityRef: diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 6331c9a992d..7c8c07cb883 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -181,7 +181,7 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT let reqdTy2 = if isTyparTy g reqdTy then let tp = destTyparTy g reqdTy - match tp.Constraints |> List.choose (function TyparConstraint.CoercesTo (c, _) -> Some c | _ -> None) with + match tp.Constraints |> List.choose (function TyparConstraint.CoercesTo (tgtTy, _) -> Some tgtTy | _ -> None) with | [reqdTy2] when tp.Rigidity = TyparRigidity.Flexible -> reqdTy2 | _ -> reqdTy else reqdTy @@ -363,8 +363,8 @@ let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableO calledArgTy, TypeDirectedConversionUsed.No, None | _ -> let compgenId = mkSynId range0 unassignedTyparName - let tp = mkTyparTy (Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, SynTypar(compgenId, TyparStaticReq.None, true), false, TyparDynamicReq.No, [], false, false)) - tp, TypeDirectedConversionUsed.No, None + let tpTy = mkTyparTy (Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, SynTypar(compgenId, TyparStaticReq.None, true), false, TyparDynamicReq.No, [], false, false)) + tpTy, TypeDirectedConversionUsed.No, None else AdjustCalledArgTypeForTypeDirectedConversionsAndAutoQuote infoReader ad callerArgTy calledArgTy calledArg m @@ -456,7 +456,7 @@ type CalledMethArgSet<'T> = let MakeCalledArgs amap m (minfo: MethInfo) minst = // Mark up the arguments with their position, so we can sort them back into order later let paramDatas = minfo.GetParamDatas(amap, m, minst) - paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) -> + paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, calledArgTy)) -> { Position=(i,j) IsParamArray=isParamArrayArg OptArgInfo=optArgInfo @@ -465,7 +465,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst = IsOutArg=isOutArg ReflArgInfo=reflArgInfo NameOpt=nmOpt - CalledArgumentType=typeOfCalledArg }) + CalledArgumentType=calledArgTy }) /// /// Represents the syntactic matching between a caller of a method and the called method. @@ -969,7 +969,7 @@ let BuildILMethInfoCall g amap m isProp (minfo: ILMethInfo) valUseFlags minst di /// /// QUERY: this looks overly complex considering that we are doing a fundamentally simple /// thing here. -let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = +let BuildFSharpMethodApp g m (vref: ValRef) vExpr vexprty (args: Exprs) = let arities = (arityOfVal vref.Deref).AritiesOfArgs let args3, (leftover, retTy) = @@ -990,17 +990,17 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = (mkRefTupled g m tupargs tuptys), (argst, rangeOfFunTy g fty) ) if not leftover.IsEmpty then error(InternalError("Unexpected "+string(leftover.Length)+" remaining arguments in method application", m)) - mkApps g ((vexp, vexprty), [], args3, m), + mkApps g ((vExpr, vexprty), [], args3, m), retTy /// Build a call to an F# method. let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = - let vexp = Expr.Val (vref, valUseFlags, m) - let vexpty = vref.Type + let vExpr = Expr.Val (vref, valUseFlags, m) + let vExprTy = vref.Type let tpsorig, tau = vref.GeneralizedType let vtinst = argsOfAppTy g ty @ minst if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected List.length mismatch", m)) - let expr = mkTyAppExpr m (vexp, vexpty) vtinst + let expr = mkTyAppExpr m (vExpr, vExprTy) vtinst let exprTy = instType (mkTyparInst tpsorig vtinst) tau BuildFSharpMethodApp g m vref expr exprTy args @@ -1113,8 +1113,8 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA if valRefEq amap.g fsValRef amap.g.reraise_vref then mkReraise m exprTy, exprTy else - let vexp, vexpty = tcVal fsValRef valUseFlags (minfo.DeclaringTypeInst @ minst) m - BuildFSharpMethodApp g m fsValRef vexp vexpty allArgs + 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 isNewObj = isCtor && (match valUseFlags with NormalValUse -> true | _ -> false) @@ -1139,8 +1139,8 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA // Go see if this is a use of a recursive definition... Note we know the value instantiation // we want to use so we pass that in order not to create a new one. - let vexp, vexpty = tcVal vref valUseFlags (minfo.DeclaringTypeInst @ minst) m - BuildFSharpMethodApp g m vref vexp vexpty allArgs + let vExpr, vExprTy = tcVal vref valUseFlags (minfo.DeclaringTypeInst @ minst) m + BuildFSharpMethodApp g m vref vExpr vExprTy allArgs // Build a 'call' to a struct default constructor | DefaultStructCtor (g, ty) -> @@ -1793,6 +1793,7 @@ module ProvidedMethodCalls = for v, e in Seq.zip (paramVars |> Seq.map (fun x -> x.PUntaint(id, m))) (Option.toList thisArg @ allArgs) do dict.Add(v, (None, e)) dict + let rec exprToExprAndWitness top (ea: Tainted) = let fail() = error(Error(FSComp.SR.etUnsupportedProvidedExpression(ea.PUntaint((fun etree -> etree.UnderlyingExpressionString), m)), m)) match ea with @@ -1806,139 +1807,139 @@ module ProvidedMethodCalls = 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 te = mkCoerceIfNeeded g targetTy sourceTy srcExpr - None, (te, tyOfExpr g te) + 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 te = mkCallTypeTest g m targetTy srcExpr - None, (te, tyOfExpr g te) + let exprR = mkCallTypeTest g m targetTy srcExpr + None, (exprR, tyOfExpr g exprR) | ProvidedIfThenElseExpr (test, thenBranch, elseBranch) -> let test, thenBranch, elseBranch = exprType.PApply3((fun _ -> (test, thenBranch, elseBranch)), m) let testExpr = exprToExpr test let ifTrueExpr = exprToExpr thenBranch let ifFalseExpr = exprToExpr elseBranch - let te = mkCond DebugPointAtBinding.NoneAtSticky m (tyOfExpr g ifTrueExpr) testExpr ifTrueExpr ifFalseExpr - None, (te, tyOfExpr g te) + let exprR = mkCond DebugPointAtBinding.NoneAtSticky m (tyOfExpr g ifTrueExpr) testExpr ifTrueExpr ifFalseExpr + None, (exprR, tyOfExpr g exprR) | ProvidedVarExpr providedVar -> let _, vTe = varToExpr (exprType.PApply((fun _ -> providedVar), m)) None, (vTe, tyOfExpr g vTe) | ProvidedConstantExpr (obj, prType) -> - let ce = convertConstExpr g amap m (exprType.PApply((fun _ -> (obj, prType)), m)) - None, (ce, tyOfExpr g ce) + let exprR = convertConstExpr g amap m (exprType.PApply((fun _ -> (obj, prType)), m)) + None, (exprR, tyOfExpr g exprR) | ProvidedNewTupleExpr info -> let elems = exprType.PApplyArray((fun _ -> info), "GetInvokerExpression", m) - let elemsT = elems |> Array.map exprToExpr |> Array.toList - let exprT = mkRefTupledNoTypes g m elemsT - None, (exprT, tyOfExpr g exprT) + let elemsR = elems |> Array.map exprToExpr |> Array.toList + let exprR = mkRefTupledNoTypes g m elemsR + None, (exprR, tyOfExpr g exprR) | ProvidedNewArrayExpr (ty, elems) -> let ty, elems = exprType.PApply2((fun _ -> (ty, elems)), m) - let tyT = Import.ImportProvidedType amap m ty + let tyR = Import.ImportProvidedType amap m ty let elems = elems.PApplyArray(id, "GetInvokerExpression", m) - let elemsT = elems |> Array.map exprToExpr |> Array.toList - let exprT = Expr.Op (TOp.Array, [tyT], elemsT, m) - None, (exprT, tyOfExpr g exprT) + let elemsR = elems |> Array.map exprToExpr |> Array.toList + let exprR = Expr.Op (TOp.Array, [tyR], elemsR, m) + None, (exprR, tyOfExpr g exprR) | ProvidedTupleGetExpr (inp, n) -> let inp, n = exprType.PApply2((fun _ -> (inp, n)), m) - let inpT = inp |> exprToExpr + let inpR = inp |> exprToExpr // if type of expression is erased type then we need convert it to the underlying base type - let typeOfExpr = - let t = tyOfExpr g inpT + let exprTy = + let t = tyOfExpr g inpR stripTyEqnsWrtErasure EraseMeasures g t - let tupInfo, tysT = tryDestAnyTupleTy g typeOfExpr - let exprT = mkTupleFieldGet g (tupInfo, inpT, tysT, n.PUntaint(id, m), m) - None, (exprT, tyOfExpr g exprT) + let tupInfo, tysT = tryDestAnyTupleTy g exprTy + let exprR = mkTupleFieldGet g (tupInfo, inpR, tysT, n.PUntaint(id, m), m) + None, (exprR, tyOfExpr g exprR) | ProvidedLambdaExpr (v, b) -> let v, b = exprType.PApply2((fun _ -> (v, b)), m) - let vT = addVar v - let bT = exprToExpr b + let vR = addVar v + let bR = exprToExpr b removeVar v - let exprT = mkLambda m vT (bT, tyOfExpr g bT) - None, (exprT, tyOfExpr g exprT) + let exprR = mkLambda m vR (bR, tyOfExpr g bR) + None, (exprR, tyOfExpr g exprR) | ProvidedLetExpr (v, e, b) -> let v, e, b = exprType.PApply3((fun _ -> (v, e, b)), m) - let eT = exprToExpr e - let vT = addVar v - let bT = exprToExpr b + let eR = exprToExpr e + let vR = addVar v + let bR = exprToExpr b removeVar v - let exprT = mkCompGenLet m vT eT bT - None, (exprT, tyOfExpr g exprT) + let exprR = mkCompGenLet m vR eR bR + None, (exprR, tyOfExpr g exprR) | ProvidedVarSetExpr (v, e) -> let v, e = exprType.PApply2((fun _ -> (v, e)), m) - let eT = exprToExpr e - let vTopt, _ = varToExpr v - match vTopt with + let eR = exprToExpr e + let vOptR, _ = varToExpr v + match vOptR with | None -> fail() - | Some vT -> - let exprT = mkValSet m (mkLocalValRef vT) eT - None, (exprT, tyOfExpr g exprT) + | Some vR -> + 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 guardExprT = exprToExpr guardExpr - let bodyExprT = exprToExpr bodyExpr - let exprT = mkWhile g (DebugPointAtWhile.No, SpecialWhileLoopMarker.NoSpecialWhileLoopMarker, guardExprT, bodyExprT, m) - None, (exprT, tyOfExpr g exprT) + let guardExprR = exprToExpr guardExpr + let bodyExprR = exprToExpr bodyExpr + let exprR = mkWhile g (DebugPointAtWhile.No, SpecialWhileLoopMarker.NoSpecialWhileLoopMarker, guardExprR, bodyExprR, m) + None, (exprR, tyOfExpr g exprR) | ProvidedForIntegerRangeLoopExpr (v, e1, e2, e3) -> let v, e1, e2, e3 = exprType.PApply4((fun _ -> (v, e1, e2, e3)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let vT = addVar v - let e3T = exprToExpr e3 + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let vR = addVar v + let e3R = exprToExpr e3 removeVar v - let exprT = mkFastForLoop g (DebugPointAtFor.No, DebugPointAtInOrTo.No, m, vT, e1T, true, e2T, e3T) - None, (exprT, tyOfExpr g exprT) + let exprR = mkFastForLoop g (DebugPointAtFor.No, DebugPointAtInOrTo.No, m, vR, e1R, true, e2R, e3R) + None, (exprR, tyOfExpr g exprR) | ProvidedNewDelegateExpr (delegateTy, boundVars, delegateBodyExpr) -> let delegateTy, boundVars, delegateBodyExpr = exprType.PApply3((fun _ -> (delegateTy, boundVars, delegateBodyExpr)), m) - let delegateTyT = Import.ImportProvidedType amap m delegateTy + let delegateTyR = Import.ImportProvidedType amap m delegateTy let vs = boundVars.PApplyArray(id, "GetInvokerExpression", m) |> Array.toList let vsT = List.map addVar vs - let delegateBodyExprT = exprToExpr delegateBodyExpr + let delegateBodyExprR = exprToExpr delegateBodyExpr List.iter removeVar vs - let lambdaExpr = mkLambdas g m [] vsT (delegateBodyExprT, tyOfExpr g delegateBodyExprT) + let lambdaExpr = mkLambdas g m [] vsT (delegateBodyExprR, tyOfExpr g delegateBodyExprR) let lambdaExprTy = tyOfExpr g lambdaExpr let infoReader = InfoReader(g, amap) - let exprT = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyT - None, (exprT, tyOfExpr g exprT) + let exprR = CoerceFromFSharpFuncToDelegate g amap infoReader AccessorDomain.AccessibleFromSomewhere lambdaExprTy m lambdaExpr delegateTyR + None, (exprR, tyOfExpr g exprR) #if PROVIDED_ADDRESS_OF | ProvidedAddressOfExpr e -> - let eT = exprToExpr (exprType.PApply((fun _ -> e), m)) - let wrap,ce, _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates eT None m - let ce = wrap ce - None, (ce, tyOfExpr g ce) + let eR = exprToExpr (exprType.PApply((fun _ -> e), m)) + let wrap,exprR, _readonly, _writeonly = mkExprAddrOfExpr g true false DefinitelyMutates eR None m + let exprR = wrap exprR + None, (exprR, tyOfExpr g exprR) #endif | ProvidedDefaultExpr pty -> let ty = Import.ImportProvidedType amap m (exprType.PApply((fun _ -> pty), m)) - let ce = mkDefault (m, ty) - None, (ce, tyOfExpr g ce) + let exprR = mkDefault (m, ty) + None, (exprR, tyOfExpr g exprR) | ProvidedCallExpr (e1, e2, e3) -> methodCallToExpr top ea (exprType.PApply((fun _ -> (e1, e2, e3)), m)) | ProvidedSequentialExpr (e1, e2) -> let e1, e2 = exprType.PApply2((fun _ -> (e1, e2)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let ce = mkCompGenSequential m e1T e2T - None, (ce, tyOfExpr g ce) + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let exprR = mkCompGenSequential m e1R e2R + None, (exprR, tyOfExpr g exprR) | ProvidedTryFinallyExpr (e1, e2) -> let e1, e2 = exprType.PApply2((fun _ -> (e1, e2)), m) - let e1T = exprToExpr e1 - let e2T = exprToExpr e2 - let ce = mkTryFinally g (e1T, e2T, m, tyOfExpr g e1T, DebugPointAtTry.No, DebugPointAtFinally.No) - None, (ce, tyOfExpr g ce) + let e1R = exprToExpr e1 + let e2R = exprToExpr e2 + let exprR = mkTryFinally g (e1R, e2R, m, tyOfExpr g e1R, DebugPointAtTry.No, DebugPointAtFinally.No) + None, (exprR, tyOfExpr g exprR) | ProvidedTryWithExpr (e1, e2, e3, e4, e5) -> let info = exprType.PApply((fun _ -> (e1, e2, e3, e4, e5)), m) - let bT = exprToExpr (info.PApply((fun (x, _, _, _, _) -> x), m)) + let bR = exprToExpr (info.PApply((fun (x, _, _, _, _) -> x), m)) let v1 = info.PApply((fun (_, x, _, _, _) -> x), m) - let v1T = addVar v1 - let e1T = exprToExpr (info.PApply((fun (_, _, x, _, _) -> x), m)) + let v1R = addVar v1 + let e1R = exprToExpr (info.PApply((fun (_, _, x, _, _) -> x), m)) removeVar v1 let v2 = info.PApply((fun (_, _, _, x, _) -> x), m) - let v2T = addVar v2 - let e2T = exprToExpr (info.PApply((fun (_, _, _, _, x) -> x), m)) + let v2R = addVar v2 + let e2R = exprToExpr (info.PApply((fun (_, _, _, _, x) -> x), m)) removeVar v2 - let ce = mkTryWith g (bT, v1T, e1T, v2T, e2T, m, tyOfExpr g bT, DebugPointAtTry.No, DebugPointAtWith.No) - None, (ce, tyOfExpr g ce) + let exprR = mkTryWith g (bR, v1R, e1R, v2R, e2R, m, tyOfExpr g bR, DebugPointAtTry.No, DebugPointAtWith.No) + None, (exprR, tyOfExpr g exprR) | ProvidedNewObjectExpr (e1, e2) -> None, ctorCallToExpr (exprType.PApply((fun _ -> (e1, e2)), m)) @@ -1955,10 +1956,10 @@ 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 tyT = Import.ImportProvidedType amap m (v.PApply ((fun v -> v.Type), m)) - let vT, vTe = if mut then mkMutableCompGenLocal m nm tyT else mkCompGenLocal m nm tyT - varConv[vRaw] <- (Some vT, vTe) - vT + let tyR = Import.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 and removeVar (v: Tainted) = let vRaw = v.PUntaint (id, m) diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 9d3e6c50153..7c5e9934a77 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -160,7 +160,7 @@ module DispatchSlotChecking = let belongsToReqdTy = match overrideBy.MemberInfo.Value.ImplementedSlotSigs with | [] -> false - | ss :: _ -> isInterfaceTy g ss.ImplementedType && typeEquiv g reqdTy ss.ImplementedType + | ss :: _ -> isInterfaceTy g ss.DeclaringType && typeEquiv g reqdTy ss.DeclaringType if belongsToReqdTy then CanImplementAnyInterfaceSlot else @@ -178,7 +178,7 @@ module DispatchSlotChecking = Override(implKind, overrideBy.MemberApparentEntity, mkSynId overrideBy.Range nm, memberMethodTypars, memberToParentInst, argTys, retTy, isFakeEventProperty, overrideBy.IsCompilerGenerated) /// Get the override information for an object expression method being used to implement dispatch slots - let GetObjectExprOverrideInfo g amap (implty, id: Ident, memberFlags, ty, arityInfo, bindingAttribs, rhsExpr) = + let GetObjectExprOverrideInfo g amap (implTy, id: Ident, memberFlags, ty, arityInfo, bindingAttribs, rhsExpr) = // Dissect the type. The '0' indicates there are no enclosing generic class type parameters relevant here. let tps, _, argInfos, retTy, _ = GetMemberTypeInMemberForm g memberFlags arityInfo 0 ty id.idRange let argTys = argInfos |> List.mapSquared fst @@ -192,13 +192,13 @@ module DispatchSlotChecking = // Check for empty variable list from a () arg let vs = if List.isSingleton vs && argInfos.IsEmpty then [] else vs let implKind = - if isInterfaceTy g implty then + if isInterfaceTy g implTy then CanImplementAnyInterfaceSlot else CanImplementAnyClassHierarchySlot //CanImplementAnySlot <<----- Change to this to enable implicit interface implementation let isFakeEventProperty = CompileAsEvent g bindingAttribs - let overrideByInfo = Override(implKind, tcrefOfAppTy g implty, id, tps, [], argTys, retTy, isFakeEventProperty, false) + let overrideByInfo = Override(implKind, tcrefOfAppTy g implTy, id, tps, [], argTys, retTy, isFakeEventProperty, false) overrideByInfo, (baseValOpt, thisv, vs, bindingAttribs, rhsExpr) | _ -> error(InternalError("Unexpected shape for object expression override", id.idRange)) @@ -749,7 +749,7 @@ module DispatchSlotChecking = let amap = infoReader.amap let tcaug = tycon.TypeContents - let interfaces = tycon.ImmediateInterfacesOfFSharpTycon |> List.map (fun (ity, _compgen, m) -> (ity, m)) + let interfaces = tycon.ImmediateInterfacesOfFSharpTycon |> List.map (fun (intfTy, _compgen, m) -> (intfTy, m)) let overallTy = generalizedTyconRef g (mkLocalTyconRef tycon) @@ -780,9 +780,9 @@ module DispatchSlotChecking = | [] -> // Are we looking at the implementation of the class hierarchy? If so include all the override members not (isInterfaceTy g reqdTy) - | ss -> - ss |> List.forall (fun ss -> - let ty = ss.ImplementedType + | slotSigs -> + slotSigs |> List.forall (fun slotSig -> + let ty = slotSig.DeclaringType if isInterfaceTy g ty then // Is this a method impl listed under the reqdTy? typeEquiv g ty reqdTy diff --git a/src/Compiler/Checking/MethodOverrides.fsi b/src/Compiler/Checking/MethodOverrides.fsi index e6091626469..b93b290f5d3 100644 --- a/src/Compiler/Checking/MethodOverrides.fsi +++ b/src/Compiler/Checking/MethodOverrides.fsi @@ -89,7 +89,7 @@ module DispatchSlotChecking = val GetObjectExprOverrideInfo: g: TcGlobals -> amap: ImportMap -> - implty: TType * + implTy: TType * id: Ident * memberFlags: SynMemberFlags * ty: TType * diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index d04f9d0929d..0f3daba1d0f 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -1420,10 +1420,10 @@ and AddModuleOrNamespaceContentsToNameEnv (g: TcGlobals) amap (ad: AccessorDomai and AddModuleOrNamespaceRefsContentsToNameEnv g amap ad m root nenv modrefs = (modrefs, nenv) ||> List.foldBack (fun modref acc -> AddModuleOrNamespaceRefContentsToNameEnv g amap ad m root acc modref) -and AddTypeContentsToNameEnv g amap ad m nenv (typ: TType) = - assert (isAppTy g typ) - assert not (tcrefOfAppTy g typ).IsModuleOrNamespace - AddStaticContentOfTypeToNameEnv g amap ad m nenv typ +and AddTypeContentsToNameEnv g amap ad m nenv (ty: TType) = + assert (isAppTy g ty) + assert not (tcrefOfAppTy g ty).IsModuleOrNamespace + AddStaticContentOfTypeToNameEnv g amap ad m nenv ty and AddModuleOrNamespaceRefContentsToNameEnv g amap ad m root nenv (modref: EntityRef) = assert modref.IsModuleOrNamespace @@ -2426,8 +2426,8 @@ let TryFindUnionCaseOfType g ty nm = ValueNone /// Try to find a union case of a type, with the given name -let TryFindAnonRecdFieldOfType g typ nm = - match tryDestAnonRecdTy g typ with +let TryFindAnonRecdFieldOfType g ty nm = + match tryDestAnonRecdTy g ty with | ValueSome (anonInfo, tys) -> match anonInfo.SortedIds |> Array.tryFindIndex (fun x -> x.idText = nm) with | Some i -> Some (Item.AnonRecdField(anonInfo, tys, i, anonInfo.SortedIds[i].idRange)) @@ -4113,7 +4113,7 @@ let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMet // e.g. .. for einfo in ncenv.InfoReader.GetEventInfosOfType(Some id, ad, m, ty) do - let einfoTy = PropTypOfEventInfo ncenv.InfoReader m ad einfo + let einfoTy = PropTypeOfEventInfo ncenv.InfoReader m ad einfo yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest einfoTy // nested types @@ -4811,7 +4811,7 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta // e.g. .. for einfo in ncenv.InfoReader.GetEventInfosOfType(Some id, ad, m, ty) do - let tyinfo = PropTypOfEventInfo ncenv.InfoReader m ad einfo + let tyinfo = PropTypeOfEventInfo ncenv.InfoReader m ad einfo yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item tyinfo // nested types! diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 6d8b38c7956..a07f000c7a7 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -497,7 +497,7 @@ module PrintTypes = | _ -> itemL /// Layout a reference to a type - let layoutTyconRef denv tycon = layoutTyconRefImpl false denv tycon + let layoutTyconRef denv tcref = layoutTyconRefImpl false denv tcref /// Layout the flags of a member let layoutMemberFlags (memFlags: SynMemberFlags) = @@ -546,8 +546,8 @@ module PrintTypes = | TypeDefOfExpr denv.g ty -> LeftL.keywordTypedefof ^^ wordL (tagPunctuation "<") ^^ layoutType denv ty ^^ rightL (tagPunctuation ">") - | Expr.Op (TOp.Coerce, [tgTy;_], [arg2], _) -> - leftL (tagPunctuation "(") ^^ layoutAttribArg denv arg2 ^^ wordL (tagPunctuation ":>") ^^ layoutType denv tgTy ^^ rightL (tagPunctuation ")") + | Expr.Op (TOp.Coerce, [tgtTy;_], [arg2], _) -> + leftL (tagPunctuation "(") ^^ layoutAttribArg denv arg2 ^^ wordL (tagPunctuation ":>") ^^ layoutType denv tgtTy ^^ rightL (tagPunctuation ")") | AttribBitwiseOrExpr denv.g (arg1, arg2) -> layoutAttribArg denv arg1 ^^ wordL (tagPunctuation "|||") ^^ layoutAttribArg denv arg2 @@ -726,8 +726,8 @@ module PrintTypes = and layoutConstraintWithInfo denv env (tp, tpc) = let longConstraintPrefix l = (layoutTyparRefWithInfo denv env tp |> addColonL) ^^ l match tpc with - | TyparConstraint.CoercesTo(tpct, _) -> - [layoutTyparRefWithInfo denv env tp ^^ wordL (tagOperator ":>") --- layoutTypeWithInfo denv env tpct] + | TyparConstraint.CoercesTo(tgtTy, _) -> + [layoutTyparRefWithInfo denv env tp ^^ wordL (tagOperator ":>") --- layoutTypeWithInfo denv env tgtTy] | TyparConstraint.MayResolveMember(traitInfo, _) -> [layoutTraitWithInfo denv env traitInfo] @@ -815,8 +815,8 @@ module PrintTypes = /// Layout a unit of measure expression and layoutMeasure denv unt = - let sortVars vs = vs |> List.sortBy (fun (v: Typar, _) -> v.DisplayName) - let sortCons cs = cs |> List.sortBy (fun (c: TyconRef, _) -> c.DisplayName) + let sortVars vs = vs |> List.sortBy (fun (tp: Typar, _) -> tp.DisplayName) + let sortCons cs = cs |> List.sortBy (fun (tcref: TyconRef, _) -> tcref.DisplayName) let negvs, posvs = ListMeasureVarOccsWithNonZeroExponents unt |> sortVars |> List.partition (fun (_, e) -> SignRational e < 0) let negcs, poscs = ListMeasureConOccsWithNonZeroExponents denv.g false unt |> sortCons |> List.partition (fun (_, e) -> SignRational e < 0) let unparL uv = layoutTyparRef denv uv @@ -832,14 +832,14 @@ module PrintTypes = | _ -> prefix ^^ sepL (tagPunctuation "/") ^^ (if List.length negvs + List.length negcs > 1 then sepL (tagPunctuation "(") ^^ postfix ^^ sepL (tagPunctuation ")") else postfix) /// Layout type arguments, either NAME or (ty, ..., ty) NAME *) - and layoutTypeAppWithInfoAndPrec denv env tcL prec prefix args = + and layoutTypeAppWithInfoAndPrec denv env tcL prec prefix argTys = if prefix then - match args with + match argTys with | [] -> tcL - | [arg] -> tcL ^^ sepL (tagPunctuation "<") ^^ (layoutTypeWithInfoAndPrec denv env 4 arg) ^^ rightL (tagPunctuation">") - | args -> bracketIfL (prec <= 1) (tcL ^^ angleL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args)) + | [argTy] -> tcL ^^ sepL (tagPunctuation "<") ^^ (layoutTypeWithInfoAndPrec denv env 4 argTy) ^^ rightL (tagPunctuation">") + | _ -> bracketIfL (prec <= 1) (tcL ^^ angleL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) argTys)) else - match args with + match argTys with | [] -> tcL | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) @@ -1050,8 +1050,8 @@ module PrintTypes = prettyTyparInst, niceMethodTypars, layout - let prettyLayoutOfMemberType denv v typarInst argInfos retTy = - match PartitionValRefTypars denv.g v with + let prettyLayoutOfMemberType denv vref typarInst argInfos retTy = + match PartitionValRefTypars denv.g vref with | Some(_, _, memberMethodTypars, memberToParentInst, _) -> prettyLayoutOfMemberSigCore denv memberToParentInst (typarInst, memberMethodTypars, argInfos, retTy) | None -> @@ -1123,14 +1123,14 @@ module PrintTypes = let ty, _cxs = PrettyTypes.PrettifyType denv.g ty layoutTypeWithInfoAndPrec denv SimplifyTypes.typeSimplificationInfo0 5 ty - let layoutOfValReturnType denv (v: ValRef) = - match v.ValReprInfo with + let layoutOfValReturnType denv (vref: ValRef) = + match vref.ValReprInfo with | None -> - let tau = v.TauType + let tau = vref.TauType let _argTysl, retTy = stripFunTy denv.g tau layoutReturnType denv SimplifyTypes.typeSimplificationInfo0 retTy | Some (ValReprInfo(_typars, argInfos, _retInfo)) -> - let tau = v.TauType + let tau = vref.TauType let _c, retTy = GetTopTauTypeInFSharpForm denv.g argInfos tau Range.range0 layoutReturnType denv SimplifyTypes.typeSimplificationInfo0 retTy @@ -1147,22 +1147,22 @@ module PrintTastMemberOrVals = else nameL - let layoutMemberName (denv: DisplayEnv) (v: ValRef) niceMethodTypars tagFunction name = - let nameL = ConvertValNameToDisplayLayout v.IsBaseVal (tagFunction >> mkNav v.DefinitionRange >> wordL) name + let layoutMemberName (denv: DisplayEnv) (vref: ValRef) niceMethodTypars tagFunction name = + let nameL = ConvertValNameToDisplayLayout vref.IsBaseVal (tagFunction >> mkNav vref.DefinitionRange >> wordL) name let nameL = if denv.showMemberContainers then - layoutTyconRef denv v.MemberApparentEntity ^^ SepL.dot ^^ nameL + layoutTyconRef denv vref.MemberApparentEntity ^^ SepL.dot ^^ nameL else nameL let nameL = if denv.showTyparBinding then layoutTyparDecls denv nameL true niceMethodTypars else nameL - let nameL = layoutAccessibility denv v.Accessibility nameL + let nameL = layoutAccessibility denv vref.Accessibility nameL nameL let prettyLayoutOfMemberShortOption denv typarInst (v: Val) short = - let v = mkLocalValRef v - let membInfo = Option.get v.MemberInfo + let vref = mkLocalValRef v + let membInfo = Option.get vref.MemberInfo let stat = layoutMemberFlags membInfo.MemberFlags - let _tps, argInfos, retTy, _ = GetTypeOfMemberInFSharpForm denv.g v + let _tps, argInfos, retTy, _ = GetTypeOfMemberInFSharpForm denv.g vref if short then for argInfo in argInfos do @@ -1173,22 +1173,22 @@ module PrintTastMemberOrVals = let prettyTyparInst, memberL = match membInfo.MemberFlags.MemberKind with | SynMemberKind.Member -> - let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then tauL else - let nameL = layoutMemberName denv v niceMethodTypars tagMember v.DisplayNameCoreMangled - let nameL = if short then nameL else mkInlineL denv v.Deref nameL + let nameL = layoutMemberName denv vref niceMethodTypars tagMember vref.DisplayNameCoreMangled + let nameL = if short then nameL else mkInlineL denv vref.Deref nameL stat --- ((nameL |> addColonL) ^^ tauL) prettyTyparInst, resL | SynMemberKind.ClassConstructor | SynMemberKind.Constructor -> - let prettyTyparInst, _, tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, _, tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then tauL else - let newL = layoutAccessibility denv v.Accessibility WordL.keywordNew + let newL = layoutAccessibility denv vref.Accessibility WordL.keywordNew stat ++ (newL |> addColonL) ^^ tauL prettyTyparInst, resL @@ -1198,8 +1198,8 @@ module PrintTastMemberOrVals = | SynMemberKind.PropertyGet -> if isNil argInfos then // use error recovery because intellisense on an incomplete file will show this - errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), v.Id.idRange)) - let nameL = layoutMemberName denv v [] tagProperty v.DisplayNameCoreMangled + errorR(Error(FSComp.SR.tastInvalidFormForPropertyGetter(), vref.Id.idRange)) + let nameL = layoutMemberName denv vref [] tagProperty vref.DisplayNameCoreMangled let resL = if short then nameL --- (WordL.keywordWith ^^ WordL.keywordGet) else stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordGet) @@ -1209,31 +1209,31 @@ module PrintTastMemberOrVals = match argInfos with | [[(ty, _)]] when isUnitTy denv.g ty -> [] | _ -> argInfos - let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv v typarInst argInfos retTy + let prettyTyparInst, niceMethodTypars,tauL = prettyLayoutOfMemberType denv vref typarInst argInfos retTy let resL = if short then if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ WordL.keywordGet) else - let nameL = layoutMemberName denv v niceMethodTypars tagProperty v.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars tagProperty vref.DisplayNameCoreMangled stat --- ((nameL |> addColonL) ^^ (if isNil argInfos then tauL else tauL --- (WordL.keywordWith ^^ WordL.keywordGet))) prettyTyparInst, resL | SynMemberKind.PropertySet -> if argInfos.Length <> 1 || isNil argInfos.Head then // use error recovery because intellisense on an incomplete file will show this - errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), v.Id.idRange)) - let nameL = layoutMemberName denv v [] tagProperty v.DisplayNameCoreMangled + errorR(Error(FSComp.SR.tastInvalidFormForPropertySetter(), vref.Id.idRange)) + let nameL = layoutMemberName denv vref [] tagProperty vref.DisplayNameCoreMangled let resL = stat --- nameL --- (WordL.keywordWith ^^ WordL.keywordSet) emptyTyparInst, resL else let argInfos, valueInfo = List.frontAndBack argInfos.Head - let prettyTyparInst, niceMethodTypars, tauL = prettyLayoutOfMemberType denv v typarInst (if isNil argInfos then [] else [argInfos]) (fst valueInfo) + let prettyTyparInst, niceMethodTypars, tauL = prettyLayoutOfMemberType denv vref typarInst (if isNil argInfos then [] else [argInfos]) (fst valueInfo) let resL = if short then (tauL --- (WordL.keywordWith ^^ WordL.keywordSet)) else - let nameL = layoutMemberName denv v niceMethodTypars tagProperty v.DisplayNameCoreMangled + let nameL = layoutMemberName denv vref niceMethodTypars tagProperty vref.DisplayNameCoreMangled stat --- ((nameL |> addColonL) ^^ (tauL --- (WordL.keywordWith ^^ WordL.keywordSet))) prettyTyparInst, resL @@ -1730,23 +1730,23 @@ module TastDefinitionPrinting = typewordL ^^ tpsL - let sortKey (v: MethInfo) = - (not v.IsConstructor, - not v.IsInstance, // instance first - v.DisplayNameCore, // sort by name - List.sum v.NumArgs, // sort by #curried - v.NumArgs.Length) // sort by arity + let sortKey (minfo: MethInfo) = + (not minfo.IsConstructor, + not minfo.IsInstance, // instance first + minfo.DisplayNameCore, // sort by name + List.sum minfo.NumArgs, // sort by #curried + minfo.NumArgs.Length) // sort by arity - let shouldShow (valRef: ValRef option) = - match valRef with + let shouldShow (vrefOpt: ValRef option) = + match vrefOpt with | None -> true - | Some(vr) -> - (denv.showObsoleteMembers || not (CheckFSharpAttributesForObsolete denv.g vr.Attribs)) && - (denv.showHiddenMembers || not (CheckFSharpAttributesForHidden denv.g vr.Attribs)) + | Some vref -> + (denv.showObsoleteMembers || not (CheckFSharpAttributesForObsolete denv.g vref.Attribs)) && + (denv.showHiddenMembers || not (CheckFSharpAttributesForHidden denv.g vref.Attribs)) let ctors = GetIntrinsicConstructorInfosOfType infoReader m ty - |> List.filter (fun v -> IsMethInfoAccessible amap m ad v && not v.IsClassConstructor && shouldShow v.ArbitraryValRef) + |> List.filter (fun minfo -> IsMethInfoAccessible amap m ad minfo && not minfo.IsClassConstructor && shouldShow minfo.ArbitraryValRef) let iimpls = if suppressInheritanceAndInterfacesForTyInSimplifiedDisplays g amap m ty then @@ -1760,15 +1760,15 @@ module TastDefinitionPrinting = let iimplsLs = iimpls - |> List.map (fun ity -> wordL (tagKeyword (if isInterfaceTy g ty then "inherit" else "interface")) -* layoutType denv ity) + |> List.map (fun intfTy -> wordL (tagKeyword (if isInterfaceTy g ty then "inherit" else "interface")) -* layoutType denv intfTy) let props = GetImmediateIntrinsicPropInfosOfType (None, ad) g amap m ty - |> List.filter (fun v -> shouldShow v.ArbitraryValRef) + |> List.filter (fun pinfo -> shouldShow pinfo.ArbitraryValRef) let events = infoReader.GetEventInfosOfType(None, ad, m, ty) - |> List.filter (fun v -> shouldShow v.ArbitraryValRef && typeEquiv g ty v.ApparentEnclosingType) + |> List.filter (fun einfo -> shouldShow einfo.ArbitraryValRef && typeEquiv g ty einfo.ApparentEnclosingType) let impliedNames = try @@ -1883,8 +1883,8 @@ module TastDefinitionPrinting = let inherits = [ if not (suppressInheritanceAndInterfacesForTyInSimplifiedDisplays g amap m ty) then match GetSuperTypeOfType g amap m ty with - | Some super when not (isObjTy g super) && not (isValueTypeTy g super) -> - super + | Some superTy when not (isObjTy g superTy) && not (isValueTypeTy g superTy) -> + superTy | _ -> () ] @@ -2052,8 +2052,8 @@ module TastDefinitionPrinting = |> addLhs | TNoRepr when tycon.TypeAbbrev.IsSome -> - let abbreviatedType = tycon.TypeAbbrev.Value - (lhsL ^^ WordL.equals) -* (layoutType { denv with shortTypeNames = false } abbreviatedType) + let abbreviatedTy = tycon.TypeAbbrev.Value + (lhsL ^^ WordL.equals) -* (layoutType { denv with shortTypeNames = false } abbreviatedTy) | _ when isNil allDecls -> lhsL @@ -2386,8 +2386,8 @@ module PrintData = else layoutConst denv.g ty c - | Expr.Val (v, _, _) -> - wordL (tagLocal v.DisplayName) + | Expr.Val (vref, _, _) -> + wordL (tagLocal vref.DisplayName) | Expr.Link rX -> dataExprWrapL denv isAtomic rX.Value @@ -2435,21 +2435,28 @@ let outputValOrMember denv infoReader os x = x |> PrintTastMemberOrVals.prettyLa let stringValOrMember denv infoReader x = x |> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader |> showL /// Print members with a qualification showing the type they are contained in -let layoutQualifiedValOrMember denv infoReader typarInst v = PrintTastMemberOrVals.prettyLayoutOfValOrMember { denv with showMemberContainers=true; } infoReader typarInst v +let layoutQualifiedValOrMember denv infoReader typarInst vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMember { denv with showMemberContainers=true; } infoReader typarInst vref -let outputQualifiedValOrMember denv infoReader os v = outputValOrMember { denv with showMemberContainers=true; } infoReader os v +let outputQualifiedValOrMember denv infoReader os vref = + outputValOrMember { denv with showMemberContainers=true; } infoReader os vref -let outputQualifiedValSpec denv infoReader os v = outputQualifiedValOrMember denv infoReader os v +let outputQualifiedValSpec denv infoReader os vref = + outputQualifiedValOrMember denv infoReader os vref -let stringOfQualifiedValOrMember denv infoReader v = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst { denv with showMemberContainers=true; } infoReader v |> showL +let stringOfQualifiedValOrMember denv infoReader vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst { denv with showMemberContainers=true; } infoReader vref |> showL /// Convert a MethInfo to a string -let formatMethInfoToBufferFreeStyle infoReader m denv buf d = InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf d +let formatMethInfoToBufferFreeStyle infoReader m denv buf d = + InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf d -let prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo = InfoMemberPrinting.prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo +let prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo = + InfoMemberPrinting.prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo /// Convert a PropInfo to a string -let prettyLayoutOfPropInfoFreeStyle g amap m denv d = InfoMemberPrinting.prettyLayoutOfPropInfoFreeStyle g amap m denv d +let prettyLayoutOfPropInfoFreeStyle g amap m denv d = + InfoMemberPrinting.prettyLayoutOfPropInfoFreeStyle g amap m denv d /// Convert a MethInfo to a string let stringOfMethInfo infoReader m denv minfo = @@ -2509,13 +2516,15 @@ let stringOfILAttrib denv x = x |> PrintTypes.layoutILAttrib denv |> squareAngle let layoutImpliedSignatureOfModuleOrNamespace showHeader denv infoReader ad m contents = InferredSigPrinting.layoutImpliedSignatureOfModuleOrNamespace showHeader denv infoReader ad m contents -let prettyLayoutOfValOrMember denv infoReader typarInst v = PrintTastMemberOrVals.prettyLayoutOfValOrMember denv infoReader typarInst v +let prettyLayoutOfValOrMember denv infoReader typarInst vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMember denv infoReader typarInst vref -let prettyLayoutOfValOrMemberNoInst denv infoReader v = PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader v +let prettyLayoutOfValOrMemberNoInst denv infoReader vref = + PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv infoReader vref let prettyLayoutOfMemberNoInstShort denv v = PrintTastMemberOrVals.prettyLayoutOfMemberNoInstShort denv v -let layoutOfValReturnType denv v = v |> PrintTypes.layoutOfValReturnType denv +let layoutOfValReturnType denv vref = vref |> PrintTypes.layoutOfValReturnType denv let prettyLayoutOfInstAndSig denv x = PrintTypes.prettyLayoutOfInstAndSig denv x @@ -2523,14 +2532,14 @@ let prettyLayoutOfInstAndSig denv x = PrintTypes.prettyLayoutOfInstAndSig denv x /// /// If the output text is different without showing constraints and/or imperative type variable /// annotations and/or fully qualifying paths then don't show them! -let minimalStringsOfTwoTypes denv t1 t2= - let (t1, t2), tpcs = PrettyTypes.PrettifyTypePair denv.g (t1, t2) +let minimalStringsOfTwoTypes denv ty1 ty2 = + let (ty1, ty2), tpcs = PrettyTypes.PrettifyTypePair denv.g (ty1, ty2) // try denv + no type annotations let attempt1 = let denv = { denv with showInferenceTyparAnnotations=false; showStaticallyResolvedTyparAnnotations=false } - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, "") else None match attempt1 with @@ -2540,8 +2549,8 @@ let minimalStringsOfTwoTypes denv t1 t2= // try denv + no type annotations + show full paths let attempt2 = let denv = { denv with showInferenceTyparAnnotations=false; showStaticallyResolvedTyparAnnotations=false }.SetOpenPaths [] - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, "") else None match attempt2 with @@ -2549,8 +2558,8 @@ let minimalStringsOfTwoTypes denv t1 t2= | None -> let attempt3 = - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, stringOfTyparConstraints denv tpcs) else None match attempt3 with @@ -2561,8 +2570,8 @@ let minimalStringsOfTwoTypes denv t1 t2= // try denv + show full paths + static parameters let denv = denv.SetOpenPaths [] let denv = { denv with includeStaticParametersInTypeNames=true } - let min1 = stringOfTy denv t1 - let min2 = stringOfTy denv t2 + let min1 = stringOfTy denv ty1 + let min2 = stringOfTy denv ty2 if min1 <> min2 then Some (min1, min2, stringOfTyparConstraints denv tpcs) else None match attempt4 with @@ -2576,19 +2585,19 @@ let minimalStringsOfTwoTypes denv t1 t2= let assemblyName = PrintTypes.layoutAssemblyName denv t |> function | null | "" -> "" | name -> sprintf " (%s)" name sprintf "%s%s" (stringOfTy denv t) assemblyName - (makeName t1, makeName t2, stringOfTyparConstraints denv tpcs) + (makeName ty1, makeName ty2, stringOfTyparConstraints denv tpcs) // Note: Always show imperative annotations when comparing value signatures -let minimalStringsOfTwoValues denv infoReader v1 v2= +let minimalStringsOfTwoValues denv infoReader vref1 vref2 = let denvMin = { denv with showInferenceTyparAnnotations=true; showStaticallyResolvedTyparAnnotations=false } - let min1 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf v1) - let min2 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf v2) + let min1 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf vref1) + let min2 = buildString (fun buf -> outputQualifiedValOrMember denvMin infoReader buf vref2) if min1 <> min2 then (min1, min2) else let denvMax = { denv with showInferenceTyparAnnotations=true; showStaticallyResolvedTyparAnnotations=true } - let max1 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf v1) - let max2 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf v2) + let max1 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf vref1) + let max2 = buildString (fun buf -> outputQualifiedValOrMember denvMax infoReader buf vref2) max1, max2 let minimalStringOfType denv ty = diff --git a/src/Compiler/Checking/NicePrint.fsi b/src/Compiler/Checking/NicePrint.fsi index c9df76a87a7..523202af9b9 100644 --- a/src/Compiler/Checking/NicePrint.fsi +++ b/src/Compiler/Checking/NicePrint.fsi @@ -54,14 +54,14 @@ val layoutQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInstantiation -> - v: ValRef -> + vref: ValRef -> TyparInstantiation * Layout -val outputQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit +val outputQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> vref: ValRef -> unit -val outputQualifiedValSpec: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit +val outputQualifiedValSpec: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> vref: ValRef -> unit -val stringOfQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> string +val stringOfQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> vref: ValRef -> string val formatMethInfoToBufferFreeStyle: infoReader: InfoReader -> m: range -> denv: DisplayEnv -> buf: StringBuilder -> d: MethInfo -> unit @@ -139,22 +139,23 @@ val prettyLayoutOfValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInstantiation -> - v: ValRef -> + vref: ValRef -> TyparInstantiation * Layout -val prettyLayoutOfValOrMemberNoInst: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> Layout +val prettyLayoutOfValOrMemberNoInst: denv: DisplayEnv -> infoReader: InfoReader -> vref: ValRef -> Layout val prettyLayoutOfMemberNoInstShort: denv: DisplayEnv -> v: Val -> Layout -val layoutOfValReturnType: denv: DisplayEnv -> v: ValRef -> Layout +val layoutOfValReturnType: denv: DisplayEnv -> vref: ValRef -> Layout val prettyLayoutOfInstAndSig: denv: DisplayEnv -> TyparInstantiation * TTypes * TType -> TyparInstantiation * (TTypes * TType) * (Layout list * Layout) * Layout -val minimalStringsOfTwoTypes: denv: DisplayEnv -> t1: TType -> t2: TType -> string * string * string +val minimalStringsOfTwoTypes: denv: DisplayEnv -> ty1: TType -> ty2: TType -> string * string * string -val minimalStringsOfTwoValues: denv: DisplayEnv -> infoReader: InfoReader -> v1: ValRef -> v2: ValRef -> string * string +val minimalStringsOfTwoValues: + denv: DisplayEnv -> infoReader: InfoReader -> vref1: ValRef -> vref2: ValRef -> string * string val minimalStringOfType: denv: DisplayEnv -> ty: TType -> string diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index c38f65e307e..ec5c5488f81 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -312,8 +312,8 @@ let RefuteDiscrimSet g m path discrims = raise CannotRefute go path tm -let rec CombineRefutations g r1 r2 = - match r1, r2 with +let rec CombineRefutations g refutation1 refutation2 = + match refutation1, refutation2 with | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = "_" -> other | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = notNullText -> other | Expr.Val (vref, _, _), other | other, Expr.Val (vref, _, _) when vref.LogicalName = otherSubtypeText -> other @@ -326,9 +326,9 @@ let rec CombineRefutations g r1 r2 = Expr.Op (op1, tinst1, List.map2 (CombineRefutations g) flds1 flds2, m1) (* Choose the greater of the two ucrefs based on name ordering *) elif ucref1.CaseName < ucref2.CaseName then - r2 + refutation2 else - r1 + refutation1 | Expr.Op (op1, tinst1, flds1, m1), Expr.Op (_, _, flds2, _) -> Expr.Op (op1, tinst1, List.map2 (CombineRefutations g) flds1 flds2, m1) @@ -352,7 +352,7 @@ let rec CombineRefutations g r1 r2 = Expr.Const (c12, m1, ty1) - | _ -> r1 + | _ -> refutation1 let ShowCounterExample g denv m refuted = try @@ -592,8 +592,8 @@ let getDiscrimOfPattern (g: TcGlobals) tpinst t = match t with | TPat_null _m -> Some(DecisionTreeTest.IsNull) - | TPat_isinst (srcty, tgty, _, _m) -> - Some(DecisionTreeTest.IsInst (instType tpinst srcty, instType tpinst tgty)) + | TPat_isinst (srcTy, tgtTy, _, _m) -> + Some(DecisionTreeTest.IsInst (instType tpinst srcTy, instType tpinst tgtTy)) | TPat_exnconstr(tcref, _, _m) -> Some(DecisionTreeTest.IsInst (g.exn_ty, mkAppTy tcref [])) | TPat_const (c, _m) -> @@ -624,7 +624,7 @@ let discrimsEq (g: TcGlobals) d1 d2 = | DecisionTreeTest.ArrayLength (n1, _), DecisionTreeTest.ArrayLength(n2, _) -> (n1=n2) | DecisionTreeTest.Const c1, DecisionTreeTest.Const c2 -> (c1=c2) | DecisionTreeTest.IsNull, DecisionTreeTest.IsNull -> true - | DecisionTreeTest.IsInst (srcty1, tgty1), DecisionTreeTest.IsInst (srcty2, tgty2) -> typeEquiv g srcty1 srcty2 && typeEquiv g tgty1 tgty2 + | DecisionTreeTest.IsInst (srcTy1, tgtTy1), DecisionTreeTest.IsInst (srcTy2, tgtTy2) -> typeEquiv g srcTy1 srcTy2 && typeEquiv g tgtTy1 tgtTy2 | DecisionTreeTest.ActivePatternCase (_, _, _, vrefOpt1, n1, _), DecisionTreeTest.ActivePatternCase (_, _, _, vrefOpt2, n2, _) -> match vrefOpt1, vrefOpt2 with | Some (vref1, tinst1), Some (vref2, tinst2) -> valRefEq g vref1 vref2 && n1 = n2 && not (doesActivePatternHaveFreeTypars g vref1) && List.lengthsEqAndForall2 (typeEquiv g) tinst1 tinst2 @@ -1213,15 +1213,15 @@ let CompilePatternBasic // This is really an optimization that could be done more effectively in opt.fs // if we flowed a bit of information through - | [EdgeDiscrim(_i', DecisionTreeTest.IsInst (_srcty, tgty), m)] + | [EdgeDiscrim(_i', DecisionTreeTest.IsInst (_srcTy, tgtTy), m)] // check we can use a simple 'isinst' instruction - when isRefTy g tgty && canUseTypeTestFast g tgty && isNil origInputValTypars -> + when isRefTy g tgtTy && canUseTypeTestFast g tgtTy && isNil origInputValTypars -> - let v, vExpr = mkCompGenLocal m "typeTestResult" tgty + let v, vExpr = mkCompGenLocal m "typeTestResult" tgtTy if origInputVal.IsMemberOrModuleBinding then AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData let argExpr = GetSubExprOfInput subexpr - let appExpr = mkIsInst tgty argExpr mMatch + let appExpr = mkIsInst tgtTy argExpr mMatch Some vExpr, Some(mkInvisibleBind v appExpr) // Any match on a struct union must take the address of its input. diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 1459fc99984..d8bca9c223c 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -416,8 +416,8 @@ and CheckTypeConstraintDeep cenv f g env x = | TyparConstraint.MayResolveMember(traitInfo, _) -> CheckTraitInfoDeep cenv f g env traitInfo | TyparConstraint.DefaultsTo(_, ty, _) -> CheckTypeDeep cenv f g env true ty | TyparConstraint.SimpleChoice(tys, _) -> CheckTypesDeep cenv f g env tys - | TyparConstraint.IsEnum(uty, _) -> CheckTypeDeep cenv f g env true uty - | TyparConstraint.IsDelegate(aty, bty, _) -> CheckTypeDeep cenv f g env true aty; CheckTypeDeep cenv f g env true bty + | TyparConstraint.IsEnum(underlyingTy, _) -> CheckTypeDeep cenv f g env true underlyingTy + | TyparConstraint.IsDelegate(argTys, retTy, _) -> CheckTypeDeep cenv f g env true argTys; CheckTypeDeep cenv f g env true retTy | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -717,39 +717,42 @@ type TTypeEquality = | FeasiblyEqual | NotEqual -let compareTypesWithRegardToTypeVariablesAndMeasures g amap m typ1 typ2 = +let compareTypesWithRegardToTypeVariablesAndMeasures g amap m ty1 ty2 = - if (typeEquiv g typ1 typ2) then + if (typeEquiv g ty1 ty2) then ExactlyEqual else - if (typeEquiv g typ1 typ2 || TypesFeasiblyEquivStripMeasures g amap m typ1 typ2) then + if (typeEquiv g ty1 ty2 || TypesFeasiblyEquivStripMeasures g amap m ty1 ty2) then FeasiblyEqual else NotEqual -let CheckMultipleInterfaceInstantiations cenv (typ:TType) (interfaces:TType list) isObjectExpression m = - let keyf ty = assert isAppTy cenv.g ty; (tcrefOfAppTy cenv.g ty).Stamp - let groups = interfaces |> List.groupBy keyf +let keyTyByStamp g ty = + assert isAppTy g ty + (tcrefOfAppTy g ty).Stamp + +let CheckMultipleInterfaceInstantiations cenv (ty:TType) (interfaces:TType list) isObjectExpression m = + let groups = interfaces |> List.groupBy (keyTyByStamp cenv.g) let errors = seq { for _, items in groups do for i1 in 0 .. items.Length - 1 do for i2 in i1 + 1 .. items.Length - 1 do - let typ1 = items[i1] - let typ2 = items[i2] - let tcRef1 = tcrefOfAppTy cenv.g typ1 - match compareTypesWithRegardToTypeVariablesAndMeasures cenv.g cenv.amap m typ1 typ2 with + let ty1 = items[i1] + let ty2 = items[i2] + let tcRef1 = tcrefOfAppTy cenv.g ty1 + match compareTypesWithRegardToTypeVariablesAndMeasures cenv.g cenv.amap m ty1 ty2 with | ExactlyEqual -> () | FeasiblyEqual -> match tryLanguageFeatureErrorOption cenv.g.langVersion LanguageFeature.InterfacesWithMultipleGenericInstantiation m with | None -> () | Some exn -> exn - let typ1Str = NicePrint.minimalStringOfType cenv.denv typ1 - let typ2Str = NicePrint.minimalStringOfType cenv.denv typ2 + let typ1Str = NicePrint.minimalStringOfType cenv.denv ty1 + let typ2Str = NicePrint.minimalStringOfType cenv.denv ty2 if isObjectExpression then Error(FSComp.SR.typrelInterfaceWithConcreteAndVariableObjectExpression(tcRef1.DisplayNameWithStaticParametersAndUnderscoreTypars, typ1Str, typ2Str),m) else - let typStr = NicePrint.minimalStringOfType cenv.denv typ + let typStr = NicePrint.minimalStringOfType cenv.denv ty Error(FSComp.SR.typrelInterfaceWithConcreteAndVariable(typStr, tcRef1.DisplayNameWithStaticParametersAndUnderscoreTypars, typ1Str, typ2Str),m) | NotEqual -> @@ -1575,8 +1578,8 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) NoLimit - | TOp.Coerce, [tgty;srcty], [x] -> - if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then + | TOp.Coerce, [tgtTy;srcTy], [x] -> + if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy then CheckExpr cenv env x ctxt else CheckTypeInstNoByrefs cenv env m tyargs @@ -2279,8 +2282,8 @@ let CheckEntityDefn cenv env (tycon: Entity) = let allVirtualMethsInParent = match GetSuperTypeOfType g cenv.amap m ty with - | Some super -> - GetIntrinsicMethInfosOfType cenv.infoReader None AccessibleFromSomewhere AllowMultiIntfInstantiations.Yes IgnoreOverrides m super + | Some superTy -> + GetIntrinsicMethInfosOfType cenv.infoReader None AccessibleFromSomewhere AllowMultiIntfInstantiations.Yes IgnoreOverrides m superTy |> List.filter (fun minfo -> minfo.IsVirtual) | None -> [] diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index 044ff283f0b..089de7b4a7f 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -172,7 +172,7 @@ let (|ModuleValueOrMemberUse|_|) g expr = match stripExpr expr with | Expr.App (InnerExprPat(Expr.Val (vref, vFlags, _) as f), fty, tyargs, actualArgs, _m) when vref.IsMemberOrModuleBinding -> Some(vref, vFlags, f, fty, tyargs, actualArgs @ args) - | Expr.App (f, _fty, [], actualArgs, _) -> + | Expr.App (f, _fTy, [], actualArgs, _) -> loop f (actualArgs @ args) | Expr.Val (vref, vFlags, _m) as f when (match vref.DeclaringEntity with ParentNone -> false | _ -> true) -> let fty = tyOfExpr g f @@ -292,8 +292,8 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // Recognize applications of module functions. match expr with // Detect expression tree exprSplices - | Expr.App (InnerExprPat(Expr.Val (vf, _, _)), _, _, x0 :: rest, m) - when isSplice g vf -> + | Expr.App (InnerExprPat(Expr.Val (vref, _, _)), _, _, x0 :: rest, m) + when isSplice g vref -> let idx = cenv.exprSplices.Count let ty = tyOfExpr g expr @@ -305,7 +305,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let hole = QP.mkHole(ConvType cenv env m ty, idx) (hole, rest) ||> List.fold (fun fR arg -> QP.mkApp (fR, ConvExpr cenv env arg)) - | ModuleValueOrMemberUse g (vref, vFlags, _f, _fty, tyargs, curriedArgs) + | ModuleValueOrMemberUse g (vref, vFlags, _f, _fTy, tyargs, curriedArgs) when not (isSplice g vref) -> let m = expr.Range @@ -419,16 +419,16 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. List.fold (fun fR arg -> QP.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) -> - let rfty = applyForallTy g fty tyargs - ConvExpr cenv env (primMkApp (primMkApp (f, fty) tyargs [] m, rfty) [] args m) + | Expr.App (f, fTy, (_ :: _ as tyargs), (_ :: _ as args), m) -> + let reducedTy = applyForallTy g fTy tyargs + ConvExpr cenv env (primMkApp (primMkApp (f, fTy) tyargs [] m, reducedTy) [] args m) // Uses of possibly-polymorphic values - | Expr.App (InnerExprPat(Expr.Val (vref, _vFlags, m)), _fty, tyargs, [], _) -> + | Expr.App (InnerExprPat(Expr.Val (vref, _vFlags, m)), _fTy, tyargs, [], _) -> ConvValRef true cenv env m vref tyargs // Simple applications - | Expr.App (f, _fty, tyargs, args, m) -> + | 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 @@ -828,12 +828,12 @@ and ConvLValueExprCore cenv env expr = | TOp.UnionCaseFieldGetAddr (ucref, n, _), [e], _ -> ConvUnionFieldGet cenv env m ucref n tyargs e | TOp.ILAsm ([ I_ldflda(fspec) ], _), _, _ -> ConvLdfld cenv env m fspec tyargs args | TOp.ILAsm ([ I_ldsflda(fspec) ], _), _, _ -> ConvLdfld cenv env m fspec tyargs args - | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemty] -> + | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemTy] -> match shape.Rank, idxs with - | 1, [idx1] -> ConvExpr cenv env (mkCallArrayGet cenv.g m elemty arr idx1) - | 2, [idx1; idx2] -> ConvExpr cenv env (mkCallArray2DGet cenv.g m elemty arr idx1 idx2) - | 3, [idx1; idx2; idx3] -> ConvExpr cenv env (mkCallArray3DGet cenv.g m elemty arr idx1 idx2 idx3) - | 4, [idx1; idx2; idx3; idx4] -> ConvExpr cenv env (mkCallArray4DGet cenv.g m elemty arr idx1 idx2 idx3 idx4) + | 1, [idx1] -> ConvExpr cenv env (mkCallArrayGet cenv.g m elemTy arr idx1) + | 2, [idx1; idx2] -> ConvExpr cenv env (mkCallArray2DGet cenv.g m elemTy arr idx1 idx2) + | 3, [idx1; idx2; idx3] -> ConvExpr cenv env (mkCallArray3DGet cenv.g m elemTy arr idx1 idx2 idx3) + | 4, [idx1; idx2; idx3; idx4] -> ConvExpr cenv env (mkCallArray4DGet cenv.g m elemTy arr idx1 idx2 idx3 idx4) | _ -> ConvExpr cenv env expr | _ -> ConvExpr cenv env expr | _ -> ConvExpr cenv env expr @@ -937,15 +937,15 @@ and private ConvValRefCore holeOk cenv env m (vref: ValRef) tyargs = elif v.IsCtorThisVal && cenv.isReflectedDefinition = IsReflectedDefinition.Yes then QP.mkThisVar(ConvType cenv env m v.Type) else - let vty = v.Type + let vTy = v.Type match v.DeclaringEntity with | ParentNone -> // References to local values are embedded by value if not holeOk then wfail(Error(FSComp.SR.crefNoSetOfHole(), m)) let idx = cenv.exprSplices.Count - let liftExpr = mkCallLiftValueWithName cenv.g m vty v.LogicalName (exprForValRef m vref) + 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) + QP.mkHole(ConvType cenv env m vTy, idx) | Parent _ -> // First-class use or use of type function @@ -1106,9 +1106,9 @@ and ConvDecisionTree cenv env tgs typR x = let eqR = ConvExpr cenv env eq QP.mkCond (eqR, ConvDecisionTree cenv env tgs typR dtree, acc) - | DecisionTreeTest.IsInst (_srcty, tgty) -> + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> let e1R = ConvExpr cenv env e1 - QP.mkCond (QP.mkTypeTest (ConvType cenv env m tgty, e1R), ConvDecisionTree cenv env tgs typR dtree, acc) + QP.mkCond (QP.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)) diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index f9d9b41b871..4a689f48a0c 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -187,26 +187,26 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = else let aenv = aenv.BindEquivTypars implTypars sigTypars - let aintfs = implTycon.ImmediateInterfaceTypesOfFSharpTycon - let fintfs = sigTycon.ImmediateInterfaceTypesOfFSharpTycon - let aintfsUser = implTycon.TypeContents.tcaug_interfaces |> List.filter (fun (_, compgen, _) -> not compgen) |> List.map p13 + let implIntfTys = implTycon.ImmediateInterfaceTypesOfFSharpTycon + let sigIntfTys = sigTycon.ImmediateInterfaceTypesOfFSharpTycon + let implUserIntfTys = implTycon.TypeContents.tcaug_interfaces |> List.filter (fun (_, compgen, _) -> not compgen) |> List.map p13 let flatten tys = tys |> List.collect (AllSuperTypesOfType g amap m AllowMultiIntfInstantiations.Yes) |> ListSet.setify (typeEquiv g) |> List.filter (isInterfaceTy g) - let aintfs = flatten aintfs - let fintfs = flatten fintfs + let implIntfTys = flatten implIntfTys + let sigIntfTys = flatten sigIntfTys - let unimpl = ListSet.subtract (fun fity aity -> typeAEquiv g aenv aity fity) fintfs aintfs - (unimpl + let unimplIntfTys = ListSet.subtract (fun sigIntfTy implIntfTy -> typeAEquiv g aenv implIntfTy sigIntfTy) sigIntfTys implIntfTys + (unimplIntfTys |> List.forall (fun ity -> let errorMessage = FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(), implTycon.DisplayName, NicePrint.minimalStringOfType denv ity) errorR (Error(errorMessage, m)); false)) && - let aintfsUser = flatten aintfsUser + let implUserIntfTys = flatten implUserIntfTys - let hidden = ListSet.subtract (typeAEquiv g aenv) aintfsUser fintfs + let hidden = ListSet.subtract (typeAEquiv g aenv) implUserIntfTys sigIntfTys let continueChecks, warningOrError = if implTycon.IsFSharpInterfaceTycon then false, errorR else true, warning (hidden |> List.forall (fun ity -> warningOrError (InterfaceNotRevealed(denv, ity, implTycon.Range)); continueChecks)) && @@ -328,12 +328,12 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = elif implVal.LiteralValue <> sigVal.LiteralValue then (err denv FSComp.SR.ValueNotContainedMutabilityLiteralConstantValuesDiffer) elif implVal.IsTypeFunction <> sigVal.IsTypeFunction then (err denv FSComp.SR.ValueNotContainedMutabilityOneIsTypeFunction) else - let implTypars, atau = implVal.GeneralizedType - let sigTypars, ftau = sigVal.GeneralizedType + let implTypars, implValTy = implVal.GeneralizedType + let sigTypars, sigValTy = sigVal.GeneralizedType if implTypars.Length <> sigTypars.Length then (err {denv with showTyparBinding=true} FSComp.SR.ValueNotContainedMutabilityParameterCountsDiffer) else let aenv = aenv.BindEquivTypars implTypars sigTypars checkTypars m aenv implTypars sigTypars && - if not (typeAEquiv g aenv atau ftau) then err denv FSComp.SR.ValueNotContainedMutabilityTypesDiffer + if not (typeAEquiv g aenv implValTy sigValTy) then err denv FSComp.SR.ValueNotContainedMutabilityTypesDiffer elif not (checkValInfo aenv (err denv) implVal sigVal) then false elif not (implVal.IsExtensionMember = sigVal.IsExtensionMember) then err denv FSComp.SR.ValueNotContainedMutabilityExtensionsDiffer elif not (checkMemberDatasConform (err denv) (implVal.Attribs, implVal, implVal.MemberInfo) (sigVal.Attribs, sigVal, sigVal.MemberInfo)) then false diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index 12572e87d10..fe44b9cf874 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -92,8 +92,8 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) match metadataOfTy g ty with #if !NO_TYPEPROVIDERS | ProvidedTypeMetadata info -> - for ity in info.ProvidedType.PApplyArray((fun st -> st.GetInterfaces()), "GetInterfaces", m) do - ImportProvidedType amap m ity + for intfTy in info.ProvidedType.PApplyArray((fun st -> st.GetInterfaces()), "GetInterfaces", m) do + ImportProvidedType amap m intfTy #endif | ILTypeMetadata (TILObjectReprData(scoref, _, tdef)) -> // ImportILType may fail for an interface if the assembly load set is incomplete and the interface @@ -103,12 +103,12 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) // succeeded with more reported. There are pathological corner cases where this // doesn't apply: e.g. for mscorlib interfaces like IComparable, but we can always // assume those are present. - for ity in tdef.Implements do - if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m ity then - RescopeAndImportILType scoref amap m tinst ity + for intfTy in tdef.Implements do + if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m intfTy then + RescopeAndImportILType scoref amap m tinst intfTy | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - for ity in tcref.ImmediateInterfaceTypesOfFSharpTycon do - instType (mkInstForAppTy g ty) ity ] + for intfTy in tcref.ImmediateInterfaceTypesOfFSharpTycon do + instType (mkInstForAppTy g ty) intfTy ] /// Collect the set of immediate declared interface types for an F# type, but do not /// traverse the type hierarchy to collect further interfaces. @@ -163,10 +163,10 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m ty = and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = [ // Report any interfaces that don't derive from IComparable<_> or IEquatable<_> - for ity in GetImmediateInterfacesOfType skipUnref g amap m reprTy do - if not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIComparable_tcref skipUnref g amap m ity) && - not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m ity) then - ity + for intfTy in GetImmediateInterfacesOfType skipUnref g amap m reprTy do + if not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIComparable_tcref skipUnref g amap m intfTy) && + not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m intfTy) then + intfTy // NOTE: we should really only report the IComparable> interface for measure-annotated types // if the original type supports IComparable somewhere in the hierarchy, likeiwse IEquatable>. @@ -181,15 +181,15 @@ and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = ] // Check for IComparable, IEquatable and interfaces that derive from these -and ExistsHeadTypeInInterfaceHierarchy target skipUnref g amap m ity = - ExistsInInterfaceHierarchy (function AppTy g (tcref,_) -> tyconRefEq g tcref target | _ -> false) skipUnref g amap m ity +and ExistsHeadTypeInInterfaceHierarchy target skipUnref g amap m intfTy = + ExistsInInterfaceHierarchy (function AppTy g (tcref,_) -> tyconRefEq g tcref target | _ -> false) skipUnref g amap m intfTy // Check for IComparable, IEquatable and interfaces that derive from these -and ExistsInInterfaceHierarchy p skipUnref g amap m ity = - match ity with +and ExistsInInterfaceHierarchy p skipUnref g amap m intfTy = + match intfTy with | AppTy g (tcref, tinst) -> - p ity || - (GetImmediateInterfacesOfMetadataType g amap m skipUnref ity tcref tinst + p intfTy || + (GetImmediateInterfacesOfMetadataType g amap m skipUnref intfTy tcref tinst |> List.exists (ExistsInInterfaceHierarchy p skipUnref g amap m)) | _ -> false @@ -369,14 +369,14 @@ let CopyTyparConstraints m tprefInst (tporig: Typar) = TyparConstraint.DefaultsTo (priority, instType tprefInst ty, m) | TyparConstraint.SupportsNull _ -> TyparConstraint.SupportsNull m - | TyparConstraint.IsEnum (uty, _) -> - TyparConstraint.IsEnum (instType tprefInst uty, m) + | TyparConstraint.IsEnum (underlyingTy, _) -> + TyparConstraint.IsEnum (instType tprefInst underlyingTy, m) | TyparConstraint.SupportsComparison _ -> TyparConstraint.SupportsComparison m | TyparConstraint.SupportsEquality _ -> TyparConstraint.SupportsEquality m - | TyparConstraint.IsDelegate(aty, bty, _) -> - TyparConstraint.IsDelegate (instType tprefInst aty, instType tprefInst bty, m) + | TyparConstraint.IsDelegate(argTys, retTy, _) -> + TyparConstraint.IsDelegate (instType tprefInst argTys, instType tprefInst retTy, m) | TyparConstraint.IsNonNullableStruct _ -> TyparConstraint.IsNonNullableStruct m | TyparConstraint.IsUnmanaged _ -> diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index b0951fd9a79..d714e1b1a60 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -46,24 +46,25 @@ let rec TypeDefinitelySubsumesTypeNoCoercion ndeep g amap m ty1 ty2 = type CanCoerce = CanCoerce | NoCoerce +let stripAll stripMeasures g ty = + if stripMeasures then + ty |> stripTyEqnsWrtErasure EraseAll g |> stripMeasuresFromTy g + else + ty |> stripTyEqns g + /// The feasible equivalence relation. Part of the language spec. let rec TypesFeasiblyEquivalent stripMeasures ndeep g amap m ty1 ty2 = if ndeep > 100 then error(InternalError("recursive class hierarchy (detected in TypeFeasiblySubsumesType), ty1 = " + (DebugPrint.showType ty1), m)); - let stripAll ty = - if stripMeasures then - ty |> stripTyEqnsWrtErasure EraseAll g |> stripMeasuresFromTType g - else - ty |> stripTyEqns g - let ty1str = stripAll ty1 - let ty2str = stripAll ty2 + let ty1 = stripAll stripMeasures g ty1 + let ty2 = stripAll stripMeasures g ty2 - match ty1str, ty2str with + match ty1, ty2 with | TType_var _, _ | _, TType_var _ -> true - | TType_app (tc1, l1, _), TType_app (tc2, l2, _) when tyconRefEq g tc1 tc2 -> + | TType_app (tcref1, l1, _), TType_app (tcref2, l2, _) when tyconRefEq g tcref1 tcref2 -> List.lengthsEqAndForall2 (TypesFeasiblyEquivalent stripMeasures ndeep g amap m) l1 l2 | TType_anon (anonInfo1, l1),TType_anon (anonInfo2, l2) -> @@ -76,9 +77,9 @@ let rec TypesFeasiblyEquivalent stripMeasures ndeep g amap m ty1 ty2 = evalTupInfoIsStruct tupInfo1 = evalTupInfoIsStruct tupInfo2 && List.lengthsEqAndForall2 (TypesFeasiblyEquivalent stripMeasures ndeep g amap m) l1 l2 - | TType_fun (d1, r1, _), TType_fun (d2, r2, _) -> - TypesFeasiblyEquivalent stripMeasures ndeep g amap m d1 d2 && - TypesFeasiblyEquivalent stripMeasures ndeep g amap m r1 r2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + TypesFeasiblyEquivalent stripMeasures ndeep g amap m domainTy1 domainTy2 && + TypesFeasiblyEquivalent stripMeasures ndeep g amap m rangeTy1 rangeTy2 | TType_measure _, TType_measure _ -> true @@ -133,51 +134,51 @@ let rec TypeFeasiblySubsumesType ndeep g amap m ty1 canCoerce ty2 = /// Here x gets a generalized type "list<'T>". let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) = let m = tp.Range - let max, m = - let initial = + let maxTy, m = + let initialTy = match tp.Kind with | TyparKind.Type -> g.obj_ty | TyparKind.Measure -> TType_measure Measure.One // Loop through the constraints computing the lub - ((initial, m), tp.Constraints) ||> List.fold (fun (maxSoFar, _) tpc -> + ((initialTy, m), tp.Constraints) ||> List.fold (fun (maxTy, _) tpc -> let join m x = - if TypeFeasiblySubsumesType 0 g amap m x CanCoerce maxSoFar then maxSoFar - elif TypeFeasiblySubsumesType 0 g amap m maxSoFar CanCoerce x then x - else errorR(Error(FSComp.SR.typrelCannotResolveImplicitGenericInstantiation((DebugPrint.showType x), (DebugPrint.showType maxSoFar)), m)); maxSoFar + if TypeFeasiblySubsumesType 0 g amap m x CanCoerce maxTy then maxTy + elif TypeFeasiblySubsumesType 0 g amap m maxTy CanCoerce x then x + else errorR(Error(FSComp.SR.typrelCannotResolveImplicitGenericInstantiation((DebugPrint.showType x), (DebugPrint.showType maxTy)), m)); maxTy // Don't continue if an error occurred and we set the value eagerly - if tp.IsSolved then maxSoFar, m else + if tp.IsSolved then maxTy, m else match tpc with | TyparConstraint.CoercesTo(x, m) -> join m x, m | TyparConstraint.MayResolveMember(_traitInfo, m) -> - maxSoFar, m + maxTy, m | TyparConstraint.SimpleChoice(_, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInPrintf(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.SupportsNull m -> - maxSoFar, m + maxTy, m | TyparConstraint.SupportsComparison m -> join m g.mk_IComparable_ty, m | TyparConstraint.SupportsEquality m -> - maxSoFar, m + maxTy, m | TyparConstraint.IsEnum(_, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInEnum(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.IsDelegate(_, _, m) -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInDelegate(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.IsNonNullableStruct m -> join m g.int_ty, m | TyparConstraint.IsUnmanaged m -> errorR(Error(FSComp.SR.typrelCannotResolveAmbiguityInUnmanaged(), m)) - maxSoFar, m + maxTy, m | TyparConstraint.RequiresDefaultConstructor m -> - maxSoFar, m + maxTy, m | TyparConstraint.IsReferenceType m -> - maxSoFar, m + maxTy, m | TyparConstraint.DefaultsTo(_priority, _ty, m) -> - maxSoFar, m) - max, m + maxTy, m) + maxTy, m let ChooseTyparSolution g amap tp = let ty, _m = ChooseTyparSolutionAndRange g amap tp @@ -249,11 +250,11 @@ let tryDestTopLambda g amap (ValReprInfo (tpNames, _, _) as tvd) (e, ty) = (None, None, [], e, ty) let n = tvd.NumCurriedArgs - let tps, taue, tauty = + let tps, bodyExpr, bodyTy = match stripDebugPoints e with | Expr.TyLambda (_, tps, b, _, retTy) when not (isNil tpNames) -> tps, b, retTy | _ -> [], e, ty - let ctorThisValOpt, baseValOpt, vsl, body, retTy = startStripLambdaUpto n (taue, tauty) + let ctorThisValOpt, baseValOpt, vsl, body, retTy = startStripLambdaUpto n (bodyExpr, bodyTy) if vsl.Length <> n then None else diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index ea3dc9dbb9a..cca134f4d38 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -174,8 +174,8 @@ let rec ImportILType (env: ImportMap) m tinst ty = | ILType.Array(bounds, ty) -> let n = bounds.Rank - let elementType = ImportILType env m tinst ty - mkArrayTy env.g n elementType m + let elemTy = ImportILType env m tinst ty + mkArrayTy env.g n elemTy m | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef @@ -335,10 +335,10 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( if tp.Kind = TyparKind.Measure then let rec conv ty = match ty with - | TType_app (tcref, [t1;t2], _) when tyconRefEq g tcref g.measureproduct_tcr -> Measure.Prod (conv t1, conv t2) - | TType_app (tcref, [t1], _) when tyconRefEq g tcref g.measureinverse_tcr -> Measure.Inv (conv t1) + | TType_app (tcref, [ty1;ty2], _) when tyconRefEq g tcref g.measureproduct_tcr -> Measure.Prod (conv ty1, conv ty2) + | TType_app (tcref, [ty1], _) when tyconRefEq g tcref g.measureinverse_tcr -> Measure.Inv (conv ty1) | TType_app (tcref, [], _) when tyconRefEq g tcref g.measureone_tcr -> Measure.One - | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Con tcref + | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Const tcref | TType_app (tcref, _, _) -> errorR(Error(FSComp.SR.impInvalidMeasureArgument1(tcref.CompiledName, tp.Name), m)) Measure.One diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 28c4382f918..c5d45e95e3f 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -55,7 +55,7 @@ type ValRef with | Some membInfo -> not membInfo.MemberFlags.IsDispatchSlot && (match membInfo.ImplementedSlotSigs with - | TSlotSig(_, oty, _, _, _, _) :: _ -> isInterfaceTy g oty + | slotSig :: _ -> isInterfaceTy g slotSig.DeclaringType | [] -> false) member vref.ImplementedSlotSignatures = @@ -312,8 +312,8 @@ let OptionalArgInfoOfProvidedParameter (amap: ImportMap) m (provParam : Tainted< elif isObjTy g ty then MissingValue else DefaultValue - let pty = ImportProvidedType amap m (provParam.PApply((fun p -> p.ParameterType), m)) - CallerSide (analyze pty) + let paramTy = ImportProvidedType amap m (provParam.PApply((fun p -> p.ParameterType), m)) + CallerSide (analyze paramTy) | _ -> let v = provParam.PUntaint((fun p -> p.RawDefaultValue), m) CallerSide (Constant (ILFieldInit.FromProvidedObj m v)) @@ -1217,8 +1217,8 @@ type MethInfo = let formalRetTy = ImportReturnTypeFromMetadata amap m ilminfo.RawMetadata.Return.Type (fun _ -> ilminfo.RawMetadata.Return.CustomAttrs) ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys let formalParams = [ [ for p in ilminfo.RawMetadata.Parameters do - let paramType = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type (fun _ -> p.CustomAttrs) - yield TSlotParam(p.Name, paramType, p.IsIn, p.IsOut, p.IsOptional, []) ] ] + let paramTy = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type (fun _ -> p.CustomAttrs) + yield TSlotParam(p.Name, paramTy, p.IsIn, p.IsOut, p.IsOptional, []) ] ] formalRetTy, formalParams #if !NO_TYPEPROVIDERS | ProvidedMeth (_, mi, _, _) -> @@ -1230,9 +1230,9 @@ type MethInfo = let formalParams = [ [ for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do let paramName = p.PUntaint((fun p -> match p.Name with null -> None | s -> Some s), m) - let paramType = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) + let paramTy = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) let isIn, isOut, isOptional = p.PUntaint((fun p -> p.IsIn, p.IsOut, p.IsOptional), m) - yield TSlotParam(paramName, paramType, isIn, isOut, isOptional, []) ] ] + yield TSlotParam(paramName, paramTy, isIn, isOut, isOptional, []) ] ] formalRetTy, formalParams #endif | _ -> failwith "unreachable" @@ -1256,15 +1256,15 @@ type MethInfo = | ProvidedMeth(amap, mi, _, _) -> // A single set of tupled parameters [ [for p in mi.PApplyArray((fun mi -> mi.GetParameters()), "GetParameters", m) do - let pname = + let paramName = match p.PUntaint((fun p -> p.Name), m) with | null -> None | name -> Some (mkSynId m name) - let pty = + let paramTy = match p.PApply((fun p -> p.ParameterType), m) with | Tainted.Null -> amap.g.unit_ty | parameterType -> ImportProvidedType amap m parameterType - yield ParamNameAndType(pname, pty) ] ] + yield ParamNameAndType(paramName, paramTy) ] ] #endif @@ -1866,14 +1866,14 @@ type PropInfo = | ProvidedProp (_, pi, m) -> [ for p in pi.PApplyArray((fun pi -> pi.GetIndexParameters()), "GetIndexParameters", m) do let paramName = p.PUntaint((fun p -> match p.Name with null -> None | s -> Some (mkSynId m s)), m) - let paramType = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) - yield ParamNameAndType(paramName, paramType) ] + let paramTy = ImportProvidedType amap m (p.PApply((fun p -> p.ParameterType), m)) + yield ParamNameAndType(paramName, paramTy) ] #endif /// Get the details of the indexer parameters associated with the property member x.GetParamDatas(amap, m) = x.GetParamNamesAndTypes(amap, m) - |> List.map (fun (ParamNameAndType(nmOpt, pty)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) + |> List.map (fun (ParamNameAndType(nmOpt, paramTy)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, paramTy)) /// Get the types of the indexer parameters associated with the property member x.GetParamTypes(amap, m) = @@ -1908,14 +1908,16 @@ type PropInfo = /// Uses the same techniques as 'MethInfosUseIdenticalDefinitions'. /// Must be compatible with ItemsAreEffectivelyEqual relation. static member PropInfosUseIdenticalDefinitions x1 x2 = + let optVrefEq g = function - | Some v1, Some v2 -> valRefEq g v1 v2 + | Some vref1, Some vref2 -> valRefEq g vref1 vref2 | None, None -> true | _ -> false + match x1, x2 with | ILProp ilpinfo1, ILProp ilpinfo2 -> (ilpinfo1.RawMetadata === ilpinfo2.RawMetadata) | FSProp(g, _, vrefa1, vrefb1), FSProp(_, _, vrefa2, vrefb2) -> - (optVrefEq g (vrefa1, vrefa2)) && (optVrefEq g (vrefb1, vrefb2)) + optVrefEq g (vrefa1, vrefa2) && optVrefEq g (vrefb1, vrefb2) #if !NO_TYPEPROVIDERS | ProvidedProp(_, pi1, _), ProvidedProp(_, pi2, _) -> ProvidedPropertyInfo.TaintedEquals (pi1, pi2) #endif @@ -1927,7 +1929,7 @@ type PropInfo = | ILProp ilpinfo -> hash ilpinfo.RawMetadata.Name | FSProp(_, _, vrefOpt1, vrefOpt2) -> // Hash on string option * string option - let vth = (vrefOpt1 |> Option.map (fun vr -> vr.LogicalName), (vrefOpt2 |> Option.map (fun vr -> vr.LogicalName))) + let vth = (vrefOpt1 |> Option.map (fun vr -> vr.LogicalName), (vrefOpt2 |> Option.map (fun vref -> vref.LogicalName))) hash vth #if !NO_TYPEPROVIDERS | ProvidedProp(_, pi, _) -> ProvidedPropertyInfo.TaintedGetHashCode pi diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index c39508fc595..63c543cfed2 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -164,7 +164,7 @@ type AttributeDecoder(namedArgs) = let findTyconRef x = match NameMap.tryFind x nameMap with - | Some (AttribExpr (_, Expr.App (_, _, [ TType_app (tr, _, _) ], _, _))) -> Some tr + | Some (AttribExpr (_, Expr.App (_, _, [ TType_app (tcref, _, _) ], _, _))) -> Some tcref | _ -> None member _.FindInt16 x dflt = @@ -575,7 +575,7 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty member eenv.ForTycon(tycon: Tycon) = eenv.ForTypars tycon.TyparsNoRange /// Get the environment for generating a reference to items within a type definition - member eenv.ForTyconRef(tycon: TyconRef) = eenv.ForTycon tycon.Deref + member eenv.ForTyconRef(tcref: TyconRef) = eenv.ForTycon tcref.Deref //-------------------------------------------------------------------------- // Generate type references @@ -2073,7 +2073,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu mkILFields [ for _, fldName, fldTy in flds -> - // Don't hide fields when splitting to multiple assemblies. + let access = if cenv.options.isInteractive && cenv.options.fsiMultiAssemblyEmit then ILMemberAccess.Public @@ -2081,7 +2081,8 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu ILMemberAccess.Private let fdef = mkILInstanceField (fldName, fldTy, None, access) - fdef.With(customAttrs = mkILCustomAttrs [ g.DebuggerBrowsableNeverAttribute ]) + let attrs = [ g.CompilerGeneratedAttribute; g.DebuggerBrowsableNeverAttribute ] + fdef.With(customAttrs = mkILCustomAttrs attrs) ] // Generate property definitions for the fields compiled as properties @@ -2171,16 +2172,16 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu ) let tcref = mkLocalTyconRef tycon - let typ = generalizedTyconRef g tcref + let ty = generalizedTyconRef g tcref let tcaug = tcref.TypeContents tcaug.tcaug_interfaces <- [ (g.mk_IStructuralComparable_ty, true, m) (g.mk_IComparable_ty, true, m) - (mkAppTy g.system_GenericIComparable_tcref [ typ ], true, m) + (mkAppTy g.system_GenericIComparable_tcref [ ty ], true, m) (g.mk_IStructuralEquatable_ty, true, m) - (mkAppTy g.system_GenericIEquatable_tcref [ typ ], true, m) + (mkAppTy g.system_GenericIEquatable_tcref [ ty ], true, m) ] let vspec1, vspec2 = AugmentWithHashCompare.MakeValsForEqualsAugmentation g tcref @@ -2209,7 +2210,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilInterfaceTys = [ - for ity, _, _ in tcaug.tcaug_interfaces -> GenType cenv m (TypeReprEnv.Empty.ForTypars tps) ity + for intfTy, _, _ in tcaug.tcaug_interfaces -> GenType cenv m (TypeReprEnv.Empty.ForTypars tps) intfTy ] let ilTypeDef = @@ -2973,7 +2974,7 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = match op, args, tyargs with | TOp.ExnConstr c, _, _ -> GenAllocExn cenv cgbuf eenv (c, args, m) sequel | TOp.UnionCase c, _, _ -> GenAllocUnionCase cenv cgbuf eenv (c, tyargs, args, m) sequel - | TOp.Recd (isCtor, tycon), _, _ -> GenAllocRecd cenv cgbuf eenv isCtor (tycon, tyargs, args, m) sequel + | TOp.Recd (isCtor, tcref), _, _ -> GenAllocRecd cenv cgbuf eenv isCtor (tcref, tyargs, args, m) sequel | TOp.AnonRecd anonInfo, _, _ -> GenAllocAnonRecd cenv cgbuf eenv (anonInfo, tyargs, args, m) sequel | TOp.AnonRecdGet (anonInfo, n), [ e ], _ -> GenGetAnonRecdField cenv cgbuf eenv (anonInfo, e, tyargs, n, m) sequel | TOp.TupleFieldGet (tupInfo, n), [ e ], _ -> GenGetTupleField cenv cgbuf eenv (tupInfo, e, tyargs, n, m) sequel @@ -3000,10 +3001,10 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = [] -> GenIntegerForLoop cenv cgbuf eenv (spFor, spTo, v, e1, dir, e2, e3, m) sequel | TOp.TryFinally (spTry, spFinally), [ Expr.Lambda (_, _, _, [ _ ], e1, _, _); Expr.Lambda (_, _, _, [ _ ], e2, _, _) ], - [ resty ] -> GenTryFinally cenv cgbuf eenv (e1, e2, m, resty, spTry, spFinally) sequel + [ resTy ] -> GenTryFinally cenv cgbuf eenv (e1, e2, m, resTy, spTry, spFinally) sequel | TOp.TryWith (spTry, spWith), [ Expr.Lambda (_, _, _, [ _ ], e1, _, _); Expr.Lambda (_, _, _, [ vf ], ef, _, _); Expr.Lambda (_, _, _, [ vh ], eh, _, _) ], - [ resty ] -> GenTryWith cenv cgbuf eenv (e1, vf, ef, vh, eh, m, resty, spTry, spWith) sequel + [ resTy ] -> GenTryWith cenv cgbuf eenv (e1, vf, ef, vh, eh, m, resTy, spTry, spWith) sequel | TOp.ILCall (isVirtual, _, isStruct, isCtor, valUseFlag, _, noTailCall, ilMethRef, enclTypeInst, methInst, returnTypes), args, [] -> @@ -3014,8 +3015,8 @@ and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv expr (sequel: sequel) = (isVirtual, isStruct, isCtor, valUseFlag, noTailCall, ilMethRef, enclTypeInst, methInst, args, returnTypes, m) sequel | TOp.RefAddrGet _readonly, [ e ], [ ty ] -> GenGetAddrOfRefCellField cenv cgbuf eenv (e, ty, m) sequel - | TOp.Coerce, [ e ], [ tgty; srcty ] -> GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel - | TOp.Reraise, [], [ rtnty ] -> GenReraise cenv cgbuf eenv (rtnty, m) sequel + | TOp.Coerce, [ e ], [ tgtTy; srcTy ] -> GenCoerce cenv cgbuf eenv (e, tgtTy, m, srcTy) sequel + | TOp.Reraise, [], [ retTy ] -> GenReraise cenv cgbuf eenv (retTy, m) sequel | TOp.TraitCall traitInfo, args, [] -> GenTraitCall cenv cgbuf eenv (traitInfo, args, m) expr sequel | TOp.LValueOp (LSet, v), [ e ], [] -> GenSetVal cenv cgbuf eenv (v, e, m) sequel | TOp.LValueOp (LByrefGet, v), [], [] -> GenGetByref cenv cgbuf eenv (v, m) sequel @@ -3285,17 +3286,17 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo, e, tys, n, m) sequel = if ar <= 0 then failwith "getCompiledTupleItem" elif ar < maxTuple then - let tcr' = mkCompiledTupleTyconRef g tupInfo ar - let ty = GenNamedTyApp cenv m eenv.tyenv tcr' tys + let tcref = mkCompiledTupleTyconRef g tupInfo ar + let ty = GenNamedTyApp cenv m eenv.tyenv tcref tys mkGetTupleItemN g m n ty tupInfo e tys[n] else let tysA, tysB = List.splitAfter goodTupleFields tys let tyB = mkCompiledTupleTy g tupInfo tysB - let tys' = tysA @ [ tyB ] - let tcr' = mkCompiledTupleTyconRef g tupInfo (List.length tys') - let ty' = GenNamedTyApp cenv m eenv.tyenv tcr' tys' - let n' = (min n goodTupleFields) - let elast = mkGetTupleItemN g m n' ty' tupInfo e tys'[n'] + let tysC = tysA @ [ tyB ] + let tcref = mkCompiledTupleTyconRef g tupInfo (List.length tysC) + let tyR = GenNamedTyApp cenv m eenv.tyenv tcref tysC + let nR = min n goodTupleFields + let elast = mkGetTupleItemN g m nR tyR tupInfo e tysC[nR] if n < goodTupleFields then elast @@ -3682,18 +3683,18 @@ and GenNewArray cenv cgbuf eenv (elems: Expr list, elemTy, m) sequel = else GenNewArraySimple cenv cgbuf eenv (elems, elemTy, m) sequel -and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = +and GenCoerce cenv cgbuf eenv (e, tgtTy, m, srcTy) sequel = let g = cenv.g // Is this an upcast? if - TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty + TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy && // Do an extra check - should not be needed - TypeFeasiblySubsumesType 0 g cenv.amap m tgty NoCoerce srcty + TypeFeasiblySubsumesType 0 g cenv.amap m tgtTy NoCoerce srcTy then - if isInterfaceTy g tgty then + if isInterfaceTy g tgtTy then GenExpr cenv cgbuf eenv e Continue - let ilToTy = GenType cenv m eenv.tyenv tgty + let ilToTy = GenType cenv m eenv.tyenv tgtTy // Section "III.1.8.1.3 Merging stack states" of ECMA-335 implies that no unboxing // is required, but we still push the coerced type on to the code gen buffer. CG.EmitInstrs cgbuf (pop 1) (Push [ ilToTy ]) [] @@ -3703,18 +3704,18 @@ and GenCoerce cenv cgbuf eenv (e, tgty, m, srcty) sequel = else GenExpr cenv cgbuf eenv e Continue - if not (isObjTy g srcty) then - let ilFromTy = GenType cenv m eenv.tyenv srcty + if not (isObjTy g srcTy) then + let ilFromTy = GenType cenv m eenv.tyenv srcTy CG.EmitInstr cgbuf (pop 1) (Push [ g.ilg.typ_Object ]) (I_box ilFromTy) - if not (isObjTy g tgty) then - let ilToTy = GenType cenv m eenv.tyenv tgty + if not (isObjTy g tgtTy) then + let ilToTy = GenType cenv m eenv.tyenv tgtTy CG.EmitInstr cgbuf (pop 1) (Push [ ilToTy ]) (I_unbox_any ilToTy) GenSequel cenv eenv.cloc cgbuf sequel -and GenReraise cenv cgbuf eenv (rtnty, m) sequel = - let ilReturnTy = GenType cenv m eenv.tyenv rtnty +and GenReraise cenv cgbuf eenv (retTy, m) sequel = + let ilReturnTy = GenType cenv m eenv.tyenv retTy CG.EmitInstr cgbuf (pop 0) Push0 I_rethrow // [See comment related to I_throw]. // Rethrow does not return. Required to push dummy value on the stack. @@ -4538,14 +4539,14 @@ and GenNamedLocalTyFuncCall cenv (cgbuf: CodeGenBuffer) eenv ty cloinfo tyargs m actualRetTy /// Generate an indirect call, converting to an ILX callfunc instruction -and GenCurriedArgsAndIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = +and GenCurriedArgsAndIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = // Generate the curried arguments to the indirect call GenExprs cenv cgbuf eenv curriedArgs - GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel + GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel /// Generate an indirect call, converting to an ILX callfunc instruction -and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = +and GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = let g = cenv.g // Fold in the new types into the environment as we generate the formal types. @@ -4553,7 +4554,7 @@ and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = // keep only non-erased type arguments when computing indirect call let tyargs = DropErasedTyargs tyargs - let typars, formalFuncTy = tryDestForallTy g functy + let typars, formalFuncTy = tryDestForallTy g funcTy let feenv = eenv.tyenv.Add typars @@ -4568,7 +4569,7 @@ and GenIndirectCall cenv cgbuf eenv (functy, tyargs, curriedArgs, m) sequel = List.foldBack (fun tyarg acc -> Apps_tyapp(GenType cenv m eenv.tyenv tyarg, acc)) tyargs (appBuilder ilxRetApps) - let actualRetTy = applyTys g functy (tyargs, curriedArgs) + let actualRetTy = applyTys g funcTy (tyargs, curriedArgs) let ilActualRetTy = GenType cenv m eenv.tyenv actualRetTy // Check if any byrefs are involved to make sure we don't tailcall @@ -4710,14 +4711,14 @@ and eligibleForFilter (cenv: cenv) expr = && not isTrivial && check expr -and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler: Val, handlerExpr, m, resty, spTry, spWith) sequel = +and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler: Val, handlerExpr, m, resTy, spTry, spWith) sequel = let g = cenv.g // Save the stack - gross because IL flushes the stack at the exn. handler // note: eenvinner notes spill vars are live LocalScope "trystack" cgbuf (fun scopeMarks -> let whereToSaveOpt, eenvinner, stack, tryMarks, afterHandler = - GenTry cenv cgbuf eenv scopeMarks (e1, m, resty, spTry) + GenTry cenv cgbuf eenv scopeMarks (e1, m, resTy, spTry) let seh = if cenv.options.generateFilterBlocks || eligibleForFilter cenv filterExpr then @@ -4824,13 +4825,13 @@ and GenTryWith cenv cgbuf eenv (e1, valForFilter: Val, filterExpr, valForHandler GenSequel cenv eenv.cloc cgbuf sequel | None -> GenUnitThenSequel cenv eenv m eenv.cloc cgbuf sequel) -and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resty, spTry, spFinally) sequel = +and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resTy, spTry, spFinally) sequel = // Save the stack - needed because IL flushes the stack at the exn. handler // note: eenvinner notes spill vars are live LocalScope "trystack" cgbuf (fun scopeMarks -> let whereToSaveOpt, eenvinner, stack, tryMarks, afterHandler = - GenTry cenv cgbuf eenv scopeMarks (bodyExpr, m, resty, spTry) + GenTry cenv cgbuf eenv scopeMarks (bodyExpr, m, resTy, spTry) // Now the catch/finally block let startOfHandler = CG.GenerateMark cgbuf "startOfHandler" @@ -7520,8 +7521,8 @@ and GenDecisionTreeSwitch CG.EmitInstr cgbuf (pop 1) (Push [ g.ilg.typ_Object ]) (I_box ilFromTy) BI_brfalse - | DecisionTreeTest.IsInst (_srcty, tgty) -> - let e = mkCallTypeTest g m tgty e + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> + let e = mkCallTypeTest g m tgtTy e GenExpr cenv cgbuf eenv e Continue BI_brtrue | _ -> failwith "internal error: GenDecisionTreeSwitch" @@ -9472,7 +9473,7 @@ and AllocLocal cenv cgbuf eenv compgen (v, ty, isFixed) (scopeMarks: Mark * Mark let j, realloc = if cenv.options.localOptimizationsEnabled then cgbuf.ReallocLocal( - (fun i (_, ty', isFixed') -> not isFixed' && not isFixed && not (IntMap.mem i eenv.liveLocals) && (ty = ty')), + (fun i (_, ty2, isFixed2) -> not isFixed2 && not isFixed && not (IntMap.mem i eenv.liveLocals) && (ty = ty2)), ranges, ty, isFixed @@ -10470,7 +10471,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = for slotsig in memberInfo.ImplementedSlotSigs do - if isInterfaceTy g slotsig.ImplementedType then + if isInterfaceTy g slotsig.DeclaringType then match vref.ValReprInfo with | Some _ -> @@ -10676,7 +10677,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let extraAttribs = match tyconRepr with - | TFSharpRecdRepr _ when not useGenuineField -> [ g.DebuggerBrowsableNeverAttribute ] // hide fields in records in debug display + | TFSharpRecdRepr _ when not useGenuineField -> + [ g.CompilerGeneratedAttribute; g.DebuggerBrowsableNeverAttribute ] | _ -> [] // don't hide fields in classes in debug display let access = ComputeMemberAccess isFieldHidden diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index fba0a064091..056f2f19a78 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -124,6 +124,7 @@ let GetRangeOfDiagnostic (diagnostic: PhasedDiagnostic) = | LetRecCheckedAtRuntime m | UpperCaseIdentifierInPattern m | NotUpperCaseConstructor m + | NotUpperCaseConstructorWithoutRQA m | RecursiveUseCheckedAtRuntime (_, _, m) | LetRecEvaluatedOutOfOrder (_, _, _, m) | DiagnosticWithText (_, _, m) @@ -270,6 +271,7 @@ let GetDiagnosticNumber (diagnostic: PhasedDiagnostic) = | UseOfAddressOfOperator _ -> 51 | DefensiveCopyWarning _ -> 52 | NotUpperCaseConstructor _ -> 53 + | NotUpperCaseConstructorWithoutRQA _ -> 53 | TypeIsImplicitlyAbstract _ -> 54 // 55 cannot be reused | DeprecatedThreadStaticBindingWarning _ -> 56 @@ -435,6 +437,7 @@ let ErrorFromApplyingDefault2E () = Message("ErrorFromApplyingDefault2", "") let ErrorsFromAddingSubsumptionConstraintE () = Message("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") let UpperCaseIdentifierInPatternE () = Message("UpperCaseIdentifierInPattern", "") let NotUpperCaseConstructorE () = Message("NotUpperCaseConstructor", "") +let NotUpperCaseConstructorWithoutRQAE () = Message("NotUpperCaseConstructorWithoutRQA", "") let FunctionExpectedE () = Message("FunctionExpected", "") let BakedInMemberConstraintNameE () = Message("BakedInMemberConstraintName", "%s") let BadEventTransformationE () = Message("BadEventTransformation", "") @@ -771,6 +774,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | NotUpperCaseConstructor _ -> os.AppendString(NotUpperCaseConstructorE().Format) + | NotUpperCaseConstructorWithoutRQA _ -> os.AppendString(NotUpperCaseConstructorWithoutRQAE().Format) + | ErrorFromAddingConstraint (_, e, _) -> OutputExceptionR os e #if !NO_TYPEPROVIDERS @@ -895,7 +900,8 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | ParameterlessStructCtor _ -> os.AppendString(ParameterlessStructCtorE().Format) - | InterfaceNotRevealed (denv, ity, _) -> os.AppendString(InterfaceNotRevealedE().Format(NicePrint.minimalStringOfType denv ity)) + | InterfaceNotRevealed (denv, intfTy, _) -> + os.AppendString(InterfaceNotRevealedE().Format(NicePrint.minimalStringOfType denv intfTy)) | NotAFunctionButIndexer (_, _, name, _, _, old) -> if old then @@ -1501,7 +1507,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu |> List.exists (function | TType_app (maybeUnit, [], _) -> match maybeUnit.TypeAbbrev with - | Some ttype when isUnitTy g ttype -> true + | Some ty when isUnitTy g ty -> true | _ -> false | _ -> false) @@ -1689,7 +1695,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | PatternMatchCompilation.RuleNeverMatched _ -> os.AppendString(RuleNeverMatchedE().Format) - | ValNotMutable (_, valRef, _) -> os.AppendString(ValNotMutableE().Format(valRef.DisplayName)) + | ValNotMutable (_, vref, _) -> os.AppendString(ValNotMutableE().Format(vref.DisplayName)) | ValNotLocal _ -> os.AppendString(ValNotLocalE().Format) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a6ce206cc8f..97e24679878 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1543,6 +1543,7 @@ featureStructActivePattern,"struct representation for active patterns" featureRelaxWhitespace2,"whitespace relaxation v2" featureReallyLongList,"list literals of any size" featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute" +featureLowercaseDUWhenRequireQualifiedAccess,"Allow lowercase DU when RequireQualifiedAccess attribute" 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index bf1c66b0f29..51f172fbbea 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -1107,4 +1107,7 @@ internal error: {0} + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + \ No newline at end of file diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index a0033a5d2b7..77b93032baa 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -49,6 +49,7 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management type LanguageVersion(versionText) = @@ -111,6 +112,7 @@ type LanguageVersion(versionText) = LanguageFeature.BetterExceptionPrinting, previewVersion LanguageFeature.ReallyLongLists, previewVersion LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, previewVersion + LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -210,6 +212,7 @@ type LanguageVersion(versionText) = | LanguageFeature.DelegateTypeNameResolutionFix -> FSComp.SR.featureDelegateTypeNameResolutionFix () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () + | LanguageFeature.LowercaseDUWhenRequireQualifiedAccess -> FSComp.SR.featureLowercaseDUWhenRequireQualifiedAccess () /// Get a version string associated with the given feature. member _.GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index ec884903b49..8227c947c77 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -39,6 +39,7 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Facilities/TextLayoutRender.fs b/src/Compiler/Facilities/TextLayoutRender.fs index 1b77bd9e6ae..e9b7cd8637a 100644 --- a/src/Compiler/Facilities/TextLayoutRender.fs +++ b/src/Compiler/Facilities/TextLayoutRender.fs @@ -204,5 +204,5 @@ module LayoutRender = let toArray layout = let output = ResizeArray() - renderL (taggedTextListR (fun tt -> output.Add(tt))) layout |> ignore + renderL (taggedTextListR output.Add) layout |> ignore output.ToArray() diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 936343a7036..5d8966fd9a1 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1814,9 +1814,9 @@ type internal FsiDynamicCompiler( ilTy |> Morphs.morphILTypeRefsInILType emEnv.ReverseMapTypeRef | _ -> ilTy) - ((istate, []), ilTys) ||> List.fold (fun (state, addedTypes) ilTy -> - let nextState, addedType = addTypeToEnvironment state ilTy - nextState, addedTypes @ [addedType]) + ((istate, []), ilTys) ||> List.fold (fun (state, addedTys) ilTy -> + let nextState, addedTy = addTypeToEnvironment state ilTy + nextState, addedTys @ [addedTy]) member _.DynamicAssemblies = dynamicAssemblies.ToArray() diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 90e79010ed6..f4462122337 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -606,9 +606,9 @@ let inline BindInternalValsToUnknown cenv vs env = ignore vs env -let BindTypeVar tyv typeinfo env = { env with typarInfos= (tyv, typeinfo) :: env.typarInfos } +let BindTypar tyv typeinfo env = { env with typarInfos= (tyv, typeinfo) :: env.typarInfos } -let BindTypeVarsToUnknown (tps: Typar list) env = +let BindTyparsToUnknown (tps: Typar list) env = if isNil tps then env else // The optimizer doesn't use the type values it could track. // However here we mutate to provide better names for generalized type parameters @@ -617,7 +617,7 @@ let BindTypeVarsToUnknown (tps: Typar list) env = (tps, nms) ||> List.iter2 (fun tp nm -> if PrettyTypes.NeedsPrettyTyparName tp then tp.typar_id <- ident (nm, tp.Range)) - List.fold (fun sofar arg -> BindTypeVar arg UnknownTypeValue sofar) env tps + List.fold (fun sofar arg -> BindTypar arg UnknownTypeValue sofar) env tps let BindCcu (ccu: CcuThunk) mval env (_g: TcGlobals) = { env with globalModuleInfos=env.globalModuleInfos.Add(ccu.AssemblyName, mval) } @@ -2245,8 +2245,8 @@ let TryDetectQueryQuoteAndRun cenv (expr: Expr) = match reqdResultInfo, exprIsEnumerableInfo with | Some _, Some _ | None, None -> resultExpr // the expression is a QuerySource, the result is a QuerySource, nothing to do | Some resultElemTy, None -> - let iety = TType_app(g.tcref_System_Collections_IEnumerable, [], g.knownWithoutNull) - mkCallGetQuerySourceAsEnumerable g expr.Range resultElemTy iety resultExpr + let enumerableTy = TType_app(g.tcref_System_Collections_IEnumerable, [], g.knownWithoutNull) + mkCallGetQuerySourceAsEnumerable g expr.Range resultElemTy enumerableTy resultExpr | None, Some (resultElemTy, qTy) -> mkCallNewQuerySource g expr.Range resultElemTy qTy resultExpr Some resultExprAfterConvertToResultTy @@ -2425,7 +2425,7 @@ and OptimizeMethods cenv env baseValOpt methods = and OptimizeMethod cenv env baseValOpt (TObjExprMethod(slotsig, attribs, tps, vs, e, m) as tmethod) = let env = {env with latestBoundId=Some tmethod.Id; functionVal = None} - let env = BindTypeVarsToUnknown tps env + let env = BindTyparsToUnknown tps env let env = BindInternalValsToUnknown cenv vs env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env let eR, einfo = OptimizeExpr cenv env e @@ -2508,11 +2508,11 @@ and OptimizeExprOp cenv env (op, tyargs, args, m) = // Special cases match op, tyargs, args with - | TOp.Coerce, [toty;fromty], [arg] -> + | TOp.Coerce, [tgtTy; srcTy], [arg] -> let argR, einfo = OptimizeExpr cenv env arg - if typeEquiv g toty fromty then argR, einfo + if typeEquiv g tgtTy srcTy then argR, einfo else - mkCoerceExpr(argR, toty, m, fromty), + mkCoerceExpr(argR, tgtTy, m, srcTy), { TotalSize=einfo.TotalSize + 1 FunctionSize=einfo.FunctionSize + 1 HasEffect = true @@ -3742,7 +3742,7 @@ and OptimizeLambdas (vspec: Val option) cenv env valReprInfo expr exprTy = let env = { env with functionVal = (match vspec with None -> None | Some v -> Some (v, valReprInfo)) } let env = Option.foldBack (BindInternalValToUnknown cenv) ctorThisValOpt env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env - let env = BindTypeVarsToUnknown tps env + let env = BindTyparsToUnknown tps env let env = List.foldBack (BindInternalValsToUnknown cenv) vsl env let bodyR, bodyinfo = OptimizeExpr cenv env body let exprR = mkMemberLambdas g m tps ctorThisValOpt baseValOpt vsl (bodyR, bodyTy) @@ -3977,7 +3977,7 @@ and TryOptimizeDecisionTreeTest cenv test vinfo = | DecisionTreeTest.ArrayLength _, _ -> None | DecisionTreeTest.Const c1, StripConstValue c2 -> if c1 = Const.Zero || c2 = Const.Zero then None else Some(c1=c2) | DecisionTreeTest.IsNull, StripConstValue c2 -> Some(c2=Const.Zero) - | DecisionTreeTest.IsInst (_srcty1, _tgty1), _ -> None + | DecisionTreeTest.IsInst (_srcTy1, _tgtTy1), _ -> None // These should not occur in optimization | DecisionTreeTest.ActivePatternCase _, _ -> None | _ -> None @@ -3989,8 +3989,8 @@ and OptimizeSwitch cenv env (e, cases, dflt, m) = // Replace IsInst tests by calls to the helper for type tests, which may then get optimized let e, cases = match cases with - | [ TCase(DecisionTreeTest.IsInst (_srcTy, tgTy), success)] -> - let testExpr = mkCallTypeTest g m tgTy e + | [ TCase(DecisionTreeTest.IsInst (_srcTy, tgtTy), success)] -> + let testExpr = mkCallTypeTest g m tgtTy e let testCases = [TCase(DecisionTreeTest.Const(Const.Bool true), success)] testExpr, testCases | _ -> e, cases diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index c7f4e0ce0f0..c6ba1fd081f 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -351,13 +351,13 @@ type internal TypeCheckInfo // Find the most deeply nested enclosing scope that contains given position sResolutions.CapturedEnvs - |> ResizeArray.iter (fun (possm, env, ad) -> - if rangeContainsPos possm cursorPos then + |> ResizeArray.iter (fun (mPossible, env, ad) -> + if rangeContainsPos mPossible cursorPos then match bestSoFar with | Some (bestm, _, _) -> - if rangeContainsRange bestm possm then - bestSoFar <- Some(possm, env, ad) - | None -> bestSoFar <- Some(possm, env, ad)) + if rangeContainsRange bestm mPossible then + bestSoFar <- Some(mPossible, env, ad) + | None -> bestSoFar <- Some(mPossible, env, ad)) let mostDeeplyNestedEnclosingScope = bestSoFar @@ -370,12 +370,12 @@ type internal TypeCheckInfo let mutable bestAlmostIncludedSoFar = None sResolutions.CapturedEnvs - |> ResizeArray.iter (fun (possm, env, ad) -> + |> ResizeArray.iter (fun (mPossible, env, ad) -> // take only ranges that strictly do not include cursorPos (all ranges that touch cursorPos were processed during 'Strict Inclusion' part) - if rangeBeforePos possm cursorPos && not (posEq possm.End cursorPos) then + if rangeBeforePos mPossible cursorPos && not (posEq mPossible.End cursorPos) then let contained = match mostDeeplyNestedEnclosingScope with - | Some (bestm, _, _) -> rangeContainsRange bestm possm + | Some (bestm, _, _) -> rangeContainsRange bestm mPossible | None -> true if contained then diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 261d6ec094f..d2621715b10 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -241,10 +241,10 @@ and [] ItemKeyStoreBuilder() = writeString anonInfo.ILTypeRef.BasicQualifiedName tinst |> List.iter (writeType false) - | TType_fun (d, r, _) -> + | TType_fun (domainTy, rangeTy, _) -> writeString ItemKeyTags.typeFunction - writeType false d - writeType false r + writeType false domainTy + writeType false rangeTy | TType_measure ms -> if isStandalone then @@ -265,7 +265,7 @@ and [] ItemKeyStoreBuilder() = | Measure.Var typar -> writeString ItemKeyTags.typeMeasureVar writeTypar isStandalone typar - | Measure.Con tcref -> + | Measure.Const tcref -> writeString ItemKeyTags.typeMeasureCon writeEntityRef tcref | _ -> () diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index bdbc73d783a..fc4f9d21b75 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -152,8 +152,8 @@ module TcResolutionsExtensions = protectAssemblyExplorationNoReraise false false (fun () -> ExistsHeadTypeInEntireHierarchy g amap range0 vref.Type g.tcref_System_IDisposable) - let isStructTyconRef (tyconRef: TyconRef) = - let ty = generalizedTyconRef g tyconRef + let isStructTyconRef (tcref: TyconRef) = + let ty = generalizedTyconRef g tcref let underlyingTy = stripTyEqnsAndMeasureEqns g ty isStructTy g underlyingTy diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 82fc0afae36..30d024d646a 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -197,15 +197,15 @@ module DeclarationListHelpers = | Item.ActivePatternCase apref -> let v = apref.ActivePatternVal // Format the type parameters to get e.g. ('a -> 'a) rather than ('?1234 -> '?1234) - let tau = v.TauType + let vTauTy = v.TauType // REVIEW: use _cxs here - let (prettyTyparInst, ptau), _cxs = PrettyTypes.PrettifyInstAndType denv.g (item.TyparInstantiation, tau) + let (prettyTyparInst, prettyTy), _cxs = PrettyTypes.PrettifyInstAndType denv.g (item.TyparInstantiation, vTauTy) let remarks = OutputFullName displayFullName pubpathOfValRef fullDisplayTextOfValRefAsLayout v let layout = wordL (tagText (FSComp.SR.typeInfoActiveRecognizer())) ^^ wordL (tagActivePatternCase apref.Name |> mkNav v.DefinitionRange) ^^ RightL.colon ^^ - NicePrint.layoutType denv ptau + NicePrint.layoutType denv prettyTy let tpsL = FormatTyparMapping denv prettyTyparInst @@ -292,7 +292,7 @@ module DeclarationListHelpers = // .NET events | Item.Event einfo -> - let eventTy = PropTypOfEventInfo infoReader m AccessibleFromSomewhere einfo + let eventTy = PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo let eventTy, _cxs = PrettyTypes.PrettifyType g eventTy let layout = wordL (tagText (FSComp.SR.typeInfoEvent())) ^^ @@ -353,11 +353,11 @@ module DeclarationListHelpers = ToolTipElement.Single(layout, xml) // The 'fake' representation of constructors of .NET delegate types - | Item.DelegateCtor delty -> - let delty, _cxs = PrettyTypes.PrettifyType g delty - let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delty m AccessibleFromSomewhere + | Item.DelegateCtor delTy -> + let delTy, _cxs = PrettyTypes.PrettifyType g delTy + let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delTy m AccessibleFromSomewhere let layout = - NicePrint.layoutTyconRef denv (tcrefOfAppTy g delty) ^^ + NicePrint.layoutTyconRef denv (tcrefOfAppTy g delTy) ^^ LeftL.leftParen ^^ NicePrint.layoutType denv delFuncTy ^^ RightL.rightParen @@ -484,16 +484,16 @@ type MethodGroupItemParameter(name: string, canonicalTypeTextForSorting: string, module internal DescriptionListsImpl = let isFunction g ty = - let _, tau = tryDestForallTy g ty - isFunTy g tau + let _, tauTy = tryDestForallTy g ty + isFunTy g tauTy - let printCanonicalizedTypeName g (denv:DisplayEnv) tau = + let printCanonicalizedTypeName g (denv:DisplayEnv) tauTy = // get rid of F# abbreviations and such - let strippedType = stripTyEqnsWrtErasure EraseAll g tau + let strippedTy = stripTyEqnsWrtErasure EraseAll g tauTy // 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 strippedType + NicePrint.stringOfTy denv strippedTy let PrettyParamOfRecdField g denv (f: RecdField) = let display = NicePrint.prettyLayoutOfType denv f.FormalType @@ -566,12 +566,12 @@ module internal DescriptionListsImpl = // Remake the params using the prettified versions let prettyParams = - (paramInfo, prettyParamTys, prettyParamTysL) |||> List.map3 (fun (nm, isOptArg, paramPrefix) tau tyL -> + (paramInfo, prettyParamTys, prettyParamTysL) |||> List.map3 (fun (nm, isOptArg, paramPrefix) tauTy tyL -> let display = paramPrefix ^^ tyL let display = toArray display MethodGroupItemParameter( name = nm, - canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tau, + canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tauTy, display = display, isOptional=isOptArg )) @@ -587,11 +587,11 @@ module internal DescriptionListsImpl = // Remake the params using the prettified versions let parameters = (prettyParamTys, prettyParamTysL) - ||> List.map2 (fun tau tyL -> + ||> List.map2 (fun paramTy tyL -> let display = toArray tyL MethodGroupItemParameter( name = "", - canonicalTypeTextForSorting = printCanonicalizedTypeName g denv tau, + canonicalTypeTextForSorting = printCanonicalizedTypeName g denv paramTy, display = display, isOptional=false )) @@ -635,17 +635,18 @@ module internal DescriptionListsImpl = let denv = { SimplerDisplayEnv denv with useColonForReturnType=true} match item.Item with | Item.Value vref -> + let getPrettyParamsOfTypes() = - let tau = vref.TauType - match tryDestFunTy denv.g tau with - | ValueSome(arg, rtau) -> + let vTauTy = vref.TauType + match tryDestFunTy denv.g vTauTy with + | ValueSome(arg, retTy) -> let args = tryDestRefTupleTy denv.g arg - let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfTypes g denv item.TyparInstantiation args rtau + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfTypes g denv item.TyparInstantiation args retTy // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group prettyParams, prettyRetTyL | _ -> - let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] tau + let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] vTauTy [], prettyTyL match vref.ValReprInfo with @@ -675,7 +676,7 @@ module internal DescriptionListsImpl = // Adjust the return type so it only strips the first argument let curriedRetTy = match tryDestFunTy denv.g vref.TauType with - | ValueSome(_, rtau) -> rtau + | ValueSome(_, retTy) -> retTy | _ -> lastRetTy let _prettyTyparInst, prettyFirstCurriedParams, prettyCurriedRetTyL, prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation firstCurriedParamDatas curriedRetTy @@ -695,8 +696,8 @@ module internal DescriptionListsImpl = | Item.ActivePatternCase(apref) -> let v = apref.ActivePatternVal - let tau = v.TauType - let args, resTy = stripFunTy denv.g tau + let vTauTy = v.TauType + let args, resTy = stripFunTy denv.g vTauTy let apinfo = Option.get (TryGetActivePatternInfo v) let aparity = apinfo.Names.Length @@ -726,7 +727,7 @@ module internal DescriptionListsImpl = [], prettyRetTyL | Item.Event einfo -> - let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypOfEventInfo infoReader m AccessibleFromSomewhere einfo) + let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] (PropTypeOfEventInfo infoReader m AccessibleFromSomewhere einfo) [], prettyRetTyL | Item.Property(_, pinfo :: _) -> @@ -775,11 +776,11 @@ module internal DescriptionListsImpl = let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInstantiation [] ty [], prettyRetTyL - | Item.DelegateCtor delty -> - let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delty m AccessibleFromSomewhere + | Item.DelegateCtor delTy -> + let (SigOfFunctionForDelegate(_, _, _, delFuncTy)) = GetSigOfFunctionForDelegate infoReader delTy m AccessibleFromSomewhere // No need to pass more generic type information in here since the instanitations have already been applied - let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation [ParamData(false, false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, delFuncTy)] delty + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation [ParamData(false, false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, delFuncTy)] delTy // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 68b7eb268f9..0751225c890 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -121,8 +121,8 @@ module NavigationImpl = |> List.fold (fun st (SynField (_, _, _, _, _, _, _, m)) -> unionRangesChecked m st) range.Zero | SynUnionCaseKind.FullType (ty, _) -> ty.Range - let bodyRange mb decls = - unionRangesChecked (rangeOfDecls decls) mb + let bodyRange mBody decls = + unionRangesChecked (rangeOfDecls decls) mBody /// Get information for implementation file let getNavigationFromImplFile (modules: SynModuleOrNamespace list) = @@ -143,18 +143,18 @@ module NavigationImpl = sprintf "%s_%d_of_%d" name idx total // Create declaration (for the left dropdown) - let createDeclLid (baseName, lid, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = + let createDeclLid (baseName, lid, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = let name = (if baseName <> "" then baseName + "." else "") + textOfLid lid - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, false, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, false, access) item, addItemName name, nested - let createDecl (baseName, id: Ident, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, isAbstract, access) = + let createDecl (baseName, id: Ident, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, isAbstract, access) = let name = (if baseName <> "" then baseName + "." else "") + id.idText - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, isAbstract, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, isAbstract, access) item, addItemName name, nested - let createTypeDecl (baseName, lid, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = - createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, bodym, nested, enclosingEntityKind, access) + let createTypeDecl (baseName, lid, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = + createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, mBody, nested, enclosingEntityKind, access) // Create member-kind-of-thing for the right dropdown let createMemberLid (lid, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = @@ -226,10 +226,10 @@ module NavigationImpl = let rec processExnDefnRepr baseName nested synExnRepr = let (SynExceptionDefnRepr (_, ucase, _, _, access, m)) = synExnRepr let (SynUnionCase (ident = SynIdent (id, _); caseType = fldspec)) = ucase - let bodym = fldspecRange fldspec + let mBody = fldspecRange fldspec [ - createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, bodym, nested, NavigationEntityKind.Exception, false, access) + createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, mBody, nested, NavigationEntityKind.Exception, false, access) ] // Process a class declaration or F# type declaration @@ -247,35 +247,35 @@ module NavigationImpl = match repr with | SynTypeDefnRepr.Exception repr -> processExnDefnRepr baseName [] repr - | SynTypeDefnRepr.ObjectModel (_, membDefns, mb) -> + | SynTypeDefnRepr.ObjectModel (_, membDefns, mBody) -> // F# class declaration let members = processMembers membDefns NavigationEntityKind.Class |> snd let nested = members @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Class, m, bodym, nested, NavigationEntityKind.Class, access) + createTypeDecl (baseName, lid, FSharpGlyph.Class, m, mBody, nested, NavigationEntityKind.Class, access) ] | SynTypeDefnRepr.Simple (simple, _) -> // F# type declaration match simple with - | SynTypeDefnSimpleRepr.Union (_, cases, mb) -> + | SynTypeDefnSimpleRepr.Union (_, cases, mBody) -> let cases = [ for SynUnionCase (ident = SynIdent (id, _); caseType = fldspec) in cases -> - let bodym = unionRanges (fldspecRange fldspec) id.idRange - createMember (id, NavigationItemKind.Other, FSharpGlyph.Struct, bodym, NavigationEntityKind.Union, false, access) + let mBody = unionRanges (fldspecRange fldspec) id.idRange + createMember (id, NavigationItemKind.Other, FSharpGlyph.Struct, mBody, NavigationEntityKind.Union, false, access) ] let nested = cases @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Union, m, bodym, nested, NavigationEntityKind.Union, access) + createTypeDecl (baseName, lid, FSharpGlyph.Union, m, mBody, nested, NavigationEntityKind.Union, access) ] - | SynTypeDefnSimpleRepr.Enum (cases, mb) -> + | SynTypeDefnSimpleRepr.Enum (cases, mBody) -> let cases = [ for SynEnumCase (ident = SynIdent (id, _); range = m) in cases -> @@ -283,13 +283,13 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, bodym, nested, NavigationEntityKind.Enum, access) + createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, mBody, nested, NavigationEntityKind.Enum, access) ] - | SynTypeDefnSimpleRepr.Record (_, fields, mb) -> + | SynTypeDefnSimpleRepr.Record (_, fields, mBody) -> let fields = [ for SynField (_, _, id, _, _, _, _, m) in fields do @@ -299,17 +299,17 @@ module NavigationImpl = ] let nested = fields @ topMembers - let bodym = bodyRange mb nested + let mBody = bodyRange mBody nested [ - createTypeDecl (baseName, lid, FSharpGlyph.Type, m, bodym, nested, NavigationEntityKind.Record, access) + createTypeDecl (baseName, lid, FSharpGlyph.Type, m, mBody, nested, NavigationEntityKind.Record, access) ] - | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mb) -> - let bodym = bodyRange mb topMembers + | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mBody) -> + let mBody = bodyRange mBody topMembers [ - createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, bodym, topMembers, NavigationEntityKind.Class, access) + createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, mBody, topMembers, NavigationEntityKind.Class, access) ] //| SynTypeDefnSimpleRepr.General of TyconKind * (SynType * Range * ident option) list * (valSpfn * MemberFlags) list * fieldDecls * bool * bool * Range @@ -371,8 +371,8 @@ module NavigationImpl = for decl in decls do match decl with | SynModuleDecl.ModuleAbbrev (id, lid, m) -> - let bodym = rangeOfLid lid - createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, [], NavigationEntityKind.Namespace, false, None) + let mBody = rangeOfLid lid + createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Namespace, false, None) | SynModuleDecl.NestedModule (moduleInfo = SynComponentInfo (longId = lid; accessibility = access); decls = decls; range = m) -> // Find let bindings (for the right dropdown) @@ -380,8 +380,8 @@ module NavigationImpl = let newBaseName = (if (baseName = "") then "" else baseName + ".") + (textOfLid lid) let other = processNavigationTopLevelDeclarations (newBaseName, decls) - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) - createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, nested, NavigationEntityKind.Module, access) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) + createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, nested, NavigationEntityKind.Module, access) // Get nested modules and types (for the left dropdown) yield! other @@ -414,11 +414,11 @@ module NavigationImpl = else NavigationItemKind.Namespace - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) let nm = textOfLid id let item = - NavigationItem.Create(nm, kind, FSharpGlyph.Module, m, bodym, singleTopLevel, NavigationEntityKind.Module, false, access) + NavigationItem.Create(nm, kind, FSharpGlyph.Module, m, mBody, singleTopLevel, NavigationEntityKind.Module, false, access) let decl = (item, addItemName (nm), nested) decl @@ -462,17 +462,17 @@ module NavigationImpl = sprintf "%s_%d_of_%d" name idx total // Create declaration (for the left dropdown) - let createDeclLid (baseName, lid, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = + let createDeclLid (baseName, lid, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = let name = (if baseName <> "" then baseName + "." else "") + (textOfLid lid) - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, false, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, false, access) item, addItemName name, nested - let createTypeDecl (baseName, lid, baseGlyph, m, bodym, nested, enclosingEntityKind, access) = - createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, bodym, nested, enclosingEntityKind, access) + let createTypeDecl (baseName, lid, baseGlyph, m, mBody, nested, enclosingEntityKind, access) = + createDeclLid (baseName, lid, NavigationItemKind.Type, baseGlyph, m, mBody, nested, enclosingEntityKind, access) - let createDecl (baseName, id: Ident, kind, baseGlyph, m, bodym, nested, enclosingEntityKind, isAbstract, access) = + let createDecl (baseName, id: Ident, kind, baseGlyph, m, mBody, nested, enclosingEntityKind, isAbstract, access) = let name = (if baseName <> "" then baseName + "." else "") + id.idText - let item = NavigationItem.Create(name, kind, baseGlyph, m, bodym, false, enclosingEntityKind, isAbstract, access) + let item = NavigationItem.Create(name, kind, baseGlyph, m, mBody, false, enclosingEntityKind, isAbstract, access) item, addItemName name, nested let createMember (id: Ident, kind, baseGlyph, m, enclosingEntityKind, isAbstract, access) = @@ -481,10 +481,10 @@ module NavigationImpl = let rec processExnRepr baseName nested inp = let (SynExceptionDefnRepr (_, SynUnionCase (ident = SynIdent (id, _); caseType = fldspec), _, _, access, m)) = inp - let bodym = fldspecRange fldspec + let mBody = fldspecRange fldspec [ - createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, bodym, nested, NavigationEntityKind.Exception, false, access) + createDecl (baseName, id, NavigationItemKind.Exception, FSharpGlyph.Exception, m, mBody, nested, NavigationEntityKind.Exception, false, access) ] and processExnSig baseName inp = @@ -501,16 +501,16 @@ module NavigationImpl = [ match repr with | SynTypeDefnSigRepr.Exception repr -> yield! processExnRepr baseName [] repr - | SynTypeDefnSigRepr.ObjectModel (_, membDefns, mb) -> + | SynTypeDefnSigRepr.ObjectModel (_, membDefns, mBody) -> // F# class declaration let members = processSigMembers membDefns let nested = members @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Class, m, bodym, nested, NavigationEntityKind.Class, access) + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Class, m, mBody, nested, NavigationEntityKind.Class, access) | SynTypeDefnSigRepr.Simple (simple, _) -> // F# type declaration match simple with - | SynTypeDefnSimpleRepr.Union (_, cases, mb) -> + | SynTypeDefnSimpleRepr.Union (_, cases, mBody) -> let cases = [ for SynUnionCase (ident = SynIdent (id, _); caseType = fldspec) in cases -> @@ -519,9 +519,9 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Union, m, bodym, nested, NavigationEntityKind.Union, access) - | SynTypeDefnSimpleRepr.Enum (cases, mb) -> + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Union, m, mBody, nested, NavigationEntityKind.Union, access) + | SynTypeDefnSimpleRepr.Enum (cases, mBody) -> let cases = [ for SynEnumCase (ident = SynIdent (id, _); range = m) in cases -> @@ -529,9 +529,9 @@ module NavigationImpl = ] let nested = cases @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, bodym, nested, NavigationEntityKind.Enum, access) - | SynTypeDefnSimpleRepr.Record (_, fields, mb) -> + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Enum, m, mBody, nested, NavigationEntityKind.Enum, access) + | SynTypeDefnSimpleRepr.Record (_, fields, mBody) -> let fields = [ for SynField (_, _, id, _, _, _, _, m) in fields do @@ -541,11 +541,11 @@ module NavigationImpl = ] let nested = fields @ topMembers - let bodym = bodyRange mb nested - createTypeDecl (baseName, lid, FSharpGlyph.Type, m, bodym, nested, NavigationEntityKind.Record, access) - | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mb) -> - let bodym = bodyRange mb topMembers - createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, bodym, topMembers, NavigationEntityKind.Class, access) + let mBody = bodyRange mBody nested + createTypeDecl (baseName, lid, FSharpGlyph.Type, m, mBody, nested, NavigationEntityKind.Record, access) + | SynTypeDefnSimpleRepr.TypeAbbrev (_, _, mBody) -> + let mBody = bodyRange mBody topMembers + createTypeDecl (baseName, lid, FSharpGlyph.Typedef, m, mBody, topMembers, NavigationEntityKind.Class, access) //| SynTypeDefnSimpleRepr.General of TyconKind * (SynType * range * ident option) list * (valSpfn * MemberFlags) list * fieldDecls * bool * bool * range //| SynTypeDefnSimpleRepr.LibraryOnlyILAssembly of ILType * range @@ -581,8 +581,8 @@ module NavigationImpl = for decl in decls do match decl with | SynModuleSigDecl.ModuleAbbrev (id, lid, m) -> - let bodym = rangeOfLid lid - createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, [], NavigationEntityKind.Module, false, None) + let mBody = rangeOfLid lid + createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Module, false, None) | SynModuleSigDecl.NestedModule (moduleInfo = SynComponentInfo (longId = lid; accessibility = access); moduleDecls = decls; range = m) -> // Find let bindings (for the right dropdown) @@ -591,8 +591,8 @@ module NavigationImpl = let other = processNavigationTopLevelSigDeclarations (newBaseName, decls) // Get nested modules and types (for the left dropdown) - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) - createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, bodym, nested, NavigationEntityKind.Module, access) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid lid) other) + createDeclLid (baseName, lid, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, nested, NavigationEntityKind.Module, access) yield! other | SynModuleSigDecl.Types (tydefs, _) -> @@ -623,10 +623,10 @@ module NavigationImpl = else NavigationItemKind.Namespace - let bodym = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) + let mBody = unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other) let item = - NavigationItem.Create(textOfLid id, kind, FSharpGlyph.Module, m, bodym, singleTopLevel, NavigationEntityKind.Module, false, access) + NavigationItem.Create(textOfLid id, kind, FSharpGlyph.Module, m, mBody, singleTopLevel, NavigationEntityKind.Module, false, access) let decl = (item, addItemName (textOfLid id), nested) decl diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index ff34dd392d4..b757120b628 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -73,8 +73,8 @@ module internal ParameterLocationsImpl = match synExpr with | SynExpr.Ident id -> Some([ id.idText ], id.idRange) | SynExpr.LongIdent (_, SynLongIdent ([ id ], [], [ Some _ ]), _, _) -> Some([ id.idText ], id.idRange) - | SynExpr.LongIdent (_, SynLongIdent (lid, _, _), _, lidRange) - | SynExpr.DotGet (_, _, SynLongIdent (lid, _, _), lidRange) -> Some(pathOfLid lid, lidRange) + | SynExpr.LongIdent (_, SynLongIdent (lid, _, _), _, mLongId) + | SynExpr.DotGet (_, _, SynLongIdent (lid, _, _), mLongId) -> Some(pathOfLid lid, mLongId) | SynExpr.TypeApp (synExpr, _, _synTypeList, _commas, _, _, _range) -> digOutIdentFromFuncExpr synExpr | SynExpr.Paren (expr = expr) -> digOutIdentFromFuncExpr expr | _ -> None @@ -213,14 +213,14 @@ module internal ParameterLocationsImpl = let (|StaticParameters|_|) pos (StripParenTypes synType) = match synType with | SynType.App (StripParenTypes (SynType.LongIdent (SynLongIdent (lid, _, _) as lidwd)), - Some (openm), + Some mLess, args, commas, - closemOpt, + mGreaterOpt, _pf, wholem) -> let lidm = lidwd.Range - let betweenTheBrackets = mkRange wholem.FileName openm.Start wholem.End + let betweenTheBrackets = mkRange wholem.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive betweenTheBrackets pos @@ -232,10 +232,10 @@ module internal ParameterLocationsImpl = ParameterLocations( pathOfLid lid, lidm, - openm.Start, + mLess.Start, [], commasAndCloseParen, - closemOpt.IsSome, + mGreaterOpt.IsSome, args |> List.map digOutIdentFromStaticArg ) ) @@ -281,7 +281,7 @@ module internal ParameterLocationsImpl = // EXPR< = error recovery of a form of half-written TypeApp | SynExpr.App (_, _, - SynExpr.App (_, true, SynExpr.LongIdent(longDotId = SynLongIdent(id = [ op ])), synExpr, openm), + SynExpr.App (_, true, SynExpr.LongIdent(longDotId = SynLongIdent(id = [ op ])), synExpr, mLess), SynExpr.ArbitraryAfterError _, wholem) when op.idText = "op_LessThan" -> // Look in the function expression @@ -290,13 +290,13 @@ module internal ParameterLocationsImpl = match fResult with | Some _ -> fResult | _ -> - let typeArgsm = mkRange openm.FileName openm.Start wholem.End + let typeArgsm = mkRange mLess.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos then // We found it, dig out ident match digOutIdentFromFuncExpr synExpr with - | Some (lid, lidRange) -> - Some(ParameterLocations(lid, lidRange, op.idRange.Start, [], [ wholem.End ], false, [])) + | Some (lid, mLongId) -> + Some(ParameterLocations(lid, mLongId, op.idRange.Start, [], [ wholem.End ], false, [])) | None -> None else None @@ -316,8 +316,8 @@ module internal ParameterLocationsImpl = | Found (parenLoc, argRanges, commasAndCloseParen, isThereACloseParen), _ -> // We found it, dig out ident match digOutIdentFromFuncExpr synExpr with - | Some (lid, lidRange) -> - assert (isInfix = (posLt parenLoc lidRange.End)) + | Some (lid, mLongId) -> + assert (isInfix = (posLt parenLoc mLongId.End)) if isInfix then // This seems to be an infix operator, since the start of the argument is a position earlier than the end of the long-id being applied to it. @@ -327,7 +327,7 @@ module internal ParameterLocationsImpl = Some( ParameterLocations( lid, - lidRange, + mLongId, parenLoc, argRanges, commasAndCloseParen |> List.map fst, @@ -340,11 +340,11 @@ module internal ParameterLocationsImpl = | _ -> traverseSynExpr synExpr2 // ID and error recovery of these - | SynExpr.TypeApp (synExpr, openm, tyArgs, commas, closemOpt, _, wholem) -> + | SynExpr.TypeApp (synExpr, mLess, tyArgs, commas, mGreaterOpt, _, wholem) -> match traverseSynExpr synExpr with | Some _ as r -> r | None -> - let typeArgsm = mkRange openm.FileName openm.Start wholem.End + let typeArgsm = mkRange mLess.FileName mLess.Start wholem.End if SyntaxTraversal.rangeContainsPosEdgesExclusive typeArgsm pos @@ -364,10 +364,10 @@ module internal ParameterLocationsImpl = ParameterLocations( [ "dummy" ], synExpr.Range, - openm.Start, + mLess.Start, argRanges, commasAndCloseParen, - closemOpt.IsSome, + mGreaterOpt.IsSome, tyArgs |> List.map digOutIdentFromStaticArg ) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 757cd90a264..a7ffb760e5a 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -476,8 +476,8 @@ module ParsedInput = ] |> pick expr - | SynExpr.DotGet (exprLeft, dotm, lidwd, _m) -> - let afterDotBeforeLid = mkRange dotm.FileName dotm.End lidwd.Range.Start + | SynExpr.DotGet (exprLeft, mDot, lidwd, _m) -> + let afterDotBeforeLid = mkRange mDot.FileName mDot.End lidwd.Range.Start [ dive exprLeft exprLeft.Range traverseSynExpr diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index 995e4e4d3e9..cbc625f709b 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -364,30 +364,30 @@ module Structure = members = ms extraImpls = extraImpls newExprRange = newRange - range = wholeRange) -> + range = mWhole) -> let bindings = unionBindingAndMembers bindings ms match argOpt with | Some (args, _) -> - let collapse = Range.endToEnd args.Range wholeRange - rcheck Scope.ObjExpr Collapse.Below wholeRange collapse + let collapse = Range.endToEnd args.Range mWhole + rcheck Scope.ObjExpr Collapse.Below mWhole collapse | None -> - let collapse = Range.endToEnd newRange wholeRange - rcheck Scope.ObjExpr Collapse.Below wholeRange collapse + let collapse = Range.endToEnd newRange mWhole + rcheck Scope.ObjExpr Collapse.Below mWhole collapse parseBindings bindings parseExprInterfaces extraImpls - | SynExpr.TryWith (e, matchClauses, wholeRange, tryPoint, withPoint, _trivia) -> + | SynExpr.TryWith (e, matchClauses, mWhole, tryPoint, withPoint, _trivia) -> match tryPoint, withPoint with | DebugPointAtTry.Yes tryRange, DebugPointAtWith.Yes withRange -> - let fullrange = Range.startToEnd tryRange wholeRange - let collapse = Range.endToEnd tryRange wholeRange + let mFull = Range.startToEnd tryRange mWhole + let collapse = Range.endToEnd tryRange mWhole let collapseTry = Range.endToStart tryRange withRange let fullrangeTry = Range.startToStart tryRange withRange - let collapseWith = Range.endToEnd withRange wholeRange - let fullrangeWith = Range.startToEnd withRange wholeRange - rcheck Scope.TryWith Collapse.Below fullrange collapse + let collapseWith = Range.endToEnd withRange mWhole + let fullrangeWith = Range.startToEnd withRange mWhole + rcheck Scope.TryWith Collapse.Below mFull collapse rcheck Scope.TryInTryWith Collapse.Below fullrangeTry collapseTry rcheck Scope.WithInTryWith Collapse.Below fullrangeWith collapseWith | _ -> () @@ -399,10 +399,10 @@ module Structure = match tryPoint, finallyPoint with | DebugPointAtTry.Yes tryRange, DebugPointAtFinally.Yes finallyRange -> let collapse = Range.endToEnd tryRange finallyExpr.Range - let fullrange = Range.startToEnd tryRange finallyExpr.Range + let mFull = Range.startToEnd tryRange finallyExpr.Range let collapseFinally = Range.endToEnd finallyRange r let fullrangeFinally = Range.startToEnd finallyRange r - rcheck Scope.TryFinally Collapse.Below fullrange collapse + rcheck Scope.TryFinally Collapse.Below mFull collapse rcheck Scope.FinallyInTryFinally Collapse.Below fullrangeFinally collapseFinally | _ -> () @@ -418,9 +418,9 @@ module Structure = match spIfToThen with | DebugPointAtBinding.Yes rt -> // Outline the entire IfThenElse - let fullrange = Range.startToEnd rt r + let mFull = Range.startToEnd rt r let collapse = Range.endToEnd ifExpr.Range r - rcheck Scope.IfThenElse Collapse.Below fullrange collapse + rcheck Scope.IfThenElse Collapse.Below mFull collapse // Outline the `then` scope let thenRange = Range.endToEnd (Range.modEnd -4 trivia.IfToThenRange) thenExpr.Range let thenCollapse = Range.endToEnd trivia.IfToThenRange thenExpr.Range @@ -653,24 +653,24 @@ module Structure = | _ -> () and parseTypeDefn typeDefn = - let (SynTypeDefn (typeInfo = typeInfo; typeRepr = objectModel; members = members; range = fullrange)) = + let (SynTypeDefn (typeInfo = typeInfo; typeRepr = objectModel; members = members; range = mFull)) = typeDefn let (SynComponentInfo (typeParams = TyparDecls typeArgs; range = r)) = typeInfo let typeArgsRange = rangeOfTypeArgsElse r typeArgs - let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) fullrange + let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) mFull match objectModel with | SynTypeDefnRepr.ObjectModel (defnKind, objMembers, r) -> match defnKind with - | SynTypeDefnKind.Augmentation _ -> rcheck Scope.TypeExtension Collapse.Below fullrange collapse - | _ -> rcheck Scope.Type Collapse.Below fullrange collapse + | SynTypeDefnKind.Augmentation _ -> rcheck Scope.TypeExtension Collapse.Below mFull collapse + | _ -> rcheck Scope.Type Collapse.Below mFull collapse List.iter (parseSynMemberDefn r) objMembers // visit the members of a type extension List.iter (parseSynMemberDefn r) members | SynTypeDefnRepr.Simple (simpleRepr, r) -> - rcheck Scope.Type Collapse.Below fullrange collapse + rcheck Scope.Type Collapse.Below mFull collapse parseSimpleRepr simpleRepr List.iter (parseSynMemberDefn r) members | SynTypeDefnRepr.Exception _ -> () @@ -774,12 +774,12 @@ module Structure = let parseModuleOrNamespace (SynModuleOrNamespace (longId, _, kind, decls, _, attribs, _, r, _)) = parseAttributes attribs let idRange = longIdentRange longId - let fullrange = Range.startToEnd idRange r + let mFull = Range.startToEnd idRange r let collapse = Range.endToEnd idRange r // do not return range for top level implicit module in scripts if kind = SynModuleOrNamespaceKind.NamedModule then - rcheck Scope.Module Collapse.Below fullrange collapse + rcheck Scope.Module Collapse.Below mFull collapse collectHashDirectives decls collectOpens decls @@ -893,9 +893,9 @@ module Structure = | SynMemberSig.Member (valSigs, _, r) -> let collapse = Range.endToEnd valSigs.RangeOfId r rcheck Scope.Member Collapse.Below r collapse - | SynMemberSig.ValField (SynField (attrs, _, _, _, _, _, _, fr), fullrange) -> - let collapse = Range.endToEnd fr fullrange - rcheck Scope.Val Collapse.Below fullrange collapse + | SynMemberSig.ValField (SynField (attrs, _, _, _, _, _, _, fr), mFull) -> + let collapse = Range.endToEnd fr mFull + rcheck Scope.Val Collapse.Below mFull collapse parseAttributes attrs | SynMemberSig.Interface (tp, r) -> rcheck Scope.Interface Collapse.Below r (Range.endToEnd tp.Range r) | SynMemberSig.NestedType (typeDefSig, _r) -> parseTypeDefnSig typeDefSig @@ -913,8 +913,8 @@ module Structure = let typeArgsRange = rangeOfTypeArgsElse r typeArgs let rangeEnd = lastMemberSigRangeElse r memberSigs let collapse = Range.endToEnd (Range.modEnd 1 typeArgsRange) rangeEnd - let fullrange = Range.startToEnd (longIdentRange longId) rangeEnd - fullrange, collapse + let mFull = Range.startToEnd (longIdentRange longId) rangeEnd + mFull, collapse List.iter parseSynMemberDefnSig memberSigs @@ -922,23 +922,23 @@ module Structure = // matches against a type declaration with <'T, ...> and (args, ...) | SynTypeDefnSigRepr.ObjectModel (SynTypeDefnKind.Unspecified, objMembers, _) -> List.iter parseSynMemberDefnSig objMembers - let fullrange, collapse = makeRanges objMembers - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.Type Collapse.Below mFull collapse | SynTypeDefnSigRepr.ObjectModel (kind = SynTypeDefnKind.Augmentation _; memberSigs = objMembers) -> - let fullrange, collapse = makeRanges objMembers - rcheck Scope.TypeExtension Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.TypeExtension Collapse.Below mFull collapse List.iter parseSynMemberDefnSig objMembers | SynTypeDefnSigRepr.ObjectModel (_, objMembers, _) -> - let fullrange, collapse = makeRanges objMembers - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges objMembers + rcheck Scope.Type Collapse.Below mFull collapse List.iter parseSynMemberDefnSig objMembers // visit the members of a type extension | SynTypeDefnSigRepr.Simple (simpleRepr, _) -> - let fullrange, collapse = makeRanges memberSigs - rcheck Scope.Type Collapse.Below fullrange collapse + let mFull, collapse = makeRanges memberSigs + rcheck Scope.Type Collapse.Below mFull collapse parseSimpleRepr simpleRepr | SynTypeDefnSigRepr.Exception _ -> () @@ -1021,8 +1021,8 @@ module Structure = let rangeEnd = lastModuleSigDeclRangeElse moduleRange decls // Outline the full scope of the module let collapse = Range.endToEnd cmpRange rangeEnd - let fullrange = Range.startToEnd moduleRange rangeEnd - rcheck Scope.Module Collapse.Below fullrange collapse + let mFull = Range.startToEnd moduleRange rangeEnd + rcheck Scope.Module Collapse.Below mFull collapse // A module's component info stores the ranges of its attributes parseAttributes attrs collectSigOpens decls @@ -1034,11 +1034,11 @@ module Structure = parseAttributes attribs let rangeEnd = lastModuleSigDeclRangeElse r decls let idrange = longIdentRange longId - let fullrange = Range.startToEnd idrange rangeEnd + let mFull = Range.startToEnd idrange rangeEnd let collapse = Range.endToEnd idrange rangeEnd if kind.IsModule then - rcheck Scope.Module Collapse.Below fullrange collapse + rcheck Scope.Module Collapse.Below mFull collapse collectSigHashDirectives decls collectSigOpens decls diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 24ffc3cb042..0de02d99948 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -348,12 +348,12 @@ module FSharpExprConvert = | TOp.UnionCaseFieldGetAddr (uref, n, _), [arg], _ -> mkUnionCaseFieldGetProvenViaExprAddr (exprOfExprAddr cenv arg, uref, tyargs, n, m) | TOp.ILAsm ([ I_ldflda fspec ], retTypes), [arg], _ -> mkAsmExpr ([ mkNormalLdfld fspec ], tyargs, [exprOfExprAddr cenv arg], retTypes, m) | TOp.ILAsm ([ I_ldsflda fspec ], retTypes), _, _ -> mkAsmExpr ([ mkNormalLdsfld fspec ], tyargs, args, retTypes, m) - | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemty] -> + | TOp.ILAsm ([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ], _), arr :: idxs, [elemTy] -> match shape.Rank, idxs with - | 1, [idx1] -> mkCallArrayGet g m elemty arr idx1 - | 2, [idx1; idx2] -> mkCallArray2DGet g m elemty arr idx1 idx2 - | 3, [idx1; idx2; idx3] -> mkCallArray3DGet g m elemty arr idx1 idx2 idx3 - | 4, [idx1; idx2; idx3; idx4] -> mkCallArray4DGet g m elemty arr idx1 idx2 idx3 idx4 + | 1, [idx1] -> mkCallArrayGet g m elemTy arr idx1 + | 2, [idx1; idx2] -> mkCallArray2DGet g m elemTy arr idx1 idx2 + | 3, [idx1; idx2; idx3] -> mkCallArray3DGet g m elemTy arr idx1 idx2 idx3 + | 4, [idx1; idx2; idx3; idx4] -> mkCallArray4DGet g m elemTy arr idx1 idx2 idx3 idx4 | _ -> expr | _ -> expr | _ -> expr @@ -618,7 +618,7 @@ module FSharpExprConvert = let bodyR = ConvExpr cenv env body FSharpObjectExprOverride(sgn, tpsR, vslR, bodyR) ] let overridesR = ConvertMethods overrides - let iimplsR = List.map (fun (ity, impls) -> ConvType cenv ity, ConvertMethods impls) iimpls + let iimplsR = iimpls |> List.map (fun (intfTy, impls) -> ConvType cenv intfTy, ConvertMethods impls) E.ObjectExpr(ConvType cenv ty, basecallR, overridesR, iimplsR) @@ -702,8 +702,8 @@ module FSharpExprConvert = let argR = ConvExpr cenv env arg E.ILFieldSet(None, typR, fspec.Name, argR) - | TOp.ILAsm ([ ], [tty]), _, [arg] -> - match tty with + | TOp.ILAsm ([ ], [tgtTy]), _, [arg] -> + match tgtTy with | TTypeConvOp cenv convOp -> let ty = tyOfExpr g arg let op = convOp g m ty arg @@ -992,7 +992,7 @@ module FSharpExprConvert = let parent = ILTypeRef.Create(e.Scope, e.Enclosing.Tail, e.Enclosing.Head) Import.ImportILTypeRef cenv.amap m parent, Some e.Name - let enclosingType = generalizedTyconRef g tcref + let enclosingTy = generalizedTyconRef g tcref let makeCall minfo = ConvObjectModelCallLinear cenv env (isNewObj, minfo, enclTypeArgs, methTypeArgs, [], callArgs) id @@ -1000,7 +1000,7 @@ module FSharpExprConvert = let makeFSCall isMember (vr: ValRef) = let memOrVal = if isMember then - let minfo = MethInfo.FSMeth(g, enclosingType, vr, None) + let minfo = MethInfo.FSMeth(g, enclosingTy, vr, None) FSharpMemberOrFunctionOrValue(cenv, minfo) else FSharpMemberOrFunctionOrValue(cenv, vr) @@ -1117,7 +1117,7 @@ module FSharpExprConvert = if tcref.IsILTycon then try let mdef = resolveILMethodRefWithRescope unscopeILType tcref.ILTyconRawMetadata ilMethRef - let minfo = MethInfo.CreateILMeth(cenv.amap, m, enclosingType, mdef) + let minfo = MethInfo.CreateILMeth(cenv.amap, m, enclosingTy, mdef) FSharpMemberOrFunctionOrValue(cenv, minfo) |> makeCall |> Some with _ -> None @@ -1155,12 +1155,12 @@ module FSharpExprConvert = let argTys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadata cenv.amap m scoref tinst1 tinst2) ] let retTy = match ImportReturnTypeFromMetadata cenv.amap m ilMethRef.ReturnType (fun _ -> emptyILCustomAttrs) scoref tinst1 tinst2 with - | None -> if isCtor then enclosingType else g.unit_ty + | None -> if isCtor then enclosingTy else g.unit_ty | Some ty -> ty let linkageType = let ty = mkIteratedFunTy g (List.map (mkRefTupledTy g) argTys) retTy - let ty = if isStatic then ty else mkFunTy g enclosingType ty + let ty = if isStatic then ty else mkFunTy g enclosingTy ty mkForallTyIfNeeded (typars1 @ typars2) ty let argCount = List.sum (List.map List.length argTys) + (if isStatic then 0 else 1) @@ -1325,9 +1325,9 @@ module FSharpExprConvert = let env = { env with suppressWitnesses = true } ConvExpr cenv env eq E.IfThenElse (eqR, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) - | DecisionTreeTest.IsInst (_srcty, tgty) -> + | DecisionTreeTest.IsInst (_srcTy, tgtTy) -> let e1R = ConvExpr cenv env inpExpr - E.IfThenElse (E.TypeTest (ConvType cenv tgty, e1R) |> Mk cenv m g.bool_ty, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) + E.IfThenElse (E.TypeTest (ConvType cenv tgtTy, e1R) |> Mk cenv m g.bool_ty, ConvDecisionTree cenv env dtreeRetTy dtree m, acc) | DecisionTreeTest.ActivePatternCase _ -> wfail("unexpected Test.ActivePatternCase test in quoted expression", m) | DecisionTreeTest.ArrayLength _ -> wfail("FSharp.Compiler.Service cannot yet return array pattern matching", m) | DecisionTreeTest.Error m -> wfail("error recovery", m) diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index f65cd4541cc..c265024fc40 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -631,9 +631,9 @@ module internal SymbolHelpers = match item with | Item.Types(_name, tys) -> match tys with - | [AppTy g (tyconRef, _typeInst)] -> - if tyconRef.IsProvidedErasedTycon || tyconRef.IsProvidedGeneratedTycon then - Some tyconRef + | [AppTy g (tcref, _typeInst)] -> + if tcref.IsProvidedErasedTycon || tcref.IsProvidedGeneratedTycon then + Some tcref else None | _ -> None @@ -644,10 +644,10 @@ module internal SymbolHelpers = match item with | Item.Types(_name, tys) -> match tys with - | [AppTy g (tyconRef, _typeInst)] -> - if tyconRef.IsProvidedErasedTycon || tyconRef.IsProvidedGeneratedTycon then + | [AppTy g (tcref, _typeInst)] -> + if tcref.IsProvidedErasedTycon || tcref.IsProvidedGeneratedTycon then let typeBeforeArguments = - match tyconRef.TypeReprInfo with + match tcref.TypeReprInfo with | TProvidedTypeRepr info -> info.ProvidedType | _ -> failwith "unreachable" let staticParameters = typeBeforeArguments.PApplyWithProvider((fun (typeBeforeArguments, provider) -> typeBeforeArguments.GetStaticParameters provider), range=m) diff --git a/src/Compiler/Symbols/SymbolPatterns.fs b/src/Compiler/Symbols/SymbolPatterns.fs index bddfe60e135..e44375cb97c 100644 --- a/src/Compiler/Symbols/SymbolPatterns.fs +++ b/src/Compiler/Symbols/SymbolPatterns.fs @@ -43,7 +43,7 @@ module FSharpSymbolPatterns = if entity.IsFSharpAbbreviation then match entity.AbbreviatedType with | TypeWithDefinition def -> getEntityAbbreviatedType def - | abbreviatedType -> entity, Some abbreviatedType + | abbreviatedTy -> entity, Some abbreviatedTy else entity, None let (|Attribute|_|) (entity: FSharpEntity) = @@ -151,12 +151,12 @@ module FSharpSymbolPatterns = | _ -> false if isMutable then Some() else None - /// Entity (originalEntity, abbreviatedEntity, abbreviatedType) + /// Entity (originalEntity, abbreviatedEntity, abbreviatedTy) let (|FSharpEntity|_|) (symbol: FSharpSymbol) = match symbol with | :? FSharpEntity as entity -> - let abbreviatedEntity, abbreviatedType = getEntityAbbreviatedType entity - Some (entity, abbreviatedEntity, abbreviatedType) + let abbreviatedEntity, abbreviatedTy = getEntityAbbreviatedType entity + Some (entity, abbreviatedEntity, abbreviatedTy) | _ -> None let (|Parameter|_|) (symbol: FSharpSymbol) = diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 6475f93a08d..602ccb7459d 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -350,7 +350,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C member sym.TryGetAttribute<'T>() = sym.Attributes |> Seq.tryFind (fun attr -> attr.IsAttribute<'T>()) -type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = +type FSharpEntity(cenv: SymbolEnv, entity: EntityRef) = inherit FSharpSymbol(cenv, (fun () -> checkEntityIsResolved entity @@ -588,8 +588,8 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = if isUnresolved() then makeReadOnlyCollection [] else let ty = generalizedTyconRef cenv.g entity DiagnosticsLogger.protectAssemblyExploration [] (fun () -> - [ for ity in GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes cenv.g cenv.amap range0 ty do - yield FSharpType(cenv, ity) ]) + [ for intfTy in GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes cenv.g cenv.amap range0 ty do + yield FSharpType(cenv, intfTy) ]) |> makeReadOnlyCollection member _.AllInterfaces = @@ -642,10 +642,13 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = else for minfo in GetImmediateIntrinsicMethInfosOfType (None, AccessibleFromSomeFSharpCode) cenv.g cenv.amap range0 entityTy do yield createMember minfo + let props = GetImmediateIntrinsicPropInfosOfType (None, AccessibleFromSomeFSharpCode) cenv.g cenv.amap range0 entityTy let events = cenv.infoReader.GetImmediateIntrinsicEventsOfType (None, AccessibleFromSomeFSharpCode, range0, entityTy) + for pinfo in props do yield FSharpMemberOrFunctionOrValue(cenv, P pinfo, Item.Property (pinfo.PropertyName, [pinfo])) + for einfo in events do yield FSharpMemberOrFunctionOrValue(cenv, E einfo, Item.Event einfo) @@ -657,8 +660,8 @@ type FSharpEntity(cenv: SymbolEnv, entity:EntityRef) = let vref = mkNestedValRef entity v yield FSharpMemberOrFunctionOrValue(cenv, V vref, Item.Value vref) match v.MemberInfo.Value.MemberFlags.MemberKind, v.ApparentEnclosingEntity with - | SynMemberKind.PropertyGet, Parent p -> - let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g p, Some vref, None) + | SynMemberKind.PropertyGet, Parent tcref -> + let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g tcref, Some vref, None) yield FSharpMemberOrFunctionOrValue(cenv, P pinfo, Item.Property (pinfo.PropertyName, [pinfo])) | SynMemberKind.PropertySet, Parent p -> let pinfo = FSProp(cenv.g, generalizedTyconRef cenv.g p, None, Some vref) @@ -1306,7 +1309,7 @@ type FSharpActivePatternGroup(cenv, apinfo:ActivePatternInfo, ty, valOpt) = |> Option.bind (fun vref -> match vref.DeclaringEntity with | ParentNone -> None - | Parent p -> Some (FSharpEntity(cenv, p))) + | Parent tcref -> Some (FSharpEntity(cenv, tcref))) type FSharpGenericParameter(cenv, v:Typar) = @@ -1411,7 +1414,7 @@ type FSharpAbstractSignature(cenv, info: SlotSig) = member _.Name = info.Name - member _.DeclaringType = FSharpType(cenv, info.ImplementedType) + member _.DeclaringType = FSharpType(cenv, info.DeclaringType) type FSharpGenericParameterMemberConstraint(cenv, info: TraitConstraintInfo) = let (TTrait(tys, nm, flags, atys, retTy, _)) = info @@ -2076,7 +2079,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | E e -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods let retTy = - try PropTypOfEventInfo cenv.infoReader range0 AccessibleFromSomewhere e + try PropTypeOfEventInfo cenv.infoReader range0 AccessibleFromSomewhere e with _ -> // For non-standard events, just use the delegate type as the ReturnParameter type e.GetDelegateType(cenv.amap, range0) @@ -2197,17 +2200,17 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = member _.IsValCompiledAsMethod = match d with - | V valRef -> IlxGen.IsFSharpValCompiledAsMethod cenv.g valRef.Deref + | V vref -> IlxGen.IsFSharpValCompiledAsMethod cenv.g vref.Deref | _ -> false member _.IsValue = match d with - | V valRef -> not (isForallFunctionTy cenv.g valRef.Type) + | V vref -> not (isForallFunctionTy cenv.g vref.Type) | _ -> false member _.IsFunction = match d with - | V valRef -> isForallFunctionTy cenv.g valRef.Type + | V vref -> isForallFunctionTy cenv.g vref.Type | _ -> false override x.Equals(other: obj) = @@ -2326,7 +2329,7 @@ type FSharpType(cenv, ty:TType) = DiagnosticsLogger.protectAssemblyExploration true <| fun () -> match stripTyparEqns ty with | TType_app (tcref, _, _) -> FSharpEntity(cenv, tcref).IsUnresolved - | TType_measure (Measure.Con tcref) -> FSharpEntity(cenv, tcref).IsUnresolved + | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref).IsUnresolved | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr).IsUnresolved | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr).IsUnresolved | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr).IsUnresolved @@ -2342,7 +2345,7 @@ type FSharpType(cenv, ty:TType) = isResolved() && protect <| fun () -> match stripTyparEqns ty with - | TType_app _ | TType_measure (Measure.Con _ | Measure.Prod _ | Measure.Inv _ | Measure.One _) -> true + | TType_app _ | TType_measure (Measure.Const _ | Measure.Prod _ | Measure.Inv _ | Measure.One _) -> true | _ -> false member _.IsTupleType = @@ -2363,7 +2366,7 @@ type FSharpType(cenv, ty:TType) = protect <| fun () -> match stripTyparEqns ty with | TType_app (tcref, _, _) -> FSharpEntity(cenv, tcref) - | TType_measure (Measure.Con tcref) -> FSharpEntity(cenv, tcref) + | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref) | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr) | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr) | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr) @@ -2375,8 +2378,8 @@ type FSharpType(cenv, ty:TType) = | TType_anon (_, tyargs) | TType_app (_, tyargs, _) | TType_tuple (_, tyargs) -> (tyargs |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection) - | TType_fun(d, r, _) -> [| FSharpType(cenv, d); FSharpType(cenv, r) |] |> makeReadOnlyCollection - | TType_measure (Measure.Con _) -> [| |] |> makeReadOnlyCollection + | TType_fun(domainTy, rangeTy, _) -> [| FSharpType(cenv, domainTy); FSharpType(cenv, rangeTy) |] |> makeReadOnlyCollection + | TType_measure (Measure.Const _) -> [| |] |> makeReadOnlyCollection | TType_measure (Measure.Prod (t1, t2)) -> [| FSharpType(cenv, TType_measure t1); FSharpType(cenv, TType_measure t2) |] |> makeReadOnlyCollection | TType_measure Measure.One -> [| |] |> makeReadOnlyCollection | TType_measure (Measure.Inv t1) -> [| FSharpType(cenv, TType_measure t1) |] |> makeReadOnlyCollection @@ -2443,8 +2446,8 @@ type FSharpType(cenv, ty:TType) = |> Option.map (fun ty -> FSharpType(cenv, ty)) member _.Instantiate(instantiation:(FSharpGenericParameter * FSharpType) list) = - let typI = instType (instantiation |> List.map (fun (tyv, ty) -> tyv.TypeParameter, ty.Type)) ty - FSharpType(cenv, typI) + let resTy = instType (instantiation |> List.map (fun (tyv, ty) -> tyv.TypeParameter, ty.Type)) ty + FSharpType(cenv, resTy) member _.Type = ty member private x.cenv = cenv @@ -2469,7 +2472,7 @@ type FSharpType(cenv, ty:TType) = | TType_app (tc1, b1, _) -> 10200 + int32 tc1.Stamp + List.sumBy hashType b1 | TType_ucase _ -> 10300 // shouldn't occur in symbols | TType_tuple (_, l1) -> 10400 + List.sumBy hashType l1 - | TType_fun (dty, rty, _) -> 10500 + hashType dty + hashType rty + | TType_fun (domainTy, rangeTy, _) -> 10500 + hashType domainTy + hashType rangeTy | TType_measure _ -> 10600 | TType_anon (_,l1) -> 10800 + List.sumBy hashType l1 hashType ty @@ -2593,9 +2596,9 @@ type FSharpStaticParameter(cenv, sp: Tainted< TypeProviders.ProvidedParameterInf inherit FSharpSymbol(cenv, (fun () -> protect <| fun () -> - let spKind = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) + let paramTy = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) let nm = sp.PUntaint((fun p -> p.Name), m) - Item.ArgName((mkSynId m nm, spKind, None))), + Item.ArgName((mkSynId m nm, paramTy, None))), (fun _ _ _ -> true)) member _.Name = diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 546a1b1ade7..1834bb0fbf7 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -373,12 +373,12 @@ let mkSynOperator (opm: range) (oper: string) = let mkSynInfix opm (l: SynExpr) oper (r: SynExpr) = let firstTwoRange = unionRanges l.Range opm - let wholeRange = unionRanges l.Range r.Range + let mWhole = unionRanges l.Range r.Range let app1 = SynExpr.App(ExprAtomicFlag.NonAtomic, true, mkSynOperator opm oper, l, firstTwoRange) - SynExpr.App(ExprAtomicFlag.NonAtomic, false, app1, r, wholeRange) + SynExpr.App(ExprAtomicFlag.NonAtomic, false, app1, r, mWhole) let mkSynBifix m oper x1 x2 = let app1 = SynExpr.App(ExprAtomicFlag.NonAtomic, true, mkSynOperator m oper, x1, m) @@ -417,17 +417,17 @@ let mkSynDotBrackGet m mDot a b = SynExpr.DotIndexedGet(a, b, mDot, m) let mkSynQMarkSet m a b c = mkSynTrifix m qmarkSet a b c -let mkSynDotParenGet lhsm dotm a b = +let mkSynDotParenGet mLhs mDot a b = match b with | SynExpr.Tuple (false, [ _; _ ], _, _) -> - errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), lhsm)) - SynExpr.Const(SynConst.Unit, lhsm) + errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), mLhs)) + SynExpr.Const(SynConst.Unit, mLhs) | SynExpr.Tuple (false, [ _; _; _ ], _, _) -> - errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), lhsm)) - SynExpr.Const(SynConst.Unit, lhsm) + errorR (Deprecated(FSComp.SR.astDeprecatedIndexerNotation (), mLhs)) + SynExpr.Const(SynConst.Unit, mLhs) - | _ -> mkSynInfix dotm a parenGet b + | _ -> mkSynInfix mDot a parenGet b let mkSynUnit m = SynExpr.Const(SynConst.Unit, m) @@ -452,24 +452,24 @@ let mkSynAssign (l: SynExpr) (r: SynExpr) = | SynExpr.App (_, _, SynExpr.DotGet (e, _, v, _), x, _) -> SynExpr.DotNamedIndexedPropertySet(e, v, x, r, m) | l -> SynExpr.Set(l, r, m) -let mkSynDot dotm m l (SynIdent (r, rTrivia)) = +let mkSynDot mDot m l (SynIdent (r, rTrivia)) = match l with | SynExpr.LongIdent (isOpt, SynLongIdent (lid, dots, trivia), None, _) -> // REVIEW: MEMORY PERFORMANCE: This list operation is memory intensive (we create a lot of these list nodes) - SynExpr.LongIdent(isOpt, SynLongIdent(lid @ [ r ], dots @ [ dotm ], trivia @ [ rTrivia ]), None, m) - | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id; r ], [ dotm ], [ None; rTrivia ]), None, m) + SynExpr.LongIdent(isOpt, SynLongIdent(lid @ [ r ], dots @ [ mDot ], trivia @ [ rTrivia ]), None, m) + | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id; r ], [ mDot ], [ None; rTrivia ]), None, m) | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) - SynExpr.DotGet(e, dm, SynLongIdent(lid @ [ r ], dots @ [ dotm ], trivia @ [ rTrivia ]), m) - | expr -> SynExpr.DotGet(expr, dotm, SynLongIdent([ r ], [], [ rTrivia ]), m) + SynExpr.DotGet(e, dm, SynLongIdent(lid @ [ r ], dots @ [ mDot ], trivia @ [ rTrivia ]), m) + | expr -> SynExpr.DotGet(expr, mDot, SynLongIdent([ r ], [], [ rTrivia ]), m) -let mkSynDotMissing dotm m l = +let mkSynDotMissing mDot m l = match l with | SynExpr.LongIdent (isOpt, SynLongIdent (lid, dots, trivia), None, _) -> // REVIEW: MEMORY PERFORMANCE: This list operation is memory intensive (we create a lot of these list nodes) - SynExpr.LongIdent(isOpt, SynLongIdent(lid, dots @ [ dotm ], trivia), None, m) - | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ dotm ], []), None, m) - | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> SynExpr.DotGet(e, dm, SynLongIdent(lid, dots @ [ dotm ], trivia), m) // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) + SynExpr.LongIdent(isOpt, SynLongIdent(lid, dots @ [ mDot ], trivia), None, m) + | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ mDot ], []), None, m) + | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> SynExpr.DotGet(e, dm, SynLongIdent(lid, dots @ [ mDot ], trivia), m) // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) | expr -> SynExpr.DiscardAfterMissingQualificationAfterDot(expr, m) let mkSynFunMatchLambdas synArgNameGenerator isMember wholem ps arrow e = @@ -974,9 +974,9 @@ let (|ParsedHashDirectiveArguments|) (input: ParsedHashDirectiveArgument list) = | ParsedHashDirectiveArgument.SourceIdentifier (_, v, _) -> v) input -let prependIdentInLongIdentWithTrivia (SynIdent (ident, identTrivia)) dotm lid = +let prependIdentInLongIdentWithTrivia (SynIdent (ident, identTrivia)) mDot lid = match lid with - | SynLongIdent (lid, dots, trivia) -> SynLongIdent(ident :: lid, dotm :: dots, identTrivia :: trivia) + | SynLongIdent (lid, dots, trivia) -> SynLongIdent(ident :: lid, mDot :: dots, identTrivia :: trivia) let mkDynamicArgExpr expr = match expr with diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index edda8d21d5b..0c7010b40fa 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -143,7 +143,7 @@ val mkSynQMarkSet: m: range -> a: SynExpr -> b: SynExpr -> c: SynExpr -> SynExpr //val mkSynDotBrackSeqSliceGet: m:range -> mDot:range -> arr:SynExpr -> argsList:SynIndexerArg list -> SynExpr -val mkSynDotParenGet: lhsm: range -> dotm: range -> a: SynExpr -> b: SynExpr -> SynExpr +val mkSynDotParenGet: mLhs: range -> mDot: range -> a: SynExpr -> b: SynExpr -> SynExpr val mkSynUnit: m: range -> SynExpr @@ -153,9 +153,9 @@ val mkSynDelay: m: range -> e: SynExpr -> SynExpr val mkSynAssign: l: SynExpr -> r: SynExpr -> SynExpr -val mkSynDot: dotm: range -> m: range -> l: SynExpr -> r: SynIdent -> SynExpr +val mkSynDot: mDot: range -> m: range -> l: SynExpr -> r: SynIdent -> SynExpr -val mkSynDotMissing: dotm: range -> m: range -> l: SynExpr -> SynExpr +val mkSynDotMissing: mDot: range -> m: range -> l: SynExpr -> SynExpr val mkSynFunMatchLambdas: synArgNameGenerator: SynArgNameGenerator -> @@ -337,7 +337,7 @@ val (|SynPipeRight2|_|): SynExpr -> (SynExpr * SynExpr * SynExpr) option /// 'e1 |||> e2' val (|SynPipeRight3|_|): SynExpr -> (SynExpr * SynExpr * SynExpr * SynExpr) option -val prependIdentInLongIdentWithTrivia: ident: SynIdent -> dotm: range -> lid: SynLongIdent -> SynLongIdent +val prependIdentInLongIdentWithTrivia: ident: SynIdent -> mDot: range -> lid: SynLongIdent -> SynLongIdent val mkDynamicArgExpr: expr: SynExpr -> SynExpr diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 51060755e80..5075d68b504 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -564,8 +564,8 @@ type TcGlobals( let tryDecodeTupleTy tupInfo l = match l with - | [t1;t2;t3;t4;t5;t6;t7;marker] -> - match marker with + | [t1;t2;t3;t4;t5;t6;t7;markerTy] -> + match markerTy with | TType_app(tcref, [t8], _) when tyconRefEq tcref v_ref_tuple1_tcr -> mkRawRefTupleTy [t1;t2;t3;t4;t5;t6;t7;t8] |> Some | TType_app(tcref, [t8], _) when tyconRefEq tcref v_struct_tuple1_tcr -> mkRawStructTupleTy [t1;t2;t3;t4;t5;t6;t7;t8] |> Some | TType_tuple (_structness2, t8plus) -> TType_tuple (tupInfo, [t1;t2;t3;t4;t5;t6;t7] @ t8plus) |> Some @@ -1779,7 +1779,7 @@ type TcGlobals( [ arg0Ty; arg1Ty ], Some retTy -> [vara; varb; varc], [ varaTy; varbTy ], varcTy, [ arg0Ty; arg1Ty; retTy ] - | ("UnaryNegationDynamic" | "CheckedUnaryNegationDynamic" | "LogicalNotDynamic" | "ExplicitDynamic"), + | ("UnaryNegationDynamic" | "CheckedUnaryNegationDynamic" | "LogicalNotDynamic" | "ExplicitDynamic" | "CheckedExplicitDynamic"), [ arg0Ty ], Some retTy -> [vara; varb ], [ varaTy ], varbTy, [ arg0Ty; retTy ] @@ -1832,11 +1832,11 @@ type TcGlobals( let info = makeOtherIntrinsicValRef (fslib_MFOperators_nleref, lower, None, Some nm, [vara], ([[varaTy]], varaTy)) let tyargs = [aty] Some (info, tyargs, argExprs) - | "get_Item", [arrTy; _], Some rty, [_; _] when isArrayTy g arrTy -> - Some (g.array_get_info, [rty], argExprs) - | "set_Item", [arrTy; _; ety], _, [_; _; _] when isArrayTy g arrTy -> - Some (g.array_set_info, [ety], argExprs) - | "get_Item", [sty; _; _], _, [_; _] when isStringTy g sty -> + | "get_Item", [arrTy; _], Some retTy, [_; _] when isArrayTy g arrTy -> + Some (g.array_get_info, [retTy], argExprs) + | "set_Item", [arrTy; _; elemTy], _, [_; _; _] when isArrayTy g arrTy -> + Some (g.array_set_info, [elemTy], argExprs) + | "get_Item", [stringTy; _; _], _, [_; _] when isStringTy g stringTy -> Some (g.getstring_info, [], argExprs) | "op_UnaryPlus", [aty], _, [_] -> // Call Operators.id diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 2d3f8c0943f..d71fd222745 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -1156,7 +1156,7 @@ type Entity = member x.MembersOfFSharpTyconSorted = x.TypeContents.tcaug_adhoc |> NameMultiMap.rangeReversingEachBucket - |> List.filter (fun v -> not v.IsCompilerGenerated) + |> List.filter (fun vref -> not vref.IsCompilerGenerated) /// Gets all immediate members of an F# type definition keyed by name, including compiler-generated ones. /// Note: result is a indexed table, and for each name the results are in reverse declaration order @@ -1179,16 +1179,16 @@ type Entity = member x.AllGeneratedValues = [ match x.GeneratedCompareToValues with | None -> () - | Some (v1, v2) -> yield v1; yield v2 + | Some (vref1, vref2) -> yield vref1; yield vref2 match x.GeneratedCompareToWithComparerValues with | None -> () | Some v -> yield v match x.GeneratedHashAndEqualsValues with | None -> () - | Some (v1, v2) -> yield v1; yield v2 + | Some (vref1, vref2) -> yield vref1; yield vref2 match x.GeneratedHashAndEqualsWithComparerValues with | None -> () - | Some (v1, v2, v3) -> yield v1; yield v2; yield v3 ] + | Some (vref1, vref2, vref3) -> yield vref1; yield vref2; yield vref3 ] /// Gets the data indicating the compiled representation of a type or module in terms of Abstract IL data structures. @@ -3720,32 +3720,32 @@ type ValRef = member x.ResolvedTarget = x.binding /// Dereference the ValRef to a Val. - member vr.Deref = - if obj.ReferenceEquals(vr.binding, null) then + member x.Deref = + if obj.ReferenceEquals(x.binding, null) then let res = - let nlr = vr.nlr + let nlr = x.nlr let e = nlr.EnclosingEntity.Deref let possible = e.ModuleOrNamespaceType.TryLinkVal(nlr.EnclosingEntity.nlr.Ccu, nlr.ItemKey) match possible with | ValueNone -> error (InternalUndefinedItemRef (FSComp.SR.tastUndefinedItemRefVal, e.DisplayNameWithStaticParameters, nlr.AssemblyName, sprintf "%+A" nlr.ItemKey.PartialKey)) | ValueSome h -> h - vr.binding <- nullableSlotFull res + x.binding <- nullableSlotFull res res - else vr.binding + else x.binding /// Dereference the ValRef to a Val option. - member vr.TryDeref = - if obj.ReferenceEquals(vr.binding, null) then + member x.TryDeref = + if obj.ReferenceEquals(x.binding, null) then let resOpt = - match vr.nlr.EnclosingEntity.TryDeref with + match x.nlr.EnclosingEntity.TryDeref with | ValueNone -> ValueNone - | ValueSome e -> e.ModuleOrNamespaceType.TryLinkVal(vr.nlr.EnclosingEntity.nlr.Ccu, vr.nlr.ItemKey) + | ValueSome e -> e.ModuleOrNamespaceType.TryLinkVal(x.nlr.EnclosingEntity.nlr.Ccu, x.nlr.ItemKey) match resOpt with | ValueNone -> () | ValueSome res -> - vr.binding <- nullableSlotFull res + x.binding <- nullableSlotFull res resOpt - else ValueSome vr.binding + else ValueSome x.binding /// The type of the value. May be a TType_forall for a generic value. /// May be a type variable or type containing type variables during type inference. @@ -3942,7 +3942,7 @@ type ValRef = /// Represents a reference to a case of a union type [] type UnionCaseRef = - | UnionCaseRef of TyconRef * string + | UnionCaseRef of tyconRef: TyconRef * caseName: string /// Get a reference to the type containing this union case member x.TyconRef = let (UnionCaseRef(tcref, _)) = x in tcref @@ -4001,7 +4001,7 @@ type UnionCaseRef = /// Represents a reference to a field in a record, class or struct [] type RecdFieldRef = - | RecdFieldRef of tcref: TyconRef * id: string + | RecdFieldRef of tyconRef: TyconRef * fieldName: string /// Get a reference to the type containing this union case member x.TyconRef = let (RecdFieldRef(tcref, _)) = x in tcref @@ -4098,7 +4098,7 @@ type TType = | TType_anon (anonInfo, _tinst) -> defaultArg anonInfo.Assembly.QualifiedName "" | TType_fun _ -> "" | TType_measure _ -> "" - | TType_var (tp, _) -> tp.Solution |> function Some sln -> sln.GetAssemblyName() | None -> "" + | TType_var (tp, _) -> tp.Solution |> function Some slnTy -> slnTy.GetAssemblyName() | None -> "" | TType_ucase (_uc, _tinst) -> let (TILObjectReprData(scope, _nesting, _definition)) = _uc.Tycon.ILTyconInfo scope.QualifiedName @@ -4120,7 +4120,7 @@ type TType = | TupInfo.Const false -> "" | TupInfo.Const true -> "struct ") + "{|" + String.concat "," (Seq.map2 (fun nm ty -> nm + " " + string ty + ";") anonInfo.SortedNames tinst) + ")" + "|}" - | TType_fun (d, r, _) -> "(" + string d + " -> " + string r + ")" + | TType_fun (domainTy, retTy, _) -> "(" + string domainTy + " -> " + string retTy + ")" | TType_ucase (uc, tinst) -> "ucase " + uc.CaseName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") | TType_var (tp, _) -> match tp.Solution with @@ -4197,7 +4197,7 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Con of tyconRef: TyconRef + | Const of tyconRef: TyconRef /// A product of two units of measure | Prod of measure1: Measure * measure2: Measure @@ -5061,7 +5061,7 @@ type ObjExprMethod = type SlotSig = | TSlotSig of methodName: string * - implementedType: TType * + declaringType: TType * classTypars: Typars * methodTypars: Typars * formalParams: SlotParam list list * @@ -5071,7 +5071,7 @@ type SlotSig = member ss.Name = let (TSlotSig(nm, _, _, _, _, _)) = ss in nm /// The (instantiated) type which the slot is logically a part of - member ss.ImplementedType = let (TSlotSig(_, ty, _, _, _, _)) = ss in ty + member ss.DeclaringType = let (TSlotSig(_, ty, _, _, _, _)) = ss in ty /// The class type parameters of the slot member ss.ClassTypars = let (TSlotSig(_, _, ctps, _, _, _)) = ss in ctps diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index cdcf93e4518..57037ba27d8 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -2818,7 +2818,7 @@ type ValRef = /// Represents a reference to a case of a union type [] type UnionCaseRef = - | UnionCaseRef of TyconRef * string + | UnionCaseRef of tyconRef: TyconRef * caseName: string /// Get a field of the union case by index member FieldByIndex: n: int -> RecdField @@ -2867,7 +2867,7 @@ type UnionCaseRef = /// Represents a reference to a field in a record, class or struct [] type RecdFieldRef = - | RecdFieldRef of tcref: TyconRef * id: string + | RecdFieldRef of tyconRef: TyconRef * fieldName: string override ToString: unit -> string @@ -2990,7 +2990,7 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Con of tyconRef: TyconRef + | Const of tyconRef: TyconRef /// A product of two units of measure | Prod of measure1: Measure * measure2: Measure @@ -3688,7 +3688,7 @@ type ObjExprMethod = type SlotSig = | TSlotSig of methodName: string * - implementedType: TType * + declaringType: TType * classTypars: Typars * methodTypars: Typars * formalParams: SlotParam list list * @@ -3709,7 +3709,7 @@ type SlotSig = member FormalReturnType: TType option /// The (instantiated) type which the slot is logically a part of - member ImplementedType: TType + member DeclaringType: TType /// The method type parameters of the slot member MethodTypars: Typars diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 1ec0b619604..63a45fb9b9a 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -93,24 +93,24 @@ let mkRawStructTupleTy tys = TType_tuple (tupInfoStruct, tys) // Equality relations on locally defined things //--------------------------------------------------------------------------- -let typarEq (lv1: Typar) (lv2: Typar) = (lv1.Stamp = lv2.Stamp) +let typarEq (tp1: Typar) (tp2: Typar) = (tp1.Stamp = tp2.Stamp) /// Equality on type variables, implemented as reference equality. This should be equivalent to using typarEq. let typarRefEq (tp1: Typar) (tp2: Typar) = (tp1 === tp2) /// Equality on value specs, implemented as reference equality -let valEq (lv1: Val) (lv2: Val) = (lv1 === lv2) +let valEq (v1: Val) (v2: Val) = (v1 === v2) /// Equality on CCU references, implemented as reference equality except when unresolved -let ccuEq (mv1: CcuThunk) (mv2: CcuThunk) = - (mv1 === mv2) || - (if mv1.IsUnresolvedReference || mv2.IsUnresolvedReference then - mv1.AssemblyName = mv2.AssemblyName +let ccuEq (ccu1: CcuThunk) (ccu2: CcuThunk) = + (ccu1 === ccu2) || + (if ccu1.IsUnresolvedReference || ccu2.IsUnresolvedReference then + ccu1.AssemblyName = ccu2.AssemblyName else - mv1.Contents === mv2.Contents) + ccu1.Contents === ccu2.Contents) /// For dereferencing in the middle of a pattern -let (|ValDeref|) (vr: ValRef) = vr.Deref +let (|ValDeref|) (vref: ValRef) = vref.Deref //-------------------------------------------------------------------------- // Make references to TAST items diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index fe4930a71d7..e739aec4062 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -61,19 +61,19 @@ val mkRawRefTupleTy: tys: TTypes -> TType val mkRawStructTupleTy: tys: TTypes -> TType -val typarEq: lv1: Typar -> lv2: Typar -> bool +val typarEq: tp1: Typar -> tp2: Typar -> bool /// Equality on type variables, implemented as reference equality. This should be equivalent to using typarEq. val typarRefEq: tp1: Typar -> tp2: Typar -> bool /// Equality on value specs, implemented as reference equality -val valEq: lv1: Val -> lv2: Val -> bool +val valEq: v1: Val -> v2: Val -> bool /// Equality on CCU references, implemented as reference equality except when unresolved -val ccuEq: mv1: CcuThunk -> mv2: CcuThunk -> bool +val ccuEq: ccu1: CcuThunk -> ccu2: CcuThunk -> bool /// For dereferencing in the middle of a pattern -val (|ValDeref|): vr: ValRef -> Val +val (|ValDeref|): vref: ValRef -> Val val mkRecdFieldRef: tcref: TyconRef -> f: string -> RecdFieldRef diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index cef7fe70b74..8229107c74a 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -45,32 +45,32 @@ type TyparMap<'T> = | TPMap of StampMap<'T> member tm.Item - with get (v: Typar) = + with get (tp: Typar) = let (TPMap m) = tm - m[v.Stamp] + m[tp.Stamp] - member tm.ContainsKey (v: Typar) = + member tm.ContainsKey (tp: Typar) = let (TPMap m) = tm - m.ContainsKey(v.Stamp) + m.ContainsKey(tp.Stamp) - member tm.TryFind (v: Typar) = + member tm.TryFind (tp: Typar) = let (TPMap m) = tm - m.TryFind(v.Stamp) + m.TryFind(tp.Stamp) - member tm.Add (v: Typar, x) = + member tm.Add (tp: Typar, x) = let (TPMap m) = tm - TPMap (m.Add(v.Stamp, x)) + TPMap (m.Add(tp.Stamp, x)) static member Empty: TyparMap<'T> = TPMap Map.empty [] type TyconRefMap<'T>(imap: StampMap<'T>) = - member m.Item with get (v: TyconRef) = imap[v.Stamp] - member m.TryFind (v: TyconRef) = imap.TryFind v.Stamp - member m.ContainsKey (v: TyconRef) = imap.ContainsKey v.Stamp - member m.Add (v: TyconRef) x = TyconRefMap (imap.Add (v.Stamp, x)) - member m.Remove (v: TyconRef) = TyconRefMap (imap.Remove v.Stamp) - member m.IsEmpty = imap.IsEmpty + member _.Item with get (tcref: TyconRef) = imap[tcref.Stamp] + member _.TryFind (tcref: TyconRef) = imap.TryFind tcref.Stamp + member _.ContainsKey (tcref: TyconRef) = imap.ContainsKey tcref.Stamp + member _.Add (tcref: TyconRef) x = TyconRefMap (imap.Add (tcref.Stamp, x)) + member _.Remove (tcref: TyconRef) = TyconRefMap (imap.Remove tcref.Stamp) + member _.IsEmpty = imap.IsEmpty static member Empty: TyconRefMap<'T> = TyconRefMap Map.empty static member OfList vs = (vs, TyconRefMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) @@ -79,14 +79,14 @@ type TyconRefMap<'T>(imap: StampMap<'T>) = [] type ValMap<'T>(imap: StampMap<'T>) = - member m.Contents = imap - member m.Item with get (v: Val) = imap[v.Stamp] - member m.TryFind (v: Val) = imap.TryFind v.Stamp - member m.ContainsVal (v: Val) = imap.ContainsKey v.Stamp - member m.Add (v: Val) x = ValMap (imap.Add(v.Stamp, x)) - member m.Remove (v: Val) = ValMap (imap.Remove(v.Stamp)) + member _.Contents = imap + member _.Item with get (v: Val) = imap[v.Stamp] + member _.TryFind (v: Val) = imap.TryFind v.Stamp + member _.ContainsVal (v: Val) = imap.ContainsKey v.Stamp + member _.Add (v: Val) x = ValMap (imap.Add(v.Stamp, x)) + member _.Remove (v: Val) = ValMap (imap.Remove(v.Stamp)) static member Empty = ValMap<'T> Map.empty - member m.IsEmpty = imap.IsEmpty + member _.IsEmpty = imap.IsEmpty static member OfList vs = (vs, ValMap<'T>.Empty) ||> List.foldBack (fun (x, y) acc -> acc.Add x y) //-------------------------------------------------------------------------- @@ -207,11 +207,11 @@ let rec remapTypeAux (tyenv: Remap) (ty: TType) = if tupInfo === tupInfoR && l === lR then ty else TType_tuple (tupInfoR, lR) - | TType_fun (d, r, flags) as ty -> - let dR = remapTypeAux tyenv d - let rR = remapTypeAux tyenv r - if d === dR && r === rR then ty else - TType_fun (dR, rR, flags) + | TType_fun (domainTy, rangeTy, flags) as ty -> + let domainTyR = remapTypeAux tyenv domainTy + let retTyR = remapTypeAux tyenv rangeTy + if domainTy === domainTyR && rangeTy === retTyR then ty else + TType_fun (domainTyR, retTyR, flags) | TType_forall (tps, ty) -> let tpsR, tyenv = copyAndRemapAndBindTypars tyenv tps @@ -224,9 +224,9 @@ let rec remapTypeAux (tyenv: Remap) (ty: TType) = and remapMeasureAux tyenv unt = match unt with | Measure.One -> unt - | Measure.Con tcref -> + | Measure.Const tcref -> match tyenv.tyconRefRemap.TryFind tcref with - | Some tcref -> Measure.Con tcref + | Some tcref -> Measure.Const tcref | None -> unt | Measure.Prod(u1, u2) -> Measure.Prod(remapMeasureAux tyenv u1, remapMeasureAux tyenv u2) | Measure.RationalPower(u, q) -> Measure.RationalPower(remapMeasureAux tyenv u, q) @@ -235,8 +235,8 @@ and remapMeasureAux tyenv unt = match tp.Solution with | None -> match ListAssoc.tryFind typarEq tp tyenv.tpinst with - | Some v -> - match v with + | Some tpTy -> + match tpTy with | TType_measure unt -> unt | _ -> failwith "remapMeasureAux: incorrect kinds" | None -> unt @@ -257,10 +257,10 @@ and remapTyparConstraintsAux tyenv cs = Some(TyparConstraint.MayResolveMember (remapTraitInfo tyenv traitInfo, m)) | TyparConstraint.DefaultsTo(priority, ty, m) -> Some(TyparConstraint.DefaultsTo(priority, remapTypeAux tyenv ty, m)) - | TyparConstraint.IsEnum(uty, m) -> - Some(TyparConstraint.IsEnum(remapTypeAux tyenv uty, m)) - | TyparConstraint.IsDelegate(uty1, uty2, m) -> - Some(TyparConstraint.IsDelegate(remapTypeAux tyenv uty1, remapTypeAux tyenv uty2, m)) + | TyparConstraint.IsEnum(underlyingTy, m) -> + Some(TyparConstraint.IsEnum(remapTypeAux tyenv underlyingTy, m)) + | TyparConstraint.IsDelegate(argTys, retTy, m) -> + Some(TyparConstraint.IsDelegate(remapTypeAux tyenv argTys, remapTypeAux tyenv retTy, m)) | TyparConstraint.SimpleChoice(tys, m) -> Some(TyparConstraint.SimpleChoice(remapTypesAux tyenv tys, m)) | TyparConstraint.SupportsComparison _ @@ -443,7 +443,7 @@ let reduceTyconRefAbbrevMeasureable (tcref: TyconRef) = let rec stripUnitEqnsFromMeasureAux canShortcut unt = match stripUnitEqnsAux canShortcut unt with - | Measure.Con tcref when tcref.IsTypeAbbrev -> + | Measure.Const tcref when tcref.IsTypeAbbrev -> stripUnitEqnsFromMeasureAux canShortcut (reduceTyconRefAbbrevMeasureable tcref) | m -> m @@ -456,7 +456,7 @@ let stripUnitEqnsFromMeasure m = stripUnitEqnsFromMeasureAux false m /// What is the contribution of unit-of-measure constant ucref to unit-of-measure expression measure? let rec MeasureExprConExponent g abbrev ucref unt = match (if abbrev then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Con ucrefR -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational + | Measure.Const ucrefR -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureExprConExponent g abbrev ucref untR) | Measure.Prod(unt1, unt2) -> AddRational(MeasureExprConExponent g abbrev ucref unt1) (MeasureExprConExponent g abbrev ucref unt2) | Measure.RationalPower(untR, q) -> MulRational (MeasureExprConExponent g abbrev ucref untR) q @@ -466,7 +466,7 @@ let rec MeasureExprConExponent g abbrev ucref unt = /// after remapping tycons? let rec MeasureConExponentAfterRemapping g r ucref unt = match stripUnitEqnsFromMeasure unt with - | Measure.Con ucrefR -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational + | Measure.Const ucrefR -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureConExponentAfterRemapping g r ucref untR) | Measure.Prod(unt1, unt2) -> AddRational(MeasureConExponentAfterRemapping g r ucref unt1) (MeasureConExponentAfterRemapping g r ucref unt2) | Measure.RationalPower(untR, q) -> MulRational (MeasureConExponentAfterRemapping g r ucref untR) q @@ -511,7 +511,7 @@ let ListMeasureVarOccsWithNonZeroExponents untexpr = let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let rec gather acc unt = match (if eraseAbbrevs then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Con c -> + | Measure.Const c -> if List.exists (fun (cR, _) -> tyconRefEq g c cR) acc then acc else let e = MeasureExprConExponent g eraseAbbrevs c untexpr if e = ZeroRational then acc else (c, e) :: acc @@ -526,7 +526,7 @@ let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let ListMeasureConOccsAfterRemapping g r unt = let rec gather acc unt = match stripUnitEqnsFromMeasure unt with - | Measure.Con c -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc + | Measure.Const c -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 | Measure.RationalPower(untR, _) -> gather acc untR | Measure.Inv untR -> gather acc untR @@ -552,8 +552,8 @@ let ProdMeasures ms = | [] -> Measure.One | m :: ms -> List.foldBack MeasureProdOpt ms m -let isDimensionless g tyarg = - match stripTyparEqns tyarg with +let isDimensionless g ty = + match stripTyparEqns ty with | TType_measure unt -> isNil (ListMeasureVarOccsWithNonZeroExponents unt) && isNil (ListMeasureConOccsWithNonZeroExponents g true unt) @@ -581,7 +581,7 @@ let normalizeMeasure g ms = match vs, cs with | [], [] -> Measure.One | [(v, e)], [] when e = OneRational -> Measure.Var v - | vs, cs -> List.foldBack (fun (v, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Var v, e), m)) vs (List.foldBack (fun (c, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Con c, e), m)) cs Measure.One) + | vs, cs -> List.foldBack (fun (v, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Var v, e), m)) vs (List.foldBack (fun (c, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Const c, e), m)) cs Measure.One) let tryNormalizeMeasureInType g ty = match ty with @@ -789,8 +789,8 @@ let rec stripTyEqnsAndErase eraseFuncAndTuple (g: TcGlobals) ty = else ty - | TType_fun(a, b, flags) when eraseFuncAndTuple -> - TType_app(g.fastFunc_tcr, [ a; b ], flags) + | TType_fun(domainTy, rangeTy, flags) when eraseFuncAndTuple -> + TType_app(g.fastFunc_tcr, [ domainTy; rangeTy ], flags) | TType_tuple(tupInfo, l) when eraseFuncAndTuple -> mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) l @@ -816,7 +816,7 @@ let rec stripExnEqns (eref: TyconRef) = let primDestForallTy g ty = ty |> stripTyEqns g |> (function TType_forall (tyvs, tau) -> (tyvs, tau) | _ -> failwith "primDestForallTy: not a forall type") -let destFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau, _) -> (tyv, tau) | _ -> failwith "destFunTy: not a function type") +let destFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (domainTy, rangeTy, _) -> (domainTy, rangeTy) | _ -> failwith "destFunTy: not a function type") let destAnyTupleTy g ty = ty |> stripTyEqns g |> (function TType_tuple (tupInfo, l) -> tupInfo, l | _ -> failwith "destAnyTupleTy: not a tuple type") @@ -880,7 +880,7 @@ let argsOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(_, tinst, _) - let tryDestTyparTy g ty = ty |> stripTyEqns g |> (function TType_var (v, _) -> ValueSome v | _ -> ValueNone) -let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau, _) -> ValueSome(tyv, tau) | _ -> ValueNone) +let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (domainTy, rangeTy, _) -> ValueSome(domainTy, rangeTy) | _ -> ValueNone) let tryTcrefOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _, _) -> ValueSome tcref | _ -> ValueNone) @@ -900,14 +900,14 @@ let tryNiceEntityRefOfTy ty = let ty = stripTyparEqnsAux false ty match ty with | TType_app (tcref, _, _) -> ValueSome tcref - | TType_measure (Measure.Con tcref) -> ValueSome tcref + | TType_measure (Measure.Const tcref) -> ValueSome tcref | _ -> ValueNone let tryNiceEntityRefOfTyOption ty = let ty = stripTyparEqnsAux false ty match ty with | TType_app (tcref, _, _) -> Some tcref - | TType_measure (Measure.Con tcref) -> Some tcref + | TType_measure (Measure.Const tcref) -> Some tcref | _ -> None let mkInstForAppTy g ty = @@ -931,12 +931,12 @@ let convertToTypeWithMetadataIfPossible g ty = // TType modifications //--------------------------------------------------------------------------- -let stripMeasuresFromTType g tt = - match tt with - | TType_app(a, b, flags) -> - let bR = b |> List.filter (isMeasureTy g >> not) - TType_app(a, bR, flags) - | _ -> tt +let stripMeasuresFromTy g ty = + match ty with + | TType_app(tcref, tinst, flags) -> + let tinstR = tinst |> List.filter (isMeasureTy g >> not) + TType_app(tcref, tinstR, flags) + | _ -> ty //--------------------------------------------------------------------------- // Equivalence of types up to alpha-equivalence @@ -990,30 +990,29 @@ and traitKeysAEquivAux erasureFlag g aenv witnessInfo1 witnessInfo2 = and returnTypesAEquivAux erasureFlag g aenv retTy retTy2 = match retTy, retTy2 with | None, None -> true - | Some t1, Some t2 -> typeAEquivAux erasureFlag g aenv t1 t2 + | Some ty1, Some ty2 -> typeAEquivAux erasureFlag g aenv ty1 ty2 | _ -> false - and typarConstraintsAEquivAux erasureFlag g aenv tpc1 tpc2 = match tpc1, tpc2 with - | TyparConstraint.CoercesTo(acty, _), - TyparConstraint.CoercesTo(fcty, _) -> - typeAEquivAux erasureFlag g aenv acty fcty + | TyparConstraint.CoercesTo(tgtTy1, _), + TyparConstraint.CoercesTo(tgtTy2, _) -> + typeAEquivAux erasureFlag g aenv tgtTy1 tgtTy2 | TyparConstraint.MayResolveMember(trait1, _), TyparConstraint.MayResolveMember(trait2, _) -> traitsAEquivAux erasureFlag g aenv trait1 trait2 - | TyparConstraint.DefaultsTo(_, acty, _), - TyparConstraint.DefaultsTo(_, fcty, _) -> - typeAEquivAux erasureFlag g aenv acty fcty + | TyparConstraint.DefaultsTo(_, dfltTy1, _), + TyparConstraint.DefaultsTo(_, dfltTy2, _) -> + typeAEquivAux erasureFlag g aenv dfltTy1 dfltTy2 - | TyparConstraint.IsEnum(uty1, _), TyparConstraint.IsEnum(uty2, _) -> - typeAEquivAux erasureFlag g aenv uty1 uty2 + | TyparConstraint.IsEnum(underlyingTy1, _), TyparConstraint.IsEnum(underlyingTy2, _) -> + typeAEquivAux erasureFlag g aenv underlyingTy1 underlyingTy2 - | TyparConstraint.IsDelegate(aty1, bty1, _), TyparConstraint.IsDelegate(aty2, bty2, _) -> - typeAEquivAux erasureFlag g aenv aty1 aty2 && - typeAEquivAux erasureFlag g aenv bty1 bty2 + | TyparConstraint.IsDelegate(argTys1, retTy1, _), TyparConstraint.IsDelegate(argTys2, retTy2, _) -> + typeAEquivAux erasureFlag g aenv argTys1 argTys2 && + typeAEquivAux erasureFlag g aenv retTy1 retTy2 | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice(tys2, _) -> ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 @@ -1036,9 +1035,9 @@ and typarsAEquivAux erasureFlag g (aenv: TypeEquivEnv) tps1 tps2 = let aenv = aenv.BindEquivTypars tps1 tps2 List.forall2 (typarConstraintSetsAEquivAux erasureFlag g aenv) tps1 tps2 -and tcrefAEquiv g aenv tc1 tc2 = - tyconRefEq g tc1 tc2 || - (match aenv.EquivTycons.TryFind tc1 with Some v -> tyconRefEq g v tc2 | None -> false) +and tcrefAEquiv g aenv tcref1 tcref2 = + tyconRefEq g tcref1 tcref2 || + (match aenv.EquivTycons.TryFind tcref1 with Some v -> tyconRefEq g v tcref2 | None -> false) and typeAEquivAux erasureFlag g aenv ty1 ty2 = let ty1 = stripTyEqnsWrtErasure erasureFlag g ty1 @@ -1052,27 +1051,27 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = | TType_var (tp1, _), _ -> match aenv.EquivTypars.TryFind tp1 with - | Some v -> typeEquivAux erasureFlag g v ty2 + | Some tpTy1 -> typeEquivAux erasureFlag g tpTy1 ty2 | None -> false - | TType_app (tc1, b1, _), TType_app (tc2, b2, _) -> - tcrefAEquiv g aenv tc1 tc2 && - typesAEquivAux erasureFlag g aenv b1 b2 + | TType_app (tcref1, tinst1, _), TType_app (tcref2, tinst2, _) -> + tcrefAEquiv g aenv tcref1 tcref2 && + typesAEquivAux erasureFlag g aenv tinst1 tinst2 - | TType_ucase (UnionCaseRef(tc1, n1), b1), TType_ucase (UnionCaseRef(tc2, n2), b2) -> - n1=n2 && - tcrefAEquiv g aenv tc1 tc2 && - typesAEquivAux erasureFlag g aenv b1 b2 + | TType_ucase (UnionCaseRef(tcref1, ucase1), tinst1), TType_ucase (UnionCaseRef(tcref2, ucase2), tinst2) -> + ucase1=ucase2 && + tcrefAEquiv g aenv tcref1 tcref2 && + typesAEquivAux erasureFlag g aenv tinst1 tinst2 - | TType_tuple (s1, l1), TType_tuple (s2, l2) -> - structnessAEquiv s1 s2 && typesAEquivAux erasureFlag g aenv l1 l2 + | TType_tuple (tupInfo1, l1), TType_tuple (tupInfo2, l2) -> + structnessAEquiv tupInfo1 tupInfo2 && typesAEquivAux erasureFlag g aenv l1 l2 | TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) -> anonInfoEquiv anonInfo1 anonInfo2 && typesAEquivAux erasureFlag g aenv l1 l2 - | TType_fun (dtys1, rty1, _), TType_fun (dtys2, retTy2, _) -> - typeAEquivAux erasureFlag g aenv dtys1 dtys2 && typeAEquivAux erasureFlag g aenv rty1 retTy2 + | TType_fun (domainTy1, rangeTy1, _), TType_fun (domainTy2, rangeTy2, _) -> + typeAEquivAux erasureFlag g aenv domainTy1 domainTy2 && typeAEquivAux erasureFlag g aenv rangeTy1 rangeTy2 | TType_measure m1, TType_measure m2 -> match erasureFlag with @@ -1081,7 +1080,6 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = | _ -> false - and anonInfoEquiv (anonInfo1: AnonRecdTypeInfo) (anonInfo2: AnonRecdTypeInfo) = ccuEq anonInfo1.Assembly anonInfo2.Assembly && structnessAEquiv anonInfo1.TupInfo anonInfo2.TupInfo && @@ -1094,7 +1092,7 @@ and structnessAEquiv un1 un2 = and measureAEquiv g aenv un1 un2 = let vars1 = ListMeasureVarOccs un1 let trans tp1 = if aenv.EquivTypars.ContainsKey tp1 then destAnyParTy g aenv.EquivTypars[tp1] else tp1 - let remapTyconRef tc = if aenv.EquivTycons.ContainsKey tc then aenv.EquivTycons[tc] else tc + let remapTyconRef tcref = if aenv.EquivTycons.ContainsKey tcref then aenv.EquivTycons[tcref] else tcref let vars1R = List.map trans vars1 let vars2 = ListSet.subtract typarEq (ListMeasureVarOccs un2) vars1R let cons1 = ListMeasureConOccsAfterRemapping g remapTyconRef un1 @@ -1161,7 +1159,9 @@ let rec getErasedTypes g ty = //--------------------------------------------------------------------------- let valOrder = { new IComparer with member _.Compare(v1, v2) = compare v1.Stamp v2.Stamp } -let tyconOrder = { new IComparer with member _.Compare(tc1, tc2) = compare tc1.Stamp tc2.Stamp } + +let tyconOrder = { new IComparer with member _.Compare(tycon1, tycon2) = compare tycon1.Stamp tycon2.Stamp } + let recdFieldRefOrder = { new IComparer with member _.Compare(RecdFieldRef(tcref1, nm1), RecdFieldRef(tcref2, nm2)) = @@ -1180,8 +1180,8 @@ let unionCaseRefOrder = // Make some common types //--------------------------------------------------------------------------- -let mkFunTy (g: TcGlobals) d r = - TType_fun (d, r, g.knownWithoutNull) +let mkFunTy (g: TcGlobals) domainTy rangeTy = + TType_fun (domainTy, rangeTy, g.knownWithoutNull) let mkForallTy d r = TType_forall (d, r) @@ -1396,7 +1396,7 @@ let NormalizeDeclaredTyparsForEquiRecursiveInference g tps = type GeneralizedType = GeneralizedType of Typars * TType let mkGenericBindRhs g m generalizedTyparsForRecursiveBlock typeScheme bodyExpr = - let (GeneralizedType(generalizedTypars, tauType)) = typeScheme + let (GeneralizedType(generalizedTypars, tauTy)) = typeScheme // Normalize the generalized typars let generalizedTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g generalizedTypars @@ -1414,7 +1414,7 @@ let mkGenericBindRhs g m generalizedTyparsForRecursiveBlock typeScheme bodyExpr // We record an expression node that indicates that a free choice can be made // for these. This expression node effectively binds the type variables. let freeChoiceTypars = ListSet.subtract typarEq generalizedTyparsForRecursiveBlock generalizedTypars - mkTypeLambda m generalizedTypars (mkTypeChoose m freeChoiceTypars bodyExpr, tauType) + mkTypeLambda m generalizedTypars (mkTypeChoose m freeChoiceTypars bodyExpr, tauTy) let isBeingGeneralized tp typeScheme = let (GeneralizedType(generalizedTypars, _)) = typeScheme @@ -1512,36 +1512,36 @@ let mkExnCaseFieldGet (e1, ecref, j, m) = let mkExnCaseFieldSet (e1, ecref, j, e2, m) = Expr.Op (TOp.ExnFieldSet (ecref, j), [], [e1;e2], m) -let mkDummyLambda (g: TcGlobals) (e: Expr, ety) = - let m = e.Range - mkLambda m (fst (mkCompGenLocal m "unitVar" g.unit_ty)) (e, ety) +let mkDummyLambda (g: TcGlobals) (bodyExpr: Expr, bodyExprTy) = + let m = bodyExpr.Range + mkLambda m (fst (mkCompGenLocal m "unitVar" g.unit_ty)) (bodyExpr, bodyExprTy) -let mkWhile (g: TcGlobals) (spWhile, marker, e1, e2, m) = - Expr.Op (TOp.While (spWhile, marker), [], [mkDummyLambda g (e1, g.bool_ty);mkDummyLambda g (e2, g.unit_ty)], m) +let mkWhile (g: TcGlobals) (spWhile, marker, guardExpr, bodyExpr, m) = + Expr.Op (TOp.While (spWhile, marker), [], [mkDummyLambda g (guardExpr, g.bool_ty);mkDummyLambda g (bodyExpr, g.unit_ty)], m) -let mkIntegerForLoop (g: TcGlobals) (spFor, spIn, v, e1, dir, e2, e3: Expr, m) = - Expr.Op (TOp.IntegerForLoop (spFor, spIn, dir), [], [mkDummyLambda g (e1, g.int_ty) ;mkDummyLambda g (e2, g.int_ty);mkLambda e3.Range v (e3, g.unit_ty)], m) +let mkIntegerForLoop (g: TcGlobals) (spFor, spIn, v, startExpr, dir, finishExpr, bodyExpr: Expr, m) = + Expr.Op (TOp.IntegerForLoop (spFor, spIn, dir), [], [mkDummyLambda g (startExpr, g.int_ty) ;mkDummyLambda g (finishExpr, g.int_ty);mkLambda bodyExpr.Range v (bodyExpr, g.unit_ty)], m) -let mkTryWith g (e1, vf, ef: Expr, vh, eh: Expr, m, ty, spTry, spWith) = - Expr.Op (TOp.TryWith (spTry, spWith), [ty], [mkDummyLambda g (e1, ty);mkLambda ef.Range vf (ef, ty);mkLambda eh.Range vh (eh, ty)], m) +let mkTryWith g (bodyExpr, filterVal, filterExpr: Expr, handlerVal, handlerExpr: Expr, m, ty, spTry, spWith) = + Expr.Op (TOp.TryWith (spTry, spWith), [ty], [mkDummyLambda g (bodyExpr, ty);mkLambda filterExpr.Range filterVal (filterExpr, ty);mkLambda handlerExpr.Range handlerVal (handlerExpr, ty)], m) -let mkTryFinally (g: TcGlobals) (e1, e2, m, ty, spTry, spFinally) = - Expr.Op (TOp.TryFinally (spTry, spFinally), [ty], [mkDummyLambda g (e1, ty);mkDummyLambda g (e2, g.unit_ty)], m) +let mkTryFinally (g: TcGlobals) (bodyExpr, finallyExpr, m, ty, spTry, spFinally) = + Expr.Op (TOp.TryFinally (spTry, spFinally), [ty], [mkDummyLambda g (bodyExpr, ty);mkDummyLambda g (finallyExpr, g.unit_ty)], m) let mkDefault (m, ty) = Expr.Const (Const.Zero, m, ty) -let mkValSet m v e = - Expr.Op (TOp.LValueOp (LSet, v), [], [e], m) +let mkValSet m vref e = + Expr.Op (TOp.LValueOp (LSet, vref), [], [e], m) -let mkAddrSet m v e = - Expr.Op (TOp.LValueOp (LByrefSet, v), [], [e], m) +let mkAddrSet m vref e = + Expr.Op (TOp.LValueOp (LByrefSet, vref), [], [e], m) -let mkAddrGet m v = - Expr.Op (TOp.LValueOp (LByrefGet, v), [], [], m) +let mkAddrGet m vref = + Expr.Op (TOp.LValueOp (LByrefGet, vref), [], [], m) -let mkValAddr m readonly v = - Expr.Op (TOp.LValueOp (LAddrOf readonly, v), [], [], m) +let mkValAddr m readonly vref = + Expr.Op (TOp.LValueOp (LAddrOf readonly, vref), [], [], m) //-------------------------------------------------------------------------- // Maps tracking extra information for values @@ -1682,9 +1682,9 @@ let tryDestForallTy g ty = let rec stripFunTy g ty = if isFunTy g ty then - let d, r = destFunTy g ty - let more, rty = stripFunTy g r - d :: more, rty + let domainTy, rangeTy = destFunTy g ty + let more, retTy = stripFunTy g rangeTy + domainTy :: more, retTy else [], ty let applyForallTy g ty tyargs = @@ -1696,23 +1696,24 @@ let reduceIteratedFunTy g ty args = if not (isFunTy g ty) then failwith "reduceIteratedFunTy" snd (destFunTy g ty)) ty args -let applyTyArgs g functy tyargs = - if isForallTy g functy then applyForallTy g functy tyargs else functy +let applyTyArgs g ty tyargs = + if isForallTy g ty then applyForallTy g ty tyargs else ty -let applyTys g functy (tyargs, argTys) = - let afterTyappTy = applyTyArgs g functy tyargs +let applyTys g funcTy (tyargs, argTys) = + let afterTyappTy = applyTyArgs g funcTy tyargs reduceIteratedFunTy g afterTyappTy argTys -let formalApplyTys g functy (tyargs, args) = +let formalApplyTys g funcTy (tyargs, args) = reduceIteratedFunTy g - (if isNil tyargs then functy else snd (destForallTy g functy)) + (if isNil tyargs then funcTy else snd (destForallTy g funcTy)) args let rec stripFunTyN g n ty = assert (n >= 0) if n > 0 && isFunTy g ty then let d, r = destFunTy g ty - let more, rty = stripFunTyN g (n-1) r in d :: more, rty + let more, retTy = stripFunTyN g (n-1) r + d :: more, retTy else [], ty let tryDestAnyTupleTy g ty = @@ -1796,10 +1797,10 @@ let destListTy (g: TcGlobals) ty = | ValueSome (tcref, [ty]) when tyconRefEq g tcref g.list_tcr_canon -> ty | _ -> failwith "destListTy" -let tyconRefEqOpt g tcOpt tc = - match tcOpt with +let tyconRefEqOpt g tcrefOpt tcref = + match tcrefOpt with | None -> false - | Some tc2 -> tyconRefEq g tc2 tc + | Some tcref2 -> tyconRefEq g tcref2 tcref let isStringTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _, _) -> tyconRefEq g tcref g.system_String_tcref | _ -> false) @@ -1830,13 +1831,13 @@ let isByrefTy g ty = let isInByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, [], _) -> tyconRefEq g g.byrefkind_In_tcr tcref | _ -> false) let isInByrefTy g ty = ty |> stripTyEqns g |> (function - | TType_app(tcref, [_; tag], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isInByrefTag g tag + | TType_app(tcref, [_; tagTy], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isInByrefTag g tagTy | _ -> false) let isOutByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, [], _) -> tyconRefEq g g.byrefkind_Out_tcr tcref | _ -> false) let isOutByrefTy g ty = ty |> stripTyEqns g |> (function - | TType_app(tcref, [_; tag], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isOutByrefTag g tag + | TType_app(tcref, [_; tagTy], _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isOutByrefTag g tagTy | _ -> false) #if !NO_TYPEPROVIDERS @@ -2059,7 +2060,7 @@ let MemberIsExplicitImpl g (membInfo: ValMemberInfo) = membInfo.MemberFlags.IsOverrideOrExplicitImpl && match membInfo.ImplementedSlotSigs with | [] -> false - | slotsigs -> slotsigs |> List.forall (fun slotsig -> isInterfaceTy g slotsig.ImplementedType) + | slotsigs -> slotsigs |> List.forall (fun slotsig -> isInterfaceTy g slotsig.DeclaringType) let ValIsExplicitImpl g (v: Val) = match v.MemberInfo with @@ -2239,8 +2240,8 @@ and accFreeInTyparConstraint opts tpc acc = | TyparConstraint.MayResolveMember (traitInfo, _) -> accFreeInTrait opts traitInfo acc | TyparConstraint.DefaultsTo(_, defaultTy, _) -> accFreeInType opts defaultTy acc | TyparConstraint.SimpleChoice(tys, _) -> accFreeInTypes opts tys acc - | TyparConstraint.IsEnum(uty, _) -> accFreeInType opts uty acc - | TyparConstraint.IsDelegate(aty, bty, _) -> accFreeInType opts aty (accFreeInType opts bty acc) + | TyparConstraint.IsEnum(underlyingTy, _) -> accFreeInType opts underlyingTy acc + | TyparConstraint.IsDelegate(argTys, retTy, _) -> accFreeInType opts argTys (accFreeInType opts retTy acc) | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -2302,18 +2303,18 @@ and accFreeInType opts ty acc = | TType_anon (anonInfo, l) -> accFreeInTypes opts l (accFreeInTupInfo opts anonInfo.TupInfo acc) - | TType_app (tc, tinst, _) -> - let acc = accFreeTycon opts tc acc + | TType_app (tcref, tinst, _) -> + let acc = accFreeTycon opts tcref acc match tinst with | [] -> acc // optimization to avoid unneeded call | [h] -> accFreeInType opts h acc // optimization to avoid unneeded call | _ -> accFreeInTypes opts tinst acc - | TType_ucase (UnionCaseRef(tc, _), tinst) -> - accFreeInTypes opts tinst (accFreeTycon opts tc acc) + | TType_ucase (UnionCaseRef(tcref, _), tinst) -> + accFreeInTypes opts tinst (accFreeTycon opts tcref acc) - | TType_fun (d, r, _) -> - accFreeInType opts d (accFreeInType opts r acc) + | TType_fun (domainTy, rangeTy, _) -> + accFreeInType opts domainTy (accFreeInType opts rangeTy acc) | TType_var (r, _) -> accFreeTyparRef opts r acc @@ -2375,10 +2376,10 @@ and accFreeInTyparConstraintLeftToRight g cxFlag thruFlag acc tpc = accFreeInTypeLeftToRight g cxFlag thruFlag acc defaultTy | TyparConstraint.SimpleChoice(tys, _) -> accFreeInTypesLeftToRight g cxFlag thruFlag acc tys - | TyparConstraint.IsEnum(uty, _) -> - accFreeInTypeLeftToRight g cxFlag thruFlag acc uty - | TyparConstraint.IsDelegate(aty, bty, _) -> - accFreeInTypeLeftToRight g cxFlag thruFlag (accFreeInTypeLeftToRight g cxFlag thruFlag acc aty) bty + | TyparConstraint.IsEnum(underlyingTy, _) -> + accFreeInTypeLeftToRight g cxFlag thruFlag acc underlyingTy + | TyparConstraint.IsDelegate(argTys, retTy, _) -> + accFreeInTypeLeftToRight g cxFlag thruFlag (accFreeInTypeLeftToRight g cxFlag thruFlag acc argTys) retTy | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -2419,9 +2420,9 @@ and accFreeInTypeLeftToRight g cxFlag thruFlag acc ty = | TType_ucase (_, tinst) -> accFreeInTypesLeftToRight g cxFlag thruFlag acc tinst - | TType_fun (d, r, _) -> - let dacc = accFreeInTypeLeftToRight g cxFlag thruFlag acc d - accFreeInTypeLeftToRight g cxFlag thruFlag dacc r + | TType_fun (domainTy, rangeTy, _) -> + let dacc = accFreeInTypeLeftToRight g cxFlag thruFlag acc domainTy + accFreeInTypeLeftToRight g cxFlag thruFlag dacc rangeTy | TType_var (r, _) -> accFreeTyparRefLeftToRight g cxFlag thruFlag acc r @@ -2546,12 +2547,12 @@ let GetMemberTypeInMemberForm g memberFlags valReprInfo numEnclosingTypars ty m let paramArgInfos = match paramArgInfos, valReprInfo.ArgInfos with // static member and module value unit argument elimination - | [[(argType, _)]], [[]] -> - assert isUnitTy g argType + | [[(argTy, _)]], [[]] -> + assert isUnitTy g argTy [[]] // instance member unit argument elimination - | [[(argType, _)]], [[_objArg];[]] -> - assert isUnitTy g argType + | [[(argTy, _)]], [[_objArg];[]] -> + assert isUnitTy g argTy [[]] | _ -> paramArgInfos @@ -2770,10 +2771,10 @@ module PrettyTypes = let niceTypars, renaming = NewPrettyTypars [] ftps names // strip universal types for printing - let getTauStayTau t = - match t with + let getTauStayTau ty = + match ty with | TType_forall (_, tau) -> tau - | _ -> t + | _ -> ty let tauThings = mapTys getTauStayTau things let prettyThings = mapTys (instType renaming) tauThings @@ -2858,8 +2859,8 @@ module SimplifyTypes = let ty = stripTyparEqns ty let z = f z ty match ty with - | TType_forall (_, body) -> - foldTypeButNotConstraints f z body + | TType_forall (_, bodyTy) -> + foldTypeButNotConstraints f z bodyTy | TType_app (_, tys, _) | TType_ucase (_, tys) @@ -2867,8 +2868,8 @@ module SimplifyTypes = | TType_tuple (_, tys) -> List.fold (foldTypeButNotConstraints f) z tys - | TType_fun (s, t, _) -> - foldTypeButNotConstraints f (foldTypeButNotConstraints f z s) t + | TType_fun (domainTy, rangeTy, _) -> + foldTypeButNotConstraints f (foldTypeButNotConstraints f z domainTy) rangeTy | TType_var _ -> z @@ -3184,7 +3185,7 @@ let tyconRefToFullName (tcref:TyconRef) = seq { yield! namespaceParts; yield tcref.DisplayName } |> String.concat "." let rec qualifiedInterfaceImplementationNameAux g (x:TType) : string = - match stripMeasuresFromTType g (stripTyEqnsAndErase true g x) with + match stripMeasuresFromTy g (stripTyEqnsAndErase true g x) with | TType_app (a, [], _) -> tyconRefToFullName a @@ -3203,8 +3204,8 @@ let rec qualifiedInterfaceImplementationNameAux g (x:TType) : string = failwithf "unexpected: expected TType_app but got %O" (x.GetType()) /// for types in the global namespace, `global is prepended (note the backtick) -let qualifiedInterfaceImplementationName g (tt:TType) memberName = - let interfaceName = tt |> qualifiedInterfaceImplementationNameAux g +let qualifiedInterfaceImplementationName g (ty: TType) memberName = + let interfaceName = ty |> qualifiedInterfaceImplementationNameAux g sprintf "%s.%s" interfaceName memberName let qualifiedMangledNameOfTyconRef tcref nm = @@ -4951,7 +4952,7 @@ and accFreeInTest (opts: FreeVarOptions) discrim acc = | DecisionTreeTest.ArrayLength(_, ty) -> accFreeVarsInTy opts ty acc | DecisionTreeTest.Const _ | DecisionTreeTest.IsNull -> acc - | DecisionTreeTest.IsInst (srcty, tgty) -> accFreeVarsInTy opts srcty (accFreeVarsInTy opts tgty acc) + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> accFreeVarsInTy opts srcTy (accFreeVarsInTy opts tgtTy acc) | DecisionTreeTest.ActivePatternCase (exp, tys, _, activePatIdentity, _, _) -> accFreeInExpr opts exp (accFreeVarsInTys opts tys @@ -5826,7 +5827,7 @@ and remapDecisionTree ctxt compgen tmenv x = | DecisionTreeTest.UnionCase (uc, tinst) -> DecisionTreeTest.UnionCase(remapUnionCaseRef tmenv.tyconRefRemap uc, remapTypes tmenv tinst) | DecisionTreeTest.ArrayLength (n, ty) -> DecisionTreeTest.ArrayLength(n, remapType tmenv ty) | DecisionTreeTest.Const _ -> test - | DecisionTreeTest.IsInst (srcty, tgty) -> DecisionTreeTest.IsInst (remapType tmenv srcty, remapType tmenv tgty) + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> DecisionTreeTest.IsInst (remapType tmenv srcTy, remapType tmenv tgtTy) | DecisionTreeTest.IsNull -> DecisionTreeTest.IsNull | DecisionTreeTest.ActivePatternCase _ -> failwith "DecisionTreeTest.ActivePatternCase should only be used during pattern match compilation" | DecisionTreeTest.Error(m) -> DecisionTreeTest.Error(m) @@ -8597,8 +8598,8 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = else sprintf "System.Tuple%s"(tyargsEnc g (gtpsType, gtpsMethod) tys) - | TType_fun (f, x, _) -> - "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [f;x] + | TType_fun (domainTy, rangeTy, _) -> + "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [domainTy; rangeTy] | TType_var (typar, _) -> typarEnc g (gtpsType, gtpsMethod) typar @@ -8869,22 +8870,22 @@ let canUseUnboxFast g m ty = // // No sequence point is generated for this expression form as this function is only // used for compiler-generated code. -let mkIsInstConditional g m tgty vinputExpr v e2 e3 = +let mkIsInstConditional g m tgtTy vinputExpr v e2 e3 = - if canUseTypeTestFast g tgty && isRefTy g tgty then + if canUseTypeTestFast g tgtTy && isRefTy g tgtTy then let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) let tg2 = mbuilder.AddResultTarget(e2) let tg3 = mbuilder.AddResultTarget(e3) let dtree = TDSwitch(exprForVal m v, [TCase(DecisionTreeTest.IsNull, tg3)], Some tg2, m) let expr = mbuilder.Close(dtree, m, tyOfExpr g e2) - mkCompGenLet m v (mkIsInst tgty vinputExpr m) expr + mkCompGenLet m v (mkIsInst tgtTy vinputExpr m) expr else let mbuilder = MatchBuilder(DebugPointAtBinding.NoneAtInvisible, m) - let tg2 = TDSuccess([mkCallUnbox g m tgty vinputExpr], mbuilder.AddTarget(TTarget([v], e2, None))) + let tg2 = TDSuccess([mkCallUnbox g m tgtTy vinputExpr], mbuilder.AddTarget(TTarget([v], e2, None))) let tg3 = mbuilder.AddResultTarget(e3) - let dtree = TDSwitch(vinputExpr, [TCase(DecisionTreeTest.IsInst(tyOfExpr g vinputExpr, tgty), tg2)], Some tg3, m) + let dtree = TDSwitch(vinputExpr, [TCase(DecisionTreeTest.IsInst(tyOfExpr g vinputExpr, tgtTy), tg2)], Some tg3, m) let expr = mbuilder.Close(dtree, m, tyOfExpr g e2) expr @@ -10114,7 +10115,7 @@ let (|ResumableCodeInvoke|_|) g expr = let ComputeUseMethodImpl g (v: Val) = v.ImplementedSlotSigs |> List.exists (fun slotsig -> - let oty = slotsig.ImplementedType + let oty = slotsig.DeclaringType let otcref = tcrefOfAppTy g oty let tcref = v.MemberApparentEntity diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 1a89375f930..5d27bff7fbc 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -845,7 +845,7 @@ val isDimensionless: TcGlobals -> TType -> bool // TType modifications and comparisons //--------------------------------------------------------------------------- -val stripMeasuresFromTType: TcGlobals -> TType -> TType +val stripMeasuresFromTy: TcGlobals -> TType -> TType //------------------------------------------------------------------------- // Equivalence of types (up to substitution of type variables in the left-hand type) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 3f5ba37afde..57c557d2b8a 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1575,7 +1575,7 @@ let p_measure_one = p_byte 4 // Pickle a unit-of-measure variable or constructor let p_measure_varcon unt st = match unt with - | Measure.Con tcref -> p_measure_con tcref st + | Measure.Const tcref -> p_measure_con tcref st | Measure.Var v -> p_measure_var v st | _ -> pfailwith st "p_measure_varcon: expected measure variable or constructor" @@ -1604,7 +1604,7 @@ let rec p_measure_power unt q st = let rec p_normalized_measure unt st = let unt = stripUnitEqnsAux false unt match unt with - | Measure.Con tcref -> p_measure_con tcref st + | Measure.Const tcref -> p_measure_con tcref st | Measure.Inv x -> p_byte 1 st; p_normalized_measure x st | Measure.Prod(x1, x2) -> p_byte 2 st; p_normalized_measure x1 st; p_normalized_measure x2 st | Measure.Var v -> p_measure_var v st @@ -1625,7 +1625,7 @@ let u_rational st = let rec u_measure_expr st = let tag = u_byte st match tag with - | 0 -> let a = u_tcref st in Measure.Con a + | 0 -> let a = u_tcref st in Measure.Const a | 1 -> let a = u_measure_expr st in Measure.Inv a | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod (a, b) | 3 -> let a = u_tpref st in Measure.Var a @@ -2437,7 +2437,7 @@ and p_dtree_discrim x st = | DecisionTreeTest.UnionCase (ucref, tinst) -> p_byte 0 st; p_tup2 p_ucref p_tys (ucref, tinst) st | DecisionTreeTest.Const c -> p_byte 1 st; p_const c st | DecisionTreeTest.IsNull -> p_byte 2 st - | DecisionTreeTest.IsInst (srcty, tgty) -> p_byte 3 st; p_ty srcty st; p_ty tgty st + | DecisionTreeTest.IsInst (srcTy, tgtTy) -> p_byte 3 st; p_ty srcTy st; p_ty tgtTy st | DecisionTreeTest.ArrayLength (n, ty) -> p_byte 4 st; p_tup2 p_int p_ty (n, ty) st | DecisionTreeTest.ActivePatternCase _ -> pfailwith st "DecisionTreeTest.ActivePatternCase: only used during pattern match compilation" | DecisionTreeTest.Error _ -> pfailwith st "DecisionTreeTest.Error: only used during pattern match compilation" diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index ebc1d2cb28c..a21e22dc891 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -141,15 +141,15 @@ type BindingSet = BindingSetPreAttrs of range * bool * bool * (SynAttributes -> let mkClassMemberLocalBindings(isStatic, initialRangeOpt, attrs, vis, BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, bindingSetRange)) = let ignoredFreeAttrs, decls = declsPreAttrs attrs vis - let wholeRange = + let mWhole = match initialRangeOpt with | None -> bindingSetRange | Some m -> unionRanges m bindingSetRange // decls could have a leading attribute |> fun m -> (m, decls) ||> unionRangeWithListBy (fun (SynBinding(range = m)) -> m) - if not (isNil ignoredFreeAttrs) then warning(Error(FSComp.SR.parsAttributesIgnored(), wholeRange)); - if isUse then errorR(Error(FSComp.SR.parsUseBindingsIllegalInImplicitClassConstructors(), wholeRange)) - SynMemberDefn.LetBindings (decls, isStatic, isRec, wholeRange) + if not (isNil ignoredFreeAttrs) then warning(Error(FSComp.SR.parsAttributesIgnored(), mWhole)); + if isUse then errorR(Error(FSComp.SR.parsUseBindingsIllegalInImplicitClassConstructors(), mWhole)) + SynMemberDefn.LetBindings (decls, isStatic, isRec, mWhole) let mkLocalBindings (mWhole, BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, _), mIn, body: SynExpr) = let ignoredFreeAttrs, decls = declsPreAttrs [] None @@ -830,12 +830,12 @@ moduleSpfn: _xmlDoc.MarkAsInvalid() let attrs = $1 @ cas let xmlDoc = grabXmlDoc(parseState, $1, 1) - let mTc = + let mDefn = (d3, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRanges range |> unionRangeWithXmlDoc xmlDoc - let tc = (SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, mTc)) - let m = (mTc, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) + let tc = SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, mDefn) + let m = (mDefn, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) SynModuleSigDecl.Types (tc :: $5, m) } | opt_attributes opt_declVisibility exconSpfn @@ -844,8 +844,8 @@ moduleSpfn: let xmlDoc = grabXmlDoc(parseState, $1, 1) let mDefnReprWithAttributes = (d2, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mWhole = (mDefnReprWithAttributes, members) ||> unionRangeWithListBy (fun (m: SynMemberSig) -> m.Range) - let ec = SynExceptionSig(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, mDefnReprWithAttributes), withKeyword, members, mWhole) - SynModuleSigDecl.Exception(ec, mWhole) } + let synExnDefn = SynExceptionSig(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, mDefnReprWithAttributes), withKeyword, members, mWhole) + SynModuleSigDecl.Exception(synExnDefn, mWhole) } | openDecl { SynModuleSigDecl.Open($1, (rhs parseState 1)) } @@ -901,7 +901,8 @@ tyconSpfnList: | AND tyconSpfn tyconSpfnList { let xmlDoc = grabXmlDoc(parseState, [], 1) let tyconSpfn = - let (SynTypeDefnSig(SynComponentInfo (a, typars, c, lid, _xmlDoc, fixity, vis, rangeOfLid) as componentInfo, equalsRange, typeRepr, withKeyword, members, range)) = $2 + let (SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range)) = $2 + let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then $2 else let range = unionRangeWithXmlDoc _xmlDoc range @@ -910,7 +911,8 @@ tyconSpfnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - SynTypeDefnSig(SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, rangeOfLid), equalsRange, typeRepr, withKeyword, members, range) + let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range) tyconSpfn :: $3 } | @@ -920,9 +922,9 @@ tyconSpfnList: /* A type definition in a signature */ tyconSpfn: | typeNameInfo EQUALS tyconSpfnRhsBlock - { let lhsm = rhs parseState 1 + { let mLhs = rhs parseState 1 let mEquals = rhs parseState 2 - $3 lhsm $1 (Some mEquals) } + $3 mLhs $1 (Some mEquals) } | typeNameInfo opt_classSpfn { let mWithKwd, members = $2 let (SynComponentInfo(range=range)) = $1 @@ -949,22 +951,22 @@ tyconSpfnRhsBlock: /* representation. */ | OBLOCKBEGIN tyconSpfnRhs opt_OBLOCKSEP classSpfnMembers opt_classSpfn oblockend opt_classSpfn { let m = lhs parseState - (fun lhsm nameInfo mEquals -> + (fun mLhs nameInfo mEquals -> let members = $4 @ (snd $5) - $2 lhsm nameInfo mEquals (checkForMultipleAugmentations m members (snd $7))) } + $2 mLhs nameInfo mEquals (checkForMultipleAugmentations m members (snd $7))) } | tyconSpfnRhs opt_classSpfn { let m = lhs parseState - (fun lhsm nameInfo mEquals -> + (fun mLhs nameInfo mEquals -> let _, members = $2 - $1 lhsm nameInfo mEquals members) } + $1 mLhs nameInfo mEquals members) } /* The right-hand-side of a type definition in a signature */ tyconSpfnRhs: | tyconDefnOrSpfnSimpleRepr - { (fun lhsm nameInfo mEquals augmentation -> - let declRange = unionRanges lhsm $1.Range + { (fun mLhs nameInfo mEquals augmentation -> + let declRange = unionRanges mLhs $1.Range let mWhole = (declRange, augmentation) ||> unionRangeWithListBy (fun (mem: SynMemberSig) -> mem.Range) SynTypeDefnSig(nameInfo, mEquals, SynTypeDefnSigRepr.Simple ($1, $1.Range), None, augmentation, mWhole)) } @@ -1063,7 +1065,7 @@ classMemberSpfn: let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = $4, grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 let mWith, getSetRangeOpt, getSet = $10 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet - let wholeRange = + let mWhole = let m = rhs parseState 3 match getSetRangeOpt with | None -> unionRanges m ty.Range @@ -1074,9 +1076,9 @@ classMemberSpfn: match optLiteralValue with | None -> m | Some e -> unionRanges m e.Range - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, wholeRange, { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals }) + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals }) let _, flags = $3 - SynMemberSig.Member(valSpfn, flags (getSetAdjuster arity), wholeRange) } + SynMemberSig.Member(valSpfn, flags (getSetAdjuster arity), mWhole) } | opt_attributes opt_declVisibility interfaceMember appType { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) @@ -1087,18 +1089,18 @@ classMemberSpfn: SynMemberSig.Inherit ($4, unionRanges (rhs parseState 3) ($4).Range) } | opt_attributes opt_declVisibility VAL fieldDecl - { let wholeRange = rhs2 parseState 1 4 + { let mWhole = rhs2 parseState 1 4 if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $4 $1 false wholeRange - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynMemberSig.ValField (field, wholeRange) } + let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $4 $1 false mWhole + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynMemberSig.ValField (field, mWhole) } | opt_attributes opt_declVisibility STATIC VAL fieldDecl - { let wholeRange = rhs2 parseState 1 5 + { let mWhole = rhs2 parseState 1 5 if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $5 $1 true wholeRange - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynMemberSig.ValField(field, wholeRange) } + let (SynField(_, _, _, _, _, xmlDoc, _, _)) as field = $5 $1 true mWhole + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynMemberSig.ValField(field, mWhole) } | opt_attributes opt_declVisibility STATIC typeKeyword tyconSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) @@ -1374,9 +1376,9 @@ moduleDefn: let (SynTypeDefn(SynComponentInfo(cas, a, cs, b, _xmlDoc, d, d2, d3), e, f, g, h, trivia)) = $4 _xmlDoc.MarkAsInvalid() let attrs = $1@cas - let mTc = (h, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRangeWithXmlDoc xmlDoc + let mDefn = (h, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mType = rhs parseState 3 - let tc = (SynTypeDefn(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), e, f, g, mTc, { trivia with TypeKeyword = Some mType })) + let tc = SynTypeDefn(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), e, f, g, mDefn, { trivia with TypeKeyword = Some mType }) let types = tc :: $5 [ SynModuleDecl.Types(types, (rhs parseState 3, types) ||> unionRangeWithListBy (fun t -> t.Range) ) ] } @@ -1387,8 +1389,8 @@ moduleDefn: let xmlDoc = grabXmlDoc(parseState, $1, 1) let defnReprRange = (d2, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc let mWhole = (f, $1) ||> unionRangeWithListBy (fun a -> a.Range) |> unionRangeWithXmlDoc xmlDoc - let ec = (SynExceptionDefn(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, defnReprRange), withKeyword, e, mWhole)) - [ SynModuleDecl.Exception(ec, mWhole) ] } + let synExnDefn = SynExceptionDefn(SynExceptionDefnRepr($1@cas, a, b, xmlDoc, d, defnReprRange), withKeyword, e, mWhole) + [ SynModuleDecl.Exception(synExnDefn, mWhole) ] } /* 'module' definitions */ | opt_attributes opt_declVisibility moduleIntro EQUALS namedModuleDefnBlock @@ -1491,7 +1493,7 @@ namedModuleDefnBlock: { Choice1Of2 $1.LongIdent } -/* A module definition that inccludes a 'begin'...'end' (rarely used in F# with #light syntax) */ +/* A module definition that includes a 'begin'...'end' (rarely used in F# with #light syntax) */ wrappedNamedModuleDefn: | structOrBegin moduleDefnsOrExprPossiblyEmpty END { $2 } @@ -1614,7 +1616,8 @@ tyconDefnList: | AND tyconDefn tyconDefnList { let xmlDoc = grabXmlDoc(parseState, [], 1) let tyconDefn = - let (SynTypeDefn(SynComponentInfo (a, typars, c, lid, _xmlDoc, fixity, vis, rangeOfLid) as componentInfo, typeRepr, members, implicitConstructor, range, trivia)) = $2 + let (SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia)) = $2 + let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then $2 else let range = unionRangeWithXmlDoc _xmlDoc range @@ -1623,7 +1626,8 @@ tyconDefnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - SynTypeDefn(SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, rangeOfLid), typeRepr, members, implicitConstructor, range, trivia) + let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia) tyconDefn :: $3 } | { [] } @@ -1910,15 +1914,15 @@ classDefnMember: let isInline, doc, id, explicitValTyparDecls = $4, grabXmlDoc(parseState, $1, 1), $5, $6 let mWith, getSetRangeOpt, getSet = $9 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet - let wholeRange = + let mWhole = let m = rhs parseState 1 match getSetRangeOpt with | None -> unionRanges m ty.Range | Some m2 -> unionRanges m m2 |> unionRangeWithXmlDoc doc - if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), wholeRange)) - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, wholeRange, { ValKeyword = None; WithKeyword = mWith; EqualsRange = None }) - [ SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags $3 (getSetAdjuster arity), wholeRange) ] } + if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = None }) + [ SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags $3 (getSetAdjuster arity), mWhole) ] } | opt_attributes opt_declVisibility inheritsDefn { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalOnInherit(), rhs parseState 1)) @@ -1998,13 +2002,13 @@ atomicPatternLongIdent: raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolDot()) let underscore = ident("_", rhs parseState 1) - let dotm = rhs parseState 2 - None, prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) dotm $3 } + let mDot = rhs parseState 2 + None, prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $3 } | GLOBAL DOT pathOp { let globalIdent = ident(MangledGlobalName, rhs parseState 1) - let dotm = rhs parseState 2 - None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, None)) dotm $3 } + let mDot = rhs parseState 2 + None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, None)) mDot $3 } | pathOp { (None, $1) } @@ -2014,8 +2018,8 @@ atomicPatternLongIdent: raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedSymbolDot()) let underscore = ident("_", rhs parseState 2) - let dotm = rhs parseState 3 - Some($1), prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) dotm $4 } + let mDot = rhs parseState 3 + Some($1), prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $4 } | access pathOp { (Some($1), $2) } @@ -2184,7 +2188,7 @@ tyconDefnOrSpfnSimpleRepr: /* A union type definition */ | opt_attributes opt_declVisibility unionTypeRepr { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalHere(), rhs parseState 1)) - let rangesOf3 = $3 |> List.map (function |Choice1Of2(ec)->ec.Range | Choice2Of2(uc)->uc.Range) + let rangesOf3 = $3 |> List.map (function Choice1Of2 ec -> ec.Range | Choice2Of2 uc -> uc.Range) let mWhole = (rhs2 parseState 1 2, rangesOf3) ||> List.fold unionRanges if $3 |> List.exists (function Choice1Of2 _ -> true | _ -> false) then ( if Option.isSome $2 then errorR(Error(FSComp.SR.parsEnumTypesCannotHaveVisibilityDeclarations(), rhs parseState 2)); @@ -2207,12 +2211,12 @@ tyconDefnOrSpfnSimpleRepr: /* An inline-assembly type definition, for FSharp.Core library only */ | opt_attributes opt_declVisibility LPAREN HASH string HASH rparen { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalHere(), rhs parseState 1)) - let lhsm = lhs parseState - if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError lhsm + let mLhs = lhs parseState + if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError mLhs if Option.isSome $2 then errorR(Error(FSComp.SR.parsInlineAssemblyCannotHaveVisibilityDeclarations(), rhs parseState 2)) let s, _ = $5 let ilType = ParseAssemblyCodeType s parseState.LexBuffer.ReportLibraryOnlyFeatures parseState.LexBuffer.LanguageVersion (rhs parseState 5) - SynTypeDefnSimpleRepr.LibraryOnlyILAssembly (box ilType, lhsm) } + SynTypeDefnSimpleRepr.LibraryOnlyILAssembly (box ilType, mLhs) } /* The core of a record type definition */ @@ -2513,8 +2517,8 @@ unionCaseReprElements: unionCaseReprElement: | ident COLON appType { let xmlDoc = grabXmlDoc(parseState, [], 1) - let wholeRange = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc - mkSynNamedField ($1, $3, xmlDoc, wholeRange) } + let mWhole = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc + mkSynNamedField ($1, $3, xmlDoc, mWhole) } | appType { let xmlDoc = grabXmlDoc(parseState, [], 1) @@ -2539,19 +2543,19 @@ recdFieldDeclList: /* A field declaration in a record type */ recdFieldDecl: | opt_attributes fieldDecl - { let wholeRange = rhs2 parseState 1 2 - let fld = $2 $1 false wholeRange - let (SynField (a, b, c, d, e, xmlDoc, vis, wholeRange)) = fld + { let mWhole = rhs2 parseState 1 2 + let fld = $2 $1 false mWhole + let (SynField (a, b, c, d, e, xmlDoc, vis, mWhole)) = fld if Option.isSome vis then errorR (Error (FSComp.SR.parsRecordFieldsCannotHaveVisibilityDeclarations (), rhs parseState 2)) - let wholeRange = unionRangeWithXmlDoc xmlDoc wholeRange - SynField (a, b, c, d, e, xmlDoc, None, wholeRange) } + let mWhole = unionRangeWithXmlDoc xmlDoc mWhole + SynField (a, b, c, d, e, xmlDoc, None, mWhole) } /* Part of a field or val declaration in a record type or object type */ fieldDecl: | opt_mutable opt_access ident COLON typ - { fun attrs stat wholeRange -> - let xmlDoc = grabXmlDocAtRangeStart(parseState, attrs, wholeRange) - SynField(attrs, stat, Some $3, $5, $1, xmlDoc, $2, wholeRange) } + { fun attrs stat mWhole -> + let xmlDoc = grabXmlDocAtRangeStart(parseState, attrs, mWhole) + SynField(attrs, stat, Some $3, $5, $1, xmlDoc, $2, mWhole) } /* An exception definition */ exconDefn: @@ -3322,12 +3326,12 @@ parenPattern: { SynPat.Ands(List.rev $1, rhs2 parseState 1 3) } | parenPattern COLON typeWithTypeConstraints %prec paren_pat_colon - { let lhsm = lhs parseState - SynPat.Typed($1, $3, lhsm) } + { let mLhs = lhs parseState + SynPat.Typed($1, $3, mLhs) } | attributes parenPattern %prec paren_pat_attribs - { let lhsm = lhs parseState - SynPat.Attrib($2, $1, lhsm) } + { let mLhs = lhs parseState + SynPat.Attrib($2, $1, mLhs) } | parenPattern COLON_COLON parenPattern { SynPat.LongIdent (SynLongIdent(mkSynCaseName (rhs parseState 2) opNameCons, [], [ Some (IdentTrivia.OriginalNotation "::") ]), None, None, SynArgPats.Pats [ SynPat.Tuple (false, [$1;$3], rhs2 parseState 1 3) ], None, lhs parseState) } @@ -3990,18 +3994,18 @@ declExpr: | declExpr DOT_DOT declExpr { let wholem = rhs2 parseState 1 3 - let opm = rhs parseState 2 - SynExpr.IndexRange(Some $1, opm, Some $3, rhs parseState 1, rhs parseState 3, wholem) } + let mOperator = rhs parseState 2 + SynExpr.IndexRange(Some $1, mOperator, Some $3, rhs parseState 1, rhs parseState 3, wholem) } | declExpr DOT_DOT %prec open_range_expr { let wholem = rhs2 parseState 1 2 - let opm = rhs parseState 2 - SynExpr.IndexRange(Some $1, opm, None, rhs parseState 1, opm, wholem) } + let mOperator = rhs parseState 2 + SynExpr.IndexRange(Some $1, mOperator, None, rhs parseState 1, mOperator, wholem) } | DOT_DOT declExpr %prec open_range_expr { let wholem = rhs2 parseState 1 2 - let opm = rhs parseState 1 - SynExpr.IndexRange(None, opm, Some $2, opm, rhs parseState 2, wholem) } + let mOperator = rhs parseState 1 + SynExpr.IndexRange(None, mOperator, Some $2, mOperator, rhs parseState 2, wholem) } | STAR { let m = rhs parseState 1 @@ -4351,61 +4355,61 @@ atomicExpr: atomicExprQualification: | identOrOp { let idm = rhs parseState 1 - (fun e lhsm dotm -> mkSynDot dotm lhsm e $1) } + (fun e mLhs mDot -> mkSynDot mDot mLhs e $1) } | GLOBAL - { (fun e lhsm dotm -> + { (fun e mLhs mDot -> reportParseErrorAt (rhs parseState 3) (FSComp.SR.nrGlobalUsedOnlyAsFirstName()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' - mkSynDotMissing dotm fixedLhsm e) } + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' + mkSynDotMissing mDot fixedLhsm e) } | /* empty */ - { (fun e lhsm dotm -> - reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' - mkSynDotMissing dotm fixedLhsm e) } + { (fun e mLhs mDot -> + reportParseErrorAt mDot (FSComp.SR.parsMissingQualificationAfterDot()) + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' + mkSynDotMissing mDot fixedLhsm e) } | recover - { (fun e lhsm dotm -> - reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) - let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' + { (fun e mLhs mDot -> + reportParseErrorAt mDot (FSComp.SR.parsMissingQualificationAfterDot()) + let fixedLhsm = mkRange mLhs.FileName mLhs.Start mDot.End // previous mLhs is wrong after 'recover' // Include 'e' in the returned expression but throw it away SynExpr.DiscardAfterMissingQualificationAfterDot (e, fixedLhsm)) } | LPAREN COLON_COLON rparen DOT INT32 - { (fun e lhsm dotm -> + { (fun e mLhs mDot -> if parseState.LexBuffer.ReportLibraryOnlyFeatures then libraryOnlyError(lhs parseState) - SynExpr.LibraryOnlyUnionCaseFieldGet (e, mkSynCaseName lhsm opNameCons, (fst $5), lhsm)) } + SynExpr.LibraryOnlyUnionCaseFieldGet (e, mkSynCaseName mLhs opNameCons, (fst $5), mLhs)) } | LPAREN typedSequentialExpr rparen { let lpr = rhs parseState 1 let rpr = rhs parseState 3 - (fun e lhsm dotm -> + (fun e mLhs mDot -> // Check for expr.( * ) // Note that "*" is parsed as an expression (it is allowed in "foo.[3,*]") match $2 with - | SynExpr.IndexRange (None, opm, None, _m1, _m2, _) -> - mkSynDot dotm lhsm e (SynIdent(ident(CompileOpName "*", opm), Some(IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr)))) + | SynExpr.IndexRange (None, mOperator, None, _m1, _m2, _) -> + mkSynDot mDot mLhs e (SynIdent(ident(CompileOpName "*", mOperator), Some(IdentTrivia.OriginalNotationWithParen(lpr, "*", rpr)))) | _ -> if parseState.LexBuffer.SupportsFeature LanguageFeature.MLCompatRevisions then mlCompatError (FSComp.SR.mlCompatMultiPrefixTyparsNoLongerSupported()) (lhs parseState) else mlCompatWarning (FSComp.SR.parsParenFormIsForML()) (lhs parseState) - mkSynDotParenGet lhsm dotm e $2) } + mkSynDotParenGet mLhs mDot e $2) } | LBRACK typedSequentialExpr RBRACK - { (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e $2) } + { (fun e mLhs mDot -> mkSynDotBrackGet mLhs mDot e $2) } | LBRACK typedSequentialExpr recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e $2)) } + (fun e mLhs mDot -> exprFromParseError (mkSynDotBrackGet mLhs mDot e $2)) } | LBRACK error RBRACK { let mArg = rhs2 parseState 1 3 - (fun e lhsm dotm -> mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr1", mArg))) } + (fun e mLhs mDot -> mkSynDotBrackGet mLhs mDot e (arbExpr("indexerExpr1", mArg))) } | LBRACK recover { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBracket()) let mArg = (rhs parseState 1).EndRange - (fun e lhsm dotm -> exprFromParseError (mkSynDotBrackGet lhsm dotm e (arbExpr("indexerExpr2", mArg)))) } + (fun e mLhs mDot -> exprFromParseError (mkSynDotBrackGet mLhs mDot e (arbExpr("indexerExpr2", mArg)))) } /* the start of atomicExprAfterType must not overlap with the valid postfix tokens of the type syntax, e.g. new List(...) */ atomicExprAfterType: @@ -4499,8 +4503,8 @@ parenExpr: | LPAREN parenExprBody ends_other_than_rparen_coming_soon_or_recover { if not $3 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).End - SynExpr.Paren (exprFromParseError ($2 lhsm), rhs parseState 1, None, lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).End + SynExpr.Paren (exprFromParseError ($2 mLhs), rhs parseState 1, None, mLhs) } | LPAREN error rparen { // silent recovery @@ -4508,18 +4512,18 @@ parenExpr: | LPAREN TYPE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2tcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2tcs", mLhs) } | LPAREN MODULE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2mcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2mcs", mLhs) } | LPAREN RBRACE_COMING_SOON { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - let lhsm = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start - arbExpr("parenExpr2rbcs", lhsm) } + let mLhs = unionRangeWithPos (rhs parseState 1) (rhs parseState 2).Start + arbExpr("parenExpr2rbcs", mLhs) } | LPAREN OBLOCKEND_COMING_SOON { let lparenRange = (rhs parseState 1) @@ -4534,8 +4538,8 @@ parenExpr: // to extend all the way over the "recover", to the end of the file if necessary // // let mLeftParen = rhs parseState 1 - //let lhsm = if $2 then unionRangeWithPos mLeftParen (rhs parseState 2).Start else mLeftParen - //arbExpr("parenExpr2", lhsm) } + //let mLhs = if $2 then unionRangeWithPos mLeftParen (rhs parseState 2).Start else mLeftParen + //arbExpr("parenExpr2", mLhs) } parenExprBody: | staticallyKnownHeadTypars COLON LPAREN classMemberSpfn rparen typedSequentialExpr @@ -4596,21 +4600,21 @@ braceExprBody: listExprElements: | sequentialExpr - { (fun lhsm -> SynExpr.ArrayOrListComputed (false, $1, lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrListComputed (false, $1, mLhs)) } | - { (fun lhsm -> SynExpr.ArrayOrList (false, [ ], lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrList (false, [ ], mLhs)) } arrayExprElements: | sequentialExpr - { (fun lhsm -> SynExpr.ArrayOrListComputed (true, $1, lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrListComputed (true, $1, mLhs)) } | - { (fun lhsm -> SynExpr.ArrayOrList (true, [ ], lhsm)) } + { (fun mLhs -> SynExpr.ArrayOrList (true, [ ], mLhs)) } computationExpr: | sequentialExpr - { $1.Range, (fun lhsm -> SynExpr.ComputationExpr (false, $1, lhsm)) } + { $1.Range, (fun mLhs -> SynExpr.ComputationExpr (false, $1, mLhs)) } arrowThenExprR: | RARROW typedSequentialExprBlockR diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index a35ece58510..fda69bff63f 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -192,6 +192,11 @@ rozhraní s vícenásobným obecným vytvářením instancí + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revize kompatibility ML diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 82283fe4ef5..394943a57e3 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -192,6 +192,11 @@ Schnittstellen mit mehrfacher generischer Instanziierung + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML-Kompatibilitätsrevisionen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index e886d028615..133b11d834f 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -192,6 +192,11 @@ interfaces con creación de instancias genéricas múltiples + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisiones de compatibilidad de ML diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 4990250d81c..050de24fcae 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -192,6 +192,11 @@ interfaces avec plusieurs instanciations génériques + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Réviseurs de compatibilité ML diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index f32f9891d15..18dfa3def7e 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -192,6 +192,11 @@ interfacce con più creazioni di istanze generiche + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisioni della compatibilità di Ml diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 082c4e84a92..ae2b9e658ae 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -192,6 +192,11 @@ 複数のジェネリックのインスタンス化を含むインターフェイス + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 互換性のリビジョン diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 06669718825..c8c5e20174b 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -192,6 +192,11 @@ 여러 제네릭 인스턴스화가 포함된 인터페이스 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 호환성 개정 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 911efdac74d..2e5eed91359 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -192,6 +192,11 @@ interfejsy z wieloma ogólnymi wystąpieniami + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Poprawki dotyczące zgodności Machine Learning diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 22bb59aa8bd..5ba3615dd11 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -192,6 +192,11 @@ interfaces com várias instanciações genéricas + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Revisões de compatibilidade de ML diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 30563882224..f25c3cb7d8d 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -192,6 +192,11 @@ интерфейсы с множественным универсальным созданием экземпляра + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions Редакции совместимости ML diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 94f5f37e105..28a47a02d20 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -192,6 +192,11 @@ birden çok genel örnek oluşturma içeren arabirimler + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML uyumluluk düzeltmeleri diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 71f44423b0c..5f88ef95941 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -192,6 +192,11 @@ 具有多个泛型实例化的接口 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 兼容性修订 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 8788739eb7c..3cdd6b3070f 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -192,6 +192,11 @@ 具有多個泛型具現化的介面 + + Allow lowercase DU when RequireQualifiedAccess attribute + Allow lowercase DU when RequireQualifiedAccess attribute + + ML compatibility revisions ML 相容性修訂 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index bbe35b11bcc..f80da09f758 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -7,6 +7,11 @@ Nejméně jedna informační zpráva v načteném souboru\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbol ..^ diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 057e3f528b2..8978b176751 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -7,6 +7,11 @@ Mindestens eine Informationsmeldung in der geladenen Datei.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' Symbol "..^" diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 28cf2d839d7..bc0ce4ad5a8 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -7,6 +7,11 @@ Uno o más mensajes informativos en el archivo cargado.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' símbolo "..^" diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 53e4eb6cff4..f88d8e7182b 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -7,6 +7,11 @@ Un ou plusieurs messages d’information dans le fichier chargé.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbole '..^' diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 7f475a4ff7b..90d7b1611ff 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -7,6 +7,11 @@ Uno o più messaggi informativi nel file caricato.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' simbolo '..^' diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index ad32096733b..b0a149427b1 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -7,6 +7,11 @@ 読み込まれたファイル内の 1 つ以上の情報メッセージ。\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' シンボル '..^' diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index a3fb6693290..95015040f09 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -7,6 +7,11 @@ 로드된 파일에 하나 이상의 정보 메시지가 있습니다.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 기호 '..^' diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index d891fb04f44..48a2f8adedc 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -7,6 +7,11 @@ Jeden lub więcej komunikatów informacyjnych w załadowanym pliku.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' symbol „..^” diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 242d057f55c..1929c486cda 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -7,6 +7,11 @@ Uma ou mais mensagens informativas no arquivo carregado.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' símbolo '..^' diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 6ae359a1229..1e91c13cd4c 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -7,6 +7,11 @@ Одно или несколько информационных сообщений в загруженном файле.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' символ "..^" diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 893935e94c3..31b4cad81af 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -7,6 +7,11 @@ Yüklenen dosyada bir veya daha fazla bilgi mesajı.\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' '..^' sembolü diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 95130a6391f..be3604df4bf 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -7,6 +7,11 @@ 加载文件 .\n 中有一条或多条信息性消息 + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 符号 "..^" diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 5ff1442b5c3..67e6c25370e 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -7,6 +7,11 @@ 已載入檔案中的一或多個資訊訊息。\n + + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + + symbol '..^' 符號 '..^' diff --git a/src/FSharp.Core/Linq.fs b/src/FSharp.Core/Linq.fs index 5b383f2c3d2..33a1dd18265 100644 --- a/src/FSharp.Core/Linq.fs +++ b/src/FSharp.Core/Linq.fs @@ -75,7 +75,170 @@ module LeafExpressionConverter = let NullableConstructor = typedefof>.GetConstructors().[0] - + + let getNonNullableType typ = match Nullable.GetUnderlyingType typ with null -> typ | t -> t + + // https://github.com/dotnet/runtime/blob/fa779e8cb2b5868a0ac2fd4215f39ffb91f0dab0/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L72 + /// Can LINQ Expressions' BinaryExpression's (Left/Right)Shift construct a SimpleBinaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsInteger typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Byte + | TypeCode.SByte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/fa779e8cb2b5868a0ac2fd4215f39ffb91f0dab0/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L2226 + /// Can LINQ Expressions' BinaryExpression's (Left/Right)Shift construct a SimpleBinaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsSimpleShift left right = + isLinqExpressionsInteger left && getNonNullableType right = typeof + + // https://github.com/dotnet/runtime/blob/cf7e7a46f8a4a6225a8f1e059a846ccdebf0454c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L110 + /// Can LINQ Expressions' (UnaryExpression/BinaryExpression)'s arithmetic operations construct a (SimpleBinaryExpression/UnaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsArithmeticType typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.Double + | TypeCode.Single + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L132 + /// Can LINQ Expressions' UnaryExpression.(Checked)Negate construct a UnaryExpression from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsArithmeticTypeButNotUnsignedInt typ = + isLinqExpressionsArithmeticType typ && + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> false + | _ -> true + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L149 + /// Can LINQ Expressions' (UnaryExpression.Not/BinaryExpression.Binary(And/Or/ExclusiveOr)) construct a (UnaryExpression/SimpleBinaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsIntegerOrBool typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Int64 + | TypeCode.Int32 + | TypeCode.Int16 + | TypeCode.UInt64 + | TypeCode.UInt32 + | TypeCode.UInt16 + | TypeCode.Boolean + | TypeCode.SByte + | TypeCode.Byte -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/7bd472498e690e9421df86d5a9d728faa939742c/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L47 + /// Can LINQ Expressions' BinaryExpression's comparison operations construct a (SimpleBinaryExpression/LogicalBinaryExpression) from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsNumeric typ = + let typ = getNonNullableType typ + not typ.IsEnum && + match Type.GetTypeCode typ with + | TypeCode.Char + | TypeCode.SByte + | TypeCode.Byte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.Double + | TypeCode.Single + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 -> true + | _ -> false + + // https://github.com/dotnet/runtime/blob/afaf666eff08435123eb649ac138419f4c9b9344/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L1047 + /// Can LINQ Expressions' BinaryExpression's equality operations provide built-in structural equality from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsStructurallyEquatable typ = + isLinqExpressionsNumeric typ || typ = typeof || getNonNullableType(typ).IsEnum + + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs#L1221 + /// Can LINQ Expressions' BinaryExpression's comparison operations provide built-in comparison from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsComparable = isLinqExpressionsNumeric + + /// Can LINQ Expressions' BinaryExpression's equality operations provide built-in equality from the type in question? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsEquatable typ = + isLinqExpressionsStructurallyEquatable typ || typ = typeof + + /// Can LINQ Expressions' BinaryExpression's conversion operations provide built-in conversion from source to dest? Otherwise, use the F# operator as the user-defined method. + let isLinqExpressionsConvertible source dest = + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs#L757 + // expression.Type.HasIdentityPrimitiveOrNullableConversionTo(type) || expression.Type.HasReferenceConversionTo(type)) + // In other words, source.HasIdentityPrimitiveOrNullableConversionTo dest || source.HasReferenceConversionTo dest + + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L532 + let isConvertible typ = + let typ = getNonNullableType typ + typ.IsEnum || + match Type.GetTypeCode typ with + | TypeCode.Boolean + | TypeCode.Byte + | TypeCode.SByte + | TypeCode.Int16 + | TypeCode.Int32 + | TypeCode.Int64 + | TypeCode.UInt16 + | TypeCode.UInt32 + | TypeCode.UInt64 + | TypeCode.Single + | TypeCode.Double + | TypeCode.Char -> true + | _ -> false + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L229 + // HasIdentityPrimitiveOrNullableConversionTo + getNonNullableType(source).IsEquivalentTo dest + || dest.IsEquivalentTo(getNonNullableType source) + || isConvertible source && isConvertible dest + && (getNonNullableType dest <> typeof || source.IsEnum && source.GetEnumUnderlyingType() = typeof) + + || + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L458 + // IsLegalExplicitVariantDelegateConversion + // https://github.com/dotnet/runtime/blob/4c92aef2b08f9c4374c520e7e664a44f1ad8ce56/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L260 + // HasReferenceConversionTo + let rec hasReferenceConversionTo source dest = + + // { if (source == typeof(void) || dest == typeof(void)) return false; } invalidates an identity conversion. This is handled by the IsEquivalentTo check above. + let nnSourceType, nnDestType = getNonNullableType source, getNonNullableType dest + + // Down conversion + nnSourceType.IsAssignableFrom nnDestType + // Up conversion + || nnDestType.IsAssignableFrom nnSourceType + + // Interface conversion + || source.IsInterface || dest.IsInterface + + // The following part shouldn't be needed for our usage of isLinqExpressionsConvertible here because we only use this for potentially nullable built-in numeric types +(* + // Variant delegate conversion + if (IsLegalExplicitVariantDelegateConversion(source, dest)) + { + return true; + } + + // Object conversion handled by assignable above. + Debug.Assert(source != typeof(object) && dest != typeof(object)); + + return (source.IsArray || dest.IsArray) && StrictHasReferenceConversionTo(source, dest, true); +*) + hasReferenceConversionTo source dest let SpecificCallToMethodInfo (minfo: System.Reflection.MethodInfo) = let isg1 = minfo.IsGenericMethod let gmd = if isg1 then minfo.GetGenericMethodDefinition() else null @@ -87,19 +250,20 @@ module LeafExpressionConverter = if isg1 then minfo2.IsGenericMethod && gmd = minfo2.GetGenericMethodDefinition() else minfo = minfo2 ) -> - Some (obj, (minfo2.GetGenericArguments() |> Array.toList), args) + Some (obj, minfo2, args) | _ -> None) - - let (|SpecificCallToMethod|_|) (mhandle: System.RuntimeMethodHandle) = + let (|SpecificCallToMethod|_|) (mhandle: RuntimeMethodHandle) = let minfo = (System.Reflection.MethodInfo.GetMethodFromHandle mhandle) :?> MethodInfo SpecificCallToMethodInfo minfo + let (|GenericArgs|) (minfo: MethodInfo) = minfo.GetGenericArguments() + let (|PhysicalEqualityQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> LanguagePrimitives.PhysicalEquality x y)) let (|GenericEqualityQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> LanguagePrimitives.GenericEquality x y)) let (|EqualsQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x = y)) let (|GreaterQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x > y)) let (|GreaterEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x >= y)) - let (|LessQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x < y)) + let (|LessQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x < y)) let (|LessEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x <= y)) let (|NotEqQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun (x, y) -> x <> y)) @@ -185,6 +349,8 @@ module LeafExpressionConverter = let (|ConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint16 x)) let (|ConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint32 x)) let (|ConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.uint64 x)) + let (|ConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.nativeint x)) + let (|ConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Operators.unativeint x)) let (|ConvInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToSByte")) let (|ConvUInt8Q|_|) = SpecificCallToMethodInfo (typeof.Assembly.GetType("Microsoft.FSharp.Core.ExtraTopLevelOperators").GetMethod("ToByte")) @@ -208,10 +374,8 @@ module LeafExpressionConverter = let (|ConvNullableUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint16 x)) let (|ConvNullableUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint32 x)) let (|ConvNullableUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.uint64 x)) - // LINQ expressions can't do native integer operations, so we don't convert these - //let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.nativeint x)) - //let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.unativeint x)) - + let (|ConvNullableIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.nativeint x)) + let (|ConvNullableUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Nullable.unativeint x)) let (|UnboxGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.UnboxGeneric x)) let (|TypeTestGeneric|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> LanguagePrimitives.IntrinsicFunctions.TypeTestGeneric x)) @@ -226,6 +390,8 @@ module LeafExpressionConverter = let (|CheckedConvUInt16Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint16 x)) let (|CheckedConvUInt32Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint32 x)) let (|CheckedConvUInt64Q|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.uint64 x)) + let (|CheckedConvIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.nativeint x)) + let (|CheckedConvUIntPtrQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> Checked.unativeint x)) let (|ImplicitExpressionConversionHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> ImplicitExpressionConversionHelper x)) let (|MemberInitializationHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> MemberInitializationHelper x)) let (|NewAnonymousObjectHelperQ|_|) = (|SpecificCallToMethod|_|) (methodhandleof (fun x -> NewAnonymousObjectHelper x)) @@ -287,7 +453,7 @@ module LeafExpressionConverter = | Patterns.Value(x, ty) -> Expression.Constant(x, ty) |> asExpr - | UnboxGeneric(_, [toTy], [x]) + | UnboxGeneric(_, GenericArgs [|toTy|], [x]) | Patterns.Coerce(x, toTy) -> let converted = ConvExprToLinqInContext env x @@ -299,7 +465,7 @@ module LeafExpressionConverter = | Patterns.TypeTest(x, toTy) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr - | TypeTestGeneric(_, [toTy], [x]) -> + | TypeTestGeneric(_, GenericArgs [|toTy|], [x]) -> Expression.TypeIs(ConvExprToLinqInContext env x, toTy) |> asExpr // Expr.*Get @@ -355,147 +521,115 @@ module LeafExpressionConverter = let props = ctor.DeclaringType.GetProperties() Expression.New(ctor, argsR, [| for p in props -> (p :> MemberInfo) |]) |> asExpr - // Do the same thing as C# compiler for string addition - | PlusQ (_, [ty1; ty2; ty3], [x1; x2]) when (ty1 = typeof) && (ty2 = typeof) && (ty3 = typeof) -> + | PlusQ (_, GenericArgs [|ty1; ty2; ty3|], [x1; x2]) when ty1 = typeof && ty2 = typeof && ty3 = typeof -> Expression.Add(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2, StringConcat) |> asExpr - | GenericEqualityQ _ - | EqualsQ _ -> transBinOp inp env false args false Expression.Equal - | NotEqQ _ -> transBinOp inp env false args false Expression.NotEqual - | GreaterQ _ -> transBinOp inp env false args false Expression.GreaterThan - | GreaterEqQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | LessQ _ -> transBinOp inp env false args false Expression.LessThan - | LessEqQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual - | NotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr - - | StaticEqualsQ _ -> transBinOp inp env false args false Expression.Equal - | StaticNotEqQ _ -> transBinOp inp env false args false Expression.NotEqual - | StaticGreaterQ _ -> transBinOp inp env false args false Expression.GreaterThan - | StaticGreaterEqQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | StaticLessQ _ -> transBinOp inp env false args false Expression.LessThan - | StaticLessEqQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual - - | NullableEqualsQ _ -> transBinOp inp env false args true Expression.Equal - | NullableNotEqQ _ -> transBinOp inp env false args true Expression.NotEqual - | NullableGreaterQ _ -> transBinOp inp env false args true Expression.GreaterThan - | NullableGreaterEqQ _ -> transBinOp inp env false args true Expression.GreaterThanOrEqual - | NullableLessQ _ -> transBinOp inp env false args true Expression.LessThan - | NullableLessEqQ _ -> transBinOp inp env false args true Expression.LessThanOrEqual - - | EqualsNullableQ _ -> transBinOp inp env true args false Expression.Equal - | NotEqNullableQ _ -> transBinOp inp env true args false Expression.NotEqual - | GreaterNullableQ _ -> transBinOp inp env true args false Expression.GreaterThan - | GreaterEqNullableQ _ -> transBinOp inp env true args false Expression.GreaterThanOrEqual - | LessNullableQ _ -> transBinOp inp env true args false Expression.LessThan - | LessEqNullableQ _ -> transBinOp inp env true args false Expression.LessThanOrEqual - - | NullableEqualsNullableQ _ -> transBinOp inp env false args false Expression.Equal - | NullableNotEqNullableQ _ -> transBinOp inp env false args false Expression.NotEqual - | NullableGreaterNullableQ _ -> transBinOp inp env false args false Expression.GreaterThan - | NullableGreaterEqNullableQ _ -> transBinOp inp env false args false Expression.GreaterThanOrEqual - | NullableLessNullableQ _ -> transBinOp inp env false args false Expression.LessThan - | NullableLessEqNullableQ _ -> transBinOp inp env false args false Expression.LessThanOrEqual + // LanguagePrimitives.PhysicalEquality's generic constraint of both sides being the same reference type is already sufficient for Linq Expressions' requirements + | PhysicalEqualityQ (_, m, [x1; x2]) -> transBoolOpNoWitness (fun _ -> true) env false x1 x2 false (fun (l, r, _, _) -> Expression.ReferenceEqual(l, r)) m + | GenericEqualityQ (_, m, [x1; x2]) + | EqualsQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.Equal m + | NotEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.NotEqual m + | GreaterQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThan m + | GreaterEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThanOrEqual m + | LessQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThan m + | LessEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThanOrEqual m + | NotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr + + | StaticEqualsQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsEquatable inp env x1 x2 Expression.Equal (methodhandleof (fun (x, y) -> LanguagePrimitives.EqualityDynamic x y)) + | StaticNotEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsEquatable inp env x1 x2 Expression.NotEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.InequalityDynamic x y)) + | StaticGreaterQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.GreaterThan (methodhandleof (fun (x, y) -> LanguagePrimitives.GreaterThanDynamic x y)) + | StaticGreaterEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.GreaterThanOrEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.GreaterThanOrEqualDynamic x y)) + | StaticLessQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.LessThan (methodhandleof (fun (x, y) -> LanguagePrimitives.LessThanDynamic x y)) + | StaticLessEqQ (_, _, [x1; x2]) -> transBoolOp isLinqExpressionsComparable inp env x1 x2 Expression.LessThanOrEqual (methodhandleof (fun (x, y) -> LanguagePrimitives.LessThanOrEqualDynamic x y)) + + | NullableEqualsQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 true Expression.Equal m + | NullableNotEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 true Expression.NotEqual m + | NullableGreaterQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.GreaterThan m + | NullableGreaterEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.GreaterThanOrEqual m + | NullableLessQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.LessThan m + | NullableLessEqQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 true Expression.LessThanOrEqual m + + | EqualsNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env true x1 x2 false Expression.Equal m + | NotEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env true x1 x2 false Expression.NotEqual m + | GreaterNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.GreaterThan m + | GreaterEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.GreaterThanOrEqual m + | LessNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.LessThan m + | LessEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env true x1 x2 false Expression.LessThanOrEqual m + + | NullableEqualsNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.Equal m + | NullableNotEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsStructurallyEquatable env false x1 x2 false Expression.NotEqual m + | NullableGreaterNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThan m + | NullableGreaterEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.GreaterThanOrEqual m + | NullableLessNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThan m + | NullableLessEqNullableQ (_, m, [x1; x2]) -> transBoolOpNoWitness isLinqExpressionsComparable env false x1 x2 false Expression.LessThanOrEqual m // 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 - | NegQ (_, _, [x1]) -> Expression.Negate(ConvExprToLinqInContext env x1) |> asExpr - | PlusQ _ -> transBinOp inp env false args false Expression.Add - | DivideQ _ -> transBinOp inp env false args false Expression.Divide - | MinusQ _ -> transBinOp inp env false args false Expression.Subtract - | MultiplyQ _ -> transBinOp inp env false args false Expression.Multiply - | ModuloQ _ -> transBinOp inp env false args false Expression.Modulo - - | ShiftLeftQ _ -> transBinOp inp env false args false Expression.LeftShift - | ShiftRightQ _ -> transBinOp inp env false args false Expression.RightShift - | BitwiseAndQ _ -> transBinOp inp env false args false Expression.And - | BitwiseOrQ _ -> transBinOp inp env false args false Expression.Or - | BitwiseXorQ _ -> transBinOp inp env false args false Expression.ExclusiveOr - | BitwiseNotQ (_, _, [x1]) -> Expression.Not(ConvExprToLinqInContext env x1) |> asExpr + | NegQ (_, _, [x]) -> transUnaryOp isLinqExpressionsArithmeticTypeButNotUnsignedInt inp env x Expression.Negate (methodhandleof (fun x -> LanguagePrimitives.UnaryNegationDynamic x)) + | 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)) + | DivideQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | ModuloQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + + | ShiftLeftQ (_, _, [x1; x2]) -> transShiftOp inp env false x1 x2 false Expression.LeftShift (methodhandleof (fun (x, y) -> LanguagePrimitives.LeftShiftDynamic x y)) + | ShiftRightQ (_, _, [x1; x2]) -> transShiftOp inp env false x1 x2 false Expression.RightShift (methodhandleof (fun (x, y) -> LanguagePrimitives.RightShiftDynamic x y)) + | 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 (fun x -> LanguagePrimitives.LogicalNotDynamic x)) - | CheckedNeg (_, _, [x1]) -> Expression.NegateChecked(ConvExprToLinqInContext env x1) |> asExpr - | CheckedPlusQ _ -> transBinOp inp env false args false Expression.AddChecked - | CheckedMinusQ _ -> transBinOp inp env false args false Expression.SubtractChecked - | CheckedMultiplyQ _ -> transBinOp inp env false args false Expression.MultiplyChecked + | 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)) + | CheckedMinusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.SubtractChecked (methodhandleof (fun (x, y) -> LanguagePrimitives.CheckedSubtractionDynamic x y)) + | CheckedMultiplyQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.MultiplyChecked (methodhandleof (fun (x, y) -> LanguagePrimitives.CheckedMultiplyDynamic x y)) - | NullablePlusQ _ -> transBinOp inp env false args true Expression.Add - | PlusNullableQ _ -> transBinOp inp env true args false Expression.Add - | NullablePlusNullableQ _ -> transBinOp inp env false args false Expression.Add + | NullablePlusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) + | PlusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) + | NullablePlusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Add (methodhandleof (fun (x, y) -> LanguagePrimitives.AdditionDynamic x y)) - | NullableMinusQ _ -> transBinOp inp env false args true Expression.Subtract - | MinusNullableQ _ -> transBinOp inp env true args false Expression.Subtract - | NullableMinusNullableQ _ -> transBinOp inp env false args false Expression.Subtract + | NullableMinusQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) + | MinusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) + | NullableMinusNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Subtract (methodhandleof (fun (x, y) -> LanguagePrimitives.SubtractionDynamic x y)) - | NullableMultiplyQ _ -> transBinOp inp env false args true Expression.Multiply - | MultiplyNullableQ _ -> transBinOp inp env true args false Expression.Multiply - | NullableMultiplyNullableQ _ -> transBinOp inp env false args false Expression.Multiply + | NullableMultiplyQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) + | MultiplyNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) + | NullableMultiplyNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Multiply (methodhandleof (fun (x, y) -> LanguagePrimitives.MultiplyDynamic x y)) - | NullableDivideQ _ -> transBinOp inp env false args true Expression.Divide - | DivideNullableQ _ -> transBinOp inp env true args false Expression.Divide - | NullableDivideNullableQ _ -> transBinOp inp env false args false Expression.Divide + | NullableDivideQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | DivideNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) + | NullableDivideNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Divide (methodhandleof (fun (x, y) -> LanguagePrimitives.DivisionDynamic x y)) - | NullableModuloQ _ -> transBinOp inp env false args true Expression.Modulo - | ModuloNullableQ _ -> transBinOp inp env true args false Expression.Modulo - | NullableModuloNullableQ _ -> transBinOp inp env false args false Expression.Modulo - - | ConvNullableCharQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableDecimalQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableFloatQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableDoubleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableFloat32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableSingleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableSByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableIntQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - | ConvNullableUInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - // LINQ expressions can't do native integer operations, so we don't convert these - //| ConvNullableIntPtrQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - //| ConvNullableUIntPtrQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof>) |> asExpr - - | ConvCharQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvDecimalQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvFloatQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvDoubleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvFloat32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvSingleQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvSByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvIntQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvByteQ (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt8Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt16Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt32Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ConvUInt64Q (_, _, [x1]) -> Expression.Convert(ConvExprToLinqInContext env x1, typeof) |> asExpr - - | CheckedConvCharQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvSByteQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt8Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt16Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt32Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvInt64Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvByteQ (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt8Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt16Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt32Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | CheckedConvUInt64Q (_, _, [x1]) -> Expression.ConvertChecked(ConvExprToLinqInContext env x1, typeof) |> asExpr - | ArrayLookupQ (_, [_; _; _], [x1; x2]) -> + | NullableModuloQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 true Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + | ModuloNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env true x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + | NullableModuloNullableQ (_, _, [x1; x2]) -> transBinOp isLinqExpressionsArithmeticType inp env false x1 x2 false Expression.Modulo (methodhandleof (fun (x, y) -> LanguagePrimitives.ModulusDynamic x y)) + + | ConvNullableCharQ (_, _, [x]) | ConvNullableDecimalQ (_, _, [x]) | ConvNullableFloatQ (_, _, [x]) | ConvNullableDoubleQ (_, _, [x]) -> transConv inp env false x + | ConvNullableFloat32Q (_, _, [x]) | ConvNullableSingleQ (_, _, [x]) | ConvNullableSByteQ (_, _, [x]) | ConvNullableInt8Q (_, _, [x]) -> transConv inp env false x + | ConvNullableInt16Q (_, _, [x]) | ConvNullableInt32Q (_, _, [x]) | ConvNullableIntQ (_, _, [x]) | ConvNullableInt64Q (_, _, [x]) -> transConv inp env false x + | ConvNullableByteQ (_, _, [x]) | ConvNullableUInt8Q (_, _, [x]) | ConvNullableUInt16Q (_, _, [x]) | ConvNullableUInt32Q (_, _, [x]) -> transConv inp env false x + | ConvNullableUInt64Q (_, _, [x]) | ConvNullableIntPtrQ (_, _, [x]) | ConvNullableUIntPtrQ (_, _, [x]) -> transConv inp env false x + + | ConvCharQ (_, _, [x]) | ConvDecimalQ (_, _, [x]) | ConvFloatQ (_, _, [x]) | ConvDoubleQ (_, _, [x]) -> transConv inp env false x + | ConvFloat32Q (_, _, [x]) | ConvSingleQ (_, _, [x]) | ConvSByteQ (_, _, [x]) | ConvInt8Q (_, _, [x]) -> transConv inp env false x + | ConvInt16Q (_, _, [x]) | ConvInt32Q (_, _, [x]) | ConvIntQ (_, _, [x]) | ConvInt64Q (_, _, [x]) -> transConv inp env false x + | ConvByteQ (_, _, [x]) | ConvUInt8Q (_, _, [x]) | ConvUInt16Q (_, _, [x]) | ConvUInt32Q (_, _, [x]) -> transConv inp env false x + | ConvUInt64Q (_, _, [x]) | ConvIntPtrQ (_, _, [x]) | ConvUIntPtrQ (_, _, [x]) -> transConv inp env false x + + | CheckedConvCharQ (_, _, [x]) | CheckedConvSByteQ (_, _, [x]) | CheckedConvInt8Q (_, _, [x]) | CheckedConvInt16Q (_, _, [x]) -> transConv inp env true x + | CheckedConvInt32Q (_, _, [x]) | CheckedConvInt64Q (_, _, [x]) | CheckedConvByteQ (_, _, [x]) | CheckedConvUInt8Q (_, _, [x]) -> transConv inp env true x + | CheckedConvUInt16Q (_, _, [x]) | CheckedConvUInt32Q (_, _, [x]) | CheckedConvUInt64Q (_, _, [x]) | CheckedConvIntPtrQ (_, _, [x]) -> transConv inp env true x + | CheckedConvUIntPtrQ (_, _, [x]) -> transConv inp env true x + + | ArrayLookupQ (_, GenericArgs [|_; _; _|], [x1; x2]) -> Expression.ArrayIndex(ConvExprToLinqInContext env x1, ConvExprToLinqInContext env x2) |> asExpr // Throw away markers inserted to satisfy C#'s design where they pass an argument // or type T to an argument expecting Expression. - | ImplicitExpressionConversionHelperQ (_, [_], [x1]) -> ConvExprToLinqInContext env x1 + | ImplicitExpressionConversionHelperQ (_, GenericArgs [|_|], [x1]) -> ConvExprToLinqInContext env x1 // Use witnesses if they are available | CallWithWitnesses (objArgOpt, _, minfo2, witnessArgs, args) -> @@ -593,11 +727,11 @@ module LeafExpressionConverter = | NullableConstruction arg -> Expression.Convert(ConvExprToLinqInContext env arg, x.Type) |> asExpr | _ -> Expression.New(ctorInfo, ConvExprsToLinq env args) |> asExpr - | Patterns.NewDelegate(dty, vs, b) -> + | Patterns.NewDelegate(delegateTy, vs, b) -> let vsP = List.map ConvVarToLinq vs let env = {env with varEnv = List.foldBack2 (fun (v:Var) vP -> Map.add v (vP |> asExpr)) vs vsP env.varEnv } let bodyP = ConvExprToLinqInContext env b - Expression.Lambda(dty, bodyP, vsP) |> asExpr + Expression.Lambda(delegateTy, bodyP, vsP) |> asExpr | Patterns.NewTuple args -> let tupTy = @@ -665,15 +799,79 @@ module LeafExpressionConverter = 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()))) - and transBinOp inp env addConvertLeft args addConvertRight (exprErasedConstructor : _ * _ -> _) = - match args with - | [x1; x2] -> - let e1 = ConvExprToLinqInContext env x1 - let e2 = ConvExprToLinqInContext env x2 - let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 - let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 - exprErasedConstructor(e1, e2) |> asExpr - | _ -> failConvert inp + /// Translate a unary operator + and transUnaryOp linqExpressionsCondition inp env x (exprErasedConstructor: _ * _ -> _) fallback = + let e = ConvExprToLinqInContext env x + if linqExpressionsCondition e.Type then + exprErasedConstructor(e, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a shift operator + and transShiftOp inp env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1.Type = e2.Type && isLinqExpressionsSimpleShift e1.Type e2.Type then + exprErasedConstructor(e1, e2, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a non-shift binary operator that does not return a boolean + and transBinOp linqExpressionsCondition inp env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1 = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2 = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1.Type = e2.Type && linqExpressionsCondition e1.Type then + exprErasedConstructor(e1, e2, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle fallback :?> Reflection.MethodInfo + exprErasedConstructor(e1, e2, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + // The F# boolean structural equality / comparison operators do not take witnesses and the referenced methods are callable directly + /// Translate a non-shift binary operator without witnesses that does not return a boolean + and transBoolOpNoWitness linqExpressionsCondition env addConvertLeft x1 x2 addConvertRight (exprErasedConstructor: _ * _ * _ * _ -> _) method = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + let e1' = if addConvertLeft then Expression.Convert(e1, typedefof>.MakeGenericType [| e1.Type |]) |> asExpr else e1 + let e2' = if addConvertRight then Expression.Convert(e2, typedefof>.MakeGenericType [| e2.Type |]) |> asExpr else e2 + if e1'.Type = e2'.Type && linqExpressionsCondition e1.Type then + // 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 + exprErasedConstructor(e1, e2, false, method) + |> asExpr + + // But the static boolean operators do take witnesses! + /// Translate a non-shift binary operator that returns a boolean + and transBoolOp linqExpressionsCondition inp env x1 x2 (exprErasedConstructor: _ * _ * _ * _ -> _) fallback = + let e1 = ConvExprToLinqInContext env x1 + let e2 = ConvExprToLinqInContext env x2 + if e1.Type = e2.Type && linqExpressionsCondition e1.Type then + // 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 + exprErasedConstructor(e1, e2, false, method.MakeGenericMethod [| getNonNullableType x1.Type; getNonNullableType x2.Type; getNonNullableType inp.Type |]) + |> asExpr + + /// Translate a conversion operator + and transConv (inp: Expr) env isChecked x = + let e = ConvExprToLinqInContext env x + let exprErasedConstructor: _ * _ * _ -> _ = if isChecked then Expression.ConvertChecked else Expression.Convert + if isLinqExpressionsConvertible e.Type inp.Type then + exprErasedConstructor(e, inp.Type, null) + else + let method = Reflection.MethodInfo.GetMethodFromHandle (if isChecked then methodhandleof (fun x -> LanguagePrimitives.CheckedExplicitDynamic x) else methodhandleof (fun x -> LanguagePrimitives.ExplicitDynamic x)) :?> Reflection.MethodInfo + exprErasedConstructor(e, inp.Type, method.MakeGenericMethod [| getNonNullableType x.Type; getNonNullableType inp.Type |]) + |> asExpr and ConvObjArg env objOpt coerceTo : Expression = match objOpt with @@ -716,6 +914,4 @@ module LeafExpressionConverter = d.DynamicInvoke [| box () |] with :? System.Reflection.TargetInvocationException as exn -> raise exn.InnerException -#endif - - +#endif \ No newline at end of file diff --git a/src/FSharp.Core/Linq.fsi b/src/FSharp.Core/Linq.fsi index cfe61b4d1eb..13f3fa4187e 100644 --- a/src/FSharp.Core/Linq.fsi +++ b/src/FSharp.Core/Linq.fsi @@ -88,4 +88,4 @@ module LeafExpressionConverter = val SubstHelperRaw: Expr * Var[] * obj[] -> Expr val internal (|SpecificCallToMethod|_|): - System.RuntimeMethodHandle -> (Expr -> (Expr option * Type list * Expr list) option) + System.RuntimeMethodHandle -> (Expr -> (Expr option * Reflection.MethodInfo * Expr list) option) diff --git a/src/FSharp.Core/Query.fs b/src/FSharp.Core/Query.fs index 2701df53b1c..ae11d3835a1 100644 --- a/src/FSharp.Core/Query.fs +++ b/src/FSharp.Core/Query.fs @@ -314,26 +314,27 @@ module Query = match prop.GetGetMethod true with | null -> None | v -> Some v + let (|GenericArgs|) (minfo: MethodInfo) = minfo.GetGenericArguments() |> Array.toList // Match 'f x' let (|SpecificCall1|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1]) -> Some(builderObj, tyargs, arg1) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1]) -> Some(builderObj, tyargs, arg1) | _ -> None // Match 'f x y' or 'f (x, y)' let (|SpecificCall2|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1; arg2]) -> Some(builderObj, tyargs, arg1, arg2) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1; arg2]) -> Some(builderObj, tyargs, arg1, arg2) | _ -> None // Match 'f x y z' or 'f (x, y, z)' let (|SpecificCall3|_|) q = let (|CallQ|_|) = (|SpecificCallToMethod|_|) q function - | CallQ (Some builderObj, tyargs, [arg1; arg2; arg3]) -> Some(builderObj, tyargs, arg1, arg2, arg3) + | CallQ (Some builderObj, GenericArgs tyargs, [arg1; arg2; arg3]) -> Some(builderObj, tyargs, arg1, arg2, arg3) | _ -> None /// (fun (x, y) -> z) is represented as 'fun p -> let x = p#0 let y = p#1' etc. @@ -1286,7 +1287,7 @@ module Query = // rewrite has had the custom operator translation mechanism applied. In this case, the // body of the "for" will simply contain "yield". - | CallQueryBuilderFor (_, [_; qTy; immutResElemTy; _], [immutSource; Lambda(immutSelectorVar, immutSelector) ]) -> + | CallQueryBuilderFor (_, GenericArgs [_; qTy; immutResElemTy; _], [immutSource; Lambda(immutSelectorVar, immutSelector) ]) -> let mutSource, sourceConv = TransInner CanEliminate.Yes check immutSource @@ -1467,7 +1468,7 @@ module Query = | _ -> GroupingConv (immutKeySelector.Type, immutElementSelector.Type, selectorConv) TransInnerResult.Other(MakeGroupValBy(qTyIsIQueryable qTy, mutVar1.Type, mutKeySelector.Type, mutElementSelector.Type, mutSource, mutVar2, mutKeySelector, mutVar1, mutElementSelector)), conv - | CallJoin(_, [_; qTy; _; _; _], + | CallJoin(_, GenericArgs [_; qTy; _; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) @@ -1491,7 +1492,7 @@ module Query = TransInnerResult.Other joinExpr, elementSelectorConv | CallGroupJoin - (_, [_; qTy; _; _; _], + (_, GenericArgs [_; qTy; _; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) @@ -1517,7 +1518,7 @@ module Query = TransInnerResult.Other joinExpr, elementSelectorConv | CallLeftOuterJoin - (_, [ _; qTy; immutInnerSourceTy; _; _], + (_, GenericArgs [ _; qTy; immutInnerSourceTy; _; _], [ immutOuterSource immutInnerSource Lambda(immutOuterKeyVar, immutOuterKeySelector) diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 40b4941045b..1d5dcc28d05 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -2518,7 +2518,6 @@ namespace Microsoft.FSharp.Core // this condition is used whenever ^T is resolved to a nominal type when ^T : ^T = (^T : (static member Zero : ^T) ()) - let inline GenericOne< ^T when ^T : (static member One : ^T) > : ^T = GenericOneDynamic<(^T)>() when ^T : int32 = 1 @@ -2541,10 +2540,21 @@ namespace Microsoft.FSharp.Core when ^T : ^T = (^T : (static member One : ^T) ()) type Type with - + /// Gets a single static non-conversion operator or method by types member inline this.GetSingleStaticMethodByTypes(name: string, parameterTypes: Type[]) = - let staticBindingFlags = (# "" 0b111000 : BindingFlags #) // BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic - this.GetMethod(name, staticBindingFlags, null, parameterTypes, null ) + let staticBindingFlags = (# "" 0b111000 : BindingFlags #) // BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic + this.GetMethod(name, staticBindingFlags, null, parameterTypes, null ) + + // Logic based on https://github.com/dotnet/runtime/blob/f66b142980b2b0df738158457458e003944dc7f6/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs#L662 + /// Gets a single static conversion operator by types + member inline this.GetSingleStaticConversionOperatorByTypes(fromType : Type, toType : Type) = + 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")) && + (let p = mi.GetParameters() in p.Length = 1 && (get p 0).ParameterType.IsEquivalentTo fromType) && mi.ReturnType.IsEquivalentTo toType then + ret <- mi + ret let UnaryDynamicImpl nm : ('T -> 'U) = let aty = typeof<'T> @@ -2567,7 +2577,14 @@ namespace Microsoft.FSharp.Core match meth with | null -> - let ameth = aty.GetSingleStaticMethodByTypes(opName, [| aty |]) + let ameth = + if System.String.Equals(opName, "op_Explicit") then + let aty2 = typeof<'U> + match aty.GetSingleStaticConversionOperatorByTypes(aty, aty2) with + | null -> aty2.GetSingleStaticConversionOperatorByTypes(aty, aty2) + | ameth -> ameth + else + aty.GetSingleStaticMethodByTypes(opName, [| aty |]) match ameth with | null -> raise (NotSupportedException (SR.GetString(SR.dyInvOpAddCoerce))) | res -> @@ -2633,6 +2650,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.u2" (# "sub" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.i1" (# "sub" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.u1" (# "sub" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.u1" (# "sub" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, decimal> then convPrim<_,'U> (Decimal.op_Subtraction(convPrim<_,decimal> x, convPrim<_,decimal> y)) else BinaryOpDynamicImplTable.Invoke "op_Subtraction" x y @@ -2715,7 +2733,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, unativeint> then convPrim<_,'U> (# "add.ovf.un" (convPrim<_,unativeint> x) (convPrim<_,unativeint> y) : unativeint #) elif type3eq<'T1, 'T2, 'U, int16> then convPrim<_,'U> (# "conv.ovf.i2" (# "add.ovf" (convPrim<_,int16> x) (convPrim<_,int16> y) : int32 #) : int16 #) elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) - elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : uint16 #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "add.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.ovf.i1" (# "add.ovf" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.ovf.u1.un" (# "add.ovf.un" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) elif type3eq<'T1, 'T2, 'U, string> then convPrim<_,'U> (String.Concat(convPrim<_,string> x, convPrim<_,string> y)) @@ -2735,6 +2753,7 @@ namespace Microsoft.FSharp.Core elif type3eq<'T1, 'T2, 'U, unativeint> then convPrim<_,'U> (# "sub.ovf.un" (convPrim<_,unativeint> x) (convPrim<_,unativeint> y) : unativeint #) elif type3eq<'T1, 'T2, 'U, int16> then convPrim<_,'U> (# "conv.ovf.i2" (# "sub.ovf" (convPrim<_,int16> x) (convPrim<_,int16> y) : int32 #) : int16 #) elif type3eq<'T1, 'T2, 'U, uint16> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "sub.ovf.un" (convPrim<_,uint16> x) (convPrim<_,uint16> y) : uint32 #) : uint16 #) + elif type3eq<'T1, 'T2, 'U, char> then convPrim<_,'U> (# "conv.ovf.u2.un" (# "sub.ovf.un" (convPrim<_,char> x) (convPrim<_,char> y) : uint32 #) : char #) elif type3eq<'T1, 'T2, 'U, sbyte> then convPrim<_,'U> (# "conv.ovf.i1" (# "sub.ovf" (convPrim<_,sbyte> x) (convPrim<_,sbyte> y) : int32 #) : sbyte #) elif type3eq<'T1, 'T2, 'U, byte> then convPrim<_,'U> (# "conv.ovf.u1.un" (# "sub.ovf.un" (convPrim<_,byte> x) (convPrim<_,byte> y) : uint32 #) : byte #) elif type3eq<'T1, 'T2, 'U, decimal> then convPrim<_,'U> (Decimal.op_Subtraction(convPrim<_,decimal> x, convPrim<_,decimal> y)) @@ -2866,7 +2885,7 @@ namespace Microsoft.FSharp.Core let ExplicitDynamic<'T, 'U> (value: 'T) : 'U = if typeeq<'U, byte> then if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.u1" (convPrim<_,sbyte> value) : byte #) - elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.u1" (convPrim<_,byte> value) : byte #) + elif typeeq<'T, byte> then convPrim<_,'U> value elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u1" (convPrim<_,int16> value) : byte #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u1" (convPrim<_,uint16> value) : byte #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u1" (convPrim<_,int32> value) : byte #) @@ -2881,7 +2900,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, string> then convPrim<_,'U> (ParseByte (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, sbyte> then - if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.i1" (convPrim<_,sbyte> value) : sbyte #) + if typeeq<'T, sbyte> then convPrim<_,'U> value elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i1" (convPrim<_,byte> value) : sbyte #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i1" (convPrim<_,int16> value) : sbyte #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i1" (convPrim<_,uint16> value) : sbyte #) @@ -2900,7 +2919,7 @@ namespace Microsoft.FSharp.Core if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.u2" (convPrim<_,sbyte> value) : uint16 #) elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.u2" (convPrim<_,byte> value) : uint16 #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int16> value) : uint16 #) - elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u2" (convPrim<_,uint16> value) : uint16 #) + elif typeeq<'T, uint16> then convPrim<_,'U> value elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int32> value) : uint16 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,uint32> value) : uint16 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.u2" (convPrim<_,int64> value) : uint16 #) @@ -2909,13 +2928,13 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u2" (convPrim<_,unativeint> value) : uint16 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float> value) : uint16 #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float32> value) : uint16 #) - elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u2" (convPrim<_,char> value) : uint16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "" (convPrim<_,char> value) : uint16 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt16 (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, int16> then if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.i2" (convPrim<_,sbyte> value) : int16 #) elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i2" (convPrim<_,byte> value) : int16 #) - elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i2" (convPrim<_,int16> value) : int16 #) + elif typeeq<'T, int16> then convPrim<_,'U> value elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i2" (convPrim<_,uint16> value) : int16 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i2" (convPrim<_,int32> value) : int16 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.i2" (convPrim<_,uint32> value) : int16 #) @@ -2934,7 +2953,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int16> value) : uint32 #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint16> value) : uint32 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int32> value) : uint32 #) - elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint32> value) : uint32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> value elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.u4" (convPrim<_,int64> value) : uint32 #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u4" (convPrim<_,uint64> value) : uint32 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.u4" (convPrim<_,nativeint> value) : uint32 #) @@ -2949,8 +2968,8 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.i4" (convPrim<_,byte> value) : int32 #) elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int16> value) : int32 #) elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint16> value) : int32 #) - elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int32> value) : int32 #) - elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint32> value) : int32 #) + elif typeeq<'T, int32> then convPrim<_,'U> value + elif typeeq<'T, uint32> then convPrim<_,'U> (# "" (convPrim<_,uint32> value) : int32 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i4" (convPrim<_,int64> value) : int32 #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.i4" (convPrim<_,uint64> value) : int32 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i4" (convPrim<_,nativeint> value) : int32 #) @@ -2968,7 +2987,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,int32> value) : uint64 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint32> value) : uint64 #) elif typeeq<'T, int64> then convPrim<_,'U> (# "" (convPrim<_,int64> value) : uint64 #) - elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.i8" (convPrim<_,uint64> value) : uint64 #) + elif typeeq<'T, uint64> then convPrim<_,'U> value elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i8" (convPrim<_,nativeint> value) : uint64 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float> value) : uint64 #) @@ -2983,12 +3002,12 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint16> value) : int64 #) elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,int32> value) : int64 #) elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,uint32> value) : int64 #) - elif typeeq<'T, int64> then convPrim<_,'U> (convPrim<_,int64> value) + elif typeeq<'T, int64> then convPrim<_,'U> value elif typeeq<'T, uint64> then convPrim<_,'U> (# "" (convPrim<_,uint64> value) : int64 #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.i8" (convPrim<_,nativeint> value) : int64 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u8" (convPrim<_,unativeint> value) : int64 #) - elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float> value) : int64 #) - elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u8" (convPrim<_,float32> value) : int64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.i8" (convPrim<_,float> value) : int64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.i8" (convPrim<_,float32> value) : int64 #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u8" (convPrim<_,char> value) : int64 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseInt64 (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value @@ -3004,6 +3023,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r4" (convPrim<_,nativeint> value) : float32 #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,unativeint> value) : float32 #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float> value) : float32 #) + // NOTE: float32 should convert its argument to 32-bit float even when applied to a higher precision float stored in a register. See devdiv2#49888. elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float32> value) : float32 #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,char> value) : float32 #) elif typeeq<'T, string> then convPrim<_,'U> (ParseSingle (convPrim<_,string> value)) @@ -3019,6 +3039,7 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint64> value) : float #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r8" (convPrim<_,nativeint> value) : float #) elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,unativeint> value) : float #) + // NOTE: float should convert its argument to 64-bit float even when applied to a higher precision float stored in a register. See devdiv2#49888. elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float> value) : float #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float32> value) : float #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,char> value) : float #) @@ -3035,10 +3056,11 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i" (convPrim<_,int64> value) : unativeint #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint64> value) : unativeint #) elif typeeq<'T, nativeint> then convPrim<_,'U> (# "" (convPrim<_,nativeint> value) : unativeint #) - elif typeeq<'T, unativeint> then convPrim<_,'U> (# "" (convPrim<_,unativeint> value) : unativeint #) + elif typeeq<'T, unativeint> then convPrim<_,'U> value elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u" (convPrim<_,float> value) : unativeint #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u" (convPrim<_,float32> value) : unativeint #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u" (convPrim<_,char> value) : unativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.u" (Decimal.op_Explicit (convPrim<_,decimal> value) : uint64) : unativeint #) elif typeeq<'T, string> then convPrim<_,'U> (ParseUIntPtr (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, nativeint> then @@ -3050,11 +3072,12 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint32> value) : nativeint #) elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.i" (convPrim<_,int64> value) : nativeint #) elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.u" (convPrim<_,uint64> value) : nativeint #) - elif typeeq<'T, nativeint> then convPrim<_,'U> (# "" (convPrim<_,nativeint> value) : nativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> value elif typeeq<'T, unativeint> then convPrim<_,'U> (# "" (convPrim<_,unativeint> value) : nativeint #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.i" (convPrim<_,float> value) : nativeint #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.i" (convPrim<_,float32> value) : nativeint #) elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u" (convPrim<_,char> value) : nativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.i" (Decimal.op_Explicit (convPrim<_,decimal> value) : int64) : nativeint #) elif typeeq<'T, string> then convPrim<_,'U> (ParseIntPtr (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, char> then @@ -3070,7 +3093,8 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.u2" (convPrim<_,unativeint> value) : char #) elif typeeq<'T, float> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float> value) : char #) elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.u2" (convPrim<_,float32> value) : char #) - elif typeeq<'T, char> then convPrim<_,'U> (# "conv.u2" (convPrim<_,char> 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> (Char.Parse (convPrim<_,string> value)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value elif typeeq<'U, decimal> then @@ -3086,7 +3110,240 @@ namespace Microsoft.FSharp.Core elif typeeq<'T, unativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #)) elif typeeq<'T, float> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float> value)) elif typeeq<'T, float32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float32> value)) - elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,char> value)) + elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (# "" (convPrim<_,char> value) : uint16 #)) + elif typeeq<'T, decimal> then convPrim<_,'U> value + elif typeeq<'T, string> then convPrim<_,'U> (Decimal.Parse(convPrim<_,string> value, NumberStyles.Float,CultureInfo.InvariantCulture)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + else + UnaryOpDynamicImplTable.Invoke "op_Explicit" value + + let CheckedExplicitDynamic<'T, 'U> (value: 'T) : 'U = + if typeeq<'U, byte> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,sbyte> value) : byte #) + elif typeeq<'T, byte> then convPrim<_,'U> value + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int16> value) : byte #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint16> value) : byte #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int32> value) : byte #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint32> value) : byte #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,int64> value) : byte #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,uint64> value) : byte #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,nativeint> value) : byte #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,unativeint> value) : byte #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,float> value) : byte #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u1" (convPrim<_,float32> value) : byte #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u1.un" (convPrim<_,char> value) : byte #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseByte (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, sbyte> then + if typeeq<'T, sbyte> then convPrim<_,'U> value + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,byte> value) : sbyte #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int16> value) : sbyte #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint16> value) : sbyte #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int32> value) : sbyte #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint32> value) : sbyte #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,int64> value) : sbyte #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,uint64> value) : sbyte #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,nativeint> value) : sbyte #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,unativeint> value) : sbyte #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,float> value) : sbyte #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i1" (convPrim<_,float32> value) : sbyte #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i1.un" (convPrim<_,char> value) : sbyte #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseSByte (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint16> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,sbyte> value) : uint16 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,byte> value) : uint16 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int16> value) : uint16 #) + elif typeeq<'T, uint16> then convPrim<_,'U> value + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int32> value) : uint16 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint32> value) : uint16 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int64> value) : uint16 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint64> value) : uint16 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,nativeint> value) : uint16 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,unativeint> value) : uint16 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float> value) : uint16 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float32> value) : uint16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "" (convPrim<_,char> value) : uint16 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt16 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int16> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,sbyte> value) : int16 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,byte> value) : int16 #) + elif typeeq<'T, int16> then convPrim<_,'U> value + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint16> value) : int16 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,int32> value) : int16 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint32> value) : int16 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,int64> value) : int16 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,uint64> value) : int16 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,nativeint> value) : int16 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,unativeint> value) : int16 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,float> value) : int16 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i2" (convPrim<_,float32> value) : int16 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i2.un" (convPrim<_,char> value) : int16 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt16 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,sbyte> value) : uint32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,byte> value) : uint32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int16> value) : uint32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,uint16> value) : uint32 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int32> value) : uint32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> value + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,int64> value) : uint32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,uint64> value) : uint32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,nativeint> value) : uint32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,unativeint> value) : uint32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,float> value) : uint32 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u4" (convPrim<_,float32> value) : uint32 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u4.un" (convPrim<_,char> value) : uint32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt32 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,sbyte> value) : int32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,byte> value) : int32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,int16> value) : int32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint16> value) : int32 #) + elif typeeq<'T, int32> then convPrim<_,'U> value + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint32> value) : int32 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,int64> value) : int32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,uint64> value) : int32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,nativeint> value) : int32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,unativeint> value) : int32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,float> value) : int32 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i4" (convPrim<_,float32> value) : int32 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i4.un" (convPrim<_,char> value) : int32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt32 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, uint64> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,sbyte> value) : uint64 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,byte> value) : uint64 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int16> value) : uint64 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,uint16> value) : uint64 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int32> value) : uint64 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,uint32> value) : uint64 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,int64> value) : uint64 #) + elif typeeq<'T, uint64> then convPrim<_,'U> value + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,nativeint> value) : uint64 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,unativeint> value) : uint64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,float> value) : uint64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u8" (convPrim<_,float32> value) : uint64 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u8.un" (convPrim<_,char> value) : uint64 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUInt64 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, int64> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,sbyte> value) : int64 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,byte> value) : int64 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,int16> value) : int64 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint16> value) : int64 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,int32> value) : int64 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint32> value) : int64 #) + elif typeeq<'T, int64> then convPrim<_,'U> value + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,uint64> value) : int64 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,nativeint> value) : int64 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,unativeint> value) : int64 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,float> value) : int64 #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i8" (convPrim<_,float32> value) : int64 #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i8.un" (convPrim<_,char> value) : int64 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseInt64 (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, float32> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.r4" (convPrim<_,sbyte> value) : float32 #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,byte> value) : float32 #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int16> value) : float32 #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint16> value) : float32 #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int32> value) : float32 #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint32> value) : float32 #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.r4" (convPrim<_,int64> value) : float32 #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,uint64> value) : float32 #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r4" (convPrim<_,nativeint> value) : float32 #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,unativeint> value) : float32 #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.r4" (convPrim<_,float> value) : float32 #) + elif typeeq<'T, float32> then convPrim<_,'U> value + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r4" (convPrim<_,char> value) : float32 #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseSingle (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, float> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.r8" (convPrim<_,sbyte> value) : float #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,byte> value) : float #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int16> value) : float #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint16> value) : float #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int32> value) : float #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint32> value) : float #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.r8" (convPrim<_,int64> value) : float #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,uint64> value) : float #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.r8" (convPrim<_,nativeint> value) : float #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,unativeint> value) : float #) + elif typeeq<'T, float> then convPrim<_,'U> value + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.r8" (convPrim<_,float32> value) : float #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.r.un conv.r8" (convPrim<_,char> value) : float #) + elif typeeq<'T, decimal> then convPrim<_,'U> (Convert.ToDouble(convPrim<_,decimal> value)) + elif typeeq<'T, string> then convPrim<_,'U> (ParseDouble (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, unativeint> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,sbyte> value) : unativeint #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,byte> value) : unativeint #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int16> value) : unativeint #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint16> value) : unativeint #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int32> value) : unativeint #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint32> value) : unativeint #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,int64> value) : unativeint #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,uint64> value) : unativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,nativeint> value) : unativeint #) + elif typeeq<'T, unativeint> then convPrim<_,'U> value + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,float> value) : unativeint #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.u" (convPrim<_,float32> value) : unativeint #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.u.un" (convPrim<_,char> value) : unativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.ovf.u" (Decimal.op_Explicit (convPrim<_,decimal> value) : uint64) : unativeint #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseUIntPtr (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, nativeint> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,sbyte> value) : nativeint #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,byte> value) : nativeint #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int16> value) : nativeint #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint16> value) : nativeint #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int32> value) : nativeint #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint32> value) : nativeint #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,int64> value) : nativeint #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,uint64> value) : nativeint #) + elif typeeq<'T, nativeint> then convPrim<_,'U> value + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,unativeint> value) : nativeint #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,float> value) : nativeint #) + elif typeeq<'T, float32> then convPrim<_,'U> (# "conv.ovf.i" (convPrim<_,float32> value) : nativeint #) + elif typeeq<'T, char> then convPrim<_,'U> (# "conv.ovf.i.un" (convPrim<_,char> value) : nativeint #) + elif typeeq<'T, decimal> then convPrim<_,'U> (# "conv.ovf.i" (Decimal.op_Explicit (convPrim<_,decimal> value) : int64) : nativeint #) + elif typeeq<'T, string> then convPrim<_,'U> (ParseIntPtr (convPrim<_,string> value)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, char> then + if typeeq<'T, sbyte> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,sbyte> value) : char #) + elif typeeq<'T, byte> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,byte> value) : char #) + elif typeeq<'T, int16> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int16> value) : char #) + elif typeeq<'T, uint16> then convPrim<_,'U> (# "" (convPrim<_,uint16> value) : char #) + elif typeeq<'T, int32> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int32> value) : char #) + elif typeeq<'T, uint32> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint32> value) : char #) + elif typeeq<'T, int64> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,int64> value) : char #) + elif typeeq<'T, uint64> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,uint64> value) : char #) + elif typeeq<'T, nativeint> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,nativeint> value) : char #) + elif typeeq<'T, unativeint> then convPrim<_,'U> (# "conv.ovf.u2.un" (convPrim<_,unativeint> value) : char #) + elif typeeq<'T, float> then convPrim<_,'U> (# "conv.ovf.u2" (convPrim<_,float> value) : char #) + 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)) + else UnaryOpDynamicImplTable.Invoke "op_Explicit" value + elif typeeq<'U, decimal> then + if typeeq<'T, sbyte> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,sbyte> value)) + elif typeeq<'T, byte> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,byte> value)) + elif typeeq<'T, int16> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int16> value)) + elif typeeq<'T, uint16> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint16> value)) + elif typeeq<'T, int32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int32> value)) + elif typeeq<'T, uint32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint32> value)) + elif typeeq<'T, int64> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,int64> value)) + elif typeeq<'T, uint64> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,uint64> value)) + elif typeeq<'T, nativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.i8" (convPrim<_,nativeint> value) : int64 #)) + elif typeeq<'T, unativeint> then convPrim<_,'U> (Convert.ToDecimal (# "conv.u8" (convPrim<_,unativeint> value) : uint64 #)) + elif typeeq<'T, float> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float> value)) + elif typeeq<'T, float32> then convPrim<_,'U> (Convert.ToDecimal (convPrim<_,float32> value)) + elif typeeq<'T, char> then convPrim<_,'U> (Convert.ToDecimal (# "" (convPrim<_,char> value) : uint16 #)) elif typeeq<'T, decimal> then convPrim<'T,'U> value elif typeeq<'T, string> then convPrim<_,'U> (Decimal.Parse(convPrim<_,string> value, NumberStyles.Float,CultureInfo.InvariantCulture)) else UnaryOpDynamicImplTable.Invoke "op_Explicit" value @@ -3211,7 +3468,7 @@ namespace Microsoft.FSharp.Core elif type2eq<'T1, 'T2, char> && typeeq<'U, bool> then convPrim<_,'U> (not (# "ceq" (convPrim<_,char> x) (convPrim<_,char> y) : bool #)) elif type2eq<'T1, 'T2, decimal> && typeeq<'U, bool> then convPrim<_,'U> (Decimal.op_Inequality (convPrim<_,decimal> x, convPrim<_,decimal> y)) elif type2eq<'T1, 'T2, string> && typeeq<'U, bool> then convPrim<_,'U> (not (String.Equals (convPrim<_,string> x, convPrim<_,string> y))) - else BinaryOpDynamicImplTable.Invoke "op_Inequality" x y + else BinaryOpDynamicImplTable.Invoke "op_Inequality" x y type DivideByIntInfo = class end @@ -4054,6 +4311,7 @@ namespace Microsoft.FSharp.Core when ^T : unativeint and ^U : unativeint = (# "sub" x y : unativeint #) when ^T : int16 and ^U : int16 = (# "conv.i2" (# "sub" x y : int32 #) : int16 #) when ^T : uint16 and ^U : uint16 = (# "conv.u2" (# "sub" x y : uint32 #) : uint16 #) + when ^T : char and ^U : char = (# "conv.u2" (# "sub" x y : uint32 #) : char #) when ^T : sbyte and ^U : sbyte = (# "conv.i1" (# "sub" x y : int32 #) : sbyte #) when ^T : byte and ^U : byte = (# "conv.u1" (# "sub" x y : uint32 #) : byte #) when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) @@ -4283,7 +4541,7 @@ namespace Microsoft.FSharp.Core when ^T : uint16 = (# "conv.u1" value : byte #) when ^T : char = (# "conv.u1" value : byte #) when ^T : unativeint = (# "conv.u1" value : byte #) - when ^T : byte = (# "conv.u1" value : byte #) + when ^T : byte = (# "" value : byte #) // According to the somewhat subtle rules of static optimizations, // this condition is used whenever ^T is resolved to a nominal type or witnesses are available when ^T : ^T = (^T : (static member op_Explicit: ^T -> byte) (value)) @@ -4299,11 +4557,11 @@ namespace Microsoft.FSharp.Core when ^T : int32 = (# "conv.i1" value : sbyte #) when ^T : int16 = (# "conv.i1" value : sbyte #) when ^T : nativeint = (# "conv.i1" value : sbyte #) - when ^T : sbyte = (# "conv.i1" value : sbyte #) - when ^T : uint64 = (# "conv.i1" value : sbyte #) - when ^T : uint32 = (# "conv.i1" value : sbyte #) - when ^T : uint16 = (# "conv.i1" value : sbyte #) - when ^T : char = (# "conv.i1" value : sbyte #) + when ^T : sbyte = (# "" value : sbyte #) + when ^T : uint64 = (# "conv.i1" value : sbyte #) + when ^T : uint32 = (# "conv.i1" value : sbyte #) + when ^T : uint16 = (# "conv.i1" value : sbyte #) + when ^T : char = (# "conv.i1" value : sbyte #) when ^T : unativeint = (# "conv.i1" value : sbyte #) when ^T : byte = (# "conv.i1" value : sbyte #) // According to the somewhat subtle rules of static optimizations, @@ -4322,10 +4580,10 @@ namespace Microsoft.FSharp.Core when ^T : int16 = (# "conv.u2" value : uint16 #) when ^T : nativeint = (# "conv.u2" value : uint16 #) when ^T : sbyte = (# "conv.u2" value : uint16 #) - when ^T : uint64 = (# "conv.u2" value : uint16 #) - when ^T : uint32 = (# "conv.u2" value : uint16 #) - when ^T : uint16 = (# "conv.u2" value : uint16 #) - when ^T : char = (# "conv.u2" value : uint16 #) + when ^T : uint64 = (# "conv.u2" value : uint16 #) + when ^T : uint32 = (# "conv.u2" value : uint16 #) + when ^T : uint16 = (# "" value : uint16 #) + when ^T : char = (# "" value : uint16 #) when ^T : unativeint = (# "conv.u2" value : uint16 #) when ^T : byte = (# "conv.u2" value : uint16 #) // According to the somewhat subtle rules of static optimizations, @@ -4341,7 +4599,7 @@ namespace Microsoft.FSharp.Core when ^T : float32 = (# "conv.i2" value : int16 #) when ^T : int64 = (# "conv.i2" value : int16 #) when ^T : int32 = (# "conv.i2" value : int16 #) - when ^T : int16 = (# "conv.i2" value : int16 #) + when ^T : int16 = (# "" value : int16 #) when ^T : nativeint = (# "conv.i2" value : int16 #) when ^T : sbyte = (# "conv.i2" value : int16 #) when ^T : uint64 = (# "conv.i2" value : int16 #) @@ -4368,10 +4626,10 @@ namespace Microsoft.FSharp.Core when ^T : int32 = (# "" value : uint32 #) when ^T : int16 = (# "" value : uint32 #) when ^T : sbyte = (# "" value : uint32 #) - when ^T : uint64 = (# "conv.u4" value : uint32 #) - when ^T : uint32 = (# "conv.u4" value : uint32 #) - when ^T : uint16 = (# "conv.u4" value : uint32 #) - when ^T : char = (# "conv.u4" value : uint32 #) + when ^T : uint64 = (# "conv.u4" value : uint32 #) + when ^T : uint32 = (# "" value : uint32 #) + when ^T : uint16 = (# "conv.u4" value : uint32 #) + when ^T : char = (# "conv.u4" value : uint32 #) when ^T : unativeint = (# "conv.u4" value : uint32 #) when ^T : byte = (# "conv.u4" value : uint32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint32) (value)) @@ -4453,7 +4711,7 @@ namespace Microsoft.FSharp.Core when ^T : string = ParseInt64 (castToString value) when ^T : float = (# "conv.i8" value : int64 #) when ^T : float32 = (# "conv.i8" value : int64 #) - when ^T : int64 = (# "conv.i8" value : int64 #) + when ^T : int64 = (# "" value : int64 #) when ^T : int32 = (# "conv.i8" value : int64 #) when ^T : int16 = (# "conv.i8" value : int64 #) when ^T : nativeint = (# "conv.i8" value : int64 #) @@ -4517,18 +4775,19 @@ namespace Microsoft.FSharp.Core let inline decimal (value: ^T) = ExplicitDynamic<(^T), decimal> value when ^T : string = (Decimal.Parse(castToString value,NumberStyles.Float,CultureInfo.InvariantCulture)) - when ^T : float = (Convert.ToDecimal((# "" value : float #))) - when ^T : float32 = (Convert.ToDecimal((# "" value : float32 #))) - when ^T : int64 = (Convert.ToDecimal((# "" value : int64 #))) - when ^T : int32 = (Convert.ToDecimal((# "" value : int32 #))) - when ^T : int16 = (Convert.ToDecimal((# "" value : int16 #))) - when ^T : nativeint = (Convert.ToDecimal(int64 (# "" value : nativeint #))) - when ^T : sbyte = (Convert.ToDecimal((# "" value : sbyte #))) - when ^T : uint64 = (Convert.ToDecimal((# "" value : uint64 #))) - when ^T : uint32 = (Convert.ToDecimal((# "" value : uint32 #))) - when ^T : uint16 = (Convert.ToDecimal((# "" value : uint16 #))) - when ^T : unativeint = (Convert.ToDecimal(uint64 (# "" value : unativeint #))) - when ^T : byte = (Convert.ToDecimal((# "" value : byte #))) + when ^T : float = (Convert.ToDecimal((# "" value : float #))) + when ^T : float32 = (Convert.ToDecimal((# "" value : float32 #))) + when ^T : int64 = (Convert.ToDecimal((# "" value : int64 #))) + when ^T : int32 = (Convert.ToDecimal((# "" value : int32 #))) + when ^T : int16 = (Convert.ToDecimal((# "" value : int16 #))) + when ^T : nativeint = (Convert.ToDecimal(int64 (# "" value : nativeint #))) + when ^T : sbyte = (Convert.ToDecimal((# "" value : sbyte #))) + when ^T : uint64 = (Convert.ToDecimal((# "" value : uint64 #))) + when ^T : uint32 = (Convert.ToDecimal((# "" value : uint32 #))) + when ^T : uint16 = (Convert.ToDecimal((# "" value : uint16 #))) + when ^T : unativeint = (Convert.ToDecimal(uint64 (# "" value : unativeint #))) + when ^T : byte = (Convert.ToDecimal((# "" value : byte #))) + when ^T : char = (Convert.ToDecimal((# "" value : uint16 #))) // Don't use the char overload which unconditionally raises an exception when ^T : decimal = (# "" value : decimal #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> decimal) (value)) @@ -4553,7 +4812,8 @@ namespace Microsoft.FSharp.Core when ^T : uint16 = (# "conv.u" value : unativeint #) when ^T : char = (# "conv.u" value : unativeint #) when ^T : unativeint = (# "" value : unativeint #) - when ^T : byte = (# "conv.u" value : unativeint #) + when ^T : byte = (# "conv.u" value : unativeint #) + when ^T : decimal = (# "conv.u" (uint64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> unativeint) (value)) [] @@ -4566,7 +4826,7 @@ namespace Microsoft.FSharp.Core when ^T : int64 = (# "conv.i" value : nativeint #) when ^T : int32 = (# "conv.i" value : nativeint #) when ^T : int16 = (# "conv.i" value : nativeint #) - when ^T : nativeint = (# "conv.i" value : nativeint #) + when ^T : nativeint = (# "" value : nativeint #) when ^T : sbyte = (# "conv.i" value : nativeint #) // Narrower unsigned types we zero-extend. // Same length unsigned types we leave as such (so unsigned MaxValue (all-bits-set) gets reinterpreted as -1). @@ -4578,6 +4838,7 @@ namespace Microsoft.FSharp.Core when ^T : char = (# "conv.u" value : nativeint #) when ^T : unativeint = (# "" value : nativeint #) when ^T : byte = (# "conv.i" value : nativeint #) + when ^T : decimal = (# "conv.i" (int64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) [] @@ -4651,8 +4912,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.u2" value : char #) when ^T : uint64 = (# "conv.u2" value : char #) when ^T : uint32 = (# "conv.u2" value : char #) - when ^T : uint16 = (# "conv.u2" value : char #) - when ^T : char = (# "conv.u2" value : char #) + when ^T : uint16 = (# "" value : char #) + when ^T : char = (# "" value : char #) when ^T : unativeint = (# "conv.u2" value : char #) when ^T : byte = (# "conv.u2" value : char #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> char) (value)) @@ -4980,11 +5241,12 @@ namespace Microsoft.FSharp.Core when ^T : uint32 and ^U : uint32 = (# "sub.ovf.un" x y : uint32 #) when ^T : nativeint and ^U : nativeint = (# "sub.ovf" x y : nativeint #) when ^T : unativeint and ^U : unativeint = (# "sub.ovf.un" x y : unativeint #) - when ^T : int16 and ^U : int16 = (# "conv.ovf.i2" (# "sub.ovf" x y : int32 #) : int16 #) - when ^T : uint16 and ^U : uint16 = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : uint16 #) - when ^T : sbyte and ^U : sbyte = (# "conv.ovf.i1" (# "sub.ovf" x y : int32 #) : sbyte #) - when ^T : byte and ^U : byte = (# "conv.ovf.u1.un" (# "sub.ovf.un" x y : uint32 #) : byte #) - when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) + when ^T : int16 and ^U : int16 = (# "conv.ovf.i2" (# "sub.ovf" x y : int32 #) : int16 #) + when ^T : uint16 and ^U : uint16 = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : uint16 #) + when ^T : char and ^U : char = (# "conv.ovf.u2.un" (# "sub.ovf.un" x y : uint32 #) : char #) + when ^T : sbyte and ^U : sbyte = (# "conv.ovf.i1" (# "sub.ovf" x y : int32 #) : sbyte #) + when ^T : byte and ^U : byte = (# "conv.ovf.u1.un" (# "sub.ovf.un" x y : uint32 #) : byte #) + when ^T : decimal and ^U : decimal = (# "" (Decimal.op_Subtraction((# "" x : decimal #),(# "" y : decimal #))) : ^V #) when ^T : ^T = ((^T or ^U): (static member (-) : ^T * ^U -> ^V) (x,y)) [] @@ -5023,47 +5285,47 @@ namespace Microsoft.FSharp.Core [] [] let inline byte (value: ^T) = - ExplicitDynamic<(^T),byte> value - when ^T : string = ParseByte (castToString value) - when ^T : float = (# "conv.ovf.u1" value : byte #) - when ^T : float32 = (# "conv.ovf.u1" value : byte #) - when ^T : int64 = (# "conv.ovf.u1" value : byte #) - when ^T : int32 = (# "conv.ovf.u1" value : byte #) - when ^T : int16 = (# "conv.ovf.u1" value : byte #) - when ^T : nativeint = (# "conv.ovf.u1" value : byte #) - when ^T : sbyte = (# "conv.ovf.u1" value : byte #) - when ^T : uint64 = (# "conv.ovf.u1.un" value : byte #) - when ^T : uint32 = (# "conv.ovf.u1.un" value : byte #) - when ^T : uint16 = (# "conv.ovf.u1.un" value : byte #) - when ^T : char = (# "conv.ovf.u1.un" value : byte #) + CheckedExplicitDynamic<(^T),byte> value + when ^T : string = ParseByte (castToString value) + when ^T : float = (# "conv.ovf.u1" value : byte #) + when ^T : float32 = (# "conv.ovf.u1" value : byte #) + when ^T : int64 = (# "conv.ovf.u1" value : byte #) + when ^T : int32 = (# "conv.ovf.u1" value : byte #) + when ^T : int16 = (# "conv.ovf.u1" value : byte #) + when ^T : nativeint = (# "conv.ovf.u1" value : byte #) + when ^T : sbyte = (# "conv.ovf.u1" value : byte #) + when ^T : uint64 = (# "conv.ovf.u1.un" value : byte #) + when ^T : uint32 = (# "conv.ovf.u1.un" value : byte #) + when ^T : uint16 = (# "conv.ovf.u1.un" value : byte #) + when ^T : char = (# "conv.ovf.u1.un" value : byte #) when ^T : unativeint = (# "conv.ovf.u1.un" value : byte #) - when ^T : byte = (# "conv.ovf.u1.un" value : byte #) + when ^T : byte = (# "" value : byte #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> byte) (value)) [] [] let inline sbyte (value: ^T) = - ExplicitDynamic<(^T),sbyte> value - when ^T : string = ParseSByte (castToString value) - when ^T : float = (# "conv.ovf.i1" value : sbyte #) - when ^T : float32 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int64 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int32 = (# "conv.ovf.i1" value : sbyte #) - when ^T : int16 = (# "conv.ovf.i1" value : sbyte #) - when ^T : nativeint = (# "conv.ovf.i1" value : sbyte #) - when ^T : sbyte = (# "conv.ovf.i1" value : sbyte #) - when ^T : uint64 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : uint32 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : uint16 = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : char = (# "conv.ovf.i1.un" value : sbyte #) + CheckedExplicitDynamic<(^T),sbyte> value + when ^T : string = ParseSByte (castToString value) + when ^T : float = (# "conv.ovf.i1" value : sbyte #) + when ^T : float32 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int64 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int32 = (# "conv.ovf.i1" value : sbyte #) + when ^T : int16 = (# "conv.ovf.i1" value : sbyte #) + when ^T : nativeint = (# "conv.ovf.i1" value : sbyte #) + when ^T : sbyte = (# "" value : sbyte #) + when ^T : uint64 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : uint32 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : uint16 = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : char = (# "conv.ovf.i1.un" value : sbyte #) when ^T : unativeint = (# "conv.ovf.i1.un" value : sbyte #) - when ^T : byte = (# "conv.ovf.i1.un" value : sbyte #) + when ^T : byte = (# "conv.ovf.i1.un" value : sbyte #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> sbyte) (value)) [] [] let inline uint16 (value: ^T) = - ExplicitDynamic<(^T),uint16> value + CheckedExplicitDynamic<(^T),uint16> value when ^T : string = ParseUInt16 (castToString value) when ^T : float = (# "conv.ovf.u2" value : uint16 #) when ^T : float32 = (# "conv.ovf.u2" value : uint16 #) @@ -5074,8 +5336,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.ovf.u2" value : uint16 #) when ^T : uint64 = (# "conv.ovf.u2.un" value : uint16 #) when ^T : uint32 = (# "conv.ovf.u2.un" value : uint16 #) - when ^T : uint16 = (# "conv.ovf.u2.un" value : uint16 #) - when ^T : char = (# "conv.ovf.u2.un" value : uint16 #) + when ^T : uint16 = (# "" value : uint16 #) + when ^T : char = (# "" value : uint16 #) when ^T : unativeint = (# "conv.ovf.u2.un" value : uint16 #) when ^T : byte = (# "conv.ovf.u2.un" value : uint16 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint16) (value)) @@ -5083,7 +5345,7 @@ namespace Microsoft.FSharp.Core [] [] let inline char (value: ^T) = - ExplicitDynamic<(^T), char> value + CheckedExplicitDynamic<(^T), char> value when ^T : string = (Char.Parse(castToString value)) when ^T : float = (# "conv.ovf.u2" value : char #) when ^T : float32 = (# "conv.ovf.u2" value : char #) @@ -5094,8 +5356,8 @@ namespace Microsoft.FSharp.Core when ^T : sbyte = (# "conv.ovf.u2" value : char #) when ^T : uint64 = (# "conv.ovf.u2.un" value : char #) when ^T : uint32 = (# "conv.ovf.u2.un" value : char #) - when ^T : uint16 = (# "conv.ovf.u2.un" value : char #) - when ^T : char = (# "conv.ovf.u2.un" value : char #) + when ^T : uint16 = (# "" value : char #) + when ^T : char = (# "" value : char #) when ^T : unativeint = (# "conv.ovf.u2.un" value : char #) when ^T : byte = (# "conv.ovf.u2.un" value : char #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> char) (value)) @@ -5103,61 +5365,61 @@ namespace Microsoft.FSharp.Core [] [] let inline int16 (value: ^T) = - ExplicitDynamic<(^T), int16> value - when ^T : string = ParseInt16 (castToString value) - when ^T : float = (# "conv.ovf.i2" value : int16 #) - when ^T : float32 = (# "conv.ovf.i2" value : int16 #) - when ^T : int64 = (# "conv.ovf.i2" value : int16 #) - when ^T : int32 = (# "conv.ovf.i2" value : int16 #) - when ^T : int16 = (# "conv.ovf.i2" value : int16 #) - when ^T : nativeint = (# "conv.ovf.i2" value : int16 #) - when ^T : sbyte = (# "conv.ovf.i2" value : int16 #) - when ^T : uint64 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : uint32 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : uint16 = (# "conv.ovf.i2.un" value : int16 #) - when ^T : char = (# "conv.ovf.i2.un" value : int16 #) + CheckedExplicitDynamic<(^T), int16> value + when ^T : string = ParseInt16 (castToString value) + when ^T : float = (# "conv.ovf.i2" value : int16 #) + when ^T : float32 = (# "conv.ovf.i2" value : int16 #) + when ^T : int64 = (# "conv.ovf.i2" value : int16 #) + when ^T : int32 = (# "conv.ovf.i2" value : int16 #) + when ^T : int16 = (# "" value : int16 #) + when ^T : nativeint = (# "conv.ovf.i2" value : int16 #) + when ^T : sbyte = (# "conv.ovf.i2" value : int16 #) + when ^T : uint64 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : uint32 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : uint16 = (# "conv.ovf.i2.un" value : int16 #) + when ^T : char = (# "conv.ovf.i2.un" value : int16 #) when ^T : unativeint = (# "conv.ovf.i2.un" value : int16 #) - when ^T : byte = (# "conv.ovf.i2.un" value : int16 #) + when ^T : byte = (# "conv.ovf.i2.un" value : int16 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int16) (value)) [] [] let inline uint32 (value: ^T) = - ExplicitDynamic<(^T), uint32> value - when ^T : string = ParseUInt32 (castToString value) - when ^T : float = (# "conv.ovf.u4" value : uint32 #) - when ^T : float32 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int64 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int32 = (# "conv.ovf.u4" value : uint32 #) - when ^T : int16 = (# "conv.ovf.u4" value : uint32 #) - when ^T : nativeint = (# "conv.ovf.u4" value : uint32 #) - when ^T : sbyte = (# "conv.ovf.u4" value : uint32 #) - when ^T : uint64 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : uint32 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : uint16 = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : char = (# "conv.ovf.u4.un" value : uint32 #) + CheckedExplicitDynamic<(^T), uint32> value + when ^T : string = ParseUInt32 (castToString value) + when ^T : float = (# "conv.ovf.u4" value : uint32 #) + when ^T : float32 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int64 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int32 = (# "conv.ovf.u4" value : uint32 #) + when ^T : int16 = (# "conv.ovf.u4" value : uint32 #) + when ^T : nativeint = (# "conv.ovf.u4" value : uint32 #) + when ^T : sbyte = (# "conv.ovf.u4" value : uint32 #) + when ^T : uint64 = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : uint32 = (# "" value : uint32 #) + when ^T : uint16 = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : char = (# "conv.ovf.u4.un" value : uint32 #) when ^T : unativeint = (# "conv.ovf.u4.un" value : uint32 #) - when ^T : byte = (# "conv.ovf.u4.un" value : uint32 #) + when ^T : byte = (# "conv.ovf.u4.un" value : uint32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint32) (value)) [] [] let inline int32 (value: ^T) = - ExplicitDynamic<(^T), int32> value - when ^T : string = ParseInt32 (castToString value) - when ^T : float = (# "conv.ovf.i4" value : int32 #) - when ^T : float32 = (# "conv.ovf.i4" value : int32 #) - when ^T : int64 = (# "conv.ovf.i4" value : int32 #) - when ^T : int32 = (# "conv.ovf.i4" value : int32 #) - when ^T : int16 = (# "conv.ovf.i4" value : int32 #) - when ^T : nativeint = (# "conv.ovf.i4" value : int32 #) - when ^T : sbyte = (# "conv.ovf.i4" value : int32 #) - when ^T : uint64 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : uint32 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : uint16 = (# "conv.ovf.i4.un" value : int32 #) - when ^T : char = (# "conv.ovf.i4.un" value : int32 #) + CheckedExplicitDynamic<(^T), int32> value + when ^T : string = ParseInt32 (castToString value) + when ^T : float = (# "conv.ovf.i4" value : int32 #) + when ^T : float32 = (# "conv.ovf.i4" value : int32 #) + when ^T : int64 = (# "conv.ovf.i4" value : int32 #) + when ^T : int32 = (# "" value : int32 #) + when ^T : int16 = (# "conv.ovf.i4" value : int32 #) + when ^T : nativeint = (# "conv.ovf.i4" value : int32 #) + when ^T : sbyte = (# "conv.ovf.i4" value : int32 #) + when ^T : uint64 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : uint32 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : uint16 = (# "conv.ovf.i4.un" value : int32 #) + when ^T : char = (# "conv.ovf.i4.un" value : int32 #) when ^T : unativeint = (# "conv.ovf.i4.un" value : int32 #) - when ^T : byte = (# "conv.ovf.i4.un" value : int32 #) + when ^T : byte = (# "conv.ovf.i4.un" value : int32 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int32) (value)) [] @@ -5166,81 +5428,83 @@ namespace Microsoft.FSharp.Core [] [] let inline uint64 (value: ^T) = - ExplicitDynamic<(^T), uint64> value - when ^T : string = ParseUInt64 (castToString value) - when ^T : float = (# "conv.ovf.u8" value : uint64 #) - when ^T : float32 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int64 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int32 = (# "conv.ovf.u8" value : uint64 #) - when ^T : int16 = (# "conv.ovf.u8" value : uint64 #) - when ^T : nativeint = (# "conv.ovf.u8" value : uint64 #) - when ^T : sbyte = (# "conv.ovf.u8" value : uint64 #) - when ^T : uint64 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : uint32 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : uint16 = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : char = (# "conv.ovf.u8.un" value : uint64 #) + CheckedExplicitDynamic<(^T), uint64> value + when ^T : string = ParseUInt64 (castToString value) + when ^T : float = (# "conv.ovf.u8" value : uint64 #) + when ^T : float32 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int64 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int32 = (# "conv.ovf.u8" value : uint64 #) + when ^T : int16 = (# "conv.ovf.u8" value : uint64 #) + when ^T : nativeint = (# "conv.ovf.u8" value : uint64 #) + when ^T : sbyte = (# "conv.ovf.u8" value : uint64 #) + when ^T : uint64 = (# "" value : uint64 #) + when ^T : uint32 = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : uint16 = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : char = (# "conv.ovf.u8.un" value : uint64 #) when ^T : unativeint = (# "conv.ovf.u8.un" value : uint64 #) - when ^T : byte = (# "conv.ovf.u8.un" value : uint64 #) + when ^T : byte = (# "conv.ovf.u8.un" value : uint64 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> uint64) (value)) [] [] let inline int64 (value: ^T) = - ExplicitDynamic<(^T), int64> value - when ^T : string = ParseInt64 (castToString value) - when ^T : float = (# "conv.ovf.i8" value : int64 #) - when ^T : float32 = (# "conv.ovf.i8" value : int64 #) - when ^T : int64 = (# "conv.ovf.i8" value : int64 #) - when ^T : int32 = (# "conv.ovf.i8" value : int64 #) - when ^T : int16 = (# "conv.ovf.i8" value : int64 #) - when ^T : nativeint = (# "conv.ovf.i8" value : int64 #) - when ^T : sbyte = (# "conv.ovf.i8" value : int64 #) - when ^T : uint64 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : uint32 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : uint16 = (# "conv.ovf.i8.un" value : int64 #) - when ^T : char = (# "conv.ovf.i8.un" value : int64 #) + CheckedExplicitDynamic<(^T), int64> value + when ^T : string = ParseInt64 (castToString value) + when ^T : float = (# "conv.ovf.i8" value : int64 #) + when ^T : float32 = (# "conv.ovf.i8" value : int64 #) + when ^T : int64 = (# "" value : int64 #) + when ^T : int32 = (# "conv.ovf.i8" value : int64 #) + when ^T : int16 = (# "conv.ovf.i8" value : int64 #) + when ^T : nativeint = (# "conv.ovf.i8" value : int64 #) + when ^T : sbyte = (# "conv.ovf.i8" value : int64 #) + when ^T : uint64 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : uint32 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : uint16 = (# "conv.ovf.i8.un" value : int64 #) + when ^T : char = (# "conv.ovf.i8.un" value : int64 #) when ^T : unativeint = (# "conv.ovf.i8.un" value : int64 #) - when ^T : byte = (# "conv.ovf.i8.un" value : int64 #) + when ^T : byte = (# "conv.ovf.i8.un" value : int64 #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> int64) (value)) [] [] let inline unativeint (value: ^T) = - ExplicitDynamic<(^T), unativeint> value - when ^T : string = ParseUIntPtr (castToString value) - when ^T : float = (# "conv.ovf.u" value : unativeint #) - when ^T : float32 = (# "conv.ovf.u" value : unativeint #) - when ^T : int64 = (# "conv.ovf.u" value : unativeint #) - when ^T : int32 = (# "conv.ovf.u" value : unativeint #) - when ^T : int16 = (# "conv.ovf.u" value : unativeint #) - when ^T : nativeint = (# "conv.ovf.u" value : unativeint #) - when ^T : sbyte = (# "conv.ovf.u" value : unativeint #) - when ^T : uint64 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : uint32 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : uint16 = (# "conv.ovf.u.un" value : unativeint #) - when ^T : char = (# "conv.ovf.u.un" value : unativeint #) - when ^T : unativeint = (# "conv.ovf.u.un" value : unativeint #) - when ^T : byte = (# "conv.ovf.u.un" value : unativeint #) + CheckedExplicitDynamic<(^T), unativeint> value + when ^T : string = ParseUIntPtr (castToString value) + when ^T : float = (# "conv.ovf.u" value : unativeint #) + when ^T : float32 = (# "conv.ovf.u" value : unativeint #) + when ^T : int64 = (# "conv.ovf.u" value : unativeint #) + when ^T : int32 = (# "conv.ovf.u" value : unativeint #) + when ^T : int16 = (# "conv.ovf.u" value : unativeint #) + when ^T : nativeint = (# "conv.ovf.u" value : unativeint #) + when ^T : sbyte = (# "conv.ovf.u" value : unativeint #) + when ^T : uint64 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : uint32 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : uint16 = (# "conv.ovf.u.un" value : unativeint #) + when ^T : char = (# "conv.ovf.u.un" value : unativeint #) + when ^T : unativeint = (# "" value : unativeint #) + when ^T : byte = (# "conv.ovf.u.un" value : unativeint #) + when ^T : decimal = (# "conv.ovf.u.un" (uint64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> unativeint) (value)) [] [] let inline nativeint (value: ^T) = - ExplicitDynamic<(^T), nativeint> value - when ^T : string = ParseIntPtr (castToString value) - when ^T : float = (# "conv.ovf.i" value : nativeint #) - when ^T : float32 = (# "conv.ovf.i" value : nativeint #) - when ^T : int64 = (# "conv.ovf.i" value : nativeint #) - when ^T : int32 = (# "conv.ovf.i" value : nativeint #) - when ^T : int16 = (# "conv.ovf.i" value : nativeint #) - when ^T : nativeint = (# "conv.ovf.i" value : nativeint #) - when ^T : sbyte = (# "conv.ovf.i" value : nativeint #) - when ^T : uint64 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : uint32 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : uint16 = (# "conv.ovf.i.un" value : nativeint #) - when ^T : char = (# "conv.ovf.i.un" value : nativeint #) + CheckedExplicitDynamic<(^T), nativeint> value + when ^T : string = ParseIntPtr (castToString value) + when ^T : float = (# "conv.ovf.i" value : nativeint #) + when ^T : float32 = (# "conv.ovf.i" value : nativeint #) + when ^T : int64 = (# "conv.ovf.i" value : nativeint #) + when ^T : int32 = (# "conv.ovf.i" value : nativeint #) + when ^T : int16 = (# "conv.ovf.i" value : nativeint #) + when ^T : nativeint = (# "" value : nativeint #) + when ^T : sbyte = (# "conv.ovf.i" value : nativeint #) + when ^T : uint64 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : uint32 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : uint16 = (# "conv.ovf.i.un" value : nativeint #) + when ^T : char = (# "conv.ovf.i.un" value : nativeint #) when ^T : unativeint = (# "conv.ovf.i.un" value : nativeint #) - when ^T : byte = (# "conv.ovf.i.un" value : nativeint #) + when ^T : byte = (# "conv.ovf.i.un" value : nativeint #) + when ^T : decimal = (# "conv.ovf.i" (int64 (# "" value : decimal #)) : nativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) module OperatorIntrinsics = diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 70ee63e0c2d..a2c03fa1025 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -1542,6 +1542,10 @@ namespace Microsoft.FSharp.Core [] val ExplicitDynamic: value: 'T -> 'U + /// A compiler intrinsic that implements dynamic invocations related to checked conversion operators. + [] + val CheckedExplicitDynamic : value:'T -> 'U + /// A compiler intrinsic that implements dynamic invocations related to the '<' operator. [] val LessThanDynamic: x: 'T1 -> y: 'T2 -> 'U diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 54ca7e2e3c4..44c625de5f5 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -1408,11 +1408,11 @@ module Patterns = | Unique of 'T | Ambiguous of 'R - let typeEquals (s: Type) (t: Type) = - s.Equals t + let typeEquals (ty1: Type) (ty2: Type) = + ty1.Equals ty2 - let typesEqual (ss: Type list) (tt: Type list) = - (ss.Length = tt.Length) && List.forall2 typeEquals ss tt + let typesEqual (tys1: Type list) (tys2: Type list) = + (tys1.Length = tys2.Length) && List.forall2 typeEquals tys1 tys2 let instFormal (typarEnv: Type[]) (ty: Instantiable<'T>) = ty (fun i -> typarEnv.[i]) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx new file mode 100644 index 00000000000..a7e7a928e36 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + + + + +type DU1 = | ``not.allowed`` + +type DU2 = ``not.allowed`` + +[] +type DU3 = | ``not.allowed`` + +[] +type DU4 = ``not.allowed`` + +type DU5 = | a + +type DU6 = a + +type du1 = du1 of string + +type du2 = | du2 of string \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx new file mode 100644 index 00000000000..e9080c19964 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + + + + +[] +type DU1 = + | a + | b + | c + +[] +type DU2 = + | a of int + | B of string + | C + +[] +type DU3 = | a + +[] +type DU4 = a + +[] +type du1 = du1 of string + +[] +type du2 = | du2 of string + +let a = DU1.a +let b = du2.du2 +let c = DU2.a(1) +let d = du2.du2("du2") +let e = du1.du1("du1") + +let f du1 = + match du1 with + | DU1.a -> () + | DU1.b -> () + | DU1.c -> () + +f DU1.c + + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index 1e27322bfbd..39f4fac3804 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -509,6 +509,64 @@ module UnionTypes = |> verifyCompileAndRun |> shouldSucceed + //SOURCE=LowercaseWhenRequireQualifiedAccess.fsx # LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``LowercaseWhenRequireQualifiedAccess_fs in langversion 6`` compilation = + compilation + |> withLangVersion60 + |> verifyCompile + |> shouldFail + + //SOURCE=LowercaseWhenRequireQualifiedAccess.fsx # LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompileAndRun + |> shouldSucceed + + //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``E_LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = + compilation + |> withLangVersionPreview + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 6, Col 14, Line 6, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 6, Col 14, Line 6, Col 29, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 883, Line 8, Col 12, Line 8, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 8, Col 12, Line 8, Col 27, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 883, Line 11, Col 14, Line 11, Col 29, "Invalid namespace, module, type or union case name"); + (Error 883, Line 14, Col 12, Line 14, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 16, Col 14, Line 16, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 18, Col 12, Line 18, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 20, Col 12, Line 20, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); + (Error 53, Line 22, Col 14, Line 22, Col 17, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + ] + + //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx + [] + let ``E_LowercaseWhenRequireQualifiedAccess_fs in langversion 6`` compilation = + compilation + |> withLangVersion60 + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Error 883, Line 6, Col 14, Line 6, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 6, Col 14, Line 6, Col 29, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 8, Col 12, Line 8, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 8, Col 12, Line 8, Col 27, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 11, Col 14, Line 11, Col 29, "Invalid namespace, module, type or union case name"); + (Error 53, Line 11, Col 14, Line 11, Col 29, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 14, Col 12, Line 14, Col 27, "Invalid namespace, module, type or union case name"); + (Error 53, Line 14, Col 12, Line 14, Col 27, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 16, Col 14, Line 16, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 18, Col 12, Line 18, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 20, Col 12, Line 20, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 22, Col 14, Line 22, Col 17, "Discriminated union cases and exception labels must be uppercase identifiers") + ] + //SOURCE=W_GenericFunctionValuedStaticProp02.fs SCFLAGS="--test:ErrorRanges --warnaserror-" # W_GenericFunctionValuedStaticProp02.fs [] let ``W_GenericFunctionValuedStaticProp02_fs`` compilation = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl index 30f333f36c8..b7aea842a83 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl index 78d4df8f587..34ab1b1e85c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl index b23967fe77b..c94a00b3427 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl @@ -66,8 +66,10 @@ { .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 assembly int32 key1@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 key2@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_key1() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl index 0b4d87cf293..31112ecefe0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl @@ -99,8 +99,10 @@ .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.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .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.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .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, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl index ded94e51adc..de3a5062203 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl @@ -62,8 +62,10 @@ { .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 assembly int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl index d34dc778f67..17ff542c4ed 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl @@ -62,8 +62,10 @@ { .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 assembly int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field assembly int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl index 1139c1cdb0d..6047356613b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl @@ -62,8 +62,10 @@ { .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 public int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field public int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl index 51afb9c71dd..97404f6bb4a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl @@ -62,8 +62,10 @@ { .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 public int32 x@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .field public int32 y@ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .method public hidebysig specialname instance int32 get_x() cil managed diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 42a431f2c27..9c0017aaed1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -42,6 +42,7 @@ + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs index 62db48e2ec9..a7672d9925f 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule1.fs @@ -246,10 +246,10 @@ type OperatorsModule1() = Assert.AreEqual(1, intbox) // string value - let stringlbox = Operators.box "string" - Assert.AreEqual("string", stringlbox) + let stringbox = Operators.box "string" + Assert.AreEqual("string", stringbox) - // null value + // null value let nullbox = Operators.box null CheckThrowsNullRefException(fun () -> nullbox.ToString() |> ignore) @@ -275,6 +275,14 @@ type OperatorsModule1() = let result = Operators.byte Int64.MinValue Assert.AreEqual(0uy, result) + // Overflow + let result = Operators.byte Single.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MaxValue + Assert.AreEqual(0uy, result) + // Overflow let result = Operators.byte Double.MinValue Assert.AreEqual(0uy, result) @@ -292,7 +300,7 @@ type OperatorsModule1() = Assert.AreEqual(4uy, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.byte Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.byte Decimal.MinValue |> ignore) [] member _.ceil() = @@ -301,18 +309,44 @@ type OperatorsModule1() = Assert.AreEqual(1.0, minceil) // normal value - let normalceil = Operators.ceil 100.0 - Assert.AreEqual(100.0, normalceil) + let normalceil = Operators.ceil 100.1 + Assert.AreEqual(101.0, normalceil) // max value let maxceil = Operators.ceil 1.7E+308 Assert.AreEqual(1.7E+308, maxceil) + // float32 value + let float32ceil = Operators.ceil 100.1f + Assert.AreEqual(101f, float32ceil) + + // decimal value + let decimalceil = Operators.ceil 100.1m + Assert.AreEqual(101m, decimalceil) + [] member _.char() = // int type - let intchar = Operators.char 48 - Assert.AreEqual('0', intchar) + Assert.AreEqual('0', Operators.char 48) + Assert.AreEqual('0', Operators.char 48u) + Assert.AreEqual('0', Operators.char 48s) + Assert.AreEqual('0', Operators.char 48us) + Assert.AreEqual('0', Operators.char 48y) + Assert.AreEqual('0', Operators.char 48uy) + Assert.AreEqual('0', Operators.char 48L) + Assert.AreEqual('0', Operators.char 48uL) + Assert.AreEqual('0', Operators.char 48n) + Assert.AreEqual('0', Operators.char 48un) + Assert.AreEqual('0', Operators.char 48f) + Assert.AreEqual('0', Operators.char 48.) + Assert.AreEqual('0', Operators.char 48m) + + // Overflow + Assert.AreEqual('\000', Operators.char Single.MinValue) + Assert.AreEqual('\000', Operators.char Double.MinValue) + Assert.AreEqual('\000', Operators.char Single.MaxValue) + Assert.AreEqual('\000', Operators.char Double.MaxValue) + CheckThrowsOverflowException(fun () -> Operators.char Decimal.MinValue |> ignore) // string type let stringchar = Operators.char " " @@ -366,12 +400,24 @@ type OperatorsModule1() = member _.decimal () = // int value - let mindecimal = Operators.decimal (1) - Assert.AreEqual(1M, mindecimal) + let intdecimal = Operators.decimal (1) + Assert.AreEqual(1M, intdecimal) + + // nativeint value + let nativeintdecimal = Operators.decimal 1n + Assert.AreEqual(1M, nativeintdecimal) + + // unativeint value + let unativeintdecimal = Operators.decimal 1un + Assert.AreEqual(1M, unativeintdecimal) + + // char value + let chardecimal = Operators.decimal '\001' + Assert.AreEqual(1M, chardecimal) - // float value - let maxdecimal = Operators.decimal (1.0) - Assert.AreEqual(1M, maxdecimal) + // float value + let floatdecimal = Operators.decimal (1.0) + Assert.AreEqual(1M, floatdecimal) [] member _.decr() = @@ -416,6 +462,10 @@ type OperatorsModule1() = // char type let chardouble = Operators.float '0' Assert.AreEqual(48.0, chardouble) + + // decimal type + let decimaldouble = Operators.float 100m + Assert.AreEqual(100.0, decimaldouble) [] member _.enum() = @@ -424,7 +474,7 @@ type OperatorsModule1() = let intenum = Operators.enum intarg Assert.AreEqual(System.ConsoleColor.Black, intenum) - // big number + // big number let bigarg : int32 = 15 let charenum = Operators.enum bigarg Assert.AreEqual(System.ConsoleColor.White, charenum) @@ -488,6 +538,10 @@ type OperatorsModule1() = let charfloat = Operators.float '0' Assert.AreEqual((float)48, charfloat) + // decimal type + let intfloat = Operators.float 100m + Assert.AreEqual((float)100, intfloat) + [] member _.float32() = // int type @@ -497,16 +551,24 @@ type OperatorsModule1() = // char type let charfloat32 = Operators.float32 '0' Assert.AreEqual((float32)48, charfloat32) + + // decimal type + let intfloat32 = Operators.float32 100m + Assert.AreEqual((float32)100, intfloat32) [] member _.floor() = // float type - let intfloor = Operators.floor 100.9 - Assert.AreEqual(100.0, intfloor) + let floatfloor = Operators.floor 100.9 + Assert.AreEqual(100.0, floatfloor) // float32 type - let charfloor = Operators.floor ((float32)100.9) - Assert.AreEqual(100.0f, charfloor) + let float32floor = Operators.floor 100.9f + Assert.AreEqual(100.0f, float32floor) + + // decimal type + let decimalfloor = Operators.floor 100.9m + Assert.AreEqual(100m, decimalfloor) [] member _.fst() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs index 3abdeee4121..d4197529ea6 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs @@ -51,6 +51,14 @@ type OperatorsModule2() = let result = Operators.int 0 Assert.AreEqual(0, result) + // Overflow. + let result = Operators.int Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + // Overflow let result = Operators.int Double.MaxValue Assert.AreEqual(Int32.MinValue, result) @@ -72,7 +80,7 @@ type OperatorsModule2() = Assert.AreEqual(Int32.MinValue, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int Decimal.MinValue |> ignore) [] member _.int16() = @@ -96,6 +104,14 @@ type OperatorsModule2() = let result = Operators.int16 "10" Assert.AreEqual(10s, result) + // Overflow. + let result = Operators.int16 Single.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Single.MinValue + Assert.AreEqual(0s, result) + // Overflow let result = Operators.int16 Double.MaxValue Assert.AreEqual(0s, result) @@ -116,7 +132,7 @@ type OperatorsModule2() = Assert.AreEqual(Int16.MinValue, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int16 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int16 Decimal.MinValue |> ignore) [] member _.int32() = @@ -140,6 +156,14 @@ type OperatorsModule2() = let result = Operators.int32 "10" Assert.AreEqual(10, result) + // Overflow. + let result = Operators.int32 Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + // Overflow let result = Operators.int32 Double.MaxValue Assert.AreEqual(Int32.MinValue, result) @@ -161,7 +185,7 @@ type OperatorsModule2() = Assert.AreEqual(Int32.MinValue + 4, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int32 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int32 Decimal.MinValue |> ignore) [] member _.int64() = @@ -185,6 +209,14 @@ type OperatorsModule2() = let result = Operators.int64 "10" Assert.AreEqual(10L, result) + // Overflow. + let result = Operators.int64 Single.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Single.MinValue + Assert.AreEqual(Int64.MinValue, result) + // Overflow. let result = Operators.int64 Double.MaxValue Assert.AreEqual(Int64.MinValue, result) @@ -202,11 +234,11 @@ type OperatorsModule2() = Assert.AreEqual(9223372036854775807L, Int64.MaxValue) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.int64 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.int64 Decimal.MinValue |> ignore) [] member _.invalidArg() = - CheckThrowsArgumentException(fun() -> Operators.invalidArg "A" "B" |>ignore ) + CheckThrowsArgumentException(fun () -> Operators.invalidArg "A" "B" |>ignore ) [] @@ -328,6 +360,22 @@ type OperatorsModule2() = let result = Operators.nativeint 0 Assert.AreEqual(0n, result) + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Single.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes let result = Operators.nativeint Double.MaxValue if Info.isX86Runtime then @@ -396,7 +444,7 @@ type OperatorsModule2() = [] member _.nullArg() = - CheckThrowsArgumentNullException(fun() -> Operators.nullArg "A" |> ignore) + CheckThrowsArgumentNullException(fun () -> Operators.nullArg "A" |> ignore) [] @@ -429,11 +477,11 @@ type OperatorsModule2() = let result = Operators.pown System.Double.MaxValue System.Int32.MaxValue Assert.AreEqual(Double.PositiveInfinity, result) - CheckThrowsOverflowException(fun() -> Operators.pown System.Int32.MaxValue System.Int32.MaxValue |>ignore) + CheckThrowsOverflowException(fun () -> Operators.pown System.Int32.MaxValue System.Int32.MaxValue |>ignore) [] member _.raise() = - CheckThrowsArgumentException(fun()-> Operators.raise <| new ArgumentException("Invalid Argument ") |> ignore) + CheckThrowsArgumentException(fun () -> Operators.raise <| new ArgumentException("Invalid Argument ") |> ignore) [] @@ -559,7 +607,7 @@ type OperatorsModule2() = Assert.AreEqual(-128y, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.sbyte Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.sbyte Decimal.MinValue |> ignore) [] member _.sign() = @@ -694,6 +742,10 @@ type OperatorsModule2() = let result = Operators.sizeof Assert.AreEqual(8, result) + // custom struct + let result = Operators.sizeof + Assert.AreEqual(12, result) + // reference type should have the same size as the IntPtr let result = Operators.sizeof Assert.AreEqual(IntPtr.Size, result) @@ -899,9 +951,25 @@ type OperatorsModule2() = // decimal let result = Operators.uint16 100M Assert.AreEqual(100us, result) + + // Overflow + let result = Operators.uint16 Single.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Single.MinValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MinValue + Assert.AreEqual(0us, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint16 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint16 Decimal.MinValue |> ignore) [] member _.uint32() = @@ -917,6 +985,14 @@ type OperatorsModule2() = let result = Operators.uint32 100M Assert.AreEqual(100u, result) + // Overflow + let result = Operators.uint32 Single.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Single.MinValue + Assert.AreEqual(0u, result) + // Overflow let result = Operators.uint32 Double.MaxValue Assert.AreEqual(0u, result) @@ -943,7 +1019,7 @@ type OperatorsModule2() = Assert.AreEqual(84ul, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint32 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint32 Decimal.MinValue |> ignore) [] member _.uint64() = @@ -959,6 +1035,14 @@ type OperatorsModule2() = let result = Operators.uint64 100M Assert.AreEqual(100UL, result) + // Overflow + let result = Operators.uint64 Single.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Single.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + // Overflow let result = Operators.uint64 Double.MaxValue Assert.AreEqual(0UL, result) @@ -980,7 +1064,7 @@ type OperatorsModule2() = Assert.AreEqual(4UL, result) // OverflowException, from decimal is always checked - CheckThrowsOverflowException(fun() -> Operators.uint64 Decimal.MinValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.uint64 Decimal.MinValue |> ignore) [] member _.unativeint() = @@ -993,6 +1077,17 @@ type OperatorsModule2() = let result = Operators.unativeint 100.0 Assert.AreEqual(100un, result) + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Single.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes let result = Operators.unativeint Double.MaxValue Assert.AreEqual(0un, result) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs index bcd16f54e27..54da228aca6 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleChecked.fs @@ -21,12 +21,14 @@ type OperatorsModuleChecked() = let charByte = Operators.Checked.byte '0' Assert.AreEqual(48uy, charByte) - // boundary value + // boundary value let boundByte = Operators.Checked.byte 255.0 Assert.AreEqual(255uy, boundByte) // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256f |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256. |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> 255uy + 1uy |> ignore) @@ -51,6 +53,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.char (int64 Char.MaxValue + 1L) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> '\uFFFF' + '\u0001' |> ignore) @@ -72,7 +76,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(32767, boundInt) // overflow exception - CheckThrowsOverflowException(fun() -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) @@ -97,6 +103,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.int16 32768.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int16.MaxValue + 1s |> ignore) @@ -121,6 +129,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.int32 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) @@ -150,7 +160,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(-9223372036854775808L, boundInt64) // overflow exception - CheckThrowsOverflowException(fun() -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> Int64.MaxValue + 1L |> ignore) @@ -179,6 +191,8 @@ type OperatorsModuleChecked() = Operators.Checked.nativeint 2147483648.0 |> ignore else Operators.Checked.nativeint 9223372036854775808.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Double.MaxValue |> ignore) [] @@ -198,6 +212,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte -256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> SByte.MaxValue + 1y |> ignore) @@ -220,7 +236,9 @@ type OperatorsModuleChecked() = let bounduint16 = Operators.Checked.uint16 65535.0 Assert.AreEqual(65535us, bounduint16) - CheckThrowsOverflowException(fun() -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt16.MaxValue + 1us |> ignore) @@ -244,7 +262,9 @@ type OperatorsModuleChecked() = Assert.AreEqual(429496729u, bounduint32) // overflow exception - CheckThrowsOverflowException(fun () -> Operators.Checked.uint32(float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 (float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt32.MaxValue + 1u |> ignore) @@ -269,6 +289,8 @@ type OperatorsModuleChecked() = // overflow exception CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 (float System.UInt64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Double.MaxValue |> ignore) // overflow exception CheckThrowsOverflowException(fun () -> UInt64.MaxValue + 1UL |> ignore) @@ -302,5 +324,7 @@ type OperatorsModuleChecked() = else Operators.Checked.unativeint (float UInt64.MaxValue + 1.0) |> ignore ) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Double.MaxValue |> ignore) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs new file mode 100644 index 00000000000..9af581dca52 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModuleDynamic.fs @@ -0,0 +1,1105 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Sync test content with OperatorsModule1.fs, OperatorsModule2.fs, and OperatorsModuleDynamic.fs + +namespace FSharp.Core.UnitTests.Operators + +open System +open Xunit + +#nowarn "1204" // CompilerMessage: This function is for use by dynamic invocations of F# code and should not be used directly +module OperatorsModuleDynamic = + + /// Check that the lambda throws an exception of the given type. Otherwise + /// calls Assert.Fail() + // Sync implementation with FSharp.Core.UnitTests.LibraryTestFx.CheckThrowsExn + let CheckThrowsExn<'a when 'a :> exn> (f : unit -> unit) = + try + let _ = f () + sprintf "Expected %O exception, got no exception" typeof<'a> |> Assert.Fail + with + | :? 'a -> () + | :? Reflection.TargetInvocationException as r when (r.InnerException :? 'a) -> () + | e -> sprintf "Expected %O or TargetInvocationException containing it, got: %O" typeof<'a> e |> Assert.Fail + let CheckThrowsOverflowException = CheckThrowsExn + + module Operators = + let byte<'T> = LanguagePrimitives.ExplicitDynamic<'T, byte> + let char<'T> = LanguagePrimitives.ExplicitDynamic<'T, char> + let double<'T> = LanguagePrimitives.ExplicitDynamic<'T, double> + let decimal<'T> = LanguagePrimitives.ExplicitDynamic<'T, decimal> + let float<'T> = LanguagePrimitives.ExplicitDynamic<'T, float> + let float32<'T> = LanguagePrimitives.ExplicitDynamic<'T, float32> + let nativeint<'T> = LanguagePrimitives.ExplicitDynamic<'T, nativeint> + let int<'T> = LanguagePrimitives.ExplicitDynamic<'T, int> + let int8<'T> = LanguagePrimitives.ExplicitDynamic<'T, int8> + let int16<'T> = LanguagePrimitives.ExplicitDynamic<'T, int16> + let int32<'T> = LanguagePrimitives.ExplicitDynamic<'T, int32> + let int64<'T> = LanguagePrimitives.ExplicitDynamic<'T, int64> + let sbyte<'T> = LanguagePrimitives.ExplicitDynamic<'T, sbyte> + let single<'T> = LanguagePrimitives.ExplicitDynamic<'T, single> + let uint<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint> + let uint8<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint8> + let uint16<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint16> + let uint32<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint32> + let uint64<'T> = LanguagePrimitives.ExplicitDynamic<'T, uint64> + let unativeint<'T> = LanguagePrimitives.ExplicitDynamic<'T, unativeint> + module Checked = + let byte<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, byte> + let char<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, char> + let double<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, double> + let decimal<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, decimal> + let float<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, float> + let float32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, float32> + let nativeint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, nativeint> + let int<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int> + let int8<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int8> + let int16<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int16> + let int32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int32> + let int64<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, int64> + let sbyte<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, sbyte> + let single<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, single> + let uint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint> + let uint8<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint8> + let uint16<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint16> + let uint32<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint32> + let uint64<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, uint64> + let unativeint<'T> = LanguagePrimitives.CheckedExplicitDynamic<'T, unativeint> + + [] + let byte() = + // int type + let intByte = Operators.byte 100 + Assert.AreEqual(100uy, intByte) + + // char type + let charByte = Operators.byte '0' + Assert.AreEqual(48uy, charByte) + + // boundary value + let boundByte = Operators.byte 255.0 + Assert.AreEqual(255uy, boundByte) + + // Overflow + let result = Operators.byte Int64.MaxValue + Assert.AreEqual(Byte.MaxValue, result) + + // Overflow + let result = Operators.byte Int64.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Single.MaxValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MinValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte Double.MaxValue + Assert.AreEqual(0uy, result) + + // Overflow + let result = Operators.byte (Int64.MaxValue * 8L) + Assert.AreEqual(248uy, result) // bit-complement + + // Overflow + let result = 255uy + 5uy + Assert.AreEqual(4uy, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.byte Decimal.MinValue |> ignore) + + [] + let char() = + // int type + Assert.AreEqual('0', Operators.char 48) + Assert.AreEqual('0', Operators.char 48u) + Assert.AreEqual('0', Operators.char 48s) + Assert.AreEqual('0', Operators.char 48us) + Assert.AreEqual('0', Operators.char 48y) + Assert.AreEqual('0', Operators.char 48uy) + Assert.AreEqual('0', Operators.char 48L) + Assert.AreEqual('0', Operators.char 48uL) + Assert.AreEqual('0', Operators.char 48n) + Assert.AreEqual('0', Operators.char 48un) + Assert.AreEqual('0', Operators.char 48f) + Assert.AreEqual('0', Operators.char 48.) + Assert.AreEqual('0', Operators.char 48m) + + // Overflow + Assert.AreEqual('\000', Operators.char Single.MinValue) + Assert.AreEqual('\000', Operators.char Double.MinValue) + Assert.AreEqual('\000', Operators.char Single.MaxValue) + Assert.AreEqual('\000', Operators.char Double.MaxValue) + CheckThrowsOverflowException(fun () -> Operators.char Decimal.MinValue |> ignore) + + // string type + let stringchar = Operators.char " " + Assert.AreEqual(' ', stringchar) + + + [] + let decimal () = + + // int value + let intdecimal = Operators.decimal (1) + Assert.AreEqual(1M, intdecimal) + + // nativeint value + let nativeintdecimal = Operators.decimal 1n + Assert.AreEqual(1M, nativeintdecimal) + + // unativeint value + let unativeintdecimal = Operators.decimal 1un + Assert.AreEqual(1M, unativeintdecimal) + + // char value + let chardecimal = Operators.decimal '\001' + Assert.AreEqual(1M, chardecimal) + + // float value + let floatdecimal = Operators.decimal (1.0) + Assert.AreEqual(1M, floatdecimal) + + [] + let double() = + // int type + let intdouble = Operators.float 100 + Assert.AreEqual(100.0, intdouble) + + // char type + let chardouble = Operators.float '0' + Assert.AreEqual(48.0, chardouble) + + // decimal type + let decimaldouble = Operators.float 100m + Assert.AreEqual(100.0, decimaldouble) + + [] + let float() = + // int type + let intfloat = Operators.float 100 + Assert.AreEqual((float)100, intfloat) + + // char type + let charfloat = Operators.float '0' + Assert.AreEqual((float)48, charfloat) + + // decimal type + let intfloat = Operators.float 100m + Assert.AreEqual((float)100, intfloat) + + [] + let float32() = + // int type + let intfloat32 = Operators.float32 100 + Assert.AreEqual((float32)100, intfloat32) + + // char type + let charfloat32 = Operators.float32 '0' + Assert.AreEqual((float32)48, charfloat32) + + // decimal type + let intfloat32 = Operators.float32 100m + Assert.AreEqual((float32)100, intfloat32) + + [] + let int() = + // int + let result = Operators.int 10 + Assert.AreEqual(10, result) + + // string + let result = Operators.int "10" + Assert.AreEqual(10, result) + + // double + let result = Operators.int 10.0 + Assert.AreEqual(10, result) + + // negative + let result = Operators.int -10 + Assert.AreEqual(-10, result) + + // zero + let result = Operators.int 0 + Assert.AreEqual(0, result) + + // Overflow + let result = Operators.int Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 1 + Assert.AreEqual(Int32.MinValue, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int Decimal.MinValue |> ignore) + + [] + let int16() = + // int + let result = Operators.int16 10 + Assert.AreEqual(10s, result) + + // double + let result = Operators.int16 10.0 + Assert.AreEqual(10s, result) + + // negative + let result = Operators.int16 -10 + Assert.AreEqual(-10s, result) + + // zero + let result = Operators.int16 0 + Assert.AreEqual(0s, result) + + // string + let result = Operators.int16 "10" + Assert.AreEqual(10s, result) + + // Overflow + let result = Operators.int16 Single.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Single.MinValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Double.MaxValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Operators.int16 Double.MinValue + Assert.AreEqual(0s, result) + + let result = Operators.int16 Int64.MaxValue + Assert.AreEqual(-1s, result) + + // Overflow + let result = Operators.int16 Int64.MinValue + Assert.AreEqual(0s, result) + + // Overflow + let result = Int16.MaxValue + 1s + Assert.AreEqual(Int16.MinValue, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int16 Decimal.MinValue |> ignore) + + [] + let int32() = + // int + let result = Operators.int32 10 + Assert.AreEqual(10, result) + + // double + let result = Operators.int32 10.0 + Assert.AreEqual(10, result) + + // negative + let result = Operators.int32 -10 + Assert.AreEqual(-10, result) + + // zero + let result = Operators.int32 0 + Assert.AreEqual(0, result) + + // string + let result = Operators.int32 "10" + Assert.AreEqual(10, result) + + // Overflow + let result = Operators.int32 Single.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Single.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Double.MaxValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Double.MinValue + Assert.AreEqual(Int32.MinValue, result) + + // Overflow + let result = Operators.int32 Int64.MaxValue + Assert.AreEqual(-1, result) + + // Overflow + let result = Operators.int32 Int64.MinValue + Assert.AreEqual(0, result) + + // Overflow + let result = Int32.MaxValue + 5 + Assert.AreEqual(Int32.MinValue + 4, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int32 Decimal.MinValue |> ignore) + + [] + let int64() = + // int + let result = Operators.int64 10 + Assert.AreEqual(10L, result) + + // double + let result = Operators.int64 10.0 + Assert.AreEqual(10L, result) + + // negative + let result = Operators.int64 -10 + Assert.AreEqual(-10L, result) + + // zero + let result = Operators.int64 0 + Assert.AreEqual(0L, result) + + // string + let result = Operators.int64 "10" + Assert.AreEqual(10L, result) + + // Overflow. + let result = Operators.int64 Single.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Single.MinValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow. + let result = Operators.int64 Double.MaxValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 Double.MinValue + Assert.AreEqual(Int64.MinValue, result) + + // Overflow + let result = Operators.int64 UInt64.MaxValue + Assert.AreEqual(-1L, result) + + // max and min value as literals (this breaks compilation if the lexer fails) + Assert.AreEqual(-9223372036854775808L, Int64.MinValue) + Assert.AreEqual(9223372036854775807L, Int64.MaxValue) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.int64 Decimal.MinValue |> ignore) + + + [] + let nativeint() = + // int + let result = Operators.nativeint 10 + Assert.AreEqual(10n, result) + + // double + let result = Operators.nativeint 10.0 + Assert.AreEqual(10n, result) + + // int64 + let result = Operators.nativeint 10L + Assert.AreEqual(10n, result) + + // negative + let result = Operators.nativeint -10 + Assert.AreEqual(-10n, result) + + // zero + let result = Operators.nativeint 0 + Assert.AreEqual(0n, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Single.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.nativeint Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0n, result) + else + // Cannot use -9223372036854775808, compiler doesn't allow it, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual(-9223372036854775807n - 1n, result) + + // Overflow (depends on pointer size) + if Info.isX86Runtime then + let result = nativeint Int32.MaxValue + 5n + Assert.AreEqual(-2147483644n, result) + else + let result = nativeint Int64.MaxValue + 5n + Assert.AreEqual(-9223372036854775804n, result) + + // Overflow (depends on pointer size) + let result = Operators.nativeint System.Double.MaxValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) + + let result = Operators.nativeint System.Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(-2147483648n, result) + else + // Cannot express this as a literal, see https://github.com/dotnet/fsharp/issues/9524 + Assert.AreEqual("-9223372036854775808", string result) + + // Max and min value as literals (this breaks compilation if the lexer fails). + // The following tests ensure that the proper value is parsed, which is similar to `nativeint Int64.MaxValue` etc. + if Info.isX86Runtime then + Assert.AreEqual("0", string -9223372036854775808n) // same as int32 -9223372036854775808L + Assert.AreEqual("-1", string 9223372036854775807n) // same as int32 9223372036854775807L + else + Assert.AreEqual("-9223372036854775808", string -9223372036854775808n) + Assert.AreEqual("9223372036854775807", string 9223372036854775807n) + + + [] + let sbyte() = + // int + let result = Operators.sbyte 10 + Assert.AreEqual(10y, result) + + // double + let result = Operators.sbyte 10.0 + Assert.AreEqual(10y, result) + + // negative + let result = Operators.sbyte -10 + Assert.AreEqual(-10y, result) + + // zero + let result = Operators.sbyte 0 + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Int64.MaxValue + Assert.AreEqual(-1y, result) + + // Overflow + let result = Operators.sbyte Int64.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Single.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Single.MaxValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MinValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte Double.MaxValue + Assert.AreEqual(0y, result) + + // Overflow + let result = Operators.sbyte (Int64.MaxValue * 8L) + Assert.AreEqual(-8y, result) // bit-complement + + // Overflow + let result = 127y + 1y + Assert.AreEqual(-128y, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.sbyte Decimal.MinValue |> ignore) + + [] + let single() = + // int + let result = Operators.float32 10 + Assert.AreEqual(10f, result) + + // double + let result = Operators.float32 10.0 + Assert.AreEqual(10f, result) + + // string + let result = Operators.float32 "10" + Assert.AreEqual(10f, result) + + + [] + let uint16() = + // int + let result = Operators.uint16 100 + Assert.AreEqual(100us, result) + + // double + let result = Operators.uint16 (100.0:double) + Assert.AreEqual(100us, result) + + // decimal + let result = Operators.uint16 100M + Assert.AreEqual(100us, result) + + // Overflow + let result = Operators.uint16 Single.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Single.MinValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MaxValue + Assert.AreEqual(0us, result) + + // Overflow + let result = Operators.uint16 Double.MinValue + Assert.AreEqual(0us, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint16 Decimal.MinValue |> ignore) + + [] + let uint32() = + // int + let result = Operators.uint32 100 + Assert.AreEqual(100u, result) + + // double + let result = Operators.uint32 (100.0:double) + Assert.AreEqual(100u, result) + + // decimal + let result = Operators.uint32 100M + Assert.AreEqual(100u, result) + + // Overflow + let result = Operators.uint32 Single.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Single.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Double.MaxValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Double.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = Operators.uint32 Int64.MaxValue + Assert.AreEqual(UInt32.MaxValue, result) + + // Overflow + let result = Operators.uint32 Int64.MinValue + Assert.AreEqual(0u, result) + + // Overflow + let result = UInt32.MaxValue + 5u + Assert.AreEqual(4u, result) + + // both 'u' and 'ul' are valid numeric suffixes for UInt32 + let result = 42u + 42ul + Assert.AreEqual(84u, result) + Assert.AreEqual(84ul, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint32 Decimal.MinValue |> ignore) + + [] + let uint64() = + // int + let result = Operators.uint64 100 + Assert.AreEqual(100UL, result) + + // double + let result = Operators.uint64 100.0 + Assert.AreEqual(100UL, result) + + // decimal + let result = Operators.uint64 100M + Assert.AreEqual(100UL, result) + + // Overflow + let result = Operators.uint64 Single.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Single.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + + // Overflow + let result = Operators.uint64 Double.MaxValue + Assert.AreEqual(0UL, result) + + // Overflow + let result = Operators.uint64 Double.MinValue + Assert.AreEqual(9223372036854775808UL, result) // surprising, but true, 2^63 + 1 + + // Overflow + let result = Operators.uint64 Int64.MinValue + Assert.AreEqual(9223372036854775808UL, result) + + // Overflow + let result = Operators.uint64 SByte.MinValue + Assert.AreEqual(UInt64.MaxValue - 127UL, result) + + // Overflow + let result = UInt64.MaxValue + 5UL + Assert.AreEqual(4UL, result) + + // OverflowException, from decimal is always checked + CheckThrowsOverflowException(fun () -> Operators.uint64 Decimal.MinValue |> ignore) + + [] + let unativeint() = + // int + let result = Operators.unativeint 100 + let x: unativeint = 12un + Assert.AreEqual(100un, result) + + // double + let result = Operators.unativeint 100.0 + Assert.AreEqual(100un, result) + + // Overflow Single.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Single.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Single.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + + // Overflow Double.MaxValue is equal on 32 bits and 64 bits runtimes + let result = Operators.unativeint Double.MaxValue + Assert.AreEqual(0un, result) + + // Overflow (depends on pointer size) + let result = Operators.unativeint Double.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) // surprising, but true, 2^63 + 1 + + // Overflow (depends on pointer size) + let result = Operators.unativeint Int64.MinValue + if Info.isX86Runtime then + Assert.AreEqual(0un, result) + else + Assert.AreEqual(9223372036854775808un, result) + + // Overflow (depends on pointer size) + let result = 0un - 1un + if Info.isX86Runtime then + Assert.AreEqual(4294967295un, result) + else + Assert.AreEqual(18446744073709551615un, result) + + open Operators.Checked + + [] + let Checkedbyte() = + // int type + let intByte = Operators.Checked.byte 100 + Assert.AreEqual(100uy, intByte) + + // char type + let charByte = Operators.Checked.byte '0' + Assert.AreEqual(48uy, charByte) + + // boundary value + let boundByte = Operators.Checked.byte 255.0 + Assert.AreEqual(255uy, boundByte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256f |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.byte 256. |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 255uy + 1uy |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> 0uy - 1uy |> ignore) + + [] + let Checkedchar() = + + // number + let numberChar = Operators.Checked.char 48 + Assert.AreEqual('0', numberChar) + + // letter + let letterChar = Operators.Checked.char 65 + Assert.AreEqual('A', letterChar) + + // boundary value + let boundchar = Operators.Checked.char 126 + Assert.AreEqual('~', boundchar) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.char (int64 Char.MaxValue + 1L) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.char Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> '\uFFFF' + '\u0001' |> ignore) + + + [] + let CheckedInt() = + + // char + let charInt = Operators.Checked.int '0' + Assert.AreEqual(48, charInt) + + // float + let floatInt = Operators.Checked.int 10.0 + Assert.AreEqual(10, floatInt) + + // boundary value + let boundInt = Operators.Checked.int 32767.0 + Assert.AreEqual(32767, boundInt) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + let CheckedInt16() = + + // char + let charInt16 = Operators.Checked.int16 '0' + Assert.AreEqual(48s, charInt16) + + // float + let floatInt16 = Operators.Checked.int16 10.0 + Assert.AreEqual(10s, floatInt16) + + // boundary value + let boundInt16 = Operators.Checked.int16 32767.0 + Assert.AreEqual(32767s, boundInt16) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 32768.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int16 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MaxValue + 1s |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int16.MinValue - 1s |> ignore) + + [] + let CheckedInt32() = + + // char + let charInt32 = Operators.Checked.int32 '0' + Assert.AreEqual(48, charInt32) + + // float + let floatInt32 = Operators.Checked.int32 10.0 + Assert.AreEqual(10, floatInt32) + + // boundary value + let boundInt32 = Operators.Checked.int32 2147483647.0 + Assert.AreEqual(2147483647, boundInt32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 2147483648.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int32 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MaxValue + 1 |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int32.MinValue - 1 |> ignore) + + [] + let CheckedInt64() = + + // char + let charInt64 = Operators.Checked.int64 '0' + Assert.AreEqual(48L, charInt64) + + // float + let floatInt64 = Operators.Checked.int64 10.0 + Assert.AreEqual(10L, floatInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 9223372036854775807I + let _ = 9223372036854775807L + Assert.AreEqual(9223372036854775807L, boundInt64) + + // boundary value + let boundInt64 = Operators.Checked.int64 -9223372036854775808I + let _ = -9223372036854775808L + Assert.AreEqual(-9223372036854775808L, boundInt64) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 (float Int64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.int64 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MaxValue + 1L |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> Int64.MinValue - 1L |> ignore) + + [] + let CheckedNativeint() = + + // char + let charnativeint = Operators.Checked.nativeint '0' + Assert.AreEqual(48n, charnativeint) + + // float + let floatnativeint = Operators.Checked.nativeint 10.0 + Assert.AreEqual(10n, floatnativeint) + + // boundary value + let boundnativeint = Operators.Checked.nativeint 32767.0 + Assert.AreEqual(32767n, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun () -> + if Info.isX86Runtime then + Operators.Checked.nativeint 2147483648.0 |> ignore + else + Operators.Checked.nativeint 9223372036854775808.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.nativeint Double.MaxValue |> ignore) + + + [] + let Checkedsbyte() = + + // char + let charsbyte = Operators.Checked.sbyte '0' + Assert.AreEqual(48y, charsbyte) + + // float + let floatsbyte = Operators.Checked.sbyte -10.0 + Assert.AreEqual(-10y, floatsbyte) + + // boundary value + let boundsbyte = Operators.Checked.sbyte -127.0 + Assert.AreEqual(-127y, boundsbyte) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte -256 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.sbyte Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MaxValue + 1y |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> SByte.MinValue - 1y |> ignore) + + [] + let Checkeduint16() = + + // char + let charuint16 = Operators.Checked.uint16 '0' + Assert.AreEqual(48us, charuint16) + + // float + let floatuint16 = Operators.Checked.uint16 10.0 + Assert.AreEqual(10us, floatuint16) + + // boundary value + let bounduint16 = Operators.Checked.uint16 65535.0 + Assert.AreEqual(65535us, bounduint16) + + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 65536.0 |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint16 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MaxValue + 1us |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt16.MinValue - 1us |> ignore) + + [] + let Checkeduint32() = + + // char + let charuint32 = Operators.Checked.uint32 '0' + Assert.AreEqual(48u, charuint32) + + // float + let floatuint32 = Operators.Checked.uint32 10.0 + Assert.AreEqual(10u, floatuint32) + + // boundary value + let bounduint32 = Operators.Checked.uint32 429496729.0 + Assert.AreEqual(429496729u, bounduint32) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 (float UInt32.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint32 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MaxValue + 1u |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt32.MinValue - 1u |> ignore) + + [] + let Checkeduint64() = + + // char + let charuint64 = Operators.Checked.uint64 '0' + Assert.AreEqual(48UL, charuint64) + + // float + let floatuint64 = Operators.Checked.uint64 10.0 + Assert.AreEqual(10UL, floatuint64) + + // boundary value + let bounduint64 = Operators.Checked.uint64 429496729.0 + Assert.AreEqual(429496729UL, bounduint64) + + // overflow exception + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 (float System.UInt64.MaxValue + 1.0) |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.uint64 Double.MaxValue |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MaxValue + 1UL |> ignore) + + // overflow exception + CheckThrowsOverflowException(fun () -> UInt64.MinValue - 1UL |> ignore) + + [] + let Checkedunativeint() = + + // char + let charunativeint = Operators.Checked.unativeint '0' + Assert.AreEqual(48un, charunativeint) + + // float + let floatunativeint = Operators.Checked.unativeint 10.0 + Assert.AreEqual(10un, floatunativeint) + + // boundary value (dependent on pointer size) + if Info.isX86Runtime then + let boundunativeint = Operators.Checked.unativeint 4294967295.0 + Assert.AreEqual(4294967295un, boundunativeint) + else + let boundnativeint = Operators.Checked.unativeint 1.84467440737095505E+19 // 64 bit max value cannot be expressed exactly as double + Assert.AreEqual(18446744073709549568un, boundnativeint) + + // overflow exception (depends on pointer size) + CheckThrowsOverflowException(fun () -> + if Info.isX86Runtime then + Operators.Checked.unativeint (float UInt32.MaxValue + 1.0) |> ignore + else + Operators.Checked.unativeint (float UInt64.MaxValue + 1.0) |> ignore + ) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Single.MaxValue |> ignore) + CheckThrowsOverflowException(fun () -> Operators.Checked.unativeint Double.MaxValue |> ignore) + + type A = A + type B() = + static member op_Equality(_: B, _: B) = false + static member op_Inequality(_: B, _: B) = true + type [] C = + static member op_Equality(_: C, _: C) = true + static member op_Inequality(_: C, _: C) = true + static member op_Explicit(_: A) = C() // Explicit from another type + static member op_Explicit(_: C) = B() // Explicit to another type + static member op_Implicit(_: D) = C() // Duplicated implicit conversion + static member op_Explicit(_: C) = { D = 0 } // Duplicated explicit conversion + and D = { D : int } with + static member op_Implicit(_: A) = { D = 0 } // Implicit from another type + static member op_Implicit(_: D) = B() // Implicit to another type + static member op_Implicit(_: D) = C() // Duplicated implicit conversion + static member op_Explicit(_: C) = { D = 0 } // Duplicated explicit conversion + let [] Equality_ExplicitDynamicTests() = + Assert.False(LanguagePrimitives.EqualityDynamic(B())(B()) : bool) + Assert.True(LanguagePrimitives.InequalityDynamic(B())(B()) : bool) + Assert.True(LanguagePrimitives.EqualityDynamic(C())(C()) : bool) + Assert.True(LanguagePrimitives.InequalityDynamic(C())(C()) : bool) + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : C) + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : C) // Explicit from another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : B) // Explicit to another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : C) // Duplicated implicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : D) // Duplicated explicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(A) : D) // Implicit from another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : B) // Implicit to another type + Assert.NotNull(LanguagePrimitives.ExplicitDynamic({ D = 0 }) : C) // Duplicated implicit conversion + Assert.NotNull(LanguagePrimitives.ExplicitDynamic(C()) : D) // Duplicated explicit conversion \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.fs index 31d2fa41d15..c214e76daf7 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.fs @@ -1486,6 +1486,7 @@ Microsoft.FSharp.Core.LanguagePrimitives: TResult AdditionDynamic[T1,T2,TResult] Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseAndDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult BitwiseOrDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedAdditionDynamic[T1,T2,TResult](T1, T2) +Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedExplicitDynamic[T,TResult](T) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedMultiplyDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedSubtractionDynamic[T1,T2,TResult](T1, T2) Microsoft.FSharp.Core.LanguagePrimitives: TResult CheckedUnaryNegationDynamic[T,TResult](T) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index f2d93c0513c..60aac52400a 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -652,8 +652,8 @@ let diff normalize path1 path2 = if x >= 0 then line.Substring(x+cwd.Length) else line else line - let line1 = normalizePath lines1[i] - let line2 = normalizePath lines2[i] + let line1 = lines1[i] |> normalizePath + let line2 = lines2[i] |> normalizePath if line1 <> line2 then append <| sprintf "diff between [%s] and [%s]" path1 path2 diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index bf58ea27d08..a2cdb2fd60f 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -3657,6 +3657,46 @@ module Optimiations = begin let _ = check "opt.oi20c77tb" (0x8000000000000000L >>> 63) (0xFFFFFFFFFFFFFFFFL) let _ = check "opt.oi20c77yb" (0x8000000000000000L >>> 64) (0x8000000000000000L) + let _ = check "opt.oi20c77qc" ('a' + '\025') ('z') + let _ = check "opt.oi20c77wc" ('z' - '\025') ('a') + let _ = check "opt.oi20c77ec" (nativeint -3m) (-3n) + let _ = check "opt.oi20c77rc" (nativeint 3m) (3n) + let _ = check "opt.oi20c77tc" (unativeint 3m) (3un) + let _ = check "opt.oi20c77yc" (char 65535m) ('\uFFFF') + let _ = check "opt.oi20c77uc" (decimal '\uFFFF') (65535m) + let _ = check "opt.oi20c77ic" (nativeint "3") (3n) + let _ = check "opt.oi20c77oc" (nativeint "-3") (-3n) + let _ = check "opt.oi20c77pc" (unativeint "3") (3un) + let _ = check "opt.oi20c77ac" (Checked.(+) 'a' '\025') ('z') + let _ = check "opt.oi20c77sc" (Checked.(-) 'z' '\025') ('a') + let _ = check "opt.oi20c77dc" (Checked.nativeint -3m) (-3n) + let _ = check "opt.oi20c77fc" (Checked.nativeint 3m) (3n) + let _ = check "opt.oi20c77gc" (Checked.unativeint 3m) (3un) + let _ = check "opt.oi20c77hc" (Checked.char 65535m) ('\uFFFF') + let _ = check "opt.oi20c77jc" (Checked.nativeint "3") (3n) + let _ = check "opt.oi20c77kc" (Checked.nativeint "-3") (-3n) + let _ = check "opt.oi20c77lc" (Checked.unativeint "3") (3un) + let _ = check "opt.oi20c77zc" (int8 3.9m) (3y) + let _ = check "opt.oi20c77xc" (uint8 3.9m) (3uy) + let _ = check "opt.oi20c77cc" (int16 3.9m) (3s) + let _ = check "opt.oi20c77vc" (uint16 3.9m) (3us) + let _ = check "opt.oi20c77bc" (int32 3.9m) (3l) + let _ = check "opt.oi20c77nc" (uint32 3.9m) (3ul) + let _ = check "opt.oi20c77mc" (int64 3.9m) (3L) + let _ = check "opt.oi20c77,c" (uint64 3.9m) (3uL) + let _ = check "opt.oi20c77.c" (nativeint 3.9m) (3n) + let _ = check "opt.oi20c77/c" (unativeint 3.9m) (3un) + let _ = check "opt.oi20c77zc'" (Checked.int8 3.9m) (3y) + let _ = check "opt.oi20c77xc'" (Checked.uint8 3.9m) (3uy) + let _ = check "opt.oi20c77cc'" (Checked.int16 3.9m) (3s) + let _ = check "opt.oi20c77vc'" (Checked.uint16 3.9m) (3us) + let _ = check "opt.oi20c77bc'" (Checked.int32 3.9m) (3l) + let _ = check "opt.oi20c77nc'" (Checked.uint32 3.9m) (3ul) + let _ = check "opt.oi20c77mc'" (Checked.int64 3.9m) (3L) + let _ = check "opt.oi20c77,c'" (Checked.uint64 3.9m) (3uL) + let _ = check "opt.oi20c77.c'" (Checked.nativeint 3.9m) (3n) + let _ = check "opt.oi20c77/c'" (Checked.unativeint 3.9m) (3un) + end diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index cc3eaef035e..cdf91519c8d 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -2764,4 +2764,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 6d1b4c6dfc9..cb22322c94a 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -2009,4 +2009,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.47.stderr.bsl b/tests/fsharp/core/printing/output.47.stderr.bsl index 4d3209ca246..3e98bca2fc4 100644 --- a/tests/fsharp/core/printing/output.47.stderr.bsl +++ b/tests/fsharp/core/printing/output.47.stderr.bsl @@ -334,3 +334,111 @@ stdin(838,6): error FS1210: Active pattern '|A|B|' has a result type containing stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function + + #r "nuget:Newtonsoft.Json, 13.0.1" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +stdin(1117,1): error FS3302: The 'package management' feature requires language version 5.0 or above + + + JsonConvert.SerializeObject { ImmutableField0 = 7 } + ^^^^^^^^^^^ + +stdin(1122,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject { MutableField1 = 8 } |> printfn "%s";; + ^^^^^^^^^^^ + +stdin(1126,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject { MutableField1 = 9 } + ^^^^^^^^^^^ + +stdin(1128,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject {| AnonRecordField2 = 10 |} |> printfn "%s";; + ^^^^^^^^^^^ + +stdin(1131,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + JsonConvert.SerializeObject {| AnonRecordField2 = 11 |} + ^^^^^^^^^^^ + +stdin(1133,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. + + + #r "nuget: System.Text.Json" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +stdin(1136,1): error FS3302: The 'package management' feature requires language version 5.0 or above + + + let test3b = JsonSerializer.Deserialize test3a;; + -------------^^^^^^^^^^^^^^ + +stdin(1140,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test3c = JsonSerializer.Serialize { ImmutableField3 = 13 };; + -------------^^^^^^^^^^^^^^ + +stdin(1141,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test3d = JsonSerializer.Deserialize test3c;; + -------------^^^^^^^^^^^^^^ + +stdin(1142,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4a = JsonSerializer.Serialize { MutableField4 = 15 };; + -------------^^^^^^^^^^^^^^ + +stdin(1145,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4b = JsonSerializer.Deserialize test4a;; + -------------^^^^^^^^^^^^^^ + +stdin(1146,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4c = JsonSerializer.Serialize { MutableField4 = 16 };; + -------------^^^^^^^^^^^^^^ + +stdin(1147,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test4d = JsonSerializer.Deserialize test4c;; + -------------^^^^^^^^^^^^^^ + +stdin(1148,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5a = JsonSerializer.Serialize {| AnonRecordField5 = 17 |};; + -------------^^^^^^^^^^^^^^ + +stdin(1151,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5b = JsonSerializer.Deserialize test5a;; + -------------^^^^^^^^^^^^^^ + +stdin(1152,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5c = JsonSerializer.Serialize {| AnonRecordField5 = 18 |};; + -------------^^^^^^^^^^^^^^ + +stdin(1153,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + + + let test5d = JsonSerializer.Deserialize test5c;; + -------------^^^^^^^^^^^^^^ + +stdin(1154,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. + diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index af2d597eaad..b6f38074b36 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -6309,4 +6309,4 @@ val ShortName: string = "hi" > val list2: int list = [1] -> > > +> > > > > > > > > > > > > > > > > > > > > diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index acdcf6c63d8..9183285f872 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -6311,4 +6311,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0316. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0323.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 2bd43f77f8f..586d7a58860 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1778,4 +1778,57 @@ val ShortName: string = "hi" > val list2: int list +module FSI_0317. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0324.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string + +> val test3b: R3 + +> val test3c: string + +> val test3d: R3 + +> type R4 = + { mutable MutableField4: int } +val test4a: string + +> val test4b: R4 + +> val test4c: string + +> val test4d: R4 + +> type R5 = {| AnonRecordField5: int |} +val test5a: string + +> val test5b: R5 + +> val test5c: string + +> val test5d: R5 + > > > diff --git a/tests/fsharp/core/printing/output.quiet.stdout.bsl b/tests/fsharp/core/printing/output.quiet.stdout.bsl index 26683b52103..d8d778aca70 100644 --- a/tests/fsharp/core/printing/output.quiet.stdout.bsl +++ b/tests/fsharp/core/printing/output.quiet.stdout.bsl @@ -11,3 +11,6 @@ [Building 5 3...done] Expect ABC = ABC Expect ABC = ABC +{"ImmutableField0":6} +{"MutableField1":8} +{"AnonRecordField2":10} diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index acdcf6c63d8..9183285f872 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -6311,4 +6311,57 @@ val ShortName: string = "hi" > val list2: int list = [1] +module FSI_0316. + D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + +{"ImmutableField0":6} +type R1 = + { ImmutableField0: int } +val it: unit = () + +> val it: R1 = { ImmutableField0 = 7 } + +> {"MutableField1":8} +type R2 = + { mutable MutableField1: int } +val it: unit = () + +> val it: R2 = { MutableField1 = 9 } + +> {"AnonRecordField2":10} +val it: unit = () + +> val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } + +module FSI_0323.Project.fsproj + +type R3 = + { ImmutableField3: int } +val test3a: string = "{"ImmutableField3":12}" + +> val test3b: R3 = { ImmutableField3 = 12 } + +> val test3c: string = "{"ImmutableField3":13}" + +> val test3d: R3 = { ImmutableField3 = 13 } + +> type R4 = + { mutable MutableField4: int } +val test4a: string = "{"MutableField4":15}" + +> val test4b: R4 = { MutableField4 = 15 } + +> val test4c: string = "{"MutableField4":16}" + +> val test4d: R4 = { MutableField4 = 16 } + +> type R5 = {| AnonRecordField5: int |} +val test5a: string = "{"AnonRecordField5":17}" + +> val test5b: R5 = { AnonRecordField5 = 17 } + +> val test5c: string = "{"AnonRecordField5":18}" + +> val test5d: R5 = { AnonRecordField5 = 18 } + > > > diff --git a/tests/fsharp/core/printing/test.fsx b/tests/fsharp/core/printing/test.fsx index 1bd15e348f8..c0943540b49 100644 --- a/tests/fsharp/core/printing/test.fsx +++ b/tests/fsharp/core/printing/test.fsx @@ -1114,6 +1114,46 @@ let list = [{ A = 1; B = "a" }];; let list2 = [ for x in list do x.A ];; +#r "nuget:Newtonsoft.Json, 13.0.1" +type R1 = { ImmutableField0: int } +open Newtonsoft.Json +JsonConvert.SerializeObject { ImmutableField0 = 6 } |> printfn "%s";; + +JsonConvert.SerializeObject { ImmutableField0 = 7 } +|> JsonConvert.DeserializeObject;; + +type R2 = { mutable MutableField1: int } +JsonConvert.SerializeObject { MutableField1 = 8 } |> printfn "%s";; + +JsonConvert.SerializeObject { MutableField1 = 9 } +|> JsonConvert.DeserializeObject;; + +JsonConvert.SerializeObject {| AnonRecordField2 = 10 |} |> printfn "%s";; + +JsonConvert.SerializeObject {| AnonRecordField2 = 11 |} +|> JsonConvert.DeserializeObject<{| AnonRecordField2 :int |}>;; + +#r "nuget: System.Text.Json" +open System.Text.Json +type R3 = { ImmutableField3: int } +let test3a = JsonSerializer.Serialize { ImmutableField3 = 12 };; +let test3b = JsonSerializer.Deserialize test3a;; +let test3c = JsonSerializer.Serialize { ImmutableField3 = 13 };; +let test3d = JsonSerializer.Deserialize test3c;; + +type R4 = { mutable MutableField4: int } +let test4a = JsonSerializer.Serialize { MutableField4 = 15 };; +let test4b = JsonSerializer.Deserialize test4a;; +let test4c = JsonSerializer.Serialize { MutableField4 = 16 };; +let test4d = JsonSerializer.Deserialize test4c;; + +type R5 = {| AnonRecordField5: int |} +let test5a = JsonSerializer.Serialize {| AnonRecordField5 = 17 |};; +let test5b = JsonSerializer.Deserialize test5a;; +let test5c = JsonSerializer.Serialize {| AnonRecordField5 = 18 |};; +let test5d = JsonSerializer.Deserialize test5c;; + + ;; (* ;; needed, to isolate error regressions *) ;;exit 0;; (* piped in to enable error regressions *) \ No newline at end of file diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index e394597f052..cc85cf23ad6 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -1543,7 +1543,7 @@ module MoreQuotationsTests = [Coerce (enumerator, Object)])), Dispose, []), Value ()))))""" - let t9() = <@@ try failwith "test" with Failure _ -> 0 @@> + let t9() = <@@ try failwith "test" with Failure _ -> 0 @@> checkStrings "vwewvwewe9" (sprintf "%A" (t9())) """TryWith (Call (None, FailWith, [Value ("test")]), matchValue, Let (activePatternResult1557, Call (None, FailurePattern, [matchValue]), @@ -3257,9 +3257,11 @@ module TestMatchBang = module WitnessTests = open FSharp.Data.UnitSystems.SI.UnitSymbols + open FSharp.Linq + open FSharp.Linq.NullableOperators test "check CallWithWitness" - (<@ 1 + 1 @> + (<@ 1 + 1 @> |> function | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> minfo1.Name = "op_Addition" && @@ -3380,287 +3382,2045 @@ module WitnessTests = false | _ -> false) - test "check CallWithWitnesses all operators)" + test "check CallWithWitnesses all operators" (let tests = - [ <@@ sin 1.0 @@>, true - <@@ sin 1.0f @@>, true - <@@ sign 1.0f @@>, true - <@@ sqrt 1.0f @@>, true - <@@ 2.0f ** 2.0f @@>, true - <@@ atan2 3.0 4.0 @@>, true - <@@ 1.0f + 4.0f @@>, true - <@@ 1.0f - 4.0f @@>, true - <@@ 1.0f * 4.0f @@>, true - <@@ 1.0M * 4.0M @@>, true - <@@ 1.0f / 4.0f @@>, true - <@@ 1 % 4 @@>, true - <@@ -(4.0M) @@>, true - - <@@ 1y <<< 3 @@>, true - <@@ 1uy <<< 3 @@>, true - <@@ 1s <<< 3 @@>, true - <@@ 1us <<< 3 @@>, true - <@@ 1 <<< 3 @@>, true - <@@ 1u <<< 3 @@>, true - <@@ 1L <<< 3 @@>, true - <@@ 1UL <<< 3 @@>, true - <@@ LanguagePrimitives.GenericOne <<< 3 @@>, false - <@@ LanguagePrimitives.GenericOne <<< 3 @@>, false - - <@@ 1y >>> 3 @@>, true - <@@ 1uy >>> 3 @@>, true - <@@ 1s >>> 3 @@>, true - <@@ 1us >>> 3 @@>, true - <@@ 1 >>> 3 @@>, true - <@@ 1u >>> 3 @@>, true - <@@ 1L >>> 3 @@>, true - <@@ 1UL >>> 3 @@>, true - <@@ LanguagePrimitives.GenericOne >>> 3 @@>, false - <@@ LanguagePrimitives.GenericOne >>> 3 @@>, false + [|<@@ sin 1.0 @@>, box 0x3FEAED548F090CEELF // Around 0.841470984807897 + <@@ sin 1.0f @@>, box 0x3F576AA4lf // = 0.841471f + <@@ sign 1.0f @@>, box 1 + <@@ sqrt 1.0f @@>, box 1f + <@@ atan2 3.0 4.0 @@>, box 0x3FE4978FA3269EE1LF // Around 0.643501108793284 + <@@ atan2 3.0 4.0 @@>, box 0x3FE4978FA3269EE1LF // Around 0.643501108793284 - <@@ 1y &&& 3y @@>, true - <@@ 1uy &&& 3uy @@>, true - <@@ 1s &&& 3s @@>, true - <@@ 1us &&& 3us @@>, true - <@@ 1 &&& 3 @@>, true - <@@ 1u &&& 3u @@>, true - <@@ 1L &&& 3L @@>, true - <@@ 1UL &&& 3UL @@>, true - <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, false - - <@@ 1y ||| 3y @@>, true - <@@ 1uy ||| 3uy @@>, true - <@@ 1s ||| 3s @@>, true - <@@ 1us ||| 3us @@>, true - <@@ 1 ||| 3 @@>, true - <@@ 1u ||| 3u @@>, true - <@@ 1L ||| 3L @@>, true - <@@ 1UL ||| 3UL @@>, true - <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, false - - <@@ 1y ^^^ 3y @@>, true - <@@ 1uy ^^^ 3uy @@>, true - <@@ 1s ^^^ 3s @@>, true - <@@ 1us ^^^ 3us @@>, true - <@@ 1 ^^^ 3 @@>, true - <@@ 1u ^^^ 3u @@>, true - <@@ 1L ^^^ 3L @@>, true - <@@ 1UL ^^^ 3UL @@>, true - <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, false - <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, false - - <@@ ~~~3y @@>, true - <@@ ~~~3uy @@>, true - <@@ ~~~3s @@>, true - <@@ ~~~3us @@>, true - <@@ ~~~3 @@>, true - <@@ ~~~3u @@>, true - <@@ ~~~3L @@>, true - <@@ ~~~3UL @@>, true - <@@ ~~~LanguagePrimitives.GenericOne @@>, false - <@@ ~~~LanguagePrimitives.GenericOne @@>, false - - <@@ byte 3uy @@>, true - <@@ byte 3y @@>, true - <@@ byte 3s @@>, true - <@@ byte 3us @@>, true - <@@ byte 3 @@>, true - <@@ byte 3u @@>, true - <@@ byte 3L @@>, true - <@@ byte 3UL @@>, true - <@@ byte 3.0f @@>, true - <@@ byte 3.0 @@>, true - <@@ byte LanguagePrimitives.GenericOne @@>, false - <@@ byte LanguagePrimitives.GenericOne @@>, false - <@@ byte 3.0M @@>, true - <@@ byte "3" @@>, false - - <@@ sbyte 3uy @@>, true - <@@ sbyte 3y @@>, true - <@@ sbyte 3s @@>, true - <@@ sbyte 3us @@>, true - <@@ sbyte 3 @@>, true - <@@ sbyte 3u @@>, true - <@@ sbyte 3L @@>, true - <@@ sbyte 3UL @@>, true - <@@ sbyte 3.0f @@>, true - <@@ sbyte 3.0 @@>, true - <@@ sbyte LanguagePrimitives.GenericOne @@>, false - <@@ sbyte LanguagePrimitives.GenericOne @@>, false - <@@ sbyte 3.0M @@>, true - <@@ sbyte "3" @@>, false - - <@@ int16 3uy @@>, true - <@@ int16 3y @@>, true - <@@ int16 3s @@>, true - <@@ int16 3us @@>, true - <@@ int16 3 @@>, true - <@@ int16 3u @@>, true - <@@ int16 3L @@>, true - <@@ int16 3UL @@>, true - <@@ int16 3.0f @@>, true - <@@ int16 3.0 @@>, true - <@@ int16 LanguagePrimitives.GenericOne @@>, false - <@@ int16 LanguagePrimitives.GenericOne @@>, false - <@@ int16 3.0M @@>, true - <@@ int16 "3" @@>, false - - <@@ uint16 3uy @@>, true - <@@ uint16 3y @@>, true - <@@ uint16 3s @@>, true - <@@ uint16 3us @@>, true - <@@ uint16 3 @@>, true - <@@ uint16 3u @@>, true - <@@ uint16 3L @@>, true - <@@ uint16 3UL @@>, true - <@@ uint16 3.0f @@>, true - <@@ uint16 3.0 @@>, true - <@@ uint16 LanguagePrimitives.GenericOne @@>, false - <@@ uint16 LanguagePrimitives.GenericOne @@>, false - <@@ uint16 3.0M @@>, true - <@@ uint16 "3" @@>, false - - <@@ int32 3uy @@>, true - <@@ int32 3y @@>, true - <@@ int32 3s @@>, true - <@@ int32 3us @@>, true - <@@ int32 3 @@>, true - <@@ int32 3u @@>, true - <@@ int32 3L @@>, true - <@@ int32 3UL @@>, true - <@@ int32 3.0f @@>, true - <@@ int32 3.0 @@>, true - <@@ int32 LanguagePrimitives.GenericOne @@>, false - <@@ int32 LanguagePrimitives.GenericOne @@>, false - <@@ int32 3.0M @@>, true - <@@ int32 "3" @@>, false - - <@@ uint32 3uy @@>, true - <@@ uint32 3y @@>, true - <@@ uint32 3s @@>, true - <@@ uint32 3us @@>, true - <@@ uint32 3 @@>, true - <@@ uint32 3u @@>, true - <@@ uint32 3L @@>, true - <@@ uint32 3UL @@>, true - <@@ uint32 3.0f @@>, true - <@@ uint32 3.0 @@>, true - <@@ uint32 LanguagePrimitives.GenericOne @@>, false - <@@ uint32 LanguagePrimitives.GenericOne @@>, false - <@@ uint32 3.0M @@>, true - <@@ uint32 "3" @@>, false - - <@@ int64 3uy @@>, true - <@@ int64 3y @@>, true - <@@ int64 3s @@>, true - <@@ int64 3us @@>, true - <@@ int64 3 @@>, true - <@@ int64 3u @@>, true - <@@ int64 3L @@>, true - <@@ int64 3UL @@>, true - <@@ int64 3.0f @@>, true - <@@ int64 3.0 @@>, true - <@@ int64 LanguagePrimitives.GenericOne @@>, false - <@@ int64 LanguagePrimitives.GenericOne @@>, false - <@@ int64 3.0M @@>, true - <@@ int64 "3" @@>, false + <@@ 1y + 4y @@>, box 5y + <@@ 1uy + 4uy @@>, box 5uy + <@@ 1s + 4s @@>, box 5s + <@@ 1us + 4us @@>, box 5us + <@@ 1 + 4 @@>, box 5 + <@@ 1u + 4u @@>, box 5u + <@@ 1L + 4L @@>, box 5L + <@@ 1uL + 4uL @@>, box 5uL + <@@ 1.0f + 4.0f @@>, box 5f + <@@ 1.0 + 4.0 @@>, box 5. + <@@ 1m + 4m @@>, box 5m + <@@ 1m + 4m @@>, box 5m + <@@ 1I + 4I @@>, box 5I + <@@ '1' + '\004' @@>, box '5' + <@@ "abc" + "def" @@>, box "abcdef" + <@@ LanguagePrimitives.GenericOne + LanguagePrimitives.GenericOne @@>, box 2n + <@@ LanguagePrimitives.GenericOne + LanguagePrimitives.GenericOne @@>, box 2un + <@@ Checked.(+) 1y 4y @@>, box 5y + <@@ Checked.(+) 1uy 4uy @@>, box 5uy + <@@ Checked.(+) 1s 4s @@>, box 5s + <@@ Checked.(+) 1us 4us @@>, box 5us + <@@ Checked.(+) 1 4 @@>, box 5 + <@@ Checked.(+) 1u 4u @@>, box 5u + <@@ Checked.(+) 1L 4L @@>, box 5L + <@@ Checked.(+) 1uL 4uL @@>, box 5uL + <@@ Checked.(+) 1.0f 4.0f @@>, box 5f + <@@ Checked.(+) 1.0 4.0 @@>, box 5. + <@@ Checked.(+) 1m 4m @@>, box 5m + <@@ Checked.(+) 1m 4m @@>, box 5m + <@@ Checked.(+) 1I 4I @@>, box 5I + <@@ Checked.(+) '1' '\004' @@>, box '5' + <@@ Checked.(+) "abc" "def" @@>, box "abcdef" + <@@ Checked.(+) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 2n + <@@ Checked.(+) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 2un + + <@@ 4y - 1y @@>, box 3y + <@@ 4uy - 1uy @@>, box 3uy + <@@ 4s - 1s @@>, box 3s + <@@ 4us - 1us @@>, box 3us + <@@ 4 - 1 @@>, box 3 + <@@ 4u - 1u @@>, box 3u + <@@ 4L - 1L @@>, box 3L + <@@ 4uL - 1uL @@>, box 3uL + <@@ 4.0f - 1.0f @@>, box 3f + <@@ 4.0 - 1.0 @@>, box 3. + <@@ 4m - 1m @@>, box 3m + <@@ 4m - 1m @@>, box 3m + <@@ 4I - 1I @@>, box 3I + <@@ '4' - '\001' @@>, box '3' + <@@ LanguagePrimitives.GenericOne - LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne - LanguagePrimitives.GenericOne @@>, box 0un + <@@ Checked.(-) 4y 1y @@>, box 3y + <@@ Checked.(-) 4uy 1uy @@>, box 3uy + <@@ Checked.(-) 4s 1s @@>, box 3s + <@@ Checked.(-) 4us 1us @@>, box 3us + <@@ Checked.(-) 4 1 @@>, box 3 + <@@ Checked.(-) 4u 1u @@>, box 3u + <@@ Checked.(-) 4L 1L @@>, box 3L + <@@ Checked.(-) 4uL 1uL @@>, box 3uL + <@@ Checked.(-) 4.0f 1.0f @@>, box 3f + <@@ Checked.(-) 4.0 1.0 @@>, box 3. + <@@ Checked.(-) 4m 1m @@>, box 3m + <@@ Checked.(-) 4m 1m @@>, box 3m + <@@ Checked.(-) 4I 1I @@>, box 3I + <@@ Checked.(-) '4' '\001' @@>, box '3' + <@@ Checked.(-) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 0n + <@@ Checked.(-) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 2y * 4y @@>, box 8y + <@@ 2uy * 4uy @@>, box 8uy + <@@ 2s * 4s @@>, box 8s + <@@ 2us * 4us @@>, box 8us + <@@ 2 * 4 @@>, box 8 + <@@ 2u * 4u @@>, box 8u + <@@ 2L * 4L @@>, box 8L + <@@ 2uL * 4uL @@>, box 8uL + <@@ 2.0f * 4.0f @@>, box 8f + <@@ 2.0 * 4.0 @@>, box 8. + <@@ 2m * 4m @@>, box 8m + <@@ 2m * 4m @@>, box 8m + <@@ 2I * 4I @@>, box 8I + <@@ LanguagePrimitives.GenericOne * LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne * LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.(*) 2y 4y @@>, box 8y + <@@ Checked.(*) 2uy 4uy @@>, box 8uy + <@@ Checked.(*) 2s 4s @@>, box 8s + <@@ Checked.(*) 2us 4us @@>, box 8us + <@@ Checked.(*) 2 4 @@>, box 8 + <@@ Checked.(*) 2u 4u @@>, box 8u + <@@ Checked.(*) 2L 4L @@>, box 8L + <@@ Checked.(*) 2uL 4uL @@>, box 8uL + <@@ Checked.(*) 2.0f 4.0f @@>, box 8f + <@@ Checked.(*) 2.0 4.0 @@>, box 8. + <@@ Checked.(*) 2m 4m @@>, box 8m + <@@ Checked.(*) 2m 4m @@>, box 8m + <@@ Checked.(*) 2I 4I @@>, box 8I + <@@ Checked.(*) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.(*) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 6y / 3y @@>, box 2y + <@@ 6uy / 3uy @@>, box 2uy + <@@ 6s / 3s @@>, box 2s + <@@ 6us / 3us @@>, box 2us + <@@ 6 / 3 @@>, box 2 + <@@ 6u / 3u @@>, box 2u + <@@ 6L / 3L @@>, box 2L + <@@ 6uL / 3uL @@>, box 2uL + <@@ 6.0f / 3.0f @@>, box 2f + <@@ 6.0 / 3.0 @@>, box 2. + <@@ 6m / 3m @@>, box 2m + <@@ 6m / 3m @@>, box 2m + <@@ 6I / 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne / LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne / LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 9y % 4y @@>, box 1y + <@@ 9uy % 4uy @@>, box 1uy + <@@ 9s % 4s @@>, box 1s + <@@ 9us % 4us @@>, box 1us + <@@ 9 % 4 @@>, box 1 + <@@ 9u % 4u @@>, box 1u + <@@ 9L % 4L @@>, box 1L + <@@ 9uL % 4uL @@>, box 1uL + <@@ 9.0f % 4.0f @@>, box 1f + <@@ 9.0 % 4.0 @@>, box 1. + <@@ 9m % 4m @@>, box 1m + <@@ 9m % 4m @@>, box 1m + <@@ 9I % 4I @@>, box 1I + <@@ LanguagePrimitives.GenericOne % LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne % LanguagePrimitives.GenericOne @@>, box 0un + + <@@ +(1y) @@>, box 1y + <@@ +(1uy) @@>, box 1uy + <@@ +(1s) @@>, box 1s + <@@ +(1us) @@>, box 1us + <@@ +(1) @@>, box 1 + <@@ +(1u) @@>, box 1u + <@@ +(1L) @@>, box 1L + <@@ +(1uL) @@>, box 1uL + <@@ +(1f) @@>, box 1f + <@@ +(1.) @@>, box 1. + <@@ +(1m) @@>, box 1m + <@@ +(1m) @@>, box 1m + <@@ +(1I) @@>, box 1I + <@@ +(LanguagePrimitives.GenericOne) @@>, box 1n + <@@ +(LanguagePrimitives.GenericOne) @@>, box 1un + + <@@ -(1y) @@>, box -1y + <@@ -(1s) @@>, box -1s + <@@ -(1) @@>, box -1 + <@@ -(1L) @@>, box -1L + <@@ -(1f) @@>, box -1f + <@@ -(1.) @@>, box -1. + <@@ -(1m) @@>, box -1m + <@@ -(1m) @@>, box -1m + <@@ -(1I) @@>, box -1I + <@@ -(LanguagePrimitives.GenericOne) @@>, box -1n + <@@ Checked.(~-) (1y) @@>, box -1y + <@@ Checked.(~-) (1s) @@>, box -1s + <@@ Checked.(~-) (1) @@>, box -1 + <@@ Checked.(~-) (1L) @@>, box -1L + <@@ Checked.(~-) (1f) @@>, box -1f + <@@ Checked.(~-) (1.) @@>, box -1. + <@@ Checked.(~-) (1m) @@>, box -1m + <@@ Checked.(~-) (1m) @@>, box -1m + <@@ Checked.(~-) (1I) @@>, box -1I + <@@ Checked.(~-) (LanguagePrimitives.GenericOne) @@>, box -1n + + <@@ 4f ** 3f @@>, box 64f + <@@ 4. ** 3. @@>, box 64. + <@@ 4I ** 3 @@>, box 64I + + <@@ 1y <<< 3 @@>, box 8y + <@@ 1uy <<< 3 @@>, box 8uy + <@@ 1s <<< 3 @@>, box 8s + <@@ 1us <<< 3 @@>, box 8us + <@@ 1 <<< 3 @@>, box 8 + <@@ 1u <<< 3 @@>, box 8u + <@@ 1L <<< 3 @@>, box 8L + <@@ 1UL <<< 3 @@>, box 8UL + <@@ 1I <<< 3 @@>, box 8I + <@@ LanguagePrimitives.GenericOne <<< 3 @@>, box 8n + <@@ LanguagePrimitives.GenericOne <<< 3 @@>, box 8un + + <@@ 1y >>> 3 @@>, box 0y + <@@ 1uy >>> 3 @@>, box 0uy + <@@ 1s >>> 3 @@>, box 0s + <@@ 1us >>> 3 @@>, box 0us + <@@ 1 >>> 3 @@>, box 0 + <@@ 1u >>> 3 @@>, box 0u + <@@ 1L >>> 3 @@>, box 0L + <@@ 1UL >>> 3 @@>, box 0UL + <@@ 1I >>> 3 @@>, box 0I + <@@ LanguagePrimitives.GenericOne >>> 3 @@>, box 0n + <@@ LanguagePrimitives.GenericOne >>> 3 @@>, box 0un - <@@ uint64 3uy @@>, true - <@@ uint64 3y @@>, true - <@@ uint64 3s @@>, true - <@@ uint64 3us @@>, true - <@@ uint64 3 @@>, true - <@@ uint64 3u @@>, true - <@@ uint64 3L @@>, true - <@@ uint64 3UL @@>, true - <@@ uint64 3.0f @@>, true - <@@ uint64 3.0 @@>, true - <@@ uint64 LanguagePrimitives.GenericOne @@>, false - <@@ uint64 LanguagePrimitives.GenericOne @@>, false - <@@ uint64 3.0M @@>, true - <@@ uint64 "3" @@>, false - - <@@ nativeint 3uy @@>, true - <@@ nativeint 3y @@>, true - <@@ nativeint 3s @@>, true - <@@ nativeint 3us @@>, true - <@@ nativeint 3 @@>, true - <@@ nativeint 3u @@>, true - <@@ nativeint 3L @@>, true - <@@ nativeint 3UL @@>, true - <@@ nativeint 3.0f @@>, true - <@@ nativeint 3.0 @@>, true - <@@ nativeint LanguagePrimitives.GenericOne @@>, false - <@@ nativeint LanguagePrimitives.GenericOne @@>, false - //<@@ nativeint 3.0M @@>, false - //<@@ nativeint "3" @@>, false - - <@@ unativeint 3uy @@>, true - <@@ unativeint 3y @@>, true - <@@ unativeint 3s @@>, true - <@@ unativeint 3us @@>, true - <@@ unativeint 3 @@>, true - <@@ unativeint 3u @@>, true - <@@ unativeint 3L @@>, true - <@@ unativeint 3UL @@>, true - <@@ unativeint 3.0f @@>, true - <@@ unativeint 3.0 @@>, true - <@@ unativeint LanguagePrimitives.GenericOne @@>, false - <@@ unativeint LanguagePrimitives.GenericOne @@>, false - //<@@ unativeint 3.0M @@>, true - //<@@ unativeint "3" @@>, true - - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericZero @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ LanguagePrimitives.GenericOne @@>, true - <@@ List.sum [ 1; 2 ] @@>, true - <@@ List.sum [ 1.0f; 2.0f ] @@>, true - <@@ List.sum [ 1.0; 2.0 ] @@>, true - <@@ List.sum [ 1.0M; 2.0M ] @@>, true - <@@ List.average [ 1.0; 2.0 ] @@>, true - <@@ List.average [ 1.0f; 2.0f ] @@>, true - <@@ List.average [ 1.0M; 2.0M ] @@>, true - ] - - tests |> List.forall (fun (test, canEval) -> - if canEval then - printfn "--> checking we can evaluate %A" test - FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test |> ignore - printfn "<-- evaluated!" - else - printfn "skipping evaluation of %A because LinqExpressionConverter can't handle it" test - printfn "checking %A" test + <@@ 1y &&& 3y @@>, box 1y + <@@ 1uy &&& 3uy @@>, box 1uy + <@@ 1s &&& 3s @@>, box 1s + <@@ 1us &&& 3us @@>, box 1us + <@@ 1 &&& 3 @@>, box 1 + <@@ 1u &&& 3u @@>, box 1u + <@@ 1L &&& 3L @@>, box 1L + <@@ 1UL &&& 3UL @@>, box 1UL + <@@ 1I &&& 3I @@>, box 1I + <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne &&& LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 1y ||| 3y @@>, box 3y + <@@ 1uy ||| 3uy @@>, box 3uy + <@@ 1s ||| 3s @@>, box 3s + <@@ 1us ||| 3us @@>, box 3us + <@@ 1 ||| 3 @@>, box 3 + <@@ 1u ||| 3u @@>, box 3u + <@@ 1L ||| 3L @@>, box 3L + <@@ 1UL ||| 3UL @@>, box 3UL + <@@ 1I ||| 3I @@>, box 3I + <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne ||| LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 1y ^^^ 3y @@>, box 2y + <@@ 1uy ^^^ 3uy @@>, box 2uy + <@@ 1s ^^^ 3s @@>, box 2s + <@@ 1us ^^^ 3us @@>, box 2us + <@@ 1 ^^^ 3 @@>, box 2 + <@@ 1u ^^^ 3u @@>, box 2u + <@@ 1L ^^^ 3L @@>, box 2L + <@@ 1UL ^^^ 3UL @@>, box 2UL + <@@ 1I ^^^ 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne ^^^ LanguagePrimitives.GenericOne @@>, box 0un + + <@@ ~~~3y @@>, box -4y + <@@ ~~~3uy @@>, box 252uy + <@@ ~~~3s @@>, box -4s + <@@ ~~~3us @@>, box 65532us + <@@ ~~~3 @@>, box -4 + <@@ ~~~3u @@>, box 4294967292u + <@@ ~~~3L @@>, box -4L + <@@ ~~~3UL @@>, box 18446744073709551612UL + <@@ ~~~LanguagePrimitives.GenericOne @@>, box ~~~1n + <@@ ~~~LanguagePrimitives.GenericOne @@>, box ~~~1un + + <@@ byte 3uy @@>, box 3uy + <@@ byte 3y @@>, box 3uy + <@@ byte 3s @@>, box 3uy + <@@ byte 3us @@>, box 3uy + <@@ byte 3 @@>, box 3uy + <@@ byte 3u @@>, box 3uy + <@@ byte 3L @@>, box 3uy + <@@ byte 3UL @@>, box 3uy + <@@ byte '\003' @@>, box 3uy + <@@ byte 3.0f @@>, box 3uy + <@@ byte 3.0 @@>, box 3uy + <@@ byte 3.0 @@>, box 3uy + <@@ byte 3I @@>, box 3uy + <@@ byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ byte 3.0M @@>, box 3uy + <@@ byte "3" @@>, box 3uy + <@@ uint8 3uy @@>, box 3uy + <@@ uint8 3y @@>, box 3uy + <@@ uint8 3s @@>, box 3uy + <@@ uint8 3us @@>, box 3uy + <@@ uint8 3 @@>, box 3uy + <@@ uint8 3u @@>, box 3uy + <@@ uint8 3L @@>, box 3uy + <@@ uint8 3UL @@>, box 3uy + <@@ uint8 '\003' @@>, box 3uy + <@@ uint8 3.0f @@>, box 3uy + <@@ uint8 3.0 @@>, box 3uy + <@@ uint8 3.0 @@>, box 3uy + <@@ uint8 3I @@>, box 3uy + <@@ uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ uint8 3.0M @@>, box 3uy + <@@ uint8 "3" @@>, box 3uy + <@@ Checked.byte 3uy @@>, box 3uy + <@@ Checked.byte 3y @@>, box 3uy + <@@ Checked.byte 3s @@>, box 3uy + <@@ Checked.byte 3us @@>, box 3uy + <@@ Checked.byte 3 @@>, box 3uy + <@@ Checked.byte 3u @@>, box 3uy + <@@ Checked.byte 3L @@>, box 3uy + <@@ Checked.byte 3UL @@>, box 3uy + <@@ Checked.byte '\003' @@>, box 3uy + <@@ Checked.byte 3.0f @@>, box 3uy + <@@ Checked.byte 3.0 @@>, box 3uy + <@@ Checked.byte 3.0 @@>, box 3uy + <@@ Checked.byte 3I @@>, box 3uy + <@@ Checked.byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.byte LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.byte 3.0M @@>, box 3uy + <@@ Checked.byte "3" @@>, box 3uy + <@@ Checked.uint8 3uy @@>, box 3uy + <@@ Checked.uint8 3y @@>, box 3uy + <@@ Checked.uint8 3s @@>, box 3uy + <@@ Checked.uint8 3us @@>, box 3uy + <@@ Checked.uint8 3 @@>, box 3uy + <@@ Checked.uint8 3u @@>, box 3uy + <@@ Checked.uint8 3L @@>, box 3uy + <@@ Checked.uint8 3UL @@>, box 3uy + <@@ Checked.uint8 '\003' @@>, box 3uy + <@@ Checked.uint8 3.0f @@>, box 3uy + <@@ Checked.uint8 3.0 @@>, box 3uy + <@@ Checked.uint8 3.0 @@>, box 3uy + <@@ Checked.uint8 3I @@>, box 3uy + <@@ Checked.uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.uint8 LanguagePrimitives.GenericOne @@>, box 1uy + <@@ Checked.uint8 3.0M @@>, box 3uy + <@@ Checked.uint8 "3" @@>, box 3uy + + <@@ sbyte 3uy @@>, box 3y + <@@ sbyte 3y @@>, box 3y + <@@ sbyte 3s @@>, box 3y + <@@ sbyte 3us @@>, box 3y + <@@ sbyte 3 @@>, box 3y + <@@ sbyte 3u @@>, box 3y + <@@ sbyte 3L @@>, box 3y + <@@ sbyte 3UL @@>, box 3y + <@@ sbyte '\003' @@>, box 3y + <@@ sbyte 3.0f @@>, box 3y + <@@ sbyte 3.0 @@>, box 3y + <@@ sbyte 3.0 @@>, box 3y + <@@ sbyte 3I @@>, box 3y + <@@ sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ sbyte 3.0M @@>, box 3y + <@@ sbyte "3" @@>, box 3y + <@@ int8 3uy @@>, box 3y + <@@ int8 3y @@>, box 3y + <@@ int8 3s @@>, box 3y + <@@ int8 3us @@>, box 3y + <@@ int8 3 @@>, box 3y + <@@ int8 3u @@>, box 3y + <@@ int8 3L @@>, box 3y + <@@ int8 3UL @@>, box 3y + <@@ int8 '\003' @@>, box 3y + <@@ int8 3.0f @@>, box 3y + <@@ int8 3.0 @@>, box 3y + <@@ int8 3.0 @@>, box 3y + <@@ int8 3I @@>, box 3y + <@@ int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ int8 3.0M @@>, box 3y + <@@ int8 "3" @@>, box 3y + <@@ Checked.sbyte 3uy @@>, box 3y + <@@ Checked.sbyte 3y @@>, box 3y + <@@ Checked.sbyte 3s @@>, box 3y + <@@ Checked.sbyte 3us @@>, box 3y + <@@ Checked.sbyte 3 @@>, box 3y + <@@ Checked.sbyte 3u @@>, box 3y + <@@ Checked.sbyte 3L @@>, box 3y + <@@ Checked.sbyte 3UL @@>, box 3y + <@@ Checked.sbyte '\003' @@>, box 3y + <@@ Checked.sbyte 3.0f @@>, box 3y + <@@ Checked.sbyte 3.0 @@>, box 3y + <@@ Checked.sbyte 3.0 @@>, box 3y + <@@ Checked.sbyte 3I @@>, box 3y + <@@ Checked.sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.sbyte LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.sbyte 3.0M @@>, box 3y + <@@ Checked.sbyte "3" @@>, box 3y + <@@ Checked.int8 3uy @@>, box 3y + <@@ Checked.int8 3y @@>, box 3y + <@@ Checked.int8 3s @@>, box 3y + <@@ Checked.int8 3us @@>, box 3y + <@@ Checked.int8 3 @@>, box 3y + <@@ Checked.int8 3u @@>, box 3y + <@@ Checked.int8 3L @@>, box 3y + <@@ Checked.int8 3UL @@>, box 3y + <@@ Checked.int8 '\003' @@>, box 3y + <@@ Checked.int8 3.0f @@>, box 3y + <@@ Checked.int8 3.0 @@>, box 3y + <@@ Checked.int8 3.0 @@>, box 3y + <@@ Checked.int8 3I @@>, box 3y + <@@ Checked.int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.int8 LanguagePrimitives.GenericOne @@>, box 1y + <@@ Checked.int8 3.0M @@>, box 3y + <@@ Checked.int8 "3" @@>, box 3y + + <@@ int16 3uy @@>, box 3s + <@@ int16 3y @@>, box 3s + <@@ int16 3s @@>, box 3s + <@@ int16 3us @@>, box 3s + <@@ int16 3 @@>, box 3s + <@@ int16 3u @@>, box 3s + <@@ int16 3L @@>, box 3s + <@@ int16 3UL @@>, box 3s + <@@ int16 '\003' @@>, box 3s + <@@ int16 3.0f @@>, box 3s + <@@ int16 3.0 @@>, box 3s + <@@ int16 3.0 @@>, box 3s + <@@ int16 3I @@>, box 3s + <@@ int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ int16 3.0M @@>, box 3s + <@@ int16 "3" @@>, box 3s + <@@ Checked.int16 3uy @@>, box 3s + <@@ Checked.int16 3y @@>, box 3s + <@@ Checked.int16 3s @@>, box 3s + <@@ Checked.int16 3us @@>, box 3s + <@@ Checked.int16 3 @@>, box 3s + <@@ Checked.int16 3u @@>, box 3s + <@@ Checked.int16 3L @@>, box 3s + <@@ Checked.int16 3UL @@>, box 3s + <@@ Checked.int16 '\003' @@>, box 3s + <@@ Checked.int16 3.0f @@>, box 3s + <@@ Checked.int16 3.0 @@>, box 3s + <@@ Checked.int16 3.0 @@>, box 3s + <@@ Checked.int16 3I @@>, box 3s + <@@ Checked.int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ Checked.int16 LanguagePrimitives.GenericOne @@>, box 1s + <@@ Checked.int16 3.0M @@>, box 3s + <@@ Checked.int16 "3" @@>, box 3s + + <@@ uint16 3uy @@>, box 3us + <@@ uint16 3y @@>, box 3us + <@@ uint16 3s @@>, box 3us + <@@ uint16 3us @@>, box 3us + <@@ uint16 3 @@>, box 3us + <@@ uint16 3u @@>, box 3us + <@@ uint16 3L @@>, box 3us + <@@ uint16 3UL @@>, box 3us + <@@ uint16 '\003' @@>, box 3us + <@@ uint16 3.0f @@>, box 3us + <@@ uint16 3.0 @@>, box 3us + <@@ uint16 3.0 @@>, box 3us + <@@ uint16 3I @@>, box 3us + <@@ uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ uint16 3.0M @@>, box 3us + <@@ uint16 "3" @@>, box 3us + <@@ Checked.uint16 3uy @@>, box 3us + <@@ Checked.uint16 3y @@>, box 3us + <@@ Checked.uint16 3s @@>, box 3us + <@@ Checked.uint16 3us @@>, box 3us + <@@ Checked.uint16 3 @@>, box 3us + <@@ Checked.uint16 3u @@>, box 3us + <@@ Checked.uint16 3L @@>, box 3us + <@@ Checked.uint16 3UL @@>, box 3us + <@@ Checked.uint16 '\003' @@>, box 3us + <@@ Checked.uint16 3.0f @@>, box 3us + <@@ Checked.uint16 3.0 @@>, box 3us + <@@ Checked.uint16 3.0 @@>, box 3us + <@@ Checked.uint16 3I @@>, box 3us + <@@ Checked.uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ Checked.uint16 LanguagePrimitives.GenericOne @@>, box 1us + <@@ Checked.uint16 3.0M @@>, box 3us + <@@ Checked.uint16 "3" @@>, box 3us + + <@@ int 3uy @@>, box 3 + <@@ int 3y @@>, box 3 + <@@ int 3s @@>, box 3 + <@@ int 3us @@>, box 3 + <@@ int 3 @@>, box 3 + <@@ int 3u @@>, box 3 + <@@ int 3L @@>, box 3 + <@@ int 3UL @@>, box 3 + <@@ int '\003' @@>, box 3 + <@@ int 3.0f @@>, box 3 + <@@ int 3.0 @@>, box 3 + <@@ int 3.0 @@>, box 3 + <@@ int 3I @@>, box 3 + <@@ int LanguagePrimitives.GenericOne @@>, box 1 + <@@ int LanguagePrimitives.GenericOne @@>, box 1 + <@@ int 3.0M @@>, box 3 + <@@ int "3" @@>, box 3 + <@@ int32 3uy @@>, box 3 + <@@ int32 3y @@>, box 3 + <@@ int32 3s @@>, box 3 + <@@ int32 3us @@>, box 3 + <@@ int32 3 @@>, box 3 + <@@ int32 3u @@>, box 3 + <@@ int32 3L @@>, box 3 + <@@ int32 3UL @@>, box 3 + <@@ int32 '\003' @@>, box 3 + <@@ int32 3.0f @@>, box 3 + <@@ int32 3.0 @@>, box 3 + <@@ int32 3.0 @@>, box 3 + <@@ int32 3I @@>, box 3 + <@@ int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ int32 3.0M @@>, box 3 + <@@ int32 "3" @@>, box 3 + <@@ Checked.int 3uy @@>, box 3 + <@@ Checked.int 3y @@>, box 3 + <@@ Checked.int 3s @@>, box 3 + <@@ Checked.int 3us @@>, box 3 + <@@ Checked.int 3 @@>, box 3 + <@@ Checked.int 3u @@>, box 3 + <@@ Checked.int 3L @@>, box 3 + <@@ Checked.int 3UL @@>, box 3 + <@@ Checked.int '\003' @@>, box 3 + <@@ Checked.int 3.0f @@>, box 3 + <@@ Checked.int 3.0 @@>, box 3 + <@@ Checked.int 3.0 @@>, box 3 + <@@ Checked.int 3I @@>, box 3 + <@@ Checked.int LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int 3.0M @@>, box 3 + <@@ Checked.int "3" @@>, box 3 + <@@ Checked.int32 3uy @@>, box 3 + <@@ Checked.int32 3y @@>, box 3 + <@@ Checked.int32 3s @@>, box 3 + <@@ Checked.int32 3us @@>, box 3 + <@@ Checked.int32 3 @@>, box 3 + <@@ Checked.int32 3u @@>, box 3 + <@@ Checked.int32 3L @@>, box 3 + <@@ Checked.int32 3UL @@>, box 3 + <@@ Checked.int32 '\003' @@>, box 3 + <@@ Checked.int32 3.0f @@>, box 3 + <@@ Checked.int32 3.0 @@>, box 3 + <@@ Checked.int32 3.0 @@>, box 3 + <@@ Checked.int32 3I @@>, box 3 + <@@ Checked.int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int32 LanguagePrimitives.GenericOne @@>, box 1 + <@@ Checked.int32 3.0M @@>, box 3 + <@@ Checked.int32 "3" @@>, box 3 + + <@@ uint 3uy @@>, box 3u + <@@ uint 3y @@>, box 3u + <@@ uint 3s @@>, box 3u + <@@ uint 3us @@>, box 3u + <@@ uint 3 @@>, box 3u + <@@ uint 3u @@>, box 3u + <@@ uint 3L @@>, box 3u + <@@ uint 3UL @@>, box 3u + <@@ uint '\003' @@>, box 3u + <@@ uint 3.0f @@>, box 3u + <@@ uint 3.0 @@>, box 3u + <@@ uint 3.0 @@>, box 3u + <@@ uint 3I @@>, box 3u + <@@ uint LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint 3.0M @@>, box 3u + <@@ uint "3" @@>, box 3u + <@@ uint32 3uy @@>, box 3u + <@@ uint32 3y @@>, box 3u + <@@ uint32 3s @@>, box 3u + <@@ uint32 3us @@>, box 3u + <@@ uint32 3 @@>, box 3u + <@@ uint32 3u @@>, box 3u + <@@ uint32 3L @@>, box 3u + <@@ uint32 3UL @@>, box 3u + <@@ uint32 '\003' @@>, box 3u + <@@ uint32 3.0f @@>, box 3u + <@@ uint32 3.0 @@>, box 3u + <@@ uint32 3.0 @@>, box 3u + <@@ uint32 3I @@>, box 3u + <@@ uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ uint32 3.0M @@>, box 3u + <@@ uint32 "3" @@>, box 3u + <@@ Checked.uint32 3uy @@>, box 3u + <@@ Checked.uint32 3y @@>, box 3u + <@@ Checked.uint32 3s @@>, box 3u + <@@ Checked.uint32 3us @@>, box 3u + <@@ Checked.uint32 3 @@>, box 3u + <@@ Checked.uint32 3u @@>, box 3u + <@@ Checked.uint32 3L @@>, box 3u + <@@ Checked.uint32 3UL @@>, box 3u + <@@ Checked.uint32 '\003' @@>, box 3u + <@@ Checked.uint32 3.0f @@>, box 3u + <@@ Checked.uint32 3.0 @@>, box 3u + <@@ Checked.uint32 3.0 @@>, box 3u + <@@ Checked.uint32 3I @@>, box 3u + <@@ Checked.uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ Checked.uint32 LanguagePrimitives.GenericOne @@>, box 1u + <@@ Checked.uint32 3.0M @@>, box 3u + <@@ Checked.uint32 "3" @@>, box 3u + + <@@ int64 3uy @@>, box 3L + <@@ int64 3y @@>, box 3L + <@@ int64 3s @@>, box 3L + <@@ int64 3us @@>, box 3L + <@@ int64 3 @@>, box 3L + <@@ int64 3u @@>, box 3L + <@@ int64 3L @@>, box 3L + <@@ int64 3UL @@>, box 3L + <@@ int64 '\003' @@>, box 3L + <@@ int64 3.0f @@>, box 3L + <@@ int64 3.0 @@>, box 3L + <@@ int64 3.0 @@>, box 3L + <@@ int64 3I @@>, box 3L + <@@ int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ int64 3.0M @@>, box 3L + <@@ int64 "3" @@>, box 3L + <@@ Checked.int64 3uy @@>, box 3L + <@@ Checked.int64 3y @@>, box 3L + <@@ Checked.int64 3s @@>, box 3L + <@@ Checked.int64 3us @@>, box 3L + <@@ Checked.int64 3 @@>, box 3L + <@@ Checked.int64 3u @@>, box 3L + <@@ Checked.int64 3L @@>, box 3L + <@@ Checked.int64 3UL @@>, box 3L + <@@ Checked.int64 '\003' @@>, box 3L + <@@ Checked.int64 3.0f @@>, box 3L + <@@ Checked.int64 3.0 @@>, box 3L + <@@ Checked.int64 3.0 @@>, box 3L + <@@ Checked.int64 3I @@>, box 3L + <@@ Checked.int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ Checked.int64 LanguagePrimitives.GenericOne @@>, box 1L + <@@ Checked.int64 3.0M @@>, box 3L + <@@ Checked.int64 "3" @@>, box 3L + + <@@ uint64 3uy @@>, box 3UL + <@@ uint64 3y @@>, box 3UL + <@@ uint64 3s @@>, box 3UL + <@@ uint64 3us @@>, box 3UL + <@@ uint64 3 @@>, box 3UL + <@@ uint64 3u @@>, box 3UL + <@@ uint64 3L @@>, box 3UL + <@@ uint64 3UL @@>, box 3UL + <@@ uint64 '\003' @@>, box 3UL + <@@ uint64 3.0f @@>, box 3UL + <@@ uint64 3.0 @@>, box 3UL + <@@ uint64 3.0 @@>, box 3UL + <@@ uint64 3I @@>, box 3UL + <@@ uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ uint64 3.0M @@>, box 3UL + <@@ uint64 "3" @@>, box 3UL + <@@ Checked.uint64 3uy @@>, box 3UL + <@@ Checked.uint64 3y @@>, box 3UL + <@@ Checked.uint64 3s @@>, box 3UL + <@@ Checked.uint64 3us @@>, box 3UL + <@@ Checked.uint64 3 @@>, box 3UL + <@@ Checked.uint64 3u @@>, box 3UL + <@@ Checked.uint64 3L @@>, box 3UL + <@@ Checked.uint64 3UL @@>, box 3UL + <@@ Checked.uint64 '\003' @@>, box 3UL + <@@ Checked.uint64 3.0f @@>, box 3UL + <@@ Checked.uint64 3.0 @@>, box 3UL + <@@ Checked.uint64 3.0 @@>, box 3UL + <@@ Checked.uint64 3I @@>, box 3UL + <@@ Checked.uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ Checked.uint64 LanguagePrimitives.GenericOne @@>, box 1UL + <@@ Checked.uint64 3.0M @@>, box 3UL + <@@ Checked.uint64 "3" @@>, box 3UL + + <@@ char 51uy @@>, box '3' + <@@ char 51y @@>, box '3' + <@@ char 51s @@>, box '3' + <@@ char 51us @@>, box '3' + <@@ char 51 @@>, box '3' + <@@ char 51u @@>, box '3' + <@@ char 51L @@>, box '3' + <@@ char 51UL @@>, box '3' + <@@ char '3' @@>, box '3' + <@@ char 51.0f @@>, box '3' + <@@ char 51.0 @@>, box '3' + <@@ char 51.0 @@>, box '3' + <@@ char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ char 51.0M @@>, box '3' + <@@ char "3" @@>, box '3' + <@@ Checked.char 51uy @@>, box '3' + <@@ Checked.char 51y @@>, box '3' + <@@ Checked.char 51s @@>, box '3' + <@@ Checked.char 51us @@>, box '3' + <@@ Checked.char 51 @@>, box '3' + <@@ Checked.char 51u @@>, box '3' + <@@ Checked.char 51L @@>, box '3' + <@@ Checked.char 51UL @@>, box '3' + <@@ Checked.char '3' @@>, box '3' + <@@ Checked.char 51.0f @@>, box '3' + <@@ Checked.char 51.0 @@>, box '3' + <@@ Checked.char 51.0 @@>, box '3' + <@@ Checked.char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ Checked.char LanguagePrimitives.GenericOne @@>, box '\001' + <@@ Checked.char 51.0M @@>, box '3' + <@@ Checked.char "3" @@>, box '3' + + <@@ nativeint 3uy @@>, box 3n + <@@ nativeint 3y @@>, box 3n + <@@ nativeint 3s @@>, box 3n + <@@ nativeint 3us @@>, box 3n + <@@ nativeint 3 @@>, box 3n + <@@ nativeint 3u @@>, box 3n + <@@ nativeint 3L @@>, box 3n + <@@ nativeint 3UL @@>, box 3n + <@@ nativeint '\003' @@>, box 3n + <@@ nativeint 3.0f @@>, box 3n + <@@ nativeint 3.0 @@>, box 3n + <@@ nativeint 3.0 @@>, box 3n + <@@ nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ nativeint 3.0M @@>, box 3n + <@@ nativeint "3" @@>, box 3n + <@@ Checked.nativeint 3uy @@>, box 3n + <@@ Checked.nativeint 3y @@>, box 3n + <@@ Checked.nativeint 3s @@>, box 3n + <@@ Checked.nativeint 3us @@>, box 3n + <@@ Checked.nativeint 3 @@>, box 3n + <@@ Checked.nativeint 3u @@>, box 3n + <@@ Checked.nativeint 3L @@>, box 3n + <@@ Checked.nativeint 3UL @@>, box 3n + <@@ Checked.nativeint '\003' @@>, box 3n + <@@ Checked.nativeint 3.0f @@>, box 3n + <@@ Checked.nativeint 3.0 @@>, box 3n + <@@ Checked.nativeint 3.0 @@>, box 3n + <@@ Checked.nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.nativeint LanguagePrimitives.GenericOne @@>, box 1n + <@@ Checked.nativeint 3.0M @@>, box 3n + <@@ Checked.nativeint "3" @@>, box 3n + + <@@ unativeint 3uy @@>, box 3un + <@@ unativeint 3y @@>, box 3un + <@@ unativeint 3s @@>, box 3un + <@@ unativeint 3us @@>, box 3un + <@@ unativeint 3 @@>, box 3un + <@@ unativeint 3u @@>, box 3un + <@@ unativeint 3L @@>, box 3un + <@@ unativeint 3UL @@>, box 3un + <@@ unativeint '\003' @@>, box 3un + <@@ unativeint 3.0f @@>, box 3un + <@@ unativeint 3.0 @@>, box 3un + <@@ unativeint 3.0 @@>, box 3un + <@@ unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ unativeint 3.0M @@>, box 3un + <@@ unativeint "3" @@>, box 3un + <@@ Checked.unativeint 3uy @@>, box 3un + <@@ Checked.unativeint 3y @@>, box 3un + <@@ Checked.unativeint 3s @@>, box 3un + <@@ Checked.unativeint 3us @@>, box 3un + <@@ Checked.unativeint 3 @@>, box 3un + <@@ Checked.unativeint 3u @@>, box 3un + <@@ Checked.unativeint 3L @@>, box 3un + <@@ Checked.unativeint 3UL @@>, box 3un + <@@ Checked.unativeint '\003' @@>, box 3un + <@@ Checked.unativeint 3.0f @@>, box 3un + <@@ Checked.unativeint 3.0 @@>, box 3un + <@@ Checked.unativeint 3.0 @@>, box 3un + <@@ Checked.unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.unativeint LanguagePrimitives.GenericOne @@>, box 1un + <@@ Checked.unativeint 3.0M @@>, box 3un + <@@ Checked.unativeint "3" @@>, box 3un + + <@@ single 3uy @@>, box 3f + <@@ single 3y @@>, box 3f + <@@ single 3s @@>, box 3f + <@@ single 3us @@>, box 3f + <@@ single 3 @@>, box 3f + <@@ single 3u @@>, box 3f + <@@ single 3L @@>, box 3f + <@@ single 3UL @@>, box 3f + <@@ single '\003' @@>, box 3f + <@@ single 3.0f @@>, box 3f + <@@ single 3.0 @@>, box 3f + <@@ single 3.0 @@>, box 3f + <@@ single 3I @@>, box 3f + <@@ single LanguagePrimitives.GenericOne @@>, box 1f + <@@ single LanguagePrimitives.GenericOne @@>, box 1f + <@@ single 3.0M @@>, box 3f + <@@ single "3" @@>, box 3f + <@@ float32 3uy @@>, box 3f + <@@ float32 3y @@>, box 3f + <@@ float32 3s @@>, box 3f + <@@ float32 3us @@>, box 3f + <@@ float32 3 @@>, box 3f + <@@ float32 3u @@>, box 3f + <@@ float32 3L @@>, box 3f + <@@ float32 3UL @@>, box 3f + <@@ float32 '\003' @@>, box 3f + <@@ float32 3.0f @@>, box 3f + <@@ float32 3.0 @@>, box 3f + <@@ float32 3.0 @@>, box 3f + <@@ float32 3I @@>, box 3f + <@@ float32 LanguagePrimitives.GenericOne @@>, box 1f + <@@ float32 LanguagePrimitives.GenericOne @@>, box 1f + <@@ float32 3.0M @@>, box 3f + <@@ float32 "3" @@>, box 3f + + <@@ double 3uy @@>, box 3. + <@@ double 3y @@>, box 3. + <@@ double 3s @@>, box 3. + <@@ double 3us @@>, box 3. + <@@ double 3 @@>, box 3. + <@@ double 3u @@>, box 3. + <@@ double 3L @@>, box 3. + <@@ double 3UL @@>, box 3. + <@@ double '\003' @@>, box 3. + <@@ double 3.0f @@>, box 3. + <@@ double 3.0 @@>, box 3. + <@@ double 3.0 @@>, box 3. + <@@ double 3I @@>, box 3. + <@@ double LanguagePrimitives.GenericOne @@>, box 1. + <@@ double LanguagePrimitives.GenericOne @@>, box 1. + <@@ double 3.0M @@>, box 3. + <@@ double "3" @@>, box 3. + <@@ float 3uy @@>, box 3. + <@@ float 3y @@>, box 3. + <@@ float 3s @@>, box 3. + <@@ float 3us @@>, box 3. + <@@ float 3 @@>, box 3. + <@@ float 3u @@>, box 3. + <@@ float 3L @@>, box 3. + <@@ float 3UL @@>, box 3. + <@@ float '\003' @@>, box 3. + <@@ float 3.0f @@>, box 3. + <@@ float 3.0 @@>, box 3. + <@@ float 3.0 @@>, box 3. + <@@ float 3I @@>, box 3. + <@@ float LanguagePrimitives.GenericOne @@>, box 1. + <@@ float LanguagePrimitives.GenericOne @@>, box 1. + <@@ float 3.0M @@>, box 3. + <@@ float "3" @@>, box 3. + + <@@ decimal 3uy @@>, box 3m + <@@ decimal 3y @@>, box 3m + <@@ decimal 3s @@>, box 3m + <@@ decimal 3us @@>, box 3m + <@@ decimal 3 @@>, box 3m + <@@ decimal 3u @@>, box 3m + <@@ decimal 3L @@>, box 3m + <@@ decimal 3UL @@>, box 3m + <@@ decimal '\003' @@>, box 3m + <@@ decimal 3.0f @@>, box 3m + <@@ decimal 3.0 @@>, box 3m + <@@ decimal 3.0 @@>, box 3m + <@@ decimal 3I @@>, box 3m + <@@ decimal LanguagePrimitives.GenericOne @@>, box 1m + <@@ decimal LanguagePrimitives.GenericOne @@>, box 1m + <@@ decimal 3.0M @@>, box 3m + <@@ decimal "3" @@>, box 3m + + <@@ LanguagePrimitives.GenericZero @@>, box 0uy + <@@ LanguagePrimitives.GenericZero @@>, box 0uy + <@@ LanguagePrimitives.GenericZero @@>, box 0y + <@@ LanguagePrimitives.GenericZero @@>, box 0y + <@@ LanguagePrimitives.GenericZero @@>, box 0s + <@@ LanguagePrimitives.GenericZero @@>, box 0us + <@@ LanguagePrimitives.GenericZero @@>, box 0 + <@@ LanguagePrimitives.GenericZero @@>, box 0 + <@@ LanguagePrimitives.GenericZero @@>, box 0u + <@@ LanguagePrimitives.GenericZero @@>, box 0u + <@@ LanguagePrimitives.GenericZero @@>, box 0L + <@@ LanguagePrimitives.GenericZero @@>, box 0UL + <@@ LanguagePrimitives.GenericZero @@>, box 0I + <@@ LanguagePrimitives.GenericZero @@>, box '\000' + <@@ LanguagePrimitives.GenericZero @@>, box 0n + <@@ LanguagePrimitives.GenericZero @@>, box 0un + <@@ LanguagePrimitives.GenericZero @@>, box 0f + <@@ LanguagePrimitives.GenericZero @@>, box 0. + <@@ LanguagePrimitives.GenericZero @@>, box 0m + <@@ LanguagePrimitives.GenericZero> @@>, box 0m + + <@@ LanguagePrimitives.GenericOne @@>, box 1uy + <@@ LanguagePrimitives.GenericOne @@>, box 1uy + <@@ LanguagePrimitives.GenericOne @@>, box 1y + <@@ LanguagePrimitives.GenericOne @@>, box 1y + <@@ LanguagePrimitives.GenericOne @@>, box 1s + <@@ LanguagePrimitives.GenericOne @@>, box 1us + <@@ LanguagePrimitives.GenericOne @@>, box 1 + <@@ LanguagePrimitives.GenericOne @@>, box 1 + <@@ LanguagePrimitives.GenericOne @@>, box 1u + <@@ LanguagePrimitives.GenericOne @@>, box 1u + <@@ LanguagePrimitives.GenericOne @@>, box 1L + <@@ LanguagePrimitives.GenericOne @@>, box 1UL + <@@ LanguagePrimitives.GenericOne @@>, box 1I + <@@ LanguagePrimitives.GenericOne @@>, box '\001' + <@@ LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne @@>, box 1un + <@@ LanguagePrimitives.GenericOne @@>, box 1f + <@@ LanguagePrimitives.GenericOne @@>, box 1. + <@@ LanguagePrimitives.GenericOne @@>, box 1m + //<@@ LanguagePrimitives.GenericOne> @@>, box 1m // Doesn't typecheck + + <@@ List.sum [ 1; 2 ] @@>, box 3 + <@@ List.sum [ 1I; 2I ] @@>, box 3I + <@@ List.sum [ 1.0f; 2.0f ] @@>, box 3f + <@@ List.sum [ 1.0; 2.0 ] @@>, box 3. + <@@ List.sum [ 1.0M; 2.0M ] @@>, box 3m + <@@ List.sum [ 1.0M; 2.0M ] @@>, box 3m + <@@ List.average [ 1.0; 2.0 ] @@>, box 1.5 + <@@ List.average [ 1.0f; 2.0f ] @@>, box 1.5f + <@@ List.average [ 1.0M; 2.0M ] @@>, box 1.5m + <@@ List.average [ 1.0M; 2.0M ] @@>, box 1.5m + + <@@ Nullable.byte (Nullable<_> 3uy) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3y) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3s) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3us) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3u) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3L) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3UL) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> '\003') @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0f) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> 3I) @@>, box 3uy + <@@ Nullable.byte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.byte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.byte (Nullable<_> 3.0M) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3uy) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3y) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3s) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3us) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3u) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3L) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3UL) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> '\003') @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0f) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3.0) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> 3I) @@>, box 3uy + <@@ Nullable.uint8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.uint8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1uy + <@@ Nullable.uint8 (Nullable<_> 3.0M) @@>, box 3uy + + <@@ Nullable.sbyte (Nullable<_> 3uy) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3y) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3s) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3us) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3u) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3L) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3UL) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> '\003') @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0f) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> 3I) @@>, box 3y + <@@ Nullable.sbyte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.sbyte (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.sbyte (Nullable<_> 3.0M) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3uy) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3y) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3s) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3us) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3u) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3L) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3UL) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> '\003') @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0f) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3.0) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> 3I) @@>, box 3y + <@@ Nullable.int8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.int8 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1y + <@@ Nullable.int8 (Nullable<_> 3.0M) @@>, box 3y + + <@@ Nullable.int16 (Nullable<_> 3uy) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3y) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3s) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3us) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3u) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3L) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3UL) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> '\003') @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0f) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3.0) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> 3I) @@>, box 3s + <@@ Nullable.int16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1s + <@@ Nullable.int16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1s + <@@ Nullable.int16 (Nullable<_> 3.0M) @@>, box 3s + + <@@ Nullable.uint16 (Nullable<_> 3uy) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3y) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3s) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3us) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3u) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3L) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3UL) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> '\003') @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0f) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3.0) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> 3I) @@>, box 3us + <@@ Nullable.uint16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1us + <@@ Nullable.uint16 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1us + <@@ Nullable.uint16 (Nullable<_> 3.0M) @@>, box 3us + + <@@ Nullable.int (Nullable<_> 3uy) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3y) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3s) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3us) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3u) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3L) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3UL) @@>, box 3 + <@@ Nullable.int (Nullable<_> '\003') @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0f) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int (Nullable<_> 3I) @@>, box 3 + <@@ Nullable.int (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int (Nullable<_> 3.0M) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3uy) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3y) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3s) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3us) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3u) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3L) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3UL) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> '\003') @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0f) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3.0) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> 3I) @@>, box 3 + <@@ Nullable.int32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1 + <@@ Nullable.int32 (Nullable<_> 3.0M) @@>, box 3 + + <@@ Nullable.uint (Nullable<_> 3uy) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3y) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3s) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3us) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3u) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3L) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3UL) @@>, box 3u + <@@ Nullable.uint (Nullable<_> '\003') @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0f) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint (Nullable<_> 3I) @@>, box 3u + <@@ Nullable.uint (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint (Nullable<_> 3.0M) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3uy) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3y) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3s) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3us) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3u) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3L) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3UL) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> '\003') @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0f) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3.0) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> 3I) @@>, box 3u + <@@ Nullable.uint32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1u + <@@ Nullable.uint32 (Nullable<_> 3.0M) @@>, box 3u + + <@@ Nullable.int64 (Nullable<_> 3uy) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3y) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3s) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3us) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3u) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3L) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3UL) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> '\003') @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0f) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3.0) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> 3I) @@>, box 3L + <@@ Nullable.int64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1L + <@@ Nullable.int64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1L + <@@ Nullable.int64 (Nullable<_> 3.0M) @@>, box 3L + + <@@ Nullable.uint64 (Nullable<_> 3uy) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3y) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3s) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3us) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3u) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3L) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3UL) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> '\003') @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0f) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3.0) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> 3I) @@>, box 3UL + <@@ Nullable.uint64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1UL + <@@ Nullable.uint64 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1UL + <@@ Nullable.uint64 (Nullable<_> 3.0M) @@>, box 3UL + + <@@ Nullable.char (Nullable<_> 51uy) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51y) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51s) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51us) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51u) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51L) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51UL) @@>, box '3' + <@@ Nullable.char (Nullable<_> '3') @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0f) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0) @@>, box '3' + <@@ Nullable.char (Nullable<_> 51.0) @@>, box '3' + <@@ Nullable.char (Nullable<_> LanguagePrimitives.GenericOne) @@>, box '\001' + <@@ Nullable.char (Nullable<_> LanguagePrimitives.GenericOne) @@>, box '\001' + <@@ Nullable.char (Nullable<_> 51.0M) @@>, box '3' + + <@@ Nullable.single (Nullable<_> 3uy) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3y) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3s) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3us) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3u) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3L) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3UL) @@>, box 3f + <@@ Nullable.single (Nullable<_> '\003') @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0f) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.single (Nullable<_> 3I) @@>, box 3f + <@@ Nullable.single (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.single (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.single (Nullable<_> 3.0M) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3uy) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3y) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3s) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3us) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3u) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3L) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3UL) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> '\003') @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0f) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3.0) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> 3I) @@>, box 3f + <@@ Nullable.float32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.float32 (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1f + <@@ Nullable.float32 (Nullable<_> 3.0M) @@>, box 3f + + <@@ Nullable.double (Nullable<_> 3uy) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3y) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3s) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3us) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3u) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3L) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3UL) @@>, box 3. + <@@ Nullable.double (Nullable<_> '\003') @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0f) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.double (Nullable<_> 3I) @@>, box 3. + <@@ Nullable.double (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.double (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.double (Nullable<_> 3.0M) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3uy) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3y) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3s) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3us) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3u) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3L) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3UL) @@>, box 3. + <@@ Nullable.float (Nullable<_> '\003') @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0f) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3.0) @@>, box 3. + <@@ Nullable.float (Nullable<_> 3I) @@>, box 3. + <@@ Nullable.float (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.float (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1. + <@@ Nullable.float (Nullable<_> 3.0M) @@>, box 3. + + <@@ Nullable.decimal (Nullable<_> 3uy) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3y) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3s) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3us) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3u) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3L) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3UL) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> '\003') @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0f) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3.0) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> 3I) @@>, box 3m + <@@ Nullable.decimal (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1m + <@@ Nullable.decimal (Nullable<_> LanguagePrimitives.GenericOne) @@>, box 1m + <@@ Nullable.decimal (Nullable<_> 3.0M) @@>, box 3m + + <@@ Nullable<_> 1y ?+ 4y @@>, box 5y + <@@ Nullable<_> 1uy ?+ 4uy @@>, box 5uy + <@@ Nullable<_> 1s ?+ 4s @@>, box 5s + <@@ Nullable<_> 1us ?+ 4us @@>, box 5us + <@@ Nullable<_> 1 ?+ 4 @@>, box 5 + <@@ Nullable<_> 1u ?+ 4u @@>, box 5u + <@@ Nullable<_> 1L ?+ 4L @@>, box 5L + <@@ Nullable<_> 1uL ?+ 4uL @@>, box 5uL + <@@ Nullable<_> 1.0f ?+ 4.0f @@>, box 5f + <@@ Nullable<_> 1.0 ?+ 4.0 @@>, box 5. + <@@ Nullable<_> 1m ?+ 4m @@>, box 5m + <@@ Nullable<_> 1m ?+ 4m @@>, box 5m + <@@ Nullable<_> 1I ?+ 4I @@>, box 5I + <@@ Nullable<_> '1' ?+ '\004' @@>, box '5' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+ LanguagePrimitives.GenericOne @@>, box 2n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+ LanguagePrimitives.GenericOne @@>, box 2un + + <@@ 1y +? Nullable<_> 4y @@>, box 5y + <@@ 1uy +? Nullable<_> 4uy @@>, box 5uy + <@@ 1s +? Nullable<_> 4s @@>, box 5s + <@@ 1us +? Nullable<_> 4us @@>, box 5us + <@@ 1 +? Nullable<_> 4 @@>, box 5 + <@@ 1u +? Nullable<_> 4u @@>, box 5u + <@@ 1L +? Nullable<_> 4L @@>, box 5L + <@@ 1uL +? Nullable<_> 4uL @@>, box 5uL + <@@ 1.0f +? Nullable<_> 4.0f @@>, box 5f + <@@ 1.0 +? Nullable<_> 4.0 @@>, box 5. + <@@ 1m +? Nullable<_> 4m @@>, box 5m + <@@ 1m +? Nullable<_> 4m @@>, box 5m + <@@ 1I +? Nullable<_> 4I @@>, box 5I + <@@ '1' +? Nullable<_> '\004' @@>, box '5' + <@@ LanguagePrimitives.GenericOne +? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2n + <@@ LanguagePrimitives.GenericOne +? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2un + + <@@ Nullable<_> 1y ?+? Nullable<_> 4y @@>, box 5y + <@@ Nullable<_> 1uy ?+? Nullable<_> 4uy @@>, box 5uy + <@@ Nullable<_> 1s ?+? Nullable<_> 4s @@>, box 5s + <@@ Nullable<_> 1us ?+? Nullable<_> 4us @@>, box 5us + <@@ Nullable<_> 1 ?+? Nullable<_> 4 @@>, box 5 + <@@ Nullable<_> 1u ?+? Nullable<_> 4u @@>, box 5u + <@@ Nullable<_> 1L ?+? Nullable<_> 4L @@>, box 5L + <@@ Nullable<_> 1uL ?+? Nullable<_> 4uL @@>, box 5uL + <@@ Nullable<_> 1.0f ?+? Nullable<_> 4.0f @@>, box 5f + <@@ Nullable<_> 1.0 ?+? Nullable<_> 4.0 @@>, box 5. + <@@ Nullable<_> 1m ?+? Nullable<_> 4m @@>, box 5m + <@@ Nullable<_> 1m ?+? Nullable<_> 4m @@>, box 5m + <@@ Nullable<_> 1I ?+? Nullable<_> 4I @@>, box 5I + <@@ Nullable<_> '1' ?+? Nullable<_> '\004' @@>, box '5' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?+? Nullable<_> LanguagePrimitives.GenericOne @@>, box 2un + + <@@ Nullable<_> 4y ?- 1y @@>, box 3y + <@@ Nullable<_> 4uy ?- 1uy @@>, box 3uy + <@@ Nullable<_> 4s ?- 1s @@>, box 3s + <@@ Nullable<_> 4us ?- 1us @@>, box 3us + <@@ Nullable<_> 4 ?- 1 @@>, box 3 + <@@ Nullable<_> 4u ?- 1u @@>, box 3u + <@@ Nullable<_> 4L ?- 1L @@>, box 3L + <@@ Nullable<_> 4uL ?- 1uL @@>, box 3uL + <@@ Nullable<_> 4.0f ?- 1.0f @@>, box 3f + <@@ Nullable<_> 4.0 ?- 1.0 @@>, box 3. + <@@ Nullable<_> 4m ?- 1m @@>, box 3m + <@@ Nullable<_> 4m ?- 1m @@>, box 3m + <@@ Nullable<_> 4I ?- 1I @@>, box 3I + <@@ Nullable<_> '4' ?- '\001' @@>, box '3' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?- LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?- LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 4y -? Nullable<_> 1y @@>, box 3y + <@@ 4uy -? Nullable<_> 1uy @@>, box 3uy + <@@ 4s -? Nullable<_> 1s @@>, box 3s + <@@ 4us -? Nullable<_> 1us @@>, box 3us + <@@ 4 -? Nullable<_> 1 @@>, box 3 + <@@ 4u -? Nullable<_> 1u @@>, box 3u + <@@ 4L -? Nullable<_> 1L @@>, box 3L + <@@ 4uL -? Nullable<_> 1uL @@>, box 3uL + <@@ 4.0f -? Nullable<_> 1.0f @@>, box 3f + <@@ 4.0 -? Nullable<_> 1.0 @@>, box 3. + <@@ 4m -? Nullable<_> 1m @@>, box 3m + <@@ 4m -? Nullable<_> 1m @@>, box 3m + <@@ 4I -? Nullable<_> 1I @@>, box 3I + <@@ '4' -? Nullable<_> '\001' @@>, box '3' + <@@ LanguagePrimitives.GenericOne -? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne -? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 4y ?-? Nullable<_> 1y @@>, box 3y + <@@ Nullable<_> 4uy ?-? Nullable<_> 1uy @@>, box 3uy + <@@ Nullable<_> 4s ?-? Nullable<_> 1s @@>, box 3s + <@@ Nullable<_> 4us ?-? Nullable<_> 1us @@>, box 3us + <@@ Nullable<_> 4 ?-? Nullable<_> 1 @@>, box 3 + <@@ Nullable<_> 4u ?-? Nullable<_> 1u @@>, box 3u + <@@ Nullable<_> 4L ?-? Nullable<_> 1L @@>, box 3L + <@@ Nullable<_> 4uL ?-? Nullable<_> 1uL @@>, box 3uL + <@@ Nullable<_> 4.0f ?-? Nullable<_> 1.0f @@>, box 3f + <@@ Nullable<_> 4.0 ?-? Nullable<_> 1.0 @@>, box 3. + <@@ Nullable<_> 4m ?-? Nullable<_> 1m @@>, box 3m + <@@ Nullable<_> 4m ?-? Nullable<_> 1m @@>, box 3m + <@@ Nullable<_> 4I ?-? Nullable<_> 1I @@>, box 3I + <@@ Nullable<_> '4' ?-? Nullable<_> '\001' @@>, box '3' + <@@ Nullable<_> LanguagePrimitives.GenericOne ?-? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?-? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 2y ?* 4y @@>, box 8y + <@@ Nullable<_> 2uy ?* 4uy @@>, box 8uy + <@@ Nullable<_> 2s ?* 4s @@>, box 8s + <@@ Nullable<_> 2us ?* 4us @@>, box 8us + <@@ Nullable<_> 2 ?* 4 @@>, box 8 + <@@ Nullable<_> 2u ?* 4u @@>, box 8u + <@@ Nullable<_> 2L ?* 4L @@>, box 8L + <@@ Nullable<_> 2uL ?* 4uL @@>, box 8uL + <@@ Nullable<_> 2.0f ?* 4.0f @@>, box 8f + <@@ Nullable<_> 2.0 ?* 4.0 @@>, box 8. + <@@ Nullable<_> 2m ?* 4m @@>, box 8m + <@@ Nullable<_> 2m ?* 4m @@>, box 8m + <@@ Nullable<_> 2I ?* 4I @@>, box 8I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?* LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?* LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 2y *? Nullable<_> 4y @@>, box 8y + <@@ 2uy *? Nullable<_> 4uy @@>, box 8uy + <@@ 2s *? Nullable<_> 4s @@>, box 8s + <@@ 2us *? Nullable<_> 4us @@>, box 8us + <@@ 2 *? Nullable<_> 4 @@>, box 8 + <@@ 2u *? Nullable<_> 4u @@>, box 8u + <@@ 2L *? Nullable<_> 4L @@>, box 8L + <@@ 2uL *? Nullable<_> 4uL @@>, box 8uL + <@@ 2.0f *? Nullable<_> 4.0f @@>, box 8f + <@@ 2.0 *? Nullable<_> 4.0 @@>, box 8. + <@@ 2m *? Nullable<_> 4m @@>, box 8m + <@@ 2m *? Nullable<_> 4m @@>, box 8m + <@@ 2I *? Nullable<_> 4I @@>, box 8I + <@@ LanguagePrimitives.GenericOne *? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne *? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 2y ?*? Nullable<_> 4y @@>, box 8y + <@@ Nullable<_> 2uy ?*? Nullable<_> 4uy @@>, box 8uy + <@@ Nullable<_> 2s ?*? Nullable<_> 4s @@>, box 8s + <@@ Nullable<_> 2us ?*? Nullable<_> 4us @@>, box 8us + <@@ Nullable<_> 2 ?*? Nullable<_> 4 @@>, box 8 + <@@ Nullable<_> 2u ?*? Nullable<_> 4u @@>, box 8u + <@@ Nullable<_> 2L ?*? Nullable<_> 4L @@>, box 8L + <@@ Nullable<_> 2uL ?*? Nullable<_> 4uL @@>, box 8uL + <@@ Nullable<_> 2.0f ?*? Nullable<_> 4.0f @@>, box 8f + <@@ Nullable<_> 2.0 ?*? Nullable<_> 4.0 @@>, box 8. + <@@ Nullable<_> 2m ?*? Nullable<_> 4m @@>, box 8m + <@@ Nullable<_> 2m ?*? Nullable<_> 4m @@>, box 8m + <@@ Nullable<_> 2I ?*? Nullable<_> 4I @@>, box 8I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?*? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?*? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 6y ?/ 3y @@>, box 2y + <@@ Nullable<_> 6uy ?/ 3uy @@>, box 2uy + <@@ Nullable<_> 6s ?/ 3s @@>, box 2s + <@@ Nullable<_> 6us ?/ 3us @@>, box 2us + <@@ Nullable<_> 6 ?/ 3 @@>, box 2 + <@@ Nullable<_> 6u ?/ 3u @@>, box 2u + <@@ Nullable<_> 6L ?/ 3L @@>, box 2L + <@@ Nullable<_> 6uL ?/ 3uL @@>, box 2uL + <@@ Nullable<_> 6.0f ?/ 3.0f @@>, box 2f + <@@ Nullable<_> 6.0 ?/ 3.0 @@>, box 2. + <@@ Nullable<_> 6m ?/ 3m @@>, box 2m + <@@ Nullable<_> 6m ?/ 3m @@>, box 2m + <@@ Nullable<_> 6I ?/ 3I @@>, box 2I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/ LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/ LanguagePrimitives.GenericOne @@>, box 1un + + <@@ 6y /? Nullable<_> 3y @@>, box 2y + <@@ 6uy /? Nullable<_> 3uy @@>, box 2uy + <@@ 6s /? Nullable<_> 3s @@>, box 2s + <@@ 6us /? Nullable<_> 3us @@>, box 2us + <@@ 6 /? Nullable<_> 3 @@>, box 2 + <@@ 6u /? Nullable<_> 3u @@>, box 2u + <@@ 6L /? Nullable<_> 3L @@>, box 2L + <@@ 6uL /? Nullable<_> 3uL @@>, box 2uL + <@@ 6.0f /? Nullable<_> 3.0f @@>, box 2f + <@@ 6.0 /? Nullable<_> 3.0 @@>, box 2. + <@@ 6m /? Nullable<_> 3m @@>, box 2m + <@@ 6m /? Nullable<_> 3m @@>, box 2m + <@@ 6I /? Nullable<_> 3I @@>, box 2I + <@@ LanguagePrimitives.GenericOne /? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ LanguagePrimitives.GenericOne /? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 6y ?/? Nullable<_> 3y @@>, box 2y + <@@ Nullable<_> 6uy ?/? Nullable<_> 3uy @@>, box 2uy + <@@ Nullable<_> 6s ?/? Nullable<_> 3s @@>, box 2s + <@@ Nullable<_> 6us ?/? Nullable<_> 3us @@>, box 2us + <@@ Nullable<_> 6 ?/? Nullable<_> 3 @@>, box 2 + <@@ Nullable<_> 6u ?/? Nullable<_> 3u @@>, box 2u + <@@ Nullable<_> 6L ?/? Nullable<_> 3L @@>, box 2L + <@@ Nullable<_> 6uL ?/? Nullable<_> 3uL @@>, box 2uL + <@@ Nullable<_> 6.0f ?/? Nullable<_> 3.0f @@>, box 2f + <@@ Nullable<_> 6.0 ?/? Nullable<_> 3.0 @@>, box 2. + <@@ Nullable<_> 6m ?/? Nullable<_> 3m @@>, box 2m + <@@ Nullable<_> 6m ?/? Nullable<_> 3m @@>, box 2m + <@@ Nullable<_> 6I ?/? Nullable<_> 3I @@>, box 2I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?/? Nullable<_> LanguagePrimitives.GenericOne @@>, box 1un + + <@@ Nullable<_> 9y ?% 4y @@>, box 1y + <@@ Nullable<_> 9uy ?% 4uy @@>, box 1uy + <@@ Nullable<_> 9s ?% 4s @@>, box 1s + <@@ Nullable<_> 9us ?% 4us @@>, box 1us + <@@ Nullable<_> 9 ?% 4 @@>, box 1 + <@@ Nullable<_> 9u ?% 4u @@>, box 1u + <@@ Nullable<_> 9L ?% 4L @@>, box 1L + <@@ Nullable<_> 9uL ?% 4uL @@>, box 1uL + <@@ Nullable<_> 9.0f ?% 4.0f @@>, box 1f + <@@ Nullable<_> 9.0 ?% 4.0 @@>, box 1. + <@@ Nullable<_> 9m ?% 4m @@>, box 1m + <@@ Nullable<_> 9m ?% 4m @@>, box 1m + <@@ Nullable<_> 9I ?% 4I @@>, box 1I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?% LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?% LanguagePrimitives.GenericOne @@>, box 0un + + <@@ 9y %? Nullable<_> 4y @@>, box 1y + <@@ 9uy %? Nullable<_> 4uy @@>, box 1uy + <@@ 9s %? Nullable<_> 4s @@>, box 1s + <@@ 9us %? Nullable<_> 4us @@>, box 1us + <@@ 9 %? Nullable<_> 4 @@>, box 1 + <@@ 9u %? Nullable<_> 4u @@>, box 1u + <@@ 9L %? Nullable<_> 4L @@>, box 1L + <@@ 9uL %? Nullable<_> 4uL @@>, box 1uL + <@@ 9.0f %? Nullable<_> 4.0f @@>, box 1f + <@@ 9.0 %? Nullable<_> 4.0 @@>, box 1. + <@@ 9m %? Nullable<_> 4m @@>, box 1m + <@@ 9m %? Nullable<_> 4m @@>, box 1m + <@@ 9I %? Nullable<_> 4I @@>, box 1I + <@@ LanguagePrimitives.GenericOne %? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ LanguagePrimitives.GenericOne %? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ Nullable<_> 9y ?%? Nullable<_> 4y @@>, box 1y + <@@ Nullable<_> 9uy ?%? Nullable<_> 4uy @@>, box 1uy + <@@ Nullable<_> 9s ?%? Nullable<_> 4s @@>, box 1s + <@@ Nullable<_> 9us ?%? Nullable<_> 4us @@>, box 1us + <@@ Nullable<_> 9 ?%? Nullable<_> 4 @@>, box 1 + <@@ Nullable<_> 9u ?%? Nullable<_> 4u @@>, box 1u + <@@ Nullable<_> 9L ?%? Nullable<_> 4L @@>, box 1L + <@@ Nullable<_> 9uL ?%? Nullable<_> 4uL @@>, box 1uL + <@@ Nullable<_> 9.0f ?%? Nullable<_> 4.0f @@>, box 1f + <@@ Nullable<_> 9.0 ?%? Nullable<_> 4.0 @@>, box 1. + <@@ Nullable<_> 9m ?%? Nullable<_> 4m @@>, box 1m + <@@ Nullable<_> 9m ?%? Nullable<_> 4m @@>, box 1m + <@@ Nullable<_> 9I ?%? Nullable<_> 4I @@>, box 1I + <@@ Nullable<_> LanguagePrimitives.GenericOne ?%? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0n + <@@ Nullable<_> LanguagePrimitives.GenericOne ?%? Nullable<_> LanguagePrimitives.GenericOne @@>, box 0un + + <@@ NonStructuralComparison.(=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(=) 3 3 @@>, box true + <@@ NonStructuralComparison.(=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(<>) 3y 3y @@>, box false + <@@ NonStructuralComparison.(<>) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(<>) 3s 3s @@>, box false + <@@ NonStructuralComparison.(<>) 3us 3us @@>, box false + <@@ NonStructuralComparison.(<>) 3 3 @@>, box false + <@@ NonStructuralComparison.(<>) 3u 3u @@>, box false + <@@ NonStructuralComparison.(<>) 3L 3L @@>, box false + <@@ NonStructuralComparison.(<>) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(<>) '3' '3' @@>, box false + <@@ NonStructuralComparison.(<>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<>) 3f 3f @@>, box false + <@@ NonStructuralComparison.(<>) 3. 3. @@>, box false + <@@ NonStructuralComparison.(<>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<>) 3I 3I @@>, box false + <@@ NonStructuralComparison.(<>) "3" "3" @@>, box false + + <@@ NonStructuralComparison.(<=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(<=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(<=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(<=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(<=) 3 3 @@>, box true + <@@ NonStructuralComparison.(<=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(<=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(<=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(<=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(<=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(<=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(<=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(<=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(<=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(<=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(<=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(<=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(<) 3y 3y @@>, box false + <@@ NonStructuralComparison.(<) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(<) 3s 3s @@>, box false + <@@ NonStructuralComparison.(<) 3us 3us @@>, box false + <@@ NonStructuralComparison.(<) 3 3 @@>, box false + <@@ NonStructuralComparison.(<) 3u 3u @@>, box false + <@@ NonStructuralComparison.(<) 3L 3L @@>, box false + <@@ NonStructuralComparison.(<) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(<) '3' '3' @@>, box false + <@@ NonStructuralComparison.(<) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(<) 3f 3f @@>, box false + <@@ NonStructuralComparison.(<) 3. 3. @@>, box false + <@@ NonStructuralComparison.(<) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<) 3m 3m @@>, box false + <@@ NonStructuralComparison.(<) 3I 3I @@>, box false + <@@ NonStructuralComparison.(<) "3" "3" @@>, box false + + <@@ NonStructuralComparison.(>=) 3y 3y @@>, box true + <@@ NonStructuralComparison.(>=) 3uy 3uy @@>, box true + <@@ NonStructuralComparison.(>=) 3s 3s @@>, box true + <@@ NonStructuralComparison.(>=) 3us 3us @@>, box true + <@@ NonStructuralComparison.(>=) 3 3 @@>, box true + <@@ NonStructuralComparison.(>=) 3u 3u @@>, box true + <@@ NonStructuralComparison.(>=) 3L 3L @@>, box true + <@@ NonStructuralComparison.(>=) 3UL 3UL @@>, box true + <@@ NonStructuralComparison.(>=) '3' '3' @@>, box true + <@@ NonStructuralComparison.(>=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(>=) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box true + <@@ NonStructuralComparison.(>=) 3f 3f @@>, box true + <@@ NonStructuralComparison.(>=) 3. 3. @@>, box true + <@@ NonStructuralComparison.(>=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(>=) 3m 3m @@>, box true + <@@ NonStructuralComparison.(>=) 3I 3I @@>, box true + <@@ NonStructuralComparison.(>=) "3" "3" @@>, box true + + <@@ NonStructuralComparison.(>) 3y 3y @@>, box false + <@@ NonStructuralComparison.(>) 3uy 3uy @@>, box false + <@@ NonStructuralComparison.(>) 3s 3s @@>, box false + <@@ NonStructuralComparison.(>) 3us 3us @@>, box false + <@@ NonStructuralComparison.(>) 3 3 @@>, box false + <@@ NonStructuralComparison.(>) 3u 3u @@>, box false + <@@ NonStructuralComparison.(>) 3L 3L @@>, box false + <@@ NonStructuralComparison.(>) 3UL 3UL @@>, box false + <@@ NonStructuralComparison.(>) '3' '3' @@>, box false + <@@ NonStructuralComparison.(>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(>) LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ NonStructuralComparison.(>) 3f 3f @@>, box false + <@@ NonStructuralComparison.(>) 3. 3. @@>, box false + <@@ NonStructuralComparison.(>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(>) 3m 3m @@>, box false + <@@ NonStructuralComparison.(>) 3I 3I @@>, box false + <@@ NonStructuralComparison.(>) "3" "3" @@>, box false + |] + + tests |> Array.map (fun (test, eval) -> + begin + printfn "--> Checking we can evaluate %A" test + let res = FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test + let b = res = eval + if b then printfn "--- Success, it is %A which is equal to %A" res eval + else printfn "!!! FAILURE, it is %A which is not equal to %A" res eval + b + end + && match test with - | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> - minfo1.IsStatic && - minfo2.IsStatic && - minfo2.Name = minfo1.Name + "$W" && + | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> + minfo1.IsStatic && + minfo2.IsStatic && + minfo2.Name = minfo1.Name + "$W" && (* - (printfn "checking minfo2.GetParameters().Length = %d..." (minfo2.GetParameters().Length); true) && - minfo2.GetParameters().Length = 3 && - (printfn "checking witnessArgs.Length..."; true) && - witnessArgs.Length = 1 && - (printfn "checking args.Length..."; true) && - args.Length = 2 && - (printfn "witnessArgs..."; true) && - (match witnessArgs with [ Lambda _ ] -> true | _ -> false) && - (printfn "args..."; true) && - (match args with [ _; _ ] -> true | _ -> false) - *) - true - | _ -> false)) + (printfn "checking minfo2.GetParameters().Length = %d..." (minfo2.GetParameters().Length); true) && + minfo2.GetParameters().Length = 3 && + (printfn "checking witnessArgs.Length..."; true) && + witnessArgs.Length = 1 && + (printfn "checking args.Length..."; true) && + args.Length = 2 && + (printfn "witnessArgs..."; true) && + (match witnessArgs with [ Lambda _ ] -> true | _ -> false) && + (printfn "args..."; true) && + (match args with [ _; _ ] -> true | _ -> false) + *) + (printfn "<-- Successfully checked with Quotations.Patterns.(|CallWithWitnesses|_|)"; true) + || (printfn "<-- FAILURE, failed after matching with Quotations.Patterns.(|CallWithWitnesses|_|)"; true) + | _ -> + printfn " Array.forall id) // Don't short circuit on a failed test + + test "check non-CallWithWitnesses operators" + (let tests = [| + <@@ LanguagePrimitives.PhysicalEquality [|3|] [|3|] @@>, box false + <@@ let x = [|3|] in LanguagePrimitives.PhysicalEquality x x @@>, box true + <@@ LanguagePrimitives.PhysicalEquality (seq { 3 }) (seq { 3 }) @@>, box false + <@@ let x = seq { 3 } in LanguagePrimitives.PhysicalEquality x x @@>, box true + <@@ LanguagePrimitives.PhysicalEquality (obj()) (obj()) @@>, box false + <@@ let x = obj() in LanguagePrimitives.PhysicalEquality x x @@>, box true + + <@@ 3y = 3y @@>, box true + <@@ 3uy = 3uy @@>, box true + <@@ 3s = 3s @@>, box true + <@@ 3us = 3us @@>, box true + <@@ 3 = 3 @@>, box true + <@@ 3u = 3u @@>, box true + <@@ 3L = 3L @@>, box true + <@@ 3UL = 3UL @@>, box true + <@@ '3' = '3' @@>, box true + <@@ LanguagePrimitives.GenericOne = LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne = LanguagePrimitives.GenericOne @@>, box true + <@@ 3f = 3f @@>, box true + <@@ 3. = 3. @@>, box true + <@@ 3m = 3m @@>, box true + <@@ 3m = 3m @@>, box true + <@@ 3I = 3I @@>, box true + <@@ "3" = "3" @@>, box true + <@@ [3] = [3] @@>, box true + <@@ [|3|] = [|3|] @@>, box true + <@@ seq { 3 } = seq { 3 } @@>, box false // Reference equality + <@@ let x = seq { 3 } in x = x @@>, box true + <@@ obj() = obj() @@>, box false + <@@ let x = obj() in x = x @@>, box true + + <@@ 3y <> 3y @@>, box false + <@@ 3uy <> 3uy @@>, box false + <@@ 3s <> 3s @@>, box false + <@@ 3us <> 3us @@>, box false + <@@ 3 <> 3 @@>, box false + <@@ 3u <> 3u @@>, box false + <@@ 3L <> 3L @@>, box false + <@@ 3UL <> 3UL @@>, box false + <@@ '3' <> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne <> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne <> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f <> 3f @@>, box false + <@@ 3. <> 3. @@>, box false + <@@ 3m <> 3m @@>, box false + <@@ 3m <> 3m @@>, box false + <@@ 3I <> 3I @@>, box false + <@@ "3" <> "3" @@>, box false + <@@ [3] <> [3] @@>, box false + <@@ [|3|] <> [|3|] @@>, box false + <@@ seq { 3 } <> seq { 3 } @@>, box true // Reference equality + <@@ let x = seq { 3 } in x <> x @@>, box false + <@@ obj() <> obj() @@>, box true + <@@ let x = obj() in x <> x @@>, box false + + <@@ 3y <= 3y @@>, box true + <@@ 3uy <= 3uy @@>, box true + <@@ 3s <= 3s @@>, box true + <@@ 3us <= 3us @@>, box true + <@@ 3 <= 3 @@>, box true + <@@ 3u <= 3u @@>, box true + <@@ 3L <= 3L @@>, box true + <@@ 3UL <= 3UL @@>, box true + <@@ '3' <= '3' @@>, box true + <@@ LanguagePrimitives.GenericOne <= LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne <= LanguagePrimitives.GenericOne @@>, box true + <@@ 3f <= 3f @@>, box true + <@@ 3. <= 3. @@>, box true + <@@ 3m <= 3m @@>, box true + <@@ 3m <= 3m @@>, box true + <@@ 3I <= 3I @@>, box true + <@@ "3" <= "3" @@>, box true + <@@ [3] <= [3] @@>, box true + <@@ [|3|] <= [|3|] @@>, box true + + <@@ 3y < 3y @@>, box false + <@@ 3uy < 3uy @@>, box false + <@@ 3s < 3s @@>, box false + <@@ 3us < 3us @@>, box false + <@@ 3 < 3 @@>, box false + <@@ 3u < 3u @@>, box false + <@@ 3L < 3L @@>, box false + <@@ 3UL < 3UL @@>, box false + <@@ '3' < '3' @@>, box false + <@@ LanguagePrimitives.GenericOne < LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne < LanguagePrimitives.GenericOne @@>, box false + <@@ 3f < 3f @@>, box false + <@@ 3. < 3. @@>, box false + <@@ 3m < 3m @@>, box false + <@@ 3m < 3m @@>, box false + <@@ 3I < 3I @@>, box false + <@@ "3" < "3" @@>, box false + <@@ [3] < [3] @@>, box false + <@@ [|3|] < [|3|] @@>, box false + + <@@ 3y >= 3y @@>, box true + <@@ 3uy >= 3uy @@>, box true + <@@ 3s >= 3s @@>, box true + <@@ 3us >= 3us @@>, box true + <@@ 3 >= 3 @@>, box true + <@@ 3u >= 3u @@>, box true + <@@ 3L >= 3L @@>, box true + <@@ 3UL >= 3UL @@>, box true + <@@ '3' >= '3' @@>, box true + <@@ LanguagePrimitives.GenericOne >= LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne >= LanguagePrimitives.GenericOne @@>, box true + <@@ 3f >= 3f @@>, box true + <@@ 3. >= 3. @@>, box true + <@@ 3m >= 3m @@>, box true + <@@ 3m >= 3m @@>, box true + <@@ 3I >= 3I @@>, box true + <@@ "3" >= "3" @@>, box true + <@@ [3] >= [3] @@>, box true + <@@ [|3|] >= [|3|] @@>, box true + + <@@ 3y > 3y @@>, box false + <@@ 3uy > 3uy @@>, box false + <@@ 3s > 3s @@>, box false + <@@ 3us > 3us @@>, box false + <@@ 3 > 3 @@>, box false + <@@ 3u > 3u @@>, box false + <@@ 3L > 3L @@>, box false + <@@ 3UL > 3UL @@>, box false + <@@ '3' > '3' @@>, box false + <@@ LanguagePrimitives.GenericOne > LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne > LanguagePrimitives.GenericOne @@>, box false + <@@ 3f > 3f @@>, box false + <@@ 3. > 3. @@>, box false + <@@ 3m > 3m @@>, box false + <@@ 3m > 3m @@>, box false + <@@ 3I > 3I @@>, box false + <@@ "3" > "3" @@>, box false + <@@ [3] > [3] @@>, box false + <@@ [|3|] > [|3|] @@>, box false + + <@@ Nullable<_> 1y ?= 1y @@>, box true + <@@ Nullable<_> 1uy ?= 1uy @@>, box true + <@@ Nullable<_> 1s ?= 1s @@>, box true + <@@ Nullable<_> 1us ?= 1us @@>, box true + <@@ Nullable<_> 1 ?= 1 @@>, box true + <@@ Nullable<_> 1u ?= 1u @@>, box true + <@@ Nullable<_> 1L ?= 1L @@>, box true + <@@ Nullable<_> 1uL ?= 1uL @@>, box true + <@@ Nullable<_> 1.0f ?= 1.0f @@>, box true + <@@ Nullable<_> 1.0 ?= 1.0 @@>, box true + <@@ Nullable<_> 1m ?= 1m @@>, box true + <@@ Nullable<_> 1m ?= 1m @@>, box true + <@@ Nullable<_> 1I ?= 1I @@>, box true + <@@ Nullable<_> '1' ?= '1' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?= LanguagePrimitives.GenericOne @@>, box true + + <@@ 1y =? Nullable<_> 1y @@>, box true + <@@ 1uy =? Nullable<_> 1uy @@>, box true + <@@ 1s =? Nullable<_> 1s @@>, box true + <@@ 1us =? Nullable<_> 1us @@>, box true + <@@ 1 =? Nullable<_> 1 @@>, box true + <@@ 1u =? Nullable<_> 1u @@>, box true + <@@ 1L =? Nullable<_> 1L @@>, box true + <@@ 1uL =? Nullable<_> 1uL @@>, box true + <@@ 1.0f =? Nullable<_> 1.0f @@>, box true + <@@ 1.0 =? Nullable<_> 1.0 @@>, box true + <@@ 1m =? Nullable<_> 1m @@>, box true + <@@ 1m =? Nullable<_> 1m @@>, box true + <@@ 1I =? Nullable<_> 1I @@>, box true + <@@ '1' =? Nullable<_> '1' @@>, box true + <@@ LanguagePrimitives.GenericOne =? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne =? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + + <@@ Nullable<_> 1y ?=? Nullable<_> 1y @@>, box true + <@@ Nullable<_> 1uy ?=? Nullable<_> 1uy @@>, box true + <@@ Nullable<_> 1s ?=? Nullable<_> 1s @@>, box true + <@@ Nullable<_> 1us ?=? Nullable<_> 1us @@>, box true + <@@ Nullable<_> 1 ?=? Nullable<_> 1 @@>, box true + <@@ Nullable<_> 1u ?=? Nullable<_> 1u @@>, box true + <@@ Nullable<_> 1L ?=? Nullable<_> 1L @@>, box true + <@@ Nullable<_> 1uL ?=? Nullable<_> 1uL @@>, box true + <@@ Nullable<_> 1.0f ?=? Nullable<_> 1.0f @@>, box true + <@@ Nullable<_> 1.0 ?=? Nullable<_> 1.0 @@>, box true + <@@ Nullable<_> 1m ?=? Nullable<_> 1m @@>, box true + <@@ Nullable<_> 1m ?=? Nullable<_> 1m @@>, box true + <@@ Nullable<_> 1I ?=? Nullable<_> 1I @@>, box true + <@@ Nullable<_> '1' ?=? Nullable<_> '1' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + + <@@ Nullable<_> 3y ?<> 3y @@>, box false + <@@ Nullable<_> 3uy ?<> 3uy @@>, box false + <@@ Nullable<_> 3s ?<> 3s @@>, box false + <@@ Nullable<_> 3us ?<> 3us @@>, box false + <@@ Nullable<_> 3 ?<> 3 @@>, box false + <@@ Nullable<_> 3u ?<> 3u @@>, box false + <@@ Nullable<_> 3L ?<> 3L @@>, box false + <@@ Nullable<_> 3UL ?<> 3UL @@>, box false + <@@ Nullable<_> '3' ?<> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?<> 3f @@>, box false + <@@ Nullable<_> 3. ?<> 3. @@>, box false + <@@ Nullable<_> 3m ?<> 3m @@>, box false + <@@ Nullable<_> 3m ?<> 3m @@>, box false + <@@ Nullable<_> 3I ?<> 3I @@>, box false + + <@@ 3y <>? Nullable<_> 3y @@>, box false + <@@ 3uy <>? Nullable<_> 3uy @@>, box false + <@@ 3s <>? Nullable<_> 3s @@>, box false + <@@ 3us <>? Nullable<_> 3us @@>, box false + <@@ 3 <>? Nullable<_> 3 @@>, box false + <@@ 3u <>? Nullable<_> 3u @@>, box false + <@@ 3L <>? Nullable<_> 3L @@>, box false + <@@ 3UL <>? Nullable<_> 3UL @@>, box false + <@@ '3' <>? Nullable<_> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne <>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne <>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f <>? Nullable<_> 3f @@>, box false + <@@ 3. <>? Nullable<_> 3. @@>, box false + <@@ 3m <>? Nullable<_> 3m @@>, box false + <@@ 3m <>? Nullable<_> 3m @@>, box false + <@@ 3I <>? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?<>? Nullable<_> 3y @@>, box false + <@@ Nullable<_> 3uy ?<>? Nullable<_> 3uy @@>, box false + <@@ Nullable<_> 3s ?<>? Nullable<_> 3s @@>, box false + <@@ Nullable<_> 3us ?<>? Nullable<_> 3us @@>, box false + <@@ Nullable<_> 3 ?<>? Nullable<_> 3 @@>, box false + <@@ Nullable<_> 3u ?<>? Nullable<_> 3u @@>, box false + <@@ Nullable<_> 3L ?<>? Nullable<_> 3L @@>, box false + <@@ Nullable<_> 3UL ?<>? Nullable<_> 3UL @@>, box false + <@@ Nullable<_> '3' ?<>? Nullable<_> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?<>? Nullable<_> 3f @@>, box false + <@@ Nullable<_> 3. ?<>? Nullable<_> 3. @@>, box false + <@@ Nullable<_> 3m ?<>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3m ?<>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3I ?<>? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?<= 3y @@>, box true + <@@ Nullable<_> 3uy ?<= 3uy @@>, box true + <@@ Nullable<_> 3s ?<= 3s @@>, box true + <@@ Nullable<_> 3us ?<= 3us @@>, box true + <@@ Nullable<_> 3 ?<= 3 @@>, box true + <@@ Nullable<_> 3u ?<= 3u @@>, box true + <@@ Nullable<_> 3L ?<= 3L @@>, box true + <@@ Nullable<_> 3UL ?<= 3UL @@>, box true + <@@ Nullable<_> '3' ?<= '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?<= 3f @@>, box true + <@@ Nullable<_> 3. ?<= 3. @@>, box true + <@@ Nullable<_> 3m ?<= 3m @@>, box true + <@@ Nullable<_> 3m ?<= 3m @@>, box true + <@@ Nullable<_> 3I ?<= 3I @@>, box true + + <@@ 3y <=? Nullable<_> 3y @@>, box true + <@@ 3uy <=? Nullable<_> 3uy @@>, box true + <@@ 3s <=? Nullable<_> 3s @@>, box true + <@@ 3us <=? Nullable<_> 3us @@>, box true + <@@ 3 <=? Nullable<_> 3 @@>, box true + <@@ 3u <=? Nullable<_> 3u @@>, box true + <@@ 3L <=? Nullable<_> 3L @@>, box true + <@@ 3UL <=? Nullable<_> 3UL @@>, box true + <@@ '3' <=? Nullable<_> '3' @@>, box true + <@@ LanguagePrimitives.GenericOne <=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne <=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ 3f <=? Nullable<_> 3f @@>, box true + <@@ 3. <=? Nullable<_> 3. @@>, box true + <@@ 3m <=? Nullable<_> 3m @@>, box true + <@@ 3m <=? Nullable<_> 3m @@>, box true + <@@ 3I <=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?<=? Nullable<_> 3y @@>, box true + <@@ Nullable<_> 3uy ?<=? Nullable<_> 3uy @@>, box true + <@@ Nullable<_> 3s ?<=? Nullable<_> 3s @@>, box true + <@@ Nullable<_> 3us ?<=? Nullable<_> 3us @@>, box true + <@@ Nullable<_> 3 ?<=? Nullable<_> 3 @@>, box true + <@@ Nullable<_> 3u ?<=? Nullable<_> 3u @@>, box true + <@@ Nullable<_> 3L ?<=? Nullable<_> 3L @@>, box true + <@@ Nullable<_> 3UL ?<=? Nullable<_> 3UL @@>, box true + <@@ Nullable<_> '3' ?<=? Nullable<_> '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?<=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?<=? Nullable<_> 3f @@>, box true + <@@ Nullable<_> 3. ?<=? Nullable<_> 3. @@>, box true + <@@ Nullable<_> 3m ?<=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3m ?<=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3I ?<=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?< 3y @@>, box false + <@@ Nullable<_> 3uy ?< 3uy @@>, box false + <@@ Nullable<_> 3s ?< 3s @@>, box false + <@@ Nullable<_> 3us ?< 3us @@>, box false + <@@ Nullable<_> 3 ?< 3 @@>, box false + <@@ Nullable<_> 3u ?< 3u @@>, box false + <@@ Nullable<_> 3L ?< 3L @@>, box false + <@@ Nullable<_> 3UL ?< 3UL @@>, box false + <@@ Nullable<_> '3' ?< '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?< LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?< LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?< 3f @@>, box false + <@@ Nullable<_> 3. ?< 3. @@>, box false + <@@ Nullable<_> 3m ?< 3m @@>, box false + <@@ Nullable<_> 3m ?< 3m @@>, box false + <@@ Nullable<_> 3I ?< 3I @@>, box false + + <@@ 3y 3y @@>, box false + <@@ 3uy 3uy @@>, box false + <@@ 3s 3s @@>, box false + <@@ 3us 3us @@>, box false + <@@ 3 3 @@>, box false + <@@ 3u 3u @@>, box false + <@@ 3L 3L @@>, box false + <@@ 3UL 3UL @@>, box false + <@@ '3' '3' @@>, box false + <@@ LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne LanguagePrimitives.GenericOne @@>, box false + <@@ 3f 3f @@>, box false + <@@ 3. 3. @@>, box false + <@@ 3m 3m @@>, box false + <@@ 3m 3m @@>, box false + <@@ 3I 3I @@>, box false + + <@@ Nullable<_> 3y ? 3y @@>, box false + <@@ Nullable<_> 3uy ? 3uy @@>, box false + <@@ Nullable<_> 3s ? 3s @@>, box false + <@@ Nullable<_> 3us ? 3us @@>, box false + <@@ Nullable<_> 3 ? 3 @@>, box false + <@@ Nullable<_> 3u ? 3u @@>, box false + <@@ Nullable<_> 3L ? 3L @@>, box false + <@@ Nullable<_> 3UL ? 3UL @@>, box false + <@@ Nullable<_> '3' ? '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ? LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ? LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ? 3f @@>, box false + <@@ Nullable<_> 3. ? 3. @@>, box false + <@@ Nullable<_> 3m ? 3m @@>, box false + <@@ Nullable<_> 3m ? 3m @@>, box false + <@@ Nullable<_> 3I ? 3I @@>, box false + + <@@ Nullable<_> 3y ?>= 3y @@>, box true + <@@ Nullable<_> 3uy ?>= 3uy @@>, box true + <@@ Nullable<_> 3s ?>= 3s @@>, box true + <@@ Nullable<_> 3us ?>= 3us @@>, box true + <@@ Nullable<_> 3 ?>= 3 @@>, box true + <@@ Nullable<_> 3u ?>= 3u @@>, box true + <@@ Nullable<_> 3L ?>= 3L @@>, box true + <@@ Nullable<_> 3UL ?>= 3UL @@>, box true + <@@ Nullable<_> '3' ?>= '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>= LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?>= 3f @@>, box true + <@@ Nullable<_> 3. ?>= 3. @@>, box true + <@@ Nullable<_> 3m ?>= 3m @@>, box true + <@@ Nullable<_> 3m ?>= 3m @@>, box true + <@@ Nullable<_> 3I ?>= 3I @@>, box true + + <@@ 3y >=? Nullable<_> 3y @@>, box true + <@@ 3uy >=? Nullable<_> 3uy @@>, box true + <@@ 3s >=? Nullable<_> 3s @@>, box true + <@@ 3us >=? Nullable<_> 3us @@>, box true + <@@ 3 >=? Nullable<_> 3 @@>, box true + <@@ 3u >=? Nullable<_> 3u @@>, box true + <@@ 3L >=? Nullable<_> 3L @@>, box true + <@@ 3UL >=? Nullable<_> 3UL @@>, box true + <@@ '3' >=? Nullable<_> '3' @@>, box true + <@@ LanguagePrimitives.GenericOne >=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ LanguagePrimitives.GenericOne >=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ 3f >=? Nullable<_> 3f @@>, box true + <@@ 3. >=? Nullable<_> 3. @@>, box true + <@@ 3m >=? Nullable<_> 3m @@>, box true + <@@ 3m >=? Nullable<_> 3m @@>, box true + <@@ 3I >=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?>=? Nullable<_> 3y @@>, box true + <@@ Nullable<_> 3uy ?>=? Nullable<_> 3uy @@>, box true + <@@ Nullable<_> 3s ?>=? Nullable<_> 3s @@>, box true + <@@ Nullable<_> 3us ?>=? Nullable<_> 3us @@>, box true + <@@ Nullable<_> 3 ?>=? Nullable<_> 3 @@>, box true + <@@ Nullable<_> 3u ?>=? Nullable<_> 3u @@>, box true + <@@ Nullable<_> 3L ?>=? Nullable<_> 3L @@>, box true + <@@ Nullable<_> 3UL ?>=? Nullable<_> 3UL @@>, box true + <@@ Nullable<_> '3' ?>=? Nullable<_> '3' @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>=? Nullable<_> LanguagePrimitives.GenericOne @@>, box true + <@@ Nullable<_> 3f ?>=? Nullable<_> 3f @@>, box true + <@@ Nullable<_> 3. ?>=? Nullable<_> 3. @@>, box true + <@@ Nullable<_> 3m ?>=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3m ?>=? Nullable<_> 3m @@>, box true + <@@ Nullable<_> 3I ?>=? Nullable<_> 3I @@>, box true + + <@@ Nullable<_> 3y ?> 3y @@>, box false + <@@ Nullable<_> 3uy ?> 3uy @@>, box false + <@@ Nullable<_> 3s ?> 3s @@>, box false + <@@ Nullable<_> 3us ?> 3us @@>, box false + <@@ Nullable<_> 3 ?> 3 @@>, box false + <@@ Nullable<_> 3u ?> 3u @@>, box false + <@@ Nullable<_> 3L ?> 3L @@>, box false + <@@ Nullable<_> 3UL ?> 3UL @@>, box false + <@@ Nullable<_> '3' ?> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?> 3f @@>, box false + <@@ Nullable<_> 3. ?> 3. @@>, box false + <@@ Nullable<_> 3m ?> 3m @@>, box false + <@@ Nullable<_> 3m ?> 3m @@>, box false + <@@ Nullable<_> 3I ?> 3I @@>, box false + + <@@ 3y >? Nullable<_> 3y @@>, box false + <@@ 3uy >? Nullable<_> 3uy @@>, box false + <@@ 3s >? Nullable<_> 3s @@>, box false + <@@ 3us >? Nullable<_> 3us @@>, box false + <@@ 3 >? Nullable<_> 3 @@>, box false + <@@ 3u >? Nullable<_> 3u @@>, box false + <@@ 3L >? Nullable<_> 3L @@>, box false + <@@ 3UL >? Nullable<_> 3UL @@>, box false + <@@ '3' >? Nullable<_> '3' @@>, box false + <@@ LanguagePrimitives.GenericOne >? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ LanguagePrimitives.GenericOne >? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ 3f >? Nullable<_> 3f @@>, box false + <@@ 3. >? Nullable<_> 3. @@>, box false + <@@ 3m >? Nullable<_> 3m @@>, box false + <@@ 3m >? Nullable<_> 3m @@>, box false + <@@ 3I >? Nullable<_> 3I @@>, box false + + <@@ Nullable<_> 3y ?>? Nullable<_> 3y @@>, box false + <@@ Nullable<_> 3uy ?>? Nullable<_> 3uy @@>, box false + <@@ Nullable<_> 3s ?>? Nullable<_> 3s @@>, box false + <@@ Nullable<_> 3us ?>? Nullable<_> 3us @@>, box false + <@@ Nullable<_> 3 ?>? Nullable<_> 3 @@>, box false + <@@ Nullable<_> 3u ?>? Nullable<_> 3u @@>, box false + <@@ Nullable<_> 3L ?>? Nullable<_> 3L @@>, box false + <@@ Nullable<_> 3UL ?>? Nullable<_> 3UL @@>, box false + <@@ Nullable<_> '3' ?>? Nullable<_> '3' @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> LanguagePrimitives.GenericOne ?>? Nullable<_> LanguagePrimitives.GenericOne @@>, box false + <@@ Nullable<_> 3f ?>? Nullable<_> 3f @@>, box false + <@@ Nullable<_> 3. ?>? Nullable<_> 3. @@>, box false + <@@ Nullable<_> 3m ?>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3m ?>? Nullable<_> 3m @@>, box false + <@@ Nullable<_> 3I ?>? Nullable<_> 3I @@>, box false + |] + tests |> Array.map (fun (test, eval) -> + begin + printfn "--> Checking we can evaluate %A" test + let res = FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation test + let b = res = eval + if b then printfn "--- Success, it is %A which is equal to %A" res eval + else printfn "!!! FAILURE, it is %A which is not equal to %A" res eval + b + end + && + match test with + | CallWithWitnesses(None, minfo1, minfo2, witnessArgs, args) -> + printfn " + printfn "<-- Success, it did not match Quotations.Patterns.(|CallWithWitnesses|_|)" + true) |> Array.forall id) // Don't short circuit on a failed test module MoreWitnessTests = open System.Runtime.CompilerServices diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index d8c4bd79cc2..d4da2adaf94 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1060,10 +1060,13 @@ module CoreTests = let rawFileErr = tryCreateTemporaryFileName () ``fsi b 2>c`` "%s --nologo --preferreduilang:en-US %s" fsc_flags_errors_ok flag ("test.fsx", rawFileOut, rawFileErr) - // REM REVIEW: want to normalise CWD paths, not suppress them. - let ``findstr /v`` text = Seq.filter (fun (s: string) -> not <| s.Contains(text)) - let removeCDandHelp from' to' = - File.ReadLines from' |> (``findstr /v`` cfg.Directory) |> (``findstr /v`` "--help' for options") |> (fun lines -> File.WriteAllLines(getfullpath cfg to', lines)) + let removeCDandHelp fromFile toFile = + File.ReadAllLines fromFile + |> Array.filter (fun s -> not (s.Contains(cfg.Directory))) + |> Array.filter (fun s -> not (s.Contains("--help' for options"))) + |> Array.filter (fun s -> not (s.Contains("[Loading"))) + |> Array.filter (fun s -> not (s.Contains("Binding session"))) + |> (fun lines -> File.WriteAllLines(getfullpath cfg toFile, lines)) removeCDandHelp rawFileOut diffFileOut removeCDandHelp rawFileErr diffFileErr diff --git a/tests/fsharp/tools/eval/test.fsx b/tests/fsharp/tools/eval/test.fsx index a289c17794a..f6a669653ce 100644 --- a/tests/fsharp/tools/eval/test.fsx +++ b/tests/fsharp/tools/eval/test.fsx @@ -1236,6 +1236,7 @@ module EvaluationTests = check "vroievr097q" (LanguagePrimitives.AdditionDynamic 3.0 4.0) 7.0 check "vroievr097w" (LanguagePrimitives.AdditionDynamic 3.0f 4.0f) 7.0f check "vroievr097e" (LanguagePrimitives.AdditionDynamic 3.0M 4.0M) 7.0M + check "vroievr097n" (LanguagePrimitives.AdditionDynamic '3' '\004') '7' check "vroievr097r" (LanguagePrimitives.CheckedAdditionDynamic 3y 4y) 7y check "vroievr097t" (LanguagePrimitives.CheckedAdditionDynamic 3s 4s) 7s @@ -1250,6 +1251,37 @@ module EvaluationTests = check "vroievr097f" (LanguagePrimitives.CheckedAdditionDynamic 3.0 4.0) 7.0 check "vroievr097g" (LanguagePrimitives.CheckedAdditionDynamic 3.0f 4.0f) 7.0f check "vroievr097h" (LanguagePrimitives.CheckedAdditionDynamic 3.0M 4.0M) 7.0M + check "vroievr097u" (LanguagePrimitives.CheckedAdditionDynamic '3' '\004') '7' + + check "vroievr0981" (LanguagePrimitives.SubtractionDynamic 7y 4y) 3y + check "vroievr0982" (LanguagePrimitives.SubtractionDynamic 7s 4s) 3s + check "vroievr0983" (LanguagePrimitives.SubtractionDynamic 7 4) 3 + check "vroievr0984" (LanguagePrimitives.SubtractionDynamic 7L 4L) 3L + check "vroievr0985" (LanguagePrimitives.SubtractionDynamic 7n 4n) 3n + check "vroievr0986" (LanguagePrimitives.SubtractionDynamic 7uy 4uy) 3uy + check "vroievr0987" (LanguagePrimitives.SubtractionDynamic 7us 4us) 3us + check "vroievr0988" (LanguagePrimitives.SubtractionDynamic 7u 4u) 3u + check "vroievr0989" (LanguagePrimitives.SubtractionDynamic 7UL 4UL) 3UL + check "vroievr0980" (LanguagePrimitives.SubtractionDynamic 7un 4un) 3un + check "vroievr098q" (LanguagePrimitives.SubtractionDynamic 7.0 4.0) 3.0 + check "vroievr098w" (LanguagePrimitives.SubtractionDynamic 7.0f 4.0f) 3.0f + check "vroievr098e" (LanguagePrimitives.SubtractionDynamic 7.0M 4.0M) 3.0M + check "vroievr098n" (LanguagePrimitives.SubtractionDynamic '7' '\004') '3' + + check "vroievr098r" (LanguagePrimitives.CheckedSubtractionDynamic 7y 4y) 3y + check "vroievr098t" (LanguagePrimitives.CheckedSubtractionDynamic 7s 4s) 3s + check "vroievr098y" (LanguagePrimitives.CheckedSubtractionDynamic 7 4) 3 + check "vroievr098u" (LanguagePrimitives.CheckedSubtractionDynamic 7L 4L) 3L + check "vroievr098i" (LanguagePrimitives.CheckedSubtractionDynamic 7n 4n) 3n + check "vroievr098o" (LanguagePrimitives.CheckedSubtractionDynamic 7uy 4uy) 3uy + check "vroievr098p" (LanguagePrimitives.CheckedSubtractionDynamic 7us 4us) 3us + check "vroievr098a" (LanguagePrimitives.CheckedSubtractionDynamic 7u 4u) 3u + check "vroievr098s" (LanguagePrimitives.CheckedSubtractionDynamic 7UL 4UL) 3UL + check "vroievr098d" (LanguagePrimitives.CheckedSubtractionDynamic 7un 4un) 3un + check "vroievr098f" (LanguagePrimitives.CheckedSubtractionDynamic 7.0 4.0) 3.0 + check "vroievr098g" (LanguagePrimitives.CheckedSubtractionDynamic 7.0f 4.0f) 3.0f + check "vroievr098h" (LanguagePrimitives.CheckedSubtractionDynamic 7.0M 4.0M) 3.0M + check "vroievr098u" (LanguagePrimitives.CheckedSubtractionDynamic '7' '\004') '3' check "vroievr0912q" (LanguagePrimitives.MultiplyDynamic 3y 4y) 12y check "vroievr0912w" (LanguagePrimitives.MultiplyDynamic 3s 4s) 12s @@ -1265,7 +1297,6 @@ module EvaluationTests = check "vroievr0912s" (LanguagePrimitives.MultiplyDynamic 3.0f 4.0f) 12.0f check "vroievr0912d" (LanguagePrimitives.MultiplyDynamic 3.0M 4.0M) 12.0M - check "vroievr0912f" (LanguagePrimitives.CheckedMultiplyDynamic 3y 4y) 12y check "vroievr0912g" (LanguagePrimitives.CheckedMultiplyDynamic 3s 4s) 12s check "vroievr0912h" (LanguagePrimitives.CheckedMultiplyDynamic 3 4) 12 diff --git a/tests/scripts/identifierAnalysisByType.fsx b/tests/scripts/identifierAnalysisByType.fsx index 7ac8de7a20b..d3b5c4e9415 100644 --- a/tests/scripts/identifierAnalysisByType.fsx +++ b/tests/scripts/identifierAnalysisByType.fsx @@ -60,7 +60,7 @@ symbols |> Array.filter (fun (v, _) -> v.GenericParameters.Count = 0) |> Array.filter (fun (v, _) -> v.CurriedParameterGroups.Count = 0) |> Array.filter (fun (v, _) -> not v.FullType.IsGenericParameter) -|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse) +|> Array.map (fun (v, vUse) -> getTypeText v, v, vUse.ToString()) |> Array.filter (fun (vTypeText, v, _) -> match vTypeText with | "System.String" -> false @@ -77,6 +77,7 @@ symbols |> Array.map (fun (key, g) -> key, (g + |> Array.distinctBy (fun (_, _, vUse) -> vUse) |> Array.groupBy (fun (_, v, _) -> v.DisplayName) |> Array.sortByDescending (snd >> Array.length))) |> Array.filter (fun (_, g) -> g.Length > 1) @@ -87,7 +88,7 @@ symbols for (nm, entries) in g do printfn " %s (%d times)" nm (Array.length entries) for (_, _, vUse) in entries do - printfn " %s" (vUse.ToString()) + printfn " %s" vUse printfn "") (* diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 05b42f7a67d..9a1f6d6bb56 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1184,7 +1184,7 @@ let ``Test Operator Declarations for Byte`` () = [], "let testByteAdditionChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),e1,e2)) @ (24,53--24,70)" [], "let testByteSubtractionChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),e1,e2)) @ (25,53--25,70)" [], "let testByteMultiplyChecked(e1) (e2) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Multiply (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2)) @ (26,53--26,70)" - [], "let testByteToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,43--29,58)" + [], "let testByteToByteChecked(e1) = e1 @ (29,56--29,58)" [], "let testByteToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,43--30,59)" [], "let testByteToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,43--31,59)" [], "let testByteToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" @@ -1195,7 +1195,7 @@ let ``Test Operator Declarations for Byte`` () = [], "let testByteToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,43--37,60)" [], "let testByteToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,43--38,63)" [], "let testByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,43--39,64)" - [], "let testByteToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,43--41,50)" + [], "let testByteToByteOperator(e1) = e1 @ (41,48--41,50)" [], "let testByteToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,43--42,51)" [], "let testByteToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,43--43,51)" [], "let testByteToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,43--44,52)" @@ -1296,7 +1296,7 @@ let ``Test Operator Declarations for SByte`` () = [], "let testSByteMultiplyChecked(e1) (e2) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Checked.op_Multiply (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.MultiplyDynamic (arg0_0,arg1_0),e1,e2)) @ (26,56--26,73)" [], "let testSByteUnaryNegChecked(e1) = Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),0,e1) @ (27,45--27,60)" [], "let testSByteToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,45--29,60)" - [], "let testSByteToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" + [], "let testSByteToSByteChecked(e1) = e1 @ (30,59--30,61)" [], "let testSByteToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" [], "let testSByteToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" [], "let testSByteToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" @@ -1307,7 +1307,7 @@ let ``Test Operator Declarations for SByte`` () = [], "let testSByteToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,45--38,65)" [], "let testSByteToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" [], "let testSByteToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,45--41,52)" - [], "let testSByteToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,45--42,53)" + [], "let testSByteToSByteOperator(e1) = e1 @ (42,51--42,53)" [], "let testSByteToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,45--43,53)" [], "let testSByteToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,45--44,54)" [], "let testSByteToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" @@ -1406,7 +1406,7 @@ let ``Test Operator Declarations for Int16`` () = [], "let testInt16UnaryNegChecked(e1) = Checked.op_Subtraction (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.SubtractionDynamic (arg0_0,arg1_0),0,e1) @ (27,45--27,60)" [], "let testInt16ToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,45--29,60)" [], "let testInt16ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" - [], "let testInt16ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" + [], "let testInt16ToInt16Checked(e1) = e1 @ (31,59--31,61)" [], "let testInt16ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" [], "let testInt16ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" [], "let testInt16ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" @@ -1417,7 +1417,7 @@ let ``Test Operator Declarations for Int16`` () = [], "let testInt16ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" [], "let testInt16ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,45--41,52)" [], "let testInt16ToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,45--42,53)" - [], "let testInt16ToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,45--43,53)" + [], "let testInt16ToInt16Operator(e1) = e1 @ (43,51--43,53)" [], "let testInt16ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,45--44,54)" [], "let testInt16ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" [], "let testInt16ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,45--46,53)" @@ -1515,7 +1515,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,47--29,62)" [], "let testUInt16ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,47--30,63)" [], "let testUInt16ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,47--31,63)" - [], "let testUInt16ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,47--32,64)" + [], "let testUInt16ToUInt16Checked(e1) = e1 @ (32,62--32,64)" [], "let testUInt16ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,47--33,61)" [], "let testUInt16ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" [], "let testUInt16ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" @@ -1526,7 +1526,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,47--41,54)" [], "let testUInt16ToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,47--42,55)" [], "let testUInt16ToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,47--43,55)" - [], "let testUInt16ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,47--44,56)" + [], "let testUInt16ToUInt16Operator(e1) = e1 @ (44,54--44,56)" [], "let testUInt16ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,47--45,53)" [], "let testUInt16ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,47--46,55)" [], "let testUInt16ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,47--47,56)" @@ -1537,7 +1537,7 @@ let ``Test Operator Declarations for UInt16`` () = [], "let testUInt16ToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (52,47--52,57)" [], "let testUInt16ToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (53,47--53,55)" [], "let testUInt16ToDecimalOperator(e1) = Convert.ToDecimal (e1) @ (54,47--54,57)" - [], "let testUInt16ToCharOperator(e1) = Operators.ToChar (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,47--55,54)" + [], "let testUInt16ToCharOperator(e1) = e1 @ (55,47--55,54)" [FC47; FC50], "let testUInt16ToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.uint16 = e1 in copyOfStruct.ToString() @ (56,47--56,56)" ] @@ -1625,8 +1625,8 @@ let ``Test Operator Declarations for Int`` () = [], "let testIntToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,41--30,57)" [], "let testIntToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,41--31,57)" [], "let testIntToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,41--32,58)" - [], "let testIntToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,41--33,55)" - [], "let testIntToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,41--34,57)" + [], "let testIntToIntChecked(e1) = e1 @ (33,53--33,55)" + [], "let testIntToInt32Checked(e1) = e1 @ (34,55--34,57)" [], "let testIntToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,41--35,58)" [], "let testIntToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,41--36,57)" [], "let testIntToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,41--37,58)" @@ -1734,8 +1734,8 @@ let ``Test Operator Declarations for Int32`` () = [], "let testInt32ToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,45--30,61)" [], "let testInt32ToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,45--31,61)" [], "let testInt32ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,45--32,62)" - [], "let testInt32ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" - [], "let testInt32ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" + [], "let testInt32ToIntChecked(e1) = e1 @ (33,57--33,59)" + [], "let testInt32ToInt32Checked(e1) = e1 @ (34,59--34,61)" [], "let testInt32ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,45--35,62)" [], "let testInt32ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,45--36,61)" [], "let testInt32ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,45--37,62)" @@ -1845,7 +1845,7 @@ let ``Test Operator Declarations for UInt32`` () = [], "let testUInt32ToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,47--32,64)" [], "let testUInt32ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,47--33,61)" [], "let testUInt32ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" - [], "let testUInt32ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" + [], "let testUInt32ToUInt32Checked(e1) = e1 @ (35,62--35,64)" [], "let testUInt32ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,47--36,63)" [], "let testUInt32ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,47--37,64)" [], "let testUInt32ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,47--38,67)" @@ -1856,7 +1856,7 @@ let ``Test Operator Declarations for UInt32`` () = [], "let testUInt32ToUInt16Operator(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (44,47--44,56)" [], "let testUInt32ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,47--45,53)" [], "let testUInt32ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,47--46,55)" - [], "let testUInt32ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,47--47,56)" + [], "let testUInt32ToUInt32Operator(e1) = e1 @ (47,54--47,56)" [], "let testUInt32ToInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,47--48,55)" [], "let testUInt32ToUInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,47--49,56)" [], "let testUInt32ToIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,47--50,59)" @@ -1955,7 +1955,7 @@ let ``Test Operator Declarations for Int64`` () = [], "let testInt64ToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,45--33,59)" [], "let testInt64ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,45--34,61)" [], "let testInt64ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,45--35,62)" - [], "let testInt64ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,45--36,61)" + [], "let testInt64ToInt64Checked(e1) = e1 @ (36,59--36,61)" [], "let testInt64ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,45--37,62)" [], "let testInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,45--38,65)" [], "let testInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,45--39,66)" @@ -1966,7 +1966,7 @@ let ``Test Operator Declarations for Int64`` () = [], "let testInt64ToIntOperator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (45,45--45,51)" [], "let testInt64ToInt32Operator(e1) = Operators.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (46,45--46,53)" [], "let testInt64ToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,45--47,54)" - [], "let testInt64ToInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,45--48,53)" + [], "let testInt64ToInt64Operator(e1) = e1 @ (48,51--48,53)" [], "let testInt64ToUInt64Operator(e1) = Operators.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,45--49,54)" [], "let testInt64ToIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,45--50,57)" [], "let testInt64ToUIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,45--51,58)" @@ -2065,7 +2065,7 @@ let ``Test Operator Declarations for UInt64`` () = [], "let testUInt64ToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,47--34,63)" [], "let testUInt64ToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,47--35,64)" [], "let testUInt64ToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,47--36,63)" - [], "let testUInt64ToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,47--37,64)" + [], "let testUInt64ToUInt64Checked(e1) = e1 @ (37,62--37,64)" [], "let testUInt64ToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,47--38,67)" [], "let testUInt64ToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,47--39,68)" [], "let testUInt64ToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,47--41,54)" @@ -2175,7 +2175,7 @@ let ``Test Operator Declarations for IntPtr`` () = [], "let testIntPtrToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,50--35,67)" [], "let testIntPtrToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,50--36,66)" [], "let testIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,50--37,67)" - [], "let testIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,50--38,70)" + [], "let testIntPtrToIntPtrChecked(e1) = e1 @ (38,68--38,70)" [], "let testIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,50--39,71)" [], "let testIntPtrToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,50--41,57)" [], "let testIntPtrToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,50--42,58)" @@ -2186,7 +2186,7 @@ let ``Test Operator Declarations for IntPtr`` () = [], "let testIntPtrToUInt32Operator(e1) = Operators.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (47,50--47,59)" [], "let testIntPtrToInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (48,50--48,58)" [], "let testIntPtrToUInt64Operator(e1) = Operators.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (49,50--49,59)" - [], "let testIntPtrToIntPtrOperator(e1) = Operators.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (50,50--50,62)" + [], "let testIntPtrToIntPtrOperator(e1) = e1 @ (50,60--50,62)" [], "let testIntPtrToUIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,50--51,63)" [], "let testIntPtrToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (52,50--52,60)" [], "let testIntPtrToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (53,50--53,58)" @@ -2284,7 +2284,7 @@ let ``Test Operator Declarations for UIntPtr`` () = [], "let testUIntPtrToInt64Checked(e1) = Checked.ToInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (36,52--36,68)" [], "let testUIntPtrToUInt64Checked(e1) = Checked.ToUInt64 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (37,52--37,69)" [], "let testUIntPtrToIntPtrChecked(e1) = Checked.ToIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (38,52--38,72)" - [], "let testUIntPtrToUIntPtrChecked(e1) = Checked.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (39,52--39,73)" + [], "let testUIntPtrToUIntPtrChecked(e1) = e1 @ (39,71--39,73)" [], "let testUIntPtrToByteOperator(e1) = Operators.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (41,52--41,59)" [], "let testUIntPtrToSByteOperator(e1) = Operators.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (42,52--42,60)" [], "let testUIntPtrToInt16Operator(e1) = Operators.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (43,52--43,60)" @@ -2870,7 +2870,7 @@ let ``Test Operator Declarations for Char`` () = [], "let testCharToByteChecked(e1) = Checked.ToByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (29,43--29,58)" [], "let testCharToSByteChecked(e1) = Checked.ToSByte (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (30,43--30,59)" [], "let testCharToInt16Checked(e1) = Checked.ToInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (31,43--31,59)" - [], "let testCharToUInt16Checked(e1) = Checked.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" + [], "let testCharToUInt16Checked(e1) = Operators.ToUInt16 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (32,43--32,60)" [], "let testCharToIntChecked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (33,43--33,57)" [], "let testCharToInt32Checked(e1) = Checked.ToInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (34,43--34,59)" [], "let testCharToUInt32Checked(e1) = Checked.ToUInt32 (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (35,43--35,60)" @@ -2891,7 +2891,7 @@ let ``Test Operator Declarations for Char`` () = [], "let testCharToUIntPtrOperator(e1) = Operators.ToUIntPtr (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (51,43--51,56)" [], "let testCharToSingleOperator(e1) = Operators.ToSingle (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (52,43--52,53)" [], "let testCharToDoubleOperator(e1) = Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),Operators.ToDouble (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1)) @ (53,43--53,51)" - [], "let testCharToCharOperator(e1) = Operators.ToChar (fun arg0_0 -> LanguagePrimitives.ExplicitDynamic (arg0_0),e1) @ (55,43--55,50)" + [], "let testCharToCharOperator(e1) = e1 @ (55,48--55,50)" [FC47; FC50], "let testCharToStringOperator(e1) = let mutable copyOfStruct: Microsoft.FSharp.Core.char = e1 in copyOfStruct.ToString() @ (56,43--56,52)" ] From 441077d202bb0eb2c864840e9a0c5f401ecec4ae Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 13 Jul 2022 14:27:59 +0200 Subject: [PATCH 039/226] Fix Zero constraint printing in signature file. (#13438) --- src/Compiler/Checking/NicePrint.fs | 5 ++++- src/Compiler/SyntaxTree/PrettyNaming.fs | 2 ++ tests/fsharp/core/zeroConstraint/test.fs | 5 +++++ tests/fsharp/tests.fs | 3 +++ .../neg_known_return_type_and_known_type_arguments.bsl | 4 ++-- 5 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tests/fsharp/core/zeroConstraint/test.fs diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index a07f000c7a7..df08572483b 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -810,7 +810,10 @@ module PrintTypes = let argTysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argTys let retTyL = layoutReturnType denv env retTy - let sigL = curriedLayoutsL "->" [argTysL] retTyL + let sigL = + match argTys with + | [] -> retTyL + | _ -> curriedLayoutsL "->" [argTysL] retTyL (tysL |> addColonL) --- bracketL (stat ++ (nameL |> addColonL) --- sigL) /// Layout a unit of measure expression diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index 6e25b5c6360..65bdbede5e8 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -585,6 +585,8 @@ let ConvertValNameToDisplayLayout isBaseVal nonOpLayout name = else leftL (TaggedText.tagPunctuation "(") ^^ wordL (TaggedText.tagOperator nm) ^^ rightL (TaggedText.tagPunctuation ")") + elif name = "get_Zero" then + ConvertNameToDisplayLayout nonOpLayout "Zero" else ConvertNameToDisplayLayout nonOpLayout name diff --git a/tests/fsharp/core/zeroConstraint/test.fs b/tests/fsharp/core/zeroConstraint/test.fs new file mode 100644 index 00000000000..91e9041eb16 --- /dev/null +++ b/tests/fsharp/core/zeroConstraint/test.fs @@ -0,0 +1,5 @@ +module Foo.Array + +[] +let inline average (array: 'T[] when ^T: (static member Zero: ^T) and ^T: (static member (+) : ^T * ^T -> ^T) and ^T: (static member DivideByInt: ^T * int -> ^T)) : 'T = + failwith "todo" \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index d4da2adaf94..3422922c449 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3388,6 +3388,9 @@ module GeneratedSignatureTests = [] let ``mixCurriedTupled-FSC_NETFX_TEST_GENERATED_SIGNATURE`` () = singleTestBuildAndRun "core/mixCurriedTupled" FSC_NETFX_TEST_GENERATED_SIGNATURE + + [] + let ``zeroConstraint-FSC_NETFX_TEST_GENERATED_SIGNATURE`` () = singleTestBuildAndRun "core/zeroConstraint" FSC_NETFX_TEST_GENERATED_SIGNATURE #endif #if !NETCOREAPP diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl index 9dadb19ee6e..dfe5a058b04 100644 --- a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl @@ -6,11 +6,11 @@ Known return type: MonoidSample Known type parameters: < MonoidSample , Zero > Available overloads: - - static member Zero.Zero: ^t * Default1 -> ^t when ^t: (static member get_Zero: -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default1 -> ^t when ^t: (static member Zero: ^t) // Argument at index 1 doesn't match - static member Zero.Zero: ^t * Default1 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match - static member Zero.Zero: ^t * Default2 -> ^t when (FromInt32 or ^t) : (static member FromInt32: ^t * FromInt32 -> (int32 -> ^t)) // Argument at index 1 doesn't match - static member Zero.Zero: ^t * Default2 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match - - static member Zero.Zero: ^t * Default3 -> ^t when ^t: (static member get_Empty: -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default3 -> ^t when ^t: (static member get_Empty: ^t) // Argument at index 1 doesn't match - static member Zero.Zero: 'a array * Zero -> 'a array // Argument at index 1 doesn't match - static member Zero.Zero: 'a list * Zero -> 'a list // Argument at index 1 doesn't match - static member Zero.Zero: 'a option * Zero -> 'a option // Argument at index 1 doesn't match From cf4aa642ed21a95058d29413959f0548688d0c55 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 13 Jul 2022 15:23:59 +0200 Subject: [PATCH 040/226] Add trivia for SynTypeDefnSig. (#13483) --- src/Compiler/Checking/CheckDeclarations.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 5 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 5 +- src/Compiler/SyntaxTree/SyntaxTrivia.fs | 15 +++++ src/Compiler/SyntaxTree/SyntaxTrivia.fsi | 16 ++++++ src/Compiler/pars.fsy | 25 +++++---- ...erService.SurfaceArea.netstandard.expected | 19 +++++-- .../SyntaxTreeTests/SignatureTypeTests.fs | 56 +++++++++++++++++-- 8 files changed, 116 insertions(+), 27 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index b8192ef5f01..33066d9e339 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4523,7 +4523,7 @@ and TcSignatureElementsMutRec cenv parent typeNames m mutRecNSInfo envInitial (d | SynModuleSigDecl.Exception (exnSig=SynExceptionSig(exnRepr=exnRepr; withKeyword=withKeyword; members=members)) -> let ( SynExceptionDefnRepr(synAttrs, SynUnionCase(ident=SynIdent(id,_)), _, xmlDoc, vis, m)) = exnRepr let compInfo = SynComponentInfo(synAttrs, None, [], [id], xmlDoc, false, vis, id.idRange) - let decls = [ MutRecShape.Tycon(SynTypeDefnSig.SynTypeDefnSig(compInfo, None, SynTypeDefnSigRepr.Exception exnRepr, withKeyword, members, m)) ] + let decls = [ MutRecShape.Tycon(SynTypeDefnSig.SynTypeDefnSig(compInfo, SynTypeDefnSigRepr.Exception exnRepr, members, m, { TypeKeyword = None; WithKeyword = withKeyword; EqualsRange = None })) ] decls, (false, false) | SynModuleSigDecl.Val (vspec, _) -> diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 9bcc3a8efe8..500aef1d3ea 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1218,11 +1218,10 @@ type SynTypeDefnSig = | SynTypeDefnSig of typeInfo: SynComponentInfo * - equalsRange: range option * typeRepr: SynTypeDefnSigRepr * - withKeyword: range option * members: SynMemberSig list * - range: range + range: range * + trivia: SynTypeDefnSigTrivia member this.Range = match this with diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 357823b658e..988d7d8cad3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1383,11 +1383,10 @@ type SynTypeDefnSig = /// The information for a type definition in a signature | SynTypeDefnSig of typeInfo: SynComponentInfo * - equalsRange: range option * typeRepr: SynTypeDefnSigRepr * - withKeyword: range option * members: SynMemberSig list * - range: range + range: range * + trivia: SynTypeDefnSigTrivia /// Gets the syntax range of this construct member Range: range diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 679ec9156a7..1b03d20b615 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -137,6 +137,21 @@ type SynTypeDefnTrivia = WithKeyword = None } +[] +type SynTypeDefnSigTrivia = + { + TypeKeyword: range option + EqualsRange: range option + WithKeyword: range option + } + + static member Zero: SynTypeDefnSigTrivia = + { + TypeKeyword = None + EqualsRange = None + WithKeyword = None + } + [] type SynBindingTrivia = { diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index 4490e0ec57c..fbdf8ecf30e 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -215,6 +215,22 @@ type SynTypeDefnTrivia = static member Zero: SynTypeDefnTrivia +/// Represents additional information for SynTypeDefnSig +[] +type SynTypeDefnSigTrivia = + { + /// The syntax range of the `type` keyword. + TypeKeyword: range option + + /// The syntax range of the `=` token. + EqualsRange: range option + + /// The syntax range of the `with` keyword + WithKeyword: range option + } + + static member Zero: SynTypeDefnSigTrivia + /// Represents additional information for SynBinding [] type SynBindingTrivia = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index a21e22dc891..c7deb4d4fc6 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -826,7 +826,7 @@ moduleSpfn: | opt_attributes opt_declVisibility typeKeyword tyconSpfn tyconSpfnList { if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let (SynTypeDefnSig (SynComponentInfo (cas, a, cs, b, _xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, range)) = $4 + let (SynTypeDefnSig (SynComponentInfo (cas, a, cs, b, _xmlDoc, d, d2, d3), typeRepr, members, range, trivia)) = $4 _xmlDoc.MarkAsInvalid() let attrs = $1 @ cas let xmlDoc = grabXmlDoc(parseState, $1, 1) @@ -834,7 +834,8 @@ moduleSpfn: (d3, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRanges range |> unionRangeWithXmlDoc xmlDoc - let tc = SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), equalsRange, typeRepr, withKeyword, members, mDefn) + let trivia = { trivia with TypeKeyword = Some (rhs parseState 3) } + let tc = (SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), typeRepr, members, mDefn, trivia)) let m = (mDefn, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) SynModuleSigDecl.Types (tc :: $5, m) } @@ -901,18 +902,18 @@ tyconSpfnList: | AND tyconSpfn tyconSpfnList { let xmlDoc = grabXmlDoc(parseState, [], 1) let tyconSpfn = - let (SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range)) = $2 + let (SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia)) = $2 let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then $2 else let range = unionRangeWithXmlDoc _xmlDoc range - SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range) + SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia) else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) - SynTypeDefnSig(componentInfo, equalsRange, typeRepr, withKeyword, members, range) + SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia) tyconSpfn :: $3 } | @@ -936,7 +937,8 @@ tyconSpfn: | Some mWithKwd -> unionRanges range mWithKwd | decls -> (range, decls) ||> unionRangeWithListBy (fun (s: SynMemberSig) -> s.Range) - SynTypeDefnSig($1, None, SynTypeDefnSigRepr.Simple (SynTypeDefnSimpleRepr.None m, m), mWithKwd, members, m) } + let trivia: SynTypeDefnSigTrivia = { TypeKeyword = None; EqualsRange = None; WithKeyword = mWithKwd } + SynTypeDefnSig($1, SynTypeDefnSigRepr.Simple (SynTypeDefnSimpleRepr.None m, m), members, m, trivia) } /* The right-hand-side of a type definition in a signature */ @@ -968,7 +970,8 @@ tyconSpfnRhs: { (fun mLhs nameInfo mEquals augmentation -> let declRange = unionRanges mLhs $1.Range let mWhole = (declRange, augmentation) ||> unionRangeWithListBy (fun (mem: SynMemberSig) -> mem.Range) - SynTypeDefnSig(nameInfo, mEquals, SynTypeDefnSigRepr.Simple ($1, $1.Range), None, augmentation, mWhole)) } + let trivia: SynTypeDefnSigTrivia = { TypeKeyword = None; WithKeyword = None; EqualsRange = mEquals } + SynTypeDefnSig(nameInfo, SynTypeDefnSigRepr.Simple ($1, $1.Range), augmentation, mWhole, trivia)) } | tyconClassSpfn { let needsCheck, (kind, decls) = $1 @@ -985,7 +988,8 @@ tyconSpfnRhs: let declRange = unionRanges nameRange objectModelRange let mWhole = (declRange, augmentation) ||> unionRangeWithListBy (fun (mem: SynMemberSig) -> mem.Range) - SynTypeDefnSig(nameInfo, mEquals, SynTypeDefnSigRepr.ObjectModel (kind, decls, objectModelRange), None, augmentation, mWhole)) } + let trivia: SynTypeDefnSigTrivia = { TypeKeyword = None; WithKeyword = None; EqualsRange = mEquals } + SynTypeDefnSig(nameInfo, SynTypeDefnSigRepr.ObjectModel (kind, decls, objectModelRange), augmentation, mWhole, trivia)) } | DELEGATE OF topType { let m = lhs parseState @@ -994,7 +998,8 @@ tyconSpfnRhs: (fun nameRange nameInfo mEquals augmentation -> if not (isNil augmentation) then raiseParseErrorAt m (FSComp.SR.parsAugmentationsIllegalOnDelegateType()) let mWhole = unionRanges nameRange m - SynTypeDefnSig(nameInfo, mEquals, SynTypeDefnSigRepr.ObjectModel (SynTypeDefnKind.Delegate (ty, arity), [invoke], m), None, [], mWhole)) } + let trivia: SynTypeDefnSigTrivia = { TypeKeyword = None; WithKeyword = None; EqualsRange = mEquals } + SynTypeDefnSig(nameInfo, SynTypeDefnSigRepr.ObjectModel (SynTypeDefnKind.Delegate (ty, arity), [invoke], m), [], mWhole, trivia)) } /* The right-hand-side of an object type definition in a signature */ @@ -1675,7 +1680,7 @@ tyconDefn: let mWhole = (declRange, members) ||> unionRangeWithListBy (fun (mem:SynMemberDefn) -> mem.Range) |> unionRangeWithXmlDoc xmlDoc - let trivia = { TypeKeyword = None; EqualsRange = Some mEquals; WithKeyword = mWith } + let trivia: SynTypeDefnTrivia = { TypeKeyword = None; EqualsRange = Some mEquals; WithKeyword = mWith } SynTypeDefn($1, tcDefRepr, members, Some memberCtorPattern, mWhole, trivia) } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 090d64e02c7..4d2da93bc08 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -8799,9 +8799,11 @@ FSharp.Compiler.Syntax.SynTypeDefnRepr: System.String ToString() FSharp.Compiler.Syntax.SynTypeDefnSig FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo typeInfo -FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSig NewSynTypeDefnSig(FSharp.Compiler.Syntax.SynComponentInfo, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Syntax.SynTypeDefnSigRepr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSig NewSynTypeDefnSig(FSharp.Compiler.Syntax.SynComponentInfo, FSharp.Compiler.Syntax.SynTypeDefnSigRepr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia) FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSigRepr get_typeRepr() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSigRepr typeRepr +FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia get_trivia() +FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia trivia FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Text.Range get_range() @@ -8810,10 +8812,6 @@ FSharp.Compiler.Syntax.SynTypeDefnSig: Int32 Tag FSharp.Compiler.Syntax.SynTypeDefnSig: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig] get_members() FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig] members -FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] equalsRange -FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_equalsRange() -FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_withKeyword() -FSharp.Compiler.Syntax.SynTypeDefnSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] withKeyword FSharp.Compiler.Syntax.SynTypeDefnSig: System.String ToString() FSharp.Compiler.Syntax.SynTypeDefnSigRepr FSharp.Compiler.Syntax.SynTypeDefnSigRepr+Exception: FSharp.Compiler.Syntax.SynExceptionDefnRepr get_repr() @@ -9457,6 +9455,17 @@ FSharp.Compiler.SyntaxTrivia.SynPatOrTrivia: FSharp.Compiler.Text.Range BarRange FSharp.Compiler.SyntaxTrivia.SynPatOrTrivia: FSharp.Compiler.Text.Range get_BarRange() FSharp.Compiler.SyntaxTrivia.SynPatOrTrivia: System.String ToString() FSharp.Compiler.SyntaxTrivia.SynPatOrTrivia: Void .ctor(FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia Zero +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia get_Zero() +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TypeKeyword +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_TypeKeyword() +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia: FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia Zero FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia: FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia get_Zero() diff --git a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs index acc789e1075..943fa5ba5e3 100644 --- a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs +++ b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs @@ -173,7 +173,7 @@ type X = delegate of string -> string match parseResults with | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals + types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _)) ] ) ]) ])) -> @@ -195,7 +195,7 @@ type Foobar = match parseResults with | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals + types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Class)) ] ) ]) ])) -> @@ -217,7 +217,7 @@ type Bear = match parseResults with | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals + types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.Simple(repr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase(trivia={ EqualsRange = mEqualsEnumCase1 }) @@ -245,7 +245,7 @@ type Shape = match parseResults with | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( - types = [ SynTypeDefnSig(equalsRange = Some mEquals + types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.Simple(repr = SynTypeDefnSimpleRepr.Union _)) ] ) ]) ])) -> @@ -267,7 +267,7 @@ member Meh : unit -> unit | ParsedInput.SigFile (ParsedSigFileInput (modules =[ SynModuleOrNamespaceSig(decls =[ SynModuleSigDecl.Types( types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple _ - withKeyword=Some mWithKeyword) ] + trivia = { WithKeyword = Some mWithKeyword }) ] ) ]) ])) -> assertRange (4, 9) (4, 13) mWithKeyword @@ -425,3 +425,49 @@ type X = assertRange (5, 19) (5, 20) mEquals assertRange (5, 4) (5, 23) mMember | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Trivia is present in SynTypeDefnSig`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh + +type X = + member a : int = 10 + +/// Represents a line number when using zero-based line counting (used by Visual Studio) +#if CHECK_LINE0_TYPES + +#else +type Y = int +#endif + +type Z with + static member P : int -> int +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Types(types = [ + SynTypeDefnSig(trivia = { TypeKeyword = Some mType1 + EqualsRange = Some mEq1 + WithKeyword = None }) ]) + SynModuleSigDecl.Types(types = [ + SynTypeDefnSig(trivia = { TypeKeyword = Some mType2 + EqualsRange = Some mEq2 + WithKeyword = None }) ]) + SynModuleSigDecl.Types(types = [ + SynTypeDefnSig(trivia = { TypeKeyword = Some mType3 + EqualsRange = None + WithKeyword = Some mWith3 }) ]) + ] ) ])) -> + () + assertRange (4, 0) (4, 4) mType1 + assertRange (4, 7) (4, 8) mEq1 + assertRange (11, 0) (11, 4) mType2 + assertRange (11, 7) (11, 8) mEq2 + assertRange (14, 0) (14, 4) mType3 + assertRange (14, 7) (14, 11) mWith3 + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" From 2b36ae0ec0cf0d9a2ec507ce44aee03ee524d43e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 13 Jul 2022 17:02:24 +0100 Subject: [PATCH 041/226] Fix cross-file navigation features when #line is used (#12963) * cleanup * cleanup * cleanup * ignore '#line' in the IDE * more cleanup * fix build * reformat * format code * fix build * add tests * fix build --- src/Compiler/Driver/CompilerConfig.fs | 4 +++ src/Compiler/Driver/CompilerConfig.fsi | 6 ++++ src/Compiler/Driver/CompilerOptions.fs | 1 + src/Compiler/Driver/ParseAndCheckInputs.fs | 10 +++++- src/Compiler/Interactive/fsi.fs | 4 +-- src/Compiler/Service/FSharpCheckerResults.fs | 19 +++++++---- src/Compiler/Service/FSharpCheckerResults.fsi | 32 ++++++++++++----- src/Compiler/Service/ServiceLexing.fs | 24 ++++++++----- src/Compiler/SyntaxTree/LexHelpers.fs | 13 +++++-- src/Compiler/SyntaxTree/LexHelpers.fsi | 3 +- ...erService.SurfaceArea.netstandard.expected | 4 ++- .../HashIfExpression.fs | 7 ++-- .../CompilerServiceBenchmarks/Benchmarks.fs | 1 + tests/service/ProjectAnalysisTests.fs | 34 +++++++++++++++---- .../FSharpProjectOptionsManager.fs | 6 ++++ 15 files changed, 130 insertions(+), 38 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 2786e30e9a3..e406af4bd5c 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -565,6 +565,8 @@ type TcConfigBuilder = mutable noConditionalErasure: bool + mutable applyLineDirectives: bool + mutable pathMap: PathMap mutable langVersion: LanguageVersion @@ -739,6 +741,7 @@ type TcConfigBuilder = internalTestSpanStackReferring = false noConditionalErasure = false pathMap = PathMap.empty + applyLineDirectives = true langVersion = LanguageVersion.Default implicitIncludeDir = implicitIncludeDir defaultFSharpBinariesDir = defaultFSharpBinariesDir @@ -1326,6 +1329,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot member _.internalTestSpanStackReferring = data.internalTestSpanStackReferring member _.noConditionalErasure = data.noConditionalErasure + member _.applyLineDirectives = data.applyLineDirectives member _.xmlDocInfoLoader = data.xmlDocInfoLoader static member Create(builder, validate) = diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index a11f1c6c77d..51a8b7d09cf 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -466,6 +466,9 @@ type TcConfigBuilder = /// Prevent erasure of conditional attributes and methods so tooling is able analyse them. mutable noConditionalErasure: bool + /// Take '#line' into account? Defaults to true + mutable applyLineDirectives: bool + mutable pathMap: PathMap mutable langVersion: LanguageVersion @@ -800,6 +803,9 @@ type TcConfig = /// Prevent erasure of conditional attributes and methods so tooling is able analyse them. member noConditionalErasure: bool + /// Take '#line' into account? Defaults to true + member applyLineDirectives: bool + /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. member internalTestSpanStackReferring: bool diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index b8fbfbe4f91..1059c0ff6bf 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1397,6 +1397,7 @@ let editorSpecificFlags (tcConfigB: TcConfigBuilder) = CompilerOption("exename", tagNone, OptionString(fun s -> tcConfigB.exename <- Some s), None, None) CompilerOption("maxerrors", tagInt, OptionInt(fun n -> tcConfigB.maxErrors <- n), None, None) CompilerOption("noconditionalerasure", tagNone, OptionUnit(fun () -> tcConfigB.noConditionalErasure <- true), None, None) + CompilerOption("ignorelinedirectives", tagNone, OptionUnit(fun () -> tcConfigB.applyLineDirectives <- false), None, None) ] let internalFlags (tcConfigB: TcConfigBuilder) = diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 6d764f264dd..b0c820c6c67 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -563,7 +563,15 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam // Set up the initial lexer arguments let lexargs = - mkLexargs (tcConfig.conditionalDefines, indentationSyntaxStatus, lexResourceManager, [], diagnosticsLogger, tcConfig.pathMap) + mkLexargs ( + tcConfig.conditionalDefines, + indentationSyntaxStatus, + lexResourceManager, + [], + diagnosticsLogger, + tcConfig.pathMap, + tcConfig.applyLineDirectives + ) // Set up the initial lexer arguments let shortFilename = SanitizeFileName fileName tcConfig.implicitIncludeDir diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 5d8966fd9a1..92bcc810a34 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2524,8 +2524,8 @@ type FsiStdinLexerProvider resetLexbufPos sourceFileName lexbuf let skip = true // don't report whitespace from lexer - let defines = tcConfigB.conditionalDefines - let lexargs = mkLexargs (defines, indentationSyntaxStatus, lexResourceManager, [], diagnosticsLogger, PathMap.empty) + let applyLineDirectives = true + let lexargs = mkLexargs (tcConfigB.conditionalDefines, indentationSyntaxStatus, lexResourceManager, [], diagnosticsLogger, PathMap.empty, applyLineDirectives) let tokenizer = LexFilter.LexFilter(indentationSyntaxStatus, tcConfigB.compilingFSharpCore, Lexer.token lexargs skip, lexbuf) tokenizer diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 48649d1835a..6f84923f6c7 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -2035,6 +2035,7 @@ type internal TypeCheckInfo type FSharpParsingOptions = { SourceFiles: string[] + ApplyLineDirectives: bool ConditionalDefines: string list DiagnosticOptions: FSharpDiagnosticOptions LangVersionText: string @@ -2051,6 +2052,7 @@ type FSharpParsingOptions = static member Default = { SourceFiles = Array.empty + ApplyLineDirectives = false ConditionalDefines = [] DiagnosticOptions = FSharpDiagnosticOptions.Default LangVersionText = LanguageVersion.Default.VersionText @@ -2063,6 +2065,7 @@ type FSharpParsingOptions = static member FromTcConfig(tcConfig: TcConfig, sourceFiles, isInteractive: bool) = { SourceFiles = sourceFiles + ApplyLineDirectives = tcConfig.applyLineDirectives ConditionalDefines = tcConfig.conditionalDefines DiagnosticOptions = tcConfig.diagnosticsOptions LangVersionText = tcConfig.langVersion.VersionText @@ -2075,6 +2078,7 @@ type FSharpParsingOptions = static member FromTcConfigBuilder(tcConfigB: TcConfigBuilder, sourceFiles, isInteractive: bool) = { SourceFiles = sourceFiles + ApplyLineDirectives = tcConfigB.applyLineDirectives ConditionalDefines = tcConfigB.conditionalDefines DiagnosticOptions = tcConfigB.diagnosticsOptions LangVersionText = tcConfigB.langVersion.VersionText @@ -2183,12 +2187,15 @@ module internal ParseAndCheckFile = // When analyzing files using ParseOneFile, i.e. for the use of editing clients, we do not apply line directives. // TODO(pathmap): expose PathMap on the service API, and thread it through here let lexargs = - mkLexargs (conditionalDefines, indentationSyntaxStatus, lexResourceManager, [], errHandler.DiagnosticsLogger, PathMap.empty) - - let lexargs = - { lexargs with - applyLineDirectives = false - } + mkLexargs ( + conditionalDefines, + indentationSyntaxStatus, + lexResourceManager, + [], + errHandler.DiagnosticsLogger, + PathMap.empty, + options.ApplyLineDirectives + ) let tokenizer = LexFilter.LexFilter(indentationSyntaxStatus, options.CompilingFSharpCore, Lexer.token lexargs true, lexbuf) diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index dd8a4aee65a..dff418f5438 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -200,14 +200,30 @@ type public FSharpProjectContext = /// Options used to determine active --define conditionals and other options relevant to parsing files in a project type public FSharpParsingOptions = - { SourceFiles: string[] - ConditionalDefines: string list - DiagnosticOptions: FSharpDiagnosticOptions - LangVersionText: string - IsInteractive: bool - IndentationAwareSyntax: bool option - CompilingFSharpCore: bool - IsExe: bool } + { + SourceFiles: string[] + + /// Indicates if the ranges returned by parsing should have '#line' directives applied to them. + /// When compiling code, this should usually be 'true'. For editing tools, this is usually 'false. + /// The default for FSharpParsingOptions.ApplyLineDirectives is 'false'. The default for + /// FSharpParsingOptions arising from FSharpProjectOptions will be 'true' unless '--ignorelinedirectives' is used in the + /// parameters from which these are derived. + ApplyLineDirectives: bool + + ConditionalDefines: string list + + DiagnosticOptions: FSharpDiagnosticOptions + + LangVersionText: string + + IsInteractive: bool + + IndentationAwareSyntax: bool option + + CompilingFSharpCore: bool + + IsExe: bool + } static member Default: FSharpParsingOptions diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 9f14d717af2..ba2490c3f9d 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1183,14 +1183,18 @@ type FSharpSourceTokenizer(conditionalDefines: string list, fileName: string opt let lexResourceManager = LexResourceManager() + let applyLineDirectives = false + let indentationSyntaxStatus = IndentationAwareSyntaxStatus(true, false) + let lexargs = mkLexargs ( conditionalDefines, - IndentationAwareSyntaxStatus(true, false), + indentationSyntaxStatus, lexResourceManager, [], DiscardErrorsLogger, - PathMap.empty + PathMap.empty, + applyLineDirectives ) member _.CreateLineTokenizer(lineText: string) = @@ -1813,14 +1817,18 @@ module FSharpLexerImpl = UnicodeLexing.SourceTextAsLexbuf(reportLibraryOnlyFeatures, langVersion, text) let indentationSyntaxStatus = IndentationAwareSyntaxStatus(isLightSyntaxOn, true) + let applyLineDirectives = isCompiling let lexargs = - mkLexargs (conditionalDefines, indentationSyntaxStatus, LexResourceManager(0), [], diagnosticsLogger, pathMap) - - let lexargs = - { lexargs with - applyLineDirectives = isCompiling - } + mkLexargs ( + conditionalDefines, + indentationSyntaxStatus, + LexResourceManager(0), + [], + diagnosticsLogger, + pathMap, + applyLineDirectives + ) let getNextToken = let lexer = Lexer.token lexargs canSkipTrivia diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index 67f6c78f558..80fc0c21246 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -74,14 +74,23 @@ type LongUnicodeLexResult = | SingleChar of uint16 | Invalid -let mkLexargs (conditionalDefines, indentationSyntaxStatus, resourceManager, ifdefStack, diagnosticsLogger, pathMap: PathMap) = +let mkLexargs + ( + conditionalDefines, + indentationSyntaxStatus, + resourceManager, + ifdefStack, + diagnosticsLogger, + pathMap: PathMap, + applyLineDirectives + ) = { conditionalDefines = conditionalDefines ifdefStack = ifdefStack indentationSyntaxStatus = indentationSyntaxStatus resourceManager = resourceManager diagnosticsLogger = diagnosticsLogger - applyLineDirectives = true + applyLineDirectives = applyLineDirectives stringNest = [] pathMap = pathMap } diff --git a/src/Compiler/SyntaxTree/LexHelpers.fsi b/src/Compiler/SyntaxTree/LexHelpers.fsi index 0f88933dac1..49f73abbabf 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fsi +++ b/src/Compiler/SyntaxTree/LexHelpers.fsi @@ -52,7 +52,8 @@ val mkLexargs: resourceManager: LexResourceManager * ifdefStack: LexerIfdefStack * diagnosticsLogger: DiagnosticsLogger * - pathMap: PathMap -> + pathMap: PathMap * + applyLineDirectives: bool -> LexArgs val reusingLexbufForParsing: Lexbuf -> (unit -> 'a) -> 'a diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 4d2da93bc08..1f16bf7c33c 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2108,7 +2108,9 @@ FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String ToString() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String get_LangVersionText() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String[] SourceFiles FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String[] get_SourceFiles() -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Void .ctor(System.String[], Microsoft.FSharp.Collections.FSharpList`1[System.String], FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions, System.String, Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Boolean, Boolean) +FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean ApplyLineDirectives +FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_ApplyLineDirectives() +FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Void .ctor(System.String[], Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.String], FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions, System.String, Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Boolean, Boolean) FSharp.Compiler.CodeAnalysis.FSharpProjectContext FSharp.Compiler.CodeAnalysis.FSharpProjectContext: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions ProjectOptions FSharp.Compiler.CodeAnalysis.FSharpProjectContext: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions get_ProjectOptions() diff --git a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs index 9af4a412632..0d81eff6cd5 100644 --- a/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs +++ b/tests/FSharp.Compiler.UnitTests/HashIfExpression.fs @@ -57,11 +57,12 @@ type public HashIfExpression() = member _.ErrorCount = errors.Count } - let lightSyntax = IndentationAwareSyntaxStatus(true, false) + let indentationSyntaxStatus = IndentationAwareSyntaxStatus(true, false) let resourceManager = LexResourceManager () - let defines= [] + let defines = [] + let applyLineDirectives = true let startPos = Position.Empty - let args = mkLexargs (defines, lightSyntax, resourceManager, [], diagnosticsLogger, PathMap.empty) + let args = mkLexargs (defines, indentationSyntaxStatus, resourceManager, [], diagnosticsLogger, PathMap.empty, applyLineDirectives) DiagnosticsThreadStatics.DiagnosticsLogger <- diagnosticsLogger diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs index 5b244d4481a..6a48e688b4e 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs @@ -136,6 +136,7 @@ type CompilerService() = DiagnosticOptions = FSharpDiagnosticOptions.Default LangVersionText = "default" IsInteractive = false + ApplyLineDirectives = false IndentationAwareSyntax = None CompilingFSharpCore = false IsExe = false diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 3318cf40cf4..d552caf10aa 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5333,7 +5333,7 @@ let x = (1 = 3.0) let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) [] -let ``Test line directives in foreground analysis`` () = // see https://github.com/dotnet/fsharp/issues/3317 +let ``Test diagnostics with line directives active`` () = // In background analysis and normal compiler checking, the errors are reported w.r.t. the line directives let wholeProjectResults = checker.ParseAndCheckProject(ProjectLineDirectives.options) |> Async.RunImmediate @@ -5342,17 +5342,39 @@ let ``Test line directives in foreground analysis`` () = // see https://github.c [ for e in wholeProjectResults.Diagnostics -> e.Range.StartLine, e.Range.EndLine, e.Range.FileName ] |> shouldEqual [(10, 10, "Test.fsy")] - // In foreground analysis routines, used by visual editing tools, the errors are reported w.r.t. the source - // file, which is assumed to be in the editor, not the other files referred to by line directives. - let checkResults1 = + let checkResults = checker.ParseAndCheckFileInProject(ProjectLineDirectives.fileName1, 0, ProjectLineDirectives.fileSource1, ProjectLineDirectives.options) |> Async.RunImmediate |> function _,FSharpCheckFileAnswer.Succeeded x -> x | _ -> failwith "unexpected aborted" - for e in checkResults1.Diagnostics do + for e in checkResults.Diagnostics do printfn "ProjectLineDirectives checkResults1 error file: <<<%s>>>" e.Range.FileName - [ for e in checkResults1.Diagnostics -> e.Range.StartLine, e.Range.EndLine, e.Range.FileName ] |> shouldEqual [(5, 5, ProjectLineDirectives.fileName1)] + // No diagnostics for logical location "Test.fsy" are reported when checking the source since the filenames don't match. You need to pass --ignorelinedirectives to get them + [ for e in checkResults.Diagnostics -> e.Range.StartLine, e.Range.EndLine, e.Range.FileName ] |> shouldEqual [ ] + +[] +let ``Test diagnostics with line directives ignored`` () = + + // If you pass hidden IDE flag --ignorelinedirectives, the diagnostics are reported w.r.t. the source + // file, not the files referred to by line directives. + let options = { ProjectLineDirectives.options with OtherOptions = (Array.append ProjectLineDirectives.options.OtherOptions [| "--ignorelinedirectives" |]) } + + let wholeProjectResults = checker.ParseAndCheckProject(options) |> Async.RunImmediate + for e in wholeProjectResults.Diagnostics do + printfn "ProjectLineDirectives wholeProjectResults error file: <<<%s>>>" e.Range.FileName + + [ for e in wholeProjectResults.Diagnostics -> e.Range.StartLine, e.Range.EndLine, e.Range.FileName ] |> shouldEqual [(5, 5, ProjectLineDirectives.fileName1)] + + let checkResults = + checker.ParseAndCheckFileInProject(ProjectLineDirectives.fileName1, 0, ProjectLineDirectives.fileSource1, options) + |> Async.RunImmediate + |> function _,FSharpCheckFileAnswer.Succeeded x -> x | _ -> failwith "unexpected aborted" + + for e in checkResults.Diagnostics do + printfn "ProjectLineDirectives checkResults error file: <<<%s>>>" e.Range.FileName + + [ for e in checkResults.Diagnostics -> e.Range.StartLine, e.Range.EndLine, e.Range.FileName ] |> shouldEqual [(5, 5, ProjectLineDirectives.fileName1)] //------------------------------------------------------ diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index cb8c6e71b82..53dbbad2338 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -289,6 +289,11 @@ type private FSharpProjectOptionsReactor (checker: FSharpChecker) = for x in project.ProjectReferences do "-r:" + project.Solution.GetProject(x.ProjectId).OutputFilePath + // In the IDE we always ignore all #line directives for all purposes. This means + // IDE features work correctly within generated source files, but diagnostics are + // reported in the IDE with respect to the generated source, and will not unify with + // diagnostics from the build. + "--ignorelinedirectives" |] let! ver = project.GetDependentVersionAsync(ct) |> Async.AwaitTask @@ -509,6 +514,7 @@ type internal FSharpProjectOptionsManager | Some (_, parsingOptions, _) -> parsingOptions | _ -> { FSharpParsingOptions.Default with + ApplyLineDirectives = false IsInteractive = CompilerEnvironment.IsScriptFile document.Name } CompilerEnvironment.GetConditionalDefinesForEditing parsingOptions From 6265ca8b6e6f8585b909af36c654772049a74497 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 13 Jul 2022 09:03:35 -0700 Subject: [PATCH 042/226] Yeet desktop pdbs (#13448) * Yeet desktop pdbs * remove extra xlfs --- FSharp.Profiles.props | 3 - src/Compiler/AbstractIL/il.fs | 2 +- src/Compiler/AbstractIL/il.fsi | 23 +- src/Compiler/AbstractIL/ilread.fs | 248 ++------ src/Compiler/AbstractIL/ilreflect.fs | 5 - src/Compiler/AbstractIL/ilsupp.fs | 542 ------------------ src/Compiler/AbstractIL/ilsupp.fsi | 85 --- src/Compiler/AbstractIL/ilwrite.fs | 52 +- src/Compiler/AbstractIL/ilwritepdb.fs | 267 --------- src/Compiler/AbstractIL/ilwritepdb.fsi | 9 - src/Compiler/Driver/CompilerConfig.fs | 9 - src/Compiler/Driver/CompilerConfig.fsi | 4 - src/Compiler/Driver/CompilerOptions.fs | 37 +- src/Compiler/Driver/CreateILModule.fs | 8 +- src/Compiler/Driver/fsc.fs | 14 - src/Compiler/FSComp.txt | 8 +- src/Compiler/TypedTree/TcGlobals.fs | 3 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 40 +- src/Compiler/xlf/FSComp.txt.de.xlf | 40 +- src/Compiler/xlf/FSComp.txt.es.xlf | 40 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 40 +- src/Compiler/xlf/FSComp.txt.it.xlf | 40 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 40 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 40 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 40 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 40 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 40 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 40 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 40 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 40 +- .../Source/CompilerOptions/fsc/pdb/env.lst | 6 - .../Source/CompilerOptions/fsc/pdb/pdb04.fs | 3 +- .../Source/CompilerOptions/fsc/pdb/pdb05.fs | 4 - .../NodeProperties.cs | 7 +- 34 files changed, 153 insertions(+), 1706 deletions(-) delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb05.fs diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 260bccd3bf9..00d4e745892 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -14,9 +14,6 @@ $(DefineConstants);NETSTANDARD $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_CORHOST_SIGNER - $(DefineConstants);FX_NO_PDB_READER - $(DefineConstants);FX_NO_PDB_WRITER - $(DefineConstants);FX_NO_SYMBOLSTORE $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 3600b0e2cf4..2321a26bf05 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -4207,7 +4207,7 @@ let mkILSimpleModule AssemblyLongevity = ILAssemblyLongevity.Unspecified DisableJitOptimizations = 0 <> (flags &&& 0x4000) JitTracking = (0 <> (flags &&& 0x8000)) // always turn these on - IgnoreSymbolStoreSequencePoints = (0 <> (flags &&& 0x2000)) + IgnoreSymbolStoreSequencePoints = false Retargetable = (0 <> (flags &&& 0x100)) ExportedTypes = exportedTypes EntrypointElsewhere = None diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 55c713968e2..12067f8911c 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -783,20 +783,14 @@ type ILDebugImports = /// IL method bodies [] type internal ILMethodBody = - { - IsZeroInit: bool - MaxStack: int32 - NoInlining: bool - AggressiveInlining: bool - Locals: ILLocals - Code: ILCode - - /// Indicates the entire range of the method. Emitted for full PDB but not currently for portable PDB. - /// Additionally, if the range is not set, then no debug points are emitted. - DebugRange: ILDebugPoint option - - DebugImports: ILDebugImports option - } + { IsZeroInit: bool + MaxStack: int32 + NoInlining: bool + AggressiveInlining: bool + Locals: ILLocals + Code: ILCode + DebugRange: ILDebugPoint option + DebugImports: ILDebugImports option } /// Member Access [] @@ -1695,7 +1689,6 @@ type ILAssemblyManifest = JitTracking: bool IgnoreSymbolStoreSequencePoints: bool - Retargetable: bool /// Records the types implemented by this assembly in auxiliary diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 6ec589b3115..3324ec1c423 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1118,11 +1118,6 @@ type VarArgMethodData = type PEReader = { fileName: string -#if FX_NO_PDB_READER - pdb: obj option -#else - pdb: (PdbReader * (string -> ILSourceDocument)) option -#endif entryPointToken: TableName * int pefile: BinaryFile textSegmentPhysicalLoc: int32 @@ -1968,7 +1963,7 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx = Retargetable = 0 <> (flags &&& 0x100) DisableJitOptimizations = 0 <> (flags &&& 0x4000) JitTracking = 0 <> (flags &&& 0x8000) - IgnoreSymbolStoreSequencePoints = 0 <> (flags &&& 0x2000) + IgnoreSymbolStoreSequencePoints = false } and seekReadAssemblyRef (ctxt: ILMetadataReader) idx = ctxt.seekReadAssemblyRef idx @@ -2927,7 +2922,7 @@ and seekReadMethod (ctxt: ILMetadataReader) mdv numTypars (idx: int) = else match ctxt.pectxtCaptured with | None -> methBodyNotAvailable - | Some pectxt -> seekReadMethodRVA pectxt ctxt (idx, nm, internalcall, noinline, aggressiveinline, numTypars) codeRVA + | Some pectxt -> seekReadMethodRVA pectxt ctxt (nm, noinline, aggressiveinline, numTypars) codeRVA ILMethodDef( name = nm, @@ -3359,7 +3354,7 @@ and seekReadImplMap (ctxt: ILMetadataReader) nm midx = } ) -and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start seqpoints = +and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start = let labelsOfRawOffsets = Dictionary<_, _>(sz / 2) let ilOffsetsOfLabels = Dictionary<_, _>(sz / 2) @@ -3403,7 +3398,7 @@ and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start s else lastb - let mutable seqPointsRemaining = seqpoints + let mutable seqPointsRemaining = [] while curr < sz do // registering "+string !curr+" as start of an instruction") @@ -3646,36 +3641,11 @@ and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numTypars (sz: int) start s markAsInstructionStart curr ibuf.Count // Build the function that maps from raw labels (offsets into the bytecode stream) to indexes in the AbsIL instruction stream let lab2pc = ilOffsetsOfLabels - - // Some offsets used in debug info refer to the end of an instruction, rather than the - // start of the subsequent instruction. But all labels refer to instruction starts, - // apart from a final label which refers to the end of the method. This function finds - // the start of the next instruction referred to by the raw offset. - let raw2nextLab rawOffset = - let isInstrStart x = - match labelsOfRawOffsets.TryGetValue x with - | true, lab -> ilOffsetsOfLabels.ContainsKey lab - | _ -> false - - if isInstrStart rawOffset then - rawToLabel rawOffset - elif isInstrStart (rawOffset + 1) then - rawToLabel (rawOffset + 1) - else - failwith ( - "the bytecode raw offset " - + string rawOffset - + " did not refer either to the start or end of an instruction" - ) - let instrs = ibuf.ToArray() - instrs, rawToLabel, lab2pc, raw2nextLab -#if FX_NO_PDB_READER -and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (_idx, nm, _internalcall, noinline, aggressiveinline, numTypars) rva = -#else -and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _internalcall, noinline, aggressiveinline, numTypars) rva = -#endif + instrs, rawToLabel, lab2pc + +and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (nm, noinline, aggressiveinline, numTypars) rva = lazy let pev = pectxt.pefile.GetView() let baseRVA = pectxt.anyV2P ("method rva", rva) @@ -3701,91 +3671,14 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int // -- a list of locals, marked with the raw offsets (actually closures which accept the resolution function that maps raw offsets to labels) // -- an overall range for the method // -- the sequence points for the method - let localPdbInfos, methRangePdbInfo, seqpoints = -#if FX_NO_PDB_READER - [], None, [] -#else - match pectxt.pdb with - | None -> [], None, [] - | Some (pdbr, get_doc) -> - try - - let pdbm = pdbReaderGetMethod pdbr (uncodedToken TableNames.Method idx) - let sps = pdbMethodGetDebugPoints pdbm - (* let roota, rootb = pdbScopeGetOffsets rootScope in *) - let seqpoints = - let arr = - sps - |> Array.map (fun sp -> - // It is VERY annoying to have to call GetURL for the document for - // each sequence point. This appears to be a short coming of the PDB - // reader API. They should return an index into the array of documents for the reader - let sourcedoc = get_doc (pdbDocumentGetURL sp.pdbSeqPointDocument) - - let source = - ILDebugPoint.Create( - document = sourcedoc, - line = sp.pdbSeqPointLine, - column = sp.pdbSeqPointColumn, - endLine = sp.pdbSeqPointEndLine, - endColumn = sp.pdbSeqPointEndColumn - ) - - (sp.pdbSeqPointOffset, source)) - - Array.sortInPlaceBy fst arr - - Array.toList arr - - let rec scopes scp = - let a, b = pdbScopeGetOffsets scp - let lvs = pdbScopeGetLocals scp - - let ilvs = - lvs - |> Array.toList - |> List.filter (fun l -> - let k, _idx = pdbVariableGetAddressAttributes l - k = 1 (* ADDR_IL_OFFSET *) ) - - let ilinfos: ILLocalDebugMapping list = - ilvs - |> List.map (fun ilv -> - let _k, idx = pdbVariableGetAddressAttributes ilv - let n = pdbVariableGetName ilv - { LocalIndex = idx; LocalName = n }) - - let thisOne = - (fun raw2nextLab -> - { - Range = (raw2nextLab a, raw2nextLab b) - DebugMappings = ilinfos - }: ILLocalDebugInfo) - - let others = - List.foldBack (scopes >> (@)) (Array.toList (pdbScopeGetChildren scp)) [] - - thisOne :: others - - let localPdbInfos = - [] (* scopes fail for mscorlib scopes rootScope *) - // REVIEW: look through sps to get ranges? Use GetRanges?? Change AbsIL?? - (localPdbInfos, None, seqpoints) - with e -> - // "* Warning: PDB info for method "+nm+" could not be read and will be ignored: "+e.Message - [], None, [] -#endif - if isTinyFormat then let codeBase = baseRVA + 1 let codeSize = (int32 b >>>& 2) // tiny format for "+nm+", code size = " + string codeSize) - let instrs, _, lab2pc, raw2nextLab = - seekReadTopCode ctxt pev mdv numTypars codeSize codeBase seqpoints + let instrs, _, lab2pc = seekReadTopCode ctxt pev mdv numTypars codeSize codeBase // Convert the linear code format to the nested code format - let localPdbInfos2 = List.map (fun f -> f raw2nextLab) localPdbInfos - let code = buildILCode nm lab2pc instrs [] localPdbInfos2 + let code = buildILCode nm lab2pc instrs [] [] { IsZeroInit = false @@ -3794,7 +3687,7 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int AggressiveInlining = aggressiveinline Locals = List.empty Code = code - DebugRange = methRangePdbInfo + DebugRange = None DebugImports = None } @@ -3818,8 +3711,8 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int // fat format for "+nm+", code size = " + string codeSize+", hasMoreSections = "+(if hasMoreSections then "true" else "false")+", b = "+string b) // Read the method body - let instrs, rawToLabel, lab2pc, raw2nextLab = - seekReadTopCode ctxt pev mdv numTypars codeSize codeBase seqpoints + let instrs, rawToLabel, lab2pc = + seekReadTopCode ctxt pev mdv numTypars codeSize codeBase // Read all the sections that follow the method body. // These contain the exception clauses. @@ -3930,16 +3823,7 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int moreSections <- (sectionFlag &&& e_CorILMethod_Sect_MoreSects) <> 0x0uy nextSectionBase <- sectionBase + sectionSize - // Convert the linear code format to the nested code format - if logging then - dprintn "doing localPdbInfos2" - - let localPdbInfos2 = List.map (fun f -> f raw2nextLab) localPdbInfos - - if logging then - dprintn "done localPdbInfos2, checking code..." - - let code = buildILCode nm lab2pc instrs seh localPdbInfos2 + let code = buildILCode nm lab2pc instrs seh [] if logging then dprintn "done checking code." @@ -3951,7 +3835,7 @@ and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _int AggressiveInlining = aggressiveinline Locals = locals Code = code - DebugRange = methRangePdbInfo + DebugRange = None DebugImports = None } ) @@ -4159,40 +4043,6 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) = ] ) -#if !FX_NO_PDB_READER -let getPdbReader pdbDirPath fileName = - match pdbDirPath with - | None -> None - | Some pdbpath -> - try - let pdbr = pdbReadOpen fileName pdbpath - let pdbdocs = pdbReaderGetDocuments pdbr - - let tab = new Dictionary<_, _>(Array.length pdbdocs) - - pdbdocs - |> Array.iter (fun pdbdoc -> - let url = pdbDocumentGetURL pdbdoc - - tab.[url] <- - ILSourceDocument.Create( - language = Some(pdbDocumentGetLanguage pdbdoc), - vendor = Some(pdbDocumentGetLanguageVendor pdbdoc), - documentType = Some(pdbDocumentGetType pdbdoc), - file = url - )) - - let docfun url = - match tab.TryGetValue url with - | true, doc -> doc - | _ -> failwith ("Document with URL " + url + " not found in list of documents in the PDB file") - - Some(pdbr, docfun) - with e -> - dprintn ("* Warning: PDB file could not be read and will be ignored: " + e.Message) - None -#endif - // Note, pectxtEager and pevEager must not be captured by the results of this function let openMetadataReader ( @@ -4677,7 +4527,7 @@ let openMetadataReader // read of the AbsIL module. // ---------------------------------------------------------------------- -let openPEFileReader (fileName, pefile: BinaryFile, pdbDirPath, noFileOnDisk) = +let openPEFileReader (fileName, pefile: BinaryFile, noFileOnDisk) = let pev = pefile.GetView() (* MSDOS HEADER *) let peSignaturePhysLoc = seekReadInt32 pev 0x3c @@ -4943,24 +4793,9 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbDirPath, noFileOnDisk) = dprintn (fileName + ": nativeResourcesSize = " + string nativeResourcesSize) let metadataPhysLoc = anyV2P ("metadata", metadataAddr) - //----------------------------------------------------------------------- - // Set up the PDB reader so we can read debug info for methods. - // ---------------------------------------------------------------------- -#if FX_NO_PDB_READER - let pdb = - ignore pdbDirPath - None -#else - let pdb = - if runningOnMono then - None - else - getPdbReader pdbDirPath fileName -#endif let pectxt: PEReader = { - pdb = pdb textSegmentPhysicalLoc = textSegmentPhysicalLoc textSegmentPhysicalSize = textSegmentPhysicalSize dataSegmentPhysicalLoc = dataSegmentPhysicalLoc @@ -4993,30 +4828,20 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbDirPath, noFileOnDisk) = alignPhys, imageBaseReal) - (metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb) + (metadataPhysLoc, metadataSize, peinfo, pectxt, pev) -let openPE (fileName, pefile, pdbDirPath, reduceMemoryUsage, noFileOnDisk) = - let metadataPhysLoc, _metadataSize, peinfo, pectxt, pev, pdb = - openPEFileReader (fileName, pefile, pdbDirPath, noFileOnDisk) +let openPE (fileName, pefile, reduceMemoryUsage, noFileOnDisk) = + let metadataPhysLoc, _metadataSize, peinfo, pectxt, pev = + openPEFileReader (fileName, pefile, noFileOnDisk) let ilModule, ilAssemblyRefs = openMetadataReader (fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage) - ilModule, ilAssemblyRefs, pdb + ilModule, ilAssemblyRefs let openPEMetadataOnly (fileName, peinfo, pectxtEager, pevEager, mdfile: BinaryFile, reduceMemoryUsage) = openMetadataReader (fileName, mdfile, 0, peinfo, pectxtEager, pevEager, None, reduceMemoryUsage) -let ClosePdbReader pdb = -#if FX_NO_PDB_READER - ignore pdb - () -#else - match pdb with - | Some (pdbr, _) -> pdbReadClose pdbr - | None -> () -#endif - type ILReaderMetadataSnapshot = obj * nativeint * int type ILReaderTryGetMetadataSnapshot = (* path: *) string (* snapshotTimeStamp: *) * DateTime -> ILReaderMetadataSnapshot option @@ -5046,11 +4871,11 @@ type ILModuleReader = inherit IDisposable [] -type ILModuleReaderImpl(ilModule: ILModuleDef, ilAssemblyRefs: Lazy, dispose: unit -> unit) = +type ILModuleReaderImpl(ilModule: ILModuleDef, ilAssemblyRefs: Lazy) = interface ILModuleReader with member x.ILModuleDef = ilModule member x.ILAssemblyRefs = ilAssemblyRefs.Force() - member x.Dispose() = dispose () + member x.Dispose() = () // ++GLOBAL MUTABLE STATE (concurrency safe via locking) type ILModuleReaderCacheKey = ILModuleReaderCacheKey of string * DateTime * bool * ReduceMemoryFlag * MetadataOnlyFlag @@ -5120,10 +4945,10 @@ let getBinaryFile fileName useMemoryMappedFile = let OpenILModuleReaderFromBytes fileName assemblyContents options = let pefile = ByteFile(fileName, assemblyContents) :> BinaryFile - let ilModule, ilAssemblyRefs, pdb = - openPE (fileName, pefile, options.pdbDirPath, (options.reduceMemoryUsage = ReduceMemoryFlag.Yes), true) + let ilModule, ilAssemblyRefs = + openPE (fileName, pefile, (options.reduceMemoryUsage = ReduceMemoryFlag.Yes), true) - new ILModuleReaderImpl(ilModule, ilAssemblyRefs, (fun () -> ClosePdbReader pdb)) :> ILModuleReader + new ILModuleReaderImpl(ilModule, ilAssemblyRefs) :> ILModuleReader let OpenILModuleReaderFromStream fileName (peStream: Stream) options = let peReader = @@ -5131,10 +4956,10 @@ let OpenILModuleReaderFromStream fileName (peStream: Stream) options = let pefile = PEFile(fileName, peReader) :> BinaryFile - let ilModule, ilAssemblyRefs, pdb = - openPE (fileName, pefile, options.pdbDirPath, (options.reduceMemoryUsage = ReduceMemoryFlag.Yes), true) + let ilModule, ilAssemblyRefs = + openPE (fileName, pefile, (options.reduceMemoryUsage = ReduceMemoryFlag.Yes), true) - new ILModuleReaderImpl(ilModule, ilAssemblyRefs, (fun () -> ClosePdbReader pdb)) :> ILModuleReader + new ILModuleReaderImpl(ilModule, ilAssemblyRefs) :> ILModuleReader let ClearAllILModuleReaderCache () = ilModuleReaderCache1.Clear(ILModuleReaderCache1LockToken()) @@ -5211,8 +5036,8 @@ let OpenILModuleReader fileName opts = let disposer, pefileEager = getBinaryFile fullPath false use _disposer = disposer - let metadataPhysLoc, metadataSize, peinfo, pectxtEager, pevEager, _pdb = - openPEFileReader (fullPath, pefileEager, None, false) + let metadataPhysLoc, metadataSize, peinfo, pectxtEager, pevEager = + openPEFileReader (fullPath, pefileEager, false) let mdfile = match mdfileOpt with @@ -5224,16 +5049,15 @@ let OpenILModuleReader fileName opts = let ilModule, ilAssemblyRefs = openPEMetadataOnly (fullPath, peinfo, pectxtEager, pevEager, mdfile, reduceMemoryUsage) - new ILModuleReaderImpl(ilModule, ilAssemblyRefs, ignore) + new ILModuleReaderImpl(ilModule, ilAssemblyRefs) else // If we are not doing metadata-only, then just go ahead and read all the bytes and hold them either strongly or weakly // depending on the heuristic let pefile = createByteFileChunk opts fullPath None - let ilModule, ilAssemblyRefs, _pdb = - openPE (fullPath, pefile, None, reduceMemoryUsage, false) + let ilModule, ilAssemblyRefs = openPE (fullPath, pefile, reduceMemoryUsage, false) - new ILModuleReaderImpl(ilModule, ilAssemblyRefs, ignore) + new ILModuleReaderImpl(ilModule, ilAssemblyRefs) let ilModuleReader = ilModuleReader :> ILModuleReader @@ -5261,11 +5085,9 @@ let OpenILModuleReader fileName opts = else createByteFileChunk opts fullPath None - let ilModule, ilAssemblyRefs, pdb = - openPE (fullPath, pefile, opts.pdbDirPath, reduceMemoryUsage, false) + let ilModule, ilAssemblyRefs = openPE (fullPath, pefile, reduceMemoryUsage, false) - let ilModuleReader = - new ILModuleReaderImpl(ilModule, ilAssemblyRefs, (fun () -> ClosePdbReader pdb)) + let ilModuleReader = new ILModuleReaderImpl(ilModule, ilAssemblyRefs) let ilModuleReader = ilModuleReader :> ILModuleReader diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index a37fa6b1ae0..dee8045ad08 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -1813,11 +1813,6 @@ let emitCode cenv modB emEnv (ilG: ILGenerator) (code: ILCode) = let emitLocal cenv emEnv (ilG: ILGenerator) (local: ILLocal) = let ty = convType cenv emEnv local.Type let locBuilder = ilG.DeclareLocalAndLog(ty, local.IsPinned) -#if !FX_NO_PDB_WRITER - match local.DebugInfo with - | Some (nm, start, finish) -> locBuilder.SetLocalSymInfo(nm, start, finish) - | None -> () -#endif locBuilder let emitILMethodBody cenv modB emEnv (ilG: ILGenerator) (ilmbody: ILMethodBody) = diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index fea9a764487..272f7b74029 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -5,15 +5,10 @@ module internal FSharp.Compiler.AbstractIL.Support open System open System.IO open System.Reflection -#if !FX_NO_SYMBOLSTORE -open System.Diagnostics.SymbolStore -#endif open System.Runtime.InteropServices open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.NativeRes open FSharp.Compiler.IO -#if FX_NO_CORHOST_SIGNER -#endif let DateTime1970Jan01 = DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc) (* ECMA Spec (Oct2002), Part II, 24.2.2 PE File Header. *) @@ -771,540 +766,3 @@ let unlinkResource (ulLinkedResourceBaseRVA: int32) (pbLinkedResource: byte[]) = .Save(ulLinkedResourceBaseRVA, pbLinkedResource, pResBuffer, resBufferOffset) pResBuffer - -#if !FX_NO_PDB_WRITER -// PDB Writing - -[] -[] -type IMetaDataDispenser = - abstract DefineScope: unit -> unit // need this here to fill the first vtable slot - - abstract OpenScope: - [] szScope: string * - [] dwOpenFlags: Int32 * - [] riid: System.Guid byref * - [] punk: Object byref -> - unit - -[] -[] -[] -type IMetadataImport = - abstract Placeholder: unit -> unit - -[] -[] -[] -type IMetadataEmit = - abstract Placeholder: unit -> unit - -[] -[] -[] -type ISymUnmanagedDocumentWriter = - abstract SetSource: sourceSize: int * [] source: byte[] -> unit - abstract SetCheckSum: algorithmId: System.Guid * checkSumSize: int * [] checkSum: byte[] -> unit - -// Struct used to retrieve info on the debug output -[] -type ImageDebugDirectory = - val Characteristics: int32 - val TimeDateStamp: int32 - val MajorVersion: int16 - val MinorVersion: int16 - val Type: int32 - val SizeOfData: int32 - val AddressOfRawData: int32 - val PointerToRawData: int32 - -[] -[] -type ISymUnmanagedWriter2 = - abstract DefineDocument: - [] url: string * - language: System.Guid byref * - languageVendor: System.Guid byref * - documentType: System.Guid byref * - [] RetVal: ISymUnmanagedDocumentWriter byref -> - unit - - abstract SetUserEntryPoint: entryMethod: uint32 -> unit - abstract OpenMethod: meth: int -> unit - abstract CloseMethod: unit -> unit - abstract OpenScope: startOffset: int * pRetVal: int byref -> unit - abstract CloseScope: endOffset: int -> unit - abstract SetScopeRange: scopeID: int * startOffset: int * endOffset: int -> unit - - abstract DefineLocalVariable: - [] varName: string * - attributes: int * - cSig: int * - [] signature: byte[] * - addressKind: int * - addr1: int * - addr2: int * - addr3: int * - startOffset: int * - endOffset: int -> - unit - - abstract DefineParameter: - [] paramName: string * - attributes: int * - sequence: int * - addressKind: int * - addr1: int * - addr2: int * - addr3: int -> - unit - - abstract DefineField: - parent: int * - [] fieldName: string * - attributes: int * - cSig: int * - [] signature: byte[] * - addressKind: int * - addr1: int * - addr2: int * - addr3: int -> - unit - - abstract DefineGlobalVariable: - [] globalVarName: string * - attributes: int * - cSig: int * - [] signature: byte[] * - addressKind: int * - addr1: int * - addr2: int * - addr3: int -> - unit - - abstract Close: unit -> unit - - abstract SetSymAttribute: - parent: int * - [] attName: string * - cData: int * - [] data: byte[] -> - unit - - abstract OpenNamespace: [] nsname: string -> unit - abstract CloseNamespace: unit -> unit - abstract UsingNamespace: [] fullName: string -> unit - - abstract SetMethodSourceRange: - startDoc: ISymUnmanagedDocumentWriter * - startLine: int * - startColumn: int * - endDoc: ISymUnmanagedDocumentWriter * - endLine: int * - endColumn: int -> - unit - - abstract Initialize: - emitter: nativeint * [] fileName: string * stream: IStream * fullBuild: bool -> unit - - abstract GetDebugInfo: - iDD: ImageDebugDirectory byref * - cData: int * - pcData: int byref * - [] data: byte[] -> - unit - - abstract DefineSequencePoints: - document: ISymUnmanagedDocumentWriter * - spCount: int * - [] offsets: int[] * - [] lines: int[] * - [] columns: int[] * - [] endLines: int[] * - [] endColumns: int[] -> - unit - - abstract RemapToken: oldToken: int * newToken: int -> unit - - abstract Initialize2: - emitter: nativeint * - [] tempFileName: string * - stream: IStream * - fullBuild: bool * - [] finalFileName: string -> - unit - - abstract DefineConstant: - [] constName: string * - value: Object * - cSig: int * - [] signature: byte[] -> - unit - - abstract Abort: unit -> unit - - abstract DefineLocalVariable2: - [] localVarName2: string * - attributes: int * - sigToken: int * - addressKind: int * - addr1: int * - addr2: int * - addr3: int * - startOffset: int * - endOffset: int -> - unit - - abstract DefineGlobalVariable2: - [] globalVarName2: string * - attributes: int * - sigToken: int * - addressKind: int * - addr1: int * - addr2: int * - addr3: int -> - unit - - abstract DefineConstant2: [] constantName2: string * value: Object * sigToken: int -> unit - abstract OpenMethod2: method2: int * isect: int * offset: int -> unit - -type PdbWriter = { symWriter: ISymUnmanagedWriter2 } - -type PdbDocumentWriter = - { - symDocWriter: ISymUnmanagedDocumentWriter - } (* pointer to pDocumentWriter COM object *) - -type idd = - { - iddCharacteristics: int32 - iddMajorVersion: int32 (* actually u16 in IMAGE_DEBUG_DIRECTORY *) - iddMinorVersion: int32 (* actually u16 in IMAGE_DEBUG_DIRECTORY *) - iddType: int32 - iddData: byte[] - } -#endif - -#if !FX_NO_PDB_WRITER -let pdbInitialize (binaryName: string) (pdbName: string) = - // collect necessary COM types - let CorMetaDataDispenser = - System.Type.GetTypeFromProgID("CLRMetaData.CorMetaDataDispenser") - - // get the importer pointer - let mdd = - System.Activator.CreateInstance(CorMetaDataDispenser) :?> IMetaDataDispenser - - let mutable IID_IMetaDataEmit = new Guid("BA3FEE4C-ECB9-4E41-83B7-183FA41CD859") - let mutable o = Object() - mdd.OpenScope(binaryName, 0x1, &IID_IMetaDataEmit, &o) // 0x1 = ofWrite - let emitterPtr = Marshal.GetComInterfaceForObject(o, typeof) - - let writer = - try - let writer = - Activator.CreateInstance(System.Type.GetTypeFromProgID("CorSymWriter_SxS")) :?> ISymUnmanagedWriter2 - - writer.Initialize(emitterPtr, pdbName, Unchecked.defaultof, true) - writer - finally - // Marshal.GetComInterfaceForObject adds an extra ref for emitterPtr - if IntPtr.Zero <> emitterPtr then - Marshal.Release emitterPtr |> ignore - - { symWriter = writer } - -let pdbCloseDocument (documentWriter: PdbDocumentWriter) = - Marshal.ReleaseComObject(documentWriter.symDocWriter) |> ignore - -let pdbClose (writer: PdbWriter) dllFilename pdbFilename = - writer.symWriter.Close() - - // CorSymWriter objects (ISymUnmanagedWriter) lock the files they're operating - // on (both the pdb and the binary). The locks are released only when their ref - // count reaches zero, but since we're dealing with RCWs, there's no telling when - // that will be. The result is that sometimes, the pdb and object files will - // still be locked well after the call to this function. - // The SymReader class gets around this problem by implementing the ISymUnmanagedDispose - // interface, which the SymWriter class, unfortunately, does not. - // Right now, take the same approach as mdbg, and manually forcing a collection. - let rc = Marshal.ReleaseComObject(writer.symWriter) - - for i = 0 to (rc - 1) do - Marshal.ReleaseComObject(writer.symWriter) |> ignore - - let isLocked fileName = - try - use _holder = - FileSystem.OpenFileForWriteShim(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None) - - false - with _ -> - true - - let mutable attempts = 0 - - while (isLocked dllFilename || isLocked pdbFilename) && attempts < 3 do - // Need to induce two full collections for finalizers to run - System.GC.Collect() - System.GC.Collect() - System.GC.WaitForPendingFinalizers() - attempts <- attempts + 1 - -let pdbSetUserEntryPoint (writer: PdbWriter) (entryMethodToken: int32) = - writer.symWriter.SetUserEntryPoint((uint32) entryMethodToken) - -// Document checksum algorithms - -let guidSourceHashMD5 = - System.Guid(0x406ea660u, 0x64cfus, 0x4c82us, 0xb6uy, 0xf0uy, 0x42uy, 0xd4uy, 0x81uy, 0x72uy, 0xa7uy, 0x99uy) //406ea660-64cf-4c82-b6f0-42d48172a799 - -let hashSizeOfMD5 = 16 - -// If the FIPS algorithm policy is enabled on the computer (e.g., for US government employees and contractors) -// then obtaining the MD5 implementation in BCL will throw. -// In this case, catch the failure, and not set a checksum. -let internal setCheckSum (url: string, writer: ISymUnmanagedDocumentWriter) = - try - use file = FileSystem.OpenFileForReadShim(url) - use md5 = System.Security.Cryptography.MD5.Create() - let checkSum = md5.ComputeHash file - - if (checkSum.Length = hashSizeOfMD5) then - writer.SetCheckSum(guidSourceHashMD5, hashSizeOfMD5, checkSum) - with _ -> - () - -let pdbDefineDocument (writer: PdbWriter) (url: string) = - //3F5162F8-07C6-11D3-9053-00C04FA302A1 - //let mutable corSymLanguageTypeCSharp = System.Guid(0x3F5162F8u, 0x07C6us, 0x11D3us, 0x90uy, 0x53uy, 0x00uy, 0xC0uy, 0x4Fuy, 0xA3uy, 0x02uy, 0xA1uy) - let mutable corSymLanguageTypeFSharp = - System.Guid(0xAB4F38C9u, 0xB6E6us, 0x43baus, 0xBEuy, 0x3Buy, 0x58uy, 0x08uy, 0x0Buy, 0x2Cuy, 0xCCuy, 0xE3uy) - - let mutable corSymLanguageVendorMicrosoft = - System.Guid(0x994b45c4u, 0xe6e9us, 0x11d2us, 0x90uy, 0x3fuy, 0x00uy, 0xc0uy, 0x4fuy, 0xa3uy, 0x02uy, 0xa1uy) - - let mutable corSymDocumentTypeText = - System.Guid(0x5a869d0bu, 0x6611us, 0x11d3us, 0xbduy, 0x2auy, 0x0uy, 0x0uy, 0xf8uy, 0x8uy, 0x49uy, 0xbduy) - - let mutable docWriter = Unchecked.defaultof - writer.symWriter.DefineDocument(url, &corSymLanguageTypeFSharp, &corSymLanguageVendorMicrosoft, &corSymDocumentTypeText, &docWriter) - setCheckSum (url, docWriter) - { symDocWriter = docWriter } - -let pdbOpenMethod (writer: PdbWriter) (methodToken: int32) = writer.symWriter.OpenMethod methodToken - -let pdbCloseMethod (writer: PdbWriter) = writer.symWriter.CloseMethod() - -let pdbOpenScope (writer: PdbWriter) (startOffset: int32) = - let mutable retInt = 0 - writer.symWriter.OpenScope(startOffset, &retInt) - check "action" (retInt) - -let pdbCloseScope (writer: PdbWriter) (endOffset: int32) = writer.symWriter.CloseScope endOffset - -let pdbDefineLocalVariable (writer: PdbWriter) (name: string) (signature: byte[]) (addr1: int32) = - writer.symWriter.DefineLocalVariable( - name, - 0, - signature.Length, - signature, - int System.Diagnostics.SymbolStore.SymAddressKind.ILOffset, - addr1, - 0, - 0, - 0, - 0 - ) - -let pdbSetMethodRange - (writer: PdbWriter) - (docWriter1: PdbDocumentWriter) - (startLine: int) - (startCol: int) - (docWriter2: PdbDocumentWriter) - (endLine: int) - (endCol: int) - = - writer.symWriter.SetMethodSourceRange(docWriter1.symDocWriter, startLine, startCol, docWriter2.symDocWriter, endLine, endCol) - -let pdbDefineSequencePoints (writer: PdbWriter) (docWriter: PdbDocumentWriter) (pts: (int * int * int * int * int)[]) = - let offsets = (Array.map (fun (x, _, _, _, _) -> x) pts) - let lines = (Array.map (fun (_, x, _, _, _) -> x) pts) - let columns = (Array.map (fun (_, _, x, _, _) -> x) pts) - let endLines = (Array.map (fun (_, _, _, x, _) -> x) pts) - let endColumns = (Array.map (fun (_, _, _, _, x) -> x) pts) - writer.symWriter.DefineSequencePoints(docWriter.symDocWriter, pts.Length, offsets, lines, columns, endLines, endColumns) - -let pdbWriteDebugInfo (writer: PdbWriter) = - let mutable iDD = new ImageDebugDirectory() - let mutable length = 0 - writer.symWriter.GetDebugInfo(&iDD, 0, &length, null) - let mutable data: byte[] = Array.zeroCreate length - writer.symWriter.GetDebugInfo(&iDD, length, &length, data) - - { - iddCharacteristics = iDD.Characteristics - iddMajorVersion = int32 iDD.MajorVersion - iddMinorVersion = int32 iDD.MinorVersion - iddType = iDD.Type - iddData = data - } -#endif - -#if !FX_NO_PDB_WRITER -// PDB reading -type PdbReader = { symReader: ISymbolReader } -type PdbDocument = { symDocument: ISymbolDocument } -type PdbMethod = { symMethod: ISymbolMethod } -type PdbVariable = { symVariable: ISymbolVariable } -type PdbMethodScope = { symScope: ISymbolScope } - -type PdbDebugPoint = - { - pdbSeqPointOffset: int - pdbSeqPointDocument: PdbDocument - pdbSeqPointLine: int - pdbSeqPointColumn: int - pdbSeqPointEndLine: int - pdbSeqPointEndColumn: int - } - -let pdbReadOpen (moduleName: string) (path: string) : PdbReader = - let CorMetaDataDispenser = - System.Type.GetTypeFromProgID("CLRMetaData.CorMetaDataDispenser") - - let mutable IID_IMetaDataImport = new Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44") - - let mdd = - System.Activator.CreateInstance(CorMetaDataDispenser) :?> IMetaDataDispenser - - let mutable o: Object = new Object() - mdd.OpenScope(moduleName, 0, &IID_IMetaDataImport, &o) - let importerPtr = Marshal.GetComInterfaceForObject(o, typeof) - - try -#if ENABLE_MONO_SUPPORT - // ISymWrapper.dll is not available as a compile-time dependency for the cross-platform compiler, since it is Windows-only - // Access it via reflection instead.System.Diagnostics.SymbolStore.SymBinder - try - let isym = - System.Reflection.Assembly.Load("ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") - - let symbolBinder = isym.CreateInstance("System.Diagnostics.SymbolStore.SymBinder") - let symbolBinderTy = symbolBinder.GetType() - - let reader = - symbolBinderTy.InvokeMember( - "GetReader", - BindingFlags.Public ||| BindingFlags.InvokeMethod ||| BindingFlags.Instance, - null, - symbolBinder, - [| box importerPtr; box moduleName; box path |] - ) - - { symReader = reader :?> ISymbolReader } - with _ -> - { symReader = null } -#else - let symbolBinder = new System.Diagnostics.SymbolStore.SymBinder() - - { - symReader = symbolBinder.GetReader(importerPtr, moduleName, path) - } -#endif - finally - // Marshal.GetComInterfaceForObject adds an extra ref for importerPtr - if IntPtr.Zero <> importerPtr then - Marshal.Release importerPtr |> ignore - -// The symbol reader's finalize method will clean up any unmanaged resources. -// If file locks persist, we may want to manually invoke finalize -let pdbReadClose (_reader: PdbReader) : unit = () - -let pdbReaderGetMethod (reader: PdbReader) (token: int32) : PdbMethod = - { - symMethod = reader.symReader.GetMethod(SymbolToken token) - } - -let pdbReaderGetMethodFromDocumentPosition (reader: PdbReader) (document: PdbDocument) (line: int) (column: int) : PdbMethod = - { - symMethod = reader.symReader.GetMethodFromDocumentPosition(document.symDocument, line, column) - } - -let pdbReaderGetDocuments (reader: PdbReader) : PdbDocument[] = - let arr = reader.symReader.GetDocuments() - Array.map (fun i -> { symDocument = i }) arr - -let pdbReaderGetDocument - (reader: PdbReader) - (url: string) - (language: byte[]) - (languageVendor: byte[]) - (documentType: byte[]) - : PdbDocument = - { - symDocument = reader.symReader.GetDocument(url, Guid language, Guid languageVendor, System.Guid documentType) - } - -let pdbDocumentGetURL (document: PdbDocument) : string = document.symDocument.URL - -let pdbDocumentGetType (document: PdbDocument) : byte (* guid *) [] = - let guid = document.symDocument.DocumentType - guid.ToByteArray() - -let pdbDocumentGetLanguage (document: PdbDocument) : byte (* guid *) [] = - let guid = document.symDocument.Language - guid.ToByteArray() - -let pdbDocumentGetLanguageVendor (document: PdbDocument) : byte[] = - let guid = document.symDocument.LanguageVendor - guid.ToByteArray() - -let pdbDocumentFindClosestLine (document: PdbDocument) (line: int) : int = - document.symDocument.FindClosestLine line - -let pdbMethodGetToken (meth: PdbMethod) : int32 = - let token = meth.symMethod.Token - token.GetToken() - -let pdbMethodGetDebugPoints (meth: PdbMethod) : PdbDebugPoint[] = - let pSize = meth.symMethod.SequencePointCount - let offsets = Array.zeroCreate pSize - let docs = Array.zeroCreate pSize - let lines = Array.zeroCreate pSize - let cols = Array.zeroCreate pSize - let endLines = Array.zeroCreate pSize - let endColumns = Array.zeroCreate pSize - - meth.symMethod.GetSequencePoints(offsets, docs, lines, cols, endLines, endColumns) - - Array.init pSize (fun i -> - { - pdbSeqPointOffset = offsets.[i] - pdbSeqPointDocument = { symDocument = docs.[i] } - pdbSeqPointLine = lines.[i] - pdbSeqPointColumn = cols.[i] - pdbSeqPointEndLine = endLines.[i] - pdbSeqPointEndColumn = endColumns.[i] - }) - -let pdbScopeGetChildren (scope: PdbMethodScope) : PdbMethodScope[] = - let arr = scope.symScope.GetChildren() - Array.map (fun i -> { symScope = i }) arr - -let pdbScopeGetOffsets (scope: PdbMethodScope) : int * int = - (scope.symScope.StartOffset, scope.symScope.EndOffset) - -let pdbScopeGetLocals (scope: PdbMethodScope) : PdbVariable[] = - let arr = scope.symScope.GetLocals() - Array.map (fun i -> { symVariable = i }) arr - -let pdbVariableGetName (variable: PdbVariable) : string = variable.symVariable.Name - -let pdbVariableGetSignature (variable: PdbVariable) : byte[] = variable.symVariable.GetSignature() - -// The tuple is (AddressKind, AddressField1) -let pdbVariableGetAddressAttributes (variable: PdbVariable) : (int32 * int32) = - (int32 variable.symVariable.AddressKind, variable.symVariable.AddressField1) -#endif diff --git a/src/Compiler/AbstractIL/ilsupp.fsi b/src/Compiler/AbstractIL/ilsupp.fsi index e0aa2785471..a26a3049ebd 100644 --- a/src/Compiler/AbstractIL/ilsupp.fsi +++ b/src/Compiler/AbstractIL/ilsupp.fsi @@ -7,20 +7,6 @@ /// The implementation of the functions can be found in ilsupp-*.fs module internal FSharp.Compiler.AbstractIL.Support -#if !FX_NO_SYMBOLSTORE -open System.Diagnostics.SymbolStore -#endif - -#if !FX_NO_PDB_WRITER -type PdbWriter -val pdbInitialize: string -> string -> PdbWriter -#endif - -#if !FX_NO_PDB_READER -type PdbReader -val pdbReadClose: PdbReader -> unit -#endif - val absilWriteGetTimeStamp: unit -> int32 type IStream = System.Runtime.InteropServices.ComTypes.IStream @@ -32,74 +18,3 @@ type IStream = System.Runtime.InteropServices.ComTypes.IStream val linkNativeResources: unlinkedResources: byte[] list -> rva: int32 -> byte[] val unlinkResource: int32 -> byte[] -> byte[] - -#if !FX_NO_PDB_WRITER -/// PDB reader and associated types -type PdbDocument -type PdbMethod -type PdbVariable -type PdbMethodScope - -type PdbDebugPoint = - { pdbSeqPointOffset: int - pdbSeqPointDocument: PdbDocument - pdbSeqPointLine: int - pdbSeqPointColumn: int - pdbSeqPointEndLine: int - pdbSeqPointEndColumn: int } - -val pdbReadOpen: string (* module *) -> string (* path *) -> PdbReader -val pdbReadClose: PdbReader -> unit -val pdbReaderGetMethod: PdbReader -> int32 (* token *) -> PdbMethod -val pdbReaderGetMethodFromDocumentPosition: PdbReader -> PdbDocument -> int (* line *) -> int (* col *) -> PdbMethod -val pdbReaderGetDocuments: PdbReader -> PdbDocument array - -val pdbReaderGetDocument: - PdbReader -> string (* url *) -> byte (* guid *) [] -> byte (* guid *) [] -> byte (* guid *) [] -> PdbDocument - -val pdbDocumentGetURL: PdbDocument -> string -val pdbDocumentGetType: PdbDocument -> byte (* guid *) [] -val pdbDocumentGetLanguage: PdbDocument -> byte (* guid *) [] -val pdbDocumentGetLanguageVendor: PdbDocument -> byte (* guid *) [] -val pdbDocumentFindClosestLine: PdbDocument -> int -> int - -val pdbMethodGetToken: PdbMethod -> int32 -val pdbMethodGetDebugPoints: PdbMethod -> PdbDebugPoint array - -val pdbScopeGetChildren: PdbMethodScope -> PdbMethodScope array -val pdbScopeGetOffsets: PdbMethodScope -> int * int -val pdbScopeGetLocals: PdbMethodScope -> PdbVariable array - -val pdbVariableGetName: PdbVariable -> string -val pdbVariableGetSignature: PdbVariable -> byte[] -val pdbVariableGetAddressAttributes: PdbVariable -> int32 (* kind *) * int32 (* addrField1 *) -#endif - -#if !FX_NO_PDB_WRITER -//--------------------------------------------------------------------- -// PDB writer. -//--------------------------------------------------------------------- - -type PdbDocumentWriter - -type idd = - { iddCharacteristics: int32 - iddMajorVersion: int32 (* actually u16 in IMAGE_DEBUG_DIRECTORY *) - iddMinorVersion: int32 (* actually u16 in IMAGE_DEBUG_DIRECTORY *) - iddType: int32 - iddData: byte[] } - -val pdbInitialize: string (* .exe/.dll already written and closed *) -> string (* .pdb to write *) -> PdbWriter -val pdbClose: PdbWriter -> string -> string -> unit -val pdbCloseDocument: PdbDocumentWriter -> unit -val pdbSetUserEntryPoint: PdbWriter -> int32 -> unit -val pdbDefineDocument: PdbWriter -> string -> PdbDocumentWriter -val pdbOpenMethod: PdbWriter -> int32 -> unit -val pdbCloseMethod: PdbWriter -> unit -val pdbOpenScope: PdbWriter -> int -> unit -val pdbCloseScope: PdbWriter -> int -> unit -val pdbDefineLocalVariable: PdbWriter -> string -> byte[] -> int32 -> unit -val pdbSetMethodRange: PdbWriter -> PdbDocumentWriter -> int -> int -> PdbDocumentWriter -> int -> int -> unit -val pdbDefineSequencePoints: PdbWriter -> PdbDocumentWriter -> (int * int * int * int * int) array -> unit -val pdbWriteDebugInfo: PdbWriter -> idd -#endif diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 44292305bd9..3601292a4fd 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -3708,7 +3708,6 @@ let writeBytes (os: BinaryWriter) (chunk: byte[]) = os.Write(chunk, 0, chunk.Len let writePdb ( dumpDebugInfo, showTimes, - portablePDB, embeddedPDB, pdbfile, outfile, @@ -3734,10 +3733,6 @@ let writePdb ( // Now we've done the bulk of the binary, do the PDB file and fixup the binary. match pdbfile with | None -> () -#if ENABLE_MONO_SUPPORT - | Some fmdb when runningOnMono && not portablePDB -> - writeMdbInfo fmdb outfile pdbData -#endif | Some pdbfile -> let idd = match pdbInfoOpt with @@ -3751,16 +3746,17 @@ let writePdb ( ms.Close() pdbBytes <- Some (ms.ToArray()) else + let outfileInfo = FileInfo(outfile).FullName + let pdbfileInfo = FileInfo(pdbfile).FullName + + // If pdbfilepath matches output filepath then error + if String.Compare(outfileInfo, pdbfileInfo, StringComparison.InvariantCulture) = 0 then + errorR(Error(FSComp.SR.optsPdbMatchesOutputFileName(), rangeStartup)) try FileSystem.FileDeleteShim pdbfile with _ -> () use fs = FileSystem.OpenFileForWriteShim(pdbfile, fileMode = FileMode.Create, fileAccess = FileAccess.ReadWrite) stream.WriteTo fs getInfoForPortablePdb contentId pdbfile pathMap debugDataChunk debugDeterministicPdbChunk debugChecksumPdbChunk algorithmName checkSum embeddedPDB deterministic - | None -> -#if FX_NO_PDB_WRITER - [| |] -#else - writePdbInfo showTimes outfile pdbfile pdbData debugDataChunk -#endif + | None -> [| |] reportTime showTimes "Generate PDB Info" // Now we have the debug data we can go back and fill in the debug directory in the image @@ -4559,12 +4555,23 @@ let writeBinaryFiles (options: options, modul, normalizeAssemblyRefs) = FileSystem.OpenFileForWriteShim(options.outfile, FileMode.Open, FileAccess.Write, FileShare.Read) writePdb (options.dumpDebugInfo, - options.showTimes, options.portablePDB, - options.embeddedPDB, options.pdbfile, options.outfile, - reopenOutput, false, options.signer, options.deterministic, options.pathMap, - pdbData, pdbInfoOpt, debugDirectoryChunk, - debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, - debugDeterministicPdbChunk, textV2P) |> ignore + options.showTimes, + options.embeddedPDB, + options.pdbfile, + options.outfile, + reopenOutput, + false, + options.signer, + options.deterministic, + options.pathMap, + pdbData, + pdbInfoOpt, + debugDirectoryChunk, + debugDataChunk, + debugChecksumPdbChunk, + debugEmbeddedPdbChunk, + debugDeterministicPdbChunk, + textV2P) |> ignore mappings @@ -4580,7 +4587,6 @@ let writeBinaryInMemory (options: options, modul, normalizeAssemblyRefs) = let pdbBytes = writePdb (options.dumpDebugInfo, options.showTimes, - options.portablePDB, options.embeddedPDB, options.pdbfile, options.outfile, @@ -4589,9 +4595,13 @@ let writeBinaryInMemory (options: options, modul, normalizeAssemblyRefs) = options.signer, options.deterministic, options.pathMap, - pdbData, pdbInfoOpt, debugDirectoryChunk, debugDataChunk, - debugChecksumPdbChunk, debugEmbeddedPdbChunk, - debugDeterministicPdbChunk, textV2P) + pdbData, pdbInfoOpt, + debugDirectoryChunk, + debugDataChunk, + debugChecksumPdbChunk, + debugEmbeddedPdbChunk, + debugDeterministicPdbChunk, + textV2P) stream.Close() diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 55b23795bbc..eef6e4d4c31 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -913,273 +913,6 @@ let getInfoForEmbeddedPortablePdb true deterministic -#if !FX_NO_PDB_WRITER - -open Microsoft.Win32 - -//--------------------------------------------------------------------- -// PDB Writer. The function [WritePdbInfo] abstracts the -// imperative calls to the Symbol Writer API. -//--------------------------------------------------------------------- -let writePdbInfo showTimes outfile pdbfile info cvChunk = - - try - FileSystem.FileDeleteShim pdbfile - with _ -> - () - - let pdbw = - try - pdbInitialize outfile pdbfile - with _ -> - error (Error(FSComp.SR.ilwriteErrorCreatingPdb pdbfile, rangeCmdArgs)) - - match info.EntryPoint with - | None -> () - | Some x -> pdbSetUserEntryPoint pdbw x - - let docs = info.Documents |> Array.map (fun doc -> pdbDefineDocument pdbw doc.File) - - let getDocument i = - if i < 0 || i > docs.Length then - failwith "getDocument: bad doc number" - - docs.[i] - - reportTime showTimes (sprintf "PDB: Defined %d documents" info.Documents.Length) - Array.sortInPlaceBy (fun x -> x.MethToken) info.Methods - reportTime showTimes (sprintf "PDB: Sorted %d methods" info.Methods.Length) - - let spCounts = info.Methods |> Array.map (fun x -> x.DebugPoints.Length) - let allSps = Array.collect (fun x -> x.DebugPoints) info.Methods |> Array.indexed - - let mutable spOffset = 0 - - info.Methods - |> Array.iteri (fun i minfo -> - - let sps = Array.sub allSps spOffset spCounts.[i] - spOffset <- spOffset + spCounts.[i] - - (match minfo.DebugRange with - | None -> () - | Some (a, b) -> - pdbOpenMethod pdbw minfo.MethToken - - pdbSetMethodRange pdbw (getDocument a.Document) a.Line a.Column (getDocument b.Document) b.Line b.Column - - // Partition the sequence points by document - let spsets = - let res = Dictionary() - - for (_, sp) in sps do - let k = sp.Document - - match res.TryGetValue(k) with - | true, xsR -> xsR.Value <- sp :: xsR.Value - | _ -> res.[k] <- ref [ sp ] - - res - - spsets - |> Seq.iter (fun (KeyValue (_, vref)) -> - let spset = vref.Value - - if not spset.IsEmpty then - let spset = Array.ofList spset - Array.sortInPlaceWith SequencePoint.orderByOffset spset - - let sps = - spset - |> Array.map (fun sp -> - // Ildiag.dprintf "token 0x%08lx has an sp at offset 0x%08x\n" minfo.MethToken sp.Offset - (sp.Offset, sp.Line, sp.Column, sp.EndLine, sp.EndColumn)) - // Use of alloca in implementation of pdbDefineSequencePoints can give stack overflow here - if sps.Length < 5000 then - pdbDefineSequencePoints pdbw (getDocument spset.[0].Document) sps) - - // Avoid stack overflow when writing linearly nested scopes - let stackGuard = StackGuard(100) - // Write the scopes - let rec writePdbScope parent sco = - stackGuard.Guard(fun () -> - if parent = None || sco.Locals.Length <> 0 || sco.Children.Length <> 0 then - // Only nest scopes if the child scope is a different size from - let nested = - match parent with - | Some p -> sco.StartOffset <> p.StartOffset || sco.EndOffset <> p.EndOffset - | None -> true - - if nested then - pdbOpenScope pdbw sco.StartOffset - - sco.Locals - |> Array.iter (fun v -> pdbDefineLocalVariable pdbw v.Name v.Signature v.Index) - - sco.Children |> Array.iter (writePdbScope (if nested then Some sco else parent)) - - if nested then - pdbCloseScope pdbw sco.EndOffset) - - match minfo.RootScope with - | None -> () - | Some rootscope -> writePdbScope None rootscope - - pdbCloseMethod pdbw)) - - reportTime showTimes "PDB: Wrote methods" - - let res = pdbWriteDebugInfo pdbw - - for pdbDoc in docs do - pdbCloseDocument pdbDoc - - pdbClose pdbw outfile pdbfile - - reportTime showTimes "PDB: Closed" - - [| - { - iddCharacteristics = res.iddCharacteristics - iddMajorVersion = res.iddMajorVersion - iddMinorVersion = res.iddMinorVersion - iddType = res.iddType - iddTimestamp = info.Timestamp - iddData = res.iddData - iddChunk = cvChunk - } - |] -#endif - -#if ENABLE_MONO_SUPPORT -//--------------------------------------------------------------------- -// Support functions for calling 'Mono.CompilerServices.SymbolWriter' -// assembly dynamically if it is available to the compiler -//--------------------------------------------------------------------- -open Microsoft.FSharp.Reflection - -// Dynamic invoke operator. Implements simple overload resolution based -// on the name and number of parameters only. -// Supports the following cases: -// obj?Foo() // call with no arguments -// obj?Foo(1, "a") // call with two arguments (extracted from tuple) -// NOTE: This doesn't actually handle all overloads. It just picks first entry with right -// number of arguments. -let (?) this memb (args: 'Args) : 'R = - // Get array of 'obj' arguments for the reflection call - let args = - if typeof<'Args> = typeof then - [||] - elif FSharpType.IsTuple typeof<'Args> then - FSharpValue.GetTupleFields args - else - [| box args |] - - // Get methods and perform overload resolution - let methods = this.GetType().GetMethods() - - let bestMatch = - methods - |> Array.tryFind (fun mi -> mi.Name = memb && mi.GetParameters().Length = args.Length) - - match bestMatch with - | Some mi -> unbox (mi.Invoke(this, args)) - | None -> error (Error(FSComp.SR.ilwriteMDBMemberMissing memb, rangeCmdArgs)) - -// Creating instances of needed classes from 'Mono.CompilerServices.SymbolWriter' assembly - -let monoCompilerSvc = - AssemblyName("Mono.CompilerServices.SymbolWriter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756") - -let ctor (asmName: AssemblyName) clsName (args: obj[]) = - let asm = Assembly.Load asmName - let ty = asm.GetType clsName - Activator.CreateInstance(ty, args) - -let createSourceMethodImpl (name: string) (token: int) (namespaceID: int) = - ctor monoCompilerSvc "Mono.CompilerServices.SymbolWriter.SourceMethodImpl" [| box name; box token; box namespaceID |] - -let createWriter (f: string) = - ctor monoCompilerSvc "Mono.CompilerServices.SymbolWriter.MonoSymbolWriter" [| box f |] - -//--------------------------------------------------------------------- -// MDB Writer. Generate debug symbols using the MDB format -//--------------------------------------------------------------------- -let writeMdbInfo fmdb f info = - // Note, if we can't delete it code will fail later - try - FileSystem.FileDeleteShim fmdb - with _ -> - () - - // Try loading the MDB symbol writer from an assembly available on Mono dynamically - // Report an error if the assembly is not available. - let wr = - try - createWriter f - with _ -> - error (Error(FSComp.SR.ilwriteErrorCreatingMdb (), rangeCmdArgs)) - - // NOTE: MonoSymbolWriter doesn't need information about entrypoints, so 'info.EntryPoint' is unused here. - // Write information about Documents. Returns '(SourceFileEntry*CompileUnitEntry)[]' - let docs = - [| - for doc in info.Documents do - let doc = wr?DefineDocument (doc.File) - let unit = wr?DefineCompilationUnit doc - yield doc, unit - |] - - let getDocument i = - if i < 0 || i >= Array.length docs then - failwith "getDocument: bad doc number" - else - docs[i] - - // Sort methods and write them to the MDB file - Array.sortInPlaceBy (fun x -> x.MethToken) info.Methods - - for meth in info.Methods do - // Creates an instance of 'SourceMethodImpl' which is a private class that implements 'IMethodDef' interface - // We need this as an argument to 'OpenMethod' below. Using private class is ugly, but since we don't reference - // the assembly, the only way to implement 'IMethodDef' interface would be dynamically using Reflection.Emit... - let sm = createSourceMethodImpl meth.MethName meth.MethToken 0 - - match meth.DebugRange with - | Some (mstart, _) -> - // NOTE: 'meth.Params' is not needed, Mono debugger apparently reads this from meta-data - let _, cue = getDocument mstart.Document - wr?OpenMethod (cue, 0, sm) |> ignore - - // Write sequence points - for sp in meth.DebugPoints do - wr?MarkSequencePoint (sp.Offset, cue?get_SourceFile (), sp.Line, sp.Column, false) - - // Walk through the tree of scopes and write all variables - let rec writeScope (scope: PdbMethodScope) = - wr?OpenScope (scope.StartOffset) |> ignore - - for local in scope.Locals do - wr?DefineLocalVariable (local.Index, local.Name) - - for child in scope.Children do - writeScope child - - wr?CloseScope (scope.EndOffset) - - match meth.RootScope with - | None -> () - | Some rootscope -> writeScope rootscope - - // Finished generating debug information for the curretn method - wr?CloseMethod () - | _ -> () - - // Finalize - MDB requires the MVID of the generated .NET module - let moduleGuid = Guid(info.ModuleID |> Array.map byte) - wr?WriteSymbolFile moduleGuid -#endif - //--------------------------------------------------------------------- // Dumps debug info into a text file for testing purposes //--------------------------------------------------------------------- diff --git a/src/Compiler/AbstractIL/ilwritepdb.fsi b/src/Compiler/AbstractIL/ilwritepdb.fsi index 93db4b4f7e5..50ac8534d29 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fsi +++ b/src/Compiler/AbstractIL/ilwritepdb.fsi @@ -87,10 +87,6 @@ val sizeof_IMAGE_DEBUG_DIRECTORY: System.Int32 val logDebugInfo: string -> PdbData -> unit -#if ENABLE_MONO_SUPPORT -val writeMdbInfo<'a> : string -> string -> PdbData -> 'a -#endif - type BinaryChunk = { size: int32; addr: int32 } type idd = @@ -145,11 +141,6 @@ val getInfoForPortablePdb: deterministic: bool -> idd[] -#if !FX_NO_PDB_WRITER -val writePdbInfo: - showTimes: bool -> outfile: string -> pdbfile: string -> info: PdbData -> cvChunk: BinaryChunk -> idd[] -#endif - /// Check to see if a scope has a local with the same name as any of its children /// /// If so, do not emit 'scope' itself. Instead, diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index e406af4bd5c..7fd03d84bdf 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -468,7 +468,6 @@ type TcConfigBuilder = mutable embedSourceList: string list mutable sourceLink: string - mutable ignoreSymbolStoreSequencePoints: bool mutable internConstantStrings: bool mutable extraOptimizationIterations: int @@ -689,7 +688,6 @@ type TcConfigBuilder = embedAllSource = false embedSourceList = [] sourceLink = "" - ignoreSymbolStoreSequencePoints = false internConstantStrings = true extraOptimizationIterations = 0 @@ -839,12 +837,6 @@ type TcConfigBuilder = Some( match tcConfigB.debugSymbolFile with | None -> getDebugFileName outfile tcConfigB.portablePDB -#if ENABLE_MONO_SUPPORT - | Some _ when runningOnMono -> - // On Mono, the name of the debug file has to be ".mdb" so specifying it explicitly is an error - warning (Error(FSComp.SR.ilwriteMDBFileNameCannotBeChangedWarning (), rangeCmdArgs)) - getDebugFileName outfile tcConfigB.portablePDB -#endif | Some f -> f ) elif (tcConfigB.debugSymbolFile <> None) && (not tcConfigB.debuginfo) then @@ -1275,7 +1267,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.embedSourceList = data.embedSourceList member _.sourceLink = data.sourceLink member _.packageManagerLines = data.packageManagerLines - member _.ignoreSymbolStoreSequencePoints = data.ignoreSymbolStoreSequencePoints member _.internConstantStrings = data.internConstantStrings member _.extraOptimizationIterations = data.extraOptimizationIterations member _.win32icon = data.win32icon diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 51a8b7d09cf..0524261c5c8 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -349,8 +349,6 @@ type TcConfigBuilder = mutable sourceLink: string - mutable ignoreSymbolStoreSequencePoints: bool - mutable internConstantStrings: bool mutable extraOptimizationIterations: int @@ -665,8 +663,6 @@ type TcConfig = member sourceLink: string - member ignoreSymbolStoreSequencePoints: bool - member internConstantStrings: bool member extraOptimizationIterations: int diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 1059c0ff6bf..001523dad05 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -643,37 +643,17 @@ let SetTarget (tcConfigB: TcConfigBuilder) (s: string) = let SetDebugSwitch (tcConfigB: TcConfigBuilder) (dtype: string option) (s: OptionSwitch) = match dtype with | Some s -> - match s with - | "portable" -> - tcConfigB.portablePDB <- true - tcConfigB.embeddedPDB <- false - tcConfigB.jitTracking <- true - tcConfigB.ignoreSymbolStoreSequencePoints <- true - | "pdbonly" -> - tcConfigB.portablePDB <- false - tcConfigB.embeddedPDB <- false - tcConfigB.jitTracking <- false - | "embedded" -> - tcConfigB.portablePDB <- true - tcConfigB.embeddedPDB <- true - tcConfigB.jitTracking <- true - tcConfigB.ignoreSymbolStoreSequencePoints <- true -#if FX_NO_PDB_WRITER - // When building on the coreclr, full means portable - | "full" -> - tcConfigB.portablePDB <- true - tcConfigB.embeddedPDB <- false - tcConfigB.jitTracking <- true -#else - | "full" -> - tcConfigB.portablePDB <- false - tcConfigB.embeddedPDB <- false - tcConfigB.jitTracking <- true -#endif + tcConfigB.portablePDB <- true + tcConfigB.jitTracking <- true + match s with + | "full" + | "pdbonly" + | "portable" -> tcConfigB.embeddedPDB <- false + | "embedded" -> tcConfigB.embeddedPDB <- true | _ -> error (Error(FSComp.SR.optsUnrecognizedDebugType s, rangeCmdArgs)) | None -> - tcConfigB.portablePDB <- false + tcConfigB.portablePDB <- s = OptionSwitch.On tcConfigB.embeddedPDB <- false tcConfigB.jitTracking <- s = OptionSwitch.On @@ -727,7 +707,6 @@ let PrintOptionInfo (tcConfigB: TcConfigBuilder) = printfn " localOptUser . . . . . : %+A" tcConfigB.optSettings.localOptUser printfn " crossAssemblyOptimizationUser . . : %+A" tcConfigB.optSettings.crossAssemblyOptimizationUser printfn " lambdaInlineThreshold : %+A" tcConfigB.optSettings.lambdaInlineThreshold - printfn " ignoreSymStoreSeqPts . : %+A" tcConfigB.ignoreSymbolStoreSequencePoints printfn " doDetuple . . . . . . : %+A" tcConfigB.doDetuple printfn " doTLR . . . . . . . . : %+A" tcConfigB.doTLR printfn " doFinalSimplify. . . . : %+A" tcConfigB.doFinalSimplify diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 55ec3ad40a1..41b6211545f 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -392,12 +392,7 @@ module MainModuleBuilder = yield! codegenResults.ilAssemAttrs if Option.isSome pdbfile then - tcGlobals.mkDebuggableAttributeV2 ( - tcConfig.jitTracking, - tcConfig.ignoreSymbolStoreSequencePoints, - disableJitOptimizations, - false (* enableEnC *) - ) + tcGlobals.mkDebuggableAttributeV2 (tcConfig.jitTracking, disableJitOptimizations, false (* enableEnC *) ) yield! reflectedDefinitionAttrs ] @@ -419,7 +414,6 @@ module MainModuleBuilder = CustomAttrsStored = storeILCustomAttrs manifestAttrs DisableJitOptimizations = disableJitOptimizations JitTracking = tcConfig.jitTracking - IgnoreSymbolStoreSequencePoints = tcConfig.ignoreSymbolStoreSequencePoints SecurityDeclsStored = storeILSecurityDecls secDecls } diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 84fd4742d6d..de5fbf9ebd8 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -300,20 +300,6 @@ let ProcessCommandLineFlags (tcConfigB: TcConfigBuilder, lcidFromCodePage, argv) // This is where flags are interpreted by the command line fsc.exe. ParseCompilerOptions(collect, GetCoreFscCompilerOptions tcConfigB, List.tail (PostProcessCompilerArgs abbrevArgs argv)) - if not (tcConfigB.portablePDB || tcConfigB.embeddedPDB) then - if tcConfigB.embedAllSource || (tcConfigB.embedSourceList |> isNil |> not) then - error (Error(FSComp.SR.optsEmbeddedSourceRequirePortablePDBs (), rangeCmdArgs)) - - if not (String.IsNullOrEmpty(tcConfigB.sourceLink)) then - error (Error(FSComp.SR.optsSourceLinkRequirePortablePDBs (), rangeCmdArgs)) - - if tcConfigB.debuginfo && not tcConfigB.portablePDB then - if tcConfigB.deterministic then - error (Error(FSComp.SR.fscDeterministicDebugRequiresPortablePdb (), rangeCmdArgs)) - - if tcConfigB.pathMap <> PathMap.empty then - error (Error(FSComp.SR.fscPathMapDebugRequiresPortablePdb (), rangeCmdArgs)) - let inputFiles = List.rev inputFilesRef // Check if we have a codepage from the console diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 97e24679878..bb407db7791 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -856,8 +856,7 @@ optsNowin32manifest,"Do not include the default Win32 manifest" optsEmbedAllSource,"Embed all source files in the portable PDB file" optsEmbedSource,"Embed specific source files in the portable PDB file" optsSourceLink,"Source link information file to embed in the portable PDB file" -1501,optsEmbeddedSourceRequirePortablePDBs,"--embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded)" -1502,optsSourceLinkRequirePortablePDBs,"--sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded)" +1503,optsPdbMatchesOutputFileName,"The pdb output file name cannot match the build output filename use --pdb:filename.pdb" srcFileTooLarge,"Source file is too large to embed in a portable PDB" optsResource,"Embed the specified managed resource" optsLinkresource,"Link the specified resource to this assembly where the resinfo format is [,[,public|private]]" @@ -1093,9 +1092,6 @@ lexIfOCaml,"IF-FSHARP/IF-CAML regions are no longer supported" 1212,tcOptionalArgsMustComeAfterNonOptionalArgs,"Optional arguments must come at the end of the argument list, after any non-optional arguments" 1213,tcConditionalAttributeUsage,"Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes" 1215,tcMemberOperatorDefinitionInExtrinsic,"Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." -1216,ilwriteMDBFileNameCannotBeChangedWarning,"The name of the MDB file must be .mdb. The --pdb option will be ignored." -1217,ilwriteMDBMemberMissing,"MDB generation failed. Could not find compatible member %s" -1218,ilwriteErrorCreatingMdb,"Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly." 1219,tcUnionCaseNameConflictsWithGeneratedType,"The union case named '%s' conflicts with the generated type '%s'" 1220,chkNoReflectedDefinitionOnStructMember,"ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter" 1221,tcDllImportNotAllowed,"DLLImport bindings must be static members in a class or function definitions in a module" @@ -1156,8 +1152,6 @@ fscTooManyErrors,"Exiting - too many errors" 2023,fscResxSourceFileDeprecated,"Passing a .resx file (%s) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an item in the .fsproj project file." 2024,fscStaticLinkingNoProfileMismatches,"Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly)." 2025,fscAssemblyWildcardAndDeterminism,"An %s specified version '%s', but this value is a wildcard, and you have requested a deterministic build, these are in conflict." -2026,fscDeterministicDebugRequiresPortablePdb,"Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded)" -2027,fscPathMapDebugRequiresPortablePdb,"--pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded)" 2028,optsInvalidPathMapFormat,"Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath'" 2029,optsInvalidRefOut,"Invalid reference assembly path'" 2030,optsInvalidRefAssembly,"Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together." diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 5075d68b504..9c1a92d2215 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1743,11 +1743,10 @@ type TcGlobals( member _.mkDebuggableAttribute jitOptimizerDisabled = mkILCustomAttribute (tref_DebuggableAttribute, [ilg.typ_Bool; ilg.typ_Bool], [ILAttribElem.Bool false; ILAttribElem.Bool jitOptimizerDisabled], []) - member _.mkDebuggableAttributeV2(jitTracking, ignoreSymbolStoreSequencePoints, jitOptimizerDisabled, enableEnC) = + member _.mkDebuggableAttributeV2(jitTracking, jitOptimizerDisabled, enableEnC) = let debuggingMode = (if jitTracking then 1 else 0) ||| (if jitOptimizerDisabled then 256 else 0) ||| - (if ignoreSymbolStoreSequencePoints then 2 else 0) ||| (if enableEnC then 4 else 0) let tref_DebuggableAttribute_DebuggingModes = mkILTyRefInTyRef (tref_DebuggableAttribute, tname_DebuggableAttribute_DebuggingModes) mkILCustomAttribute diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index f006f4b4879..bf85ca94337 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -457,6 +457,11 @@ Zobrazte si povolené hodnoty verze jazyka a pak zadejte požadovanou verzi, například latest nebo preview. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Informační soubor zdrojového odkazu, který se má vložit do souboru PDB typu Portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Přepínač --embed se podporuje jenom při generování souboru PDB typu Portable (--debug:portable nebo --debug:embedded). - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Přepínač --sourcelink se podporuje jenom při generování souboru PDB typu Portable (--debug:portable nebo --debug:embedded). - - Source file is too large to embed in a portable PDB Zdrojový soubor je příliš velký pro vložený do souboru PDB typu Portable. @@ -6142,21 +6137,6 @@ Členové rozšíření nemůžou poskytovat přetížení operátorů. Zvažte možnost definovat místo toho operátor v definici typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - Název souboru MDB musí být <název-souboru-sestavení>.mdb. Parametr --pdb se bude ignorovat. - - - - MDB generation failed. Could not find compatible member {0} - Generování souboru MDB selhalo. Nenašel se kompatibilní člen {0}. - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Nedají se vygenerovat ladicí informace MDB. Načtení typu MonoSymbolWriter ze sestavení Mono.CompilerServices.SymbolWriter.dll selhalo. - - The union case named '{0}' conflicts with the generated type '{1}' Případ typu union s názvem {0} koliduje s generovaným typem {1}. @@ -6432,11 +6412,6 @@ Zadaná verze {0} je {1}, ale tato hodnota představuje zástupný znak a vy jste požádali o deterministické sestavení, což je v konfliktu. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministické buildy podporují jenom přenositelné soubory PDB (--debug:portable nebo --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Znak {0} není v názvu poskytnutého oboru názvů {1} povolený. @@ -8062,11 +8037,6 @@ Mapuje fyzické cesty na názvy zdrojových cest z výstupu kompilátoru. - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - Parametr --pathmap se může používat jenom s přenositelnými soubory PDB (--debug:portable nebo --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Neplatná mapa cest. Mapování musí být oddělená čárkami a používat formát cesta=zdrojováCesta. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index bcff666cca2..9f1ac3fe78f 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -457,6 +457,11 @@ Zeigen Sie die zulässigen Werte für die Sprachversion an. Geben Sie die Sprachversion als "latest" oder "preview" an. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Die Datei mit Quelllinkinformationen, die in die portierbare PDB-Datei eingebettet werden soll - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Die Option "--embed" wird nur bei der Ausgabe einer portierbaren PDB unterstützt (--debug:portable oder --debug:embedded). - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Die Option "--sourcelink" wird nur bei der Ausgabe einer portierbaren PDB unterstützt (--debug:portable oder --debug:embedded). - - Source file is too large to embed in a portable PDB Die Quelldatei ist zu groß, um in eine portierbare PDB eingebettet zu werden. @@ -6142,21 +6137,6 @@ Erweiterungsmember können keine Operatorüberladungen bereitstellen. Definieren Sie den Operator stattdessen als Teil der Typdefinition. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - Der Name der MDB-Datei muss "<assembly-file-name>.mdb" lauten. Die Option "--pdb" wird ignoriert. - - - - MDB generation failed. Could not find compatible member {0} - Fehler bei der MDB-Generierung. Kompatibler Member {0} wurde nicht gefunden. - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Es können keine MDB-Debuginformationen generiert werden. Fehler beim Laden des Typs 'MonoSymbolWriter' aus der 'Mono.CompilerServices.SymbolWriter.dll'-Assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Der Union-Fall mit dem Namen '{0}' befindet sich in einem Konflikt mit dem generierten Typ '{1}'. @@ -6432,11 +6412,6 @@ {0} hat Version "{1}" angegeben, dieser Wert ist jedoch ein Platzhalter, und Sie haben einen deterministischen Build angefordert. Zwischen diesen besteht ein Konflikt. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministische Builds unterstützen nur portierbare PDBs ("--debug:portable" oder "--debug:embedded"). - - Character '{0}' is not allowed in provided namespace name '{1}' Das Zeichen '{0}' ist im angegebenen Namespacenamen '{1}' nicht zulässig. @@ -8062,11 +8037,6 @@ Ordnet der Ausgabe von Quellpfadnamen des Compilers physische Pfade zu - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap kann nur mit portierbaren PDB-Dateien verwendet werden (--debug:portable oder --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Ungültige Pfadzuordnung. Zuordnungen müssen durch Kommas getrennt werden und das Format 'path=sourcePath' aufweisen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index f0b34cd199e..86d3eea3009 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -457,6 +457,11 @@ Mostrar los valores permitidos para la versión de idioma, especificar la versión de idioma como "latest" "preview" + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Archivo de información de vínculos de origen para insertar en el archivo PDB portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - El modificador --embed solo se admite cuando se emite un archivo PDB portátil (--debug:portable o --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - El modificador --sourcelink solo se admite cuando se emite un archivo PDB portátil (--debug:portable o --debug:embedded) - - Source file is too large to embed in a portable PDB El archivo de código fuente es demasiado grande para insertarlo en un archivo PDB portable @@ -6142,21 +6137,6 @@ Los miembros de extensión no pueden proporcionar sobrecargas de operador. En su lugar, considere definir el operador como parte de la definición de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - El nombre del archivo MDB debe ser <nombre de archivo de ensamblado>.mdb. Se omitirá la opción--pdb. - - - - MDB generation failed. Could not find compatible member {0} - Error en la generación de MDB. No se encontró un miembro {0} compatible. - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - No se puede generar información de depuración de MDB. No se pudo cargar el tipo 'MonoSymbolWriter' del ensamblado 'Mono.CompilerServices.SymbolWriter.dll'. - - The union case named '{0}' conflicts with the generated type '{1}' El caso de unión denominado '{0}' entra en conflicto con el tipo generado '{1}'. @@ -6432,11 +6412,6 @@ Un objeto {0} especificó la versión "{1}", pero este valor es un carácter comodín y ha solicitado una compilación determinista. Estas opciones están en conflicto. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Las compilaciones deterministas solo admiten PDB portátiles (--Debug: portable o--Debug: embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' No se permite el carácter '{0}' en el nombre de espacio de nombres '{1}' proporcionado. @@ -8062,11 +8037,6 @@ Asigna rutas físicas de acceso a nombres de ruta de origen resultantes del compilador - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap solo se puede utilizar con PDB portátiles (--Debug:portable o --Debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapa de ruta no válido. Las asignaciones deben estar separadas por comas y tener el formato "path=rutaOrigen" diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index e1faaa3ee52..7b1a397388f 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -457,6 +457,11 @@ Afficher les valeurs autorisées pour la version du langage, spécifier la version du langage comme 'dernière' ou 'préversion' + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Fichier d'informations sur le lien source à incorporer dans le fichier PDB portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Commutateur --embed uniquement pris en charge durant l'émission d'un fichier PDB portable (--debug:portable ou --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Commutateur --sourcelink uniquement pris en charge durant l'émission d'un fichier PDB portable (--debug:portable ou --debug:embedded) - - Source file is too large to embed in a portable PDB Le fichier source est trop grand pour être incorporé dans un fichier PDB portable @@ -6142,21 +6137,6 @@ Les membres d'extension ne peuvent pas fournir de surcharges d'opérateur. Définissez l'opérateur comme faisant partie de la définition de type. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - Le nom du fichier MDB doit être <nom_fichier_assembly>.mdb. L'option --pdb est ignorée. - - - - MDB generation failed. Could not find compatible member {0} - Échec de la génération de MDB. Le membre compatible {0} est introuvable - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Impossible de générer les informations de débogage de MDB. Le chargement du type 'MonoSymbolWriter' depuis l'assembly 'Mono.CompilerServices.SymbolWriter.dll' a échoué. - - The union case named '{0}' conflicts with the generated type '{1}' Le cas d'union nommé '{0}' est en conflit avec le type généré '{1}' @@ -6432,11 +6412,6 @@ {0} a spécifié la version '{1}', mais cette valeur est un caractère générique, et comme vous avez demandé une build déterministe, il existe un conflit. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Les builds déterministes prennent seulement en charge les PDB portables (--debug:portable ou --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Le caractère '{0}' n'est pas autorisé dans le nom d'espace de noms fourni '{1}' @@ -8062,11 +8037,6 @@ Mappe les chemins physiques aux noms de chemin source générés par le compilateur - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap peut seulement être utilisé avec des PBD portables (--debug:portable ou --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mappage de chemin non valide. Les mappages doivent être séparés par des virgules et au format 'path=sourcePath' diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index bc3b6d77268..2e60f3efcfe 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -457,6 +457,11 @@ Visualizza i valori consentiti per la versione del linguaggio. Specificare la versione del linguaggio, ad esempio 'latest' o 'preview' + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ File di informazioni sul collegamento all'origine da incorporare nel file PDB portabile - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Opzione --embed supportata solo quando si crea un file PDB portabile (--debug:portable o --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Opzione --sourcelink supportata solo quando si crea un file PDB portatile (--debug:portable o --debug:embedded) - - Source file is too large to embed in a portable PDB Le dimensioni del file di origine sono eccessive per consentirne l'incorporamento in un PDB portabile @@ -6142,21 +6137,6 @@ I membri di estensione non possono fornire overload di operatori. Provare a definire l'operatore come parte della definizione del tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - Il nome del file MDB deve essere <nome-file-assembly>.mdb. L'opzione --pdb verrà ignorata. - - - - MDB generation failed. Could not find compatible member {0} - La generazione del file MDB non è riuscita. Il membro compatibile {0} non è stato trovato - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Non è possibile generare informazioni di debug MDB. Non è stato possibile caricare il tipo 'MonoSymbolWriter' dall'assembly 'Mono.CompilerServices.SymbolWriter.dll'. - - The union case named '{0}' conflicts with the generated type '{1}' Il case di unione denominato '{0}' è in conflitto con il tipo generato '{1}' @@ -6432,11 +6412,6 @@ In un attributo {0} è stata specificata la versione '{1}', ma questo valore è un carattere jolly ed è stata richiesta una compilazione deterministica. Tali opzioni sono in conflitto. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Le compilazioni deterministiche supportano solo file PDB portabili (--debug:portable o --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Il carattere '{0}' non è consentito nel nome dello spazio dei nomi fornito '{1}' @@ -8062,11 +8037,6 @@ Esegue il mapping dei percorsi fisici ai nomi di percorso di origine restituiti dal compilatore - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap può essere usato solo con file PDB portabili (--debug:portable o --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapping di percorso non valido. I mapping devono essere delimitati da virgole e specificati in formato 'percorso=percorsoOrigine' diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index f82dbf9c798..247420814f0 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -457,6 +457,11 @@ 言語バージョンで許可された値を表示し、'最新' や 'プレビュー' などの言語バージョンを指定する + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ 移植可能な PDB ファイルに埋め込むソース リンク情報ファイル - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed スイッチは、移植可能な PDB の生成時にのみサポートされます (--debug:portable または --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink スイッチは、移植可能な PDB の生成時にのみサポートされます (--debug:portable または --debug:embedded) - - Source file is too large to embed in a portable PDB ソース ファイルが大きすぎるので、移植可能な PDB 内に埋め込めません @@ -6142,21 +6137,6 @@ 拡張メンバーでは演算子のオーバーロードを実行できません。代わりに型定義の一部として演算子を定義してください。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB ファイルの名前は <assembly-file-name>.mdb でなければなりません、--pdb オプションは無視されます。 - - - - MDB generation failed. Could not find compatible member {0} - MDB を生成できませんでした。互換性のあるメンバー {0} が見つかりませんでした - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - MDB デバッグ情報を生成できません。'Mono.CompilerServices.SymbolWriter.dll' アセンブリから 'MonoSymbolWriter' 型を読み込むことができませんでした。 - - The union case named '{0}' conflicts with the generated type '{1}' {0}' という名前の共用体ケースが、生成された型 '{1}' と競合します @@ -6432,11 +6412,6 @@ {0} によりバージョン '{1}' が指定されましたが、この値はワイルドカードです。決定論的なビルドを要求しているため、これらの指定は矛盾しています。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 決定論的ビルドは、ポータブル PDB のみをサポートします (--debug:portable または --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 指定された名前空間名 '{1}' には、文字 '{0}' を使用することはできません @@ -8062,11 +8037,6 @@ 物理パスをコンパイラ出力のソース パス名にマップします - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap は、ポータブル PDB でのみ使用できます (--debug:portable または --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 無効なパス マップです。マッピングはコンマ区切りの 'path=sourcePath' 形式である必要があります diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 1095e6c1729..98b6ca41d7a 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -457,6 +457,11 @@ 언어 버전의 허용된 값을 표시하고 '최신' 또는 '미리 보기'와 같은 언어 버전을 지정합니다. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ 이식 가능한 PDB 파일에 포함할 소스 링크 정보 파일 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed 스위치는 이식 가능한 PDB를 내보낼 때만 지원됩니다(--debug:portable 또는 --debug:embedded). - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink 스위치는 이식 가능한 PDB를 내보낼 때만 지원됩니다(--debug:portable 또는 --debug:embedded). - - Source file is too large to embed in a portable PDB 소스 파일이 너무 커서 이식 가능한 PDB에 포함할 수 없습니다. @@ -6142,21 +6137,6 @@ 확장 멤버가 연산자 오버로드를 제공할 수 없습니다. 대신 연산자를 형식 정의의 일부분으로 정의하세요. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB 파일의 이름은 <어셈블리 파일 이름>.mdb여야 합니다. --pdb 옵션은 무시됩니다. - - - - MDB generation failed. Could not find compatible member {0} - MDB를 생성하지 못했습니다. 호환 멤버 {0}을(를) 찾을 수 없습니다. - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - MDB 디버그 정보를 생성할 수 없습니다. 'Mono.CompilerServices.SymbolWriter.dll' 어셈블리에서 'MonoSymbolWriter' 형식을 로드하지 못했습니다. - - The union case named '{0}' conflicts with the generated type '{1}' 이름이 '{0}'인 공용 구조체가 생성된 형식 '{1}'과(와) 충돌합니다. @@ -6432,11 +6412,6 @@ {0}이(가) '{1}' 버전을 지정했지만, 이 값은 와일드카드인데 사용자가 결정적 빌드를 요청하여 문제가 발생했습니다. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 결정적 빌드는 이식 가능한 PDB만 지원합니다(--debug:portable 또는 --debug:embedded). - - Character '{0}' is not allowed in provided namespace name '{1}' 제공된 네임스페이스 이름 '{1}'에는 '{0}' 문자를 사용할 수 없습니다. @@ -8062,11 +8037,6 @@ 컴파일러에서 실제 경로를 소스 경로 이름 출력에 매핑합니다. - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap은 이식 가능한 PDB에만 사용할 수 있습니다(--debug:portable 또는 --debug:embedded). - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 잘못된 경로 맵입니다. 매핑은 쉼표로 구분되어야 하며 'path=sourcePath' 형식이어야 합니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index e5ad0012774..033128cec28 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -457,6 +457,11 @@ Wyświetl dozwolone wartości dla wersji językowej; określ wersję językową, np. „latest” lub „preview” + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Plik informacji o linku kodu źródłowego do osadzenia w przenośnym pliku PDB - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Przełącznik --embed jest obsługiwany tylko dla emitowania przenośnego pliku PDB (--debug:portable lub --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Przełącznik --sourcelink jest obsługiwany tylko dla emitowania przenośnego pliku PDB (--debug:portable lub --debug:embedded) - - Source file is too large to embed in a portable PDB Plik źródłowy jest za duży, aby osadzić go w przenośnym pliku PDB @@ -6142,21 +6137,6 @@ Elementy członkowskie rozszerzeń nie mogą udostępniać przeciążeń operatorów. Zamiast tego rozważ zdefiniowanie operatora jako części definicji typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - Plik MDB musi mieć nazwę <nazwa-pliku-zestawu>.mdb. Opcja --pdb zostanie zignorowana. - - - - MDB generation failed. Could not find compatible member {0} - Generowanie pliku MDB nie powiodło się. Nie można znaleźć zgodnego elementu członkowskiego {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Nie można wygenerować informacji o debugowaniu pliku MDB. Nie można załadować typu „MonoSymbolWriter” z zestawu „Mono.CompilerServices.SymbolWriter.dll”. - - The union case named '{0}' conflicts with the generated type '{1}' Przypadek unii o nazwie „{0}” powoduje konflikt z wygenerowanym typem „{1}” @@ -6432,11 +6412,6 @@ Element {0} określił wersję „{1}”, ale wartość jest symbolem wieloznacznym. Żądano kompilacji deterministycznej. Te wartości powodują konflikt. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministyczne kompilacje obsługują tylko przenośne pliki PDB (--debug:portable lub --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Znak „{0}” jest niedozwolony w podanej nazwie przestrzeni nazw „{1}” @@ -8062,11 +8037,6 @@ Mapuje ścieżki fizyczne na wyjściowe nazwy ścieżek źródłowych z kompilatora - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - Argumentu --pathmap można używać tylko z przenośnymi plikami PDB (--debug:portable lub --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Nieprawidłowe mapowanie ścieżek. Mapowania muszą być rozdzielone przecinkami i mieć format „path=sourcePath” diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 35f58279210..ac0f596fbb5 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -457,6 +457,11 @@ Exibe os valores permitidos para a versão do idioma, especifica a versão do idioma, como 'mais recente ' ou 'prévia' + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ O arquivo de informações do link de origem para inserir em um arquivo PDB portátil - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - o comutador --embed tem suporte somente ao emitir um PDB Portátil (--debug:portable ou --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - o comutador --sourcelink tem suporte somente ao emitir um PDB Portátil (--debug:portable ou --debug:embedded) - - Source file is too large to embed in a portable PDB O arquivo de origem é muito grande para ser inserido em um PDB portátil @@ -6142,21 +6137,6 @@ Membros de extensão não podem fornecer sobrecargas de operadores. Considere definir o operador como parte da definição de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - O nome do arquivo MDB deve ser <assembly-file-name>.mdb. A opção --pdb será ignorada. - - - - MDB generation failed. Could not find compatible member {0} - Falha ao gerar MDB. Não foi possível encontrar o membro compatível {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Não é possível gerar informações de depuração de MDB. Falha ao carregar o tipo 'MonoSymbolWriter' do assembly 'Mono.CompilerServices.SymbolWriter.dll'. - - The union case named '{0}' conflicts with the generated type '{1}' O caso união chamado '{0}' conflita com o tipo gerado '{1}' @@ -6432,11 +6412,6 @@ Uma versão especificada {0} '{1}', mas esse valor é um curinga, e você solicitou uma compilação determinística. Eles estão em conflito. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Os builds determinísticos oferecem suporte apenas para PDBs portáteis (--debug:portable ou --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' O caractere '{0}' não é permitido no nome de namespace fornecido '{1}'. @@ -8062,11 +8037,6 @@ Mapeia caminhos físicos para nomes de caminho de origem gerados pelo compilador - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap só pode ser usado com PDBs portáteis (--debug:portable ou --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapa de caminho inválido. Os mapeamentos devem ser separados por vírgulas e do formato 'path=sourcePath' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index d6d6e210791..754431737a3 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -457,6 +457,11 @@ Отображение допустимых значений для версии языка. Укажите версию языка, например, "latest" или "preview". + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Файл со сведениями о компоновке источников, внедряемый в переносимый PDB-файл - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Параметр --embed поддерживается только при создании переносимого PDB-файла (--debug:portable или --debug:embedded). - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - Параметр --sourcelink поддерживается только при создании переносимого PDB-файла (--debug:portable или --debug:embedded). - - Source file is too large to embed in a portable PDB Исходный файл слишком велик для внедрения в переносимый PDB-файл. @@ -6142,21 +6137,6 @@ Элементы расширения не могут предоставлять перегрузку операторов. Вместо этого рекомендуется определить оператор как часть определения типа. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB-файл должен иметь имя <assembly-file-name>.mdb. Параметр --pdb будет проигнорирован. - - - - MDB generation failed. Could not find compatible member {0} - Сбой при создании MDB-файла. Не удалось найти совместимый элемент {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Невозможно создать сведения об отладке MDB. Не удалось загрузить тип MonoSymbolWriter из сборки Mono.CompilerServices.SymbolWriter.dll. - - The union case named '{0}' conflicts with the generated type '{1}' Ветвь объединения с именем "{0}" вступает в конфликт с созданным типом "{1}" @@ -6432,11 +6412,6 @@ Пользователь {0} указал версию "{1}", но это значение является подстановочным знаком, а вы запросили детерминированную сборку: возник конфликт. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Детерминированные сборки поддерживают только переносимые PDB-файлы (--debug:portable или --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Не допускается использовать символ "{0}" в указанном имени пространства имен "{1}" @@ -8062,11 +8037,6 @@ Сопоставляет физические пути с исходными путями в выходных данных компилятора - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - Параметр --pathmap может использоваться только с переносимыми PDB-файлами (--debug:portable или --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Недействительная карта путей. Сопоставления должны быть разделены запятыми и должны иметь формат "path=исходный_путь" diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 5440ee40f47..90c225e3926 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -457,6 +457,11 @@ Dil sürümü için izin verilen değerleri görüntüleyin, dil sürümünü 'en son' veya 'önizleme' örneklerindeki gibi belirtin + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ Taşınabilir PDB dosyasına eklenecek kaynak bağlantı bilgileri dosyası - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed anahtarı yalnızca Taşınabilir PDB gösterilirken desteklenir (--debug:portable veya --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink anahtarı yalnızca Taşınabilir PDB gösterilirken desteklenir (--debug:portable veya --debug:embedded) - - Source file is too large to embed in a portable PDB Kaynak dosya, taşınabilir PDB dosyasına eklemek için çok büyük @@ -6142,21 +6137,6 @@ Uzantı üyeleri işleç aşırı yüklemeleri sağlayamaz. Bunun yerine işleci tür tanımının parçası olarak tanımlamayı düşünün. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB dosyasının adı <assembly-file-name>.mdb olmalıdır. --pdb seçeneği yoksayılacak. - - - - MDB generation failed. Could not find compatible member {0} - MDB oluşturulamadı. Uyumlu üye {0} bulunamadı - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - MDB hata ayıklama bilgileri oluşturulamıyor. 'MonoSymbolWriter' türü 'Mono.CompilerServices.SymbolWriter.dll' bütünleştirilmiş kodundan yüklenemedi. - - The union case named '{0}' conflicts with the generated type '{1}' {0}' adlı birleşim durumu oluşturulan '{1}' türüyle çakışıyor @@ -6432,11 +6412,6 @@ Bir {0} tarafından '{1}' sürümü belirtildi. Ancak siz belirleyici bir derleme istediniz, bu ise bir joker karakter ve bunlar çakışıyor. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Belirlenimci derlemeler yalnızca taşınabilir PDB'leri (--debug:portable veya --debug:embedded) destekler - - Character '{0}' is not allowed in provided namespace name '{1}' {1}' sağlanan ad alanı adında '{0}' karakterine izin verilmez @@ -8062,11 +8037,6 @@ Fiziksel yolları derleyiciye göre kaynak yol adları çıkışıyla eşler - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap yalnızca taşınabilir PDB'ler (--debug:portable veya --debug:embedded) ile kullanılabilir - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Geçersiz yol eşlemesi. Eşlemeler virgülle ayrılmış ve 'path=sourcePath' biçiminde olmalıdır diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index c9f007f023c..f0d4d5b8176 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -457,6 +457,11 @@ 显示语言版本的允许值,指定语言版本,如“最新”或“预览” + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ 要嵌入可移植 PDB 文件中的源链接信息文件 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --仅在发出可移植 PDB 时才支持嵌入开关(--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --仅在发出可移植 PDB 时才支持源链接开关(--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB 源文件太大,无法嵌入可移植 PDB @@ -6142,21 +6137,6 @@ 扩展成员无法提供运算符重载。 请考虑改为将运算符定义为类型定义的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB 文件的名称必须是 <程序集文件名称>.mdb。将忽略 --pdb 选项。 - - - - MDB generation failed. Could not find compatible member {0} - MDB 生成失败。找不到兼容成员 {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - 无法生成 MDB 调试信息。未能从“Mono.CompilerServices.SymbolWriter.dll”程序集加载“MonoSymbolWriter”类型。 - - The union case named '{0}' conflicts with the generated type '{1}' 名为“{0}”的联合用例与生成的类型“{1}”冲突 @@ -6432,11 +6412,6 @@ {0} 指定了版本“{1}”,但该值为通配符,并且你已请求确定的版本,因此存在冲突。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 决定性生成仅支持可移植的 PDB (--debug:portable 或 --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 所提供的命名空间名称“{1}”中不允许出现字符“{0}” @@ -8062,11 +8037,6 @@ 将物理路径映射到编译器输出的源路径名 - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap 只能与可移植的 PDB 一起使用(--debug:portable 或 --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 路径映射无效。映射必须以逗号分隔,且采用 "path=sourcePath" 格式 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index d9ad22c51f4..a4de4d17e8e 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -457,6 +457,11 @@ 顯示語言版本允許的值,指定 'latest' 或 'preview' 等語言版本 + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + The pdb output file name cannot match the build output filename use --pdb:filename.pdb + + Produce a reference assembly, instead of a full assembly, as the primary output Produce a reference assembly, instead of a full assembly, as the primary output @@ -5077,16 +5082,6 @@ 要內嵌於可攜式 PDB 檔案中的來源連結資訊檔案 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - 僅在發出可攜式 PDB 時才支援 --embed 參數 (--debug:portable 或 --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - 僅在發出可攜式 PDB 時才支援 --sourcelink 參數 (--debug:portable 或 --debug:embedded) - - Source file is too large to embed in a portable PDB 來源檔案過大,無法內嵌於可攜式 PDB 中 @@ -6142,21 +6137,6 @@ 擴充成員無法提供運算子多載。請考慮將運算子改成定義為類型定義的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - MDB 檔案的名稱必須是 <組件檔名稱>.mdb。會略過 --pdb 選項。 - - - - MDB generation failed. Could not find compatible member {0} - MDB 產生失敗。找不到相容的成員 {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - 無法產生 MDB 偵錯資訊。無法從 'Mono.CompilerServices.SymbolWriter.dll' 組件載入 'MonoSymbolWriter' 類型。 - - The union case named '{0}' conflicts with the generated type '{1}' 名為 '{0}' 的聯集與產生的類型 '{1}' 衝突 @@ -6432,11 +6412,6 @@ {0} 已指定版本 '{1}',但這個值為萬用字元,且您已要求確定性組建,所以發生衝突。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 確定性組建僅支援可攜式 PDB (--debug:portable 或 --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 提供的命名空間名稱 '{1}' 中不允許使用字元 '{0}' @@ -8062,11 +8037,6 @@ 將實體路徑對應至來源路徑名稱,由編譯器輸出 - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap 只能搭配可攜式 PDB 使用 (--debug:portable 或 --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 路徑對應無效。對應必須以逗號分隔,且格式應為 'path=sourcePath' diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/env.lst index 1fd2562d4f0..861263c6fd2 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/env.lst @@ -17,12 +17,6 @@ NOMONO SOURCE=pdb01.fs SCFLAGS="-g --debug:embedded --pdb:.\\pdbembedded.pdb" PR NOMONO SOURCE=pdb01.fs SCFLAGS="-g --debug:portable --embed:pdb01.fs --pdb:.\\pdbportable.pdb" PRECMD="IF EXIST pdbportable.pdb DEL pdbportable.pdb" POSTCMD="IF not EXIST pdbportable.pdb dir pdbportable.pdb&EXIT 1" # If pdb file doesn't exist then it failed to generate portable pdb with embedded source. NOMONO SOURCE=pdb01.fs SCFLAGS="-g --out:pdbembedded.exe --debug:embedded --embed:pdb01.fs PRECMD="IF EXIST pdbembedded.exe DEL pdbembedded.exe" POSTCMD="IF NOT EXIST pdbembedded.exe dir pdbembedded.exe &EXIT 1" # If pdb file doesn't exist then it failed to embedded a pdb with embedded source. -NOMONO SOURCE=pdb05.fs SCFLAGS="-g --debug:full --embed" # --embed with --debug:full is build error -NOMONO SOURCE=pdb05.fs SCFLAGS="-g --debug:pdbonly --embed" # --embed with --debug:pdbonly is build error - -NOMONO SOURCE=pdb05.fs SCFLAGS="-g --out:pdbportable.exe --debug:full --embed:pdb05.fs # --embed:filelist with --debug:full is build error -NOMONO SOURCE=pdb05.fs SCFLAGS="-g --out:pdbportable.exe --debug:pdbonly --embed:pdb05.fs" # --embed:filelist with --debug:pdbonly is build error - # Case sensitive SOURCE=pdb02.fs SCFLAGS="--PDB -g" POSTCMD="IF EXIST pdb02.pdb EXIT 1" # --PDB diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb04.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb04.fs index 53cb7ce3a66..d2546e62211 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb04.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb04.fs @@ -1,5 +1,4 @@ // #Regression #NoMT #CompilerOptions #NoMono // Regression test for FSharp1.0:3204 - Compiler throws exception when trying to use option "-g --pdb" on a locked file (or any non-accessible file) -//Unexpected error creating debug information file '.+pdb04\.exe' - +//The pdb output file name cannot match the build output filename use --pdb:filename.pdb exit 1 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb05.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb05.fs deleted file mode 100644 index 10e8390769d..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/pdb/pdb05.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions #NoMono -//.+embed switch only supported when emitting a Portable PDB .+ - -exit 1 diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/NodeProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/NodeProperties.cs index be312648108..3442920e307 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/NodeProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/NodeProperties.cs @@ -1122,12 +1122,7 @@ object VSLangProj.ProjectProperties.Extender { get { throw new NotImplementedException(); } } -/* @@@@ - object VSLangProj.ProjectProperties.get_Extender(string name) - { - return UIThread.DoOnUIThread(() => this.Extender(name)); - } -*/ + object VSLangProj.ProjectProperties.ExtenderNames { get { return UIThread.DoOnUIThread(() => this.ExtenderNames()); } From faa115a2dfd446d2d83ba6dfe19e92a5cc5e13f6 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 13 Jul 2022 18:05:26 +0200 Subject: [PATCH 043/226] Update to the latest stable SDK - 6.0.302 (#13503) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index f21d9785660..48c9ae9da47 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.301", + "version": "6.0.302", "allowPrerelease": true, "rollForward": "latestMajor" }, From c19ebd564208f1e9bc8e8e95d81393a75734d7fe Mon Sep 17 00:00:00 2001 From: Janusz Wrobel Date: Fri, 15 Jul 2022 14:09:34 +0200 Subject: [PATCH 044/226] Fix and refactor FCSBenchmarks (#13419) --- Directory.Build.props | 5 + FSharp.Compiler.Service.sln | 28 + FSharp.sln | 32 + VisualFSharp.sln | 28 +- src/Compiler/FSharp.Compiler.Service.fsproj | 1 + .../BenchmarkComparison/.gitignore | 1 + .../BenchmarkComparison.fs | 131 ----- .../BenchmarkComparison/Helpers.fs | 52 ++ .../HistoricalBenchmark.Runner.fsproj | 22 + .../HistoricalBenchmark.Runner/Runner.fs | 490 ++++++++++++++++ .../HistoricalBenchmark.fsproj | 60 ++ .../BenchmarkComparison/Program.fs | 39 +- .../BenchmarkComparison/README.md | 36 +- .../BenchmarkComparison/SingleFileCompiler.fs | 75 +++ .../BenchmarkComparison/run.fsproj | 23 - .../BenchmarkComparison/run_current.fsproj | 23 - .../BenchmarkComparison/runner.ipynb | 287 +++------ .../10_latest_nuget_versions/results.csv | 11 + .../10_latest_nuget_versions/results.html | 62 ++ .../10_latest_nuget_versions/results.json | 132 +++++ .../sample_results/README.md | 25 + .../between_2_nuget_versions/results.csv | 20 + .../between_2_nuget_versions/results.html | 62 ++ .../between_2_nuget_versions/results.json | 249 ++++++++ .../sample_versions/results.csv | 11 + .../sample_versions/results.html | 62 ++ .../sample_versions/results.json | 129 +++++ .../setup_commit_template.fsproj | 27 - .../BenchmarkComparison/setup_current.fsproj | 25 - .../setup_version_template.fsproj | 25 - .../CompilerServiceBenchmarks/Benchmarks.fs | 346 +---------- .../CompilerServiceBenchmarks.fs | 269 +++++++++ .../DecentlySizedStandAloneFileBenchmark.fs | 22 + .../FSharp.Compiler.Benchmarks.fsproj | 9 +- .../CompilerServiceBenchmarks/Program.fs | 5 +- .../CompilerServiceBenchmarks/README.md | 22 + .../{Helpers.fs => SourceText.fs} | 59 +- .../decentlySizedStandAloneFile.fsx | 547 ------------------ .../FCSBenchmarks/FCSSourceFiles/Program.fs | 4 +- tests/benchmarks/FCSBenchmarks/README.md | 5 + .../FCSBenchmarks/SmokeTestAllBenchmarks.ps1 | 19 + .../decentlySizedStandAloneFile.fs | 22 +- 42 files changed, 2077 insertions(+), 1425 deletions(-) create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/.gitignore delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/BenchmarkComparison.fs create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Helpers.fs create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/Runner.fs create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/SingleFileCompiler.fs delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run.fsproj delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run_current.fsproj create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.csv create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.html create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.json create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/README.md create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.csv create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.html create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.json create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.csv create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.html create mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.json delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_commit_template.fsproj delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_current.fsproj delete mode 100644 tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_version_template.fsproj create mode 100644 tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs create mode 100644 tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/DecentlySizedStandAloneFileBenchmark.fs create mode 100644 tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/README.md rename tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/{Helpers.fs => SourceText.fs} (54%) delete mode 100644 tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/decentlySizedStandAloneFile.fsx create mode 100644 tests/benchmarks/FCSBenchmarks/SmokeTestAllBenchmarks.ps1 rename tests/benchmarks/FCSBenchmarks/{BenchmarkComparison => }/decentlySizedStandAloneFile.fs (97%) diff --git a/Directory.Build.props b/Directory.Build.props index e9c2a5c5e99..de4eb4723e5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,4 +3,9 @@ + + + + + diff --git a/FSharp.Compiler.Service.sln b/FSharp.Compiler.Service.sln index f5fd744f121..4a303b158a0 100644 --- a/FSharp.Compiler.Service.sln +++ b/FSharp.Compiler.Service.sln @@ -22,6 +22,19 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.ComponentTe {38A23D53-E2BF-4B76-907F-49F41D60C88E} = {38A23D53-E2BF-4B76-907F-49F41D60C88E} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{AF321816-B4A0-41DD-9A1D-484E8A20C6F6}" + ProjectSection(SolutionItems) = preProject + tests\benchmarks\FCSBenchmarks\decentlySizedStandAloneFile.fs = tests\benchmarks\FCSBenchmarks\decentlySizedStandAloneFile.fs + tests\benchmarks\FCSBenchmarks\README.md = tests\benchmarks\FCSBenchmarks\README.md + tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 + EndProjectSection +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HistoricalBenchmark.Runner", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.Runner\HistoricalBenchmark.Runner.fsproj", "{07CD957A-3C31-4F75-A735-16CE72E1BD71}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD4D4A7E-D519-4409-89DA-16DCA3EF80AA}" ProjectSection(SolutionItems) = preProject src\Compiler\FSComp.txt = src\Compiler\FSComp.txt @@ -61,6 +74,18 @@ Global {2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.Build.0 = Release|Any CPU + {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.Build.0 = Release|Any CPU + {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.Build.0 = Release|Any CPU + {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.Build.0 = Release|Any CPU + {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -69,6 +94,9 @@ Global {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB} {2EF674B9-8B56-4796-9933-42B2629E52C3} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB} {38A23D53-E2BF-4B76-907F-49F41D60C88E} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB} + {35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6} + {C1950E28-1CB7-4DEC-BB3A-8A0443A17282} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6} + {07CD957A-3C31-4F75-A735-16CE72E1BD71} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F9A60F3B-D894-4C8E-BA0F-C51115B25A5A} diff --git a/FSharp.sln b/FSharp.sln index 5a3240182df..dec2db5afbc 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -40,6 +40,9 @@ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\Compiler\FSharp.Compiler.Service.fsproj", "{9B4CF83C-C215-4EA0-9F8B-B5A77090F634}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{CE70D631-C5DC-417E-9CDA-B16097BEF1AC}" + ProjectSection(SolutionItems) = preProject + tests\benchmarks\README.md = tests\benchmarks\README.md + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{348DCC13-DD3E-4214-B040-5A74E8C6B782}" EndProject @@ -101,6 +104,9 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsi\fsiAny EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiArm64", "src\fsi\fsiArm64Project\fsiArm64.fsproj", "{209C7D37-8C01-413C-8698-EC25F4C86976}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{BEC6E796-7E53-4888-AAFC-B8FD55C425DF}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D58BFE8B-7C85-4D3B-B5F3-9A7BB90FF1EE}" ProjectSection(SolutionItems) = preProject src\Compiler\FSComp.txt = src\Compiler\FSComp.txt @@ -440,6 +446,30 @@ Global {209C7D37-8C01-413C-8698-EC25F4C86976}.Release|Any CPU.Build.0 = Release|Any CPU {209C7D37-8C01-413C-8698-EC25F4C86976}.Release|x86.ActiveCfg = Release|Any CPU {209C7D37-8C01-413C-8698-EC25F4C86976}.Release|x86.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Debug|Any CPU.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Debug|x86.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Debug|x86.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Proto|Any CPU.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Proto|x86.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Proto|x86.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Release|Any CPU.Build.0 = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Release|x86.ActiveCfg = Release|Any CPU + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF}.Release|x86.Build.0 = Release|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Debug|x86.ActiveCfg = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Debug|x86.Build.0 = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Proto|Any CPU.Build.0 = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Proto|x86.ActiveCfg = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Proto|x86.Build.0 = Debug|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Release|Any CPU.Build.0 = Release|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Release|x86.ActiveCfg = Release|Any CPU + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -472,6 +502,8 @@ Global {68EEAB5F-8AED-42A2-BFEC-343D0AD5CB52} = {B8DDA694-7939-42E3-95E5-265C2217C142} {B6271954-3BCD-418A-BD24-56FEB923F3D3} = {B8DDA694-7939-42E3-95E5-265C2217C142} {209C7D37-8C01-413C-8698-EC25F4C86976} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {BEC6E796-7E53-4888-AAFC-B8FD55C425DF} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} + {9C7523BA-7AB2-4604-A5FD-653E82C2BAD1} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/VisualFSharp.sln b/VisualFSharp.sln index fa4c376c818..55862186b22 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -164,6 +164,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpDebug", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpDebug.csproj", "{A422D673-8E3B-4924-821B-DD3174173426}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}" + ProjectSection(SolutionItems) = preProject + tests\benchmarks\README.md = tests\benchmarks\README.md + EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61}" EndProject @@ -189,6 +192,15 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsi\fsiAny EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiArm64", "src\fsi\fsiArm64Project\fsiArm64.fsproj", "{EB015235-1E07-4CDA-9CC6-3FBCC27910D1}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{583182E1-3484-4A8F-AC06-7C0D232C0CA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FCSBenchmarks", "FCSBenchmarks", "{39CDF34B-FB23-49AE-AB27-0975DA379BB5}" + ProjectSection(SolutionItems) = preProject + tests\benchmarks\FCSBenchmarks\decentlySizedStandAloneFile.fs = tests\benchmarks\FCSBenchmarks\decentlySizedStandAloneFile.fs + tests\benchmarks\FCSBenchmarks\README.md = tests\benchmarks\FCSBenchmarks\README.md + tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1039,6 +1051,18 @@ Global {EB015235-1E07-4CDA-9CC6-3FBCC27910D1}.Release|Any CPU.Build.0 = Release|Any CPU {EB015235-1E07-4CDA-9CC6-3FBCC27910D1}.Release|x86.ActiveCfg = Release|Any CPU {EB015235-1E07-4CDA-9CC6-3FBCC27910D1}.Release|x86.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Debug|Any CPU.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Debug|x86.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Debug|x86.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Proto|Any CPU.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Proto|x86.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Proto|x86.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|Any CPU.Build.0 = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|x86.ActiveCfg = Release|Any CPU + {583182E1-3484-4A8F-AC06-7C0D232C0CA4}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1109,7 +1133,6 @@ Global {B5A9BBD9-2F45-4722-A6CA-BAE3C64CD4E2} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} {14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {A422D673-8E3B-4924-821B-DD3174173426} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} - {564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} {208E36EE-665C-42D2-B767-C6DB03C4FEB2} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0} {EE08E954-AE91-4EFA-8595-10931D29E628} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0} {47112E07-9FF1-43E7-8021-F2A21D6A19A0} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} @@ -1121,6 +1144,9 @@ Global {511C95D9-3BA6-451F-B6F8-F033F40878A5} = {B8DDA694-7939-42E3-95E5-265C2217C142} {37EB3E54-ABC6-4CF5-8273-7CE4B61A42C1} = {B8DDA694-7939-42E3-95E5-265C2217C142} {EB015235-1E07-4CDA-9CC6-3FBCC27910D1} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {39CDF34B-FB23-49AE-AB27-0975DA379BB5} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} + {564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5} + {583182E1-3484-4A8F-AC06-7C0D232C0CA4} = {39CDF34B-FB23-49AE-AB27-0975DA379BB5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 5ee3256d378..0a875a29c47 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -90,6 +90,7 @@ + diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/.gitignore b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/.gitignore new file mode 100644 index 00000000000..d65aa2d9d80 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/.gitignore @@ -0,0 +1 @@ +.artifacts/ \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/BenchmarkComparison.fs b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/BenchmarkComparison.fs deleted file mode 100644 index bbdfb9a0784..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/BenchmarkComparison.fs +++ /dev/null @@ -1,131 +0,0 @@ -module BenchmarkComparison - -open System -open System.IO -open System.Threading.Tasks -open BenchmarkDotNet.Attributes - -[] -module BenchmarkHelpers = - - type Async with - static member RunImmediate (computation: Async<'T>, ?cancellationToken ) = - let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken - let ts = TaskCompletionSource<'T>() - let task = ts.Task - Async.StartWithContinuations( - computation, - (fun k -> ts.SetResult k), - (fun exn -> ts.SetException exn), - (fun _ -> ts.SetCanceled()), - cancellationToken) - task.Result - -#if SERVICE_13_0_0 - open Microsoft.FSharp.Compiler.SourceCodeServices -#else -#if SERVICE_30_0_0 - open FSharp.Compiler.SourceCodeServices - open FSharp.Compiler.Text -#else - open FSharp.Compiler.Diagnostics - open FSharp.Compiler.CodeAnalysis - open FSharp.Compiler.Text -#endif -#endif - - type BenchmarkSingleFileCompiler(filePath: string) = - - let mutable checkerOpt = None - let mutable testFileOpt = None - let mutable assembliesOpt = None - - let fileText = -#if SERVICE_13_0_0 - File.ReadAllText(filePath) -#else - SourceText.ofString(File.ReadAllText(filePath)) -#endif - - member _.Setup() = - match checkerOpt with - | None -> checkerOpt <- Some(FSharpChecker.Create(projectCacheSize = 200)) - | _ -> () - - match assembliesOpt with - | None -> - let mainAssemblyLocation = typeof.Assembly.Location - let frameworkDirectory = Path.GetDirectoryName(mainAssemblyLocation) - assembliesOpt <- - Directory.EnumerateFiles(frameworkDirectory) - |> Seq.filter (fun x -> - let name = Path.GetFileName(x) - (name.StartsWith("System.") && name.EndsWith(".dll") && not(name.Contains("Native"))) || - name.Contains("netstandard") || - name.Contains("mscorlib") - ) - |> Array.ofSeq - |> Array.append [|typeof.Assembly.Location|] - |> Some - - | _ -> () - - match testFileOpt with - | None -> - let refs = - assembliesOpt.Value - |> Array.map (fun x -> - $"-r:{x}" - ) - let args = - Array.append refs [|"--simpleresolution";"--targetprofile:netcore";"--noframework"|] - let args = - Array.append [|filePath|] args - let options = - checkerOpt.Value.GetProjectOptionsFromCommandLineArgs("test.fsproj", args) - testFileOpt <- Some options - | _ -> () - - member _.Run() = - match checkerOpt, testFileOpt with - | None, _ -> failwith "no checker" - | _, None -> failwith "no test file" - | Some(checker), Some(options) -> - let _, result = - checker.ParseAndCheckFileInProject(filePath, 0, fileText, options) - |> Async.RunImmediate - match result with - | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" - | FSharpCheckFileAnswer.Succeeded results -> -#if SERVICE_13_0_0 - if results.Errors.Length > 0 then failwithf "had errors: %A" results.Errors -#else -#if SERVICE_30_0_0 - if results.Errors.Length > 0 then failwithf "had errors: %A" results.Errors -#else - if results.Diagnostics.Length > 0 then failwithf "had errors: %A" results.Diagnostics -#endif -#endif - - member _.Cleanup() = - match checkerOpt with - | None -> failwith "no checker" - | Some(checker) -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - -[] -type TypeCheckingBenchmark1() = - let compiler = BenchmarkSingleFileCompiler(Path.Combine(__SOURCE_DIRECTORY__, "decentlySizedStandAloneFile.fs")) - - [] - member _.Setup() = - compiler.Setup() - - [] - member _.Run() = - compiler.Run() - - [] - member _.Cleanup() = - compiler.Cleanup() \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Helpers.fs b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Helpers.fs new file mode 100644 index 00000000000..29e17839003 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Helpers.fs @@ -0,0 +1,52 @@ +module internal HistoricalBenchmark.Helpers + +open System.IO +#if SERVICE_13_0_0 +open Microsoft.FSharp.Compiler.SourceCodeServices +#else +#if SERVICE_30_0_0 +open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text +#else +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Text +#endif +#endif + +let getFileSourceText (filePath : string) = + let text = File.ReadAllText(filePath) +#if SERVICE_13_0_0 + text +#else + SourceText.ofString text +#endif + +let failOnErrors (results : FSharpCheckFileResults) = +#if SERVICE_13_0_0 || SERVICE_30_0_0 + if results.Errors.Length > 0 then failwithf "had errors: %A" results.Errors +#else + if results.Diagnostics.Length > 0 then failwithf $"had errors: %A{results.Diagnostics}" +#endif + +let makeCmdlineArgsWithSystemReferences (filePath : string) = + let assemblies = + let mainAssemblyLocation = typeof.Assembly.Location + let frameworkDirectory = Path.GetDirectoryName(mainAssemblyLocation) + Directory.EnumerateFiles(frameworkDirectory) + |> Seq.filter (fun x -> + let name = Path.GetFileName(x) + (name.StartsWith("System.") && name.EndsWith(".dll") && not(name.Contains("Native"))) || + name.Contains("netstandard") || + name.Contains("mscorlib") + ) + |> Array.ofSeq + |> Array.append [|typeof.Assembly.Location|] + + let refs = + assemblies + |> Array.map (fun x -> + $"-r:{x}" + ) + [|"--simpleresolution";"--targetprofile:netcore";"--noframework"|] + |> Array.append refs + |> Array.append [|filePath|] diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj new file mode 100644 index 00000000000..1bfc44c13fc --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/HistoricalBenchmark.Runner.fsproj @@ -0,0 +1,22 @@ + + + + net6.0 + true + HistoricalBenchmark.Utilities + + + + + + + + + + + + + + + + diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/Runner.fs b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/Runner.fs new file mode 100644 index 00000000000..92f64645d30 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.Runner/Runner.fs @@ -0,0 +1,490 @@ +/// Utilities for running benchmarks for different versions of the codebase. +/// Used in '../runner.ipynb' +module HistoricalBenchmark.Runner + +open System +open System.Text.RegularExpressions +open LibGit2Sharp +open Newtonsoft.Json.Linq +open NuGet.Configuration +open NuGet.Packaging.Core +open NuGet.Packaging.Signing +open NuGet.Protocol +open System.Threading +open NuGet.Protocol.Core.Types +open NuGet.Common +open NuGet.Versioning +open System.IO +open System.Diagnostics +open Plotly.NET +open Newtonsoft.Json +open Plotly.NET.GenericChart + +[] +module Utils = + let runProcess name args workingDir (envVariables : (string * string) list) = + let info = ProcessStartInfo() + info.WindowStyle <- ProcessWindowStyle.Hidden + info.Arguments <- args + info.FileName <- name + info.UseShellExecute <- false + info.WorkingDirectory <- workingDir + info.RedirectStandardError <- true + info.RedirectStandardOutput <- true + info.RedirectStandardInput <- true + info.CreateNoWindow <- true + envVariables + |> List.iter (info.EnvironmentVariables.Add) + printfn $"Running '{name} {args}' in '{workingDir}'" + let p = Process.Start(info) + let o = p.StandardOutput.ReadToEnd() + let errors = p.StandardError.ReadToEnd() + p.WaitForExit() + if p.ExitCode <> 0 then + let msg = $"Process {name} {args} failed: {errors}." + printfn $"{msg}. Its full output: {o}" + failwith msg + +module Build = + type MSBuildProps = (string * string) list + + module MSBuildProps = + let private makeVersionDefines (v : NuGetVersion) = + if v.Major < 30 then "SERVICE_13_0_0" + elif v.Major < 40 then "SERVICE_30_0_0" + else "" + let makeProject (path : string) = + [ + "FcsReferenceType", "project" + "FcsProjectPath", path + "DefineConstants", "" + ] + let makeNuGet (version : NuGetVersion) = + [ + "FcsReferenceType", "nuget" + "FcsNuGetVersion", version.OriginalVersion + "DefineConstants", makeVersionDefines version + ] + let makeDll (fcsDllPath : string) (fsharpCoreDllPath : string) = + [ + "FcsReferenceType", "dll" + "FcsDllPath", fcsDllPath + "FSharpCoreDllPath", fsharpCoreDllPath + "DefineConstants", "" // This means the 'revision' method doesn't support codebases prior to v40 + ] + + let buildFCS (dir : string) = + Utils.runProcess "cmd" $"/C build.cmd -c Release -noVisualStudio" dir [] + + let runBenchmark (outputDir : string) (msBuildProps : MSBuildProps) = + let dir = Path.Combine(__SOURCE_DIRECTORY__, "../") + Utils.runProcess "dotnet" $"build -c Release HistoricalBenchmark.fsproj" dir msBuildProps + Utils.runProcess "dotnet" $"run -c Release --no-build --project HistoricalBenchmark.fsproj -- --filter *DecentlySizedStandAloneFileBenchmark* -a {outputDir}" dir msBuildProps + +/// Benchmarking current codebase +[] +module Local = + let build () = + Build.buildFCS @"..\..\..\..\" + + let benchmark (outputDir : string) = + let msBuildArgs = Build.MSBuildProps.makeProject @"..\..\..\..\src\Compiler\FSharp.Compiler.Service.fsproj" + Build.runBenchmark outputDir msBuildArgs + +/// Benchmarking a version of FCS from Nuget +[] +module NuGet = + let private source = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" + let private packageId = "FSharp.Compiler.Service" + + let private getAllVersionsMetadata () = + let cache = new SourceCacheContext() + let repo = Repository.Factory.GetCoreV3(source); + let resource = repo.GetResourceAsync() |> Async.AwaitTask |> Async.RunSynchronously + resource.GetMetadataAsync(packageId, true, false, cache, NullLogger.Instance, CancellationToken.None) + |> Async.AwaitTask + |> Async.RunSynchronously + |> Seq.toList + + let allVersionsMetadata = lazy getAllVersionsMetadata + + /// Fetch a given version of FCS into the global packages folder + let private downloadPackage (version : NuGetVersion) = + let logger = NullLogger.Instance + let cancellationToken = CancellationToken.None + + let settings = Settings.LoadDefaultSettings(null) + let globalPackagesFolder = SettingsUtility.GetGlobalPackagesFolder(settings); + + let cache = new SourceCacheContext(); + let repository = Repository.Factory.GetCoreV3(source); + let resource = repository.GetResourceAsync() |> Async.AwaitTask |> Async.RunSynchronously + + // Download the package + use packageStream = new MemoryStream() + resource.CopyNupkgToStreamAsync(packageId, version, packageStream, cache, logger, cancellationToken) + |> Async.AwaitTask |> Async.RunSynchronously + |> ignore + + packageStream.Seek(0, SeekOrigin.Begin) + |> ignore + + // Add it to the global package folder + GlobalPackagesFolderUtility.AddPackageAsync(source, + PackageIdentity(packageId, version), + packageStream, + globalPackagesFolder, + Guid.Empty, + ClientPolicyContext.GetClientPolicy(settings, logger), + logger, + cancellationToken + ) + |> Async.AwaitTask |> Async.RunSynchronously + |> ignore + + let resolvePackageRevision (v : NuGetVersion) = + printfn $"Downloading FCS package version {v} to find out its revision" + downloadPackage v + let settings = Settings.LoadDefaultSettings(null) + let globalPackagesFolder = SettingsUtility.GetGlobalPackagesFolder(settings) + let path = Path.Combine(globalPackagesFolder, packageId, v.OriginalVersion, "lib", "netstandard2.0", "FSharp.Compiler.Service.dll") + let vi = FileVersionInfo.GetVersionInfo(path) + let pv = vi.ProductVersion + match Regex.Match(pv, "\+([a-zA-Z0-9]+)$") with + | r when r.Success -> r.Groups[1].Value + | _ -> failwith $"Couldn't match product version {pv}" + + let findVersionMetadata (version : string) = + allVersionsMetadata.Value() + |> List.find (fun v -> v.Identity.Version.OriginalVersion = version) + + let findVersionDate (version : NuGetVersion) = + version.OriginalVersion + |> findVersionMetadata + |> fun metadata -> metadata.Published.Value.UtcDateTime + + let getMetadataVersion (metadata : IPackageSearchMetadata) = + metadata.Identity.Version + + let findVersion (versionString : string) = + versionString + |> findVersionMetadata + |> getMetadataVersion + + let benchmark (outputDir : string) (version : NuGetVersion) = + Build.runBenchmark outputDir (Build.MSBuildProps.makeNuGet version) + +type RunConfig = + { + /// Used to identify a set of BDN artifacts - set to a unique value unless you want to reuse (partial) results from previous runs + Time : DateTime + /// Used to store checkouts and BDN artifacts - set to a valid local absolute path + BaseDir : string + /// How many revisions should be checked out and built in parallel + Parallelism : int + /// Name to suffx the benchmark result files with + ResultsSuffix : string + /// Whether to build local codebases before benchmarking + BuildLocalCodebases : bool + } + with + member this.CheckoutBaseDir = Path.Combine(this.BaseDir, "checkouts") + member this.BDNOutputBaseDir = Path.Combine(this.BaseDir, "bdns") + +module RunConfig = + let makeDefault () = + { + Time = DateTime.UtcNow + BaseDir = "." + Parallelism = 1 + ResultsSuffix = "results" + BuildLocalCodebases = false + } + +/// Benchmarking a specific git revision of FCS +[] +module Git = + open LibGit2Sharp + + let clone (path : string) : Repository = + printfn $"Fetching 'dotnet/fsharp.git' in '{path}'..." + Repository.Init(path) |> ignore + let repo = new Repository(path) + let remote = repo.Network.Remotes.Add("origin", "https://github.com/dotnet/fsharp.git") + repo.Network.Fetch(remote.Name, []) + repo + + let checkout (commit : string) (repo : Repository) : unit = + printfn $"Checkout {commit} in {repo.Info.Path}" + Commands.Checkout(repo, commit) |> ignore + + let revisionDir (baseDir : string) (revision : string) = + Path.Combine(baseDir, revision) + + let prepareRevisionCheckout (baseDir : string) (revision : string) = + let dir = revisionDir baseDir revision + if Repository.IsValid dir |> not then + printfn $"Checking out revision {revision} in {dir}" + try Directory.Delete dir with _ -> () + use repo = clone dir + checkout revision repo + else + printfn $"{revision} already checked out in {dir}" + + let private fcsDllPath (checkoutDir : string) = + Path.Combine(checkoutDir, "artifacts/bin/FSharp.Compiler.Service/Release/netstandard2.0/FSharp.Compiler.Service.dll") + + let private fsharpCoreDllPath (rootDir : string) = + (fcsDllPath rootDir).Replace("FSharp.Compiler.Service.dll", "FSharp.Core.dll") + + let checkoutContainsBuiltFcs (checkoutDir : string) = + File.Exists(fcsDllPath checkoutDir) + + let private prepareRevisionBuild (checkoutsBaseDir : string) (revision : string) = + let dir = revisionDir checkoutsBaseDir revision + if checkoutContainsBuiltFcs dir |> not then + printfn $"'{fcsDllPath dir}' doesn't exist - building revision {revision} in {dir}..." + Build.buildFCS dir + else + printfn $"{revision} already built in {dir}" + + let checkoutAndBuild (checkoutsBaseDir : string) (revision : string) = + prepareRevisionCheckout checkoutsBaseDir revision + prepareRevisionBuild checkoutsBaseDir revision + + let private prepareMainRepo (config : RunConfig) = + let dir = revisionDir config.CheckoutBaseDir "main" + if Directory.Exists dir then new Repository(dir) + else clone dir + + let findCommitsBetweenInclusive (config : RunConfig) (older : Commit) (newer : Commit) = + let repo = prepareMainRepo config + let filter : CommitFilter = CommitFilter(IncludeReachableFrom=newer, ExcludeReachableFrom=older) + repo.Commits.QueryBy(filter) + |> Seq.toList + |> fun l -> + if l |> List.contains older then l + else l @ [older] + + /// Some revisions don't build - exclude them + let excludeBadCommits (badCommits : string list) (commits : Commit list) = + let knownBadCommits = badCommits + let goodCommits = commits |> List.filter (fun c -> knownBadCommits |> List.contains c.Sha |> not) + printfn $"Resolved {goodCommits.Length} valid commits out of {goodCommits.Length}" + goodCommits + + let benchmark (checkoutsBaseDir : string) (bdnOutputDir : string) (commitHash: string) = + checkoutAndBuild checkoutsBaseDir commitHash + let root = revisionDir checkoutsBaseDir commitHash + let fcsDll = fcsDllPath root + let fsharpCoreDll = fsharpCoreDllPath root + + printfn $"Benchmarking revision {commitHash}, fcsDllPath={fcsDll} fsharpCoreDll={fsharpCoreDll}" + if File.Exists(fcsDll) |> not then + failwith $"{fcsDll} doesn't exist" + if File.Exists(fsharpCoreDll) |> not then + failwith $"{fsharpCoreDll} doesn't exist" + let msBuildArgs = Build.MSBuildProps.makeDll fcsDll fsharpCoreDll + Build.runBenchmark bdnOutputDir msBuildArgs + + let findCommit (config : RunConfig) (revision : string) = + let repo = prepareMainRepo config + repo.Lookup(revision) + + let findCommitDate (config : RunConfig) (revision : string) = + let commit = findCommit config revision + commit.Committer.When + +[] +type FCSVersion = + /// The current local codebase + | Local + /// A given version of the FCS NuGet package + | NuGet of NuGetVersion + /// A given Git revision of dotnet/fsharp + | Git of string + override this.ToString() = + match this with + | Local -> "local" + | NuGet version -> $"v{version}" + | Git revision -> $"git_{revision}" + member this.ShortName() = + match this with + | Local -> "local" + | NuGet version -> $"v{version}" + | Git revision -> $"git_{revision.Substring(0, 8)}" + +type RunResults = + { + MeanS : double + AllocatedMB : double + } + +type Run = + { + Version : FCSVersion + VersionTime : DateTime + Results : RunResults + } + +let getVersionDate (config : RunConfig) (version : FCSVersion) = + match version with + | FCSVersion.Local -> DateTime.UtcNow + | FCSVersion.Git revision -> (Git.findCommitDate config revision).UtcDateTime + | FCSVersion.NuGet version -> NuGet.findVersionDate version + +module Runner = + let makeChart (results : Run list) = + let results = + results + |> List.sortBy (fun r -> r.VersionTime) + let x = + results + |> List.map (fun r -> + let time = r.VersionTime.ToString("yyyy-MM-dd") + $"{r.Version.ShortName()} - {time}" + ) + + let getMeanMS {Results = {MeanS = mean}} = Math.Round(mean / 1000000.0, 2) + let getAllocatedMB { Results = {AllocatedMB = allocated}} = Math.Round(allocated / 1024.0 / 1024.0, 2) + + let meanMS = (x, (results |> List.map getMeanMS)) ||> List.zip + let allocatedMB = (x, (results |> List.map getAllocatedMB)) ||> List.zip + + let meanLine = Chart.Line(meanMS, Name="Mean (ms)") + let allocatedLine = Chart.Line(allocatedMB, Name="Allocated (MB)") + + Chart.combine([meanLine;allocatedLine]) + + let exportEntriesAsJson (path : string) (entries : Run list) = + printfn $"Saving {entries.Length} aggregate results as JSON in {path}" + File.WriteAllText(path, JsonConvert.SerializeObject(entries, Formatting.Indented)) + + let exportEntriesAsCsv (path : string) (entries : Run list) = + printfn $"Saving {entries.Length} aggregate results as CSV in {path}" + let header = "Version,MeanS,AllocatedMB" + let csv = + entries + |> List.map (fun x -> $"{x.Version},{x.Results.MeanS},{x.Results.AllocatedMB}") + |> fun rows -> header :: rows + |> fun lines -> String.Join(Environment.NewLine, lines) + File.WriteAllText(path, csv) + + let bdnBaseDir (config : RunConfig) = + Path.Combine(config.BDNOutputBaseDir, config.Time.ToString("yyyy-MM-dd_HH-mm")) + + let exportEntries (config : RunConfig) (entries : Run list) : GenericChart = + let dir = Path.Combine(bdnBaseDir config, config.ResultsSuffix) + Directory.CreateDirectory dir |> ignore + let pathWithoutExtension = Path.Combine(dir, "results") + exportEntriesAsJson (pathWithoutExtension + ".json") entries + exportEntriesAsCsv (pathWithoutExtension + ".csv") entries + let chart = makeChart entries + let htmlPath = pathWithoutExtension + ".html" + printfn $"Saving chart for {entries.Length} results as HTML in {htmlPath}" + Chart.saveHtml (htmlPath, false) chart + chart + + let getBdnArtifactDir (bdnsBaseDir : string) (version : FCSVersion) = + Path.Combine(bdnsBaseDir, $"{version}") + + let resultsJsonPath (bdnArtifactDir : string) = + Path.Combine(bdnArtifactDir, @"results/HistoricalBenchmark.DecentlySizedStandAloneFileBenchmark-report.json") + + let readBDNJsonResults (bdnArtifactDir : string) = + let json = File.ReadAllText(resultsJsonPath bdnArtifactDir) + JsonConvert.DeserializeObject(json) + + let extractResultsFromJson (summary : JObject) : RunResults = + let benchmark = summary["Benchmarks"][0] + let stats = benchmark["Statistics"] + let mean = stats["Mean"].ToString() |> Double.Parse + + let metrics = benchmark["Metrics"] :?> JArray + let am = + let found = + metrics + |> Seq.find (fun m -> (m["Descriptor"]["Id"]).ToString() = "Allocated Memory") + found["Value"].ToString() |> Double.Parse + + { MeanS = mean; AllocatedMB = am } + + let bdnResultExists (config : RunConfig) (v : FCSVersion) = + let dir = getBdnArtifactDir (bdnBaseDir config) v + let jsonReportPath = resultsJsonPath dir + File.Exists jsonReportPath + + let benchmark (config : RunConfig) (version : FCSVersion) = + let outputDir = getBdnArtifactDir (bdnBaseDir config) version + if bdnResultExists config version then + printfn $"Benchmark result for '{version}' already exists in: {outputDir}" + Ok () + else + printfn $"Benchmarking '{version}' - output dir: {outputDir}" + try + match version with + | FCSVersion.Local -> + Local.benchmark outputDir + | FCSVersion.Git revision -> + Git.benchmark config.CheckoutBaseDir outputDir revision + | FCSVersion.NuGet version -> + NuGet.benchmark outputDir version + printfn $"Benchmarking '{version}' done" + Ok () + with e -> + printfn $"Failed to benchmark {version}: {e.Message}" + e.Message|> Error + + let loadResultsFromDisk (config : RunConfig) (v : FCSVersion) = + try + let bdnDir = getBdnArtifactDir (bdnBaseDir config) v + { + Version = v + VersionTime = getVersionDate config v + Results = readBDNJsonResults bdnDir |> extractResultsFromJson + } + |> Ok + with e -> + Error e.Message + + /// Prepare version but don't run any benchmarks + let prepareVersion (config : RunConfig) (version : FCSVersion) = + printfn $"*** Preparing version {version}" + match version with + | FCSVersion.Git revision -> + async { + try + Git.checkoutAndBuild config.CheckoutBaseDir revision + with e -> + printfn $"*** {nameof(Git.prepareRevisionCheckout)} {revision} failed: {e.Message}" + } + |> Some + | FCSVersion.Local + | FCSVersion.NuGet _ -> None + + let prepareVersions (config : RunConfig) (parallelism : int) (versions : FCSVersion list) = + printfn $"Preparing {versions.Length} versions" + versions + |> List.choose (prepareVersion config) + |> List.toArray + |> fun jobs -> Async.Parallel(jobs, parallelism) + |> Async.RunSynchronously + |> ignore + + let runAll (config : RunConfig) (versions : FCSVersion list) = + printfn $"*** Preparing and running benchmarks for the following {versions.Length} versions:" + versions |> List.iter (fun v -> printfn $"- {v}") + prepareVersions config config.Parallelism versions + let found, notFound = versions |> List.partition (bdnResultExists config) + printfn $"*** {found.Length}/{versions.Length} versions have existing benchmark results - will only run benchmarks for the remaining {notFound.Length}" + let results = + versions + |> List.mapi (fun i v -> + printfn $"*** Benchmark {v} [{i+1}/{versions.Length}]" + v, benchmark config v + ) + |> List.choose (function (v, Ok()) -> Some v | _ -> None) + |> List.map (loadResultsFromDisk config) + |> List.choose (function Ok run -> Some run | _ -> None) + printfn $"*** After running benchmarks {results.Length} reports are now available - exporting to files and showing a chart." + exportEntries config results diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj new file mode 100644 index 00000000000..d6468724731 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj @@ -0,0 +1,60 @@ + + + + Exe + net6 + true + Release + + + + true + true + + + + project + ..\..\..\..\src\Compiler\FSharp.Compiler.Service.fsproj + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(FcsDllPath) + + + $(FSharpCoreDllPath) + + + + + + + + diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Program.fs b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Program.fs index d60a6dabe40..779a18a7709 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Program.fs +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/Program.fs @@ -1,11 +1,36 @@ - +namespace HistoricalBenchmark + open System.IO -open System.Reflection +open BenchmarkDotNet.Attributes open BenchmarkDotNet.Running -open BenchmarkComparison -[] -let main _ = - BenchmarkRunner.Run() |> ignore - 0 +[] +type SingleFileCompilerBenchmarkBase(compiler : SingleFileCompiler) = + [] + member _.Setup() = + compiler.Setup() + + [] + member _.Run() = + compiler.Run() + + [] + member _.Cleanup() = + compiler.Cleanup() + +[] +[] +type DecentlySizedStandAloneFileBenchmark() = + inherit SingleFileCompilerBenchmarkBase( + SingleFileCompiler( + Path.Combine(__SOURCE_DIRECTORY__, "../decentlySizedStandAloneFile.fs"), + OptionsCreationMethod.CmdlineArgs + ) + ) + +module Benchmark = + [] + let main args = + BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args) |> ignore + 0 \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/README.md b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/README.md index d24c6ad5216..d3bd6c823e6 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/README.md +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/README.md @@ -2,19 +2,41 @@ ## What is it -* A meta-benchmark that compares performance between versions of the FCS codebase for a single-file codebase. -* Notebook-based, see `runner.ipynb`. -* Specified versions of FCS are downloaded from GitHub, built and benchmarked. -* Individual runs involve running a BDN benchmark in a separate process. -* Each run tests `FSharpChecker.ParseAndCheckFileInProject` on a single file (see `decentlySizedStandAloneFile.fs`). +- A meta-benchmark that compares performance between versions of the FCS codebase for a single file. +- Notebook-based, see `runner.ipynb`. +- Each run performs `FSharpChecker.ParseAndCheckFileInProject` on a single file (see `../decentlySizedStandAloneFile.fs`). ## How to run it -*TODO* +To run a benchmark for a local FCS in the current codebase you can run the benchmark directly: + +```dotnet run --project HistoricalBenchmark.fsproj -c Release --filter *``` + +To run a comparison use the `runner.ipynb` .NET notebook + +## How it works + +- `runner.ipynb` runs `HistoricalBenchmark.fsproj` for a selection of versions/commits/local codebases. +- Individual runs involve running a BDN benchmark in a separate process (via `HistoricalBenchmark.fsproj`). +- For each version: + 1. For a commit-based run we fetch FCS at a given revision from GitHub into a temporary folder and build it via `build.cmd` + 2. `HistoricalBenchmark.fsproj` is built with custom MSBuild properties that reference FCS in a specific way (project/package or dll reference) + 3. We run `HistoricalBenchmark` which is a BDN benchmark + 4. `runner.ipynb` then parses CSV results from all runs and plots a chart + +## `HistoricalBenchmark` and backwards compatibility + +Due to the requirement to run the same benchmark on older versions of the codebase and minor changes in the API, code in `HistoricalBenchmark` can be compiled in three different ways by adding one of the following DEFINEs: +- `SERVICE_13_0_0` +- `SERVICE_30_0_0` +- _none_ (default, uses latest API) + +As of now the minimum supported version of FCS is 13.0.0 ## Sample results -*TODO* +Below is a sample result of running the notebook locally with a selection of versions: +![a](./sample_result.png?raw=true) ## Other diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/SingleFileCompiler.fs b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/SingleFileCompiler.fs new file mode 100644 index 00000000000..6e1efa64f80 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/SingleFileCompiler.fs @@ -0,0 +1,75 @@ +// Code in this file supports older versions of the compiler via preprocessor directives using the following DEFINEs: +// - SERVICE_13_0_0 +// - SERVICE_30_0_0 +// - latest (no DEFINE set) +// The purpose is to allow running the same benchmark old different historical versions for comparison. + +namespace HistoricalBenchmark + +#if SERVICE_13_0_0 +open Microsoft.FSharp.Compiler.SourceCodeServices +#else +#if SERVICE_30_0_0 +open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text +#else +open FSharp.Compiler.CodeAnalysis +#endif +#endif + +type private SingleFileCompilerConfig = + { + Checker : FSharpChecker + Options : FSharpProjectOptions + } + +[] +type OptionsCreationMethod = + | CmdlineArgs + | FromScript + +/// Performs compilation (FSharpChecker.ParseAndCheckFileInProject) on the given file +type SingleFileCompiler(filePath: string, optionsCreationMethod : OptionsCreationMethod) = + + let mutable configOpt : SingleFileCompilerConfig option = None + + member _.Setup() = + configOpt <- + match configOpt with + | Some _ -> configOpt + | None -> + let checker = FSharpChecker.Create(projectCacheSize = 200) + let options = + match optionsCreationMethod with + | OptionsCreationMethod.CmdlineArgs -> + let args = Helpers.makeCmdlineArgsWithSystemReferences filePath + checker.GetProjectOptionsFromCommandLineArgs(filePath, args) + | OptionsCreationMethod.FromScript -> + checker.GetProjectOptionsFromScript(filePath, Helpers.getFileSourceText filePath) + |> Async.RunSynchronously + |> fst + { + Checker = checker + Options = options + } + |> Some + + member _.Run() = + match configOpt with + | None -> failwith "Setup not run" + | Some {Checker = checker; Options = options} -> + let _, result = + checker.ParseAndCheckFileInProject(filePath, 0, Helpers.getFileSourceText filePath, options) + |> Async.RunSynchronously + match result with + | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" + | FSharpCheckFileAnswer.Succeeded results -> + Helpers.failOnErrors results + + abstract member Cleanup : unit -> unit + default _.Cleanup() = + match configOpt with + | None -> failwith "Setup not run" + | Some {Checker = checker} -> + checker.InvalidateAll() + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run.fsproj deleted file mode 100644 index 7bae666b94c..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run.fsproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - Exe - net6 - true - Release - - - - true - true - - - - - - - - - - - diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run_current.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run_current.fsproj deleted file mode 100644 index 7f417d9a002..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/run_current.fsproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - Exe - net6 - true - Release - - - - true - true - - - - - - - - - - - diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb index bda88e2e313..720292f1ee3 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/runner.ipynb @@ -3,220 +3,123 @@ { "cell_type": "code", "execution_count": null, - "source": [ - "#r \"nuget: Plotly.NET, 2.0.0-preview.6\"\r\n", - "#r \"nuget: Plotly.NET.Interactive, 2.0.0-preview.6\"\r\n", - "#r \"nuget: Microsoft.Data.Analysis, 0.18.0\"\r\n", - "\r\n", - "open System.IO\r\n", - "open System.Diagnostics\r\n", - "open Microsoft.Data.Analysis\r\n", - "open Plotly.NET\r\n", - "\r\n", - "let parseMilliseconds (str: string) =\r\n", - " if str.Contains(\" ms\") then\r\n", - " Single.Parse(str.Replace(\" ms\", \"\"))\r\n", - " elif str.Contains(\" s\") then\r\n", - " Single.Parse(str.Replace(\" s\", \"\")) * 1000.f\r\n", - " else\r\n", - " failwith \"Invalid string\"\r\n", - "\r\n", - "let parseAllocated (str: string) =\r\n", - " if str.Contains(\" MB\") then\r\n", - " Single.Parse(str.Replace(\" MB\", \"\"))\r\n", - " elif str.Contains(\" KB\") then\r\n", - " Single.Parse(str.Replace(\" KB\", \"\")) / 1024.f\r\n", - " else\r\n", - " failwith \"Invalid string\"\r\n", - "\r\n", - "let run name args workingDir =\r\n", - " let info = ProcessStartInfo()\r\n", - " info.WindowStyle <- ProcessWindowStyle.Hidden\r\n", - " info.Arguments <- args\r\n", - " info.FileName <- name\r\n", - " info.UseShellExecute <- false\r\n", - " info.WorkingDirectory <- workingDir\r\n", - " info.RedirectStandardError <- true\r\n", - " info.RedirectStandardOutput <- true\r\n", - " info.RedirectStandardInput <- true\r\n", - " info.CreateNoWindow <- true\r\n", - " let p = Process.Start(info)\r\n", - " p.WaitForExit()\r\n", - " let errors = p.StandardError.ReadToEnd()\r\n", - " p.StandardOutput.ReadToEnd() |> ignore\r\n", - " p.WaitForExit()\r\n", - " if p.ExitCode <> 0 then\r\n", - " failwith $\"Process {name} {args} failed: {errors}.\"\r\n", - "\r\n", - "let resultsPath = Path.Combine(__SOURCE_DIRECTORY__, \"BenchmarkDotNet.Artifacts\\\\results\\\\BenchmarkComparison.TypeCheckingBenchmark1-report.csv\")\r\n", - "\r\n", - "let benchmarkCurrent(): string * DataFrame =\r\n", - " printfn \"Benchmarking Current (Today)...\"\r\n", - " run \"dotnet\" \"run -c Release --project run_current.fsproj\" __SOURCE_DIRECTORY__\r\n", - " let df = DataFrame.LoadCsv(resultsPath)\r\n", - " printfn \"Current (Today) Done\"\r\n", - " (\"Current (Today)\", df)\r\n", - "\r\n", - "let benchmarkVersion (name: string) (version: string) (constants: string): string * DataFrame =\r\n", - " try File.Delete(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\")) with | _ -> ()\r\n", - " try\r\n", - " printfn $\"Benchmarking {name}...\"\r\n", - " let setupTemplate = File.ReadAllText(Path.Combine(__SOURCE_DIRECTORY__, \"setup_version_template.fsproj\"))\r\n", - " let setup = setupTemplate.Replace(\"{TEMPLATE_FCS_VERSION}\", version).Replace(\"{TEMPLATE_DEFINE_CONSTANTS}\", constants)\r\n", - " File.WriteAllText(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\"), setup)\r\n", - " run \"dotnet\" \"run -c Release --project run.fsproj\" __SOURCE_DIRECTORY__\r\n", - "\r\n", - " let df = DataFrame.LoadCsv(resultsPath)\r\n", - " printfn $\"{name} Done\"\r\n", - " (name, df)\r\n", - " finally\r\n", - " try File.Delete(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\")) with | _ -> ()\r\n", - "\r\n", - "let benchmarkCommit (commitHash: string) (constants: string): string * DataFrame =\r\n", - " try File.Delete(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\")) with | _ -> ()\r\n", - " let tmp = Path.GetTempFileName()\r\n", - " try File.Delete(tmp) with | _ -> ()\r\n", - " let tmpDir = Path.Combine(Path.GetDirectoryName(tmp), Path.GetFileNameWithoutExtension(tmp))\r\n", - " Directory.CreateDirectory(tmpDir) |> ignore\r\n", - "\r\n", - " try\r\n", - " let fcsOutputPath = Path.Combine(tmpDir, \"artifacts/bin/FSharp.Compiler.Service/Release/netstandard2.0/FSharp.Compiler.Service.dll\")\r\n", - " printfn $\"Cloning 'dotnet/fsharp.git' in '{tmpDir}'...\"\r\n", - " run \"git\" $\"clone https://github.com/dotnet/fsharp.git {tmpDir}\" __SOURCE_DIRECTORY__\r\n", - " printfn $\"Switching to '{commitHash}'...\"\r\n", - " run \"git\" $\"reset --hard {commitHash}\" tmpDir\r\n", - " printfn \"Building fsharp...\"\r\n", - " run \"cmd\" \"/C build.cmd -c Release\" tmpDir\r\n", - " \r\n", - " printfn $\"Benchmarking {commitHash}...\"\r\n", - " let setupTemplate = File.ReadAllText(Path.Combine(__SOURCE_DIRECTORY__, \"setup_commit_template.fsproj\"))\r\n", - " let setup = setupTemplate.Replace(\"{TEMPLATE_FCS_PATH}\", fcsOutputPath).Replace(\"{TEMPLATE_DEFINE_CONSTANTS}\", constants)\r\n", - " File.WriteAllText(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\"), setup)\r\n", - " run \"dotnet\" \"run -c Release --project run.fsproj\" __SOURCE_DIRECTORY__\r\n", - "\r\n", - " let df = DataFrame.LoadCsv(resultsPath)\r\n", - " printfn $\"{commitHash} Done\"\r\n", - " (commitHash, df)\r\n", - " finally\r\n", - " try File.Delete(Path.Combine(__SOURCE_DIRECTORY__, \"setup.fsproj\")) with | _ -> ()\r\n", - " try Directory.Delete(tmpDir) with | _ -> ()" - ], - "outputs": [ - { - "data": { - "text/html": [ - "
Installed Packages
  • Microsoft.Data.Analysis, 0.18.0
  • Plotly.NET, 2.0.0-preview.6
  • Plotly.NET.Interactive, 2.0.0-preview.6
" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], "metadata": { "dotnet_interactive": { "language": "fsharp" + }, + "vscode": { + "languageId": "dotnet-interactive.fsharp" } - } + }, + "outputs": [], + "source": [ + "#r \"nuget: NuGet.Protocol, 6.2.1\"\n", + "#r \"nuget: Plotly.NET, 3.0.0\"\n", + "#r \"nuget: Plotly.NET.Interactive, 3.0.0\"\n", + "#r \"nuget: LibGit2Sharp, 0.26.2\"\n", + "#r \"nuget: BenchmarkDotnet, 0.13.1\"\n", + "#r \"../../../../artifacts/bin/HistoricalBenchmark.Runner/Release/net6.0/HistoricalBenchmark.Runner.dll\"\n", + "\n", + "open HistoricalBenchmark.Runner\n", + "\n", + "let config =\n", + " {\n", + " RunConfig.Time = DateTime(2022, 7, 12, 8, 19, 0)\n", + " // Set to a valid local absolute path\n", + " BaseDir = \"d:/benchmarks\"\n", + " Parallelism = 3\n", + " ResultsSuffix = \"results\"\n", + " BuildLocalCodebases = false\n", + " }" + ] }, { "cell_type": "code", "execution_count": null, - "source": [ - "let benchmarkData =\r\n", - " [\r\n", - " // Note: SERVICE_30_0_0 and SERVICE_13_0_0 refer to define constants in order to build the benchmark on older versions.\r\n", - " benchmarkCurrent()\r\n", - " //benchmarkCommit doesn't fully work yet\r\n", - " //benchmarkCommit \"81d1d918740e9ba3cb2eb063b6f28c3139ca9cfa\" \"\"\r\n", - " //benchmarkCommit \"1d36c75225436f8a7d30c4691f20d6118b657fec\" \"\"\r\n", - " //benchmarkCommit \"2e4096153972abedae142da85cac2ffbcf57fe0a\" \"\"\r\n", - " //benchmarkCommit \"af6ff33b5bc15951a6854bdf3b226db8f0e28b56\" \"\"\r\n", - " benchmarkVersion \"40.0.0 (6/22/2021)\" \"40.0.0\" \"\"\r\n", - " benchmarkVersion \"35.0.0 (4/10/2020)\" \"35.0.0\" \"SERVICE_30_0_0\"\r\n", - " benchmarkVersion \"30.0.0 (6/29/2019)\" \"30.0.0\" \"SERVICE_30_0_0\"\r\n", - " benchmarkVersion \"25.0.1 (9/5/2018)\" \"25.0.1\" \"SERVICE_13_0_0\"\r\n", - " benchmarkVersion \"20.0.1 (2/21/2018)\" \"20.0.1\" \"SERVICE_13_0_0\"\r\n", - " benchmarkVersion \"13.0.0 (6/28/2017)\" \"13.0.0\" \"SERVICE_13_0_0\"\r\n", - " ]" - ], - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Cloning 'dotnet/fsharp.git' in 'C:\\Users\\lolti\\AppData\\Local\\Temp\\tmp286'...\r\n", - "Switching to '81d1d918740e9ba3cb2eb063b6f28c3139ca9cfa'...\r\n", - "Building fsharp...\r\n" - ] + "metadata": { + "dotnet_interactive": { + "language": "fsharp" }, - { - "output_type": "error", - "ename": "Error", - "evalue": "System.OperationCanceledException: Command :SubmitCode: let benchmarkData =\r\n [\r\n // Note: SERVI ... cancelled.", - "traceback": [ - "System.OperationCanceledException: Command :SubmitCode: let benchmarkData =\r\n", - " [\r\n", - " // Note: SERVI ... cancelled." - ] + "vscode": { + "languageId": "dotnet-interactive.fsharp" } - ], + }, + "outputs": [], + "source": [ + "// let newerVersion = findVersion \"40.0.1-preview.21352.5\"\n", + "// let olderVersion = findVersion \"40.0.0\"\n", + "// let newerRevision = NuGet.resolvePackageRevision newerVersion\n", + "// let olderVersion = NuGet.resolvePackageRevision olderVersion\n", + "\n", + "// Find all commits between the two\n", + "let newerRevision = \"cb3692bf5d5af46b075c50d4f802f09152fb6b67\"\n", + "let olderRevision = \"4d330f37ae740adccd2586d568b6d45d2c408fad\"\n", + "let cNewer, cOlder = Git.findCommit config newerRevision, Git.findCommit config olderRevision\n", + "let versions =\n", + " Git.findCommitsBetweenInclusive config cOlder cNewer |> Seq.toList\n", + " |> Git.excludeBadCommits [\"679e11c533ad6c408723cf9b227a57be23fb51db\"]\n", + " |> List.map (fun c -> FCSVersion.Git c.Sha)\n", + "// Fetch, build and run benchmarks for all of them\n", + "Runner.runAll {config with ResultsSuffix = \"between_2_nuget_versions\"} versions" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": { "dotnet_interactive": { "language": "fsharp" + }, + "vscode": { + "languageId": "dotnet-interactive.fsharp" } - } + }, + "outputs": [], + "source": [ + "// Find two latest NuGet versions of FCS (including prereleases), run benchmarks and export results\n", + "NuGet.allVersionsMetadata.Value()\n", + "|> List.take 10\n", + "|> List.map (fun metadata -> FCSVersion.NuGet metadata.Identity.Version)\n", + "|> Runner.runAll {config with ResultsSuffix = \"10_latest_nuget_versions\"}" + ] }, { "cell_type": "code", "execution_count": null, - "source": [ - "// Data cleanup\r\n", - "\r\n", - "let df =\r\n", - " (benchmarkData.[0] |> snd, benchmarkData.[1..])\r\n", - " ||> List.fold (fun df (_, df2) ->\r\n", - " df.Append(df2.Rows)\r\n", - " )\r\n", - "\r\n", - "let x =\r\n", - " benchmarkData\r\n", - " |> List.map (fun (name, _) -> name)\r\n", - "\r\n", - "let meanColumn = df.Columns.[\"Mean\"]\r\n", - "let allocatedColumn = df.Columns.[\"Allocated\"]\r\n", - "\r\n", - "let y1 =\r\n", - " [\r\n", - " for i = 0L to meanColumn.Length - 1L do\r\n", - " meanColumn.[i] :?> string\r\n", - " |> parseMilliseconds\r\n", - " ]\r\n", - "let meanData = (x, y1) ||> List.zip |> List.rev\r\n", - "let y2 =\r\n", - " [\r\n", - " for i = 0L to allocatedColumn.Length - 1L do\r\n", - " allocatedColumn.[i] :?> string\r\n", - " |> parseAllocated\r\n", - " ]\r\n", - "let allocatedData = (x, y2) ||> List.zip |> List.rev\r\n", - "\r\n", - "// Charts\r\n", - "\r\n", - "let meanLine = Chart.Line(meanData, Name=\"Mean (ms)\")\r\n", - "let allocatedLine = Chart.Line(allocatedData, Name=\"Allocated (MB)\")\r\n", - "\r\n", - "Chart.Combine([meanLine;allocatedLine])" - ], - "outputs": [], "metadata": { "dotnet_interactive": { "language": "fsharp" + }, + "vscode": { + "languageId": "dotnet-interactive.fsharp" } - } + }, + "outputs": [], + "source": [ + "let versions =\n", + " [\n", + " FCSVersion.Local\n", + " FCSVersion.Git \"4edcbb45365f96d4858f438a556b93d4a32ae219\"\n", + " FCSVersion.NuGet (NuGet.findVersion \"41.0.5-preview.22329.3\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"41.0.5\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"40.0.0\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"35.0.0\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"30.0.0\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"25.0.1\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"20.0.1\")\n", + " FCSVersion.NuGet (NuGet.findVersion \"13.0.0\")\n", + " ]\n", + " \n", + "Runner.runAll {config with ResultsSuffix = \"sample_versions\"} versions" + ] } ], "metadata": { - "orig_nbformat": 4, + "kernelspec": { + "display_name": ".NET (C#)", + "language": "C#", + "name": ".net-csharp" + }, "language_info": { "file_extension": ".cs", "mimetype": "text/x-csharp", @@ -224,11 +127,7 @@ "pygments_lexer": "csharp", "version": "9.0" }, - "kernelspec": { - "display_name": ".NET (C#)", - "language": "C#", - "name": ".net-csharp" - } + "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.csv b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.csv new file mode 100644 index 00000000000..e718aa5dd8d --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.csv @@ -0,0 +1,11 @@ +Version,MeanS,AllocatedMB +v41.0.5,373396345.9459459,286827416 +v41.0.5-preview.22329.3,386133361,288359960 +v41.0.5-preview.22327.2,376069890,288347416 +v41.0.5-preview.22305.1,377613916,288279296 +v41.0.4,365490276.9230769,286764440 +v41.0.4-preview.22203.2,361500627.7777778,286794528 +v41.0.4-preview.22181.2,376075749.01960784,286836120 +v41.0.3,369155025,286760992 +v41.0.3-preview.22123.2,383346165,286777408 +v41.0.2,363445603.7037037,286523448 \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.html b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.html new file mode 100644 index 00000000000..3cd44bf28d9 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.html @@ -0,0 +1,62 @@ + + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.json b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.json new file mode 100644 index 00000000000..7c75f1795c8 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/10_latest_nuget_versions/results.json @@ -0,0 +1,132 @@ +[ + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5" + ] + }, + "VersionTime": "2022-06-14T16:17:50Z", + "Results": { + "MeanS": 373396345.9459459, + "AllocatedMB": 286827416.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5-preview.22329.3" + ] + }, + "VersionTime": "2022-07-12T14:31:06Z", + "Results": { + "MeanS": 386133361.0, + "AllocatedMB": 288359960.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5-preview.22327.2" + ] + }, + "VersionTime": "2022-07-12T19:31:29Z", + "Results": { + "MeanS": 376069890.0, + "AllocatedMB": 288347416.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5-preview.22305.1" + ] + }, + "VersionTime": "2022-06-14T14:22:36Z", + "Results": { + "MeanS": 377613916.0, + "AllocatedMB": 288279296.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.4" + ] + }, + "VersionTime": "2022-05-10T15:33:19Z", + "Results": { + "MeanS": 365490276.9230769, + "AllocatedMB": 286764440.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.4-preview.22203.2" + ] + }, + "VersionTime": "2022-05-10T16:57:24Z", + "Results": { + "MeanS": 361500627.7777778, + "AllocatedMB": 286794528.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.4-preview.22181.2" + ] + }, + "VersionTime": "2022-04-19T15:24:15Z", + "Results": { + "MeanS": 376075749.01960784, + "AllocatedMB": 286836120.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.3" + ] + }, + "VersionTime": "2022-03-04T01:10:40Z", + "Results": { + "MeanS": 369155025.0, + "AllocatedMB": 286760992.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.3-preview.22123.2" + ] + }, + "VersionTime": "2022-04-13T17:24:43Z", + "Results": { + "MeanS": 383346165.0, + "AllocatedMB": 286777408.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.2" + ] + }, + "VersionTime": "2022-02-17T21:18:54Z", + "Results": { + "MeanS": 363445603.7037037, + "AllocatedMB": 286523448.0 + } + } +] \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/README.md b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/README.md new file mode 100644 index 00000000000..098d4f8a0c4 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/README.md @@ -0,0 +1,25 @@ +# Sample results +This folder contains a selection of results obtained by running the notebook located in `../runner.ipynb` + +## Timings are not accurate +The results were gathered on a busy machine without much care taken to provide a reliable performance environment. +While this means the timing metrics are not very useful, the results can still be useful for two reasons: +* allocation data is quite accurate as it doesn't tend to depend much on the environment +* they work as examples that can make using the benchmarks easier + +## Structure +Each directory contains 3 files output by `HistoricalBenchmark.Runner.runAll` function for a given selection of versions. + +The three different version sets are: +- `sample_versions` - an arbitrary selection featuring all three types of versions supported +- `between_2_nuget_versions` - all commits between two NuGet versions of FCS +- `10_latest_nuget_versions` - 10 FCS NuGet versions between `v41.0.2` and ``v41.0.5-preview.22327.2` + +## Observations +One thing that can be observed by looking at the results in `between_2_nuget_versions` is the noticable increase of allocations in https://github.com/dotnet/fsharp/pull/11517 + +While this isn't necessarily something worth addressing, partly because later revisions show reduced allocations, it shows how running a historical benchmark can be potentially useful. + +## Notes +- The metrics gathered here are very limited - much more data can be gathered from each benchmark. +- Such historical benchmarks run locally might be mostly deprecated once CI setup exists for performance tests that will provide the necessary historical information \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.csv b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.csv new file mode 100644 index 00000000000..514bc2b74ef --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.csv @@ -0,0 +1,20 @@ +Version,MeanS,AllocatedMB +git_cb3692bf5d5af46b075c50d4f802f09152fb6b67,434877200.53763443,284894480 +git_a5c5f93752107ef0198fc1c9fde9dd28695b2812,331581307.6923077,176122152 +git_a2f429c5968ae986d4a64086c48255a9a9679edf,333340964.28571427,176173728 +git_6b0e62cc5fc5dc59db8654c26d45746d8d1575a5,333900386.1111111,176090792 +git_306e3c52b5d55f780ff9045ecf5c5721a0e723e0,415544085.71428573,284852312 +git_b940196465155b644d27f20cbf8f0b9d7720ce35,327533800,176167216 +git_02114036157a4b8ae8d026bd0d7104ab5de61ff3,331101469.4444444,176126728 +git_cbfd0f6900cd2dad02404dfc5e9efb49cb80fe82,329015046.6666667,176163664 +git_ae277903f7c6e1757efc94a3e1e9433933f17a57,329314058.3333333,176177848 +git_2b64f212290cb26d97f08a9fb445402b4a871506,335215900,176139128 +git_67e853f732761567a28b3cc1848ac403195a2b95,332180889.28571427,176070128 +git_63b14da8ab73c50d5336503b7b46edff79dd5e9a,336142668.42105263,176123616 +git_fc42e0b5bbf5da03fbf04f0edd8195f7ebb26504,330602951.7241379,176084392 +git_b1fa25841d9f815b8cf918c32deba173eae77842,331167713.6363636,176168336 +git_16fe0b8c05d6ada6b906f8532009d31922b56665,326324297.72727275,176141536 +git_fbb0f3f2d8a6745eaecd83f4bf4a8814f0f8615d,327365134.375,176032480 +git_812b5a9b2e591062875e3021e50a7c34e097c6ff,328415031.4285714,176102472 +git_4edcbb45365f96d4858f438a556b93d4a32ae219,323065237.5,176081512 +git_4d330f37ae740adccd2586d568b6d45d2c408fad,331001475.8064516,176118592 \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.html b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.html new file mode 100644 index 00000000000..7d636144e90 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.html @@ -0,0 +1,62 @@ + + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.json b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.json new file mode 100644 index 00000000000..067217e74fb --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/between_2_nuget_versions/results.json @@ -0,0 +1,249 @@ +[ + { + "Version": { + "Case": "Git", + "Fields": [ + "cb3692bf5d5af46b075c50d4f802f09152fb6b67" + ] + }, + "VersionTime": "2021-05-10T19:41:31Z", + "Results": { + "MeanS": 434877200.53763443, + "AllocatedMB": 284894480.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "a5c5f93752107ef0198fc1c9fde9dd28695b2812" + ] + }, + "VersionTime": "2021-05-10T18:34:42Z", + "Results": { + "MeanS": 331581307.6923077, + "AllocatedMB": 176122152.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "a2f429c5968ae986d4a64086c48255a9a9679edf" + ] + }, + "VersionTime": "2021-05-10T17:36:53Z", + "Results": { + "MeanS": 333340964.28571427, + "AllocatedMB": 176173728.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "6b0e62cc5fc5dc59db8654c26d45746d8d1575a5" + ] + }, + "VersionTime": "2021-05-10T17:36:39Z", + "Results": { + "MeanS": 333900386.1111111, + "AllocatedMB": 176090792.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "306e3c52b5d55f780ff9045ecf5c5721a0e723e0" + ] + }, + "VersionTime": "2021-05-10T17:32:23Z", + "Results": { + "MeanS": 415544085.71428573, + "AllocatedMB": 284852312.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "b940196465155b644d27f20cbf8f0b9d7720ce35" + ] + }, + "VersionTime": "2021-05-08T17:41:29Z", + "Results": { + "MeanS": 327533800.0, + "AllocatedMB": 176167216.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "02114036157a4b8ae8d026bd0d7104ab5de61ff3" + ] + }, + "VersionTime": "2021-05-03T19:50:26Z", + "Results": { + "MeanS": 331101469.4444444, + "AllocatedMB": 176126728.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "cbfd0f6900cd2dad02404dfc5e9efb49cb80fe82" + ] + }, + "VersionTime": "2021-05-03T17:39:41Z", + "Results": { + "MeanS": 329015046.6666667, + "AllocatedMB": 176163664.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "ae277903f7c6e1757efc94a3e1e9433933f17a57" + ] + }, + "VersionTime": "2021-04-30T18:33:07Z", + "Results": { + "MeanS": 329314058.3333333, + "AllocatedMB": 176177848.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "2b64f212290cb26d97f08a9fb445402b4a871506" + ] + }, + "VersionTime": "2021-04-30T17:41:39Z", + "Results": { + "MeanS": 335215900.0, + "AllocatedMB": 176139128.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "67e853f732761567a28b3cc1848ac403195a2b95" + ] + }, + "VersionTime": "2021-04-30T17:40:41Z", + "Results": { + "MeanS": 332180889.28571427, + "AllocatedMB": 176070128.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "63b14da8ab73c50d5336503b7b46edff79dd5e9a" + ] + }, + "VersionTime": "2021-04-30T16:39:11Z", + "Results": { + "MeanS": 336142668.42105263, + "AllocatedMB": 176123616.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "fc42e0b5bbf5da03fbf04f0edd8195f7ebb26504" + ] + }, + "VersionTime": "2021-04-30T00:19:08Z", + "Results": { + "MeanS": 330602951.7241379, + "AllocatedMB": 176084392.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "b1fa25841d9f815b8cf918c32deba173eae77842" + ] + }, + "VersionTime": "2021-04-29T16:55:47Z", + "Results": { + "MeanS": 331167713.6363636, + "AllocatedMB": 176168336.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "16fe0b8c05d6ada6b906f8532009d31922b56665" + ] + }, + "VersionTime": "2021-04-29T06:56:03Z", + "Results": { + "MeanS": 326324297.72727275, + "AllocatedMB": 176141536.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "fbb0f3f2d8a6745eaecd83f4bf4a8814f0f8615d" + ] + }, + "VersionTime": "2021-04-28T18:39:31Z", + "Results": { + "MeanS": 327365134.375, + "AllocatedMB": 176032480.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "812b5a9b2e591062875e3021e50a7c34e097c6ff" + ] + }, + "VersionTime": "2021-04-27T22:22:15Z", + "Results": { + "MeanS": 328415031.4285714, + "AllocatedMB": 176102472.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "4edcbb45365f96d4858f438a556b93d4a32ae219" + ] + }, + "VersionTime": "2021-04-27T20:46:24Z", + "Results": { + "MeanS": 323065237.5, + "AllocatedMB": 176081512.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "4d330f37ae740adccd2586d568b6d45d2c408fad" + ] + }, + "VersionTime": "2021-04-29T04:41:39Z", + "Results": { + "MeanS": 331001475.8064516, + "AllocatedMB": 176118592.0 + } + } +] \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.csv b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.csv new file mode 100644 index 00000000000..dd646014402 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.csv @@ -0,0 +1,11 @@ +Version,MeanS,AllocatedMB +local,407125562.24489796,288379560 +git_4edcbb45365f96d4858f438a556b93d4a32ae219,323065237.5,176081512 +v41.0.5-preview.22329.3,386133361,288359960 +v41.0.5,373396345.9459459,286827416 +v40.0.0,330649644.4444444,177144704 +v35.0.0,328710979.71014494,192795088 +v30.0.0,272079184.2105263,177900568 +v25.0.1,308437262.1621622,192296968 +v20.0.1,411006163.6363636,355512464 +v13.0.0,1081577700,1014285288 \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.html b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.html new file mode 100644 index 00000000000..0d2ba777be0 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.html @@ -0,0 +1,62 @@ + + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.json b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.json new file mode 100644 index 00000000000..b38ecad1fbd --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/sample_results/sample_versions/results.json @@ -0,0 +1,129 @@ +[ + { + "Version": { + "Case": "Local" + }, + "VersionTime": "2022-07-13T19:36:29.1189338Z", + "Results": { + "MeanS": 407125562.24489796, + "AllocatedMB": 288379560.0 + } + }, + { + "Version": { + "Case": "Git", + "Fields": [ + "4edcbb45365f96d4858f438a556b93d4a32ae219" + ] + }, + "VersionTime": "2021-04-27T20:46:24Z", + "Results": { + "MeanS": 323065237.5, + "AllocatedMB": 176081512.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5-preview.22329.3" + ] + }, + "VersionTime": "2022-07-12T14:31:06Z", + "Results": { + "MeanS": 386133361.0, + "AllocatedMB": 288359960.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "41.0.5" + ] + }, + "VersionTime": "2022-06-14T16:17:50Z", + "Results": { + "MeanS": 373396345.9459459, + "AllocatedMB": 286827416.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "40.0.0" + ] + }, + "VersionTime": "2021-06-22T22:16:34Z", + "Results": { + "MeanS": 330649644.4444444, + "AllocatedMB": 177144704.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "35.0.0" + ] + }, + "VersionTime": "2021-02-09T23:24:33Z", + "Results": { + "MeanS": 328710979.71014494, + "AllocatedMB": 192795088.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "30.0.0" + ] + }, + "VersionTime": "2021-02-09T23:24:22Z", + "Results": { + "MeanS": 272079184.2105263, + "AllocatedMB": 177900568.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "25.0.1" + ] + }, + "VersionTime": "2021-02-09T23:24:36Z", + "Results": { + "MeanS": 308437262.1621622, + "AllocatedMB": 192296968.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "20.0.1" + ] + }, + "VersionTime": "2021-02-09T23:24:04Z", + "Results": { + "MeanS": 411006163.6363636, + "AllocatedMB": 355512464.0 + } + }, + { + "Version": { + "Case": "NuGet", + "Fields": [ + "13.0.0" + ] + }, + "VersionTime": "2021-02-09T23:24:07Z", + "Results": { + "MeanS": 1081577700.0, + "AllocatedMB": 1014285288.0 + } + } +] \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_commit_template.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_commit_template.fsproj deleted file mode 100644 index c33b103f503..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_commit_template.fsproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net6 - true - Release - {TEMPLATE_DEFINE_CONSTANTS} - - - - true - true - - - - - - - - - - - {TEMPLATE_FCS_PATH} - - - - diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_current.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_current.fsproj deleted file mode 100644 index 8701aa0e715..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_current.fsproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6 - true - Release - {TEMPLATE_DEFINE_CONSTANTS} - - - - true - true - - - - - - - - - - - - - diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_version_template.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_version_template.fsproj deleted file mode 100644 index 300465c09f8..00000000000 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/setup_version_template.fsproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6 - true - Release - {TEMPLATE_DEFINE_CONSTANTS} - - - - true - true - - - - - - - - - - - - - diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs index 6a48e688b4e..5f282702bb0 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Benchmarks.fs @@ -1,345 +1 @@ -namespace FSharp.Compiler.Benchmarks - -open System -open System.IO -open System.Text -open System.Threading.Tasks -open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.Diagnostics -open FSharp.Compiler.EditorServices -open FSharp.Compiler.Text -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.AbstractIL.ILBinaryReader -open BenchmarkDotNet.Attributes -open FSharp.Compiler.Benchmarks - -[] -module BenchmarkHelpers = - - type Async with - static member RunImmediate (computation: Async<'T>, ?cancellationToken ) = - let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken - let ts = TaskCompletionSource<'T>() - let task = ts.Task - Async.StartWithContinuations( - computation, - (fun k -> ts.SetResult k), - (fun exn -> ts.SetException exn), - (fun _ -> ts.SetCanceled()), - cancellationToken) - task.Result - - let createProject name referencedProjects = - let tmpPath = Path.GetTempPath() - let file = Path.Combine(tmpPath, Path.ChangeExtension(name, ".fs")) - { - ProjectFileName = Path.Combine(tmpPath, Path.ChangeExtension(name, ".dll")) - ProjectId = None - SourceFiles = [|file|] - OtherOptions = - Array.append [|"--optimize+"; "--target:library" |] (referencedProjects |> Array.ofList |> Array.map (fun x -> "-r:" + x.ProjectFileName)) - ReferencedProjects = - referencedProjects - |> List.map (fun x -> FSharpReferencedProject.CreateFSharp (x.ProjectFileName, x)) - |> Array.ofList - IsIncompleteTypeCheckEnvironment = false - UseScriptResolutionRules = false - LoadTime = DateTime() - UnresolvedReferences = None - OriginalLoadReferences = [] - Stamp = Some 0L (* set the stamp to 0L on each run so we don't evaluate the whole project again *) - } - - let generateSourceCode moduleName = - sprintf """ -module Benchmark.%s - -type %s = - - val X : int - - val Y : int - - val Z : int - -let function%s (x: %s) = - let x = 1 - let y = 2 - let z = x + y - z""" moduleName moduleName moduleName moduleName - - let decentlySizedStandAloneFile = File.ReadAllText(Path.Combine(__SOURCE_DIRECTORY__, "decentlySizedStandAloneFile.fsx")) - -[] -type TypeCheckingBenchmark1() = - let mutable checkerOpt = None - let mutable assembliesOpt = None - let mutable testFileOpt = None - - [] - member _.Setup() = - match checkerOpt with - | None -> checkerOpt <- Some(FSharpChecker.Create(projectCacheSize = 200)) - | _ -> () - - match assembliesOpt with - | None -> - assembliesOpt <- - System.AppDomain.CurrentDomain.GetAssemblies() - |> Array.map (fun x -> (x.Location)) - |> Some - - | _ -> () - - match testFileOpt with - | None -> - let options, _ = - checkerOpt.Value.GetProjectOptionsFromScript("decentlySizedStandAloneFile.fsx", SourceText.ofString decentlySizedStandAloneFile) - |> Async.RunImmediate - testFileOpt <- Some options - | _ -> () - - [] - member _.Run() = - match checkerOpt, testFileOpt with - | None, _ -> failwith "no checker" - | _, None -> failwith "no test file" - | Some(checker), Some(options) -> - let _, result = - checker.ParseAndCheckFileInProject("decentlySizedStandAloneFile.fsx", 0, SourceText.ofString decentlySizedStandAloneFile, options) - |> Async.RunImmediate - match result with - | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" - | FSharpCheckFileAnswer.Succeeded results -> - if results.Diagnostics.Length > 0 then failwithf "had errors: %A" results.Diagnostics - - [] - member _.Cleanup() = - match checkerOpt with - | None -> failwith "no checker" - | Some(checker) -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - ClearAllILModuleReaderCache() - -[] -type CompilerService() = - let mutable checkerOpt = None - let mutable sourceOpt = None - let mutable assembliesOpt = None - let mutable decentlySizedStandAloneFileCheckResultOpt = None - - let parsingOptions = - { - SourceFiles = [|"CheckExpressions.fs"|] - ConditionalDefines = [] - DiagnosticOptions = FSharpDiagnosticOptions.Default - LangVersionText = "default" - IsInteractive = false - ApplyLineDirectives = false - IndentationAwareSyntax = None - CompilingFSharpCore = false - IsExe = false - } - - let readerOptions = - { - pdbDirPath = None - reduceMemoryUsage = ReduceMemoryFlag.No - metadataOnly = MetadataOnlyFlag.Yes - tryGetMetadataSnapshot = fun _ -> None - } - - [] - member _.Setup() = - match checkerOpt with - | None -> - checkerOpt <- Some(FSharpChecker.Create(projectCacheSize = 200)) - | _ -> () - - match sourceOpt with - | None -> - sourceOpt <- Some <| FSharpSourceText.From(File.OpenRead("""..\..\..\..\..\..\..\..\..\src\CheckExpressions.fs"""), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true) - | _ -> () - - match assembliesOpt with - | None -> - assembliesOpt <- - System.AppDomain.CurrentDomain.GetAssemblies() - |> Array.map (fun x -> (x.Location)) - |> Some - - | _ -> () - - match decentlySizedStandAloneFileCheckResultOpt with - | None -> - let options, _ = - checkerOpt.Value.GetProjectOptionsFromScript("decentlySizedStandAloneFile.fsx", SourceText.ofString decentlySizedStandAloneFile) - |> Async.RunImmediate - let _, checkResult = - checkerOpt.Value.ParseAndCheckFileInProject("decentlySizedStandAloneFile.fsx", 0, SourceText.ofString decentlySizedStandAloneFile, options) - |> Async.RunImmediate - decentlySizedStandAloneFileCheckResultOpt <- Some checkResult - | _ -> () - - [] - member _.ParsingTypeCheckerFs() = - match checkerOpt, sourceOpt with - | None, _ -> failwith "no checker" - | _, None -> failwith "no source" - | Some(checker), Some(source) -> - let results = checker.ParseFile("CheckExpressions.fs", source.ToFSharpSourceText(), parsingOptions) |> Async.RunImmediate - if results.ParseHadErrors then failwithf "parse had errors: %A" results.Diagnostics - - [] - member _.ParsingTypeCheckerFsSetup() = - match checkerOpt with - | None -> failwith "no checker" - | Some(checker) -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - checker.ParseFile("dummy.fs", SourceText.ofString "dummy", parsingOptions) |> Async.RunImmediate |> ignore - ClearAllILModuleReaderCache() - - [] - member _.ILReading() = - match assembliesOpt with - | None -> failwith "no assemblies" - | Some(assemblies) -> - // We try to read most of everything in the assembly that matter, mainly types with their properties, methods, and fields. - // CustomAttrs and SecurityDecls are lazy until you call them, so we call them here for benchmarking. - for fileName in assemblies do - let reader = OpenILModuleReader fileName readerOptions - - let ilModuleDef = reader.ILModuleDef - - let ilAssemblyManifest = ilModuleDef.Manifest.Value - - ilAssemblyManifest.CustomAttrs |> ignore - ilAssemblyManifest.SecurityDecls |> ignore - for x in ilAssemblyManifest.ExportedTypes.AsList() do - x.CustomAttrs |> ignore - - ilModuleDef.CustomAttrs |> ignore - for ilTypeDef in ilModuleDef.TypeDefs.AsArray() do - ilTypeDef.CustomAttrs |> ignore - ilTypeDef.SecurityDecls |> ignore - - for ilMethodDef in ilTypeDef.Methods.AsArray() do - ilMethodDef.CustomAttrs |> ignore - ilMethodDef.SecurityDecls |> ignore - - for ilFieldDef in ilTypeDef.Fields.AsList() do - ilFieldDef.CustomAttrs |> ignore - - for ilPropertyDef in ilTypeDef.Properties.AsList() do - ilPropertyDef.CustomAttrs |> ignore - - [] - member _.ILReadingSetup() = - // With caching, performance increases an order of magnitude when re-reading an ILModuleReader. - // Clear it for benchmarking. - ClearAllILModuleReaderCache() - - member val TypeCheckFileWith100ReferencedProjectsOptions = - createProject "MainProject" - [ for i = 1 to 100 do - createProject ("ReferencedProject" + string i) [] - ] - - member this.TypeCheckFileWith100ReferencedProjectsRun() = - let options = this.TypeCheckFileWith100ReferencedProjectsOptions - let file = options.SourceFiles.[0] - - match checkerOpt with - | None -> failwith "no checker" - | Some checker -> - let parseResult, checkResult = - checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString (File.ReadAllText(file)), options) - |> Async.RunImmediate - - if parseResult.Diagnostics.Length > 0 then - failwithf "%A" parseResult.Diagnostics - - match checkResult with - | FSharpCheckFileAnswer.Aborted -> failwith "aborted" - | FSharpCheckFileAnswer.Succeeded checkFileResult -> - - if checkFileResult.Diagnostics.Length > 0 then - failwithf "%A" checkFileResult.Diagnostics - - [] - member this.TypeCheckFileWith100ReferencedProjectsSetup() = - for file in this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles do - File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) - - for proj in this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects do - match proj with - | FSharpReferencedProject.FSharpReference(_, referencedProjectOptions) -> - for file in referencedProjectOptions.SourceFiles do - File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) - | _ -> () - - this.TypeCheckFileWith100ReferencedProjectsRun() - - [] - member this.TypeCheckFileWith100ReferencedProjects() = - // Because the checker's projectcachesize is set to 200, this should be fast. - // If set to 3, it will be almost as slow as re-evaluating all project and it's projects references on setup; this could be a bug or not what we want. - this.TypeCheckFileWith100ReferencedProjectsRun() - - member val TypeCheckFileWithNoReferencesOptions = createProject "MainProject" [] - - [] - member this.TypeCheckFileWith100ReferencedProjectsCleanup() = - for file in this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles do - try File.Delete(file) with | _ -> () - - for proj in this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects do - match proj with - | FSharpReferencedProject.FSharpReference(_, referencedProjectOptions) -> - for file in referencedProjectOptions.SourceFiles do - try File.Delete(file) with | _ -> () - | _ -> () - - match checkerOpt with - | None -> failwith "no checker" - | Some checker -> - checker.InvalidateAll() - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - ClearAllILModuleReaderCache() - - [] - member _.SimplifyNames() = - match decentlySizedStandAloneFileCheckResultOpt with - | Some checkResult -> - match checkResult with - | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" - | FSharpCheckFileAnswer.Succeeded results -> - let sourceLines = decentlySizedStandAloneFile.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None) - let ranges = SimplifyNames.getSimplifiableNames(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunImmediate - ignore ranges - | _ -> failwith "oopsie" - - [] - member _.UnusedOpens() = - match decentlySizedStandAloneFileCheckResultOpt with - | Some checkResult -> - match checkResult with - | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" - | FSharpCheckFileAnswer.Succeeded results -> - let sourceLines = decentlySizedStandAloneFile.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None) - let decls = UnusedOpens.getUnusedOpens(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunImmediate - ignore decls - | _ -> failwith "oopsie" - - [] - member _.UnusedDeclarations() = - match decentlySizedStandAloneFileCheckResultOpt with - | Some checkResult -> - match checkResult with - | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" - | FSharpCheckFileAnswer.Succeeded results -> - let decls = UnusedDeclarations.getUnusedDeclarations(results, true) |> Async.RunImmediate - ignore decls // should be 16 - | _ -> failwith "oopsie" \ No newline at end of file + \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs new file mode 100644 index 00000000000..d7bacab4470 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fs @@ -0,0 +1,269 @@ +namespace FSharp.Compiler.Benchmarks + +open System +open System.IO +open System.Text +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Diagnostics +open FSharp.Compiler.EditorServices +open FSharp.Compiler.Text +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.ILBinaryReader +open BenchmarkDotNet.Attributes +open FSharp.Compiler.Benchmarks +open Microsoft.CodeAnalysis.Text + +type private Config = + { + Checker : FSharpChecker + Source : SourceText + Assemblies : string[] + CheckResult : FSharpCheckFileAnswer + DecentlySizedFileSource : string + } + +[] +module private Helpers = + + let createProject name referencedProjects = + let tmpPath = Path.GetTempPath() + let file = Path.Combine(tmpPath, Path.ChangeExtension(name, ".fs")) + { + ProjectFileName = Path.Combine(tmpPath, Path.ChangeExtension(name, ".dll")) + ProjectId = None + SourceFiles = [|file|] + OtherOptions = + Array.append [|"--optimize+"; "--target:library" |] (referencedProjects |> Array.ofList |> Array.map (fun x -> "-r:" + x.ProjectFileName)) + ReferencedProjects = + referencedProjects + |> List.map (fun x -> FSharpReferencedProject.CreateFSharp (x.ProjectFileName, x)) + |> Array.ofList + IsIncompleteTypeCheckEnvironment = false + UseScriptResolutionRules = false + LoadTime = DateTime() + UnresolvedReferences = None + OriginalLoadReferences = [] + Stamp = Some 0L (* set the stamp to 0L on each run so we don't evaluate the whole project again *) + } + + let generateSourceCode moduleName = + $""" +module Benchmark.%s{moduleName} + +type %s{moduleName} = + + val X : int + + val Y : int + + val Z : int + +let function%s{moduleName} (x: %s{moduleName}) = + let x = 1 + let y = 2 + let z = x + y + z""" + + +[] +type CompilerServiceBenchmarks() = + let mutable configOpt : Config option = None + let sourcePath = Path.Combine(__SOURCE_DIRECTORY__, "../decentlySizedStandAloneFile.fs") + + let getConfig () = + configOpt + |> Option.defaultWith (fun () -> failwith "Setup not run") + + let parsingOptions = + { + SourceFiles = [|"CheckExpressions.fs"|] + ConditionalDefines = [] + DiagnosticOptions = FSharpDiagnosticOptions.Default + LangVersionText = "default" + IsInteractive = false + ApplyLineDirectives = false + IndentationAwareSyntax = None + CompilingFSharpCore = false + IsExe = false + } + + let readerOptions = + { + pdbDirPath = None + reduceMemoryUsage = ReduceMemoryFlag.No + metadataOnly = MetadataOnlyFlag.Yes + tryGetMetadataSnapshot = fun _ -> None + } + + [] + member _.Setup() = + configOpt <- + match configOpt with + | Some _ -> configOpt + | None -> + let checker = FSharpChecker.Create(projectCacheSize = 200) + let source = FSharpSourceText.From(File.OpenRead("""..\..\..\..\..\..\..\..\..\src\Compiler\Checking\CheckExpressions.fs"""), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true) + let assemblies = + AppDomain.CurrentDomain.GetAssemblies() + |> Array.map (fun x -> x.Location) + let decentlySizedStandAloneFile = File.ReadAllText(Path.Combine(__SOURCE_DIRECTORY__, sourcePath)) + let options, _ = + checker.GetProjectOptionsFromScript(sourcePath, SourceText.ofString decentlySizedStandAloneFile) + |> Async.RunSynchronously + let _, checkResult = + checker.ParseAndCheckFileInProject(sourcePath, 0, SourceText.ofString decentlySizedStandAloneFile, options) + |> Async.RunSynchronously + { + Checker = checker + Source = source + Assemblies = assemblies + CheckResult = checkResult + DecentlySizedFileSource = decentlySizedStandAloneFile + } + |> Some + + [] + member _.ParsingTypeCheckerFs() = + let config = getConfig() + let results = config.Checker.ParseFile("CheckExpressions.fs", config.Source |> SourceText.toFSharpSourceText, parsingOptions) |> Async.RunSynchronously + if results.ParseHadErrors then failwithf $"parse had errors: %A{results.Diagnostics}" + + [] + member _.ParsingTypeCheckerFsSetup() = + let checker = getConfig().Checker + checker.InvalidateAll() + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + checker.ParseFile("dummy.fs", SourceText.ofString "dummy", parsingOptions) |> Async.RunSynchronously |> ignore + ClearAllILModuleReaderCache() + + [] + member _.ILReading() = + let config = getConfig() + // We try to read most of everything in the assembly that matter, mainly types with their properties, methods, and fields. + // CustomAttrs and SecurityDecls are lazy until you call them, so we call them here for benchmarking. + for fileName in config.Assemblies do + let reader = OpenILModuleReader fileName readerOptions + + let ilModuleDef = reader.ILModuleDef + + let ilAssemblyManifest = ilModuleDef.Manifest.Value + + ilAssemblyManifest.CustomAttrs |> ignore + ilAssemblyManifest.SecurityDecls |> ignore + for x in ilAssemblyManifest.ExportedTypes.AsList() do + x.CustomAttrs |> ignore + + ilModuleDef.CustomAttrs |> ignore + for ilTypeDef in ilModuleDef.TypeDefs.AsArray() do + ilTypeDef.CustomAttrs |> ignore + ilTypeDef.SecurityDecls |> ignore + + for ilMethodDef in ilTypeDef.Methods.AsArray() do + ilMethodDef.CustomAttrs |> ignore + ilMethodDef.SecurityDecls |> ignore + + for ilFieldDef in ilTypeDef.Fields.AsList() do + ilFieldDef.CustomAttrs |> ignore + + for ilPropertyDef in ilTypeDef.Properties.AsList() do + ilPropertyDef.CustomAttrs |> ignore + + [] + member _.ILReadingSetup() = + // With caching, performance increases an order of magnitude when re-reading an ILModuleReader. + // Clear it for benchmarking. + ClearAllILModuleReaderCache() + + member val TypeCheckFileWith100ReferencedProjectsOptions = + createProject "MainProject" + [ for i = 1 to 100 do + createProject ("ReferencedProject" + string i) [] + ] + + member this.TypeCheckFileWith100ReferencedProjectsRun() = + let options = this.TypeCheckFileWith100ReferencedProjectsOptions + let file = options.SourceFiles.[0] + let checker = getConfig().Checker + let parseResult, checkResult = + checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString (File.ReadAllText(file)), options) + |> Async.RunSynchronously + + if parseResult.Diagnostics.Length > 0 then + failwithf $"%A{parseResult.Diagnostics}" + + match checkResult with + | FSharpCheckFileAnswer.Aborted -> failwith "aborted" + | FSharpCheckFileAnswer.Succeeded checkFileResult -> + + if checkFileResult.Diagnostics.Length > 0 then + failwithf $"%A{checkFileResult.Diagnostics}" + + [] + member this.TypeCheckFileWith100ReferencedProjectsSetup() = + for file in this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles do + File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) + + for proj in this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects do + match proj with + | FSharpReferencedProject.FSharpReference(_, referencedProjectOptions) -> + for file in referencedProjectOptions.SourceFiles do + File.WriteAllText(file, generateSourceCode (Path.GetFileNameWithoutExtension(file))) + | _ -> () + + this.TypeCheckFileWith100ReferencedProjectsRun() + + [] + member this.TypeCheckFileWith100ReferencedProjects() = + // Because the checker's projectcachesize is set to 200, this should be fast. + // If set to 3, it will be almost as slow as re-evaluating all project and it's projects references on setup; this could be a bug or not what we want. + this.TypeCheckFileWith100ReferencedProjectsRun() + + member val TypeCheckFileWithNoReferencesOptions = createProject "MainProject" [] + + [] + member this.TypeCheckFileWith100ReferencedProjectsCleanup() = + for file in this.TypeCheckFileWith100ReferencedProjectsOptions.SourceFiles do + try File.Delete(file) with | _ -> () + + for proj in this.TypeCheckFileWith100ReferencedProjectsOptions.ReferencedProjects do + match proj with + | FSharpReferencedProject.FSharpReference(_, referencedProjectOptions) -> + for file in referencedProjectOptions.SourceFiles do + try File.Delete(file) with | _ -> () + | _ -> () + + let checker = getConfig().Checker + checker.InvalidateAll() + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + ClearAllILModuleReaderCache() + + [] + member _.SimplifyNames() = + let checkResult = getConfig().CheckResult + let source = getConfig().DecentlySizedFileSource + match checkResult with + | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" + | FSharpCheckFileAnswer.Succeeded results -> + let sourceLines = source.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None) + let ranges = SimplifyNames.getSimplifiableNames(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunSynchronously + ignore ranges + + [] + member _.UnusedOpens() = + let checkResult = getConfig().CheckResult + let source = getConfig().DecentlySizedFileSource + match checkResult with + | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" + | FSharpCheckFileAnswer.Succeeded results -> + let sourceLines = source.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None) + let decls = UnusedOpens.getUnusedOpens(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunSynchronously + ignore decls + + [] + member _.UnusedDeclarations() = + let checkResult = getConfig().CheckResult + match checkResult with + | FSharpCheckFileAnswer.Aborted -> failwith "checker aborted" + | FSharpCheckFileAnswer.Succeeded results -> + let decls = UnusedDeclarations.getUnusedDeclarations(results, true) |> Async.RunSynchronously + ignore decls // should be 16 diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/DecentlySizedStandAloneFileBenchmark.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/DecentlySizedStandAloneFileBenchmark.fs new file mode 100644 index 00000000000..f1525cfc734 --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/DecentlySizedStandAloneFileBenchmark.fs @@ -0,0 +1,22 @@ +namespace FSharp.Compiler.Benchmarks + +open System.IO +open HistoricalBenchmark +open BenchmarkDotNet.Attributes + +type SingleFileCompilerWithILCacheClearing(file, options) = + inherit SingleFileCompiler(file, options) + + override this.Cleanup() = + base.Cleanup() + FSharp.Compiler.AbstractIL.ILBinaryReader.ClearAllILModuleReaderCache() + +[] +type DecentlySizedStandAloneFileBenchmark() = + inherit SingleFileCompilerBenchmarkBase( + SingleFileCompilerWithILCacheClearing( + Path.Combine(__SOURCE_DIRECTORY__, "../decentlySizedStandAloneFile.fs"), + OptionsCreationMethod.FromScript + ) + ) + diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj index ce0203b33e8..927a7cee750 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj @@ -14,20 +14,21 @@ - - - + + + - + + diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs index d624def2d8c..fa0474dbf5e 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs @@ -2,7 +2,6 @@ open FSharp.Compiler.Benchmarks [] -let main _ = - //BenchmarkRunner.Run() |> ignore - BenchmarkRunner.Run() |> ignore +let main args = + BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args) |> ignore 0 diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/README.md b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/README.md new file mode 100644 index 00000000000..90e90b0fd6f --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/README.md @@ -0,0 +1,22 @@ +# CompilerServiceBenchmarks + +## What is it + +* A selection of BDN benchmarks analysing FCS performance +* Uses BDN's commandline API + +## How to run it + +Running all benchmarks: +```dotnet run -c Release --filter *``` + +Running a specific benchmark: +```dotnet run -c Release --filter *ParsingTypeCheckerFs*``` + +## Sample results + +*TODO* + +## Other + +You can find this document under 'tests/benchmarks/FCSBenchmarks/BenchmarkComparison/README.md'. \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Helpers.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/SourceText.fs similarity index 54% rename from tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Helpers.fs rename to tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/SourceText.fs index 21952786f1c..49d46568ff4 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Helpers.fs +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/SourceText.fs @@ -1,20 +1,16 @@ -[] -module internal FSharp.Compiler.Benchmarks.Helpers +namespace FSharp.Compiler.Benchmarks open System -open System.IO -open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open FSharp.Compiler.Text -open FSharp.Compiler.CodeAnalysis -module private SourceText = +module internal SourceText = open System.Runtime.CompilerServices - let weakTable = ConditionalWeakTable() + let private weakTable = ConditionalWeakTable() - let create (sourceText: SourceText) = + let private create (sourceText: SourceText) = let sourceText = { new ISourceText with @@ -71,46 +67,9 @@ module private SourceText = } sourceText + + let toFSharpSourceText (sourceText : SourceText) = + weakTable.GetValue(sourceText, ConditionalWeakTable<_,_>.CreateValueCallback(create)) -type SourceText with - - member this.ToFSharpSourceText() = - SourceText.weakTable.GetValue(this, Runtime.CompilerServices.ConditionalWeakTable<_,_>.CreateValueCallback(SourceText.create)) - -type FSharpSourceText = SourceText -type FSharpSourceHashAlgorithm = SourceHashAlgorithm - -type Async with - static member RunImmediate (computation: Async<'T>, ?cancellationToken ) = - let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken - let ts = TaskCompletionSource<'T>() - let task = ts.Task - Async.StartWithContinuations( - computation, - (fun k -> ts.SetResult k), - (fun exn -> ts.SetException exn), - (fun _ -> ts.SetCanceled()), - cancellationToken) - task.Result - -let CreateProject name referencedProjects = - let tmpPath = Path.GetTempPath() - let file = Path.Combine(tmpPath, Path.ChangeExtension(name, ".fs")) - { - ProjectFileName = Path.Combine(tmpPath, Path.ChangeExtension(name, ".dll")) - ProjectId = None - SourceFiles = [|file|] - OtherOptions = - Array.append [|"--optimize+"; "--target:library" |] (referencedProjects |> Array.ofList |> Array.map (fun x -> "-r:" + x.ProjectFileName)) - ReferencedProjects = - referencedProjects - |> List.map (fun x -> FSharpReferencedProject.CreateFSharp (x.ProjectFileName, x)) - |> Array.ofList - IsIncompleteTypeCheckEnvironment = false - UseScriptResolutionRules = false - LoadTime = DateTime() - UnresolvedReferences = None - OriginalLoadReferences = [] - Stamp = Some 0L (* set the stamp to 0L on each run so we don't evaluate the whole project again *) - } - +type internal FSharpSourceText = SourceText +type internal FSharpSourceHashAlgorithm = SourceHashAlgorithm diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/decentlySizedStandAloneFile.fsx b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/decentlySizedStandAloneFile.fsx deleted file mode 100644 index 95b2f151be6..00000000000 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/decentlySizedStandAloneFile.fsx +++ /dev/null @@ -1,547 +0,0 @@ -module Parser = - - (* - F# implementation of a generic Top-Down-Operator-Precedence Parser - as described in this paper http://portal.acm.org/citation.cfm?id=512931. - - The parser has been extended to allow for statements in comparison to Pratt's - original algorithm which only parsed languages which use expression-only grammar. - - The parsers is "impure" in the sense that is uses a ref-cell for storing the - input in the T<_, _, _> record class, this is soley for performance reasons - as it's to expensive to create a new record object for every consumed token. - Certain functions also throw exceptions, which generally also is considered impure. - - The parser produces nice error message in this style: - - Error on line: 5 col: 9 - 4: if(x == y) { - 5: print'x equals y'); - ----------^ - Unexpected: #string "x equals y" - - More information: - * http://en.wikipedia.org/wiki/Vaughan_Pratt (Original Inventor) - * http://en.wikipedia.org/wiki/Pratt_parser (Alias name) - * http://effbot.org/zone/simple-top-down-parsing.htm (Python implementation) - * http://javascript.crockford.com/tdop/tdop.html (JavaScript implementation) - *) - - type Pos = int * int - - type T<'a, 'b, 'c> when 'c : comparison = { - Input : 'a list ref - Lines : string option - - Type : 'a -> 'c - Position : 'a -> Pos - PrettyPrint : ('a -> string) option - - //Parser definitions and binding powers - BindingPower : Map<'c, int> - Null : Map<'c, 'a -> T<'a, 'b, 'c> -> 'b> - Stmt : Map<'c, 'a -> T<'a, 'b, 'c> -> 'b> - Left : Map<'c, 'a -> 'b -> T<'a, 'b, 'c> -> 'b> - } - - type Pattern<'a, 'b, 'c> when 'c : comparison - = Sym of 'c - | Get of (T<'a, 'b, 'c> -> 'b) - - //Errors - type Exn (msg, pos) = - inherit System.Exception(msg) - member x.Position = pos - - (* - Creates a string error snippet - that points out the exact source position - where the error occured, for example: - - 4: if(x == y) { - 5: print'x equals y'); - ----------^ - *) - let errorSource pos source = - - let splitLines (text:string) = - let text = text.Replace("\r\n", "\n").Replace("\r", "\n") - System.Text.RegularExpressions.Regex.Split(text, "\n") - - let lineNum (input:int) n = - (input.ToString()).PadLeft(n, '0') - - let stringRepeat n input = - if System.String.IsNullOrEmpty input then input - else - let result = new System.Text.StringBuilder(input.Length * n) - result.Insert(0, input, n).ToString() - - match source with - | None -> "" - | Some(source:string) -> - let source = source |> splitLines - let result = ref "" - let line, column = pos - - if line <= source.Length && line > 1 then - let nr = line.ToString() - let nrl = nr.Length - - //previous line - let pline = line - 1 - if pline >= 1 then - let num = lineNum pline nrl - result := num+": "+source.[pline-1]+"\n" - - //current line - let text = source.[line-1] - if column <= text.Length then - let arrow = "-" |> stringRepeat (nrl + column) - result := !result+nr+": "+text+"\n"+arrow+"^\n" - - !result - - let exn msg = Exn(msg, (0, 0)) |> raise - let exnLine pos msg = - let line = sprintf "Error on line: %i col: %i\n" (fst pos) (snd pos) - Exn(line + msg, pos) |> raise - - let private unexpectedEnd () = "Unexpected end of input" |> exn - let private unexpectedToken token parser = - let type' = - match parser.PrettyPrint with - | None -> (token |> parser.Type).ToString() - | Some f -> token |> f - - let pos = token |> parser.Position - let source = parser.Lines |> errorSource pos - let expected = sprintf "Unexpected: %s" type' - (source + expected) |> exnLine pos - - let inline private getBindingPower tok parser = - let pwr = parser.BindingPower.TryFind (parser.Type tok) - match pwr with Some pwr -> pwr | _ -> 0 - - let current parser = - match !parser.Input with - | token::_ -> token - | _ -> unexpectedEnd () - - let currentTry parser = - match !parser.Input with - | token::_ -> Some token - | _ -> None - - let currentType parser = - parser |> current |> parser.Type - - let currentTypeTry parser = - match parser |> currentTry with - | Some token -> Some(token |> parser.Type) - | _ -> None - - let skip parser = - match !parser.Input with - | _::input -> parser.Input := input - | _ -> unexpectedEnd () - - let skipIf type' parser = - match !parser.Input with - | token::xs when parser.Type token = type' -> - parser.Input := xs - - | token::_ -> - unexpectedToken token parser - - | _ -> unexpectedEnd () - - let skipCurrent parser = - let current = parser |> current - parser |> skip - current - - let exprPwr rbpw parser = - let rec expr left = - match parser |> currentTry with - | Some token when rbpw < (parser |> getBindingPower token) -> - parser |> skip - - let type' = parser.Type token - let led = - match parser.Left.TryFind type' with - | None -> unexpectedToken token parser - | Some led -> led - - led token left parser |> expr - - | _ -> left - - let tok = parser |> skipCurrent - let type' = parser.Type tok - let nud = - match parser.Null.TryFind type' with - | None -> unexpectedToken tok parser - | Some nud -> nud - - nud tok parser |> expr - - let expr parser = - parser |> exprPwr 0 - - let exprSkip type' parser = - let expr = parser |> expr - parser |> skipIf type' - expr - - let rec exprList parser = - match !parser.Input with - | [] -> [] - | _ -> (parser |> expr) :: (parser |> exprList) - - let stmt term parser = - let token = parser |> current - match parser.Stmt.TryFind (token |> parser.Type) with - | Some stmt -> parser |> skip; stmt token parser - | None -> parser |> exprSkip term - - let rec stmtList term parser = - match !parser.Input with - | [] -> [] - | _ -> (parser |> stmt term) :: (parser |> stmtList term) - - let match' pattern parser = - let rec match' acc pattern parser = - match pattern with - | [] -> acc |> List.rev - - | Sym(symbol)::pattern -> - parser |> skipIf symbol - parser |> match' acc pattern - - | Get(f)::pattern -> - let acc = (f parser) :: acc - parser |> match' acc pattern - - parser |> match' [] pattern - - (* - Convenience functions exposed for - easing parser definition and usage - *) - - let create<'a, 'b, 'c when 'c : comparison> type' position prettyPrint = { - Input = ref [] - Lines = None - - Type = type' - Position = position - PrettyPrint = prettyPrint - - BindingPower = Map.empty<'c, int> - Null = Map.empty<'c, 'a -> T<'a, 'b, 'c> -> 'b> - Stmt = Map.empty<'c, 'a -> T<'a, 'b, 'c> -> 'b> - Left = Map.empty<'c, 'a -> 'b -> T<'a, 'b, 'c> -> 'b> - } - - let matchError () = exn "Match pattern failed" - let smd token funct parser = {parser with T.Stmt = parser.Stmt.Add(token, funct)} - let nud token funct parser = {parser with T.Null = parser.Null.Add(token, funct)} - let led token funct parser = {parser with T.Left = parser.Left.Add(token, funct)} - let bpw token power parser = {parser with T.BindingPower = parser.BindingPower.Add(token, power)} - - (*Defines a left-associative infix operator*) - let infix f typ pwr p = - let infix tok left p = - f tok left (p |> exprPwr pwr) - - p |> bpw typ pwr |> led typ infix - - (*Defines a right-associative infix operator*) - let infixr f typ pwr p = - let lpwr = pwr - 1 - - let infix tok left p = - f tok left (p |> exprPwr lpwr) - - p |> bpw typ pwr |> led typ infix - - (*Defines a prefix/unary operator*) - let prefix f typ pwr p = - let prefix tok parser = - f tok (parser |> exprPwr pwr) - - p |> nud typ prefix - - (*Defines a constant*) - let constant symbol value p = - p |> nud symbol (fun _ _ -> value) - - (* - Runs the parser and treats all - top level construct as expressions - *) - let runExpr input source parser = - {parser with - T.Input = ref input - T.Lines = source - } |> exprList - - (* - Runs the parser and treats all - top level construct as statements - *) - let runStmt input source term parser = - {parser with - T.Input = ref input - T.Lines = source - } |> stmtList term - -(* - Example parser for a very simple grammar -*) - -//AST Types -type UnaryOp - = Plus - | Minus - -type BinaryOp - = Multiply - | Add - | Subtract - | Divide - | Assign - | Equals - -type Ast - = Number of int - | Identifier of string - | String of string - | Binary of BinaryOp * Ast * Ast - | Unary of UnaryOp * Ast - | Ternary of Ast * Ast * Ast // test * ifTrue * ifFalse - | If of Ast * Ast * Ast option // test + ifTrue and possibly ifFalse (else branch) - | Call of Ast * Ast list // target + arguments list - | Block of Ast list // statements list - | True - | False - -//Shorthand types for convenience -module P = Parser -type Token = string * string * (Parser.Pos) -type P = Parser.T - -//Utility functions for extracting values out of Token -let type' ((t, _, _):Token) = t -let value ((_, v, _):Token) = v -let pos ((_, _, p):Token) = p -let value_num (t:Token) = t |> value |> int - -//Utility functions for creating new tokens -let number value pos : Token = "#number", value, pos -let string value pos : Token = "#string", value, pos -let identifier name pos : Token = "#identifier", name, pos - -let symbol type' pos : Token = type', "", pos -let add = symbol "+" -let sub = symbol "-" -let mul = symbol "*" -let div = symbol "/" -let assign = symbol "=" -let equals = symbol "==" -let lparen = symbol "(" -let rparen = symbol ")" -let lbrace = symbol "{" -let rbrace = symbol "}" -let comma = symbol "," -let qmark = symbol "?" -let colon = symbol ":" -let scolon = symbol ";" -let if' = symbol "if" -let true' = symbol "true" -let else' = symbol "else" - -//Utility functions for converting tokens to binary and unary operators -let toBinaryOp tok = - match type' tok with - | "=" -> BinaryOp.Assign - | "+" -> BinaryOp.Add - | "-" -> BinaryOp.Subtract - | "*" -> BinaryOp.Multiply - | "/" -> BinaryOp.Divide - | "==" -> BinaryOp.Equals - | _ -> P.exn (sprintf "Couldn't convert %s-token to BinaryOp" (type' tok)) - -let toUnaryOp tok = - match type' tok with - | "+" -> UnaryOp.Plus - | "-" -> UnaryOp.Minus - | _ -> P.exn (sprintf "Couldn't convert %s-token to UnaryOp" (type' tok)) - -//Utility function for defining infix operators -let infix = - P.infix (fun token left right -> - Binary(token |> toBinaryOp, left, right)) - -//Utility function for defining prefix operators -let prefix = - P.prefix (fun token ast -> - Unary(token |> toUnaryOp, ast)) - -//Utility function for defining constants -let constant typ value p = - p |> P.nud typ (fun _ _ -> value) - -//Utility function for parsing a block -let block p = - let rec stmts p = - match p |> P.currentTypeTry with - | None -> [] - | Some "}" -> p |> P.skip; [] - | _ -> (p |> P.stmt ";") :: (stmts p) - - p |> P.skipIf "{" - Block(p |> stmts) - -//Pretty printing function for error messages -let prettyPrint (tok:Token) = - match tok with - | "#number", value, _ -> sprintf "#number %s" value - | "#identifier", name, _ -> sprintf "#identifier %s" name - | "#string", value, _ -> sprintf "#string \"%s\"" value - | type', _, _ -> type' - -//The parser definition -let example_parser = - (P.create type' pos (Some prettyPrint)) - - //Literals and identifiers - |> P.nud "#number" (fun t _ -> t |> value |> int |> Number) - |> P.nud "#identifier" (fun t _ -> t |> value |> Identifier) - |> P.nud "#string" (fun t _ -> t |> value |> String) - - //Constants - |> constant "true" Ast.True - |> constant "false" Ast.False - - //Infix Operators - |> infix "==" 40 - |> infix "+" 50 - |> infix "-" 50 - |> infix "*" 60 - |> infix "/" 60 - |> infix "=" 80 - - //Prefix Operators - |> prefix "+" 70 - |> prefix "-" 70 - - //Grouping expressions () - |> P.nud "(" (fun t p -> p |> P.exprSkip ")") - - //Ternary operator ? : - |> P.bpw "?" 70 - |> P.led "?" (fun _ left p -> - let ternary = [P.Get P.expr; P.Sym ":"; P.Get P.expr] - match p |> P.match' ternary with - | ifTrue::ifFalse::_ -> Ternary(left, ifTrue, ifFalse) - | _ -> P.matchError() - ) - - //If/Else statement if() { }] - |> P.smd "if" (fun _ p -> - let if' = [P.Sym "("; P.Get P.expr; P.Sym ")"; P.Get block] - let else' = [P.Sym "else"; P.Get block] - - match p |> P.match' if' with - | test::ifTrue::_ -> - match p |> P.match' else' with - | ifFalse::_ -> If(test, ifTrue, Some(ifFalse)) - | _ -> If(test, ifTrue, None) - | _ -> P.matchError() - ) - - //Function call - |> P.bpw "(" 80 - |> P.led "(" (fun _ func p -> - let rec args (p:P) = - match p |> P.currentType with - | ")" -> p |> P.skip; [] - | "," -> p |> P.skip; args p - | _ -> (p |> P.expr) :: args p - - Call(func, args p) - ) - -//Code to parse -(* -1: x = 5; -2: y = 5; -3: -4: if(x == y) { -5: print("x equals y"); -6: } else { -7: print("x doesn't equal y"); -8: } -*) - -let code = @"x = 5; -y = 5; - -if(x == y) { - print('x equals y'); -} else { - print('x doesn't equal y'); -}" - -//The code in tokens, manually entered -//since we don't have a lexer to produce -//the tokens for us -let tokens = - [ - //x = 5; - identifier "x" (1, 1) - assign (1, 3) - number "5" (1, 5) - scolon (1, 6) - - //y = 5; - identifier "y" (2, 1) - assign (2, 3) - number "5" (2, 5) - scolon (2, 6) - - //if(x == y) { - if' (4, 1) - lparen (4, 3) - identifier "x" (4, 4) - equals (4, 6) - identifier "y" (4, 9) - rparen (4, 10) - lbrace (4, 12) - - //print("x equals y"); - identifier "print" (5, 3) - lparen (5, 8) - string "x equals y" (5, 9) - rparen (5, 21) - scolon (5, 22) - - //} else { - rbrace (6, 1) - else' (6, 3) - lbrace (6, 7) - - //print("x doesn't equal y"); - identifier "print" (7, 3) - lparen (7, 7) - string "x doesn't equal y" (7, 9) - rparen (7, 27) - scolon (7, 28) - - //} - rbrace (8, 1) - ] - -let ast = example_parser |> P.runStmt tokens (Some code) ";" diff --git a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs index 62cbb587e93..a5b798e072e 100644 --- a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs +++ b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs @@ -929,6 +929,6 @@ type CompilerService() = ) [] -let main _ = - BenchmarkRunner.Run() |> ignore +let main args = + BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args) |> ignore 0 diff --git a/tests/benchmarks/FCSBenchmarks/README.md b/tests/benchmarks/FCSBenchmarks/README.md index 700e12fb890..6d4a3a674f0 100644 --- a/tests/benchmarks/FCSBenchmarks/README.md +++ b/tests/benchmarks/FCSBenchmarks/README.md @@ -17,6 +17,11 @@ When making changes to the FCS source code, consider running some of these to as All the above benchmarks use BenchmarkDotNet. +## Quickly validating that the benchmarks work +`SmokeTestAllBenchmarks.ps1` allows to run all BDN benchmarks in this directory with a minimum number of iterations, as a way to verify that the benchmarks still work. + +This doesn't validate the notebook-based meta-benchmarks. + ## Other You can find this document under 'tests/benchmarks/FCSBenchmarks/README.md'. \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/SmokeTestAllBenchmarks.ps1 b/tests/benchmarks/FCSBenchmarks/SmokeTestAllBenchmarks.ps1 new file mode 100644 index 00000000000..688434a176e --- /dev/null +++ b/tests/benchmarks/FCSBenchmarks/SmokeTestAllBenchmarks.ps1 @@ -0,0 +1,19 @@ +# Smoke test for checking that all the benchmarks work +# The test is successful if all the benchmarks run and produce results. +# The actual numbers produced aren't accurate. +# Results can be checked in BenchmarkDotNet.Artifacts/results + +function Run { + param ( + [string[]]$path + ) + # Build the benchmark project itself but no dependencies - still fast, but reduces risk of not accounting for code changes + dotnet build -c release --no-dependencies $path + # Run the minimum the CLI API allows - ideally we would use ColdStart but that's not part of the CLI API + # For API details see https://benchmarkdotnet.org/articles/guides/console-args.html + dotnet run -c release --project $path --no-build -- --warmupCount 0 --iterationCount 1 --runOncePerIteration --filter * +} + +Run "BenchmarkComparison/HistoricalBenchmark.fsproj" +Run "CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj" +Run "FCSSourceFiles/FCSSourceFiles.fsproj" \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/decentlySizedStandAloneFile.fs b/tests/benchmarks/FCSBenchmarks/decentlySizedStandAloneFile.fs similarity index 97% rename from tests/benchmarks/FCSBenchmarks/BenchmarkComparison/decentlySizedStandAloneFile.fs rename to tests/benchmarks/FCSBenchmarks/decentlySizedStandAloneFile.fs index 95b2f151be6..deea6ccbaee 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/decentlySizedStandAloneFile.fs +++ b/tests/benchmarks/FCSBenchmarks/decentlySizedStandAloneFile.fs @@ -92,15 +92,15 @@ let pline = line - 1 if pline >= 1 then let num = lineNum pline nrl - result := num+": "+source.[pline-1]+"\n" + result.Value <- num+": "+source.[pline-1]+"\n" //current line let text = source.[line-1] if column <= text.Length then let arrow = "-" |> stringRepeat (nrl + column) - result := !result+nr+": "+text+"\n"+arrow+"^\n" + result.Value <- result.Value+nr+": "+text+"\n"+arrow+"^\n" - !result + result.Value let exn msg = Exn(msg, (0, 0)) |> raise let exnLine pos msg = @@ -124,12 +124,12 @@ match pwr with Some pwr -> pwr | _ -> 0 let current parser = - match !parser.Input with + match parser.Input.Value with | token::_ -> token | _ -> unexpectedEnd () let currentTry parser = - match !parser.Input with + match parser.Input.Value with | token::_ -> Some token | _ -> None @@ -142,14 +142,14 @@ | _ -> None let skip parser = - match !parser.Input with - | _::input -> parser.Input := input + match parser.Input.Value with + | _::input -> parser.Input.Value <- input | _ -> unexpectedEnd () let skipIf type' parser = - match !parser.Input with + match parser.Input.Value with | token::xs when parser.Type token = type' -> - parser.Input := xs + parser.Input.Value <- xs | token::_ -> unexpectedToken token parser @@ -195,7 +195,7 @@ expr let rec exprList parser = - match !parser.Input with + match parser.Input.Value with | [] -> [] | _ -> (parser |> expr) :: (parser |> exprList) @@ -206,7 +206,7 @@ | None -> parser |> exprSkip term let rec stmtList term parser = - match !parser.Input with + match parser.Input.Value with | [] -> [] | _ -> (parser |> stmt term) :: (parser |> stmtList term) From e4ef7b3d8b923e0d9b700dd48b2c22e8a7980a06 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 16 Jul 2022 09:17:21 -0700 Subject: [PATCH 045/226] versions (#13518) --- eng/Versions.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6571c5fb21a..664020f8004 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,7 @@ 6 0 - 5 + 6 0 @@ -32,7 +32,7 @@ 41 0 - 5 + $(FSBuildVersion) $(FSRevisionVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion) @@ -47,7 +47,7 @@ 12 0 - 4 + $(FSBuildVersion) $(FSRevisionVersion) $(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion) $(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion) @@ -55,7 +55,7 @@ 17 - 1 + 4 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 886734eb2740c241fe270b36daddaaa69775a914 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Tue, 19 Jul 2022 23:10:16 +0200 Subject: [PATCH 046/226] Fix nameof operator (#13501) * Use trivia in SynLongIdent to print operator name. * Add test for op_RangeStep. --- src/Compiler/Checking/CheckExpressions.fs | 16 +++++++----- .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Language/NameofTests.fs | 26 +++++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 7e3baef258b..7004439ef01 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -8019,7 +8019,7 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = let m = cleanSynArg.Range let rec check overallTyOpt resultOpt expr (delayed: DelayedItem list) = match expr with - | LongOrSingleIdent (false, SynLongIdent(longId, _, _), _, _) -> + | LongOrSingleIdent (false, SynLongIdent(longId, _, trivia), _, _) -> let ad = env.eAccessRights let result = defaultArg resultOpt (List.last longId) @@ -8027,12 +8027,16 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = // Demangle back to source operator name if the lengths in the ranges indicate the // original source range matches exactly let result = - if IsMangledOpName result.idText then - let demangled = DecompileOpName result.idText - if demangled.Length = result.idRange.EndColumn - result.idRange.StartColumn then - ident(demangled, result.idRange) + match List.tryLast trivia |> Option.bind id with + | Some (IdentTrivia.OriginalNotation(text = text)) + | Some (IdentTrivia.OriginalNotationWithParen(text = text)) -> ident(text, result.idRange) + | _ -> + if IsMangledOpName result.idText then + let demangled = DecompileOpName result.idText + if demangled.Length = result.idRange.EndColumn - result.idRange.StartColumn then + ident(demangled, result.idRange) + else result else result - else result // Nameof resolution resolves to a symbol and in general we make that the same symbol as // would resolve if the long ident was used as an expression at the given location. diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index a899d457f86..6ca61dc0c02 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -156,6 +156,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs new file mode 100644 index 00000000000..bbe14823416 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.ComponentTests.Language + +open Xunit +open FSharp.Test.Compiler + +module NameofTests = + + [] + [] + [] + [] + [] + [] + let ``nameof() with operator should return demangled name`` operator = + let source = $""" +let expected = "{operator}" +let actual = nameof({operator}) +if actual <> expected then failwith $"Expected nameof({{expected}}) to be '{{expected}}', but got '{{actual}}'" + """ + Fsx source + |> asExe + |> withLangVersion50 + |> compileAndRun + |> shouldSucceed From 85febdd97bb1ca1a4d46007232ecd9bd4492d264 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 20 Jul 2022 09:25:03 -0700 Subject: [PATCH 047/226] Stack overflow on localized languages. (#13529) * Don't resolve resources in fsi * temp --- src/Compiler/Interactive/fsi.fs | 34 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 92bcc810a34..ae1a0ac34b7 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2345,16 +2345,16 @@ type internal FsiInterruptController( // // For information about contexts, see the Assembly.LoadFrom(String) method overload. -module internal MagicAssemblyResolution = +type internal MagicAssemblyResolution () = // See bug 5501 for details on decision to use UnsafeLoadFrom here. // Summary: // It is an explicit user trust decision to load an assembly with #r. Scripts are not run automatically (for example, by double-clicking in explorer). // We considered setting loadFromRemoteSources in fsi.exe.config but this would transitively confer unsafe loading to the code in the referenced // assemblies. Better to let those assemblies decide for themselves which is safer. - let private assemblyLoadFrom (path:string) = Assembly.UnsafeLoadFrom(path) + static let assemblyLoadFrom (path:string) = Assembly.UnsafeLoadFrom(path) - let ResolveAssembly (ctok, m, tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput, fullAssemName: string) = + static member private ResolveAssemblyCore (ctok, m, tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput, fullAssemName: string) = try // Grab the name of the assembly @@ -2362,12 +2362,9 @@ module internal MagicAssemblyResolution = let simpleAssemName = fullAssemName.Split([| ',' |]).[0] if progress then fsiConsoleOutput.uprintfn "ATTEMPT MAGIC LOAD ON ASSEMBLY, simpleAssemName = %s" simpleAssemName // "Attempting to load a dynamically required assembly in response to an AssemblyResolve event by using known static assembly references..." - // Special case: Mono Windows Forms attempts to load an assembly called something like "Windows.Forms.resources" - // We can't resolve this, so don't try. - // REVIEW: Suggest 4481, delete this special case. - if (runningOnMono && simpleAssemName.EndsWith(".resources",StringComparison.OrdinalIgnoreCase)) || - simpleAssemName.EndsWith(".XmlSerializers", StringComparison.OrdinalIgnoreCase) || - (runningOnMono && simpleAssemName = "UIAutomationWinforms") then null + // We can't resolve an assembly called blah.resources" so don't try. + if simpleAssemName.EndsWith(".XmlSerializers", StringComparison.OrdinalIgnoreCase) || + (simpleAssemName = "UIAutomationWinforms") then null else match fsiDynamicCompiler.FindDynamicAssembly(simpleAssemName) with | Some asm -> asm @@ -2451,7 +2448,22 @@ module internal MagicAssemblyResolution = stopProcessingRecovery e range0 null - let Install(tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput) = + [] + static val mutable private resolving: bool + + static member private ResolveAssembly (ctok, m, tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput, fullAssemName: string) = + + //Eliminate recursive calls to Resolve which can happen via our callout to msbuild resolution + if MagicAssemblyResolution.resolving then + null + else + try + MagicAssemblyResolution.resolving <- true + MagicAssemblyResolution.ResolveAssemblyCore (ctok, m, tcConfigB, tcImports, fsiDynamicCompiler, fsiConsoleOutput, fullAssemName) + finally + MagicAssemblyResolution.resolving <- false + + static member Install(tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput) = let rangeStdin0 = rangeN stdinMockFileName 0 @@ -2459,7 +2471,7 @@ module internal MagicAssemblyResolution = // Explanation: our understanding is that magic assembly resolution happens // during compilation. So we recover the CompilationThreadToken here. let ctok = AssumeCompilationThreadWithoutEvidence () - ResolveAssembly (ctok, rangeStdin0, tcConfigB, tcImports, fsiDynamicCompiler, fsiConsoleOutput, args.Name)) + MagicAssemblyResolution.ResolveAssembly (ctok, rangeStdin0, tcConfigB, tcImports, fsiDynamicCompiler, fsiConsoleOutput, args.Name)) AppDomain.CurrentDomain.add_AssemblyResolve(resolveAssembly) From 2ac689db753e30785d830a4f7ff8004d2aa97735 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 20 Jul 2022 09:34:32 -0700 Subject: [PATCH 048/226] Fix 13345 (#13524) * Fix 13345 * fantomas --- src/Compiler/AbstractIL/ilmorph.fs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Compiler/AbstractIL/ilmorph.fs b/src/Compiler/AbstractIL/ilmorph.fs index 08bd3a292c6..bcc65878d1a 100644 --- a/src/Compiler/AbstractIL/ilmorph.fs +++ b/src/Compiler/AbstractIL/ilmorph.fs @@ -265,12 +265,31 @@ let morphILTypeDefs f (tdefs: ILTypeDefs) = let morphILLocals f locals = List.map (morphILLocal f) locals +let morphILDebugImport fs debugImport = + let _, f = fs + + match debugImport with + | ILDebugImport.ImportType ty -> ILDebugImport.ImportType(f ty) + | ILDebugImport.ImportNamespace _ns -> debugImport + +let morphILDebugImports fs ilDebugImports = + ilDebugImports |> Array.map (morphILDebugImport fs) + let ilmbody_instr2instr_ty2ty fs (ilmbody: ILMethodBody) = - let finstr, fTyInCtxt = fs + let _, fTyInCtxt = fs { ilmbody with - Code = code_instr2instr_ty2ty (finstr, fTyInCtxt) ilmbody.Code + Code = code_instr2instr_ty2ty fs ilmbody.Code Locals = morphILLocals fTyInCtxt ilmbody.Locals + DebugImports = + match ilmbody.DebugImports with + | None -> None + | Some imports -> + Some( + { imports with + Imports = morphILDebugImports fs imports.Imports + } + ) } let morphILMethodBody fMethBody (x: MethodBody) = From 0666a98921b1314d4262871efea2fc373fd1ede1 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 20 Jul 2022 11:52:59 -0700 Subject: [PATCH 049/226] remove ENABLE_MONO_SUPPORT (#13531) * remove ENABLE_MONO_SUPPORT * temp * fantomas * Update OptimizeInputs.fs Remove @@@@ --- FSharp.Profiles.props | 1 - fcs-samples/FscExe/FscMain.fs | 75 ++------------- fcs-samples/FsiExe/fsimain.fs | 12 +-- src/Compiler/AbstractIL/ilread.fs | 4 +- src/Compiler/AbstractIL/ilreflect.fs | 45 +-------- src/Compiler/AbstractIL/ilsign.fs | 94 +++++-------------- src/Compiler/AbstractIL/ilwrite.fs | 28 ------ src/Compiler/AbstractIL/ilwritepdb.fs | 9 +- src/Compiler/AbstractIL/ilwritepdb.fsi | 2 +- src/Compiler/Driver/CompilerConfig.fs | 37 +------- src/Compiler/Driver/CompilerOptions.fs | 5 - src/Compiler/Driver/CreateILModule.fs | 3 +- src/Compiler/Driver/OptimizeInputs.fs | 3 +- src/Compiler/Driver/OptimizeInputs.fsi | 1 - src/Compiler/Driver/fsc.fs | 1 - src/Compiler/FSharp.Compiler.Service.fsproj | 1 - src/Compiler/Facilities/CompilerLocation.fs | 14 +-- src/Compiler/Interactive/fsi.fs | 41 ++------ .../Legacy/LegacyMSBuildReferenceResolver.fs | 10 +- src/Compiler/Service/FSharpSource.fs | 18 +--- src/Compiler/Service/service.fs | 8 +- src/Compiler/Utilities/FileSystem.fs | 5 +- src/Compiler/Utilities/illib.fs | 18 ---- src/Compiler/Utilities/illib.fsi | 2 - .../CreateFSharpManifestResourceName.fs | 27 +----- src/fsi/fsimain.fs | 15 +-- 26 files changed, 70 insertions(+), 409 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 00d4e745892..37a9dae76b2 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -6,7 +6,6 @@ $(DefineConstants);CROSS_PLATFORM_COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT diff --git a/fcs-samples/FscExe/FscMain.fs b/fcs-samples/FscExe/FscMain.fs index 4b465cb2ab5..a1c41a44dba 100644 --- a/fcs-samples/FscExe/FscMain.fs +++ b/fcs-samples/FscExe/FscMain.fs @@ -8,7 +8,6 @@ open System.IO open System.Reflection open System.Runtime.CompilerServices open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.AbstractIL.Utils // runningOnMono open FSharp.Compiler.AbstractIL.Library open FSharp.Compiler.ErrorLogger @@ -51,17 +50,9 @@ module FSharpResidentCompiler = static let userName = Environment.GetEnvironmentVariable (if onWindows then "USERNAME" else "USER") // Use different base channel names on mono and CLR as a CLR remoting process can't talk // to a mono server - static let baseChannelName = - if runningOnMono then - "FSCChannelMono" - else - "FSCChannel" + static let baseChannelName = "FSCChannel" static let channelName = baseChannelName + "_" + domainName + "_" + userName - static let serverName = - if runningOnMono then - "FSCServerMono" - else - "FSCSever" + static let serverName = "FSCSever" static let mutable serverExists = true let outputCollector = new OutputCollector() @@ -119,30 +110,8 @@ module FSharpResidentCompiler = ChannelServices.RegisterChannel(chan,false); RemotingServices.Marshal(server,serverName) |> ignore - // On Unix, the file permissions of the implicit socket need to be set correctly to make this - // private to the user. - if runningOnMono then - try - let monoPosix = System.Reflection.Assembly.Load(new System.Reflection.AssemblyName("Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756")) - let monoUnixFileInfo = monoPosix.GetType("Mono.Unix.UnixFileSystemInfo") - let socketName = Path.Combine(FileSystem.GetTempPathShim(), channelName) - let fileEntry = monoUnixFileInfo.InvokeMember("GetFileSystemEntry", (BindingFlags.InvokeMethod ||| BindingFlags.Static ||| BindingFlags.Public), null, null, [| box socketName |],System.Globalization.CultureInfo.InvariantCulture) - // Add 0x00000180 (UserReadWriteExecute) to the access permissions on Unix - monoUnixFileInfo.InvokeMember("set_FileAccessPermissions", (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), null, fileEntry, [| box 0x00000180 |],System.Globalization.CultureInfo.InvariantCulture) |> ignore -#if DEBUG - if !progress then printfn "server: good, set permissions on socket name '%s'" socketName - let fileEntry = monoUnixFileInfo.InvokeMember("GetFileSystemEntry", (BindingFlags.InvokeMethod ||| BindingFlags.Static ||| BindingFlags.Public), null, null, [| box socketName |],System.Globalization.CultureInfo.InvariantCulture) - let currPermissions = monoUnixFileInfo.InvokeMember("get_FileAccessPermissions", (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), null, fileEntry, [| |],System.Globalization.CultureInfo.InvariantCulture) |> unbox - if !progress then printfn "server: currPermissions = '%o' (octal)" currPermissions -#endif - with e -> -#if DEBUG - printfn "server: failed to set permissions on socket, perhaps on windows? Is is not needed there." -#endif - () - // Fail silently server.Run() - + static member private ConnectToServer() = Activator.GetObject(typeof,"ipc://" + channelName + "/" + serverName) :?> FSharpCompilationServer @@ -164,27 +133,11 @@ module FSharpResidentCompiler = Some client with _ -> if !progress then printfn "client: error while creating client, starting client instead" - let procInfo = - if runningOnMono then - let shellName, useShellExecute = - match System.Environment.GetEnvironmentVariable("FSC_MONO") with - | null -> - if onWindows then - // e.g. "C:\Program Files\Mono-2.6.1\lib\mono\2.0\mscorlib.dll" --> "C:\Program Files\Mono-2.6.1\bin\mono.exe" - Path.Combine(Path.GetDirectoryName (typeof.Assembly.Location), @"..\..\..\bin\mono.exe"), false - else - "mono-sgen", true - | path -> path, true - - ProcessStartInfo(FileName = shellName, - Arguments = fscServerExe + " /server", - CreateNoWindow = true, - UseShellExecute = useShellExecute) - else - ProcessStartInfo(FileName=fscServerExe, - Arguments = "/server", - CreateNoWindow = true, - UseShellExecute = false) + let procInfo = + ProcessStartInfo(FileName=fscServerExe, + Arguments = "/server", + CreateNoWindow = true, + UseShellExecute = false) let cmdProcess = new Process(StartInfo=procInfo) //let exitE = cmdProcess.Exited |> Observable.map (fun x -> x) @@ -261,7 +214,7 @@ module Driver = System.Console.ReadKey() |> ignore #if RESIDENT_COMPILER - if runningOnMono && hasArgument "resident" argv then + if hasArgument "resident" argv then let argv = stripArgument "resident" argv let fscServerExe = typeof.Assembly.Location @@ -272,10 +225,6 @@ module Driver = let errors, exitCode = FSharpChecker.Create().Compile (argv) |> Async.RunSynchronously for error in errors do eprintfn "%s" (error.ToString()) exitCode - - elif runningOnMono && hasArgument "server" argv then - FSharpResidentCompiler.FSharpCompilationServer.RunServer() - 0 #endif else let errors, exitCode = FSharpChecker.Create().Compile (argv) |> Async.RunSynchronously @@ -290,12 +239,6 @@ let main(argv) = System.Runtime.GCSettings.LatencyMode <- System.Runtime.GCLatencyMode.Batch use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter -//#if NO_HEAPTERMINATION -//#else -// if not runningOnMono then Lib.UnmanagedProcessExecutionOptions.EnableHeapTerminationOnCorruption() (* SDL recommendation *) -// Lib.UnmanagedProcessExecutionOptions.EnableHeapTerminationOnCorruption() (* SDL recommendation *) -//#endif - try Driver.main(Array.append [| "fsc.exe" |] argv); with e -> diff --git a/fcs-samples/FsiExe/fsimain.fs b/fcs-samples/FsiExe/fsimain.fs index 5fb34c3af17..e0ebdeef41e 100644 --- a/fcs-samples/FsiExe/fsimain.fs +++ b/fcs-samples/FsiExe/fsimain.fs @@ -211,13 +211,11 @@ let MainMain argv = // Route GUI application exceptions to the exception handlers Application.add_ThreadException(new ThreadExceptionEventHandler(fun _ args -> fsiSession.ReportUnhandledException args.Exception)); - let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e-> false - if not runningOnMono then - try - TrySetUnhandledExceptionMode() - with _ -> - () - + try + TrySetUnhandledExceptionMode() + with _ -> + () + #if USE_WINFORMS_EVENT_LOOP try fsi.EventLoop <- WinFormsEventLoop(fsiSession.LCID) with e -> diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 3324ec1c423..964d4d2b779 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -5023,7 +5023,7 @@ let OpenILModuleReader fileName opts = // let ilModuleReader = // Check if we are doing metadataOnly reading (the most common case in both the compiler and IDE) - if not runningOnMono && metadataOnly then + if metadataOnly then // See if tryGetMetadata gives us a BinaryFile for the metadata section alone. let mdfileOpt = @@ -5079,7 +5079,7 @@ let OpenILModuleReader fileName opts = // multi-proc build. So use memory mapping, but only for stable files. Other files // still use an in-memory ByteFile let pefile = - if not runningOnMono && (alwaysMemoryMapFSC || stableFileHeuristicApplies fullPath) then + if alwaysMemoryMapFSC || stableFileHeuristicApplies fullPath then let _, pefile = getBinaryFile fullPath false pefile else diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index dee8045ad08..b09ade2f551 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -631,26 +631,7 @@ let envUpdateCreatedTypeRef emEnv (tref: ILTypeRef) = if typB.IsCreated() then let ty = typB.CreateTypeAndLog() -#if ENABLE_MONO_SUPPORT - // Mono has a bug where executing code that includes an array type - // match "match x with :? C[] -> ..." before the full loading of an object of type - // causes a failure when C is later loaded. One workaround for this is to attempt to do a fake allocation - // of objects. We use System.Runtime.Serialization.FormatterServices.GetUninitializedObject to do - // the fake allocation - this creates an "empty" object, even if the object doesn't have - // a constructor. It is not usable in partial trust code. - if - runningOnMono - && ty.IsClass - && not ty.IsAbstract - && not ty.IsGenericType - && not ty.IsGenericTypeDefinition - then - try - System.Runtime.Serialization.FormatterServices.GetUninitializedObject ty - |> ignore - with _ -> - () -#endif + { emEnv with emTypMap = Zmap.add tref (typT, typB, typeDef, Some ty) emEnv.emTypMap } @@ -898,17 +879,7 @@ let convReturnModifiers cenv emEnv (p: ILReturn) = // have to use alternative means for various Method/Field/Constructor lookups. However since // it isn't we resort to this technique... let TypeBuilderInstantiationT = - let ty = -#if ENABLE_MONO_SUPPORT - if runningOnMono then - let ty = Type.GetType("System.Reflection.MonoGenericClass") - - match ty with - | null -> Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation") - | _ -> ty - else -#endif - Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation") + let ty = Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation") assert (not (isNull ty)) ty @@ -1633,12 +1604,6 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = let elemTy = arrayTy.GetElementType() let meth = -#if ENABLE_MONO_SUPPORT - // See bug 6254: Mono has a bug in reflection-emit dynamic calls to the "Get", "Address" or "Set" methods on arrays - if runningOnMono then - getArrayMethInfo shape.Rank elemTy - else -#endif modB.GetArrayMethodAndLog(arrayTy, "Get", CallingConventions.HasThis, elemTy, Array.create shape.Rank typeof) ilG.EmitAndLog(OpCodes.Call, meth) @@ -1651,12 +1616,6 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = let elemTy = arrayTy.GetElementType() let meth = -#if ENABLE_MONO_SUPPORT - // See bug 6254: Mono has a bug in reflection-emit dynamic calls to the "Get", "Address" or "Set" methods on arrays - if runningOnMono then - setArrayMethInfo shape.Rank elemTy - else -#endif modB.GetArrayMethodAndLog( arrayTy, "Set", diff --git a/src/Compiler/AbstractIL/ilsign.fs b/src/Compiler/AbstractIL/ilsign.fs index 6118383758e..de79383120c 100644 --- a/src/Compiler/AbstractIL/ilsign.fs +++ b/src/Compiler/AbstractIL/ilsign.fs @@ -519,32 +519,18 @@ let getICLRStrongName () = | Some sn -> sn let legacySignerGetPublicKeyForKeyPair kp = - if runningOnMono then - let snt = System.Type.GetType("Mono.Security.StrongName") - let sn = System.Activator.CreateInstance(snt, [| box kp |]) - - snt.InvokeMember( - "PublicKey", - (BindingFlags.GetProperty ||| BindingFlags.Instance ||| BindingFlags.Public), - null, - sn, - [||], - Globalization.CultureInfo.InvariantCulture - ) - :?> byte[] - else - let mutable pSize = 0u - let mutable pBuffer: nativeint = (nativeint) 0 - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameGetPublicKey(Unchecked.defaultof, kp, (uint32) kp.Length, &pBuffer, &pSize) - |> ignore - - let mutable keybuffer: byte[] = Bytes.zeroCreate (int pSize) - // Copy the marshalled data over - we'll have to free this ourselves - Marshal.Copy(pBuffer, keybuffer, 0, int pSize) - iclrSN.StrongNameFreeBuffer pBuffer |> ignore - keybuffer + let mutable pSize = 0u + let mutable pBuffer: nativeint = (nativeint) 0 + let iclrSN = getICLRStrongName () + + iclrSN.StrongNameGetPublicKey(Unchecked.defaultof, kp, (uint32) kp.Length, &pBuffer, &pSize) + |> ignore + + let mutable keybuffer: byte[] = Bytes.zeroCreate (int pSize) + // Copy the marshalled data over - we'll have to free this ourselves + Marshal.Copy(pBuffer, keybuffer, 0, int pSize) + iclrSN.StrongNameFreeBuffer pBuffer |> ignore + keybuffer let legacySignerGetPublicKeyForKeyContainer kc = let mutable pSize = 0u @@ -565,51 +551,21 @@ let legacySignerCloseKeyContainer kc = iclrSN.StrongNameKeyDelete kc |> ignore let legacySignerSignatureSize (pk: byte[]) = - if runningOnMono then - if pk.Length > 32 then pk.Length - 32 else 128 - else - let mutable pSize = 0u - let iclrSN = getICLRStrongName () - iclrSN.StrongNameSignatureSize(pk, uint32 pk.Length, &pSize) |> ignore - int pSize + let mutable pSize = 0u + let iclrSN = getICLRStrongName () + iclrSN.StrongNameSignatureSize(pk, uint32 pk.Length, &pSize) |> ignore + int pSize let legacySignerSignFileWithKeyPair fileName kp = - if runningOnMono then - let snt = System.Type.GetType("Mono.Security.StrongName") - let sn = System.Activator.CreateInstance(snt, [| box kp |]) - let conv (x: obj) = if (unbox x: bool) then 0 else -1 - - snt.InvokeMember( - "Sign", - (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), - null, - sn, - [| box fileName |], - Globalization.CultureInfo.InvariantCulture - ) - |> conv - |> check "Sign" - - snt.InvokeMember( - "Verify", - (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), - null, - sn, - [| box fileName |], - Globalization.CultureInfo.InvariantCulture - ) - |> conv - |> check "Verify" - else - let mutable pcb = 0u - let mutable ppb = (nativeint) 0 - let mutable ok = false - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameSignatureGeneration(fileName, Unchecked.defaultof, kp, uint32 kp.Length, ppb, &pcb) - |> ignore - - iclrSN.StrongNameSignatureVerificationEx(fileName, true, &ok) |> ignore + let mutable pcb = 0u + let mutable ppb = (nativeint) 0 + let mutable ok = false + let iclrSN = getICLRStrongName () + + iclrSN.StrongNameSignatureGeneration(fileName, Unchecked.defaultof, kp, uint32 kp.Length, ppb, &pcb) + |> ignore + + iclrSN.StrongNameSignatureVerificationEx(fileName, true, &ok) |> ignore let legacySignerSignFileWithKeyContainer fileName kcName = let mutable pcb = 0u diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 3601292a4fd..ef8f4b4ec65 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -3197,29 +3197,6 @@ module FileSystemUtilities = open System.Reflection open System.Globalization let progress = try Environment.GetEnvironmentVariable("FSharp_DebugSetFilePermissions") <> null with _ -> false - let setExecutablePermission (fileName: string) = - -#if ENABLE_MONO_SUPPORT - if runningOnMono then - try - let monoPosix = Assembly.Load("Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756") - if progress then eprintf "loading type Mono.Unix.UnixFileInfo...\n" - let monoUnixFileInfo = monoPosix.GetType("Mono.Unix.UnixFileSystemInfo") - let fileEntry = monoUnixFileInfo.InvokeMember("GetFileSystemEntry", (BindingFlags.InvokeMethod ||| BindingFlags.Static ||| BindingFlags.Public), null, null, [| box fileName |], CultureInfo.InvariantCulture) - let prevPermissions = monoUnixFileInfo.InvokeMember("get_FileAccessPermissions", (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), null, fileEntry, [| |], CultureInfo.InvariantCulture) - let prevPermissionsValue = prevPermissions |> unbox - let newPermissionsValue = prevPermissionsValue ||| 0x000001ED - let newPermissions = Enum.ToObject(prevPermissions.GetType(), newPermissionsValue) - // Add 0x000001ED (UserReadWriteExecute, GroupReadExecute, OtherReadExecute) to the access permissions on Unix - monoUnixFileInfo.InvokeMember("set_FileAccessPermissions", (BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| BindingFlags.Public), null, fileEntry, [| newPermissions |], CultureInfo.InvariantCulture) |> ignore - with exn -> - if progress then eprintf "failure: %s...\n" (exn.ToString()) - // Fail silently - else -#else - ignore fileName -#endif - () /// Arbitrary value [] @@ -4546,11 +4523,6 @@ let writeBinaryFiles (options: options, modul, normalizeAssemblyRefs) = try FileSystem.FileDeleteShim options.outfile with | _ -> () reraise() - try - FileSystemUtilities.setExecutablePermission options.outfile - with _ -> - () - let reopenOutput () = FileSystem.OpenFileForWriteShim(options.outfile, FileMode.Open, FileAccess.Write, FileShare.Read) diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index eef6e4d4c31..52fc97a9776 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -313,14 +313,7 @@ let pdbGetDebugInfo //------------------------------------------------------------------------------ // This function takes output file name and returns debug file name. -let getDebugFileName outfile (portablePDB: bool) = -#if ENABLE_MONO_SUPPORT - if runningOnMono && not portablePDB then - outfile + ".mdb" - else -#else - ignore portablePDB -#endif +let getDebugFileName outfile = (FileSystemUtils.chopExtension outfile) + ".pdb" let sortMethods showTimes info = diff --git a/src/Compiler/AbstractIL/ilwritepdb.fsi b/src/Compiler/AbstractIL/ilwritepdb.fsi index 50ac8534d29..79c1db52ac0 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fsi +++ b/src/Compiler/AbstractIL/ilwritepdb.fsi @@ -80,7 +80,7 @@ type PdbData = } /// Takes the output file name and returns debug file name. -val getDebugFileName: string -> bool -> string +val getDebugFileName: string -> string /// 28 is the size of the IMAGE_DEBUG_DIRECTORY in ntimage.h val sizeof_IMAGE_DEBUG_DIRECTORY: System.Int32 diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 7fd03d84bdf..88db6a031c2 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -643,7 +643,7 @@ type TcConfigBuilder = outputFile = None platform = None prefer32Bit = false - useSimpleResolution = runningOnMono + useSimpleResolution = false target = CompilerTarget.ConsoleExe debuginfo = false testFlagEmitFeeFeeAs100001 = false @@ -836,7 +836,7 @@ type TcConfigBuilder = if tcConfigB.debuginfo then Some( match tcConfigB.debugSymbolFile with - | None -> getDebugFileName outfile tcConfigB.portablePDB + | None -> getDebugFileName outfile | Some f -> f ) elif (tcConfigB.debugSymbolFile <> None) && (not tcConfigB.debuginfo) then @@ -1088,14 +1088,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = with e -> // We no longer expect the above to fail but leaving this just in case error (Error(FSComp.SR.buildErrorOpeningBinaryFile (fileName, e.Message), rangeStartup)) - | None -> -#if !ENABLE_MONO_SUPPORT - // TODO: we have to get msbuild out of this - if data.useSimpleResolution then - None, "" - else -#endif - None, data.legacyReferenceResolver.Impl.HighestInstalledNetFrameworkVersion() + | None -> None, data.legacyReferenceResolver.Impl.HighestInstalledNetFrameworkVersion() let makePathAbsolute path = ComputeMakePathAbsolute data.implicitIncludeDir path @@ -1143,30 +1136,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = | _ -> () | LegacyResolutionEnvironment.EditingOrCompilation _ -> -#if ENABLE_MONO_SUPPORT - if runningOnMono then - // Default compilation-time references on Mono - // - // On Mono, the default references come from the implementation assemblies. - // This is because we have had trouble reliably using MSBuild APIs to compute DotNetFrameworkReferenceAssembliesRootDirectory on Mono. - yield runtimeRoot - - if FileSystem.DirectoryExistsShim runtimeRootFacades then - yield runtimeRootFacades // System.Runtime.dll is in /usr/lib/mono/4.5/Facades - - if FileSystem.DirectoryExistsShim runtimeRootWPF then - yield runtimeRootWPF // PresentationCore.dll is in C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF - // On Mono we also add a default reference to the 4.5-api and 4.5-api/Facades directories. - let runtimeRootApi = runtimeRootWithoutSlash + "-api" - let runtimeRootApiFacades = Path.Combine(runtimeRootApi, "Facades") - - if FileSystem.DirectoryExistsShim runtimeRootApi then - yield runtimeRootApi - - if FileSystem.DirectoryExistsShim runtimeRootApiFacades then - yield runtimeRootApiFacades - else -#endif // Default compilation-time references on .NET Framework // // This is the normal case for "fsc.exe a.fs". We refer to the reference assemblies folder. diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 001523dad05..1a892bf37f8 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1285,11 +1285,6 @@ let advancedFlagsFsc tcConfigB = Some(FSComp.SR.optsStaticlink ()) ) -#if ENABLE_MONO_SUPPORT - if runningOnMono then - CompilerOption("resident", tagFile, OptionUnit(fun () -> ()), None, Some(FSComp.SR.optsResident ())) -#endif - CompilerOption("pdb", tagString, OptionString(fun s -> tcConfigB.debugSymbolFile <- Some s), None, Some(FSComp.SR.optsPdb ())) CompilerOption( diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 41b6211545f..7aad1268a74 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -580,7 +580,6 @@ module MainModuleBuilder = not (tcConfig.target.IsExe) || not (tcConfig.includewin32manifest) || not (tcConfig.win32res = "") - || runningOnMono then "" // otherwise, include the default manifest @@ -604,7 +603,7 @@ module MainModuleBuilder = ILNativeResource.Out av if not (tcConfig.win32res = "") then ILNativeResource.Out(FileSystem.OpenFileForReadShim(tcConfig.win32res).ReadAllBytes()) - if tcConfig.includewin32manifest && not (win32Manifest = "") && not runningOnMono then + if tcConfig.includewin32manifest && not (win32Manifest = "") then ILNativeResource.Out [| yield! ResFileFormat.ResFileHeader() diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index fc276a711a0..299bb1a8886 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -223,7 +223,6 @@ let GenerateIlxCode ( ilxBackend, isInteractiveItExpr, - isInteractiveOnMono, tcConfig: TcConfig, topAttrs: TopAttribs, optimizedImpls, @@ -243,7 +242,7 @@ let GenerateIlxCode let ilxGenOpts: IlxGenOptions = { generateFilterBlocks = tcConfig.generateFilterBlocks - emitConstantArraysUsingStaticDataBlobs = not isInteractiveOnMono + emitConstantArraysUsingStaticDataBlobs = true workAroundReflectionEmitBugs = tcConfig.isInteractive generateDebugSymbols = tcConfig.debuginfo // REVIEW: is this still required? fragName = fragName diff --git a/src/Compiler/Driver/OptimizeInputs.fsi b/src/Compiler/Driver/OptimizeInputs.fsi index 9c5f42f222e..d5c731ba05d 100644 --- a/src/Compiler/Driver/OptimizeInputs.fsi +++ b/src/Compiler/Driver/OptimizeInputs.fsi @@ -38,7 +38,6 @@ val CreateIlxAssemblyGenerator: val GenerateIlxCode: ilxBackend: IlxGenBackend * isInteractiveItExpr: bool * - isInteractiveOnMono: bool * tcConfig: TcConfig * topAttrs: TopAttribs * optimizedImpls: CheckedAssemblyAfterOptimization * diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index de5fbf9ebd8..654c0a8bda2 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -1139,7 +1139,6 @@ let main4 GenerateIlxCode( codegenBackend, Option.isSome dynamicAssemblyCreator, - false, tcConfig, topAttrs, optimizedImpls, diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 0a875a29c47..e5cbff8394d 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -13,7 +13,6 @@ FSharp.Compiler.Service true $(DefineConstants);COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);USE_SHIPPED_FSCORE $(OtherFlags) --extraoptimizationloops:1 --times diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 993443e57d5..48daaacf8b7 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -134,20 +134,9 @@ module internal FSharpEnvironment = let is32Bit = IntPtr.Size = 4 - let runningOnMono = - try - System.Type.GetType("Mono.Runtime") <> null - with e -> - false - let tryRegKey (subKey: string) = - //if we are running on mono simply return None - // GetDefaultRegistryStringValueViaDotNet will result in an access denied by default, - // and Get32BitRegistryStringValueViaPInvoke will fail due to Advapi32.dll not existing - if runningOnMono then - None - else if is32Bit then + if is32Bit then let s = GetDefaultRegistryStringValueViaDotNet(subKey) // If we got here AND we're on a 32-bit OS then we can validate that Get32BitRegistryStringValueViaPInvoke(...) works // by comparing against the result from GetDefaultRegistryStringValueViaDotNet(...) @@ -260,7 +249,6 @@ module internal FSharpEnvironment = let IsNetFx45OrAboveInstalled = IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" || IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" - || runningOnMono // Check if the running framework version is 4.5 or above. // Use the presence of v4.5.x in the registry to distinguish between 4.0 and 4.5 diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index ae1a0ac34b7..7d58c8472ac 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -828,10 +828,9 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, fsiConsoleOutput: FsiConsoleOutput) = let mutable enableConsoleKeyProcessing = - // Mono on Win32 doesn't implement correct console processing - not (runningOnMono && Environment.OSVersion.Platform = PlatformID.Win32NT) + not (Environment.OSVersion.Platform = PlatformID.Win32NT) - let mutable gui = not runningOnMono // override via "--gui", on by default except when on Mono + let mutable gui = true // override via "--gui" on by default #if DEBUG let mutable showILCode = false // show modul il code #endif @@ -1645,7 +1644,7 @@ type internal FsiDynamicCompiler( diagnosticsLogger.AbortOnError(fsiConsoleOutput) let fragName = textOfLid prefixPath - let codegenResults = GenerateIlxCode (IlReflectBackend, isInteractiveItExpr, runningOnMono, tcConfig, topCustomAttrs, optimizedImpls, fragName, ilxGenerator) + let codegenResults = GenerateIlxCode (IlReflectBackend, isInteractiveItExpr, tcConfig, topCustomAttrs, optimizedImpls, fragName, ilxGenerator) diagnosticsLogger.AbortOnError(fsiConsoleOutput) codegenResults, optEnv, fragName @@ -2362,9 +2361,8 @@ type internal MagicAssemblyResolution () = let simpleAssemName = fullAssemName.Split([| ',' |]).[0] if progress then fsiConsoleOutput.uprintfn "ATTEMPT MAGIC LOAD ON ASSEMBLY, simpleAssemName = %s" simpleAssemName // "Attempting to load a dynamically required assembly in response to an AssemblyResolve event by using known static assembly references..." - // We can't resolve an assembly called blah.resources" so don't try. if simpleAssemName.EndsWith(".XmlSerializers", StringComparison.OrdinalIgnoreCase) || - (simpleAssemName = "UIAutomationWinforms") then null + simpleAssemName = "UIAutomationWinforms" then null else match fsiDynamicCompiler.FindDynamicAssembly(simpleAssemName) with | Some asm -> asm @@ -3137,26 +3135,7 @@ type FsiInteractionProcessor with e -> stopProcessingRecovery e range0; finally - if progress then fprintfn fsiConsoleOutput.Out "- READER: Exiting process because of failure/exit on stdinReaderThread"; - // REVIEW: On some flavors of Mono, calling exit may freeze the process if we're using the WinForms event handler - // Basically, on Mono 2.6.3, the GUI thread may be left dangling on exit. At that point: - // -- System.Environment.Exit will cause the process to stop responding - // -- Calling Application.Exit() will leave the GUI thread up and running, creating a Zombie process - // -- Calling Abort() on the Main thread or the GUI thread will have no effect, and the process will remain unresponsive - // Also, even the the GUI thread is up and running, the WinForms event loop will be listed as closed - // In this case, killing the process is harmless, since we've already cleaned up after ourselves and FSI is responding - // to an error. (CTRL-C is handled elsewhere.) - // We'll only do this if we're running on Mono, "--gui" is specified and our input is piped in from stdin, so it's still - // fairly constrained. -#if FX_NO_WINFORMS exit 1 -#else - if runningOnMono && fsiOptions.Gui then - System.Environment.ExitCode <- 1 - Process.GetCurrentProcess().Kill() - else - exit 1 -#endif ),Name="StdinReaderThread") @@ -3254,7 +3233,7 @@ type FsiCompilationException(message: string, errorInfos: FSharpDiagnostic[] opt /// text input, writing to the given text output and error writers. type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], inReader:TextReader, outWriter:TextWriter, errorWriter: TextWriter, fsiCollectible: bool, legacyReferenceResolver: LegacyReferenceResolver option) = - do if not runningOnMono then UnmanagedProcessExecutionOptions.EnableHeapTerminationOnCorruption() (* SDL recommendation *) + do UnmanagedProcessExecutionOptions.EnableHeapTerminationOnCorruption() (* SDL recommendation *) // Explanation: When FsiEvaluationSession.Create is called we do a bunch of processing. For fsi.exe // and fsiAnyCpu.exe there are no other active threads at this point, so we can assume this is the @@ -3266,14 +3245,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let timeReporter = FsiTimeReporter(outWriter) - //---------------------------------------------------------------------------- - // Console coloring - //---------------------------------------------------------------------------- - - // Testing shows "console coloring" is broken on some Mono configurations (e.g. Mono 2.4 Suse LiveCD). - // To support fsi usage, the console coloring is switched off by default on Mono. - do if runningOnMono then enableConsoleColoring <- false - //---------------------------------------------------------------------------- // tcConfig - build the initial config //---------------------------------------------------------------------------- @@ -3674,7 +3645,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i // We later switch to doing interaction-by-interaction processing on the "event loop" thread let ctokRun = AssumeCompilationThreadWithoutEvidence () - if not runningOnMono && fsiOptions.IsInteractiveServer then + if fsiOptions.IsInteractiveServer then SpawnInteractiveServer (fsi, fsiOptions, fsiConsoleOutput) use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Interactive diff --git a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs b/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs index b78e3334f52..0509157d425 100644 --- a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs +++ b/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs @@ -314,19 +314,11 @@ module FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver AllowedAssemblyExtensions= [| ".dll" ; ".exe" |]) rar.TargetProcessorArchitecture <- targetProcessorArchitecture let targetedRuntimeVersionValue = typeof.Assembly.ImageRuntimeVersion -#if ENABLE_MONO_SUPPORT - // The properties TargetedRuntimeVersion and CopyLocalDependenciesWhenParentReferenceInGac - // are not available on Mono. So we only set them if available (to avoid a compile-time dependency). - if not runningOnMono then - typeof.InvokeMember("TargetedRuntimeVersion",(BindingFlags.Instance ||| BindingFlags.SetProperty ||| BindingFlags.Public),null,rar,[| box targetedRuntimeVersionValue |]) |> ignore - typeof.InvokeMember("CopyLocalDependenciesWhenParentReferenceInGac",(BindingFlags.Instance ||| BindingFlags.SetProperty ||| BindingFlags.Public),null,rar,[| box true |]) |> ignore -#else rar.TargetedRuntimeVersion <- targetedRuntimeVersionValue rar.CopyLocalDependenciesWhenParentReferenceInGac <- true -#endif let succeeded = rar.Execute() - + if not succeeded then raise LegacyResolutionFailure diff --git a/src/Compiler/Service/FSharpSource.fs b/src/Compiler/Service/FSharpSource.fs index b7f13801c98..383a61be85a 100644 --- a/src/Compiler/Service/FSharpSource.fs +++ b/src/Compiler/Service/FSharpSource.fs @@ -79,17 +79,7 @@ type FSharpSource with static member CreateCopyFromFile(filePath: string) = let timeStamp = FileSystem.GetLastWriteTimeShim(filePath) - // We want to use mmaped documents only when - // not running on mono, since its MemoryMappedFile implementation throws when "mapName" is not provided (is null), (see: https://github.com/mono/mono/issues/10245) - if runningOnMono then - let bytes = - FileSystem - .OpenFileForReadShim(filePath, useMemoryMappedFile = false) - .ReadAllBytes() - - FSharpSourceByteArray(filePath, timeStamp, bytes) :> FSharpSource - else - let openStream = - fun () -> FileSystem.OpenFileForReadShim(filePath, useMemoryMappedFile = true, shouldShadowCopy = true) - - FSharpSourceMemoryMappedFile(filePath, timeStamp, openStream) :> FSharpSource + let openStream = + fun () -> FileSystem.OpenFileForReadShim(filePath, useMemoryMappedFile = true, shouldShadowCopy = true) + + FSharpSourceMemoryMappedFile(filePath, timeStamp, openStream) :> FSharpSource diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 20fd5956c43..3ff00eeb31a 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -1081,12 +1081,8 @@ type BackgroundCompiler let otherFlags = defaultArg otherFlags extraFlags - let useSimpleResolution = -#if ENABLE_MONO_SUPPORT - runningOnMono || otherFlags |> Array.exists (fun x -> x = "--simpleresolution") -#else - true -#endif + let useSimpleResolution = otherFlags |> Array.exists (fun x -> x = "--simpleresolution") + let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading let applyCompilerOptions tcConfigB = diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index bdd64e87b69..791e829a367 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -361,9 +361,6 @@ module MemoryMappedFileExtensions = if length = 0L then None - else if runningOnMono then - // mono's MemoryMappedFile implementation throws with null `mapName`, so we use byte arrays instead: https://github.com/mono/mono/issues/1024 - None else // Try to create a memory mapped file and copy the contents of the given bytes to it. // If this fails, then we clean up and return None. @@ -536,7 +533,7 @@ type DefaultFileSystem() as this = // - Running on mono, since its MemoryMappedFile implementation throws when "mapName" is not provided (is null). // (See: https://github.com/mono/mono/issues/10245) - if runningOnMono || (not useMemoryMappedFile) then + if not useMemoryMappedFile then fileStream :> Stream else let mmf = diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 3c1172aec7d..eb86fce0030 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -67,24 +67,6 @@ module internal PervasiveAutoOpens = /// We set the limit to be 80k to account for larger pointer sizes for when F# is running 64-bit. let LOH_SIZE_THRESHOLD_BYTES = 80_000 - let runningOnMono = -#if ENABLE_MONO_SUPPORT - // Officially supported way to detect if we are running on Mono. - // See http://www.mono-project.com/FAQ:_Technical - // "How can I detect if am running in Mono?" section - try - Type.GetType "Mono.Runtime" <> null - with _ -> - // Must be robust in the case that someone else has installed a handler into System.AppDomain.OnTypeResolveEvent - // that is not reliable. - // This is related to bug 5506--the issue is actually a bug in VSTypeResolutionService.EnsurePopulated which is - // called by OnTypeResolveEvent. The function throws a NullReferenceException. I'm working with that team to get - // their issue fixed but we need to be robust here anyway. - false -#else - false -#endif - type String with member inline x.StartsWithOrdinal value = diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index 8ea3cb9727b..1be82c84895 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -50,8 +50,6 @@ module internal PervasiveAutoOpens = val reportTime: (bool -> string -> unit) - val runningOnMono: bool - /// Get an initialization hole val getHole: r: 'a option ref -> 'a diff --git a/src/FSharp.Build/CreateFSharpManifestResourceName.fs b/src/FSharp.Build/CreateFSharpManifestResourceName.fs index 9c86fb7fb7d..fb5874a0ee6 100644 --- a/src/FSharp.Build/CreateFSharpManifestResourceName.fs +++ b/src/FSharp.Build/CreateFSharpManifestResourceName.fs @@ -31,32 +31,7 @@ type CreateFSharpManifestResourceName public () = let fileName, linkFileName, rootNamespace = match this.UseStandardResourceNames with | true -> fileName, linkFileName, rootNamespace - | false -> - let runningOnMono = - try - System.Type.GetType("Mono.Runtime") <> null - with e -> - false - - let fileName = - if - not runningOnMono - || fileName.EndsWith(".resources", StringComparison.OrdinalIgnoreCase) - then - fileName - else - Path.GetFileName(fileName) - - let linkFileName = - if - not runningOnMono - || linkFileName.EndsWith(".resources", StringComparison.OrdinalIgnoreCase) - then - linkFileName - else - Path.GetFileName(linkFileName) - - fileName, linkFileName, "" + | false -> fileName, linkFileName, "" let embeddedFileName = match linkFileName with diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index ae6513f00cc..4bd0c1903ed 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -333,17 +333,10 @@ let evaluateSession (argv: string[]) = new ThreadExceptionEventHandler(fun _ args -> fsiSession.ReportUnhandledException args.Exception) ) - let runningOnMono = - try - System.Type.GetType("Mono.Runtime") <> null - with e -> - false - - if not runningOnMono then - try - TrySetUnhandledExceptionMode() - with _ -> - () + try + TrySetUnhandledExceptionMode() + with _ -> + () fsiWinFormsLoop.Value |> Option.iter (fun l -> l.LCID <- fsiSession.LCID) #endif From d5b3182540210effd64c948832bb4124e954e7fd Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Thu, 21 Jul 2022 17:19:49 -0500 Subject: [PATCH 050/226] Use the live FSharp.Core bits to bootstrap. (#13544) Source-build doesn't need to match the shipped bootstrap version. See https://github.com/dotnet/fsharp/issues/13463 for more details. --- src/FSharp.Build/FSharp.Build.fsproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 56abe4a113a..a79179f198a 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -52,7 +52,7 @@ - + + $(NoWarn);NU1505 From a7b668136cc720e50b92b0cae0f06081c5df1117 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 22 Jul 2022 09:34:11 -0700 Subject: [PATCH 052/226] native tools (#13383) * native tools * path * temp * temp * TEMP * fixit --- eng/Build.ps1 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index bacf90f8c4e..3955e5d980f 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -425,7 +425,6 @@ try { [System.Environment]::SetEnvironmentVariable('DOTNET_ROLL_FORWARD_TO_PRERELEASE', '1', [System.EnvironmentVariableTarget]::User) - $env:NativeToolsOnMachine = $true Process-Arguments @@ -438,6 +437,10 @@ try { Get-ChildItem ENV: | Sort-Object Name Write-Host "" + if($env:NativeToolsOnMachine) { + $variable:NativeToolsOnMachine = $env:NativeToolsOnMachine + } + if ($ci) { Prepare-TempDir EnablePreviewSdks @@ -448,9 +451,19 @@ try { TryDownloadDotnetFrameworkSdk $nativeToolsDir = InitializeNativeTools - write-host "Native tools: $nativeToolsDir" - $env:PERL5Path = Join-Path "$nativeToolsDir" "perl\5.32.1.1\perl\bin\perl.exe" - $env:PERL5LIB = Join-Path "$nativeToolsDir" "perl\5.32.1.1\perl\vendor\lib" + + if (-not (Test-Path variable:NativeToolsOnMachine)) { + $env:PERL5Path = Join-Path "$nativeToolsDir" "perl\5.32.1.1\perl\bin\perl.exe" + write-host "variable:NativeToolsOnMachine = unset or false" + write-host "nativeToolsDir = $nativeToolsDir" + write-host "Path = $env:PERL5Path" + } + else { + $env:PERL5Path = "C:\arcade-tools\perl-5.32.1.1\perl\bin\perl.exe" + write-host "variable:NativeToolsOnMachine = $variable:NativeToolsOnMachine" + write-host "nativeToolsDir = $nativeToolsDir" + write-host "Path = $env:PERL5Path" + } $dotnetPath = InitializeDotNetCli $env:DOTNET_ROOT = "$dotnetPath" @@ -517,7 +530,9 @@ try { $env:FSCOREDLLPATH = "$ArtifactsDir\bin\fsc\$configuration\net472\FSharp.Core.dll" $env:LINK_EXE = "$RepoRoot\tests\fsharpqa\testenv\bin\link\link.exe" $env:OSARCH = $env:PROCESSOR_ARCHITECTURE + write-host "Exec-Console $env:PERL5Path" Exec-Console $env:PERL5Path """$RepoRoot\tests\fsharpqa\testenv\bin\runall.pl"" -resultsroot ""$resultsRoot"" -results $resultsLog -log $errorLog -fail $failLog -cleanup:no -procs:$env:NUMBER_OF_PROCESSORS" + write-host "Exec-Console finished" Pop-Location } From 80b550321b7da2bb5a6c389eaa4c456a7caba14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Matou=C5=A1ek?= Date: Sun, 24 Jul 2022 15:47:07 -0700 Subject: [PATCH 053/226] Use External Access wrapper of IWorkspaceProjectContextFactory (#13514) * Use External Access wrapper of IWorkspaceProjectContextFactory * Update dependencies * VB fixes --- eng/Versions.props | 131 ++++++++------- .../LanguageService/LanguageService.fs | 4 +- .../LegacyProjectWorkspaceMap.fs | 16 +- .../LanguageService/MetadataAsSource.fs | 16 +- .../LanguageService/SingleFileWorkspaceMap.fs | 150 +++--------------- .../FSharp.ProjectSystem.PropertyPages.vbproj | 1 + .../PropertyPages/ApplicationPropPageBase.vb | 17 +- .../PropertyPages/DebugPropPage.vb | 4 +- .../UnitTests/Workspace/WorkspaceTests.fs | 10 +- 9 files changed, 130 insertions(+), 219 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6571c5fb21a..b067e8c4f16 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -112,82 +112,91 @@ 4.3.0 6.0.0 4.5.0 - - 17.2.178-preview - 17.2.0-preview-1-32131-009 + + + 4.4.0-1.22368.2 + 17.3.133-preview + 17.3.0-preview-1-32407-044 17.0.77-pre-g62a6cb5699 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - 17.0.0-preview-1-31115-307 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) + 17.3.1-alpha + 17.1.0 + - 4.2.0-3.22154.1 $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) - 2.0.28 $(RoslynVersion) + 2.0.28 + + + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + 14.3.25407 + 10.0.30319 + 11.0.50727 + 15.0.25123-Dev15Preview + 16.0.1 + 16.0.28924.11111 + - 17.0.0 $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) - 17.1.4054 - - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - - 16.7.30329.88 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - - 17.2.22-alpha - $(VisualStudioImplementationPackagesVersion) - 17.0.0 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) + + + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + + + $(MicrosoftVisualStudioThreadingPackagesVersion) + + $(VisualStudioProjectSystemPackagesVersion) 2.3.6152103 - 14.3.25407 - 10.0.30319 - 11.0.50727 - 15.0.25123-Dev15Preview - 16.0.1 - 16.0.28924.11111 - 17.2.10-alpha - $(VisualStudioContractPackagesVersion) - 17.0.46 + + + 17.1.4054 + 17.3.3-alpha + 17.0.0 + 17.0.53 9.0.30729 6.0.0 12.0.4 @@ -216,7 +225,7 @@ 3.11.0 2.1.80 1.0.0-beta2-dev3 - 2.11.34 + 2.12.7-alpha 2.8.57 2.4.1 2.4.2 diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index b50277c019b..203867a6afe 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -259,14 +259,14 @@ type internal FSharpPackage() as this = solutionEventsOpt <- Some(solutionEvents) solution.AdviseSolutionEvents(solutionEvents) |> ignore - let projectContextFactory = this.ComponentModel.GetService() + let projectContextFactory = this.ComponentModel.GetService() let miscFilesWorkspace = this.ComponentModel.GetService() let _singleFileWorkspaceMap = new SingleFileWorkspaceMap( FSharpMiscellaneousFileService( workspace, miscFilesWorkspace, - FSharpWorkspaceProjectContextFactory(projectContextFactory) + projectContextFactory ), rdt) let _legacyProjectWorkspaceMap = new LegacyProjectWorkspaceMap(solution, optionsManager, projectContextFactory) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs index 996ce1cadf8..78c6ad15785 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs @@ -12,6 +12,7 @@ open System.IO open System.Linq open System.Runtime.CompilerServices open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem @@ -21,10 +22,10 @@ open Microsoft.VisualStudio.Shell.Interop [] type internal LegacyProjectWorkspaceMap(solution: IVsSolution, projectInfoManager: FSharpProjectOptionsManager, - projectContextFactory: IWorkspaceProjectContextFactory) as this = + projectContextFactory: FSharpWorkspaceProjectContextFactory) as this = let invalidPathChars = set (Path.GetInvalidPathChars()) - let optionsAssociation = ConditionalWeakTable() + let optionsAssociation = ConditionalWeakTable() let isPathWellFormed (path: string) = not (String.IsNullOrWhiteSpace path) && path |> Seq.forall (fun c -> not (Set.contains c invalidPathChars)) let projectDisplayNameOf projectFileName = @@ -40,7 +41,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, /// Sync the Roslyn information for the project held in 'projectContext' to match the information given by 'site'. /// Also sync the info in ProjectInfoManager if necessary. - member this.SyncLegacyProject(projectContext: IWorkspaceProjectContext, site: IProjectSite) = + member this.SyncLegacyProject(projectContext: FSharpWorkspaceProjectContext, site: IProjectSite) = let wellFormedFilePathSetIgnoreCase (paths: seq) = HashSet(paths |> Seq.filter isPathWellFormed |> Seq.map (fun s -> try Path.GetFullPath(s) with _ -> s), StringComparer.OrdinalIgnoreCase) @@ -58,7 +59,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, for file in updatedFiles do if not(originalFiles.Contains(file)) then - projectContext.AddSourceFile(file) + projectContext.AddSourceFile(file, SourceCodeKind.Regular) for file in originalFiles do if not(updatedFiles.Contains(file)) then @@ -72,7 +73,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, for ref in updatedRefs do if not(originalRefs.Contains(ref)) then - projectContext.AddMetadataReference(ref, MetadataReferenceProperties.Assembly) + projectContext.AddMetadataReference(ref) for ref in originalRefs do if not(updatedRefs.Contains(ref)) then @@ -90,7 +91,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, //projectContext.SetOptions(String.concat " " updatedOptions) for file in updatedFiles do projectContext.RemoveSourceFile(file) - projectContext.AddSourceFile(file) + projectContext.AddSourceFile(file, SourceCodeKind.Regular) // Record the last seen options as an associated value if ok then optionsAssociation.Remove(projectContext) |> ignore @@ -119,7 +120,6 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, let projectContext = projectContextFactory.CreateProjectContext( - FSharpConstants.FSharpLanguageName, projectDisplayName, projectFileName, projectGuid, @@ -131,7 +131,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, // Sync IProjectSite --> projectContext, and IProjectSite --> ProjectInfoManage this.SyncLegacyProject(projectContext, site) - site.BuildErrorReporter <- Some (projectContext :?> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) + site.BuildErrorReporter <- Some (projectContext.BuildErrorReporter) // TODO: consider forceUpdate = false here. forceUpdate=true may be causing repeated computation? site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, diff --git a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs index 3c205e68c87..0fe209093d0 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs @@ -17,6 +17,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.FindSymbols open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.LanguageServices.ProjectSystem @@ -96,25 +97,26 @@ module internal MetadataAsSource = type internal FSharpMetadataAsSourceService() = let serviceProvider = ServiceProvider.GlobalProvider - let projs = System.Collections.Concurrent.ConcurrentDictionary() + let projs = System.Collections.Concurrent.ConcurrentDictionary() let createMetadataProjectContext (projInfo: ProjectInfo) (docInfo: DocumentInfo) = let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel - let projectContextFactory = componentModel.GetService() - let projectContext = projectContextFactory.CreateProjectContext(LanguageNames.FSharp, projInfo.Id.ToString(), projInfo.FilePath, Guid.NewGuid(), null, null) + let projectContextFactory = componentModel.GetService() + + let projectContext = projectContextFactory.CreateProjectContext(projInfo.FilePath, projInfo.Id.ToString()) projectContext.DisplayName <- projInfo.Name - projectContext.AddSourceFile(docInfo.FilePath, sourceCodeKind = SourceCodeKind.Regular) - + projectContext.AddSourceFile(docInfo.FilePath, SourceCodeKind.Regular) + for metaRef in projInfo.MetadataReferences do match metaRef with | :? PortableExecutableReference as peRef -> - projectContext.AddMetadataReference(peRef.FilePath, MetadataReferenceProperties.Assembly) + projectContext.AddMetadataReference(peRef.FilePath) | _ -> () projectContext - let clear filePath (projectContext: IWorkspaceProjectContext) = + let clear filePath (projectContext: IFSharpWorkspaceProjectContext) = projs.TryRemove(filePath) |> ignore projectContext.Dispose() try diff --git a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs index 87aeb8264ee..7f596d17a82 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs @@ -4,125 +4,19 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Collections.Concurrent -open System.Collections.Immutable open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor -open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell.Interop -open Microsoft.VisualStudio.LanguageServices open FSharp.Compiler.CodeAnalysis -type internal IFSharpWorkspaceProjectContext = - inherit IDisposable - - abstract Id : ProjectId - - abstract FilePath : string - - abstract ProjectReferenceCount : int - - abstract HasProjectReference : filePath: string -> bool - - abstract SetProjectReferences : IFSharpWorkspaceProjectContext seq -> unit - - abstract MetadataReferenceCount : int - - abstract HasMetadataReference : referencePath: string -> bool - - abstract SetMetadataReferences : referencePaths: string seq -> unit - -type internal IFSharpWorkspaceProjectContextFactory = - - abstract CreateProjectContext : filePath: string -> IFSharpWorkspaceProjectContext - -type private ProjectContextState = - { - refs: ImmutableDictionary - metadataRefs: ImmutableHashSet - } - -type internal FSharpWorkspaceProjectContext(vsProjectContext: IWorkspaceProjectContext) = - - let mutable state = - { - refs = ImmutableDictionary.Create(StringComparer.OrdinalIgnoreCase) - metadataRefs = ImmutableHashSet.Create(equalityComparer = StringComparer.OrdinalIgnoreCase) - } - - member private _.VisualStudioProjectContext = vsProjectContext - - member private _.AddProjectReference(builder: ImmutableDictionary<_, _>.Builder, projectContext: IFSharpWorkspaceProjectContext) = - match projectContext with - | :? FSharpWorkspaceProjectContext as fsProjectContext -> - vsProjectContext.AddProjectReference(fsProjectContext.VisualStudioProjectContext, MetadataReferenceProperties.Assembly) - builder.Add(projectContext.FilePath, projectContext) - | _ -> - () - - member private _.RemoveProjectReference(projectContext: IFSharpWorkspaceProjectContext) = - match projectContext with - | :? FSharpWorkspaceProjectContext as fsProjectContext -> - vsProjectContext.RemoveProjectReference(fsProjectContext.VisualStudioProjectContext) - | _ -> - () - - member private _.AddMetadataReference(builder: ImmutableHashSet<_>.Builder, referencePath: string) = - vsProjectContext.AddMetadataReference(referencePath, MetadataReferenceProperties.Assembly) - builder.Add(referencePath) |> ignore - - member private _.RemoveMetadataReference(referencePath: string) = - vsProjectContext.RemoveMetadataReference(referencePath) - - interface IFSharpWorkspaceProjectContext with - - member _.Id = vsProjectContext.Id - - member _.FilePath = vsProjectContext.ProjectFilePath - - member _.ProjectReferenceCount = state.refs.Count - - member _.HasProjectReference(filePath) = state.refs.ContainsKey(filePath) - - member this.SetProjectReferences(projRefs) = - let builder = ImmutableDictionary.CreateBuilder() - - state.refs.Values - |> Seq.iter (fun x -> - this.RemoveProjectReference(x) - ) - - projRefs - |> Seq.iter (fun x -> - this.AddProjectReference(builder, x) - ) - - state <- { state with refs = builder.ToImmutable() } - - member _.MetadataReferenceCount = state.metadataRefs.Count - - member _.HasMetadataReference(referencePath) = state.metadataRefs.Contains(referencePath) - - member this.SetMetadataReferences(referencePaths) = - let builder = ImmutableHashSet.CreateBuilder() - - state.metadataRefs - |> Seq.iter (fun x -> - this.RemoveMetadataReference(x) - ) - - referencePaths - |> Seq.iter (fun x -> - this.AddMetadataReference(builder, x) - ) - - state <- { state with metadataRefs = builder.ToImmutable() } - - member _.Dispose() = - vsProjectContext.Dispose() +type internal FSharpMiscellaneousFileService(workspace: Workspace, + miscFilesWorkspace: Workspace, + projectContextFactory: IFSharpWorkspaceProjectContextFactory) = -type internal FSharpWorkspaceProjectContextFactory(projectContextFactory: IWorkspaceProjectContextFactory) = + let files = ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase) + let optionsManager = workspace.Services.GetRequiredService().FSharpProjectOptionsManager static let createSourceCodeKind (filePath: string) = if isScriptFile filePath then @@ -130,21 +24,6 @@ type internal FSharpWorkspaceProjectContextFactory(projectContextFactory: IWorks else SourceCodeKind.Regular - interface IFSharpWorkspaceProjectContextFactory with - - member _.CreateProjectContext filePath = - let projectContext = projectContextFactory.CreateProjectContext(FSharpConstants.FSharpLanguageName, filePath, filePath, Guid.NewGuid(), null, null) - projectContext.DisplayName <- FSharpConstants.FSharpMiscellaneousFilesName - projectContext.AddSourceFile(filePath, sourceCodeKind = createSourceCodeKind filePath) - new FSharpWorkspaceProjectContext(projectContext) :> IFSharpWorkspaceProjectContext - -type internal FSharpMiscellaneousFileService(workspace: Workspace, - miscFilesWorkspace: Workspace, - projectContextFactory: IFSharpWorkspaceProjectContextFactory) = - - let files = ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase) - let optionsManager = workspace.Services.GetRequiredService().FSharpProjectOptionsManager - static let mustUpdateProjectReferences (refSourceFiles: string []) (projectContext: IFSharpWorkspaceProjectContext) = refSourceFiles.Length <> projectContext.ProjectReferenceCount || ( @@ -161,6 +40,12 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, |> not ) + let createProjectContextForDocument (filePath: string) = + let context = projectContextFactory.CreateProjectContext(filePath, filePath) + context.DisplayName <- FSharpConstants.FSharpMiscellaneousFilesName + context.AddSourceFile(filePath, createSourceCodeKind filePath) + context + let tryRemove (document: Document) = let projIds = document.Project.Solution.GetDependentProjectIds(document.Project.Id) if projIds.Count = 0 then @@ -195,7 +80,8 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, let newProjRefs = refSourceFiles |> Array.map (fun filePath -> - let createProjectContext = lazy projectContextFactory.CreateProjectContext(filePath) + let createProjectContext = lazy createProjectContextForDocument(filePath) + if files.TryAdd(filePath, createProjectContext) then createProjectContext.Value else @@ -225,7 +111,9 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, // a F# miscellaneous project, which could be a script or not. if document.Project.IsFSharp && workspace.CurrentSolution.GetDocumentIdsWithFilePath(document.FilePath).Length = 0 then let filePath = document.FilePath - let createProjectContext = lazy projectContextFactory.CreateProjectContext(filePath) + + let createProjectContext = lazy createProjectContextForDocument(filePath) + if files.TryAdd(filePath, createProjectContext) then createProjectContext.Force() |> ignore ) @@ -293,7 +181,9 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, | Some(document) -> optionsManager.ClearSingleFileOptionsCache(document.Id) projectContext.Value.Dispose() - let newProjectContext = lazy projectContextFactory.CreateProjectContext(newFilePath) + + let newProjectContext = lazy createProjectContextForDocument(newFilePath) + if files.TryAdd(newFilePath, newProjectContext) then newProjectContext.Force() |> ignore else diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj index a6b16f955b3..5f5f1a3b687 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj @@ -24,6 +24,7 @@ true 2.0 {FCFB214C-462E-42B3-91CA-FC557EFEE74F} + true diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb index 981ae080b12..f8633f96b78 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb @@ -4,6 +4,7 @@ Imports EnvDTE Imports Microsoft.VisualBasic Imports System +Imports System.IO Imports System.Collections Imports System.ComponentModel Imports System.Diagnostics @@ -187,8 +188,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages sFileName = "" sInitialDirectory = "" Else - sFileName = System.IO.Path.GetFileName(sInitialDirectory) - sInitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory) + sFileName = Path.GetFileName(sInitialDirectory) + sInitialDirectory = Path.GetDirectoryName(sInitialDirectory) End If Dim fileNames As ArrayList = Common.Utils.GetFilesViaBrowse(ServiceProvider, Me.Handle, sInitialDirectory, SR.GetString(SR.PPG_AddExistingFilesTitle), _ @@ -312,13 +313,13 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages End If ' Verify all the characters in the path are valid - If path.IndexOfAny(IO.Path.GetInvalidPathChars()) >= 0 Then + If path.IndexOfAny(System.IO.Path.GetInvalidPathChars()) >= 0 Then ShowErrorMessage(SR.GetString(SR.PPG_Application_CantAddIcon)) Return False End If - If Not IO.Path.IsPathRooted(path) Then - path = IO.Path.Combine(GetProjectPath(), path) + If Not System.IO.Path.IsPathRooted(path) Then + path = System.IO.Path.Combine(GetProjectPath(), path) End If If System.IO.File.Exists(path) Then @@ -328,7 +329,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages ' create the Image. Try Dim IconContents As Byte() = IO.File.ReadAllBytes(path) - Dim IconStream As New IO.MemoryStream(IconContents, 0, IconContents.Length) + Dim IconStream As New MemoryStream(IconContents, 0, IconContents.Length) ApplicationIconPictureBox.Image = IconToImage(New Icon(IconStream), ApplicationIconPictureBox.ClientSize) Catch ex As Exception Common.RethrowIfUnrecoverable(ex, True) @@ -413,7 +414,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Protected Sub AddIconsFromProjectItem(ByVal ProjectItem As EnvDTE.ProjectItem, ByVal ApplicationIconCombobox As ComboBox) For Index As Short = 1 To ProjectItem.FileCount Dim FileName As String = ProjectItem.FileNames(Index) - Dim ext As String = System.IO.Path.GetExtension(FileName) + Dim ext As String = Path.GetExtension(FileName) If ext.Equals(".ico", StringComparison.OrdinalIgnoreCase) Then ApplicationIconCombobox.Items.Add(GetProjectRelativeFilePath(FileName)) End If @@ -527,7 +528,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Protected Sub AddManifestsFromProjectItem(ByVal ProjectItem As EnvDTE.ProjectItem, ByVal ApplicationManifestCombobox As ComboBox) For Index As Short = 1 To ProjectItem.FileCount Dim FileName As String = ProjectItem.FileNames(Index) - Dim ext As String = System.IO.Path.GetExtension(FileName) + Dim ext As String = Path.GetExtension(FileName) If ext.Equals(".manifest", StringComparison.OrdinalIgnoreCase) Then ApplicationManifestCombobox.Items.Add(GetProjectRelativeFilePath(FileName)) End If diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb index 5708fc56b74..00bd63a37d2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb @@ -22,7 +22,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Private m_controlGroup As Control()() 'PERF: A note about the labels used as lines. The 3D label is being set to 1 px high, - ' so youre really only using the grey part of it. Using BorderStyle.Fixed3D seems + ' so you’re really only using the grey part of it. Using BorderStyle.Fixed3D seems ' to fire an extra resize OnHandleCreated. The simple solution is to use BorderStyle.None ' and BackColor = SystemColors.ControlDark. @@ -507,7 +507,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages If sInitialDirectory = "" Then Try sInitialDirectory = Path.Combine(GetDebugPathProjectPath(), GetSelectedConfigOutputPath()) - Catch ex As IO.IOException + Catch ex As IOException 'Ignore Catch ex As Exception Common.RethrowIfUnrecoverable(ex) diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index bcdcd67b66b..d13723b9697 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -11,6 +11,7 @@ open System.Collections.Immutable open System.Threading open Microsoft.VisualStudio.Composition open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.Host open Microsoft.CodeAnalysis.Text open Microsoft.VisualStudio.FSharp.Editor @@ -184,6 +185,10 @@ module WorkspaceTests = interface IFSharpWorkspaceProjectContext with + member _.get_DisplayName() : string = "" + + member _.set_DisplayName(value: string) : unit = () + member _.Dispose(): unit = () member _.FilePath: string = mainProj.FilePath @@ -260,10 +265,13 @@ module WorkspaceTests = mainProj <- solution.GetProject(currentProj.Id) + member _.AddMetadataReference(_: string): unit = () + member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () + type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = interface IFSharpWorkspaceProjectContextFactory with - member _.CreateProjectContext(filePath: string): IFSharpWorkspaceProjectContext = + member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with | Some docId -> let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) From d6f3c8971c3e43579ba977e2e639769fd8f2077b Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 25 Jul 2022 08:12:36 -0700 Subject: [PATCH 054/226] Merge main to release/dev17.4 (#13559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomáš Matoušek --- eng/Versions.props | 131 ++++++++------- .../LanguageService/LanguageService.fs | 4 +- .../LegacyProjectWorkspaceMap.fs | 16 +- .../LanguageService/MetadataAsSource.fs | 16 +- .../LanguageService/SingleFileWorkspaceMap.fs | 150 +++--------------- .../FSharp.ProjectSystem.PropertyPages.vbproj | 1 + .../PropertyPages/ApplicationPropPageBase.vb | 17 +- .../PropertyPages/DebugPropPage.vb | 4 +- .../UnitTests/Workspace/WorkspaceTests.fs | 10 +- 9 files changed, 130 insertions(+), 219 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 84342d785c7..6d7059405f7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -112,82 +112,91 @@ 4.3.0 6.0.0 4.5.0 - - 17.2.178-preview - 17.2.0-preview-1-32131-009 + + + 4.4.0-1.22368.2 + 17.3.133-preview + 17.3.0-preview-1-32407-044 17.0.77-pre-g62a6cb5699 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - 17.0.0-preview-1-31115-307 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) + 17.3.1-alpha + 17.1.0 + - 4.2.0-3.22154.1 $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) - 2.0.28 $(RoslynVersion) + 2.0.28 + + + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + $(MicrosoftVisualStudioShellPackagesVersion) + 14.3.25407 + 10.0.30319 + 11.0.50727 + 15.0.25123-Dev15Preview + 16.0.1 + 16.0.28924.11111 + - 17.0.0 $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) - 17.1.4054 - - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - $(VisualStudioImplementationPackagesVersion) - - 16.7.30329.88 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - - 17.2.22-alpha - $(VisualStudioImplementationPackagesVersion) - 17.0.0 - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) - $(VisualStudioContractPackagesVersion) + + + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + $(VisualStudioEditorPackagesVersion) + + + $(MicrosoftVisualStudioThreadingPackagesVersion) + + $(VisualStudioProjectSystemPackagesVersion) 2.3.6152103 - 14.3.25407 - 10.0.30319 - 11.0.50727 - 15.0.25123-Dev15Preview - 16.0.1 - 16.0.28924.11111 - 17.2.10-alpha - $(VisualStudioContractPackagesVersion) - 17.0.46 + + + 17.1.4054 + 17.3.3-alpha + 17.0.0 + 17.0.53 9.0.30729 6.0.0 12.0.4 @@ -216,7 +225,7 @@ 3.11.0 2.1.80 1.0.0-beta2-dev3 - 2.11.34 + 2.12.7-alpha 2.8.57 2.4.1 2.4.2 diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index b50277c019b..203867a6afe 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -259,14 +259,14 @@ type internal FSharpPackage() as this = solutionEventsOpt <- Some(solutionEvents) solution.AdviseSolutionEvents(solutionEvents) |> ignore - let projectContextFactory = this.ComponentModel.GetService() + let projectContextFactory = this.ComponentModel.GetService() let miscFilesWorkspace = this.ComponentModel.GetService() let _singleFileWorkspaceMap = new SingleFileWorkspaceMap( FSharpMiscellaneousFileService( workspace, miscFilesWorkspace, - FSharpWorkspaceProjectContextFactory(projectContextFactory) + projectContextFactory ), rdt) let _legacyProjectWorkspaceMap = new LegacyProjectWorkspaceMap(solution, optionsManager, projectContextFactory) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs index 996ce1cadf8..78c6ad15785 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs @@ -12,6 +12,7 @@ open System.IO open System.Linq open System.Runtime.CompilerServices open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem @@ -21,10 +22,10 @@ open Microsoft.VisualStudio.Shell.Interop [] type internal LegacyProjectWorkspaceMap(solution: IVsSolution, projectInfoManager: FSharpProjectOptionsManager, - projectContextFactory: IWorkspaceProjectContextFactory) as this = + projectContextFactory: FSharpWorkspaceProjectContextFactory) as this = let invalidPathChars = set (Path.GetInvalidPathChars()) - let optionsAssociation = ConditionalWeakTable() + let optionsAssociation = ConditionalWeakTable() let isPathWellFormed (path: string) = not (String.IsNullOrWhiteSpace path) && path |> Seq.forall (fun c -> not (Set.contains c invalidPathChars)) let projectDisplayNameOf projectFileName = @@ -40,7 +41,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, /// Sync the Roslyn information for the project held in 'projectContext' to match the information given by 'site'. /// Also sync the info in ProjectInfoManager if necessary. - member this.SyncLegacyProject(projectContext: IWorkspaceProjectContext, site: IProjectSite) = + member this.SyncLegacyProject(projectContext: FSharpWorkspaceProjectContext, site: IProjectSite) = let wellFormedFilePathSetIgnoreCase (paths: seq) = HashSet(paths |> Seq.filter isPathWellFormed |> Seq.map (fun s -> try Path.GetFullPath(s) with _ -> s), StringComparer.OrdinalIgnoreCase) @@ -58,7 +59,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, for file in updatedFiles do if not(originalFiles.Contains(file)) then - projectContext.AddSourceFile(file) + projectContext.AddSourceFile(file, SourceCodeKind.Regular) for file in originalFiles do if not(updatedFiles.Contains(file)) then @@ -72,7 +73,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, for ref in updatedRefs do if not(originalRefs.Contains(ref)) then - projectContext.AddMetadataReference(ref, MetadataReferenceProperties.Assembly) + projectContext.AddMetadataReference(ref) for ref in originalRefs do if not(updatedRefs.Contains(ref)) then @@ -90,7 +91,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, //projectContext.SetOptions(String.concat " " updatedOptions) for file in updatedFiles do projectContext.RemoveSourceFile(file) - projectContext.AddSourceFile(file) + projectContext.AddSourceFile(file, SourceCodeKind.Regular) // Record the last seen options as an associated value if ok then optionsAssociation.Remove(projectContext) |> ignore @@ -119,7 +120,6 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, let projectContext = projectContextFactory.CreateProjectContext( - FSharpConstants.FSharpLanguageName, projectDisplayName, projectFileName, projectGuid, @@ -131,7 +131,7 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, // Sync IProjectSite --> projectContext, and IProjectSite --> ProjectInfoManage this.SyncLegacyProject(projectContext, site) - site.BuildErrorReporter <- Some (projectContext :?> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) + site.BuildErrorReporter <- Some (projectContext.BuildErrorReporter) // TODO: consider forceUpdate = false here. forceUpdate=true may be causing repeated computation? site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, diff --git a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs index 3c205e68c87..0fe209093d0 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs @@ -17,6 +17,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.FindSymbols open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.LanguageServices.ProjectSystem @@ -96,25 +97,26 @@ module internal MetadataAsSource = type internal FSharpMetadataAsSourceService() = let serviceProvider = ServiceProvider.GlobalProvider - let projs = System.Collections.Concurrent.ConcurrentDictionary() + let projs = System.Collections.Concurrent.ConcurrentDictionary() let createMetadataProjectContext (projInfo: ProjectInfo) (docInfo: DocumentInfo) = let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel - let projectContextFactory = componentModel.GetService() - let projectContext = projectContextFactory.CreateProjectContext(LanguageNames.FSharp, projInfo.Id.ToString(), projInfo.FilePath, Guid.NewGuid(), null, null) + let projectContextFactory = componentModel.GetService() + + let projectContext = projectContextFactory.CreateProjectContext(projInfo.FilePath, projInfo.Id.ToString()) projectContext.DisplayName <- projInfo.Name - projectContext.AddSourceFile(docInfo.FilePath, sourceCodeKind = SourceCodeKind.Regular) - + projectContext.AddSourceFile(docInfo.FilePath, SourceCodeKind.Regular) + for metaRef in projInfo.MetadataReferences do match metaRef with | :? PortableExecutableReference as peRef -> - projectContext.AddMetadataReference(peRef.FilePath, MetadataReferenceProperties.Assembly) + projectContext.AddMetadataReference(peRef.FilePath) | _ -> () projectContext - let clear filePath (projectContext: IWorkspaceProjectContext) = + let clear filePath (projectContext: IFSharpWorkspaceProjectContext) = projs.TryRemove(filePath) |> ignore projectContext.Dispose() try diff --git a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs index 87aeb8264ee..7f596d17a82 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs @@ -4,125 +4,19 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Collections.Concurrent -open System.Collections.Immutable open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor -open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell.Interop -open Microsoft.VisualStudio.LanguageServices open FSharp.Compiler.CodeAnalysis -type internal IFSharpWorkspaceProjectContext = - inherit IDisposable - - abstract Id : ProjectId - - abstract FilePath : string - - abstract ProjectReferenceCount : int - - abstract HasProjectReference : filePath: string -> bool - - abstract SetProjectReferences : IFSharpWorkspaceProjectContext seq -> unit - - abstract MetadataReferenceCount : int - - abstract HasMetadataReference : referencePath: string -> bool - - abstract SetMetadataReferences : referencePaths: string seq -> unit - -type internal IFSharpWorkspaceProjectContextFactory = - - abstract CreateProjectContext : filePath: string -> IFSharpWorkspaceProjectContext - -type private ProjectContextState = - { - refs: ImmutableDictionary - metadataRefs: ImmutableHashSet - } - -type internal FSharpWorkspaceProjectContext(vsProjectContext: IWorkspaceProjectContext) = - - let mutable state = - { - refs = ImmutableDictionary.Create(StringComparer.OrdinalIgnoreCase) - metadataRefs = ImmutableHashSet.Create(equalityComparer = StringComparer.OrdinalIgnoreCase) - } - - member private _.VisualStudioProjectContext = vsProjectContext - - member private _.AddProjectReference(builder: ImmutableDictionary<_, _>.Builder, projectContext: IFSharpWorkspaceProjectContext) = - match projectContext with - | :? FSharpWorkspaceProjectContext as fsProjectContext -> - vsProjectContext.AddProjectReference(fsProjectContext.VisualStudioProjectContext, MetadataReferenceProperties.Assembly) - builder.Add(projectContext.FilePath, projectContext) - | _ -> - () - - member private _.RemoveProjectReference(projectContext: IFSharpWorkspaceProjectContext) = - match projectContext with - | :? FSharpWorkspaceProjectContext as fsProjectContext -> - vsProjectContext.RemoveProjectReference(fsProjectContext.VisualStudioProjectContext) - | _ -> - () - - member private _.AddMetadataReference(builder: ImmutableHashSet<_>.Builder, referencePath: string) = - vsProjectContext.AddMetadataReference(referencePath, MetadataReferenceProperties.Assembly) - builder.Add(referencePath) |> ignore - - member private _.RemoveMetadataReference(referencePath: string) = - vsProjectContext.RemoveMetadataReference(referencePath) - - interface IFSharpWorkspaceProjectContext with - - member _.Id = vsProjectContext.Id - - member _.FilePath = vsProjectContext.ProjectFilePath - - member _.ProjectReferenceCount = state.refs.Count - - member _.HasProjectReference(filePath) = state.refs.ContainsKey(filePath) - - member this.SetProjectReferences(projRefs) = - let builder = ImmutableDictionary.CreateBuilder() - - state.refs.Values - |> Seq.iter (fun x -> - this.RemoveProjectReference(x) - ) - - projRefs - |> Seq.iter (fun x -> - this.AddProjectReference(builder, x) - ) - - state <- { state with refs = builder.ToImmutable() } - - member _.MetadataReferenceCount = state.metadataRefs.Count - - member _.HasMetadataReference(referencePath) = state.metadataRefs.Contains(referencePath) - - member this.SetMetadataReferences(referencePaths) = - let builder = ImmutableHashSet.CreateBuilder() - - state.metadataRefs - |> Seq.iter (fun x -> - this.RemoveMetadataReference(x) - ) - - referencePaths - |> Seq.iter (fun x -> - this.AddMetadataReference(builder, x) - ) - - state <- { state with metadataRefs = builder.ToImmutable() } - - member _.Dispose() = - vsProjectContext.Dispose() +type internal FSharpMiscellaneousFileService(workspace: Workspace, + miscFilesWorkspace: Workspace, + projectContextFactory: IFSharpWorkspaceProjectContextFactory) = -type internal FSharpWorkspaceProjectContextFactory(projectContextFactory: IWorkspaceProjectContextFactory) = + let files = ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase) + let optionsManager = workspace.Services.GetRequiredService().FSharpProjectOptionsManager static let createSourceCodeKind (filePath: string) = if isScriptFile filePath then @@ -130,21 +24,6 @@ type internal FSharpWorkspaceProjectContextFactory(projectContextFactory: IWorks else SourceCodeKind.Regular - interface IFSharpWorkspaceProjectContextFactory with - - member _.CreateProjectContext filePath = - let projectContext = projectContextFactory.CreateProjectContext(FSharpConstants.FSharpLanguageName, filePath, filePath, Guid.NewGuid(), null, null) - projectContext.DisplayName <- FSharpConstants.FSharpMiscellaneousFilesName - projectContext.AddSourceFile(filePath, sourceCodeKind = createSourceCodeKind filePath) - new FSharpWorkspaceProjectContext(projectContext) :> IFSharpWorkspaceProjectContext - -type internal FSharpMiscellaneousFileService(workspace: Workspace, - miscFilesWorkspace: Workspace, - projectContextFactory: IFSharpWorkspaceProjectContextFactory) = - - let files = ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase) - let optionsManager = workspace.Services.GetRequiredService().FSharpProjectOptionsManager - static let mustUpdateProjectReferences (refSourceFiles: string []) (projectContext: IFSharpWorkspaceProjectContext) = refSourceFiles.Length <> projectContext.ProjectReferenceCount || ( @@ -161,6 +40,12 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, |> not ) + let createProjectContextForDocument (filePath: string) = + let context = projectContextFactory.CreateProjectContext(filePath, filePath) + context.DisplayName <- FSharpConstants.FSharpMiscellaneousFilesName + context.AddSourceFile(filePath, createSourceCodeKind filePath) + context + let tryRemove (document: Document) = let projIds = document.Project.Solution.GetDependentProjectIds(document.Project.Id) if projIds.Count = 0 then @@ -195,7 +80,8 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, let newProjRefs = refSourceFiles |> Array.map (fun filePath -> - let createProjectContext = lazy projectContextFactory.CreateProjectContext(filePath) + let createProjectContext = lazy createProjectContextForDocument(filePath) + if files.TryAdd(filePath, createProjectContext) then createProjectContext.Value else @@ -225,7 +111,9 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, // a F# miscellaneous project, which could be a script or not. if document.Project.IsFSharp && workspace.CurrentSolution.GetDocumentIdsWithFilePath(document.FilePath).Length = 0 then let filePath = document.FilePath - let createProjectContext = lazy projectContextFactory.CreateProjectContext(filePath) + + let createProjectContext = lazy createProjectContextForDocument(filePath) + if files.TryAdd(filePath, createProjectContext) then createProjectContext.Force() |> ignore ) @@ -293,7 +181,9 @@ type internal FSharpMiscellaneousFileService(workspace: Workspace, | Some(document) -> optionsManager.ClearSingleFileOptionsCache(document.Id) projectContext.Value.Dispose() - let newProjectContext = lazy projectContextFactory.CreateProjectContext(newFilePath) + + let newProjectContext = lazy createProjectContextForDocument(newFilePath) + if files.TryAdd(newFilePath, newProjectContext) then newProjectContext.Force() |> ignore else diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj index a6b16f955b3..5f5f1a3b687 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.ProjectSystem.PropertyPages.vbproj @@ -24,6 +24,7 @@ true 2.0 {FCFB214C-462E-42B3-91CA-FC557EFEE74F} + true diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb index 981ae080b12..f8633f96b78 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb @@ -4,6 +4,7 @@ Imports EnvDTE Imports Microsoft.VisualBasic Imports System +Imports System.IO Imports System.Collections Imports System.ComponentModel Imports System.Diagnostics @@ -187,8 +188,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages sFileName = "" sInitialDirectory = "" Else - sFileName = System.IO.Path.GetFileName(sInitialDirectory) - sInitialDirectory = System.IO.Path.GetDirectoryName(sInitialDirectory) + sFileName = Path.GetFileName(sInitialDirectory) + sInitialDirectory = Path.GetDirectoryName(sInitialDirectory) End If Dim fileNames As ArrayList = Common.Utils.GetFilesViaBrowse(ServiceProvider, Me.Handle, sInitialDirectory, SR.GetString(SR.PPG_AddExistingFilesTitle), _ @@ -312,13 +313,13 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages End If ' Verify all the characters in the path are valid - If path.IndexOfAny(IO.Path.GetInvalidPathChars()) >= 0 Then + If path.IndexOfAny(System.IO.Path.GetInvalidPathChars()) >= 0 Then ShowErrorMessage(SR.GetString(SR.PPG_Application_CantAddIcon)) Return False End If - If Not IO.Path.IsPathRooted(path) Then - path = IO.Path.Combine(GetProjectPath(), path) + If Not System.IO.Path.IsPathRooted(path) Then + path = System.IO.Path.Combine(GetProjectPath(), path) End If If System.IO.File.Exists(path) Then @@ -328,7 +329,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages ' create the Image. Try Dim IconContents As Byte() = IO.File.ReadAllBytes(path) - Dim IconStream As New IO.MemoryStream(IconContents, 0, IconContents.Length) + Dim IconStream As New MemoryStream(IconContents, 0, IconContents.Length) ApplicationIconPictureBox.Image = IconToImage(New Icon(IconStream), ApplicationIconPictureBox.ClientSize) Catch ex As Exception Common.RethrowIfUnrecoverable(ex, True) @@ -413,7 +414,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Protected Sub AddIconsFromProjectItem(ByVal ProjectItem As EnvDTE.ProjectItem, ByVal ApplicationIconCombobox As ComboBox) For Index As Short = 1 To ProjectItem.FileCount Dim FileName As String = ProjectItem.FileNames(Index) - Dim ext As String = System.IO.Path.GetExtension(FileName) + Dim ext As String = Path.GetExtension(FileName) If ext.Equals(".ico", StringComparison.OrdinalIgnoreCase) Then ApplicationIconCombobox.Items.Add(GetProjectRelativeFilePath(FileName)) End If @@ -527,7 +528,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Protected Sub AddManifestsFromProjectItem(ByVal ProjectItem As EnvDTE.ProjectItem, ByVal ApplicationManifestCombobox As ComboBox) For Index As Short = 1 To ProjectItem.FileCount Dim FileName As String = ProjectItem.FileNames(Index) - Dim ext As String = System.IO.Path.GetExtension(FileName) + Dim ext As String = Path.GetExtension(FileName) If ext.Equals(".manifest", StringComparison.OrdinalIgnoreCase) Then ApplicationManifestCombobox.Items.Add(GetProjectRelativeFilePath(FileName)) End If diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb index 5708fc56b74..00bd63a37d2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.vb @@ -22,7 +22,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Private m_controlGroup As Control()() 'PERF: A note about the labels used as lines. The 3D label is being set to 1 px high, - ' so youre really only using the grey part of it. Using BorderStyle.Fixed3D seems + ' so you’re really only using the grey part of it. Using BorderStyle.Fixed3D seems ' to fire an extra resize OnHandleCreated. The simple solution is to use BorderStyle.None ' and BackColor = SystemColors.ControlDark. @@ -507,7 +507,7 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages If sInitialDirectory = "" Then Try sInitialDirectory = Path.Combine(GetDebugPathProjectPath(), GetSelectedConfigOutputPath()) - Catch ex As IO.IOException + Catch ex As IOException 'Ignore Catch ex As Exception Common.RethrowIfUnrecoverable(ex) diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index bcdcd67b66b..d13723b9697 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -11,6 +11,7 @@ open System.Collections.Immutable open System.Threading open Microsoft.VisualStudio.Composition open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.Host open Microsoft.CodeAnalysis.Text open Microsoft.VisualStudio.FSharp.Editor @@ -184,6 +185,10 @@ module WorkspaceTests = interface IFSharpWorkspaceProjectContext with + member _.get_DisplayName() : string = "" + + member _.set_DisplayName(value: string) : unit = () + member _.Dispose(): unit = () member _.FilePath: string = mainProj.FilePath @@ -260,10 +265,13 @@ module WorkspaceTests = mainProj <- solution.GetProject(currentProj.Id) + member _.AddMetadataReference(_: string): unit = () + member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () + type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = interface IFSharpWorkspaceProjectContextFactory with - member _.CreateProjectContext(filePath: string): IFSharpWorkspaceProjectContext = + member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with | Some docId -> let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) From c18989124a92cc26a736d89137254f1ca84d4880 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 25 Jul 2022 17:18:57 +0200 Subject: [PATCH 055/226] Use SynLongIdent in SynOpenDeclTarget.ModuleOrNamespace (#13523) --- src/Compiler/Checking/CheckDeclarations.fs | 9 ++++---- src/Compiler/Symbols/Symbols.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 2 +- src/Compiler/pars.fsy | 6 +++--- ...erService.SurfaceArea.netstandard.expected | 10 ++++----- tests/service/InteractiveCheckerTests.fs | 2 +- .../SyntaxTreeTests/ModuleOrNamespaceTests.fs | 21 ++++++++++++++++++- 8 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 33066d9e339..57a56ee2e88 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -366,7 +366,8 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath (env: match ResolveLongIdentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem true OpenQualified env.eNameResEnv ad id rest true with | Result modrefs -> let modrefs = List.map p23 modrefs - let openTarget = SynOpenDeclTarget.ModuleOrNamespace(enclosingNamespacePathToOpen, scopem) + let lid = SynLongIdent(enclosingNamespacePathToOpen, [] , []) + let openTarget = SynOpenDeclTarget.ModuleOrNamespace(lid, scopem) let openDecl = OpenDeclaration.Create (openTarget, modrefs, [], scopem, true) OpenModuleOrNamespaceRefs tcSink g amap scopem false env modrefs openDecl | Exception _ -> env @@ -656,7 +657,7 @@ let TcOpenModuleOrNamespaceDecl tcSink g amap scopem env (longId, m) = let modrefs = List.map p23 modrefs modrefs |> List.iter (fun modref -> CheckEntityAttributes g modref m |> CommitOperationResult) - let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.ModuleOrNamespace (longId, m), modrefs, [], scopem, false) + let openDecl = OpenDeclaration.Create (SynOpenDeclTarget.ModuleOrNamespace (SynLongIdent(longId, [], []), m), modrefs, [], scopem, false) let env = OpenModuleOrNamespaceRefs tcSink g amap scopem false env modrefs openDecl env, [openDecl] @@ -681,7 +682,7 @@ let TcOpenDecl (cenv: cenv) mOpenDecl scopem env target = let g = cenv.g match target with | SynOpenDeclTarget.ModuleOrNamespace (longId, m) -> - TcOpenModuleOrNamespaceDecl cenv.tcSink g cenv.amap scopem env (longId, m) + TcOpenModuleOrNamespaceDecl cenv.tcSink g cenv.amap scopem env (longId.LongIdent, m) | SynOpenDeclTarget.Type (synType, m) -> TcOpenTypeDecl cenv mOpenDecl scopem env (synType, m) @@ -4981,7 +4982,7 @@ let ApplyAssemblyLevelAutoOpenAttributeToTcEnv g amap (ccu: CcuThunk) scopem env match modref.TryDeref with | ValueNone -> warn() | ValueSome _ -> - let openTarget = SynOpenDeclTarget.ModuleOrNamespace([], scopem) + let openTarget = SynOpenDeclTarget.ModuleOrNamespace(SynLongIdent([],[],[]), scopem) let openDecl = OpenDeclaration.Create (openTarget, [modref], [], scopem, false) let envinner = OpenModuleOrNamespaceRefs TcResultsSink.NoSink g amap scopem root env [modref] openDecl [openDecl], envinner diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 602ccb7459d..043624bbc63 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2794,7 +2794,7 @@ type FSharpOpenDeclaration(target: SynOpenDeclTarget, range: range option, modul member _.LongId = match target with - | SynOpenDeclTarget.ModuleOrNamespace(longId, _) -> longId + | SynOpenDeclTarget.ModuleOrNamespace(longId, _) -> longId.LongIdent | SynOpenDeclTarget.Type(synType, _) -> let rec get ty = match ty with diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 500aef1d3ea..ad225b7e5de 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1471,7 +1471,7 @@ type SynModuleDecl = [] type SynOpenDeclTarget = - | ModuleOrNamespace of longId: LongIdent * range: range + | ModuleOrNamespace of longId: SynLongIdent * range: range | Type of typeName: SynType * range: range diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 988d7d8cad3..dc94eb28c27 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1654,7 +1654,7 @@ type SynModuleDecl = type SynOpenDeclTarget = /// A 'open' declaration - | ModuleOrNamespace of longId: LongIdent * range: range + | ModuleOrNamespace of longId: SynLongIdent * range: range /// A 'open type' declaration | Type of typeName: SynType * range: range diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index c7deb4d4fc6..3268a31911b 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -1432,7 +1432,7 @@ moduleDefn: openDecl: /* 'open' declarations */ | OPEN path - { SynOpenDeclTarget.ModuleOrNamespace($2.LongIdent, (rhs parseState 2)) } + { SynOpenDeclTarget.ModuleOrNamespace($2, (rhs parseState 2)) } | OPEN typeKeyword appType { SynOpenDeclTarget.Type($3, (rhs parseState 3)) } @@ -2013,7 +2013,7 @@ atomicPatternLongIdent: | GLOBAL DOT pathOp { let globalIdent = ident(MangledGlobalName, rhs parseState 1) let mDot = rhs parseState 2 - None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, None)) mDot $3 } + None, prependIdentInLongIdentWithTrivia (SynIdent(globalIdent, (Some (IdentTrivia.OriginalNotation "global")))) mDot $3 } | pathOp { (None, $1) } @@ -5445,7 +5445,7 @@ ident: /* A A.B.C path used to an identifier */ path: | GLOBAL - { SynLongIdent([ident(MangledGlobalName, rhs parseState 1)], [], [None]) } + { SynLongIdent([ident(MangledGlobalName, rhs parseState 1)], [], [Some (IdentTrivia.OriginalNotation "global")]) } | ident { SynLongIdent([$1], [], [None]) } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 1f16bf7c33c..2c377bad439 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2081,12 +2081,14 @@ FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: System.String get_FileName( FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: System.String[] DependencyFiles FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: System.String[] get_DependencyFiles() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions +FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean ApplyLineDirectives FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean CompilingFSharpCore FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean Equals(FSharp.Compiler.CodeAnalysis.FSharpParsingOptions) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean Equals(System.Object) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean Equals(System.Object, System.Collections.IEqualityComparer) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean IsExe FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean IsInteractive +FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_ApplyLineDirectives() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_CompilingFSharpCore() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_IsExe() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_IsInteractive() @@ -2108,8 +2110,6 @@ FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String ToString() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String get_LangVersionText() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String[] SourceFiles FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: System.String[] get_SourceFiles() -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean ApplyLineDirectives -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Boolean get_ApplyLineDirectives() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Void .ctor(System.String[], Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.String], FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions, System.String, Boolean, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Boolean, Boolean) FSharp.Compiler.CodeAnalysis.FSharpProjectContext FSharp.Compiler.CodeAnalysis.FSharpProjectContext: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions ProjectOptions @@ -7882,10 +7882,10 @@ FSharp.Compiler.Syntax.SynModuleSigDecl: Int32 Tag FSharp.Compiler.Syntax.SynModuleSigDecl: Int32 get_Tag() FSharp.Compiler.Syntax.SynModuleSigDecl: System.String ToString() FSharp.Compiler.Syntax.SynOpenDeclTarget +FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: FSharp.Compiler.Syntax.SynLongIdent get_longId() +FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: FSharp.Compiler.Syntax.SynLongIdent longId FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] get_longId() -FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] longId FSharp.Compiler.Syntax.SynOpenDeclTarget+Tags: Int32 ModuleOrNamespace FSharp.Compiler.Syntax.SynOpenDeclTarget+Tags: Int32 Type FSharp.Compiler.Syntax.SynOpenDeclTarget+Type: FSharp.Compiler.Syntax.SynType get_typeName() @@ -7896,7 +7896,7 @@ FSharp.Compiler.Syntax.SynOpenDeclTarget: Boolean IsModuleOrNamespace FSharp.Compiler.Syntax.SynOpenDeclTarget: Boolean IsType FSharp.Compiler.Syntax.SynOpenDeclTarget: Boolean get_IsModuleOrNamespace() FSharp.Compiler.Syntax.SynOpenDeclTarget: Boolean get_IsType() -FSharp.Compiler.Syntax.SynOpenDeclTarget: FSharp.Compiler.Syntax.SynOpenDeclTarget NewModuleOrNamespace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynOpenDeclTarget: FSharp.Compiler.Syntax.SynOpenDeclTarget NewModuleOrNamespace(FSharp.Compiler.Syntax.SynLongIdent, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynOpenDeclTarget: FSharp.Compiler.Syntax.SynOpenDeclTarget NewType(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynOpenDeclTarget: FSharp.Compiler.Syntax.SynOpenDeclTarget+ModuleOrNamespace FSharp.Compiler.Syntax.SynOpenDeclTarget: FSharp.Compiler.Syntax.SynOpenDeclTarget+Tags diff --git a/tests/service/InteractiveCheckerTests.fs b/tests/service/InteractiveCheckerTests.fs index df2b132865a..ac208f8f6a3 100644 --- a/tests/service/InteractiveCheckerTests.fs +++ b/tests/service/InteractiveCheckerTests.fs @@ -42,7 +42,7 @@ let internal identsAndRanges (input: ParsedInput) = | SynModuleDecl.Let _ -> failwith "Not implemented yet" | SynModuleDecl.Expr _ -> failwith "Not implemented yet" | SynModuleDecl.Exception _ -> failwith "Not implemented yet" - | SynModuleDecl.Open(SynOpenDeclTarget.ModuleOrNamespace (lid, range), _) -> [ identAndRange (longIdentToString lid) range ] + | SynModuleDecl.Open(SynOpenDeclTarget.ModuleOrNamespace (lid, range), _) -> [ identAndRange (longIdentToString lid.LongIdent) range ] | SynModuleDecl.Open(SynOpenDeclTarget.Type _, _) -> failwith "Not implemented yet" | SynModuleDecl.Attributes _ -> failwith "Not implemented yet" | SynModuleDecl.HashDirective _ -> failwith "Not implemented yet" diff --git a/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs index 2dbd30d673a..8091c0942d6 100644 --- a/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs +++ b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs @@ -2,6 +2,7 @@ module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ModuleOrNamespaceTests open FSharp.Compiler.Service.Tests.Common open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia open NUnit.Framework [] @@ -114,4 +115,22 @@ let a = 42 | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> assertRange (2, 0) (2, 9) mNamespace - | _ -> Assert.Fail "Could not get valid AST" + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``global in open path should contain trivia`` () = + let parseResults = + getParseResults + """ +namespace Ionide.VSCode.FSharp + +open global.Node +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Open(target = SynOpenDeclTarget.ModuleOrNamespace(longId = SynLongIdent(trivia = [ Some (IdentTrivia.OriginalNotation("global")); None ]))) + ]) ])) -> + Assert.Pass() + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" From a8360b1ea50da44d1d88f46fe46d1bd10685260a Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 25 Jul 2022 20:00:40 +0200 Subject: [PATCH 056/226] Fix VSGeneralVersion (#13561) --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6d7059405f7..f894f4e1a93 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,7 +56,7 @@ 17 4 - $(VSMajorVersion).5 + $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 86022945117035c3fe0c466e345941c090c91432 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 19:58:25 -0700 Subject: [PATCH 057/226] [main] Update dependencies from dotnet/arcade (#13441) * Update dependencies from https://github.com/dotnet/arcade build 20220704.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22354.1 * Update dependencies from https://github.com/dotnet/arcade build 20220705.4 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22355.4 * Update dependencies from https://github.com/dotnet/arcade build 20220706.3 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22356.3 * Update dependencies from https://github.com/dotnet/arcade build 20220708.3 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22358.3 * Update global.json * Update dependencies from https://github.com/dotnet/arcade build 20220712.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22362.1 * Update dependencies from https://github.com/dotnet/arcade build 20220713.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22363.1 * Update dependencies from https://github.com/dotnet/arcade build 20220714.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22364.1 * Update dependencies from https://github.com/dotnet/arcade build 20220715.4 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22365.4 * Update dependencies from https://github.com/dotnet/arcade build 20220717.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22367.1 * Update dependencies from https://github.com/dotnet/arcade build 20220718.5 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22368.5 * Update dependencies from https://github.com/dotnet/arcade build 20220719.9 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22369.9 * Update dependencies from https://github.com/dotnet/arcade build 20220720.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22370.1 * Update dependencies from https://github.com/dotnet/arcade build 20220721.8 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22327.2 -> To Version 7.0.0-beta.22371.8 * Update sdk to `7.0.100-preview.5.22307.18` to see if it fixes build issues * temp * temp * proto * temp * tests * pattern * list equality issue Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) Co-authored-by: Vlad Zarytovskii --- Proto.sln | 34 ++++++++++++++++ eng/Build.ps1 | 11 +++-- eng/Version.Details.xml | 4 +- eng/build-utils.ps1 | 4 +- eng/build.sh | 3 +- eng/common/cross/build-rootfs.sh | 33 ++++++++------- eng/common/cross/toolchain.cmake | 30 +++++++++----- eng/common/generate-locproject.ps1 | 14 +++---- eng/common/generate-sbom-prep.ps1 | 2 + eng/common/generate-sbom-prep.sh | 12 ++++++ eng/common/init-tools-native.ps1 | 4 +- eng/common/native/init-compiler.sh | 2 +- eng/common/tools.ps1 | 2 +- global.json | 6 +-- proto.proj | 40 ------------------- src/FSharp.Build/FSharp.Build.fsproj | 5 ++- src/FSharp.Core/FSharp.Core.fsproj | 1 + src/fsc/fscArm64Project/fscArm64.fsproj | 2 +- src/fsc/fscProject/fsc.fsproj | 12 ++++-- src/fsi/fsiArm64Project/fsiArm64.fsproj | 2 +- src/fsi/fsiProject/fsi.fsproj | 12 ++++-- .../FSharpScriptTests.fs | 13 ------ tests/fsharp/core/libtest/test.fsx | 13 ++++-- 23 files changed, 143 insertions(+), 118 deletions(-) create mode 100644 Proto.sln delete mode 100644 proto.proj diff --git a/Proto.sln b/Proto.sln new file mode 100644 index 00000000000..d48b1e3d1b6 --- /dev/null +++ b/Proto.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Build", "src\FSharp.Build\FSharp.Build.fsproj", "{C02D44B2-BB67-4A17-9678-9D21D93B3930}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsc", "src\fsc\fscProject\fsc.fsproj", "{5BEC9F77-5AE6-4EC3-BDE9-63CF8E1D0086}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsi\fsiProject\fsi.fsproj", "{07CB51BF-8E98-4CFF-A7BA-99C4A0BC6037}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "src\FSharp.Core\FSharp.Core.fsproj", "{8A772476-D857-4810-9A9C-E67AC61497AB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Proto|Any CPU = Proto|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C02D44B2-BB67-4A17-9678-9D21D93B3930}.Proto|Any CPU.ActiveCfg = Proto|Any CPU + {C02D44B2-BB67-4A17-9678-9D21D93B3930}.Proto|Any CPU.Build.0 = Proto|Any CPU + {5BEC9F77-5AE6-4EC3-BDE9-63CF8E1D0086}.Proto|Any CPU.ActiveCfg = Proto|Any CPU + {5BEC9F77-5AE6-4EC3-BDE9-63CF8E1D0086}.Proto|Any CPU.Build.0 = Proto|Any CPU + {07CB51BF-8E98-4CFF-A7BA-99C4A0BC6037}.Proto|Any CPU.ActiveCfg = Proto|Any CPU + {07CB51BF-8E98-4CFF-A7BA-99C4A0BC6037}.Proto|Any CPU.Build.0 = Proto|Any CPU + {8A772476-D857-4810-9A9C-E67AC61497AB}.Proto|Any CPU.ActiveCfg = Proto|Any CPU + {8A772476-D857-4810-9A9C-E67AC61497AB}.Proto|Any CPU.Build.0 = Proto|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {53F11F0A-D5FC-4410-B875-DC432F12B5AF} + EndGlobalSection +EndGlobal diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 3955e5d980f..aaa91bd91f9 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -450,18 +450,17 @@ try { $toolsetBuildProj = InitializeToolset TryDownloadDotnetFrameworkSdk - $nativeToolsDir = InitializeNativeTools - + $nativeTools = InitializeNativeTools if (-not (Test-Path variable:NativeToolsOnMachine)) { - $env:PERL5Path = Join-Path "$nativeToolsDir" "perl\5.32.1.1\perl\bin\perl.exe" + $env:PERL5Path = Join-Path $nativeTools "perl\5.32.1.1\perl\bin\perl.exe" write-host "variable:NativeToolsOnMachine = unset or false" - write-host "nativeToolsDir = $nativeToolsDir" + $nativeTools write-host "Path = $env:PERL5Path" } else { - $env:PERL5Path = "C:\arcade-tools\perl-5.32.1.1\perl\bin\perl.exe" + $env:PERL5Path = Join-Path $nativeTools["perl"] "perl\bin\perl.exe" write-host "variable:NativeToolsOnMachine = $variable:NativeToolsOnMachine" - write-host "nativeToolsDir = $nativeToolsDir" + $nativeTools.values write-host "Path = $env:PERL5Path" } diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0ff466b9e27..d65e5136c64 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - a264eb13fea14125f3ef8d4056586cd66fa55309 + 11672d906390046e77a34b6406d9e02229fd7e45 diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 3ba2549e06c..2aca2e02a35 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -256,8 +256,8 @@ function Make-BootstrapBuild() { Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\net6.0" -Destination "$dir\AssemblyCheck" -Force -Recurse # prepare compiler - $protoProject = "`"$RepoRoot\proto.proj`"" - $args = "build $protoProject -c $bootstrapConfiguration -v $verbosity -f $bootstrapTfm" + $argNoRestore + $argNoIncremental + $protoProject = "`"$RepoRoot\proto.sln`"" + $args = "build $protoProject -c $bootstrapConfiguration -v $verbosity " + $argNoRestore + $argNoIncremental if ($binaryLog) { $logFilePath = Join-Path $LogDir "protoBootstrapLog.binlog" $args += " /bl:`"$logFilePath`"" diff --git a/eng/build.sh b/eng/build.sh index 284bae206d4..8bac7ce52b9 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -262,7 +262,7 @@ function BuildSolution { fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then BuildMessage="Error building bootstrap" - MSBuild "$repo_root/proto.proj" \ + MSBuild "$repo_root/Proto.sln" \ /restore \ /p:Configuration=$bootstrap_config @@ -275,7 +275,6 @@ function BuildSolution { BuildMessage="Error building solution" MSBuild $toolset_build_proj \ $bl \ - /v:$verbosity \ /p:Configuration=$configuration \ /p:Projects="$projects" \ /p:RepoRoot="$repo_root" \ diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 5a59dcff28f..c8540474aa1 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -5,7 +5,7 @@ set -e usage() { echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir ]" - echo "BuildArch can be: arm(default), armel, arm64, x86" + echo "BuildArch can be: arm(default), armel, arm64, x86, x64" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo " for FreeBSD can be: freebsd12, freebsd13" echo " for illumos can be: illumos." @@ -21,6 +21,9 @@ __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __InitialDir=$PWD __BuildArch=arm __AlpineArch=armv7 +__FreeBSDArch=arm +__FreeBSDMachineArch=armv7 +__IllumosArch=arm7 __QEMUArch=arm __UbuntuArch=armhf __UbuntuRepo="http://ports.ubuntu.com/" @@ -115,6 +118,8 @@ while :; do __UbuntuArch=arm64 __AlpineArch=aarch64 __QEMUArch=aarch64 + __FreeBSDArch=arm64 + __FreeBSDMachineArch=aarch64 ;; armel) __BuildArch=armel @@ -140,6 +145,14 @@ while :; do __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') unset __LLDB_Package ;; + x64) + __BuildArch=x64 + __UbuntuArch=amd64 + __FreeBSDArch=amd64 + __FreeBSDMachineArch=amd64 + __illumosArch=x86_64 + __UbuntuRepo= + ;; x86) __BuildArch=x86 __UbuntuArch=i386 @@ -205,11 +218,6 @@ while :; do __LLDB_Package="liblldb-6.0-dev" ;; tizen) - if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ] && [ "$__BuildArch" != "x86" ] ; then - echo "Tizen is available only for arm, armel, arm64 and x86." - usage; - exit 1; - fi __CodeName= __UbuntuRepo= __Tizen=tizen @@ -228,19 +236,16 @@ while :; do ;; freebsd12) __CodeName=freebsd - __BuildArch=x64 __SkipUnmount=1 ;; freebsd13) __CodeName=freebsd __FreeBSDBase="13.0-RELEASE" __FreeBSDABI="13" - __BuildArch=x64 __SkipUnmount=1 ;; illumos) __CodeName=illumos - __BuildArch=x64 __SkipUnmount=1 ;; --skipunmount) @@ -312,8 +317,8 @@ if [[ "$__CodeName" == "alpine" ]]; then elif [[ "$__CodeName" == "freebsd" ]]; then mkdir -p $__RootfsDir/usr/local/etc JOBS="$(getconf _NPROCESSORS_ONLN)" - wget -O - https://download.freebsd.org/ftp/releases/amd64/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version - echo "ABI = \"FreeBSD:${__FreeBSDABI}:amd64\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf + wget -O - https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version + echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf echo "FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > ${__RootfsDir}/etc/pkg/FreeBSD.conf mkdir -p $__RootfsDir/tmp # get and build package manager @@ -335,7 +340,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then echo "Building binutils. Please wait.." wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - mkdir build-binutils && cd build-binutils - ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir" + ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" make -j "$JOBS" && make install && cd .. echo "Building gcc. Please wait.." wget -O - https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - @@ -345,7 +350,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then CFLAGS_FOR_TARGET="-fPIC" export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET mkdir build-gcc && cd build-gcc - ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="x86_64-sun-solaris2.10" --program-prefix="x86_64-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ + ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. @@ -353,7 +358,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=http://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/x86_64/All + BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/${__illumosArch}/All echo "Downloading dependencies." read -ra array <<<"$__IllumosPackages" for package in "${array[@]}"; do diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index eaeeab38fa1..d5dfc13504b 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -48,11 +48,13 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) set(TOOLCHAIN "aarch64-alpine-linux-musl") - else() + elseif(LINUX) set(TOOLCHAIN "aarch64-linux-gnu") - endif() - if(TIZEN) - set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") + if(TIZEN) + set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") + endif() + elseif(FREEBSD) + set(triple "aarch64-unknown-freebsd12") endif() elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") set(CMAKE_SYSTEM_PROCESSOR ppc64le) @@ -66,12 +68,18 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") if(TIZEN) set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") endif() -elseif (FREEBSD) - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - set(triple "x86_64-unknown-freebsd12") -elseif (ILLUMOS) - set(CMAKE_SYSTEM_PROCESSOR "x86_64") - set(TOOLCHAIN "x86_64-illumos") +elseif(TARGET_ARCH_NAME STREQUAL "x64") + set(CMAKE_SYSTEM_PROCESSOR x86_64) + if(LINUX) + set(TOOLCHAIN "x86_64-linux-gnu") + if(TIZEN) + set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") + endif() + elseif(FREEBSD) + set(triple "x86_64-unknown-freebsd12") + elseif(ILLUMOS) + set(TOOLCHAIN "x86_64-illumos") + endif() else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, ppc64le, s390x and x86 are supported!") endif() @@ -218,7 +226,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/generate-locproject.ps1 b/eng/common/generate-locproject.ps1 index 25e97ac0077..afdd1750290 100644 --- a/eng/common/generate-locproject.ps1 +++ b/eng/common/generate-locproject.ps1 @@ -10,9 +10,7 @@ Param( Set-StrictMode -Version 2.0 $ErrorActionPreference = "Stop" -. $PSScriptRoot\tools.ps1 - -Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') +. $PSScriptRoot\pipeline-logging-functions.ps1 $exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" $exclusions = @{ Exclusions = @() } @@ -28,7 +26,7 @@ $jsonFiles = @() $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern $jsonTemplateFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json - + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } @@ -46,7 +44,7 @@ if ($allXlfFiles) { } $langXlfFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf - + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } @@ -59,7 +57,7 @@ $locJson = @{ LanguageSet = $LanguageSet LocItems = @( $locFiles | ForEach-Object { - $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" + $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { if ($outputPath.Contains($exclusion)) @@ -108,10 +106,10 @@ else { if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." - + exit 1 } else { Write-Host "Generated LocProject.json and current LocProject.json are identical." } -} \ No newline at end of file +} diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 index a733a888582..3e5c1c74a1c 100644 --- a/eng/common/generate-sbom-prep.ps1 +++ b/eng/common/generate-sbom-prep.ps1 @@ -2,6 +2,8 @@ Param( [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed ) +. $PSScriptRoot\pipeline-logging-functions.ps1 + Write-Host "Creating dir $ManifestDirPath" # create directory for sbom manifest to be placed if (!(Test-Path -path $ManifestDirPath)) diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh index f6c77453142..d5c76dc827b 100644 --- a/eng/common/generate-sbom-prep.sh +++ b/eng/common/generate-sbom-prep.sh @@ -2,6 +2,18 @@ source="${BASH_SOURCE[0]}" +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +. $scriptroot/pipeline-logging-functions.sh + manifest_dir=$1 if [ ! -d "$manifest_dir" ] ; then diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index 24a5e65de1b..8d48ec5680f 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -87,6 +87,7 @@ try { $NativeTools.PSObject.Properties | ForEach-Object { $ToolName = $_.Name $ToolVersion = $_.Value + $InstalledTools = @{} if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { if ($ToolVersion -eq "latest") { @@ -111,9 +112,10 @@ try { $ToolPath = Convert-Path -Path $BinPath Write-Host "Adding $ToolName to the path ($ToolPath)..." Write-Host "##vso[task.prependpath]$ToolPath" + $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } } } - exit 0 + return $InstalledTools } else { $NativeTools.PSObject.Properties | ForEach-Object { $ToolName = $_.Name diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 6d7ba15e5f2..4b99a9cad3b 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -71,7 +71,7 @@ if [[ -z "$CLR_CC" ]]; then # Set default versions if [[ -z "$majorVersion" ]]; then # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. - if [[ "$compiler" == "clang" ]]; then versions=( 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) + if [[ "$compiler" == "clang" ]]; then versions=( 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) elif [[ "$compiler" == "gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 395b43eebb6..9638c63c725 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -635,7 +635,7 @@ function InitializeNativeTools() { InstallDirectory = "$ToolsDir" } } - if (Test-Path variable:NativeToolsOnMachine) { + if ($env:NativeToolsOnMachine) { Write-Host "Variable NativeToolsOnMachine detected, enabling native tool path promotion..." $nativeArgs += @{ PathPromotion = $true } } diff --git a/global.json b/global.json index 48c9ae9da47..9212af17a6f 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "6.0.302", + "version": "7.0.100-preview.5.22307.18", "allowPrerelease": true, "rollForward": "latestMajor" }, "tools": { - "dotnet": "7.0.100-preview.2.22153.17", + "dotnet": "7.0.100-preview.5.22307.18", "vs": { "version": "17.0", "components": [ @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22327.1", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22372.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } diff --git a/proto.proj b/proto.proj deleted file mode 100644 index 8973f53fbcd..00000000000 --- a/proto.proj +++ /dev/null @@ -1,40 +0,0 @@ - - - - Proto - AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - - - - - TargetFramework=netstandard2.0 - - - TargetFramework=net6.0 - - - TargetFramework=net6.0 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index a79179f198a..5fcd59b4375 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -11,7 +11,8 @@ $(DefineConstants);LOCALIZATION_FSBUILD NU1701;FS0075 true - 6.0 + 6.0 + Debug;Release;Proto @@ -60,7 +61,7 @@ - + diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 0bf44a3d125..2059fcc6096 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -36,6 +36,7 @@ true FSharp.Core redistributables from F# Tools version $(FSProductVersionPrefix) For F# $(FSLanguageVersion). Contains code from the F# Software Foundation. /blob/main/release-notes.md#FSharp-Core-$(FSCoreReleaseNotesVersion) + Debug;Release;Proto diff --git a/src/fsc/fscArm64Project/fscArm64.fsproj b/src/fsc/fscArm64Project/fscArm64.fsproj index d430a022213..08265c05de1 100644 --- a/src/fsc/fscArm64Project/fscArm64.fsproj +++ b/src/fsc/fscArm64Project/fscArm64.fsproj @@ -3,7 +3,7 @@ - net472 + net472 arm64 .exe true diff --git a/src/fsc/fscProject/fsc.fsproj b/src/fsc/fscProject/fsc.fsproj index 03fbcd56d51..d6bdf814cb3 100644 --- a/src/fsc/fscProject/fsc.fsproj +++ b/src/fsc/fscProject/fsc.fsproj @@ -2,9 +2,15 @@ - - $(ProtoTargetFramework) - net472;net6.0 + + net472;net6.0 + net6.0 + x86 + Debug;Release;Proto + + + + net472 net6.0 x86 diff --git a/src/fsi/fsiArm64Project/fsiArm64.fsproj b/src/fsi/fsiArm64Project/fsiArm64.fsproj index 4d46d947ddf..3356a42f3f7 100644 --- a/src/fsi/fsiArm64Project/fsiArm64.fsproj +++ b/src/fsi/fsiArm64Project/fsiArm64.fsproj @@ -3,7 +3,7 @@ - net472 + net472 arm64 .exe true diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj index b027f97e2b9..46ca382c3e0 100644 --- a/src/fsi/fsiProject/fsi.fsproj +++ b/src/fsi/fsiProject/fsi.fsproj @@ -2,9 +2,15 @@ - - $(ProtoTargetFramework) - net472;net6.0 + + net472;net6.0 + net6.0 + x86 + Debug;Release;Proto + + + + net472 net6.0 x86 diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs index 431ac983ec4..c218cc2f408 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs @@ -317,19 +317,6 @@ typeof.Assembly.Location // Only Windows/Linux supported. () - [] - member _.``Reference -- Azure.ResourceManager.Resources``() = - let code = """ -#r "nuget: Azure.Identity, 1.3.0" -#r "nuget: Azure.ResourceManager.Resources, 1.0.0-preview.2" -let creds = Azure.Identity.DefaultAzureCredential() -let client = Azure.ResourceManager.Resources.ResourcesManagementClient("mySubscriptionId", creds) -true""" - use script = new FSharpScript(additionalArgs=[|"/langversion:preview"|]) - let opt = script.Eval(code) |> getValue - let value = opt.Value - Assert.True(true = downcast value.ReflectionValue) - [] member _.``Simple pinvoke should not be impacted by native resolver``() = let code = @" diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index a2cdb2fd60f..e4aa2382cec 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -22,7 +22,7 @@ let test s b = let format_uint64 outc formatc width left_justify add_zeros num_prefix_if_pos (n:uint64) = - let _ = match formatc with 'd' | 'i' | 'u' -> 10UL | 'o' -> 8UL | 'x' | 'X' -> 16UL in + let _ = match formatc with 'd' | 'i' | 'u' -> 10UL | 'o' -> 8UL | 'x' | 'X'-> 16UL | _ -> failwith "invalid value" in failwith "hello" @@ -4122,9 +4122,14 @@ module SetTests = begin let xs = randomInts nx |> check in let ys = randomInts ny |> check in (* time union ops *) - let t0 = time (fun () -> rapp2 n union0 xs ys) in - let t1 = time (fun () -> rapp2 n union1 xs ys) in - test "vwnwer" (Set.toList (union0 xs ys |> check) = Set.toList (union1 xs ys |> check)); + let t0 = time (fun () -> rapp2 n union0 xs ys) + let t1 = time (fun () -> rapp2 n union1 xs ys) + + let lst0 = Set.toList (union0 xs ys |> check) + let lst1 = Set.toList (union1 xs ys |> check) + let listsNotEqual = not( List.exists2(fun a b -> a <> b) lst0 lst1) + + test "vwnwer-e" (listsNotEqual) printf "-- Union times: (fold = %.6f) (divquonq = %.6f) with t0 = %f on sizes %8d,%-8d and x %d\n" (t0/t0) (t1/t0) t0 nx ny n; let test_fold() = From 7415f555fd3c9ea0bbec7b005385a468d3d34b14 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 26 Jul 2022 07:33:50 +0200 Subject: [PATCH 058/226] Add policheck exclusions (#13560) --- azure-pipelines.yml | 1 + eng/policheck_exclusions.xml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 eng/policheck_exclusions.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93e24046b2d..ce584c2506a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -585,6 +585,7 @@ stages: -TsaRepositoryName "FSharp" -TsaCodebaseName "FSharp-GitHub" -TsaPublish $True + -PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(Build.SourcesDirectory)/eng/policheck_exclusions.xml") #---------------------------------------------------------------------------------------------------------------------# # VS Insertion # diff --git a/eng/policheck_exclusions.xml b/eng/policheck_exclusions.xml new file mode 100644 index 00000000000..c7bc4cee293 --- /dev/null +++ b/eng/policheck_exclusions.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + RELEASE-NOTES.MD + DEBUG-EMIT.MD + PRINTF.FSI + CHECKFORMATSTRINGS.FS + TUTORIAL.FSX + TUTORIAL.FSX.ES.XLF + TUTORIAL.FSX.FR.XLF + TUTORIAL.FSX.PT-BR.XLF + \ No newline at end of file From ae7c0682d96fb9c6a10ba2a336bca0965cf763c0 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 26 Jul 2022 10:29:12 +0200 Subject: [PATCH 059/226] InfoReader: fix getting xmlDoc sig for default ctor (#13379) --- src/Compiler/Checking/InfoReader.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 581cb7d0353..96f65890160 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -1080,7 +1080,13 @@ let GetXmlDocSigOfMethInfo (infoReader: InfoReader) m (minfo: MethInfo) = let normalizedName = ilminfo.ILName.Replace(".", "#") Some (ccuFileName, "M:"+actualTypeName+"."+normalizedName+genArity+XmlDocArgsEnc g (formalTypars, fmtps) args) - | DefaultStructCtor _ -> None + + | DefaultStructCtor(g, ty) -> + match tryTcrefOfAppTy g ty with + | ValueSome tcref -> + Some(None, $"M:{tcref.CompiledRepresentationForNamedType.FullName}.#ctor") + | _ -> None + #if !NO_TYPEPROVIDERS | ProvidedMeth _ -> None #endif From eb8a7e02e75d083663f217524f788648a4870612 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 26 Jul 2022 12:08:37 +0200 Subject: [PATCH 060/226] Temporarily disable flaky test (#13566) --- .../FSharp.Core/Microsoft.FSharp.Collections/ListProperties.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListProperties.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListProperties.fs index 4803c088e9d..53623f11548 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListProperties.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListProperties.fs @@ -838,7 +838,7 @@ type ListProperties () = let check = xs |> List.collect (List.replicate ys.Length) pairsFst = check - [] + [] member this.``List.allPairs first elements are correct`` () = Check.QuickThrowOnFailure this.allPairsFst Check.QuickThrowOnFailure this.allPairsFst From 329b55807aae741a1d15c353005056842d3dec61 Mon Sep 17 00:00:00 2001 From: Marcin Krystianc Date: Tue, 26 Jul 2022 12:28:22 +0200 Subject: [PATCH 061/226] Use ReferencePathWithRefAssemblies instead of ReferencePath (#13567) --- src/FSharp.Build/Microsoft.FSharp.Targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 8bf3c3efe9e..3495d1b304d 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -252,7 +252,7 @@ this file. @(ManifestNonResxWithNoCultureOnDisk); $(ApplicationIcon); $(AssemblyOriginatorKeyFile); - @(ReferencePath); + @(ReferencePathWithRefAssemblies); @(CompiledLicenseFile); @(EmbeddedDocumentation); $(Win32Resource); @@ -346,8 +346,8 @@ this file. PreferredUILang="$(PreferredUILang)" ProvideCommandLineArgs="$(ProvideCommandLineArgs)" PublicSign="$(PublicSign)" - References="@(ReferencePath)" - ReferencePath="$(ReferencePath)" + References="@(ReferencePathWithRefAssemblies)" + ReferencePath="$(ReferencePathWithRefAssemblies)" RefOnly="$(ProduceOnlyReferenceAssembly)" Resources="@(ActualEmbeddedResources)" SkipCompilerExecution="$(SkipCompilerExecution)" From 85c2ad5718d87e0d4df49b4fc84cf2e054854c22 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:13:59 +0000 Subject: [PATCH 062/226] Update dependencies from https://github.com/dotnet/arcade build 20220725.4 (#13568) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 8 -------- global.json | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d65e5136c64..9905da5066b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 11672d906390046e77a34b6406d9e02229fd7e45 + 5d3e421833a18b48eed5bda24f4d5f65a75cf970 diff --git a/eng/Versions.props b/eng/Versions.props index b067e8c4f16..cfb3ff2ab68 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -112,7 +112,6 @@ 4.3.0 6.0.0 4.5.0 - 4.4.0-1.22368.2 17.3.133-preview @@ -120,7 +119,6 @@ 17.0.77-pre-g62a6cb5699 17.3.1-alpha 17.1.0 - $(RoslynVersion) $(RoslynVersion) @@ -130,7 +128,6 @@ $(RoslynVersion) $(RoslynVersion) 2.0.28 - $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) @@ -165,13 +162,11 @@ 15.0.25123-Dev15Preview 16.0.1 16.0.28924.11111 - $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) - $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) @@ -184,14 +179,11 @@ $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) - $(MicrosoftVisualStudioThreadingPackagesVersion) - $(VisualStudioProjectSystemPackagesVersion) 2.3.6152103 - 17.1.4054 17.3.3-alpha diff --git a/global.json b/global.json index 9212af17a6f..27e22f558f7 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22372.1", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22375.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 2bfb60540c6def7f76ca2fcef8a48dfdc843eeac Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 27 Jul 2022 09:41:14 +0200 Subject: [PATCH 063/226] Include Internal Attribute Constructors in reference assemblies. (#13522) * Produce reference assembly for F# Core. * Remove ProduceReferenceAssembly * Added comment, removed ProduceReferenceAssembly from FSharp.Core, until SDK supports it * Added test for internal constructor Co-authored-by: Vlad Zarytovskii --- src/Compiler/AbstractIL/ilwrite.fs | 7 +- .../EmittedIL/ReferenceAssemblyTests.fs | 130 ++++++++++++++++++ 2 files changed, 135 insertions(+), 2 deletions(-) diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index ef8f4b4ec65..9349020f4f6 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -1137,14 +1137,17 @@ let TryGetMethodRefAsMethodDefIdx cenv (mref: ILMethodRef) = let canGenMethodDef (tdef: ILTypeDef) cenv (mdef: ILMethodDef) = if not cenv.referenceAssemblyOnly then true - // If the method is part of attribute type, generate get_* and set_* methods for it, consider the following case: + // If the method is part of attribute type, generate get_* and set_* methods and .ctors for it, consider the following case: // [] // type PublicWithInternalSetterPropertyAttribute() = // inherit Attribute() // member val internal Prop1 : int = 0 with get, set // [] // type ClassPublicWithAttributes() = class end - else if tdef.IsKnownToBeAttribute && mdef.IsSpecialName && (not mdef.IsConstructor) && (not mdef.IsClassInitializer) then + + // We want to generate pretty much everything for attributes, because of serialization scenarios, and the fact that non-visible constructors, properties and fields can still be part of reference assembly. + // Example: NoDynamicInvocationAttribute has an internal constructor, which should be included in the reference assembly. + else if tdef.IsKnownToBeAttribute && mdef.IsSpecialName && (not mdef.IsClassInitializer) then true else match mdef.Access with diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 890209b8f9f..864ce6f93c0 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -723,4 +723,134 @@ type MType() = } """ ] + + [] + let ``Internal constructor is emitted for attribute`` () = + FSharp """ +module ReferenceAssembly + +open System +[] +[] +type CustomAttribute(smth: bool) = + inherit Attribute() + internal new () = CustomAttribute(false) + member _.Something = smth + +type Person(name : string, age : int) = + [] + member val Name = name with get, set + [] + member val Age = age with get, set + """ + |> withOptions ["--refonly"] + |> compile + |> shouldSucceed + |> verifyIL [ + referenceAssemblyAttributeExpectedIL + """.class auto ansi serializable sealed nested public CustomAttribute + extends [runtime]System.Attribute + { + .custom instance void [runtime]System.AttributeUsageAttribute::.ctor(valuetype [runtime]System.AttributeTargets) = ( 01 00 C0 00 00 00 01 00 54 02 0D 41 6C 6C 6F 77 + 4D 75 6C 74 69 70 6C 65 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.SealedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly bool smth + .method public specialname rtspecialname + instance void .ctor(bool smth) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method assembly specialname rtspecialname + instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname + instance bool get_Something() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + } + + .class auto ansi serializable nested public Person + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(string name, + int32 age) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname + instance string get_Name() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname + instance void set_Name(string v) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname + instance int32 get_Age() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname + instance void set_Age(int32 v) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .property instance bool Something() + { + .get instance bool ReferenceAssembly/CustomAttribute::get_Something() + } + .property instance string Name() + { + .custom instance void ReferenceAssembly/CustomAttribute::.ctor(bool) = ( 01 00 01 00 00 ) + .set instance void ReferenceAssembly/Person::set_Name(string) + .get instance string ReferenceAssembly/Person::get_Name() + } + .property instance int32 Age() + { + .custom instance void ReferenceAssembly/CustomAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void ReferenceAssembly/Person::set_Age(int32) + .get instance int32 ReferenceAssembly/Person::get_Age() + } + }""" + ] // TODO: Add tests for internal functions, types, interfaces, abstract types (with and without IVTs), (private, internal, public) fields, properties (+ different visibility for getters and setters), events. \ No newline at end of file From 9f971c8ca85a3bcc0006f15db01d8e19a58592d7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 09:27:12 -0700 Subject: [PATCH 064/226] Update dependencies from https://github.com/dotnet/arcade build 20220726.3 (#13575) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22375.4 -> To Version 7.0.0-beta.22376.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/common/build.sh | 17 ++++++++++++++++- global.json | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9905da5066b..75e68789201 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 5d3e421833a18b48eed5bda24f4d5f65a75cf970 + 37e6d5179448c5255f1517834463210dcc45963a diff --git a/eng/common/build.sh b/eng/common/build.sh index 55b298f16cc..9031d41eab8 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -19,6 +19,9 @@ usage() echo "Actions:" echo " --restore Restore dependencies (short: -r)" echo " --build Build solution (short: -b)" + echo " --source-build Source-build the solution (short: -sb)" + echo " Will additionally trigger the following actions: --restore, --build, --pack" + echo " If --configuration is not set explicitly, will also set it to 'Release'" echo " --rebuild Rebuild solution" echo " --test Run all unit tests in the solution (short: -t)" echo " --integrationTest Run all integration tests in the solution" @@ -55,6 +58,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" restore=false build=false +source_build=false rebuild=false test=false integration_test=false @@ -73,7 +77,7 @@ exclude_ci_binary_log=false pipelines_log=false projects='' -configuration='Debug' +configuration='' prepare_machine=false verbosity='minimal' runtime_source_feed='' @@ -119,6 +123,12 @@ while [[ $# > 0 ]]; do -pack) pack=true ;; + -sourcebuild|-sb) + build=true + source_build=true + restore=true + pack=true + ;; -test|-t) test=true ;; @@ -168,6 +178,10 @@ while [[ $# > 0 ]]; do shift done +if [[ -z "$configuration" ]]; then + if [[ "$source_build" = true ]]; then configuration="Release"; else configuration="Debug"; fi +fi + if [[ "$ci" == true ]]; then pipelines_log=true node_reuse=false @@ -205,6 +219,7 @@ function Build { /p:RepoRoot="$repo_root" \ /p:Restore=$restore \ /p:Build=$build \ + /p:ArcadeBuildFromSource=$source_build \ /p:Rebuild=$rebuild \ /p:Test=$test \ /p:Pack=$pack \ diff --git a/global.json b/global.json index 27e22f558f7..98d0514812b 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22375.4", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22376.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From e63d48c7906d661ddd1bf73e1654072b5e18c80c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 14:03:08 +0000 Subject: [PATCH 065/226] Update dependencies from https://github.com/dotnet/arcade build 20220727.15 (#13583) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22376.3 -> To Version 7.0.0-beta.22377.15 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 +- eng/common/cross/build-rootfs.sh | 121 +++++++++++++++---------------- global.json | 2 +- 3 files changed, 61 insertions(+), 66 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 75e68789201..bba8ceb550a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 37e6d5179448c5255f1517834463210dcc45963a + 7df67590fb080663ada77f269a8b132ef127a039 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index c8540474aa1..77eaac60c8c 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -18,7 +18,6 @@ usage() __CodeName=xenial __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -__InitialDir=$PWD __BuildArch=arm __AlpineArch=armv7 __FreeBSDArch=arm @@ -43,7 +42,7 @@ __AlpinePackages+=" libedit" # symlinks fixer __UbuntuPackages+=" symlinks" -# CoreCLR and CoreFX dependencies +# runtime dependencies __UbuntuPackages+=" libicu-dev" __UbuntuPackages+=" liblttng-ust-dev" __UbuntuPackages+=" libunwind8-dev" @@ -54,7 +53,7 @@ __AlpinePackages+=" libunwind-dev" __AlpinePackages+=" lttng-ust-dev" __AlpinePackages+=" compiler-rt-static" -# CoreFX dependencies +# runtime libraries' dependencies __UbuntuPackages+=" libcurl4-openssl-dev" __UbuntuPackages+=" libkrb5-dev" __UbuntuPackages+=" libssl-dev" @@ -84,17 +83,18 @@ __IllumosPackages+=" zlib-1.2.11" __UbuntuPackages+=" libomp5" __UbuntuPackages+=" libomp-dev" +__Keyring= __UseMirror=0 __UnprocessedBuildArgs= while :; do - if [ $# -le 0 ]; then + if [[ "$#" -le 0 ]]; then break fi - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + lowerI="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case $lowerI in - -?|-h|--help) + -\?|-h|--help) usage exit 1 ;; @@ -111,7 +111,7 @@ while :; do __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" __CodeName=buster __LLDB_Package="liblldb-6.0-dev" - __Keyring="/usr/share/keyrings/raspbian-archive-keyring.gpg" + __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg" ;; arm64) __BuildArch=arm64 @@ -189,17 +189,17 @@ while :; do fi ;; xenial) # Ubuntu 16.04 - if [ "$__CodeName" != "jessie" ]; then + if [[ "$__CodeName" != "jessie" ]]; then __CodeName=xenial fi ;; zesty) # Ubuntu 17.04 - if [ "$__CodeName" != "jessie" ]; then + if [[ "$__CodeName" != "jessie" ]]; then __CodeName=zesty fi ;; bionic) # Ubuntu 18.04 - if [ "$__CodeName" != "jessie" ]; then + if [[ "$__CodeName" != "jessie" ]]; then __CodeName=bionic fi ;; @@ -253,7 +253,7 @@ while :; do ;; --rootfsdir|-rootfsdir) shift - __RootfsDir=$1 + __RootfsDir="$1" ;; --use-mirror) __UseMirror=1 @@ -266,71 +266,66 @@ while :; do shift done -if [ -e "$__Keyring" ]; then - __Keyring="--keyring=$__Keyring" -else - __Keyring="" -fi - -if [ "$__BuildArch" == "armel" ]; then +if [[ "$__BuildArch" == "armel" ]]; then __LLDB_Package="lldb-3.5-dev" fi + __UbuntuPackages+=" ${__LLDB_Package:-}" -if [ ! -z "$__LLVM_MajorVersion" ]; then +if [[ -n "$__LLVM_MajorVersion" ]]; then __UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev" fi -if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then - __RootfsDir=$ROOTFS_DIR +if [[ -z "$__RootfsDir" && -n "$ROOTFS_DIR" ]]; then + __RootfsDir="$ROOTFS_DIR" fi -if [ -z "$__RootfsDir" ]; then +if [[ -z "$__RootfsDir" ]]; then __RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch" fi -if [ -d "$__RootfsDir" ]; then - if [ $__SkipUnmount == 0 ]; then - umount $__RootfsDir/* || true +if [[ -d "$__RootfsDir" ]]; then + if [[ "$__SkipUnmount" == "0" ]]; then + umount "$__RootfsDir"/* || true fi - rm -rf $__RootfsDir + rm -rf "$__RootfsDir" fi -mkdir -p $__RootfsDir +mkdir -p "$__RootfsDir" __RootfsDir="$( cd "$__RootfsDir" && pwd )" if [[ "$__CodeName" == "alpine" ]]; then __ApkToolsVersion=2.9.1 - __ApkToolsDir=$(mktemp -d) - wget https://github.com/alpinelinux/apk-tools/releases/download/v$__ApkToolsVersion/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -P $__ApkToolsDir - tar -xf $__ApkToolsDir/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -C $__ApkToolsDir - mkdir -p $__RootfsDir/usr/bin - cp -v /usr/bin/qemu-$__QEMUArch-static $__RootfsDir/usr/bin + __ApkToolsDir="$(mktemp -d)" + wget "https://github.com/alpinelinux/apk-tools/releases/download/v$__ApkToolsVersion/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz" -P "$__ApkToolsDir" + tar -xf "$__ApkToolsDir/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz" -C "$__ApkToolsDir" + mkdir -p "$__RootfsDir"/usr/bin + cp -v "/usr/bin/qemu-$__QEMUArch-static" "$__RootfsDir/usr/bin" - $__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \ - -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \ - -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \ - -U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \ + "$__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk" \ + -X "http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main" \ + -X "http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community" \ + -U --allow-untrusted --root "$__RootfsDir" --arch "$__AlpineArch" --initdb \ add $__AlpinePackages - rm -r $__ApkToolsDir + rm -r "$__ApkToolsDir" elif [[ "$__CodeName" == "freebsd" ]]; then - mkdir -p $__RootfsDir/usr/local/etc + mkdir -p "$__RootfsDir"/usr/local/etc JOBS="$(getconf _NPROCESSORS_ONLN)" - wget -O - https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz | tar -C $__RootfsDir -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version - echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > ${__RootfsDir}/usr/local/etc/pkg.conf - echo "FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > ${__RootfsDir}/etc/pkg/FreeBSD.conf - mkdir -p $__RootfsDir/tmp + wget -O - "https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz" | tar -C "$__RootfsDir" -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version + echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > "${__RootfsDir}"/usr/local/etc/pkg.conf + echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf + mkdir -p "$__RootfsDir"/tmp # get and build package manager - wget -O - https://github.com/freebsd/pkg/archive/${__FreeBSDPkg}.tar.gz | tar -C $__RootfsDir/tmp -zxf - - cd $__RootfsDir/tmp/pkg-${__FreeBSDPkg} + wget -O - "https://github.com/freebsd/pkg/archive/${__FreeBSDPkg}.tar.gz" | tar -C "$__RootfsDir"/tmp -zxf - + cd "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}" # needed for install to succeed - mkdir -p $__RootfsDir/host/etc - ./autogen.sh && ./configure --prefix=$__RootfsDir/host && make -j "$JOBS" && make install - rm -rf $__RootfsDir/tmp/pkg-${__FreeBSDPkg} + mkdir -p "$__RootfsDir"/host/etc + ./autogen.sh && ./configure --prefix="$__RootfsDir"/host && make -j "$JOBS" && make install + rm -rf "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}" # install packages we need. - INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf update - INSTALL_AS_USER=$(whoami) $__RootfsDir/host/sbin/pkg -r $__RootfsDir -C $__RootfsDir/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages + INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update + INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages elif [[ "$__CodeName" == "illumos" ]]; then mkdir "$__RootfsDir/tmp" pushd "$__RootfsDir/tmp" @@ -358,7 +353,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=http://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl"/packages/SmartOS/2020Q1/${__illumosArch}/All + BaseUrl="$BaseUrl/packages/SmartOS/2020Q1/${__illumosArch}/All" echo "Downloading dependencies." read -ra array <<<"$__IllumosPackages" for package in "${array[@]}"; do @@ -376,26 +371,26 @@ elif [[ "$__CodeName" == "illumos" ]]; then wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/dlt.h wget -P "$__RootfsDir"/usr/include/netpacket https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/inet/sockmods/netpacket/packet.h wget -P "$__RootfsDir"/usr/include/sys https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/sys/sdt.h -elif [[ -n $__CodeName ]]; then - qemu-debootstrap $__Keyring --arch $__UbuntuArch $__CodeName $__RootfsDir $__UbuntuRepo - cp $__CrossDir/$__BuildArch/sources.list.$__CodeName $__RootfsDir/etc/apt/sources.list - chroot $__RootfsDir apt-get update - chroot $__RootfsDir apt-get -f -y install - chroot $__RootfsDir apt-get -y install $__UbuntuPackages - chroot $__RootfsDir symlinks -cr /usr - chroot $__RootfsDir apt-get clean +elif [[ -n "$__CodeName" ]]; then + qemu-debootstrap $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list" + chroot "$__RootfsDir" apt-get update + chroot "$__RootfsDir" apt-get -f -y install + chroot "$__RootfsDir" apt-get -y install $__UbuntuPackages + chroot "$__RootfsDir" symlinks -cr /usr + chroot "$__RootfsDir" apt-get clean - if [ $__SkipUnmount == 0 ]; then - umount $__RootfsDir/* || true + if [[ "$__SkipUnmount" == "0" ]]; then + umount "$__RootfsDir"/* || true fi if [[ "$__BuildArch" == "armel" && "$__CodeName" == "jessie" ]]; then - pushd $__RootfsDir - patch -p1 < $__CrossDir/$__BuildArch/armel.jessie.patch + pushd "$__RootfsDir" + patch -p1 < "$__CrossDir/$__BuildArch/armel.jessie.patch" popd fi elif [[ "$__Tizen" == "tizen" ]]; then - ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh + ROOTFS_DIR="$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh" else echo "Unsupported target platform." usage; diff --git a/global.json b/global.json index 98d0514812b..b0245e8e4eb 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22376.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22377.15", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 01631f1bbf69059e6be9d0304ab1f10f304f29b7 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 28 Jul 2022 18:50:23 +0200 Subject: [PATCH 066/226] Mark methods of automatically implemented properties with CompilerGenerated attribute (#13542) * Emitting CompilerGenerated attribute on auto-generated accessors #11535 * Emitting DebuggerNonUserCode attribute together with CompilerGenerated attribute --- .../Checking/AugmentWithHashCompare.fs | 2 + src/Compiler/Checking/CheckDeclarations.fs | 5 +- src/Compiler/CodeGen/IlxGen.fs | 11 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 5 + src/Compiler/SyntaxTree/SyntaxTree.fsi | 3 + src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 6 + src/Compiler/TypedTree/TcGlobals.fs | 2 + src/Compiler/TypedTree/TypedTree.fs | 5 +- src/Compiler/TypedTree/TypedTree.fsi | 3 + src/Compiler/TypedTree/TypedTreePickle.fs | 1 + .../CCtorDUWithMember01a.fs.il.bsl | 26 ++- ...iledNameAttribute04.fs.il.net472.debug.bsl | 24 ++- ...edNameAttribute04.fs.il.net472.release.bsl | 24 ++- ...ledNameAttribute04.fs.il.netcore.debug.bsl | 24 ++- ...dNameAttribute04.fs.il.netcore.release.bsl | 24 ++- .../CompilerGeneratedAttributeOnAccessors.fs | 187 ++++++++++++++++++ .../GenericComparison/Compare05.fsx.il.bsl | 26 ++- .../GenericComparison/Compare06.fsx.il.bsl | 14 +- .../GenericComparison/Compare07.fsx.il.bsl | 26 ++- .../GenericComparison/Compare10.fsx.il.bsl | 20 +- .../GenericComparison/Equals04.fsx.il.bsl | 10 +- .../GenericComparison/Equals05.fsx.il.bsl | 14 +- .../GenericComparison/Equals06.fsx.il.bsl | 26 ++- .../GenericComparison/Equals09.fsx.il.bsl | 20 +- .../GenericComparison/Hash05.fsx.il.bsl | 10 +- .../GenericComparison/Hash06.fsx.il.bsl | 10 +- .../GenericComparison/Hash08.fsx.il.bsl | 14 +- .../GenericComparison/Hash09.fsx.il.bsl | 26 ++- .../GenericComparison/Hash12.fsx.il.bsl | 20 +- .../Inlining/Match01.fs.il.debug.bsl | 32 +-- .../Inlining/Match01.fs.il.release.bsl | 32 +-- .../Inlining/StructUnion01.fs.il.bsl | 26 ++- .../EmittedIL/Misc/AnonRecd.fs.il.bsl | 30 ++- .../Misc/EqualsOnUnions01.fs.il.debug.bsl | 26 ++- .../Misc/EqualsOnUnions01.fs.il.release.bsl | 26 ++- .../Misc/GeneralizationOnUnions01.fs.il.bsl | 26 ++- .../EmittedIL/Misc/Structs01.fs.il.debug.bsl | 24 ++- .../Misc/Structs01.fs.il.release.bsl | 24 ++- .../EmittedIL/Misc/Structs02.fs.il.debug.bsl | 26 ++- .../Misc/Structs02.fs.il.release.bsl | 28 ++- .../Misc/StructsAsArrayElements01.fs.il.bsl | 24 ++- ...StructsAsArrayElements01.fs.il.release.bsl | 24 ++- .../ToplevelModule.fs.il.debug.bsl | 56 ++++-- .../ToplevelModule.fs.il.release.bsl | 56 ++++-- .../ToplevelModule60.fs.il.debug.bsl | 56 ++++-- .../ToplevelModule60.fs.il.release.bsl | 56 ++++-- .../ToplevelNamespace.fs.il.debug.bsl | 97 ++++++--- .../ToplevelNamespace.fs.il.release.bsl | 97 ++++++--- .../ToplevelNamespace60.fs.il.debug.bsl | 97 ++++++--- .../ToplevelNamespace60.fs.il.release.bsl | 97 ++++++--- .../StaticInit/StaticInit_Class01.fs.il.bsl | 3 +- ...StaticInit_Struct01.fs.il.net472.debug.bsl | 27 ++- ...aticInit_Struct01.fs.il.net472.release.bsl | 27 ++- ...taticInit_Struct01.fs.il.netcore.debug.bsl | 27 ++- ...ticInit_Struct01.fs.il.netcore.release.bsl | 27 ++- .../SteppingMatch06.fs.il.net472.debug.bsl | 26 ++- .../SteppingMatch06.fs.il.net472.release.bsl | 26 ++- .../SteppingMatch06.fs.il.netcore.debug.bsl | 26 ++- .../SteppingMatch06.fs.il.netcore.release.bsl | 26 ++- .../SteppingMatch07.fs.il.net472.debug.bsl | 26 ++- .../SteppingMatch07.fs.il.net472.release.bsl | 26 ++- .../SteppingMatch07.fs.il.netcore.debug.bsl | 26 ++- .../SteppingMatch07.fs.il.netcore.release.bsl | 26 ++- .../EmittedIL/StructGettersReadOnly.fs | 4 + .../FloatsAndDoubles.fs.il.debug.bsl | 56 ++++-- .../FloatsAndDoubles.fs.il.release.bsl | 56 ++++-- .../TestFunction16.fs.il.debug.bsl | 26 ++- .../TestFunction16.fs.il.release.bsl | 26 ++- .../TestFunction17.fs.il.debug.bsl | 30 ++- .../TestFunction17.fs.il.release.bsl | 30 ++- .../TestFunctions/TestFunction20.fs.il.bsl | 3 +- .../TestFunction21.fs.il.debug.bsl | 26 ++- .../TestFunction21.fs.il.release.bsl | 26 ++- .../TestFunction23.fs.il.net472.bsl | 3 +- .../TestFunction23.fs.il.netcore.bsl | 3 +- .../TestFunction24.fs.il.debug.bsl | 34 +++- .../TestFunction24.fs.il.release.bsl | 34 +++- .../FSharp.Compiler.ComponentTests.fsproj | 1 + ...erService.SurfaceArea.netstandard.expected | 6 +- .../FSharp.Test.Utilities/ReflectionHelper.fs | 4 +- .../EmittedIL/ReferenceAssemblyTests.fs | 134 ++++++++----- .../CodeGen/EmittedIL/TaskGeneratedCode.fs | 4 +- 82 files changed, 1708 insertions(+), 665 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs diff --git a/src/Compiler/Checking/AugmentWithHashCompare.fs b/src/Compiler/Checking/AugmentWithHashCompare.fs index cb7320006b7..59d74eb0335 100644 --- a/src/Compiler/Checking/AugmentWithHashCompare.fs +++ b/src/Compiler/Checking/AugmentWithHashCompare.fs @@ -855,6 +855,7 @@ let slotImplMethod (final, c, slotsig) : ValMemberInfo = IsDispatchSlot=false IsFinal=final IsOverrideOrExplicitImpl=true + GetterOrSetterIsCompilerGenerated=false MemberKind=SynMemberKind.Member Trivia=SynMemberFlagsTrivia.Zero} IsImplemented=false @@ -866,6 +867,7 @@ let nonVirtualMethod c : ValMemberInfo = IsDispatchSlot=false IsFinal=false IsOverrideOrExplicitImpl=false + GetterOrSetterIsCompilerGenerated=false MemberKind=SynMemberKind.Member Trivia=SynMemberFlagsTrivia.Zero} IsImplemented=false diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 57a56ee2e88..cc55ee5f23c 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4032,6 +4032,7 @@ module TcDeclarations = let fldId = ident (CompilerGeneratedName id.idText, mMemberPortion) let headPatIds = if isStatic then [id] else [ident ("__", mMemberPortion);id] let headPat = SynPat.LongIdent (SynLongIdent(headPatIds, [], List.replicate headPatIds.Length None), None, Some noInferredTypars, SynArgPats.Pats [], None, mMemberPortion) + let memberFlags kind = Some { memberFlags kind with GetterOrSetterIsCompilerGenerated = true } match propKind, mGetSetOpt with | SynMemberKind.PropertySet, Some m -> errorR(Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSetNotJustSet(), m)) @@ -4046,7 +4047,7 @@ module TcDeclarations = let rhsExpr = SynExpr.Ident fldId let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) let attribs = mkAttributeList attribs mMemberPortion - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some (memberFlags SynMemberKind.Member), SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, memberFlags SynMemberKind.Member, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield getter | _ -> () @@ -4059,7 +4060,7 @@ module TcDeclarations = let headPat = SynPat.LongIdent (SynLongIdent(headPatIds, [], List.replicate headPatIds.Length None), None, Some noInferredTypars, SynArgPats.Pats [mkSynPatVar None vId], None, mMemberPortion) let rhsExpr = mkSynAssign (SynExpr.Ident fldId) (SynExpr.Ident vId) //let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], Some (memberFlags SynMemberKind.PropertySet), SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], memberFlags SynMemberKind.PropertySet, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield setter | _ -> ()] diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 63c543cfed2..40b96f22861 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -2107,7 +2107,9 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu [ for propName, fldName, fldTy in flds -> let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] + mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) + |> g.AddMethodGeneratedAttributes yield! genToStringMethod ilTy ] @@ -8996,8 +8998,8 @@ and GenMethodForBinding // Do not push the attributes to the method for events and properties let ilAttrsCompilerGenerated = - if v.IsCompilerGenerated then - [ g.CompilerGeneratedAttribute ] + if v.IsCompilerGenerated || v.GetterOrSetterIsCompilerGenerated then + [ g.CompilerGeneratedAttribute; g.DebuggerNonUserCodeAttribute ] else [] @@ -10760,7 +10762,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = else [] - yield mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) + yield + mkLdfldMethodDef (ilMethName, access, isStatic, ilThisTy, ilFieldName, ilPropType, attrs) + |> g.AddMethodGeneratedAttributes // Generate property setter methods for the mutable fields for useGenuineField, ilFieldName, isFSharpMutable, isStatic, _, ilPropType, isPropHidden, fspec in fieldSummaries do @@ -10799,6 +10803,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = ) mkILNonGenericInstanceMethod (ilMethName, iLAccess, ilParams, ilReturn, ilMethodBody) + |> g.AddMethodGeneratedAttributes yield ilMethodDef.WithSpecialName diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index ad225b7e5de..2ea6674327b 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1047,6 +1047,9 @@ type SynMemberFlags = IsFinal: bool + // This is not persisted in pickling + GetterOrSetterIsCompilerGenerated: bool + MemberKind: SynMemberKind Trivia: SynMemberFlagsTrivia @@ -1059,6 +1062,7 @@ type SynMemberFlags = && this.IsDispatchSlot = other.IsDispatchSlot && this.IsOverrideOrExplicitImpl = other.IsOverrideOrExplicitImpl && this.IsFinal = other.IsFinal + && this.GetterOrSetterIsCompilerGenerated = other.GetterOrSetterIsCompilerGenerated && this.MemberKind = other.MemberKind | _ -> false @@ -1067,6 +1071,7 @@ type SynMemberFlags = + hash this.IsDispatchSlot + hash this.IsOverrideOrExplicitImpl + hash this.IsFinal + + hash this.GetterOrSetterIsCompilerGenerated + hash this.MemberKind [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index dc94eb28c27..0a5af4cf455 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1203,6 +1203,9 @@ type SynMemberFlags = /// The member is 'final' IsFinal: bool + /// The member was generated by the compiler + GetterOrSetterIsCompilerGenerated: bool + /// The kind of the member MemberKind: SynMemberKind diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 1834bb0fbf7..8898e2345cd 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -697,6 +697,7 @@ let NonVirtualMemberFlags trivia k : SynMemberFlags = IsDispatchSlot = false IsOverrideOrExplicitImpl = false IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } @@ -707,6 +708,7 @@ let CtorMemberFlags trivia : SynMemberFlags = IsDispatchSlot = false IsOverrideOrExplicitImpl = false IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } @@ -717,6 +719,7 @@ let ClassCtorMemberFlags trivia : SynMemberFlags = IsDispatchSlot = false IsOverrideOrExplicitImpl = false IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } @@ -727,6 +730,7 @@ let OverrideMemberFlags trivia k : SynMemberFlags = IsDispatchSlot = false IsOverrideOrExplicitImpl = true IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } @@ -737,6 +741,7 @@ let AbstractMemberFlags trivia k : SynMemberFlags = IsDispatchSlot = true IsOverrideOrExplicitImpl = false IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } @@ -747,6 +752,7 @@ let StaticMemberFlags trivia k : SynMemberFlags = IsDispatchSlot = false IsOverrideOrExplicitImpl = false IsFinal = false + GetterOrSetterIsCompilerGenerated = false Trivia = trivia } diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 9c1a92d2215..ba5f583a3f2 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1758,6 +1758,8 @@ type TcGlobals( member _.CompilerGeneratedAttribute = mkCompilerGeneratedAttribute () + member _.DebuggerNonUserCodeAttribute = mkDebuggerNonUserCodeAttribute () + member _.MakeInternalsVisibleToAttribute(simpleAssemName) = mkILCustomAttribute (tref_InternalsVisibleToAttribute, [ilg.typ_String], [ILAttribElem.String (Some simpleAssemName)], []) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index d71fd222745..53c88172dd1 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2783,6 +2783,10 @@ type Val = /// /// Note: this is true for the overrides generated by hash/compare augmentations member x.IsCompilerGenerated = x.val_flags.IsCompilerGenerated + + /// Indicates that this value's getter or setter are generated by the compiler + member x.GetterOrSetterIsCompilerGenerated = + x.MemberInfo |> Option.exists (fun m -> m.MemberFlags.GetterOrSetterIsCompilerGenerated = true) /// Get the declared attributes for the value member x.Attribs = @@ -5955,4 +5959,3 @@ type Construct() = let pos = Position.mkPos line (max 0 (column - 1)) mkRange filePath pos pos |> Some #endif - diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 57037ba27d8..d201a64af04 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -2001,6 +2001,9 @@ type Val = /// Note: this is true for the overrides generated by hash/compare augmentations member IsCompilerGenerated: bool + /// Indicates that this value's getter or setter are generated by the compiler + member GetterOrSetterIsCompilerGenerated: bool + /// Indicates if this is an F#-defined 'new' constructor member member IsConstructor: bool diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 57c557d2b8a..f97e293c9a8 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1499,6 +1499,7 @@ let u_MemberFlags st : SynMemberFlags= IsDispatchSlot=x4 IsOverrideOrExplicitImpl=x5 IsFinal=x6 + GetterOrSetterIsCompilerGenerated=false MemberKind=x7 Trivia = SynMemberFlagsTrivia.Zero } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01a.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01a.fs.il.bsl index 5c7b6e8b573..2dc8dbfa5f7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01a.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01a.fs.il.bsl @@ -210,7 +210,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -224,7 +224,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class CCtorDUWithMember01a/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -269,7 +270,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -283,7 +285,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class CCtorDUWithMember01a/C V_0, @@ -334,7 +337,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -354,7 +358,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -367,7 +372,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class CCtorDUWithMember01a/C V_0, @@ -422,7 +428,8 @@ .method public hidebysig virtual final instance bool Equals(class CCtorDUWithMember01a/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -458,7 +465,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class CCtorDUWithMember01a/C V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.debug.bsl index f166e2eeaeb..f3a0347d75d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.debug.bsl @@ -142,7 +142,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Program/S obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -155,7 +156,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -169,7 +171,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 3 .locals init (valuetype Program/S V_0, @@ -186,7 +189,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 2 (0x2) .maxstack 8 IL_0000: ldc.i4.0 @@ -196,7 +200,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -209,7 +214,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 3 .locals init (object V_0, @@ -247,7 +253,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Program/S obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -260,7 +267,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.release.bsl index 6327bcbfdea..d3082c2ce7a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.net472.release.bsl @@ -142,7 +142,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Program/S obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -155,7 +156,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -169,7 +171,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 3 .locals init (valuetype Program/S V_0, @@ -186,7 +189,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 2 (0x2) .maxstack 8 IL_0000: ldc.i4.0 @@ -196,7 +200,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -209,7 +214,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 3 .locals init (object V_0, @@ -247,7 +253,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Program/S obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -260,7 +267,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.debug.bsl index 7d12e40578a..01861b35cc9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.debug.bsl @@ -147,7 +147,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Program/S obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -160,7 +161,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -174,7 +176,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 3 .locals init (valuetype Program/S V_0, @@ -191,7 +194,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 2 (0x2) .maxstack 8 IL_0000: ldc.i4.0 @@ -201,7 +205,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -214,7 +219,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 3 .locals init (object V_0, @@ -252,7 +258,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Program/S obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -265,7 +272,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.release.bsl index 766e85b9ec1..cfda847e4e6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompiledNameAttribute/CompiledNameAttribute04.fs.il.netcore.release.bsl @@ -147,7 +147,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Program/S obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -160,7 +161,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -174,7 +176,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 3 .locals init (valuetype Program/S V_0, @@ -191,7 +194,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 2 (0x2) .maxstack 8 IL_0000: ldc.i4.0 @@ -201,7 +205,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -214,7 +219,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 3 .locals init (object V_0, @@ -252,7 +258,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Program/S obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 5 (0x5) .maxstack 3 .locals init (valuetype Program/S& V_0) @@ -265,7 +272,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs new file mode 100644 index 00000000000..20c5251b989 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs @@ -0,0 +1,187 @@ +namespace FSharp.Compiler.ComponentTests.EmittedIL + +open Microsoft.FSharp.Core +open Xunit +open FSharp.Test.Compiler +open FSharp.Test.ReflectionHelper + +module ``Auto-generated accessors have CompilerGenerated attribute`` = + + let classProperty = + FSharp + """ + module Test + + type User() = + member val Age = 0 with get, set + """ + + let classStaticProperty = + FSharp + """ + module Test + + type User() = + static member val Age = 0 with get, set + """ + + [] + [] + [] + let ``Class property has CompilerGenerated attribute`` method = + classProperty + |> compileAssembly + |> getType "Test+User" + |> getMethod method + |> should haveAttribute "CompilerGeneratedAttribute" + + [] + let ``Class property has CompilerGenerated attributes in IL`` () = + classProperty + |> compile + |> verifyIL [ + """ + .method public hidebysig specialname + instance int32 get_Age() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Test/User::Age@ + IL_0006: ret + } + + .method public hidebysig specialname + instance void set_Age(int32 v) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 Test/User::Age@ + IL_0007: ret + } + """ + ] + + [] + [] + [] + let ``Class static property has CompilerGenerated attribute`` method = + classStaticProperty + |> compileAssembly + |> getType "Test+User" + |> getMethod method + |> should haveAttribute "CompilerGeneratedAttribute" + + [] + let ``Class static property has CompilerGenerated attributes in IL`` () = + classStaticProperty + |> compile + |> verifyIL [ + """ + .method public specialname static int32 + get_Age() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: volatile. + IL_0002: ldsfld int32 Test/User::init@4 + IL_0007: ldc.i4.1 + IL_0008: bge.s IL_0011 + + IL_000a: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() + IL_000f: br.s IL_0011 + + IL_0011: ldsfld int32 Test/User::Age@ + IL_0016: ret + } + + .method public specialname static void + set_Age(int32 v) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: volatile. + IL_0002: ldsfld int32 Test/User::init@4 + IL_0007: ldc.i4.1 + IL_0008: bge.s IL_0011 + + IL_000a: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() + IL_000f: br.s IL_0011 + + IL_0011: ldarg.0 + IL_0012: stsfld int32 Test/User::Age@ + IL_0017: ret + } + """ + ] + + [] + [] + [] + let ``Custom accessor shouldn't have CompilerGenerated attribute`` method = + FSharp + """ + module Test + + type User() = + member this.Age + with get() = 9000 + and set (value: int) = () + """ + |> compileAssembly + |> getType "Test+User" + |> getMethod method + |> shouldn't haveAttribute "CompilerGeneratedAttribute" + + [] + let ``Record getters should have CompilerGenerated attribute`` () = + FSharp + """ + module Test + + type User = { Age : int } + """ + |> compileAssembly + |> getType "Test+User" + |> getMethod "get_Age" + |> should haveAttribute "CompilerGeneratedAttribute" + |> should haveAttribute "DebuggerNonUserCodeAttribute" + + + [] + let ``Record setters should have CompilerGenerated attribute`` () = + FSharp + """ + module Test + + type User = { mutable Age : int } + """ + |> compileAssembly + |> getType "Test+User" + |> getMethod "set_Age" + |> should haveAttribute "CompilerGeneratedAttribute" + |> should haveAttribute "DebuggerNonUserCodeAttribute" + + [] + let ``Anonymous record getters should have CompilerGenerated attribute`` () = + FSharp + """ + module Test + + let user = {| Age = 9000 |} + """ + |> compileAssembly + |> getFirstAnonymousType + |> getMethod "get_Age" + |> should haveAttribute "CompilerGeneratedAttribute" + |> should haveAttribute "DebuggerNonUserCodeAttribute" diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare05.fsx.il.bsl index 7f3f99eda4e..5ffac61048a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare05.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -178,7 +178,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Compare05/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Compare05/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -262,7 +263,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -276,7 +278,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Compare05/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -361,7 +364,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -413,7 +417,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -426,7 +431,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Compare05/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -477,7 +483,8 @@ .method public hidebysig virtual final instance bool Equals(class Compare05/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Compare05/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -524,7 +531,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Compare05/CompareMicroPerfAndCodeGenerationTests/Key V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl index b7aea842a83..1c3aff527ce 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl @@ -74,6 +74,8 @@ .method public hidebysig specialname instance int32 get_key1() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -84,6 +86,8 @@ .method public hidebysig specialname instance int32 get_key2() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -111,7 +115,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -126,6 +130,7 @@ instance int32 CompareTo(class Compare06/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 87 (0x57) .maxstack 5 .locals init (int32 V_0, @@ -202,6 +207,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -216,6 +222,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 92 (0x5c) .maxstack 5 .locals init (class Compare06/CompareMicroPerfAndCodeGenerationTests/KeyR V_0, @@ -293,6 +300,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 7 .locals init (int32 V_0) @@ -338,6 +346,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -351,6 +360,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 4 .locals init (class Compare06/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) @@ -394,6 +404,7 @@ instance bool Equals(class Compare06/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -433,6 +444,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Compare06/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare07.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare07.fsx.il.bsl index 58e91ae46c6..f3d7cc91310 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare07.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare07.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -178,7 +178,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 101 (0x65) .maxstack 5 .locals init (class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -261,7 +262,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 15 (0xf) .maxstack 8 IL_0000: ldarg.0 @@ -276,7 +278,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 106 (0x6a) .maxstack 5 .locals init (class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -360,7 +363,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 73 (0x49) .maxstack 7 .locals init (int32 V_0, @@ -423,7 +427,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -436,7 +441,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 84 (0x54) .maxstack 5 .locals init (class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -505,7 +511,8 @@ .method public hidebysig virtual final instance bool Equals(class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 71 (0x47) .maxstack 4 .locals init (class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -566,7 +573,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare10.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare10.fsx.il.bsl index 4029fde7bb9..85867b39e1c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare10.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare10.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Compare10/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Compare10/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/Key V_0) @@ -678,7 +686,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -693,6 +701,7 @@ instance int32 CompareTo(class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 160 (0xa0) .maxstack 5 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -802,6 +811,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -816,6 +826,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 165 (0xa5) .maxstack 5 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -926,6 +937,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 104 (0x68) .maxstack 7 .locals init (int32 V_0, @@ -1004,6 +1016,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1017,6 +1030,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 135 (0x87) .maxstack 5 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1109,6 +1123,7 @@ instance bool Equals(class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 63 (0x3f) .maxstack 4 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1159,6 +1174,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals04.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals04.fsx.il.bsl index f8409177e22..074587c734c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals04.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals04.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl index 34ab1b1e85c..89dda0ab2ca 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl @@ -74,6 +74,8 @@ .method public hidebysig specialname instance int32 get_key1() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -84,6 +86,8 @@ .method public hidebysig specialname instance int32 get_key2() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -111,7 +115,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -126,6 +130,7 @@ instance int32 CompareTo(class Equals05/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 87 (0x57) .maxstack 5 .locals init (int32 V_0, @@ -202,6 +207,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -216,6 +222,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 92 (0x5c) .maxstack 5 .locals init (class Equals05/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0, @@ -293,6 +300,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 7 .locals init (int32 V_0) @@ -338,6 +346,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -351,6 +360,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 4 .locals init (class Equals05/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) @@ -394,6 +404,7 @@ instance bool Equals(class Equals05/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -433,6 +444,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Equals05/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals06.fsx.il.bsl index c7dbee58c5d..df2419f10f5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals06.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -178,7 +178,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 101 (0x65) .maxstack 5 .locals init (class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -261,7 +262,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 15 (0xf) .maxstack 8 IL_0000: ldarg.0 @@ -276,7 +278,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 106 (0x6a) .maxstack 5 .locals init (class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -360,7 +363,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 73 (0x49) .maxstack 7 .locals init (int32 V_0, @@ -423,7 +427,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -436,7 +441,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 84 (0x54) .maxstack 5 .locals init (class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -505,7 +511,8 @@ .method public hidebysig virtual final instance bool Equals(class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 71 (0x47) .maxstack 4 .locals init (class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -566,7 +573,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals09.fsx.il.bsl index a1e2de9fe5d..650127c9a31 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals09.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key V_0) @@ -678,7 +686,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -693,6 +701,7 @@ instance int32 CompareTo(class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 160 (0xa0) .maxstack 5 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -802,6 +811,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -816,6 +826,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 165 (0xa5) .maxstack 5 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -926,6 +937,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 104 (0x68) .maxstack 7 .locals init (int32 V_0, @@ -1004,6 +1016,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1017,6 +1030,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 135 (0x87) .maxstack 5 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1109,6 +1123,7 @@ instance bool Equals(class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 63 (0x3f) .maxstack 4 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1159,6 +1174,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash05.fsx.il.bsl index 9d3644fad7d..c485978dd53 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash05.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Hash05/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Hash05/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Hash05/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Hash05/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Hash05/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Hash05/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Hash05/HashMicroPerfAndCodeGenerationTests/Key V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash06.fsx.il.bsl index f72d0b9ef6f..c7e4181cb8b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash06.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Hash06/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Hash06/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Hash06/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Hash06/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Hash06/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Hash06/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Hash06/HashMicroPerfAndCodeGenerationTests/Key V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl index c94a00b3427..4378f1cb396 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl @@ -74,6 +74,8 @@ .method public hidebysig specialname instance int32 get_key1() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -84,6 +86,8 @@ .method public hidebysig specialname instance int32 get_key2() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -111,7 +115,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -126,6 +130,7 @@ instance int32 CompareTo(class Hash08/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 87 (0x57) .maxstack 5 .locals init (int32 V_0, @@ -202,6 +207,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -216,6 +222,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 92 (0x5c) .maxstack 5 .locals init (class Hash08/HashMicroPerfAndCodeGenerationTests/KeyR V_0, @@ -293,6 +300,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 7 .locals init (int32 V_0) @@ -338,6 +346,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -351,6 +360,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 4 .locals init (class Hash08/HashMicroPerfAndCodeGenerationTests/KeyR V_0) @@ -394,6 +404,7 @@ instance bool Equals(class Hash08/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -433,6 +444,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Hash08/HashMicroPerfAndCodeGenerationTests/KeyR V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash09.fsx.il.bsl index 5a1f705640b..9e672dc25f7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash09.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -178,7 +178,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 101 (0x65) .maxstack 5 .locals init (class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -261,7 +262,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 15 (0xf) .maxstack 8 IL_0000: ldarg.0 @@ -276,7 +278,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 106 (0x6a) .maxstack 5 .locals init (class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -360,7 +363,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 73 (0x49) .maxstack 7 .locals init (int32 V_0, @@ -423,7 +427,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -436,7 +441,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 84 (0x54) .maxstack 5 .locals init (class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -505,7 +511,8 @@ .method public hidebysig virtual final instance bool Equals(class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 71 (0x47) .maxstack 4 .locals init (class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 V_0, @@ -566,7 +573,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash12.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash12.fsx.il.bsl index 313ec19364b..29fc7807c67 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash12.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash12.fsx.il.bsl @@ -164,7 +164,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -179,6 +179,7 @@ instance int32 CompareTo(class Hash12/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 105 (0x69) .maxstack 5 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -263,6 +264,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -277,6 +279,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 110 (0x6e) .maxstack 5 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -362,6 +365,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 7 .locals init (int32 V_0, @@ -414,6 +418,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -427,6 +432,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 60 (0x3c) .maxstack 4 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -478,6 +484,7 @@ instance bool Equals(class Hash12/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/Key V_0, @@ -525,6 +532,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/Key V_0) @@ -678,7 +686,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -693,6 +701,7 @@ instance int32 CompareTo(class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 160 (0xa0) .maxstack 5 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -802,6 +811,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -816,6 +826,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 165 (0xa5) .maxstack 5 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -926,6 +937,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 104 (0x68) .maxstack 7 .locals init (int32 V_0, @@ -1004,6 +1016,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1017,6 +1030,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 135 (0x87) .maxstack 5 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1109,6 +1123,7 @@ instance bool Equals(class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 63 (0x3f) .maxstack 4 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0, @@ -1159,6 +1174,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.debug.bsl index 3d7263bd40f..bb276018c45 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.debug.bsl @@ -613,7 +613,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -627,7 +627,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Match01/Test1 obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 24 (0x18) .maxstack 8 IL_0000: ldarg.0 @@ -660,7 +661,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -674,7 +676,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 5 .locals init (class Match01/Test1 V_0) @@ -713,7 +716,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 167 (0xa7) .maxstack 7 .locals init (int32 V_0, @@ -824,7 +828,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -837,7 +842,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 209 (0xd1) .maxstack 4 .locals init (class Match01/Test1 V_0, @@ -946,7 +952,8 @@ .method public hidebysig virtual final instance bool Equals(class Match01/Test1 obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 200 (0xc8) .maxstack 4 .locals init (int32 V_0, @@ -1051,7 +1058,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Match01/Test1 V_0) @@ -1111,7 +1119,8 @@ class Match01/Test1 obj, class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 268 (0x10c) .maxstack 5 .locals init (int32 V_0, @@ -1246,7 +1255,8 @@ class Match01/Test1 objTemp, class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 240 (0xf0) .maxstack 5 .locals init (int32 V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.release.bsl index bea000625f7..350b2120658 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Match01.fs.il.release.bsl @@ -613,7 +613,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -627,7 +627,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class Match01/Test1 obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 24 (0x18) .maxstack 8 IL_0000: ldarg.0 @@ -660,7 +661,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -674,7 +676,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 32 (0x20) .maxstack 6 .locals init (class Match01/Test1 V_0) @@ -708,7 +711,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 167 (0xa7) .maxstack 7 .locals init (int32 V_0, @@ -819,7 +823,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -832,7 +837,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 209 (0xd1) .maxstack 4 .locals init (class Match01/Test1 V_0, @@ -941,7 +947,8 @@ .method public hidebysig virtual final instance bool Equals(class Match01/Test1 obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 200 (0xc8) .maxstack 4 .locals init (int32 V_0, @@ -1046,7 +1053,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class Match01/Test1 V_0) @@ -1106,7 +1114,8 @@ class Match01/Test1 obj, class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 268 (0x10c) .maxstack 5 .locals init (int32 V_0, @@ -1242,7 +1251,8 @@ class Match01/Test1 objTemp, class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 253 (0xfd) .maxstack 5 .locals init (int32 V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/StructUnion01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/StructUnion01.fs.il.bsl index 489023a16aa..fb61af46ec1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/StructUnion01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/StructUnion01.fs.il.bsl @@ -162,7 +162,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 8 IL_0000: ldstr "%+A" @@ -177,7 +177,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StructUnion01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 76 (0x4c) .maxstack 5 .locals init (int32 V_0, @@ -237,7 +238,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -251,7 +253,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 71 (0x47) .maxstack 5 .locals init (valuetype StructUnion01/U V_0, @@ -310,7 +313,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 50 (0x32) .maxstack 7 .locals init (int32 V_0) @@ -353,7 +357,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -366,7 +371,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 52 (0x34) .maxstack 4 .locals init (valuetype StructUnion01/U V_0) @@ -402,7 +408,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StructUnion01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 8 IL_0000: ldarg.0 @@ -427,7 +434,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 23 (0x17) .maxstack 8 IL_0000: ldarg.1 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl index 31112ecefe0..bd8b2bb3a0a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/AnonRecd.fs.il.bsl @@ -124,6 +124,8 @@ .method public hidebysig specialname instance !'j__TPar' get_A() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -134,6 +136,8 @@ .method public hidebysig specialname instance !'j__TPar' get_B() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -144,7 +148,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -158,7 +162,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 75 (0x4b) .maxstack 5 .locals init (int32 V_0) @@ -218,7 +223,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 15 (0xf) .maxstack 8 IL_0000: ldarg.0 @@ -233,7 +239,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 86 (0x56) .maxstack 5 .locals init (class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0, @@ -302,7 +309,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 63 (0x3f) .maxstack 7 .locals init (int32 V_0) @@ -353,7 +361,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 @@ -367,7 +376,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 68 (0x44) .maxstack 5 .locals init (class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0, @@ -421,7 +431,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 57 (0x39) .maxstack 8 IL_0000: ldarg.0 @@ -464,7 +475,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 4 .locals init (class '<>f__AnonymousType1912756633`2'j__TPar',!'j__TPar'> V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.debug.bsl index e364665021b..9f475da7fb7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.debug.bsl @@ -325,7 +325,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -339,7 +339,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class EqualsOnUnions01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 136 (0x88) .maxstack 5 .locals init (int32 V_0, @@ -443,7 +444,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -457,7 +459,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 151 (0x97) .maxstack 5 .locals init (class EqualsOnUnions01/U V_0, @@ -567,7 +570,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 71 (0x47) .maxstack 7 .locals init (int32 V_0, @@ -631,7 +635,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -644,7 +649,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 126 (0x7e) .maxstack 4 .locals init (class EqualsOnUnions01/U V_0, @@ -741,7 +747,8 @@ .method public hidebysig virtual final instance bool Equals(class EqualsOnUnions01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 95 (0x5f) .maxstack 4 .locals init (int32 V_0, @@ -819,7 +826,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class EqualsOnUnions01/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.release.bsl index d71aaabcf5a..3ab626ff65f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/EqualsOnUnions01.fs.il.release.bsl @@ -325,7 +325,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -339,7 +339,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class EqualsOnUnions01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 121 (0x79) .maxstack 5 .locals init (int32 V_0, @@ -434,7 +435,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -448,7 +450,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 136 (0x88) .maxstack 5 .locals init (class EqualsOnUnions01/U V_0, @@ -549,7 +552,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 64 (0x40) .maxstack 7 .locals init (int32 V_0, @@ -607,7 +611,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -620,7 +625,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 111 (0x6f) .maxstack 4 .locals init (class EqualsOnUnions01/U V_0, @@ -708,7 +714,8 @@ .method public hidebysig virtual final instance bool Equals(class EqualsOnUnions01/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 95 (0x5f) .maxstack 4 .locals init (int32 V_0, @@ -786,7 +793,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class EqualsOnUnions01/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/GeneralizationOnUnions01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/GeneralizationOnUnions01.fs.il.bsl index c59925933cd..f4ad24c1b72 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/GeneralizationOnUnions01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/GeneralizationOnUnions01.fs.il.bsl @@ -131,7 +131,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -145,7 +145,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class GeneralizationOnUnions01/Weirdo obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 17 (0x11) .maxstack 8 IL_0000: ldarg.0 @@ -173,7 +174,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -187,7 +189,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 34 (0x22) .maxstack 3 .locals init (class GeneralizationOnUnions01/Weirdo V_0) @@ -221,7 +224,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 11 (0xb) .maxstack 3 .locals init (int32 V_0) @@ -242,7 +246,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -255,7 +260,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 4 .locals init (class GeneralizationOnUnions01/Weirdo V_0, @@ -288,7 +294,8 @@ .method public hidebysig virtual final instance bool Equals(class GeneralizationOnUnions01/Weirdo obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 @@ -310,7 +317,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class GeneralizationOnUnions01/Weirdo V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.debug.bsl index 7c310b26824..baeb6450e15 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.debug.bsl @@ -65,7 +65,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Experiment.Test/Test obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 46 (0x2e) .maxstack 5 .locals init (valuetype Experiment.Test/Test& V_0, @@ -104,7 +105,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -118,7 +120,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 5 .locals init (valuetype Experiment.Test/Test V_0, @@ -161,7 +164,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0, @@ -196,7 +200,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -209,7 +214,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (object V_0, @@ -265,7 +271,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Experiment.Test/Test obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype Experiment.Test/Test& V_0) @@ -282,7 +289,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.release.bsl index fab1602c18a..59fb5acd4c4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs01.fs.il.release.bsl @@ -65,7 +65,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Experiment.Test/Test obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 33 (0x21) .maxstack 5 .locals init (valuetype Experiment.Test/Test& V_0, @@ -95,7 +96,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -109,7 +111,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 5 .locals init (valuetype Experiment.Test/Test V_0, @@ -143,7 +146,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 7 .locals init (int32 V_0, @@ -172,7 +176,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -185,7 +190,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 4 .locals init (object V_0, @@ -232,7 +238,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Experiment.Test/Test obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype Experiment.Test/Test& V_0) @@ -249,7 +256,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl index cc8f56cd993..61f2dd9be84 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.debug.bsl @@ -67,6 +67,8 @@ instance int32 get_hash() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -77,7 +79,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Experiment.Test/Repro obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 46 (0x2e) .maxstack 5 .locals init (valuetype Experiment.Test/Repro& V_0, @@ -116,7 +119,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -130,7 +134,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 5 .locals init (valuetype Experiment.Test/Repro V_0, @@ -173,7 +178,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0, @@ -208,7 +214,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -221,7 +228,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (object V_0, @@ -309,7 +317,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Experiment.Test/Repro obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype Experiment.Test/Repro& V_0) @@ -326,7 +335,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl index ed4eefc32ed..659121ef261 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Structs02.fs.il.release.bsl @@ -66,7 +66,9 @@ .method public hidebysig specialname instance int32 get_hash() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -77,7 +79,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype Experiment.Test/Repro obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 33 (0x21) .maxstack 5 .locals init (valuetype Experiment.Test/Repro& V_0, @@ -107,7 +110,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -121,7 +125,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 5 .locals init (valuetype Experiment.Test/Repro V_0, @@ -155,7 +160,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 7 .locals init (int32 V_0, @@ -184,7 +190,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -197,7 +204,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 4 .locals init (object V_0, @@ -276,7 +284,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype Experiment.Test/Repro obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype Experiment.Test/Repro& V_0) @@ -293,7 +302,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.bsl index 8f04d1e815d..238ed9c3083 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.bsl @@ -66,7 +66,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StructsAsArrayElements01/T obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 46 (0x2e) .maxstack 5 .locals init (valuetype StructsAsArrayElements01/T& V_0, @@ -105,7 +106,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -119,7 +121,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 51 (0x33) .maxstack 5 .locals init (valuetype StructsAsArrayElements01/T V_0, @@ -162,7 +165,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0, @@ -197,7 +201,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -210,7 +215,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (object V_0, @@ -266,7 +272,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StructsAsArrayElements01/T obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype StructsAsArrayElements01/T& V_0) @@ -283,7 +290,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.release.bsl index 10db4563bb1..01654f7823e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/StructsAsArrayElements01.fs.il.release.bsl @@ -66,7 +66,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StructsAsArrayElements01/T obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 33 (0x21) .maxstack 5 .locals init (valuetype StructsAsArrayElements01/T& V_0, @@ -96,7 +97,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -110,7 +112,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 5 .locals init (valuetype StructsAsArrayElements01/T V_0, @@ -144,7 +147,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 7 .locals init (int32 V_0, @@ -173,7 +177,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -186,7 +191,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 4 .locals init (object V_0, @@ -233,7 +239,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StructsAsArrayElements01/T obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 18 (0x12) .maxstack 4 .locals init (valuetype StructsAsArrayElements01/T& V_0) @@ -250,7 +257,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl index 99591a2d86a..59aa70ed458 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -213,7 +214,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -227,7 +229,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -295,7 +298,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -343,7 +347,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -356,7 +361,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -413,7 +419,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -451,7 +458,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -544,7 +552,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -586,7 +595,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -599,7 +609,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -662,7 +673,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -706,7 +718,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -858,7 +871,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -873,6 +886,7 @@ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -935,6 +949,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -949,6 +964,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -1017,6 +1033,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1065,6 +1082,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1078,6 +1096,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1135,6 +1154,7 @@ instance bool Equals(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1173,6 +1193,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1266,6 +1287,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -1308,6 +1330,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1321,6 +1344,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1384,6 +1408,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1428,6 +1453,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl index 4145b82faa6..14c1385f00b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -204,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -218,7 +220,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -277,7 +280,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -319,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -332,7 +337,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -380,7 +386,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -418,7 +425,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -511,7 +519,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -547,7 +556,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -560,7 +570,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -614,7 +625,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -658,7 +670,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -810,7 +823,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -825,6 +838,7 @@ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -878,6 +892,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -892,6 +907,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -951,6 +967,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -993,6 +1010,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1006,6 +1024,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1054,6 +1073,7 @@ instance bool Equals(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1092,6 +1112,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1185,6 +1206,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1221,6 +1243,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1234,6 +1257,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1288,6 +1312,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1332,6 +1357,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.debug.bsl index 8d7da403aad..fe9e02129fa 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.debug.bsl @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -213,7 +214,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -227,7 +229,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -295,7 +298,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -343,7 +347,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -356,7 +361,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -413,7 +419,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -451,7 +458,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -544,7 +552,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -586,7 +595,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -599,7 +609,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -662,7 +673,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -706,7 +718,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -858,7 +871,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -873,6 +886,7 @@ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -935,6 +949,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -949,6 +964,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -1017,6 +1033,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1065,6 +1082,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1078,6 +1096,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1135,6 +1154,7 @@ instance bool Equals(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1173,6 +1193,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1266,6 +1287,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -1308,6 +1330,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1321,6 +1344,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1384,6 +1408,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1428,6 +1453,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.release.bsl index 11b27d4f216..e43adbbe591 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule60.fs.il.release.bsl @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -204,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -218,7 +220,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -277,7 +280,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -319,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -332,7 +337,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -380,7 +386,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -418,7 +425,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -511,7 +519,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -547,7 +556,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -560,7 +570,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -614,7 +625,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -658,7 +670,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -810,7 +823,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -825,6 +838,7 @@ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -878,6 +892,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -892,6 +907,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -951,6 +967,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -993,6 +1010,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1006,6 +1024,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1054,6 +1073,7 @@ instance bool Equals(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1092,6 +1112,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1185,6 +1206,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1221,6 +1243,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1234,6 +1257,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1288,6 +1312,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1332,6 +1357,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl index 44992dcf054..090e268304a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,7 +146,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -208,7 +209,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -222,7 +224,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -290,7 +293,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -338,7 +342,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -351,7 +356,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -408,7 +414,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -446,7 +453,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -539,7 +547,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -581,7 +590,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -594,7 +604,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -657,7 +668,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -701,7 +713,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -853,7 +866,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -867,7 +880,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -929,7 +943,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -943,7 +958,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -1011,7 +1027,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1059,7 +1076,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1072,7 +1090,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1129,7 +1148,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1167,7 +1187,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1260,7 +1281,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -1302,7 +1324,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1315,7 +1338,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1378,7 +1402,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1422,7 +1447,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1574,7 +1600,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1589,6 +1615,7 @@ instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1651,6 +1678,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1665,6 +1693,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1733,6 +1762,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1781,6 +1811,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1794,6 +1825,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1851,6 +1883,7 @@ instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1889,6 +1922,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1982,6 +2016,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -2024,6 +2059,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -2037,6 +2073,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -2100,6 +2137,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2144,6 +2182,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl index c26c87956ab..6cd3bc0ed4b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,7 +146,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -199,7 +200,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -213,7 +215,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -272,7 +275,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -314,7 +318,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -327,7 +332,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -375,7 +381,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -413,7 +420,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -506,7 +514,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -542,7 +551,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -555,7 +565,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -609,7 +620,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -653,7 +665,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -805,7 +818,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -819,7 +832,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -872,7 +886,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -886,7 +901,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -945,7 +961,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -987,7 +1004,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1000,7 +1018,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1048,7 +1067,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1086,7 +1106,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1179,7 +1200,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1215,7 +1237,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1228,7 +1251,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1282,7 +1306,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1326,7 +1351,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1478,7 +1504,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1493,6 +1519,7 @@ instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1546,6 +1573,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1560,6 +1588,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1619,6 +1648,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -1661,6 +1691,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1674,6 +1705,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1722,6 +1754,7 @@ instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1760,6 +1793,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1853,6 +1887,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1889,6 +1924,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1902,6 +1938,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1956,6 +1993,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2000,6 +2038,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.debug.bsl index 6e7e3c29032..9a1e6201eee 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.debug.bsl @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,7 +146,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -208,7 +209,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -222,7 +224,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -290,7 +293,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -338,7 +342,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -351,7 +356,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -408,7 +414,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -446,7 +453,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -539,7 +547,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -581,7 +590,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -594,7 +604,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -657,7 +668,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -701,7 +713,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -853,7 +866,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -867,7 +880,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -929,7 +943,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -943,7 +958,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -1011,7 +1027,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1059,7 +1076,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1072,7 +1090,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1129,7 +1148,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1167,7 +1187,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1260,7 +1281,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -1302,7 +1324,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1315,7 +1338,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1378,7 +1402,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1422,7 +1447,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1574,7 +1600,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1589,6 +1615,7 @@ instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1651,6 +1678,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1665,6 +1693,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1733,6 +1762,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, @@ -1781,6 +1811,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1794,6 +1825,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1851,6 +1883,7 @@ instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1889,6 +1922,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1982,6 +2016,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, @@ -2024,6 +2059,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -2037,6 +2073,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -2100,6 +2137,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2144,6 +2182,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.release.bsl index 1728bb5cb5f..76a96aeb4a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace60.fs.il.release.bsl @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,7 +146,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -199,7 +200,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -213,7 +215,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -272,7 +275,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -314,7 +318,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -327,7 +332,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -375,7 +381,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -413,7 +420,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -506,7 +514,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -542,7 +551,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -555,7 +565,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -609,7 +620,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -653,7 +665,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -805,7 +818,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -819,7 +832,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -872,7 +886,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -886,7 +901,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -945,7 +961,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -987,7 +1004,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1000,7 +1018,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1048,7 +1067,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1086,7 +1106,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1179,7 +1200,8 @@ .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1215,7 +1237,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1228,7 +1251,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1282,7 +1306,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1326,7 +1351,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1478,7 +1504,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1493,6 +1519,7 @@ instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1546,6 +1573,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1560,6 +1588,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1619,6 +1648,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -1661,6 +1691,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1674,6 +1705,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1722,6 +1754,7 @@ instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1760,6 +1793,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1853,6 +1887,7 @@ GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1889,6 +1924,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1902,6 +1938,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1956,6 +1993,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2000,6 +2038,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Class01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Class01.fs.il.bsl index faa7c410084..c6261418230 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Class01.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Class01.fs.il.bsl @@ -72,7 +72,8 @@ .method assembly static int32 f() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 8 IL_0000: nop diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.debug.bsl index 89018defc65..d82858315ba 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.debug.bsl @@ -72,7 +72,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 34 (0x22) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0, @@ -102,7 +103,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -116,7 +118,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C V_0, @@ -150,7 +153,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -179,7 +183,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -192,7 +197,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0, @@ -248,7 +254,8 @@ .method assembly static int32 f() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 8 IL_0000: nop @@ -273,7 +280,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 21 (0x15) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0) @@ -291,7 +299,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.release.bsl index c7abcb4d473..4539655457a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.net472.release.bsl @@ -72,7 +72,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0, @@ -93,7 +94,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -107,7 +109,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C V_0, @@ -132,7 +135,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -161,7 +165,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -174,7 +179,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 45 (0x2d) .maxstack 4 .locals init (object V_0, @@ -221,7 +227,8 @@ .method assembly static int32 f() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 8 IL_0000: nop @@ -246,7 +253,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 21 (0x15) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0) @@ -264,7 +272,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.debug.bsl index 12c38b58444..ead8a45682f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.debug.bsl @@ -72,7 +72,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 34 (0x22) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0, @@ -102,7 +103,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -116,7 +118,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C V_0, @@ -150,7 +153,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -179,7 +183,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -192,7 +197,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0, @@ -248,7 +254,8 @@ .method assembly static int32 f() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 8 IL_0000: nop @@ -273,7 +280,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 21 (0x15) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0) @@ -291,7 +299,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.release.bsl index a1562b9e802..ddfbd24e58a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticInit/StaticInit_Struct01.fs.il.netcore.release.bsl @@ -72,7 +72,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 27 (0x1b) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0, @@ -93,7 +94,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -107,7 +109,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C V_0, @@ -132,7 +135,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -161,7 +165,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -174,7 +179,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 45 (0x2d) .maxstack 4 .locals init (object V_0, @@ -221,7 +227,8 @@ .method assembly static int32 f() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 8 IL_0000: nop @@ -246,7 +253,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype StaticInit_Struct01/C obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 21 (0x15) .maxstack 4 .locals init (valuetype StaticInit_Struct01/C& V_0) @@ -264,7 +272,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.debug.bsl index e42c7b62351..a5c03745dd1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.debug.bsl @@ -191,7 +191,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -205,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -250,7 +251,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -264,7 +266,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -315,7 +318,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -335,7 +339,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -348,7 +353,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -391,7 +397,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -427,7 +434,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.release.bsl index 5ffc41a960c..7add7601037 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.net472.release.bsl @@ -191,7 +191,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -205,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -250,7 +251,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -264,7 +266,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -315,7 +318,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -335,7 +339,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -348,7 +353,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -391,7 +397,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -427,7 +434,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.debug.bsl index b8d7892bda5..0f0c9fcad38 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.debug.bsl @@ -196,7 +196,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -210,7 +210,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -255,7 +256,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -269,7 +271,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -320,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -340,7 +344,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -353,7 +358,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -396,7 +402,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -432,7 +439,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.release.bsl index 7ce83c40b7a..8f493f6b71a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch06.fs.il.netcore.release.bsl @@ -196,7 +196,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -210,7 +210,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -255,7 +256,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -269,7 +271,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -320,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -340,7 +344,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -353,7 +358,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0, @@ -396,7 +402,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch06/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -432,7 +439,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch06/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.debug.bsl index d6b3c82987d..154e53cad56 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.debug.bsl @@ -191,7 +191,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -205,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -250,7 +251,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -264,7 +266,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -315,7 +318,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -335,7 +339,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -348,7 +353,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -391,7 +397,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -427,7 +434,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.release.bsl index 7bf9ed58e07..d3137774417 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.net472.release.bsl @@ -191,7 +191,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -205,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -250,7 +251,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -264,7 +266,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -315,7 +318,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -335,7 +339,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -348,7 +353,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -391,7 +397,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -427,7 +434,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.debug.bsl index 516cc8f4b32..189164a4b7b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.debug.bsl @@ -196,7 +196,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -210,7 +210,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -255,7 +256,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -269,7 +271,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -320,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -340,7 +344,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -353,7 +358,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -396,7 +402,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -432,7 +439,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.release.bsl index cff1286f862..8e47f0de778 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SteppingMatch/SteppingMatch07.fs.il.netcore.release.bsl @@ -196,7 +196,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -210,7 +210,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (int32 V_0, @@ -255,7 +256,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -269,7 +271,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -320,7 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 3 .locals init (int32 V_0) @@ -340,7 +344,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -353,7 +358,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 44 (0x2c) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0, @@ -396,7 +402,8 @@ .method public hidebysig virtual final instance bool Equals(class SteppingMatch07/Discr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 35 (0x23) .maxstack 4 .locals init (int32 V_0, @@ -432,7 +439,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class SteppingMatch07/Discr V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs index ccb94a97e50..89fa1ffc061 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StructGettersReadOnly.fs @@ -33,6 +33,8 @@ module ``Struct getters readonly`` = instance int32 get_MyField() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -65,6 +67,8 @@ module ``Struct getters readonly`` = .method public hidebysig specialname instance int32 get_MyField() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl index 0e84741e970..47a70fee5bc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.debug.bsl @@ -65,7 +65,9 @@ .method public hidebysig specialname instance float64 get_F() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -76,7 +78,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype floatsanddoubles/Float obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 76 (0x4c) .maxstack 5 .locals init (valuetype floatsanddoubles/Float& V_0, @@ -139,7 +142,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -153,7 +157,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (valuetype floatsanddoubles/Float V_0, @@ -220,7 +225,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -249,7 +255,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -262,7 +269,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (object V_0, @@ -318,7 +326,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype floatsanddoubles/Float obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 4 .locals init (valuetype floatsanddoubles/Float& V_0, @@ -364,7 +373,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, @@ -410,7 +420,9 @@ .method public hidebysig specialname instance float64 get_D() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -421,7 +433,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype floatsanddoubles/Double obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 76 (0x4c) .maxstack 5 .locals init (valuetype floatsanddoubles/Double& V_0, @@ -484,7 +497,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -498,7 +512,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (valuetype floatsanddoubles/Double V_0, @@ -565,7 +580,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -594,7 +610,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -607,7 +624,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (object V_0, @@ -663,7 +681,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype floatsanddoubles/Double obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 4 .locals init (valuetype floatsanddoubles/Double& V_0, @@ -709,7 +728,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl index 9d6c3245635..b1409aea228 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/FloatsAndDoubles.fs.il.release.bsl @@ -65,7 +65,9 @@ .method public hidebysig specialname instance float64 get_F() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -76,7 +78,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype floatsanddoubles/Float obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 58 (0x3a) .maxstack 5 .locals init (valuetype floatsanddoubles/Float& V_0, @@ -130,7 +133,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -144,7 +148,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (valuetype floatsanddoubles/Float V_0, @@ -202,7 +207,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -231,7 +237,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -244,7 +251,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 4 .locals init (object V_0, @@ -291,7 +299,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype floatsanddoubles/Float obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (valuetype floatsanddoubles/Float& V_0, @@ -331,7 +340,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, @@ -377,7 +387,9 @@ .method public hidebysig specialname instance float64 get_D() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -388,7 +400,8 @@ .method public hidebysig virtual final instance int32 CompareTo(valuetype floatsanddoubles/Double obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 58 (0x3a) .maxstack 5 .locals init (valuetype floatsanddoubles/Double& V_0, @@ -442,7 +455,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -456,7 +470,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (valuetype floatsanddoubles/Double V_0, @@ -514,7 +529,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 31 (0x1f) .maxstack 7 .locals init (int32 V_0) @@ -543,7 +559,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -556,7 +573,8 @@ 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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 4 .locals init (object V_0, @@ -603,7 +621,8 @@ .method public hidebysig virtual final instance bool Equals(valuetype floatsanddoubles/Double obj) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 39 (0x27) .maxstack 4 .locals init (valuetype floatsanddoubles/Double& V_0, @@ -643,7 +662,8 @@ .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 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 30 (0x1e) .maxstack 4 .locals init (object V_0, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.debug.bsl index 298db7135ad..5b3b0c9ce9c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.debug.bsl @@ -160,7 +160,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -174,7 +174,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction16/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 132 (0x84) .maxstack 5 .locals init (class TestFunction16/U V_0, @@ -279,7 +280,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -293,7 +295,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 140 (0x8c) .maxstack 5 .locals init (class TestFunction16/U V_0, @@ -404,7 +407,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 75 (0x4b) .maxstack 7 .locals init (int32 V_0, @@ -474,7 +478,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -487,7 +492,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 94 (0x5e) .maxstack 4 .locals init (class TestFunction16/U V_0, @@ -566,7 +572,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction16/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class TestFunction16/U V_0, @@ -613,7 +620,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction16/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.release.bsl index 9187098dbfe..e14dd1cf9a4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.release.bsl @@ -160,7 +160,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -174,7 +174,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction16/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 106 (0x6a) .maxstack 5 .locals init (class TestFunction16/U V_0, @@ -261,7 +262,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -275,7 +277,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 116 (0x74) .maxstack 5 .locals init (class TestFunction16/U V_0, @@ -368,7 +371,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 7 .locals init (int32 V_0, @@ -426,7 +430,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -439,7 +444,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 4 .locals init (class TestFunction16/U V_0, @@ -500,7 +506,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction16/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class TestFunction16/U V_0, @@ -547,7 +554,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction16/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl index de3a5062203..e6af44a0c80 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl @@ -70,6 +70,8 @@ .method public hidebysig specialname instance int32 get_x() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -80,6 +82,8 @@ .method public hidebysig specialname instance int32 get_y() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -107,7 +111,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -121,7 +125,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction17/R obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 119 (0x77) .maxstack 5 .locals init (int32 V_0, @@ -218,7 +223,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -232,7 +238,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 134 (0x86) .maxstack 5 .locals init (class TestFunction17/R V_0, @@ -338,7 +345,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 68 (0x44) .maxstack 7 .locals init (int32 V_0, @@ -401,7 +409,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -414,7 +423,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 84 (0x54) .maxstack 4 .locals init (class TestFunction17/R V_0, @@ -485,7 +495,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction17/R obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -524,7 +535,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction17/R V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl index 17ff542c4ed..9499c69d0fe 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl @@ -70,6 +70,8 @@ .method public hidebysig specialname instance int32 get_x() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -80,6 +82,8 @@ .method public hidebysig specialname instance int32 get_y() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -107,7 +111,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -121,7 +125,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction17/R obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 94 (0x5e) .maxstack 5 .locals init (int32 V_0, @@ -200,7 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -214,7 +220,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 111 (0x6f) .maxstack 5 .locals init (class TestFunction17/R V_0, @@ -302,7 +309,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 55 (0x37) .maxstack 7 .locals init (int32 V_0, @@ -353,7 +361,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -366,7 +375,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 62 (0x3e) .maxstack 4 .locals init (class TestFunction17/R V_0, @@ -419,7 +429,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction17/R obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -458,7 +469,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction17/R V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl index 2e57790c2de..3ddb1517a23 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl @@ -114,7 +114,8 @@ .method assembly hidebysig instance int32 f(int32 a) cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.debug.bsl index 6edae290c3b..d99120f8ce0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.debug.bsl @@ -160,7 +160,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -174,7 +174,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction21/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 132 (0x84) .maxstack 5 .locals init (class TestFunction21/U V_0, @@ -279,7 +280,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -293,7 +295,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 140 (0x8c) .maxstack 5 .locals init (class TestFunction21/U V_0, @@ -404,7 +407,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 75 (0x4b) .maxstack 7 .locals init (int32 V_0, @@ -474,7 +478,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -487,7 +492,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 94 (0x5e) .maxstack 4 .locals init (class TestFunction21/U V_0, @@ -566,7 +572,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction21/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class TestFunction21/U V_0, @@ -613,7 +620,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction21/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.release.bsl index b27ba780bfe..9006f275cc3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.release.bsl @@ -160,7 +160,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -174,7 +174,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction21/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 106 (0x6a) .maxstack 5 .locals init (class TestFunction21/U V_0, @@ -261,7 +262,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -275,7 +277,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 116 (0x74) .maxstack 5 .locals init (class TestFunction21/U V_0, @@ -368,7 +371,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 7 .locals init (int32 V_0, @@ -426,7 +430,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -439,7 +444,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 4 .locals init (class TestFunction21/U V_0, @@ -500,7 +506,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction21/U obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 53 (0x35) .maxstack 4 .locals init (class TestFunction21/U V_0, @@ -547,7 +554,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction21/U V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl index 002f4add877..88bfbd3b84d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl @@ -96,7 +96,8 @@ .method assembly hidebysig instance string g() cil managed { - .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl index 82f208f59c8..ad24a3cbbfb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl @@ -101,7 +101,8 @@ .method assembly hidebysig instance string g() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl index 6047356613b..53a8f9c56b5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl @@ -70,6 +70,8 @@ .method public hidebysig specialname instance int32 get_x() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -80,6 +82,8 @@ .method public hidebysig specialname instance int32 get_y() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -90,6 +94,8 @@ .method public hidebysig specialname instance void set_x(int32 'value') cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 @@ -101,6 +107,8 @@ .method public hidebysig specialname instance void set_y(int32 'value') cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 @@ -129,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -143,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction24/Point obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 119 (0x77) .maxstack 5 .locals init (int32 V_0, @@ -240,7 +249,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -254,7 +264,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 134 (0x86) .maxstack 5 .locals init (class TestFunction24/Point V_0, @@ -360,7 +371,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 68 (0x44) .maxstack 7 .locals init (int32 V_0, @@ -423,7 +435,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -436,7 +449,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 84 (0x54) .maxstack 4 .locals init (class TestFunction24/Point V_0, @@ -507,7 +521,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction24/Point obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -546,7 +561,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction24/Point V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl index 97404f6bb4a..c82433ad3e5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl @@ -70,6 +70,8 @@ .method public hidebysig specialname instance int32 get_x() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -80,6 +82,8 @@ .method public hidebysig specialname instance int32 get_y() cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -90,6 +94,8 @@ .method public hidebysig specialname instance void set_x(int32 'value') cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 @@ -101,6 +107,8 @@ .method public hidebysig specialname instance void set_y(int32 'value') cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 @@ -129,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -143,7 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class TestFunction24/Point obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 94 (0x5e) .maxstack 5 .locals init (int32 V_0, @@ -222,7 +231,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -236,7 +246,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 111 (0x6f) .maxstack 5 .locals init (class TestFunction24/Point V_0, @@ -324,7 +335,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 55 (0x37) .maxstack 7 .locals init (int32 V_0, @@ -375,7 +387,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -388,7 +401,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 62 (0x3e) .maxstack 4 .locals init (class TestFunction24/Point V_0, @@ -441,7 +455,8 @@ .method public hidebysig virtual final instance bool Equals(class TestFunction24/Point obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 47 (0x2f) .maxstack 8 IL_0000: ldarg.0 @@ -480,7 +495,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class TestFunction24/Point V_0) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 6ca61dc0c02..8ff0d9ce1db 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -88,6 +88,7 @@ + diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 2c377bad439..2fc56c7d3f9 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -7495,10 +7495,12 @@ FSharp.Compiler.Syntax.SynMemberDefn: Int32 get_Tag() FSharp.Compiler.Syntax.SynMemberDefn: System.String ToString() FSharp.Compiler.Syntax.SynMemberFlags FSharp.Compiler.Syntax.SynMemberFlags: Boolean Equals(System.Object) +FSharp.Compiler.Syntax.SynMemberFlags: Boolean GetterOrSetterIsCompilerGenerated FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsDispatchSlot FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsFinal FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsInstance FSharp.Compiler.Syntax.SynMemberFlags: Boolean IsOverrideOrExplicitImpl +FSharp.Compiler.Syntax.SynMemberFlags: Boolean get_GetterOrSetterIsCompilerGenerated() FSharp.Compiler.Syntax.SynMemberFlags: Boolean get_IsDispatchSlot() FSharp.Compiler.Syntax.SynMemberFlags: Boolean get_IsFinal() FSharp.Compiler.Syntax.SynMemberFlags: Boolean get_IsInstance() @@ -7509,7 +7511,7 @@ FSharp.Compiler.Syntax.SynMemberFlags: FSharp.Compiler.SyntaxTrivia.SynMemberFla FSharp.Compiler.Syntax.SynMemberFlags: FSharp.Compiler.SyntaxTrivia.SynMemberFlagsTrivia get_Trivia() FSharp.Compiler.Syntax.SynMemberFlags: Int32 GetHashCode() FSharp.Compiler.Syntax.SynMemberFlags: System.String ToString() -FSharp.Compiler.Syntax.SynMemberFlags: Void .ctor(Boolean, Boolean, Boolean, Boolean, FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.SyntaxTrivia.SynMemberFlagsTrivia) +FSharp.Compiler.Syntax.SynMemberFlags: Void .ctor(Boolean, Boolean, Boolean, Boolean, Boolean, FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.SyntaxTrivia.SynMemberFlagsTrivia) FSharp.Compiler.Syntax.SynMemberKind FSharp.Compiler.Syntax.SynMemberKind+Tags: Int32 ClassConstructor FSharp.Compiler.Syntax.SynMemberKind+Tags: Int32 Constructor @@ -11051,4 +11053,4 @@ FSharp.Compiler.Xml.XmlDoc: System.String GetXmlText() FSharp.Compiler.Xml.XmlDoc: System.String[] GetElaboratedXmlLines() FSharp.Compiler.Xml.XmlDoc: System.String[] UnprocessedLines FSharp.Compiler.Xml.XmlDoc: System.String[] get_UnprocessedLines() -FSharp.Compiler.Xml.XmlDoc: Void .ctor(System.String[], FSharp.Compiler.Text.Range) \ No newline at end of file +FSharp.Compiler.Xml.XmlDoc: Void .ctor(System.String[], FSharp.Compiler.Text.Range) diff --git a/tests/FSharp.Test.Utilities/ReflectionHelper.fs b/tests/FSharp.Test.Utilities/ReflectionHelper.fs index 5759752c706..65d501c1eda 100644 --- a/tests/FSharp.Test.Utilities/ReflectionHelper.fs +++ b/tests/FSharp.Test.Utilities/ReflectionHelper.fs @@ -35,14 +35,14 @@ let getMethod methodName (ty: Type) = /// Assert that function f returns Ok for given input let should f x y = match f x y with - | Ok _ -> () + | Ok _ -> y | Error message -> failwith $"%s{message} but it should" /// Assert that function f doesn't return Ok for given input let shouldn't f x y = match f x y with | Ok message -> failwith $"%s{message} but it shouldn't" - | Error _ -> () + | Error _ -> y /// Verify the object contains a custom attribute with the given name. E.g. "ObsoleteAttribute" let haveAttribute attrName thingy = diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 864ce6f93c0..099369d37c1 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -194,7 +194,9 @@ module Nested = .method public hidebysig specialname instance int32 get_x() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -222,7 +224,8 @@ module Nested = .method public hidebysig virtual final instance int32 CompareTo(class ReferenceAssembly/Nested/Test obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -232,7 +235,8 @@ module Nested = .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -243,7 +247,8 @@ module Nested = instance int32 CompareTo(object obj, class [runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -253,7 +258,8 @@ module Nested = .method public hidebysig virtual final instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -263,7 +269,8 @@ module Nested = .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -274,7 +281,8 @@ module Nested = instance bool Equals(object obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -284,7 +292,8 @@ module Nested = .method public hidebysig virtual final instance bool Equals(class ReferenceAssembly/Nested/Test obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -294,7 +303,8 @@ module Nested = .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -529,7 +539,9 @@ type MySecondaryAttribute() = .method assembly hidebysig specialname instance int32 get_Prop1() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -538,7 +550,9 @@ type MySecondaryAttribute() = .method assembly hidebysig specialname instance void set_Prop1(int32 v) cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -564,7 +578,9 @@ type MySecondaryAttribute() = .method assembly hidebysig specialname instance int32 get_Prop1() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -573,7 +589,9 @@ type MySecondaryAttribute() = .method assembly hidebysig specialname instance void set_Prop1(int32 v) cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -670,7 +688,9 @@ type MType() = .method public hidebysig specialname instance int32 get_PubProp1() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -679,7 +699,9 @@ type MType() = .method public hidebysig specialname instance void set_PubProp1(int32 v) cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw @@ -736,7 +758,7 @@ type CustomAttribute(smth: bool) = inherit Attribute() internal new () = CustomAttribute(false) member _.Something = smth - + type Person(name : string, age : int) = [] member val Name = name with get, set @@ -751,106 +773,114 @@ type Person(name : string, age : int) = """.class auto ansi serializable sealed nested public CustomAttribute extends [runtime]System.Attribute { - .custom instance void [runtime]System.AttributeUsageAttribute::.ctor(valuetype [runtime]System.AttributeTargets) = ( 01 00 C0 00 00 00 01 00 54 02 0D 41 6C 6C 6F 77 - 4D 75 6C 74 69 70 6C 65 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.SealedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .custom instance void [runtime]System.AttributeUsageAttribute::.ctor(valuetype [runtime]System.AttributeTargets) = ( 01 00 C0 00 00 00 01 00 54 02 0D 41 6C 6C 6F 77 + 4D 75 6C 74 69 70 6C 65 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.SealedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly bool smth - .method public specialname rtspecialname + .method public specialname rtspecialname instance void .ctor(bool smth) cil managed { - + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method assembly specialname rtspecialname + .method assembly specialname rtspecialname instance void .ctor() cil managed { - + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance bool get_Something() cil managed { - + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - } + } .class auto ansi serializable nested public Person extends [runtime]System.Object { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public specialname rtspecialname + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(string name, int32 age) cil managed { - + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance string get_Name() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance void set_Name(string v) cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance int32 get_Age() cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance void set_Age(int32 v) cil managed { - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw - } + } .property instance bool Something() { .get instance bool ReferenceAssembly/CustomAttribute::get_Something() - } + } .property instance string Name() { - .custom instance void ReferenceAssembly/CustomAttribute::.ctor(bool) = ( 01 00 01 00 00 ) + .custom instance void ReferenceAssembly/CustomAttribute::.ctor(bool) = ( 01 00 01 00 00 ) .set instance void ReferenceAssembly/Person::set_Name(string) .get instance string ReferenceAssembly/Person::get_Name() - } + } .property instance int32 Age() { - .custom instance void ReferenceAssembly/CustomAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void ReferenceAssembly/CustomAttribute::.ctor() = ( 01 00 00 00 ) .set instance void ReferenceAssembly/Person::set_Age(int32) .get instance int32 ReferenceAssembly/Person::get_Age() - } + } }""" ] - // TODO: Add tests for internal functions, types, interfaces, abstract types (with and without IVTs), (private, internal, public) fields, properties (+ different visibility for getters and setters), events. \ No newline at end of file + // TODO: Add tests for internal functions, types, interfaces, abstract types (with and without IVTs), (private, internal, public) fields, properties (+ different visibility for getters and setters), events. diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs index 24137545abe..2b0232dc852 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs @@ -1100,7 +1100,8 @@ type Generic1InGeneric1<'T>() = .method assembly hidebysig instance class [runtime]System.Threading.Tasks.Task`1 run(class [runtime]System.Threading.Tasks.Task`1 computation) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 4 .locals init (valuetype Test/clo@7 V_0, @@ -1375,4 +1376,3 @@ module ``SRTP ReturnFrom on a ValueTask is still generic in the bind type`` = let t1 : Task = TryFindAsync() // test TryFindAsync is generic let t2 : Task = TryFindAsync() // test TryFindAsync is generic - From e1f735546a907b0a511b818f10829b1d75139021 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 28 Jul 2022 18:24:14 +0100 Subject: [PATCH 067/226] SynType with single slash and type (#13440) * Update pars.fsy WIP * Update SynType.Tuple to catpture the division edgecase * Update pars.fsy amd Helper to reflect the Star and Division * WIP Update where SynTyp.Tuple is being use and fix build locally * Include firstType when used on Services and fix formatting * Introduce TupleTypeSegment to SynType.Tuple. * Update CheckDeclaration * Update SurfaceArea * Non measure kinds are not measures. * Code clean up * Rename Parser helper function, update pars.fsy , Add more testing * Rename TupleTypeSegment to SynTupleTypeSegment. Co-authored-by: nojaf --- src/Compiler/Checking/CheckExpressions.fs | 46 +++++++---- src/Compiler/Service/ServiceParseTreeWalk.fs | 2 +- src/Compiler/Service/ServiceParsedInputOps.fs | 4 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 12 +++ src/Compiler/SyntaxTree/ParseHelpers.fsi | 2 + src/Compiler/SyntaxTree/SyntaxTree.fs | 14 +++- src/Compiler/SyntaxTree/SyntaxTree.fsi | 14 ++-- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 6 ++ src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 2 + src/Compiler/pars.fsy | 40 +++++++--- ...erService.SurfaceArea.netstandard.expected | 34 +++++++- tests/service/ServiceUntypedParseTests.fs | 5 +- tests/service/SyntaxTreeTests/MeasureTests.fs | 78 ++++++++++++++++++- 13 files changed, 217 insertions(+), 42 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 7004439ef01..f301fcaf7a4 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4538,8 +4538,8 @@ and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env (tpenv: Unscoped | SynType.LongIdentApp (synLeftTy, synLongId, _, args, _commas, _, m) -> TcNestedAppType cenv newOk checkConstraints occ env tpenv synLeftTy synLongId args m - | SynType.Tuple(isStruct, args, m) -> - TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct args m + | SynType.Tuple(isStruct, segments, m) -> + TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct segments m | SynType.AnonRecd(_, [],m) -> error(Error((FSComp.SR.tcAnonymousTypeInvalidInDeclaration()), m)) @@ -4649,8 +4649,7 @@ and TcNestedAppType cenv newOk checkConstraints occ env tpenv synLeftTy synLongI | _ -> error(Error(FSComp.SR.tcTypeHasNoNestedTypes(), m)) -and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct args m = - +and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct (args: SynTupleTypeSegment list) m = let tupInfo = mkTupInfo isStruct if isStruct then let argsR,tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m @@ -4659,8 +4658,9 @@ and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct args let isMeasure = match kindOpt with | Some TyparKind.Measure -> true - | None -> List.exists (fun (isquot,_) -> isquot) args | _ -> false - + | None -> args |> List.exists(function | SynTupleTypeSegment.Slash _ -> true | _ -> false) + | Some _ -> false + if isMeasure then let ms,tpenv = TcMeasuresAsTuple cenv newOk checkConstraints occ env tpenv args m TType_measure ms,tpenv @@ -4670,7 +4670,7 @@ and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct args and TcAnonRecdType cenv newOk checkConstraints occ env tpenv isStruct args m = let tupInfo = mkTupInfo isStruct - let tup = args |> List.map snd |> List.map (fun x -> (false, x)) + let tup = args |> List.map (fun (_, t) -> SynTupleTypeSegment.Type t) let argsR,tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv tup m let unsortedFieldIds = args |> List.map fst |> List.toArray let anonInfo = AnonRecdTypeInfo.Create(cenv.thisCcu, tupInfo, unsortedFieldIds) @@ -4808,25 +4808,39 @@ and TcAnonTypeOrMeasure kindOpt _cenv rigid dyn newOk m = and TcTypes cenv newOk checkConstraints occ env tpenv args = List.mapFold (TcTypeAndRecover cenv newOk checkConstraints occ env) tpenv args -and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m = +and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv (args: SynTupleTypeSegment list) m = + let hasASlash = + args + |> List.exists(function | SynTupleTypeSegment.Slash _ -> true | _ -> false) + + if hasASlash then errorR(Error(FSComp.SR.tcUnexpectedSlashInType(), m)) + + let args : SynType list = getTypeFromTuplePath args match args with | [] -> error(InternalError("empty tuple type", m)) - | [(_, ty)] -> let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty in [ty], tpenv - | (isquot, ty) :: args -> + | [ty] -> let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty in [ty], tpenv + | ty :: args -> let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty + let args = List.map SynTupleTypeSegment.Type args let tys, tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m - if isquot then errorR(Error(FSComp.SR.tcUnexpectedSlashInType(), m)) ty :: tys, tpenv // Type-check a list of measures separated by juxtaposition, * or / -and TcMeasuresAsTuple cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) args m = - let rec gather args tpenv isquot acc = +and TcMeasuresAsTuple cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (args: SynTupleTypeSegment list) m = + let rec gather (args: SynTupleTypeSegment list) tpenv acc = match args with | [] -> acc, tpenv - | (nextisquot, ty) :: args -> + | SynTupleTypeSegment.Type ty :: args -> + let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m + gather args tpenv ms1 + | SynTupleTypeSegment.Star _ :: SynTupleTypeSegment.Type ty :: args -> + let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m + gather args tpenv (Measure.Prod(acc, ms1)) + | SynTupleTypeSegment.Slash _ :: SynTupleTypeSegment.Type ty :: args -> let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m - gather args tpenv nextisquot (if isquot then Measure.Prod(acc, Measure.Inv ms1) else Measure.Prod(acc, ms1)) - gather args tpenv false Measure.One + gather args tpenv (Measure.Prod(acc, Measure.Inv ms1)) + | _ -> failwith "inpossible" + gather args tpenv Measure.One and TcTypesOrMeasures optKinds cenv newOk checkConstraints occ env tpenv args m = match optKinds with diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index e2eedc9ba47..6e4812eeb6d 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -819,7 +819,7 @@ module SyntaxTraversal = | SynType.Array (_, ty, _) -> traverseSynType path ty | SynType.StaticConstantNamed (ty1, ty2, _) | SynType.MeasureDivide (ty1, ty2, _) -> [ ty1; ty2 ] |> List.tryPick (traverseSynType path) - | SynType.Tuple (_, tys, _) -> tys |> List.map snd |> List.tryPick (traverseSynType path) + | SynType.Tuple (path = segments) -> getTypeFromTuplePath segments |> List.tryPick (traverseSynType path) | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr | SynType.Anon _ -> None | _ -> None diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index a7ffb760e5a..662a420ae0b 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -661,7 +661,7 @@ module ParsedInput = None | SynType.App (ty, _, types, _, _, _, _) -> walkType ty |> Option.orElseWith (fun () -> List.tryPick walkType types) | SynType.LongIdentApp (_, _, _, types, _, _, _) -> List.tryPick walkType types - | SynType.Tuple (_, ts, _) -> ts |> List.tryPick (fun (_, t) -> walkType t) + | SynType.Tuple (path = segments) -> getTypeFromTuplePath segments |> List.tryPick walkType | SynType.Array (_, t, _) -> walkType t | SynType.Fun (argType = t1; returnType = t2) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.WithGlobalConstraints (t, _, _) -> walkType t @@ -1669,7 +1669,7 @@ module ParsedInput = walkType ty List.iter walkType types | SynType.LongIdentApp (_, _, _, types, _, _, _) -> List.iter walkType types - | SynType.Tuple (_, ts, _) -> ts |> List.iter (fun (_, t) -> walkType t) + | SynType.Tuple (path = segment) -> getTypeFromTuplePath segment |> List.iter walkType | SynType.WithGlobalConstraints (t, typeConstraints, _) -> walkType t List.iter walkTypeConstraint typeConstraints diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index ff7a44e98a4..4cb172651ad 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -811,3 +811,15 @@ let mkSynMemberDefnGetSet [] | _ -> [] | _ -> [] + +// The last element of elementTypes does not have a star or slash +let mkSynTypeTuple (isStruct: bool) (elementTypes: SynTupleTypeSegment list) : SynType = + let range = + match elementTypes with + | [] -> Range.Zero + | head :: tail -> + + (head.Range, tail) + ||> List.fold (fun acc segment -> unionRanges acc segment.Range) + + SynType.Tuple(isStruct, elementTypes, range) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index c240ab124e5..e84c3759fbe 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -175,3 +175,5 @@ val mkSynMemberDefnGetSet: attrs: SynAttributeList list -> rangeStart: range -> SynMemberDefn list + +val mkSynTypeTuple: isStruct: bool -> elementTypes: SynTupleTypeSegment list -> SynType diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 2ea6674327b..9926d7d61fa 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -369,6 +369,18 @@ type SynTyparDecls = | PrefixList (range = range) -> range | SinglePrefix (range = range) -> range +[] +type SynTupleTypeSegment = + | Type of typeName: SynType + | Star of range: range + | Slash of range: range + + member this.Range = + match this with + | SynTupleTypeSegment.Type t -> t.Range + | SynTupleTypeSegment.Star (range = range) + | SynTupleTypeSegment.Slash (range = range) -> range + [] type SynType = @@ -392,7 +404,7 @@ type SynType = greaterRange: range option * range: range - | Tuple of isStruct: bool * elementTypes: (bool * SynType) list * range: range + | Tuple of isStruct: bool * path: SynTupleTypeSegment list * range: range | AnonRecd of isStruct: bool * fields: (Ident * SynType) list * range: range diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 0a5af4cf455..874518d28ba 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -427,6 +427,14 @@ type SynTyparDecls = member Constraints: SynTypeConstraint list member Range: range +[] +type SynTupleTypeSegment = + | Type of typeName: SynType + | Star of range: range + | Slash of range: range + + member Range: range + /// Represents a syntax tree for F# types [] type SynType = @@ -457,11 +465,7 @@ type SynType = /// F# syntax: type * ... * type /// F# syntax: struct (type * ... * type) - | Tuple of - // the bool is true if / rather than * follows the type - isStruct: bool * - elementTypes: (bool * SynType) list * - range: range + | Tuple of isStruct: bool * path: SynTupleTypeSegment list * range: range /// F# syntax: {| id: type; ...; id: type |} /// F# syntax: struct {| id: type; ...; id: type |} diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 8898e2345cd..b620ab7985f 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1023,3 +1023,9 @@ let rec desugarGetSetMembers (memberDefns: SynMemberDefns) = let members = Option.map desugarGetSetMembers members [ SynMemberDefn.Interface(interfaceType, withKeyword, members, m) ] | md -> [ md ]) + +let getTypeFromTuplePath (path: SynTupleTypeSegment list) : SynType list = + path + |> List.choose (function + | SynTupleTypeSegment.Type t -> Some t + | _ -> None) diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 0c7010b40fa..7af4403fac2 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -344,3 +344,5 @@ val mkDynamicArgExpr: expr: SynExpr -> SynExpr val normalizeTupleExpr: exprs: SynExpr list -> commas: range list -> SynExpr list * range List val desugarGetSetMembers: memberDefns: SynMemberDefns -> SynMemberDefns + +val getTypeFromTuplePath: path: SynTupleTypeSegment list -> SynType list diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 3268a31911b..001dc57bc2d 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5029,17 +5029,23 @@ topType: topTupleType: | topAppType STAR topTupleTypeElements - { let ty, mdata = $1 in let tys, mdatas = List.unzip $3 in (SynType.Tuple(false, List.map (fun ty -> (false, ty)) (ty :: tys), lhs parseState)), (mdata :: mdatas) } + { let t, argInfo = $1 + let path = SynTupleTypeSegment.Type t :: (List.map fst $3) + let mdata = argInfo :: (List.choose snd $3) + mkSynTypeTuple false path, mdata } | topAppType { let ty, mdata = $1 in ty, [mdata] } topTupleTypeElements: | topAppType STAR topTupleTypeElements - { $1 :: $3 } + { let t, argInfo = $1 + let mStar = rhs parseState 2 + (SynTupleTypeSegment.Type t, Some argInfo) :: (SynTupleTypeSegment.Star mStar, None) :: $3 } | topAppType %prec prec_toptuptyptail_prefix - { [$1] } + { let t, argInfo = $1 + [ SynTupleTypeSegment.Type t, Some argInfo ] } topAppType: | attributes appType COLON appType @@ -5080,29 +5086,37 @@ typEOF: tupleType: | appType STAR tupleOrQuotTypeElements - { SynType.Tuple(false, (false, $1) :: $3, lhs parseState) } + { let mStar = rhs parseState 2 + let path = SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Star mStar :: $3 + mkSynTypeTuple false path } | INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $1 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); - SynType.Tuple(false, (true, SynType.StaticConstant (SynConst.Int32 1, lhs parseState)) :: $2, lhs parseState) } + let mSlash = rhs parseState 1 + let path = SynTupleTypeSegment.Slash mSlash :: $2 + mkSynTypeTuple false path } | appType INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $2 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); - SynType.Tuple(false, (true, $1) :: $3, lhs parseState) } + let mSlash = rhs parseState 2 + let path = SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Slash mSlash :: $3 + mkSynTypeTuple false path } | appType %prec prec_tuptyp_prefix { $1 } tupleOrQuotTypeElements: | appType STAR tupleOrQuotTypeElements - { (false, $1) :: $3 } + { let mStar = rhs parseState 2 + SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Star mStar :: $3 } | appType INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $2 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); - (true, $1) :: $3 } + let mSlash = rhs parseState 2 + SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Slash mSlash :: $3 } | appType %prec prec_tuptyptail_prefix - { [(false, $1)] } + { [ SynTupleTypeSegment.Type $1 ] } appTypeCon: | path %prec prec_atomtyp_path @@ -5236,11 +5250,15 @@ atomType: SynType.Paren ($2, lhs parseState) } | STRUCT LPAREN appType STAR tupleOrQuotTypeElements rparen - { SynType.Tuple(true, (false, $3) :: $5, lhs parseState) } + { let mStar = rhs parseState 4 + let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5 + mkSynTypeTuple true path } | STRUCT LPAREN appType STAR tupleOrQuotTypeElements recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) - SynType.Tuple(true, (false, $3) :: $5, lhs parseState) } + let mStar = rhs parseState 4 + let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5 + mkSynTypeTuple true path } | STRUCT LPAREN appType STAR recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 2fc56c7d3f9..a6b0635a936 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -8309,6 +8309,34 @@ FSharp.Compiler.Syntax.SynStringKind: Int32 GetHashCode(System.Collections.IEqua FSharp.Compiler.Syntax.SynStringKind: Int32 Tag FSharp.Compiler.Syntax.SynStringKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynStringKind: System.String ToString() +FSharp.Compiler.Syntax.SynTupleTypeSegment +FSharp.Compiler.Syntax.SynTupleTypeSegment+Slash: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTupleTypeSegment+Slash: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTupleTypeSegment+Star: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTupleTypeSegment+Star: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTupleTypeSegment+Tags: Int32 Slash +FSharp.Compiler.Syntax.SynTupleTypeSegment+Tags: Int32 Star +FSharp.Compiler.Syntax.SynTupleTypeSegment+Tags: Int32 Type +FSharp.Compiler.Syntax.SynTupleTypeSegment+Type: FSharp.Compiler.Syntax.SynType get_typeName() +FSharp.Compiler.Syntax.SynTupleTypeSegment+Type: FSharp.Compiler.Syntax.SynType typeName +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean IsSlash +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean IsStar +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean IsType +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean get_IsSlash() +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean get_IsStar() +FSharp.Compiler.Syntax.SynTupleTypeSegment: Boolean get_IsType() +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment NewSlash(FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment NewStar(FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment NewType(FSharp.Compiler.Syntax.SynType) +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment+Slash +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment+Star +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment+Tags +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Syntax.SynTupleTypeSegment+Type +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Text.Range get_Range() +FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 Tag +FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 get_Tag() +FSharp.Compiler.Syntax.SynTupleTypeSegment: System.String ToString() FSharp.Compiler.Syntax.SynTypar FSharp.Compiler.Syntax.SynTypar: Boolean get_isCompGen() FSharp.Compiler.Syntax.SynTypar: Boolean isCompGen @@ -8479,8 +8507,8 @@ FSharp.Compiler.Syntax.SynType+Tuple: Boolean get_isStruct() FSharp.Compiler.Syntax.SynType+Tuple: Boolean isStruct FSharp.Compiler.Syntax.SynType+Tuple: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynType+Tuple: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynType+Tuple: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Boolean,FSharp.Compiler.Syntax.SynType]] elementTypes -FSharp.Compiler.Syntax.SynType+Tuple: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Boolean,FSharp.Compiler.Syntax.SynType]] get_elementTypes() +FSharp.Compiler.Syntax.SynType+Tuple: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTupleTypeSegment] get_path() +FSharp.Compiler.Syntax.SynType+Tuple: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTupleTypeSegment] path FSharp.Compiler.Syntax.SynType+Var: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynType+Var: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynType+Var: FSharp.Compiler.Text.Range get_range() @@ -8539,7 +8567,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewParen(FSharp.C FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Boolean,FSharp.Compiler.Syntax.SynType]], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTupleTypeSegment], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewVar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithGlobalConstraints(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Anon diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index 9917ec23d27..19716749a39 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -12,6 +12,7 @@ open FsUnit open FSharp.Compiler.EditorServices open FSharp.Compiler.Service.Tests.Common open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text open FSharp.Compiler.Text.Position open NUnit.Framework @@ -156,8 +157,8 @@ let rec getParenTypes (synType: SynType): SynType list = yield! getParenTypes argType yield! getParenTypes returnType - | SynType.Tuple (_, types, _) -> - for _, synType in types do + | SynType.Tuple(path = segment) -> + for synType in getTypeFromTuplePath segment do yield! getParenTypes synType | SynType.AnonRecd (_, fields, _) -> diff --git a/tests/service/SyntaxTreeTests/MeasureTests.fs b/tests/service/SyntaxTreeTests/MeasureTests.fs index 0ccbf5a6d5d..0e618693df9 100644 --- a/tests/service/SyntaxTreeTests/MeasureTests.fs +++ b/tests/service/SyntaxTreeTests/MeasureTests.fs @@ -46,4 +46,80 @@ let ``SynMeasure.Paren has correct range`` () = Assert.AreEqual("staff", staffIdent.idText) Assert.AreEqual("weeks", weeksIdent.idText) assertRange (2, 9) (2, 22) mParen - | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +let private (|TypeName|_|) t = + match t with + | SynType.LongIdent(SynLongIdent([ident], _, _)) -> Some ident.idText + | _ -> None + +[] +let ``SynType.Tuple in measure type with no slashes`` () = + let parseResults = + getParseResults + """ +[] type X = Y * Z +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = + SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.TypeAbbrev(rhsType = + SynType.Tuple(false, [ SynTupleTypeSegment.Type (TypeName "Y") + SynTupleTypeSegment.Star mStar + SynTupleTypeSegment.Type (TypeName "Z") ], mTuple)))) + ]) + ]) ])) -> + assertRange (2, 23) (2, 24) mStar + assertRange (2, 21) (2, 26) mTuple + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynType.Tuple in measure type with leading slash`` () = + let parseResults = + getParseResults + """ +[] type X = / second +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = + SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.TypeAbbrev(rhsType = + SynType.Tuple(false, [ SynTupleTypeSegment.Slash mSlash + SynTupleTypeSegment.Type (TypeName "second") ], mTuple)))) + ]) + ]) ])) -> + assertRange (2, 21) (2, 22) mSlash + assertRange (2, 21) (2, 29) mTuple + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynType.Tuple in measure type with start and slash`` () = + let parseResults = + getParseResults + """ +[] type R = X * Y / Z +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = + SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.TypeAbbrev(rhsType = + SynType.Tuple(false, [ SynTupleTypeSegment.Type (TypeName "X") + SynTupleTypeSegment.Star msStar + SynTupleTypeSegment.Type (TypeName "Y") + SynTupleTypeSegment.Slash msSlash + SynTupleTypeSegment.Type (TypeName "Z") ], mTuple)))) + ]) + ]) ])) -> + assertRange (2, 23) (2, 24) msStar + assertRange (2, 21) (2, 30) mTuple + assertRange (2, 27) (2, 28) msSlash + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" From 17aea36b67bacc0f89081c977721d0f9eb60a254 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 28 Jul 2022 21:00:21 +0200 Subject: [PATCH 068/226] Use net7 devcontainer (#13584) * Use .NET7 container * Autocrlf * Remove test explorer extensions, since they just load forever * Testing settings + disable autobuild --- .devcontainer/Dockerfile | 4 ++-- .devcontainer/devcontainer.json | 25 +++++++++++-------------- .vscode/settings.json | 8 ++------ azure-pipelines.yml | 2 ++ 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1258aa2b644..d750473d682 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,8 +3,8 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -ARG VARIANT=6.0-focal -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} +ARG VARIANT=7.0-bullseye-slim +FROM mcr.microsoft.com/dotnet/sdk:${VARIANT} # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a0945a548ad..6713c830831 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: { - "name": "F# (.NET 6)", + "name": "F# (.NET 7)", "build": { "dockerfile": "Dockerfile", "args": { - // Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0 - // Append -bullseye or -focal to pin to an OS version. - "VARIANT": "6.0-focal" + // Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0, 7.0 + // Append -bullseye(-slim), -focal, or -jammy to pin to an OS version. + "VARIANT": "7.0-bullseye-slim" } }, "hostRequirements": { @@ -20,19 +20,16 @@ // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "ms-vscode.test-adapter-converter", - "hbenl.vscode-test-explorer", - "formulahendry.dotnet-test-explorer", "ms-dotnettools.csharp", "Ionide.Ionide-fsharp", "tintoy.msbuild-project-tools" ], - "onCreateCommand": [ - "/bin/bash", - "-c", - "./build.sh", - "-c", - "Debug" - ], + //"onCreateCommand": [ // It is a bit buggy in codespaces, so for now, need to run it manually. + // "/bin/bash", + // "-c", + // "./build.sh", + // "-c", + // "Debug" + //], "waitFor": "onCreateCommand" } diff --git a/.vscode/settings.json b/.vscode/settings.json index a6076623164..176672fadf0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,7 +16,7 @@ "*.fs": "${capture}.fsi" }, "FSharp.suggestGitignore": false, - "FSharp.enableMSBuildProjectGraph": false, + "FSharp.enableMSBuildProjectGraph": true, "FSharp.workspacePath": "FSharp.Compiler.Service.sln", "FSharp.workspaceModePeekDeepLevel": 1, "FSharp.enableBackgroundServices": false, @@ -34,7 +34,7 @@ "csharp.suppressDotnetInstallWarning": true, "csharp.suppressDotnetRestoreNotification": true, "csharp.suppressHiddenDiagnostics": true, - "omnisharp.autoStart": false, + "omnisharp.autoStart": true, "omnisharp.defaultLaunchSolution": "FSharp.Compiler.Service.sln", "omnisharp.enableMsBuildLoadProjectsOnDemand": true, "omnisharp.disableMSBuildDiagnosticWarning": true, @@ -45,10 +45,6 @@ "powershell.promptToUpdatePowerShell": false, "powershell.integratedConsole.showOnStartup": false, "powershell.startAutomatically": false, - "dotnet-test-explorer.testProjectPath": "tests/+(FSharp.Compiler.Service.Tests|FSharp.Compiler.UnitTests|FSharp.Core.UnitTests|FSharp.Build.UnitTests|FSharp.Compiler.ComponentTests)/*Tests.fsproj", - "dotnet-test-explorer.addProblems": true, - "dotnet-test-explorer.autoWatch": false, - "dotnet-test-explorer.treeMode": "merged", "testExplorer.useNativeTesting": true, "markdownlint.config": { "MD028": false, diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ce584c2506a..728725e3696 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,6 +12,8 @@ trigger: exclude: - .github/* - docs/ + - .vscode/* + - .devcontainer/* - tests/scripts/ - attributions.md - CODE_OF_CONDUCT.md From c696bd5902e654b4c4ba74b2f04f91713c4cac8f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 00:07:45 -0700 Subject: [PATCH 069/226] Remove NO_SYSTEM_CONFIGURATION (#13580) --- FSharp.Profiles.props | 1 - src/Compiler/Facilities/CompilerLocation.fs | 63 ++++++--------------- 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 37a9dae76b2..7f93b3b3646 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -13,7 +13,6 @@ $(DefineConstants);NETSTANDARD $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_CORHOST_SIGNER - $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS $(DefineConstants);FX_RESHAPED_REFEMIT diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 48daaacf8b7..9453c72f1af 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -157,28 +157,6 @@ module internal FSharpEnvironment = else None -#if FX_NO_SYSTEM_CONFIGURATION - let internal tryAppConfig (_appConfigKey: string) = None -#else - let internal tryAppConfig (_appConfigKey: string) = - let locationFromAppConfig = - System.Configuration.ConfigurationSettings.AppSettings.[_appConfigKey] -#if DEBUG - Debug.Print(sprintf "Considering _appConfigKey %s which has value '%s'" _appConfigKey locationFromAppConfig) -#endif - if String.IsNullOrEmpty(locationFromAppConfig) then - None - else - let exeAssemblyFolder = - Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) - - let locationFromAppConfig = - locationFromAppConfig.Replace("{exepath}", exeAssemblyFolder) -#if DEBUG - Debug.Print(sprintf "Using path %s" locationFromAppConfig) -#endif - Some locationFromAppConfig -#endif // The default location of FSharp.Core.dll and fsc.exe based on the version of fsc.exe that is running // Used for @@ -195,30 +173,23 @@ module internal FSharpEnvironment = match Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN") with | result when not (String.IsNullOrWhiteSpace result) -> Some result | _ -> - // FSharp.Compiler support setting an appKey for compiler location. I've never seen this used. - let result = tryAppConfig "fsharp-compiler-location" - - match result with - | Some _ -> result - | None -> - - let safeExists f = - (try - File.Exists(f) - with _ -> - false) - - // Look in the probePoint if given, e.g. look for a compiler alongside of FSharp.Build.dll - match probePoint with - | Some p when safeExists (Path.Combine(p, "FSharp.Core.dll")) -> Some p - | _ -> - let fallback () = - let d = Assembly.GetExecutingAssembly() - Some(Path.GetDirectoryName d.Location) - - match tryCurrentDomain () with - | None -> fallback () - | Some path -> Some path + let safeExists f = + (try + File.Exists(f) + with _ -> + false) + + // Look in the probePoint if given, e.g. look for a compiler alongside of FSharp.Build.dll + match probePoint with + | Some p when safeExists (Path.Combine(p, "FSharp.Core.dll")) -> Some p + | _ -> + let fallback () = + let d = Assembly.GetExecutingAssembly() + Some(Path.GetDirectoryName d.Location) + + match tryCurrentDomain () with + | None -> fallback () + | Some path -> Some path with e -> None From 631456c3f14be694c0ddace6eaa7cfe88f2830fb Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 00:09:45 -0700 Subject: [PATCH 070/226] Remove reshaped ref emit (#13578) --- FSharp.Profiles.props | 1 - src/Compiler/AbstractIL/ilreflect.fs | 146 +++----------------------- src/Compiler/AbstractIL/ilreflect.fsi | 2 +- src/Compiler/Interactive/fsi.fs | 2 +- 4 files changed, 14 insertions(+), 137 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 7f93b3b3646..159238eac30 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -15,7 +15,6 @@ $(DefineConstants);FX_NO_CORHOST_SIGNER $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS - $(DefineConstants);FX_RESHAPED_REFEMIT $(OtherFlags) --simpleresolution diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index b09ade2f551..e7e1e548e1a 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -31,32 +31,16 @@ let logRefEmitCalls = false type AssemblyBuilder with - member asmB.DefineDynamicModuleAndLog(a, b, c) = -#if FX_RESHAPED_REFEMIT - ignore b - ignore c - let modB = asmB.DefineDynamicModule a -#else - let modB = asmB.DefineDynamicModule(a, b, c) - - if logRefEmitCalls then - printfn "let moduleBuilder%d = assemblyBuilder%d.DefineDynamicModule(%A, %A, %A)" (abs <| hash modB) (abs <| hash asmB) a b c -#endif + member this.DefineDynamicModuleAndLog(assemblyName) = + let modB = this.DefineDynamicModule assemblyName modB - member asmB.SetCustomAttributeAndLog(cinfo, bytes) = + member this.SetCustomAttributeAndLog(cinfo, bytes) = if logRefEmitCalls then - printfn "assemblyBuilder%d.SetCustomAttribute(%A, %A)" (abs <| hash asmB) cinfo bytes + printfn "assemblyBuilder%d.SetCustomAttribute(%A, %A)" (abs <| hash this) cinfo bytes - wrapCustomAttr asmB.SetCustomAttribute (cinfo, bytes) + wrapCustomAttr this.SetCustomAttribute (cinfo, bytes) -#if !FX_RESHAPED_REFEMIT - member asmB.AddResourceFileAndLog(nm1, nm2, attrs) = - if logRefEmitCalls then - printfn "assemblyBuilder%d.AddResourceFile(%A, %A, enum %d)" (abs <| hash asmB) nm1 nm2 (LanguagePrimitives.EnumToValue attrs) - - asmB.AddResourceFile(nm1, nm2, attrs) -#endif member asmB.SetCustomAttributeAndLog cab = if logRefEmitCalls then printfn "assemblyBuilder%d.SetCustomAttribute(%A)" (abs <| hash asmB) cab @@ -71,22 +55,6 @@ type ModuleBuilder with modB.GetArrayMethod(arrayTy, nm, flags, retTy, argTys) -#if !FX_RESHAPED_REFEMIT - member modB.DefineDocumentAndLog(file, lang, vendor, doctype) = - let symDoc = modB.DefineDocument(file, lang, vendor, doctype) - - if logRefEmitCalls then - printfn - "let docWriter%d = moduleBuilder%d.DefineDocument(@%A, System.Guid(\"%A\"), System.Guid(\"%A\"), System.Guid(\"%A\"))" - (abs <| hash symDoc) - (abs <| hash modB) - file - lang - vendor - doctype - - symDoc -#endif member modB.GetTypeAndLog(nameInModule, flag1, flag2) = if logRefEmitCalls then printfn "moduleBuilder%d.GetType(%A, %A, %A) |> ignore" (abs <| hash modB) nameInModule flag1 flag2 @@ -106,18 +74,6 @@ type ModuleBuilder with typB -#if !FX_RESHAPED_REFEMIT - member modB.DefineManifestResourceAndLog(name, stream, attrs) = - if logRefEmitCalls then - printfn - "moduleBuilder%d.DefineManifestResource(%A, %A, enum %d)" - (abs <| hash modB) - name - stream - (LanguagePrimitives.EnumToValue attrs) - - modB.DefineManifestResource(name, stream, attrs) -#endif member modB.SetCustomAttributeAndLog(cinfo, bytes) = if logRefEmitCalls then printfn "moduleBuilder%d.SetCustomAttribute(%A, %A)" (abs <| hash modB) cinfo bytes @@ -206,11 +162,8 @@ type TypeBuilder with member typB.CreateTypeAndLog() = if logRefEmitCalls then printfn "typeBuilder%d.CreateType()" (abs <| hash typB) -#if FX_RESHAPED_REFEMIT typB.CreateTypeInfo().AsType() -#else - typB.CreateType() -#endif + member typB.DefineNestedTypeAndLog(name, attrs) = let res = typB.DefineNestedType(name, attrs) @@ -308,7 +261,6 @@ type TypeBuilder with typB.AddInterfaceImplementation ty member typB.InvokeMemberAndLog(nm, _flags, args) = -#if FX_RESHAPED_REFEMIT let t = typB.CreateTypeAndLog() let m = @@ -321,17 +273,6 @@ type TypeBuilder with m.Invoke(null, args) else raise (MissingMethodException nm) -#else - if logRefEmitCalls then - printfn - "typeBuilder%d.InvokeMember(\"%s\", enum %d, null, null, %A, Globalization.CultureInfo.InvariantCulture)" - (abs <| hash typB) - nm - (LanguagePrimitives.EnumToValue _flags) - args - - typB.InvokeMember(nm, _flags, null, null, args, Globalization.CultureInfo.InvariantCulture) -#endif member typB.SetCustomAttributeAndLog(cinfo, bytes) = if logRefEmitCalls then @@ -360,13 +301,6 @@ type ILGenerator with ilG.MarkLabel lab -#if !FX_RESHAPED_REFEMIT - member ilG.MarkSequencePointAndLog(symDoc, l1, c1, l2, c2) = - if logRefEmitCalls then - printfn "ilg%d.MarkSequencePoint(docWriter%d, %A, %A, %A, %A)" (abs <| hash ilG) (abs <| hash symDoc) l1 c1 l2 c2 - - ilG.MarkSequencePoint(symDoc, l1, c1, l2, c2) -#endif member ilG.BeginExceptionBlockAndLog() = if logRefEmitCalls then printfn "ilg%d.BeginExceptionBlock()" (abs <| hash ilG) @@ -1643,27 +1577,7 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = | I_refanyval ty -> ilG.EmitAndLog(OpCodes.Refanyval, convType cenv emEnv ty) | I_rethrow -> ilG.EmitAndLog OpCodes.Rethrow | I_break -> ilG.EmitAndLog OpCodes.Break - | I_seqpoint src -> -#if FX_RESHAPED_REFEMIT - ignore src - () -#else - if cenv.generatePdb && not (src.Document.File.EndsWithOrdinal("stdin")) then - let guid x = - match x with - | None -> Guid.Empty - | Some g -> Guid(g: byte[]) in - - let symDoc = - modB.DefineDocumentAndLog( - src.Document.File, - guid src.Document.Language, - guid src.Document.Vendor, - guid src.Document.DocumentType - ) - - ilG.MarkSequencePointAndLog(symDoc, src.Line, src.Column, src.EndLine, src.EndColumn) -#endif + | I_seqpoint _ -> () | I_arglist -> ilG.EmitAndLog OpCodes.Arglist | I_localloc -> ilG.EmitAndLog OpCodes.Localloc @@ -1882,12 +1796,6 @@ let emitParameter cenv emEnv (defineParameter: int * ParameterAttributes * strin // buildMethodPass2 //---------------------------------------------------------------------------- -#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_1 - -let enablePInvoke = true - -#else - // Use reflection to invoke the api when we are executing on a platform that doesn't directly have this API. let definePInvokeMethod = typeof.GetMethod @@ -1909,7 +1817,6 @@ let definePInvokeMethod = |]) let enablePInvoke = definePInvokeMethod <> null -#endif let rec buildMethodPass2 cenv tref (typB: TypeBuilder) emEnv (mdef: ILMethodDef) = let attrs = mdef.Attributes @@ -1948,12 +1855,6 @@ let rec buildMethodPass2 cenv tref (typB: TypeBuilder) emEnv (mdef: ILMethodDef) // p.CharBestFit // p.NoMangle -#if !FX_RESHAPED_REFEMIT || NETCOREAPP3_1 - // DefinePInvokeMethod was removed in early versions of coreclr, it was added back in NETCOREAPP3. - // It has always been available in the desktop framework - let methB = - typB.DefinePInvokeMethod(mdef.Name, p.Where.Name, p.Name, attrs, cconv, retTy, null, null, argTys, null, null, pcc, pcs) -#else // Use reflection to invoke the api when we are executing on a platform that doesn't directly have this API. let methB = System.Diagnostics.Debug.Assert(definePInvokeMethod <> null, "Runtime does not have DefinePInvokeMethod") // Absolutely can't happen @@ -1977,7 +1878,7 @@ let rec buildMethodPass2 cenv tref (typB: TypeBuilder) emEnv (mdef: ILMethodDef) |] ) :?> MethodBuilder -#endif + methB.SetImplementationFlagsAndLog implflags envBindMethodRef emEnv mref methB @@ -2591,7 +2492,7 @@ let buildModuleTypePass4 visited emEnv tdef = buildTypeDefPass4 visited [] emEnv // buildModuleFragment - only the types the fragment get written //---------------------------------------------------------------------------- -let buildModuleFragment cenv emEnv (asmB: AssemblyBuilder) (modB: ModuleBuilder) (m: ILModuleDef) = +let buildModuleFragment cenv emEnv (modB: ModuleBuilder) (m: ILModuleDef) = let tdefs = m.TypeDefs.AsList() let emEnv = (emEnv, tdefs) ||> List.fold (buildModuleTypePass1 cenv modB) @@ -2609,23 +2510,6 @@ let buildModuleFragment cenv emEnv (asmB: AssemblyBuilder) (modB: ModuleBuilder) tdefs |> List.iter (buildModuleTypePass4 (visited, created) emEnv) let emEnv = Seq.fold envUpdateCreatedTypeRef emEnv created.Keys // update typT with the created typT emitCustomAttrs cenv emEnv modB.SetCustomAttributeAndLog m.CustomAttrs -#if FX_RESHAPED_REFEMIT - ignore asmB -#else - m.Resources.AsList() - |> List.iter (fun r -> - let attribs = - (match r.Access with - | ILResourceAccess.Public -> ResourceAttributes.Public - | ILResourceAccess.Private -> ResourceAttributes.Private) - - match r.Location with - | ILResourceLocation.Local bytes -> - use stream = bytes.GetByteMemory().AsStream() - modB.DefineManifestResourceAndLog(r.Name, stream, attribs) - | ILResourceLocation.File (mr, _) -> asmB.AddResourceFileAndLog(r.Name, mr.Name, attribs) - | ILResourceLocation.Assembly _ -> failwith "references to resources other assemblies may not be emitted using System.Reflection") -#endif emEnv //---------------------------------------------------------------------------- @@ -2652,8 +2536,7 @@ let defineDynamicAssemblyAndLog (asmName, flags, asmDir: string) = asmB -let mkDynamicAssemblyAndModule (assemblyName, optimize, debugInfo: bool, collectible) = - let fileName = assemblyName + ".dll" +let mkDynamicAssemblyAndModule (assemblyName, optimize, collectible) = let asmDir = "." let asmName = AssemblyName() asmName.Name <- assemblyName @@ -2661,13 +2544,8 @@ let mkDynamicAssemblyAndModule (assemblyName, optimize, debugInfo: bool, collect let asmAccess = if collectible then AssemblyBuilderAccess.RunAndCollect -#if FX_RESHAPED_REFEMIT else AssemblyBuilderAccess.Run -#else - else - AssemblyBuilderAccess.RunAndSave -#endif let asmB = defineDynamicAssemblyAndLog (asmName, asmAccess, asmDir) if not optimize then @@ -2687,7 +2565,7 @@ let mkDynamicAssemblyAndModule (assemblyName, optimize, debugInfo: bool, collect asmB.SetCustomAttributeAndLog daBuilder - let modB = asmB.DefineDynamicModuleAndLog(assemblyName, fileName, debugInfo) + let modB = asmB.DefineDynamicModuleAndLog(assemblyName) asmB, modB let EmitDynamicAssemblyFragment @@ -2711,7 +2589,7 @@ let EmitDynamicAssemblyFragment tryFindSysILTypeRef = tryFindSysILTypeRef } - let emEnv = buildModuleFragment cenv emEnv asmB modB modul + let emEnv = buildModuleFragment cenv emEnv modB modul match modul.Manifest with | None -> () diff --git a/src/Compiler/AbstractIL/ilreflect.fsi b/src/Compiler/AbstractIL/ilreflect.fsi index 771c867a2ae..79fb6f8535c 100644 --- a/src/Compiler/AbstractIL/ilreflect.fsi +++ b/src/Compiler/AbstractIL/ilreflect.fsi @@ -9,7 +9,7 @@ open System.Reflection.Emit open FSharp.Compiler.AbstractIL.IL val mkDynamicAssemblyAndModule: - assemblyName: string * optimize: bool * debugInfo: bool * collectible: bool -> AssemblyBuilder * ModuleBuilder + assemblyName: string * optimize: bool * collectible: bool -> AssemblyBuilder * ModuleBuilder type cenv = { ilg: ILGlobals diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 7d58c8472ac..37b5bca7a35 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1368,7 +1368,7 @@ type internal FsiDynamicCompiler( if tcConfigB.fsiMultiAssemblyEmit then None else - let assemBuilder, moduleBuilder = mkDynamicAssemblyAndModule (dynamicCcuName, tcConfigB.optSettings.LocalOptimizationsEnabled, generateDebugInfo, fsiCollectible) + let assemBuilder, moduleBuilder = mkDynamicAssemblyAndModule (dynamicCcuName, tcConfigB.optSettings.LocalOptimizationsEnabled, fsiCollectible) dynamicAssemblies.Add(assemBuilder) Some (assemBuilder, moduleBuilder) From efdcde29108055b5ac8881e032bb3579ff81526d Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 29 Jul 2022 11:48:06 +0200 Subject: [PATCH 071/226] Init-only & required properties support (#13490) Co-authored-by: Petr Pokorny --- src/Compiler/AbstractIL/il.fs | 5 +- src/Compiler/AbstractIL/il.fsi | 2 + src/Compiler/Checking/AttributeChecking.fs | 36 +- src/Compiler/Checking/CheckExpressions.fs | 56 +- src/Compiler/Checking/NicePrint.fs | 14 + src/Compiler/Checking/NicePrint.fsi | 5 + src/Compiler/Checking/infos.fs | 44 +- src/Compiler/Checking/infos.fsi | 15 + src/Compiler/FSComp.txt | 5 + src/Compiler/Facilities/LanguageFeatures.fs | 6 + src/Compiler/Facilities/LanguageFeatures.fsi | 2 + src/Compiler/TypedTree/TcGlobals.fs | 6 + src/Compiler/xlf/FSComp.txt.cs.xlf | 25 + src/Compiler/xlf/FSComp.txt.de.xlf | 25 + src/Compiler/xlf/FSComp.txt.es.xlf | 25 + src/Compiler/xlf/FSComp.txt.fr.xlf | 25 + src/Compiler/xlf/FSComp.txt.it.xlf | 25 + src/Compiler/xlf/FSComp.txt.ja.xlf | 25 + src/Compiler/xlf/FSComp.txt.ko.xlf | 25 + src/Compiler/xlf/FSComp.txt.pl.xlf | 25 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 25 + src/Compiler/xlf/FSComp.txt.ru.xlf | 25 + src/Compiler/xlf/FSComp.txt.tr.xlf | 25 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 25 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 25 + .../FSharp.Compiler.ComponentTests.fsproj | 16 +- .../Interop/RequiredAndInitOnlyProperties.fs | 486 ++++++++++++++++++ tests/FSharp.Test.Utilities/Compiler.fs | 5 + .../PropertyPages/ApplicationPropPageBase.vb | 2 +- 29 files changed, 1006 insertions(+), 24 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 2321a26bf05..23e6186253a 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -1203,10 +1203,11 @@ type ILAttribute = [] type ILAttributes(array: ILAttribute[]) = + member _.AsArray() = array - member x.AsArray() = array + member _.AsList() = array |> Array.toList - member x.AsList() = array |> Array.toList + static member val internal Empty = ILAttributes([||]) [] type ILAttributesStored = diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 12067f8911c..8b5a3160c06 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -855,6 +855,8 @@ type ILAttributes = member AsList: unit -> ILAttribute list + static member internal Empty: ILAttributes + /// Represents the efficiency-oriented storage of ILAttributes in another item. [] type ILAttributesStored diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 0e013980da3..7731b83c256 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -21,6 +21,8 @@ open FSharp.Compiler.TypeHierarchy #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders open FSharp.Core.CompilerServices +open Features + #endif exception ObsoleteWarning of string * range @@ -229,22 +231,36 @@ let MethInfoHasAttribute g m attribSpec minfo = |> Option.isSome +let private CheckCompilerFeatureRequiredAttribute (g: TcGlobals) cattrs msg m = + // In some cases C# will generate both ObsoleteAttribute and CompilerFeatureRequiredAttribute. + // Specifically, when default constructor is generated for class with any reqired members in them. + // ObsoleteAttribute should be ignored if CompilerFeatureRequiredAttribute is present, and its name is "RequiredMembers". + let (AttribInfo(tref,_)) = g.attrib_CompilerFeatureRequiredAttribute + match TryDecodeILAttribute tref cattrs with + | Some([ILAttribElem.String (Some featureName) ], _) when featureName = "RequiredMembers" -> + CompleteD + | _ -> + ErrorD (ObsoleteError(msg, m)) + /// Check IL attributes for 'ObsoleteAttribute', returning errors and warnings as data -let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m = +let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m = let (AttribInfo(tref,_)) = g.attrib_SystemObsolete - match TryDecodeILAttribute tref cattrs with - | Some ([ILAttribElem.String (Some msg) ], _) when not isByrefLikeTyconRef -> + match TryDecodeILAttribute tref cattrs with + | Some ([ILAttribElem.String (Some msg) ], _) when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef -> - if isError then - ErrorD (ObsoleteError(msg, m)) - else + | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef -> + if isError then + if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) then + CheckCompilerFeatureRequiredAttribute g cattrs msg m + else + ErrorD (ObsoleteError(msg, m)) + else WarnD (ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String None ], _) when not isByrefLikeTyconRef -> + | Some ([ILAttribElem.String None ], _) when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning("", m)) - | Some _ when not isByrefLikeTyconRef -> + | Some _ when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning("", m)) - | _ -> + | _ -> CompleteD let langVersionPrefix = "--langversion:preview" diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index f301fcaf7a4..fa9546d9482 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -1497,6 +1497,44 @@ let CheckForAbnormalOperatorNames (cenv: cenv) (idRange: range) coreDisplayName warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes opName, idRange)) | Other -> () +let CheckInitProperties (g: TcGlobals) (minfo: MethInfo) methodName mItem = + if g.langVersion.SupportsFeature(LanguageFeature.InitPropertiesSupport) then + // Check, wheter this method has external init, emit an error diagnostic in this case. + if minfo.HasExternalInit then + errorR (Error (FSComp.SR.tcSetterForInitOnlyPropertyCannotBeCalled1 methodName, mItem)) + +let CheckRequiredProperties (g:TcGlobals) (env: TcEnv) (cenv: TcFileState) (minfo: MethInfo) finalAssignedItemSetters mMethExpr = + // Make sure, if apparent type has any required properties, they all are in the `finalAssignedItemSetters`. + // If it is a constructor, and it is not marked with `SetsRequiredMembersAttributeAttribute`, then: + // 1. Get all properties of the type. + // 2. Check if any of them has `IsRequired` set. + // 2.1. If there are none, proceed as usual + // 2.2. If there are any, make sure all of them (or their setters) are in `finalAssignedItemSetters`. + // 3. If some are missing, produce a diagnostic which missing ones. + if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) + && minfo.IsConstructor + && not (TryFindILAttribute g.attrib_SetsRequiredMembersAttribute (minfo.GetCustomAttrs())) then + + let requiredProps = + [ + let props = GetImmediateIntrinsicPropInfosOfType (None, AccessibleFromSomeFSharpCode) g cenv.amap range0 minfo.ApparentEnclosingType + for prop in props do + if prop.IsRequired then + prop + ] + + if requiredProps.Length > 0 then + let setterPropNames = + finalAssignedItemSetters + |> List.choose (function | AssignedItemSetter(_, AssignedPropSetter (pinfo, _, _), _) -> Some pinfo.PropertyName | _ -> None) + + let missingProps = + requiredProps + |> List.filter (fun pinfo -> not (List.contains pinfo.PropertyName setterPropNames)) + if missingProps.Length > 0 then + let details = NicePrint.multiLineStringOfPropInfos g cenv.amap mMethExpr env.DisplayEnv missingProps + errorR(Error(FSComp.SR.tcMissingRequiredMembers details, mMethExpr)) + let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRecInfo, vscheme, attrs, xmlDoc, konst, isGeneratedEventVal) = let g = cenv.g @@ -8992,6 +9030,9 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela // To get better warnings we special case some of the few known mutate-a-struct method names let mutates = (if methodName = "MoveNext" || methodName = "GetNextArg" then DefinitelyMutates else PossiblyMutates) + // Check if we have properties with "init-only" setters, which we try to call after init is done. + CheckInitProperties g (List.head minfos) methodName mItem + #if !NO_TYPEPROVIDERS match TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos, tyArgsOpt, mExprAndItem, mItem) with | Some minfoAfterStaticArguments -> @@ -9038,6 +9079,10 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag delayed else + + if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly then + errorR (Error (FSComp.SR.tcInitOnlyPropertyCannotBeSet1 nm, mItem)) + let args = if pinfo.IsIndexer then args else [] let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [expr2]) atomicFlag [] @@ -9741,6 +9786,9 @@ and TcMethodApplication // Handle post-hoc property assignments let setterExprPrebinders, callExpr3 = let expr = callExpr2b + + CheckRequiredProperties g env cenv finalCalledMethInfo finalAssignedItemSetters mMethExpr + if isCheckingAttributeCall then [], expr elif isNil finalAssignedItemSetters then @@ -9752,7 +9800,7 @@ and TcMethodApplication // Build the expression that mutates the properties on the result of the call let setterExprPrebinders, propSetExpr = (mkUnit g mMethExpr, finalAssignedItemSetters) ||> List.mapFold (fun acc assignedItemSetter -> - let argExprPrebinder, action, m = TcSetterArgExpr cenv env denv objExpr ad assignedItemSetter + let argExprPrebinder, action, m = TcSetterArgExpr cenv env denv objExpr ad assignedItemSetter finalCalledMethInfo.IsConstructor argExprPrebinder, mkCompGenSequential m acc action) // now put them together @@ -9798,7 +9846,7 @@ and TcMethodApplication (callExpr6, finalAttributeAssignedNamedItems, delayed), tpenv /// For Method(X = expr) 'X' can be a property, IL Field or F# record field -and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) = +and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) calledFromConstructor = let g = cenv.g if isOptCallerArg then @@ -9807,6 +9855,10 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal let argExprPrebinder, action, defnItem = match setter with | AssignedPropSetter (pinfo, pminfo, pminst) -> + + if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly && not calledFromConstructor then + errorR (Error (FSComp.SR.tcInitOnlyPropertyCannotBeSet1 pinfo.PropertyName, m)) + 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 diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index df08572483b..f9ede5721e7 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1556,6 +1556,10 @@ module InfoMemberPrinting = layoutType denv retTy ^^ getterSetter + let formatPropInfoToBufferFreeStyle g amap m denv os (pinfo: PropInfo) = + let resL = prettyLayoutOfPropInfoFreeStyle g amap m denv pinfo + resL |> bufferL os + let formatMethInfoToBufferFreeStyle amap m denv os (minfo: MethInfo) = let _, resL = prettyLayoutOfMethInfoFreeStyle amap m denv emptyTyparInst minfo resL |> bufferL os @@ -2472,6 +2476,16 @@ let multiLineStringOfMethInfos infoReader m denv minfos = |> List.map (sprintf "%s %s" Environment.NewLine) |> String.concat "" +let stringOfPropInfo g amap m denv pinfo = + buildString (fun buf -> InfoMemberPrinting.formatPropInfoToBufferFreeStyle g amap m denv buf pinfo) + +/// Convert PropInfos to lines separated by newline including a newline as the first character +let multiLineStringOfPropInfos g amap m denv pinfos = + pinfos + |> List.map (stringOfPropInfo g amap m denv) + |> List.map (sprintf "%s %s" Environment.NewLine) + |> String.concat "" + /// Convert a ParamData to a string let stringOfParamData denv paramData = buildString (fun buf -> InfoMemberPrinting.formatParamDataToBuffer denv buf paramData) diff --git a/src/Compiler/Checking/NicePrint.fsi b/src/Compiler/Checking/NicePrint.fsi index 523202af9b9..f00cd3395e1 100644 --- a/src/Compiler/Checking/NicePrint.fsi +++ b/src/Compiler/Checking/NicePrint.fsi @@ -82,6 +82,11 @@ val stringOfMethInfo: infoReader: InfoReader -> m: range -> denv: DisplayEnv -> val multiLineStringOfMethInfos: infoReader: InfoReader -> m: range -> denv: DisplayEnv -> minfos: MethInfo list -> string +val stringOfPropInfo: g: TcGlobals -> amap: ImportMap -> m: range -> denv: DisplayEnv -> pinfo: PropInfo -> string + +val multiLineStringOfPropInfos: + g: TcGlobals -> amap: ImportMap -> m: range -> denv: DisplayEnv -> pinfos: PropInfo list -> string + val stringOfParamData: denv: DisplayEnv -> paramData: ParamData -> string val layoutOfParamData: denv: DisplayEnv -> paramData: ParamData -> Layout diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index c5d45e95e3f..ddaf2e35b0c 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -22,6 +22,8 @@ open FSharp.Compiler.Xml #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders +open FSharp.Compiler.AbstractIL + #endif //------------------------------------------------------------------------- @@ -152,6 +154,11 @@ let private GetInstantiationForPropertyVal g (ty, vref) = let memberParentTypars, memberMethodTypars, _retTy, parentTyArgs = AnalyzeTypeOfMemberVal false g (ty, vref) CombineMethInsts memberParentTypars memberMethodTypars parentTyArgs (generalizeTypars memberMethodTypars) +let private HasExternalInit (mref: ILMethodRef) : bool = + match mref.ReturnType with + | ILType.Modified(_, cls, _) -> cls.FullName = "System.Runtime.CompilerServices.IsExternalInit" + | _ -> false + /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced /// later through 'open' get priority in overload resolution. type ExtensionMethodPriority = uint64 @@ -933,6 +940,12 @@ type MethInfo = | FSMeth _ -> false // F# defined methods not supported yet. Must be a language feature. | _ -> false + /// Indicates, wheter this method has `IsExternalInit` modreq. + member x.HasExternalInit = + match x with + | ILMeth (_, ilMethInfo, _) -> HasExternalInit ilMethInfo.ILMethodRef + | _ -> false + /// Indicates if this method is an extension member that is read-only. /// An extension member is considered read-only if the first argument is a read-only byref (inref) type. member x.IsReadOnlyExtensionMember (amap: ImportMap, m) = @@ -1053,6 +1066,12 @@ type MethInfo = else [] #endif + /// Get custom attributes for method (only applicable for IL methods) + member x.GetCustomAttrs() = + match x with + | ILMeth(_, ilMethInfo, _) -> ilMethInfo.RawMetadata.CustomAttrs + | _ -> ILAttributes.Empty + /// Get the parameter attributes of a method info, which get combined with the parameter names and types member x.GetParamAttribs(amap, m) = match x with @@ -1562,6 +1581,10 @@ type ILPropInfo = /// Indicates if the IL property has a 'set' method member x.HasSetter = Option.isSome x.RawMetadata.SetMethod + /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) + member x.IsSetterInitOnly = + x.HasSetter && HasExternalInit x.SetterMethod.ILMethodRef + /// Indicates if the IL property is static member x.IsStatic = (x.RawMetadata.CallingConv = ILThisConvention.Static) @@ -1575,6 +1598,9 @@ type ILPropInfo = (x.HasGetter && x.GetterMethod.IsNewSlot) || (x.HasSetter && x.SetterMethod.IsNewSlot) + /// Indicates if the property is required, i.e. has RequiredMemberAttribute applied. + member x.IsRequired = TryFindILAttribute x.TcGlobals.attrib_RequiredMemberAttribute x.RawMetadata.CustomAttrs + /// Get the names and types of the indexer arguments associated with the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. @@ -1688,6 +1714,22 @@ type PropInfo = | ProvidedProp(_, pi, m) -> pi.PUntaint((fun pi -> pi.CanWrite), m) #endif + member x.IsSetterInitOnly = + match x with + | ILProp ilpinfo -> ilpinfo.IsSetterInitOnly + | FSProp _ -> false +#if !NO_TYPEPROVIDERS + | ProvidedProp _ -> false +#endif + + member x.IsRequired = + match x with + | ILProp ilpinfo -> ilpinfo.IsRequired + | FSProp _ -> false +#if !NO_TYPEPROVIDERS + | ProvidedProp _ -> false +#endif + /// Indicates if this is an extension member member x.IsExtensionMember = match x.ArbitraryValRef with @@ -2263,4 +2305,4 @@ let PropInfosEquivByNameAndSig erasureFlag g amap m (pinfo: PropInfo) (pinfo2: P let SettersOfPropInfos (pinfos: PropInfo list) = pinfos |> List.choose (fun pinfo -> if pinfo.HasSetter then Some(pinfo.SetterMethod, Some pinfo) else None) -let GettersOfPropInfos (pinfos: PropInfo list) = pinfos |> List.choose (fun pinfo -> if pinfo.HasGetter then Some(pinfo.GetterMethod, Some pinfo) else None) +let GettersOfPropInfos (pinfos: PropInfo list) = pinfos |> List.choose (fun pinfo -> if pinfo.HasGetter then Some(pinfo.GetterMethod, Some pinfo) else None) \ No newline at end of file diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index dba5200afb7..9d4fd965a67 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -423,6 +423,9 @@ type MethInfo = /// Receiver must be a struct type. member IsReadOnly: bool + /// Indicates, wheter this method has `IsExternalInit` modreq. + member HasExternalInit: bool + /// Indicates if the enclosing type for the method is a value type. /// /// For an extension method, this indicates if the method extends a struct type. @@ -493,6 +496,9 @@ type MethInfo = /// An instance method returns one object argument. member GetObjArgTypes: amap: ImportMap * m: range * minst: TypeInst -> TType list + /// Get custom attributes for method (only applicable for IL methods) + member GetCustomAttrs: unit -> ILAttributes + /// Get the parameter attributes of a method info, which get combined with the parameter names and types member GetParamAttribs: amap: ImportMap * m: range -> (bool * bool * bool * OptionalArgInfo * CallerInfo * ReflectedArgInfo) list list @@ -695,6 +701,9 @@ type ILPropInfo = /// Get the declaring IL type of the IL property, including any generic instantiation member ILTypeInfo: ILTypeInfo + /// Is the property requied (has the RequiredMemberAttribute). + member IsRequired: bool + /// Indicates if the IL property is logically a 'newslot', i.e. hides any previous slots of the same name. member IsNewSlot: bool @@ -787,6 +796,12 @@ type PropInfo = /// Indicates if this property has an associated setter method. member HasSetter: bool + /// Indidcates whether IL property has an init-only setter (i.e. has the `System.Runtime.CompilerServices.IsExternalInit` modifer) + member IsSetterInitOnly: bool + + /// Is the property requied (has the RequiredMemberAttribute). + member IsRequired: bool + member ImplementedSlotSignatures: SlotSig list /// Indicates if this property is marked 'override' and thus definitely overrides another property. diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index bb407db7791..60e5702d449 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -652,6 +652,8 @@ tcExpressionWithIfRequiresParenthesis,"This list or array expression includes an 808,tcLookupMayNotBeUsedHere,"This lookup cannot be used here" 809,tcPropertyIsStatic,"Property '%s' is static" 810,tcPropertyCannotBeSet1,"Property '%s' cannot be set" +810,tcInitOnlyPropertyCannotBeSet1,"Init-only property '%s' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" +810,tcSetterForInitOnlyPropertyCannotBeCalled1,"Cannot call '%s' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" 811,tcConstructorsCannotBeFirstClassValues,"Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'." 812,tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields,"The syntax 'expr.id' may only be used with record labels, properties and fields" 813,tcEventIsStatic,"Event '%s' is static" @@ -1537,6 +1539,8 @@ featureStructActivePattern,"struct representation for active patterns" featureRelaxWhitespace2,"whitespace relaxation v2" featureReallyLongList,"list literals of any size" featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute" +featureRequiredProperties,"support for required properties" +featureInitProperties,"support for consuming init properties" featureLowercaseDUWhenRequireQualifiedAccess,"Allow lowercase DU when RequireQualifiedAccess attribute" 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." @@ -1627,3 +1631,4 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form" 3522,tcAnonRecdDuplicateFieldId,"The field '%s' appears multiple times in this record expression." 3523,tcAnonRecdTypeDuplicateFieldId,"The field '%s' appears multiple times in this anonymous record type." 3524,parsExpectingExpressionInTuple,"Expecting expression" +3545,tcMissingRequiredMembers,"The following required properties have to be initalized:%s" \ No newline at end of file diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 77b93032baa..03401823c1a 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -49,6 +49,8 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | RequiredPropertiesSupport + | InitPropertiesSupport | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management @@ -112,6 +114,8 @@ type LanguageVersion(versionText) = LanguageFeature.BetterExceptionPrinting, previewVersion LanguageFeature.ReallyLongLists, previewVersion LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, previewVersion + LanguageFeature.RequiredPropertiesSupport, previewVersion + LanguageFeature.InitPropertiesSupport, previewVersion LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion ] @@ -212,6 +216,8 @@ type LanguageVersion(versionText) = | LanguageFeature.DelegateTypeNameResolutionFix -> FSComp.SR.featureDelegateTypeNameResolutionFix () | LanguageFeature.ReallyLongLists -> FSComp.SR.featureReallyLongList () | LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess -> FSComp.SR.featureErrorOnDeprecatedRequireQualifiedAccess () + | LanguageFeature.RequiredPropertiesSupport -> FSComp.SR.featureRequiredProperties () + | LanguageFeature.InitPropertiesSupport -> FSComp.SR.featureInitProperties () | LanguageFeature.LowercaseDUWhenRequireQualifiedAccess -> FSComp.SR.featureLowercaseDUWhenRequireQualifiedAccess () /// Get a version string associated with the given feature. diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 8227c947c77..1e2c977a4ad 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -39,6 +39,8 @@ type LanguageFeature = | DelegateTypeNameResolutionFix | ReallyLongLists | ErrorOnDeprecatedRequireQualifiedAccess + | RequiredPropertiesSupport + | InitPropertiesSupport | LowercaseDUWhenRequireQualifiedAccess /// LanguageVersion management diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index ba5f583a3f2..7b42df06495 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -983,6 +983,9 @@ type TcGlobals( tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute" tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute" tryFindSysAttrib "System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute" + tryFindSysAttrib "System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute" + tryFindSysAttrib "System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute" + tryFindSysAttrib "System.Runtime.CompilerServices.RequiredMemberAttribute" ] |> List.choose (Option.map (fun x -> x.TyconRef)) override _.ToString() = "" @@ -1425,6 +1428,9 @@ type TcGlobals( member val attrib_SecurityCriticalAttribute = findSysAttrib "System.Security.SecurityCriticalAttribute" member val attrib_SecuritySafeCriticalAttribute = findSysAttrib "System.Security.SecuritySafeCriticalAttribute" member val attrib_ComponentModelEditorBrowsableAttribute = findSysAttrib "System.ComponentModel.EditorBrowsableAttribute" + member val attrib_CompilerFeatureRequiredAttribute = findSysAttrib "System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute" + member val attrib_SetsRequiredMembersAttribute = findSysAttrib "System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute" + member val attrib_RequiredMemberAttribute = findSysAttrib "System.Runtime.CompilerServices.RequiredMemberAttribute" member g.improveType tcref tinst = improveTy tcref tinst diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index bf85ca94337..8052182cecb 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -187,6 +187,11 @@ Notace expr[idx] pro indexování a vytváření řezů + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation rozhraní s vícenásobným obecným vytvářením instancí @@ -257,6 +262,11 @@ relaxace whitespace v2 + + support for required properties + support for required properties + + resumable state machines obnovitelné stavové stroje @@ -707,6 +717,11 @@ Tento výraz používá implicitní převod {0} pro převod typu {1} na typ {2}. Přečtěte si téma https://aka.ms/fsharp-implicit-convs. Toto upozornění může být vypnuté pomocí '#nowarn \"3391\". + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. Atribut InlineIfLambda je možné použít pouze u parametrů vložených funkcí metod s typem funkce nebo typem delegáta F#. @@ -772,6 +787,11 @@ K hodnotě označené jako literál se {0} nedá přiřadit. + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later Použití metod s atributem NoEagerConstraintApplicationAttribute vyžaduje /langversion:6.0 nebo novější. @@ -852,6 +872,11 @@ Použití obnovitelného kódu nebo obnovitelných stavových strojů vyžaduje /langversion:preview. + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Tento výraz implicitně převede typ {0} na typ {1}. Přečtěte si téma https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 9f1ac3fe78f..3d3dc8c2604 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -187,6 +187,11 @@ expr[idx]-Notation zum Indizieren und Aufteilen + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation Schnittstellen mit mehrfacher generischer Instanziierung @@ -257,6 +262,11 @@ whitespace relaxation v2 + + support for required properties + support for required properties + + resumable state machines Fortsetzbarer Zustand-Maschinen @@ -707,6 +717,11 @@ Dieser Ausdruck verwendet die implizite Konvertierung "{0}", um den Typ "{1}" in den Typ "{2}" zu konvertieren. Siehe https://aka.ms/fsharp-implicit-convs. Diese Warnung kann durch "#nowarn \" 3391 \ " deaktiviert werden. + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. Das "InlineIfLambda-Attribut" darf nur für Parameter von Inlinefunktionen von Methoden verwendet werden, deren Typ ein Funktions-oder F #-Delegattyp ist. @@ -772,6 +787,11 @@ "{0}" kann keinem als Literal markierten Wert zugewiesen werden. + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later Die Verwendung von Methoden mit "NoEagerConstraintApplicationAttribute" erfordert /langversion:6.0 oder höher. @@ -852,6 +872,11 @@ Die Verwendung von Fortsetzbarem Code oder fortsetzbaren Zustandscomputern erfordert /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Dieser Ausdruck konvertiert den Typ "{0}" implizit in den Typ "{1}". Siehe https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 86d3eea3009..ba19316436e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -187,6 +187,11 @@ Notación para indexación y segmentación expr[idx] + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation interfaces con creación de instancias genéricas múltiples @@ -257,6 +262,11 @@ relajación de espacios en blanco v2 + + support for required properties + support for required properties + + resumable state machines máquinas de estado reanudables @@ -707,6 +717,11 @@ Esta expresión usa la conversión implícita '{0}' para convertir el tipo '{1}' al tipo '{2}'. Consulte https://aka.ms/fsharp-implicit-convs. Esta advertencia se puede deshabilitar mediante '#nowarn \"3391\". + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. El atributo "InlineIfLambda" solo se puede usar en los parámetros de funciones insertadas de métodos cuyo tipo es una función o un tipo de delegado F#. @@ -772,6 +787,11 @@ No se puede asignar "{0}" a un valor marcado como literal + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later El uso de métodos con "NoEagerConstraintApplicationAttribute" requiere /langversion:6.0 o posteriores @@ -852,6 +872,11 @@ El uso de código reanudable o de máquinas de estado reanudables requiere /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Esta expresión convierte implícitamente el tipo '{0}' al tipo '{1}'. Consulte https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 7b1a397388f..4ed2c0da2a9 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -187,6 +187,11 @@ Notation expr[idx] pour l’indexation et le découpage + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation interfaces avec plusieurs instanciations génériques @@ -257,6 +262,11 @@ relaxation des espaces blancs v2 + + support for required properties + support for required properties + + resumable state machines ordinateurs d’état pouvant être repris @@ -707,6 +717,11 @@ Cette expression utilise la conversion implicite « {0}<» pour convertir le type « {1} » en type « {2} ». Voir https://aka.ms/fsharp-implicit-convs. Cet avertissement peut être désactivé à l’aide de '#nowarn \"3391\". + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. L’attribut « InlineIfLambda » ne peut être utilisé que sur les paramètres des fonctions incorporées des méthodes dont le type est une fonction ou un type délégué F#. @@ -772,6 +787,11 @@ Impossible d'affecter '{0}' à une valeur marquée comme littérale + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later L’utilisation de méthodes avec « NoEagerConstraintApplicationAttribute » requiert/langversion:6.0 ou ultérieur @@ -852,6 +872,11 @@ L’utilisation de code pouvant être repris ou de machines d’état pouvant être reprises nécessite /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Cette expression convertit implicitement le type « {0} » en type « {1} ». Voir https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 2e60f3efcfe..01af391840a 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -187,6 +187,11 @@ Notazione expr[idx] per l'indicizzazione e il sezionamento + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation interfacce con più creazioni di istanze generiche @@ -257,6 +262,11 @@ uso meno restrittivo degli spazi vuoti v2 + + support for required properties + support for required properties + + resumable state machines macchine a stati ripristinabili @@ -707,6 +717,11 @@ Questa espressione usa la conversione implicita '{0}' per convertire il tipo '{1}' nel tipo '{2}'. Vedere https://aka.ms/fsharp-implicit-convs. Per disabilitare questo avviso, usare '#nowarn \"3391\"'. + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. L'attributo 'InlineIfLambda' può essere usato solo in parametri di funzioni impostate come inline di metodi il cui tipo è un tipo di funzione o delegato F#. @@ -772,6 +787,11 @@ Non è possibile assegnare '{0}' a un valore contrassegnato come letterale + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later L'utilizzo di metodi con 'NoEagerConstraintApplicationAttribute' richiede /langversion: 6.0 o versione successiva @@ -852,6 +872,11 @@ Per l'uso del codice ripristinabile o delle macchine a stati ripristinabili è richiesto /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Questa espressione converte in modo implicito il tipo '{0}' nel tipo '{1}'. Vedere https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 247420814f0..54fbab4b514 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -187,6 +187,11 @@ インデックス作成とスライス用の expr[idx] 表記 + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation 複数のジェネリックのインスタンス化を含むインターフェイス @@ -257,6 +262,11 @@ whitespace relaxation v2 + + support for required properties + support for required properties + + resumable state machines 再開可能なステート マシン @@ -707,6 +717,11 @@ この式では、暗黙的な変換 '{0}' を使用して、型 '{1}' を型 '{2}' に変換しています。https://aka.ms/fsharp-implicit-convs をご確認ください。'#nowarn\"3391\" を使用して、この警告を無効にできる可能性があります。 + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. 'InlineIfLambda' 属性を使用できるのは、型が関数または F# デリゲート型であるメソッドのインライン関数のパラメーターに対してのみです。 @@ -772,6 +787,11 @@ リテラルとしてマークされた値に '{0}' を割り当てることはできません + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later 'NoEagerConstraintApplicationAttribute' を指定してメソッドを使用するには、/langversion:6.0 以降が必要です @@ -852,6 +872,11 @@ 再開可能なコードまたは再開可能なステート マシンを使用するには、/langversion:preview が必要です + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. この式は、型 '{0}' を型 '{1}' に暗黙的に変換します。https://aka.ms/fsharp-implicit-convs を参照してください。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 98b6ca41d7a..7ed437b2763 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -187,6 +187,11 @@ 인덱싱 및 슬라이싱을 위한 expr[idx] 표기법 + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation 여러 제네릭 인스턴스화가 포함된 인터페이스 @@ -257,6 +262,11 @@ 공백 relaxation v2 + + support for required properties + support for required properties + + resumable state machines 다시 시작 가능한 상태 시스템 @@ -707,6 +717,11 @@ 이 식은 암시적 변환 '{0}'을 사용하여 '{1}' 형식을 '{2}' 형식으로 변환 합니다. https://aka.ms/fsharp-implicit-convs 참조. ’#Nowarn \ "3391\"을 (를) 사용하여 이 경고를 사용 하지 않도록 설정할 수 있습니다. + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. 'InlineIfLambda' 특성은 형식이 함수 또는 F# 대리자 형식인 메서드의 인라인 함수 매개 변수에만 사용할 수 있습니다. @@ -772,6 +787,11 @@ 리터럴로 표시된 값에 '{0}'을(를) 할당할 수 없습니다. + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later 'NoEagerConstraintApplicationAttribute'와 함께 메서드를 사용하려면 /langversion:6.0 이상이 필요합니다. @@ -852,6 +872,11 @@ 다시 시작 가능한 코드 또는 다시 시작 가능한 상태 시스템을 사용하려면 /langversion:preview가 필요합니다. + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. 이 식은 암시적으로 '{0}' 형식을 '{1}' 형식으로 변환 합니다. https://aka.ms/fsharp-implicit-convs 참조 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 033128cec28..19e01c91485 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -187,6 +187,11 @@ notacja wyrażenia expr[idx] do indeksowania i fragmentowania + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation interfejsy z wieloma ogólnymi wystąpieniami @@ -257,6 +262,11 @@ łagodzenie odstępów wer 2 + + support for required properties + support for required properties + + resumable state machines automaty stanów z możliwością wznowienia @@ -707,6 +717,11 @@ W tym wyrażeniu jest używana bezwzględna konwersja "{0}" w celu przekonwertowania typu "{1}" na typ "{2}". Zobacz https://aka.ms/fsharp-implicit-convs. To ostrzeżenie można wyłączyć przy użyciu polecenia "#nowarn \" 3391 \ ". + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. Atrybut "InlineIfLambda" może być używany tylko w przypadku parametrów funkcji z podkreśleniem metod, których typ to funkcja lub typ delegata języka F #. @@ -772,6 +787,11 @@ Nie można przypisać elementu „{0}” do wartości oznaczonej jako literał + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later Używanie metod z atrybutem "NoEagerConstraintApplicationAttribute" wymaga parametru /langversion:6.0 lub nowszego @@ -852,6 +872,11 @@ Używanie kodu z możliwością wznowienia lub automatów stanów z możliwością wznowienia wymaga parametru /langversion: wersja zapoznawcza + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. To wyrażenie bezwzględnie konwertuje typ "{0}" na typ "{1}". Zobacz https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index ac0f596fbb5..615e716bd0f 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -187,6 +187,11 @@ notação expr[idx] para indexação e fatia + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation interfaces com várias instanciações genéricas @@ -257,6 +262,11 @@ relaxamento de espaço em branco v2 + + support for required properties + support for required properties + + resumable state machines máquinas de estado retomável @@ -707,6 +717,11 @@ Essa expressão usa a conversão implícita '{0}' para converter o tipo '{1}' ao tipo '{2}'. Consulte https://aka.ms/fsharp-implicit-convs. Este aviso pode ser desabilitado usando '#nowarn\"3391\". + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. O atributo 'InlineIfLambda' só pode ser usado em parâmetros de funções de métodos em linha cujo tipo seja uma função ou F# tipo delegado. @@ -772,6 +787,11 @@ Não é possível atribuir '{0}' a um valor marcado como literal + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later Usar métodos com 'NoEagerConstraintApplicationAttribute' requer /langversion:6.0 ou posterior @@ -852,6 +872,11 @@ Usar código retomável ou máquinas de estado retomável requer /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Essa expressão converte implicitamente o tipo '{0}' ao tipo '{1}'. Consulte https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 754431737a3..f534378e99f 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -187,6 +187,11 @@ expr[idx] для индексации и среза + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation интерфейсы с множественным универсальным созданием экземпляра @@ -257,6 +262,11 @@ смягчение требований по использованию пробелов, версия 2 + + support for required properties + support for required properties + + resumable state machines возобновляемые конечные автоматы @@ -707,6 +717,11 @@ Это выражение использует неявное преобразование "{0}" для преобразования типа "{1}" в тип "{2}". См. сведения на странице https://aka.ms/fsharp-implicit-convs. Это предупреждение можно отключить, используя параметр '#nowarn \"3391\" + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. Атрибут "InlineIfLambda" может использоваться только в параметрах встраиваемых функций методов, типом которых является функция или делегат F#. @@ -772,6 +787,11 @@ Невозможно присвоить "{0}" значению, помеченному как литерал + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later Для использования методов с "NoEagerConstraintApplicationAttribute" требуется /langversion:6.0 или более поздняя версия @@ -852,6 +872,11 @@ Для использования возобновляемого кода или возобновляемых конечных автоматов требуется /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Это выражение неявно преобразует тип "{0}" в тип "{1}". См. сведения на странице https://aka.ms/fsharp-implicit-convs. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 90c225e3926..70335d09d9d 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -187,6 +187,11 @@ Dizin oluşturma ve dilimleme için expr[idx] gösterimi + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation birden çok genel örnek oluşturma içeren arabirimler @@ -257,6 +262,11 @@ boşluk ilişkilendirme v2 + + support for required properties + support for required properties + + resumable state machines sürdürülebilir durum makineleri @@ -707,6 +717,11 @@ Bu ifade '{1}' türünü '{2}' türüne dönüştürmek için '{0}' örtük dönüştürmesini kullanır. https://aka.ms/fsharp-implicit-convs adresine bakın. Bu uyarı '#nowarn \"3391\" kullanılarak devre dışı bırakılabilir. + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. 'InlineIfLambda' özniteliği yalnızca işlev veya F# temsilci türündeki yöntemlerin satır içine alınmış işlev parametrelerinde kullanılabilir. @@ -772,6 +787,11 @@ Sabit değer olarak işaretlenen bir değere '{0}' atanamaz + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later 'NoEagerConstraintApplicationAttribute' içeren yöntemlerin kullanılması /langversion:6.0 veya üstünü gerektiriyor @@ -852,6 +872,11 @@ Sürdürülebilir kod veya sürdürülebilir durum makinelerini kullanmak için /langversion:preview gerekir + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. Bu ifade '{0}' türünü örtülü olarak '{1}' türüne dönüştürür. https://aka.ms/fsharp-implicit-convs adresine bakın. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index f0d4d5b8176..4e7e55a375c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -187,6 +187,11 @@ 用于索引和切片的 expr[idx] 表示法 + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation 具有多个泛型实例化的接口 @@ -257,6 +262,11 @@ 空格放空 v2 + + support for required properties + support for required properties + + resumable state machines 可恢复状态机 @@ -707,6 +717,11 @@ 此表达式使用隐式转换“{0}”将类型“{1}”转换为类型“{2}”。请参阅 https://aka.ms/fsharp-implicit-convs。可使用 '#nowarn \"3391\" 禁用此警告。 + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. "InlineIfLambda" 特性只能用于类型为函数或 F# 委托类型的方法的内联函数的参数。 @@ -772,6 +787,11 @@ 无法将“{0}”分配给标记为文本的值 + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later 将方法与 “NoEagerConstraintApplicationAttribute” 配合使用需要 /langversion:6.0 或更高版本 @@ -852,6 +872,11 @@ 使用可恢复代码或可恢复状态机需要 /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. 此表达式将类型“{0}”隐式转换为类型“{1}”。请参阅 https://aka.ms/fsharp-implicit-convs。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index a4de4d17e8e..965a9c231b6 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -187,6 +187,11 @@ 用於編製索引和分割的 expr[idx] 註釋 + + support for consuming init properties + support for consuming init properties + + interfaces with multiple generic instantiation 具有多個泛型具現化的介面 @@ -257,6 +262,11 @@ 空格鍵放鬆 v2 + + support for required properties + support for required properties + + resumable state machines 可繼續的狀態機器 @@ -707,6 +717,11 @@ 此運算式使用隱含轉換 '{0}' 將類型 '{1}' 轉換為類型 '{2}'。請參閱 https://aka.ms/fsharp-implicit-convs。可使用 '#nowarn \"3391\" 停用此警告。 + + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type. 'InlineIfLambda' 屬性只能用於類型為函式或 F# 委派類型之方法的內嵌函式參數。 @@ -772,6 +787,11 @@ 無法將 '{0}' 指派給標記為常值的值 + + The following required properties have to be initalized:{0} + The following required properties have to be initalized:{0} + + Using methods with 'NoEagerConstraintApplicationAttribute' requires /langversion:6.0 or later 使用具有 'NoEagerConstraintApplicationAttribute' 的方法需要 /langversion:6.0 或更新版本 @@ -852,6 +872,11 @@ 使用可繼續的程式碼或可繼續的狀態機器需要 /langversion:preview + + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + + This expression implicitly converts type '{0}' to type '{1}'. See https://aka.ms/fsharp-implicit-convs. 此運算式將類型 '{0}' 隱含轉換為類型 '{1}'。請參閱 https://aka.ms/fsharp-implicit-convs。 diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 8ff0d9ce1db..c7861509686 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -124,7 +124,6 @@ - @@ -160,8 +159,15 @@ + + %(RelativeDir)\TestSource\%(Filename)%(Extension) + + + %(RelativeDir)\TestSource\%(Filename)%(Extension) + - + + @@ -185,12 +191,6 @@ %(RelativeDir)\BaseLine\%(Filename)%(Extension) - - %(RelativeDir)\TestSource\%(Filename)%(Extension) - - - %(RelativeDir)\TestSource\%(Filename)%(Extension) - diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs new file mode 100644 index 00000000000..90ba1699311 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +namespace FSharp.Compiler.ComponentTests.Interop + +open Xunit +open FSharp.Test.Compiler +open FSharp.Test +open System + +module ``Required and init-only properties`` = + + let csharpBaseClass = + CSharp """ + namespace RequiredAndInitOnlyProperties + { + public sealed class RAIO + { + public int GetSet { get; set; } + public int GetInit { get; init; } + public RAIO GetThis() => this; + } + + }""" |> withCSharpLanguageVersion CSharpLanguageVersion.Preview |> withName "csLib" + + let csharpRBaseClass = + CSharp """ + // Until we move to .NET7 runtime (or use experimental) + namespace System.Runtime.CompilerServices + { + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] + public sealed class RequiredMemberAttribute : Attribute { } + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] + public sealed class CompilerFeatureRequiredAttribute : Attribute + { + public CompilerFeatureRequiredAttribute(string featureName) + { + FeatureName = featureName; + } + public string FeatureName { get; } + public bool IsOptional { get; init; } + public const string RefStructs = nameof(RefStructs); + public const string RequiredMembers = nameof(RequiredMembers); + } + } + + namespace RequiredAndInitOnlyProperties + { + public sealed class RAIO + { + public required int GetSet { get; set; } + public required int GetInit { get; init; } + } + + }""" |> withCSharpLanguageVersion CSharpLanguageVersion.Preview |> withName "csLib" + + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can init both set and init-only`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + + if raio.GetSet <> 1 then + failwith $"Unexpected result %d{raio.GetSet}" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can change set property`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + + if raio.GetSet <> 1 then + failwith $"Unexpected result %d{raio.GetSet}" + + raio.GetSet <- 0 + + if raio.GetSet <> 0 then + failwith $"Unexpected result %d{raio.GetSet}" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can change set property via calling an explicit setter`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + + if raio.GetSet <> 1 then + failwith $"Unexpected result %d{raio.GetSet}" + + raio.set_GetSet(0) + + if raio.GetSet <> 0 then + failwith $"Unexpected result %d{raio.GetSet}" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can get property via calling an explicit getter`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + + if raio.get_GetSet() <> 1 then + failwith $"Unexpected result %d{raio.GetSet}" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# cannot change init-only property`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + raio.GetInit <- 0 + + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 810, Line 9, Col 5, Line 9, Col 17, "Init-only property 'GetInit' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" + ] + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# cannot change init-only property via calling an explicit setter`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet = 1, GetInit = 2) + raio.set_GetInit(0) + + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 810, Line 9, Col 5, Line 9, Col 21, "Cannot call 'set_GetInit' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" + ] + + #if !NETCOREAPP + [] +#else + [] +#endif + let ``F# cannot change init-only property via calling an initializer on instance`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO() + raio.GetThis(GetSet=2, GetInit = 42) |> ignore + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 810, Line 9, Col 38, Line 9, Col 40, "Init-only property 'GetInit' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" + ] + + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# should produce compile-time error when required properties are not specified in the initializer`` () = + + let csharpLib = csharpRBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO() + + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 3545, Line 8, Col 16, Line 8, Col 22, "The following required properties have to be initalized:" + Environment.NewLine + " property RAIO.GetSet: int with get, set" + Environment.NewLine + " property RAIO.GetInit: int with get, set" + ] + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# should produce compile-time error when some required properties are not specified in the initializer`` () = + + let csharpLib = csharpRBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet=1) + + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 3545, Line 8, Col 16, Line 8, Col 30, "The following required properties have to be initalized:" + Environment.NewLine + " property RAIO.GetInit: int with get, set" + ] + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# should not produce compile-time error when all required properties are specified in the initializer`` () = + + let csharpLib = csharpRBaseClass + + let fsharpSource = + """ +open System +open RequiredAndInitOnlyProperties + +[] +let main _ = + + let raio = RAIO(GetSet=1, GetInit=2) + + if raio.GetSet <> 1 then + failwith "Unexpected value" + + if raio.GetInit <> 2 then + failwith "Unexpected value" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``F# should only be able to explicitly call constructors which set SetsRequiredMembersAttribute`` () = + + let csharpLib = + CSharp """ + // Until we move to .NET7 runtime (or use experimental) + namespace System.Runtime.CompilerServices + { + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] + public sealed class RequiredMemberAttribute : Attribute { } + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] + public sealed class CompilerFeatureRequiredAttribute : Attribute + { + public CompilerFeatureRequiredAttribute(string featureName) + { + FeatureName = featureName; + } + public string FeatureName { get; } + public bool IsOptional { get; init; } + public const string RefStructs = nameof(RefStructs); + public const string RequiredMembers = nameof(RequiredMembers); + } + } + + namespace System.Diagnostics.CodeAnalysis + { + [AttributeUsage(AttributeTargets.Constructor, AllowMultiple=false, Inherited=false)] + public sealed class SetsRequiredMembersAttribute : Attribute {} + } + + namespace RequiredAndInitOnlyProperties + { + using System.Runtime.CompilerServices; + using System.Diagnostics.CodeAnalysis; + + public sealed class RAIO + { + public required int GetSet { get; set; } + public required int GetInit { get; init; } + [SetsRequiredMembers] + public RAIO(int foo) {} // Should be legal to call any constructor which does have "SetsRequiredMembersAttribute" + public RAIO(int foo, int bar) {} // Should be illegal to call any constructor which does not have "SetsRequiredMembersAttribute" + } + + }""" |> withCSharpLanguageVersion CSharpLanguageVersion.Preview |> withName "csLib" + + let fsharpSource = + """ + open System + open RequiredAndInitOnlyProperties + + [] + let main _ = + let _raio = RAIO(1) + 0 + """ + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + |> ignore + + let fsharpSource2 = + """ + open System + open RequiredAndInitOnlyProperties + + [] + let main _ = + let _raio = RAIO(1,2) + 0 + """ + FSharp fsharpSource2 + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldFail + |> withSingleDiagnostic (Error 3545, Line 7, Col 21, Line 7, Col 30, "The following required properties have to be initalized:" + Environment.NewLine + " property RAIO.GetSet: int with get, set" + Environment.NewLine + " property RAIO.GetInit: int with get, set") + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# should produce a warning if RequiredMemberAttribute is specified`` () = + // TODO: This test will start failing with different reason when we will move to .NET7, since RequiredMemberArgument will be in System.Runtime.*.dll. + // It will needs to be fixed then. + let fsharpSource = + """ +namespace FooBarBaz +open System +open System.Runtime.CompilerServices + +type RAIOFS() = + [] + member val GetSet = 0 with get, set +""" + FSharp fsharpSource + |> asLibrary + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 39 \ No newline at end of file diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 54822b93d80..574d7dae1ee 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -452,6 +452,11 @@ module rec Compiler = let withRefOut (name:string) (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--refout:{name}" ] "withNoInterfaceData is only supported for F#" cUnit + let withCSharpLanguageVersion (ver: CSharpLanguageVersion) (cUnit: CompilationUnit) : CompilationUnit = + match cUnit with + | CS cs -> CS { cs with LangVersion = ver } + | _ -> failwith "Only supported in C#" + let asLibrary (cUnit: CompilationUnit) : CompilationUnit = match cUnit with | FS fs -> FS { fs with OutputType = CompileOutput.Library } diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb index f8633f96b78..98df251d91a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPageBase.vb @@ -4,11 +4,11 @@ Imports EnvDTE Imports Microsoft.VisualBasic Imports System -Imports System.IO Imports System.Collections Imports System.ComponentModel Imports System.Diagnostics Imports System.Drawing +Imports System.IO Imports System.Windows.Forms Imports System.Runtime.InteropServices From 5b117cc56f22c3b0e31ad94c62ea725339a356f8 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 09:22:06 -0700 Subject: [PATCH 072/226] Remove NO_WIN_REGISTRY (#13579) * Remove NO_WIN_REGISTRY * profile --- src/Compiler/Facilities/CompilerLocation.fs | 133 ------------------ .../SimulatedMSBuildReferenceResolver.fs | 44 ------ 2 files changed, 177 deletions(-) diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 9453c72f1af..d222446b933 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -9,10 +9,6 @@ open System.Reflection open System.Runtime.InteropServices open Microsoft.FSharp.Core -#if !FX_NO_WIN_REGISTRY -open Microsoft.Win32 -#endif - #nowarn "44" // ConfigurationSettings is obsolete but the new stuff is horribly complicated. module internal FSharpEnvironment = @@ -47,16 +43,6 @@ module internal FSharpEnvironment = let isRunningOnCoreClr = typeof.Assembly.FullName.StartsWith ("System.Private.CoreLib", StringComparison.InvariantCultureIgnoreCase) -#if !FX_NO_WIN_REGISTRY - [] - extern uint32 RegOpenKeyExW(UIntPtr _hKey, string _lpSubKey, uint32 _ulOptions, int _samDesired, UIntPtr& _phkResult) - - [] - extern uint32 RegQueryValueExW(UIntPtr _hKey, string _lpValueName, uint32 _lpReserved, uint32& _lpType, IntPtr _lpData, int& _lpchData) - - [] - extern uint32 RegCloseKey(UIntPtr _hKey) -#endif module Option = /// Convert string into Option string where null and String.Empty result in None let ofString s = @@ -67,88 +53,6 @@ module internal FSharpEnvironment = let maxPath = 260 let maxDataLength = (System.Text.UTF32Encoding()).GetMaxByteCount(maxPath) -#if !FX_NO_WIN_REGISTRY - let KEY_WOW64_DEFAULT = 0x0000 - let KEY_WOW64_32KEY = 0x0200 - let HKEY_LOCAL_MACHINE = UIntPtr(0x80000002u) - let KEY_QUERY_VALUE = 0x1 - let REG_SZ = 1u - - let GetDefaultRegistryStringValueViaDotNet (subKey: string) = - Option.ofString ( - try - downcast Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\\" + subKey, null, null) - with e -> -#if DEBUG - Debug.Assert(false, sprintf "Failed in GetDefaultRegistryStringValueViaDotNet: %s" (e.ToString())) -#endif - null - ) - - let Get32BitRegistryStringValueViaPInvoke (subKey: string) = - Option.ofString ( - try - // 64 bit flag is not available <= Win2k - let options = - let hasWow6432Node = - use x = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node") - x <> null - - try - match hasWow6432Node with - | true -> KEY_WOW64_32KEY - | false -> KEY_WOW64_DEFAULT - with _ -> - KEY_WOW64_DEFAULT - - let mutable hkey = UIntPtr.Zero - let pathResult = Marshal.AllocCoTaskMem(maxDataLength) - - try - let res = - RegOpenKeyExW(HKEY_LOCAL_MACHINE, subKey, 0u, KEY_QUERY_VALUE ||| options, &hkey) - - if res = 0u then - let mutable uType = REG_SZ - let mutable cbData = maxDataLength - - let res = RegQueryValueExW(hkey, null, 0u, &uType, pathResult, &cbData) - - if (res = 0u && cbData > 0 && cbData <= maxDataLength) then - Marshal.PtrToStringUni(pathResult, (cbData - 2) / 2) - else - null - else - null - finally - if hkey <> UIntPtr.Zero then RegCloseKey(hkey) |> ignore - - if pathResult <> IntPtr.Zero then - Marshal.FreeCoTaskMem(pathResult) - with e -> -#if DEBUG - Debug.Assert(false, sprintf "Failed in Get32BitRegistryStringValueViaPInvoke: %s" (e.ToString())) -#endif - null - ) - - let is32Bit = IntPtr.Size = 4 - - let tryRegKey (subKey: string) = - - if is32Bit then - let s = GetDefaultRegistryStringValueViaDotNet(subKey) - // If we got here AND we're on a 32-bit OS then we can validate that Get32BitRegistryStringValueViaPInvoke(...) works - // by comparing against the result from GetDefaultRegistryStringValueViaDotNet(...) -#if DEBUG - let viaPinvoke = Get32BitRegistryStringValueViaPInvoke(subKey) - Debug.Assert((s = viaPinvoke), sprintf "32bit path: pi=%A def=%A" viaPinvoke s) -#endif - s - else - Get32BitRegistryStringValueViaPInvoke(subKey) -#endif - let internal tryCurrentDomain () = let pathFromCurrentDomain = AppDomain.CurrentDomain.BaseDirectory @@ -193,43 +97,6 @@ module internal FSharpEnvironment = with e -> None -#if !FX_NO_WIN_REGISTRY - // Apply the given function to the registry entry corresponding to the subKey. - // The reg key is disposed at the end of the scope. - let useKey subKey f = - let key = Registry.LocalMachine.OpenSubKey subKey - - try - f key - finally - match key with - | null -> () - | _ -> key.Dispose() - - // Check if the framework version 4.5 or above is installed at the given key entry - let IsNetFx45OrAboveInstalledAt subKey = - try - useKey subKey (fun regKey -> - match regKey with - | null -> false - | _ -> regKey.GetValue("Release", 0) :?> int |> (fun s -> s >= 0x50000)) // 0x50000 implies 4.5.0 - with _ -> - false - - // Check if the framework version 4.5 or above is installed - let IsNetFx45OrAboveInstalled = - IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" - || IsNetFx45OrAboveInstalledAt @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" - - // Check if the running framework version is 4.5 or above. - // Use the presence of v4.5.x in the registry to distinguish between 4.0 and 4.5 - let IsRunningOnNetFx45OrAbove = - let version = new Version(versionOf) - let major = version.Major - major > 4 || (major = 4 && IsNetFx45OrAboveInstalled) - -#endif - // Specify the tooling-compatible fragments of a path such as: // typeproviders/fsharp41/net461/MyProvider.DesignTime.dll // tools/fsharp41/net461/MyProvider.DesignTime.dll diff --git a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs index 2dfeb45460d..21d3260c5c8 100644 --- a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs +++ b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs @@ -9,10 +9,6 @@ open Microsoft.Build.Utilities open Internal.Utilities.Library open FSharp.Compiler.IO -#if !FX_NO_WIN_REGISTRY -open Microsoft.Win32 -#endif - // ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released // 1. List of frameworks // 2. DeriveTargetFrameworkDirectoriesFor45Plus @@ -129,42 +125,6 @@ let private SimulatedMSBuildResolver = logWarningOrError ) = -#if !FX_NO_WIN_REGISTRY - let registrySearchPaths () = - [ - let registryKey = @"Software\Microsoft\.NetFramework" - use key = Registry.LocalMachine.OpenSubKey registryKey - - match key with - | null -> () - | _ -> - for subKeyName in key.GetSubKeyNames() do - use subKey = key.OpenSubKey subKeyName - use subSubKey = subKey.OpenSubKey("AssemblyFoldersEx") - - match subSubKey with - | null -> () - | _ -> - for subSubSubKeyName in subSubKey.GetSubKeyNames() do - use subSubSubKey = subSubKey.OpenSubKey subSubSubKeyName - - match subSubSubKey.GetValue null with - | :? string as s -> yield s - | _ -> () - - use subSubKey = key.OpenSubKey("AssemblyFolders") - - match subSubKey with - | null -> () - | _ -> - for subSubSubKeyName in subSubKey.GetSubKeyNames() do - let subSubSubKey = subSubKey.OpenSubKey subSubSubKeyName - - match subSubSubKey.GetValue null with - | :? string as s -> yield s - | _ -> () - ] -#endif let results = ResizeArray() @@ -174,10 +134,6 @@ let private SimulatedMSBuildResolver = yield! explicitIncludeDirs yield fsharpCoreDir yield implicitIncludeDir -#if !FX_NO_WIN_REGISTRY - if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then - yield! registrySearchPaths () -#endif yield! GetPathToDotNetFrameworkReferenceAssemblies targetFrameworkVersion yield! GetPathToDotNetFrameworkImlpementationAssemblies targetFrameworkVersion ] From a9a0ef333aa7cab866309d287096139f9f9b7313 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 29 Jul 2022 16:22:38 +0000 Subject: [PATCH 073/226] Update dependencies from https://github.com/dotnet/arcade build 20220728.16 (#13591) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 4 +- eng/common/build.sh | 2 +- eng/common/cross/build-rootfs.sh | 37 ++++++++++++------ eng/common/cross/riscv64/sources.list.sid | 1 + eng/common/cross/toolchain.cmake | 47 ++++++++++++----------- global.json | 2 +- 6 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 eng/common/cross/riscv64/sources.list.sid diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bba8ceb550a..d682c728f34 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 7df67590fb080663ada77f269a8b132ef127a039 + 6f93ec8da69a42fbe9a702a33e104f94773c3f03 diff --git a/eng/common/build.sh b/eng/common/build.sh index 9031d41eab8..50af40cdd2c 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -19,7 +19,7 @@ usage() echo "Actions:" echo " --restore Restore dependencies (short: -r)" echo " --build Build solution (short: -b)" - echo " --source-build Source-build the solution (short: -sb)" + echo " --sourceBuild Source-build the solution (short: -sb)" echo " Will additionally trigger the following actions: --restore, --build, --pack" echo " If --configuration is not set explicitly, will also set it to 'Release'" echo " --rebuild Rebuild solution" diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 77eaac60c8c..f058c98763a 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -5,7 +5,7 @@ set -e usage() { echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir ]" - echo "BuildArch can be: arm(default), armel, arm64, x86, x64" + echo "BuildArch can be: arm(default), arm64, armel, armv6, ppc64le, riscv64, s390x, x64, x86" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo " for FreeBSD can be: freebsd12, freebsd13" echo " for illumos can be: illumos." @@ -104,15 +104,6 @@ while :; do __AlpineArch=armv7 __QEMUArch=arm ;; - armv6) - __BuildArch=armv6 - __UbuntuArch=armhf - __QEMUArch=arm - __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" - __CodeName=buster - __LLDB_Package="liblldb-6.0-dev" - __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg" - ;; arm64) __BuildArch=arm64 __UbuntuArch=arm64 @@ -127,6 +118,18 @@ while :; do __UbuntuRepo="http://ftp.debian.org/debian/" __CodeName=jessie ;; + armv6) + __BuildArch=armv6 + __UbuntuArch=armhf + __QEMUArch=arm + __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" + __CodeName=buster + __LLDB_Package="liblldb-6.0-dev" + + if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then + __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg" + fi + ;; ppc64le) __BuildArch=ppc64le __UbuntuArch=ppc64el @@ -136,6 +139,18 @@ while :; do __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') unset __LLDB_Package ;; + riscv64) + __BuildArch=riscv64 + __UbuntuArch=riscv64 + __UbuntuRepo="http://deb.debian.org/debian-ports" + __CodeName=sid + __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') + unset __LLDB_Package + + if [[ -e "/usr/share/keyrings/debian-ports-archive-keyring.gpg" ]]; then + __Keyring="--keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --include=debian-ports-archive-keyring" + fi + ;; s390x) __BuildArch=s390x __UbuntuArch=s390x @@ -390,7 +405,7 @@ elif [[ -n "$__CodeName" ]]; then popd fi elif [[ "$__Tizen" == "tizen" ]]; then - ROOTFS_DIR="$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh" + ROOTFS_DIR="$__RootfsDir" "$__CrossDir/$__BuildArch/tizen-build-rootfs.sh" else echo "Unsupported target platform." usage; diff --git a/eng/common/cross/riscv64/sources.list.sid b/eng/common/cross/riscv64/sources.list.sid new file mode 100644 index 00000000000..65f730d224c --- /dev/null +++ b/eng/common/cross/riscv64/sources.list.sid @@ -0,0 +1 @@ +deb http://deb.debian.org/debian-ports sid main diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index d5dfc13504b..909117759e6 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -19,13 +19,7 @@ elseif(EXISTS ${CROSS_ROOTFS}/android_platform) set(ANDROID 1) endif() -if(TARGET_ARCH_NAME STREQUAL "armel") - set(CMAKE_SYSTEM_PROCESSOR armv7l) - set(TOOLCHAIN "arm-linux-gnueabi") - if(TIZEN) - set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/9.2.0") - endif() -elseif(TARGET_ARCH_NAME STREQUAL "arm") +if(TARGET_ARCH_NAME STREQUAL "arm") set(CMAKE_SYSTEM_PROCESSOR armv7l) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf) set(TOOLCHAIN "armv7-alpine-linux-musleabihf") @@ -37,13 +31,6 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm") if(TIZEN) set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0") endif() -elseif(TARGET_ARCH_NAME STREQUAL "armv6") - set(CMAKE_SYSTEM_PROCESSOR armv6l) - if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf) - set(TOOLCHAIN "armv6-alpine-linux-musleabihf") - else() - set(TOOLCHAIN "arm-linux-gnueabihf") - endif() elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) @@ -56,18 +43,28 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") elseif(FREEBSD) set(triple "aarch64-unknown-freebsd12") endif() +elseif(TARGET_ARCH_NAME STREQUAL "armel") + set(CMAKE_SYSTEM_PROCESSOR armv7l) + set(TOOLCHAIN "arm-linux-gnueabi") + if(TIZEN) + set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/9.2.0") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "armv6") + set(CMAKE_SYSTEM_PROCESSOR armv6l) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf) + set(TOOLCHAIN "armv6-alpine-linux-musleabihf") + else() + set(TOOLCHAIN "arm-linux-gnueabihf") + endif() elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") set(CMAKE_SYSTEM_PROCESSOR ppc64le) set(TOOLCHAIN "powerpc64le-linux-gnu") +elseif(TARGET_ARCH_NAME STREQUAL "riscv64") + set(CMAKE_SYSTEM_PROCESSOR riscv64) + set(TOOLCHAIN "riscv64-linux-gnu") elseif(TARGET_ARCH_NAME STREQUAL "s390x") set(CMAKE_SYSTEM_PROCESSOR s390x) set(TOOLCHAIN "s390x-linux-gnu") -elseif(TARGET_ARCH_NAME STREQUAL "x86") - set(CMAKE_SYSTEM_PROCESSOR i686) - set(TOOLCHAIN "i686-linux-gnu") - if(TIZEN) - set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") - endif() elseif(TARGET_ARCH_NAME STREQUAL "x64") set(CMAKE_SYSTEM_PROCESSOR x86_64) if(LINUX) @@ -80,8 +77,14 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") elseif(ILLUMOS) set(TOOLCHAIN "x86_64-illumos") endif() +elseif(TARGET_ARCH_NAME STREQUAL "x86") + set(CMAKE_SYSTEM_PROCESSOR i686) + set(TOOLCHAIN "i686-linux-gnu") + if(TIZEN) + set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") + endif() else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, ppc64le, s390x and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, ppc64le, riscv64, s390x, x64 and x86 are supported!") endif() if(DEFINED ENV{TOOLCHAIN}) @@ -226,7 +229,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/global.json b/global.json index b0245e8e4eb..39c5497feee 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22377.15", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22378.16", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 32b789d51d318bad8d5e44e54d0ef8b54e10f3d9 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 09:23:41 -0700 Subject: [PATCH 074/226] Simplify errors from msbuild (#13538) * Reduce platform differences * newline * temp * temp * change switch name * temp --- eng/build.sh | 47 ++++--- src/Compiler/Driver/CompilerImports.fs | 21 +-- .../CompilerOptions/fsc/reference.fs | 126 ++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 2 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 5 +- .../fsc/reference/EscapeChars01.fs | 4 - .../fsc/reference/EscapeChars02.fs | 5 - .../fsc/reference/MissingDLL.fs | 5 - .../fsc/reference/MissingDLL.fsx | 6 - .../fsc/reference/MissingEXE.fs | 6 - .../fsc/reference/MissingEXE.fsx | 6 - .../CompilerOptions/fsc/reference/env.lst | 17 --- tests/fsharpqa/Source/test.lst | 1 - .../Tests.LanguageService.ErrorList.fs | 2 +- .../Tests.LanguageService.Script.fs | 2 +- 15 files changed, 163 insertions(+), 92 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reference.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars01.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars02.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/reference/env.lst diff --git a/eng/build.sh b/eng/build.sh index 8bac7ce52b9..16ecfaf3067 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -8,30 +8,31 @@ set -u usage() { echo "Common settings:" - echo " --configuration Build configuration: 'Debug' or 'Release' (short: -c)" - echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" - echo " --binaryLog Create MSBuild binary log (short: -bl)" + echo " --configuration Build configuration: 'Debug' or 'Release' (short: -c)" + echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" + echo " --binaryLog Create MSBuild binary log (short: -bl)" echo "" echo "Actions:" - echo " --bootstrap Force the build of the bootstrap compiler" - echo " --restore Restore projects required to build (short: -r)" - echo " --norestore Don't restore projects required to build" - echo " --build Build all projects (short: -b)" - echo " --rebuild Rebuild all projects" - echo " --pack Build nuget packages" - echo " --publish Publish build artifacts" - echo " --help Print help and exit" + echo " --bootstrap Force the build of the bootstrap compiler" + echo " --restore Restore projects required to build (short: -r)" + echo " --norestore Don't restore projects required to build" + echo " --build Build all projects (short: -b)" + echo " --rebuild Rebuild all projects" + echo " --pack Build nuget packages" + echo " --publish Publish build artifacts" + echo " --help Print help and exit" echo "" echo "Test actions:" - echo " --testcoreclr Run unit tests on .NET Core (short: --test, -t)" + echo " --testcoreclr Run unit tests on .NET Core (short: --test, -t)" + echo " --testCompilerComponentTests Run FSharp.Compiler.ComponentTests on .NET Core" echo "" echo "Advanced settings:" - echo " --ci Building in CI" - echo " --docker Run in a docker container if applicable" - echo " --skipAnalyzers Do not run analyzers during build operations" - echo " --skipBuild Do not run the build" - echo " --prepareMachine Prepare machine for CI run, clean up processes after build" - echo " --sourceBuild Simulate building for source-build" + echo " --ci Building in CI" + echo " --docker Run in a docker container if applicable" + echo " --skipAnalyzers Do not run analyzers during build operations" + echo " --skipBuild Do not run the build" + echo " --prepareMachine Prepare machine for CI run, clean up processes after build" + echo " --sourceBuild Simulate building for source-build" echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -54,7 +55,7 @@ rebuild=false pack=false publish=false test_core_clr=false - +test_compilercomponent_tests=false configuration="Debug" verbosity='minimal' binary_log=false @@ -122,6 +123,9 @@ while [[ $# > 0 ]]; do --testcoreclr|--test|-t) test_core_clr=true ;; + --testcompilercomponenttests) + test_compilercomponent_tests=true + ;; --ci) ci=true ;; @@ -317,4 +321,9 @@ if [[ "$test_core_clr" == true ]]; then TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework fi +if [[ "$test_compilercomponent_tests" == true ]]; then + coreclrtestframework=net6.0 + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter +fi + ExitWithExitCode 0 diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 1e63aa45dd5..c40ce184463 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -451,30 +451,15 @@ type TcConfig with raise (FileNameNotResolved(nm, searchMessage, m)) | CcuLoadFailureAction.ReturnNone -> None - member tcConfig.MsBuildResolve(references, mode, errorAndWarningRange, showMessages) = + member tcConfig.MsBuildResolve(references, _, errorAndWarningRange, showMessages) = let logMessage showMessages = if showMessages && tcConfig.showReferenceResolutions then (fun (message: string) -> printfn "%s" message) else ignore - let logDiagnostic showMessages = - (fun isError code message -> - if showMessages && mode = ResolveAssemblyReferenceMode.ReportErrors then - if isError then - errorR (MSBuildReferenceResolutionError(code, message, errorAndWarningRange)) - else - match code with - // These are warnings that mean 'not resolved' for some assembly. - // Note that we don't get to know the name of the assembly that couldn't be resolved. - // Ignore these and rely on the logic below to emit an error for each unresolved reference. - | "MSB3246" // Resolved file has a bad image, no metadata, or is otherwise inaccessible. - | "MSB3106" -> () - | _ -> - if code = "MSB3245" then - errorR (MSBuildReferenceResolutionWarning(code, message, errorAndWarningRange)) - else - warning (MSBuildReferenceResolutionWarning(code, message, errorAndWarningRange))) + let logDiagnostic _ = + (fun (_: bool) (_: string) (_: string) -> ()) let targetProcessorArchitecture = match tcConfig.platform with diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reference.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reference.fs new file mode 100644 index 00000000000..4eb4968788b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reference.fs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.ComponentTests.CompilerOptions.fsc + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module reference = + + let source = + FSharp """ + namespace Hello.World + """ + + //SOURCE=EscapeChars01.fs SCFLAGS="-r:a\\b\\n.dll" # EscapeChars01.fs (-r:) + [] + let ``EscapeChars01`` () = + source + |> asFs + |> withOptions ["-r:a\\b\\n.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'a\b\n.dll' was not found or is invalid""") + ] + + //SOURCE=EscapeChars02.fs SCFLAGS="-r:.\\r.dll -r:..\\n\\r\\a.dll" # EscapeChars02.fs (-r: ) + [] + let ``EscapeChars02a`` () = + source + |> asFs + |> withOptions ["-r:.\\r.dll -r:..\\n\\r\\a.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference '.\r.dll -r:..\n\r\a.dll' was not found or is invalid""") + ] + + //SOURCE=EscapeChars02.fs SCFLAGS="-r .\\r.dll -r:..\\n\\r\\a.dll" # EscapeChars02.fs (-r ) + [] + let ``EscapeChars02b`` () = + source + |> asFs + |> withOptions ["-r:.\\r.dll -r:..\\n\\r\\a.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference '.\r.dll -r:..\n\r\a.dll' was not found or is invalid""") + ] + + //SOURCE=MissingDLL.fs SCFLAGS="-r:MissingDLL.dll" # MissingDLL.fs + [] + let ``MissingDLL_fs_a`` () = + source + |> asFs + |> withOptions ["-r:MissingDLL.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingDLL.dll' was not found or is invalid""") + ] + + //SOURCE=MissingEXE.fs SCFLAGS="-r:MissingEXE.exe" # MissingEXE.fs + [] + let ``MissingEXE_fs_a`` () = + source + |> asFs + |> withOptions ["-r:MissingEXE.exe"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingEXE.exe' was not found or is invalid""") + ] + + //SOURCE=MissingDLL.fsx SCFLAGS="-r:MissingDLL.dll" FSIMODE=EXEC # MissingDLL.fsx (-r:) + [] + let ``MissingDLL_fsx_a`` () = + source + |> asFsx + |> withOptions ["-r:MissingDLL.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingDLL.dll' was not found or is invalid""") + ] + + //SOURCE=MissingDLL.fsx SCFLAGS="-r MissingDLL.dll" FSIMODE=EXEC # MissingDLL.fsx (-r ) + [] + let ``MissingDLL_fsx_b`` () = + source + |> asFsx + |> withOptions ["-r:MissingDLL.dll"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingDLL.dll' was not found or is invalid""") + ] + + //SOURCE=MissingEXE.fsx SCFLAGS="-r:MissingEXE.exe" FSIMODE=EXEC # MissingEXE.fsx (-r:) + [] + let ``MissingEXE_fsx_a`` () = + source + |> asFsx + |> withOptions ["-r:MissingEXE.exe"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingEXE.exe' was not found or is invalid""") + ] + + //SOURCE=MissingEXE.fsx SCFLAGS="-r MissingEXE.exe" FSIMODE=EXEC # MissingEXE.fsx (-r ) + [] + let ``MissingEXE_fsx_b`` () = + source + |> asFsx + |> withOptions ["-r:MissingEXE.exe"] + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 84, Line 1, Col 1, Line 1, Col 1, """Assembly reference 'MissingEXE.exe' was not found or is invalid""") + ] + + diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index c7861509686..9c6e84e4a0c 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -174,7 +174,7 @@ - + diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index c3cb5e0cc5c..ef6a973bb50 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -309,10 +309,11 @@ module rec CompilerAssertHelpers = SourceFiles = [|"test.fs"|] OtherOptions = let assemblies = TargetFrameworkUtil.currentReferences |> Array.map (fun x -> sprintf "-r:%s" x) + let defaultOptions = Array.append [|"--preferreduilang:en-US"; "--noframework"; "--warn:5"|] assemblies #if NETCOREAPP - Array.append [|"--preferreduilang:en-US"; "--targetprofile:netcore"; "--noframework"; "--simpleresolution"; "--warn:5"|] assemblies + Array.append [|"--targetprofile:netcore"|] defaultOptions #else - Array.append [|"--preferreduilang:en-US"; "--targetprofile:mscorlib"; "--noframework"; "--warn:5"|] assemblies + Array.append [|"--targetprofile:mscorlib"|] defaultOptions #endif ReferencedProjects = [||] IsIncompleteTypeCheckEnvironment = false diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars01.fs deleted file mode 100644 index 5a587a6c34c..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars01.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:4147 -//Assembly reference 'a\\b\\n\.dll' was not found or is invalid -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars02.fs deleted file mode 100644 index 83c2dd1f0b2..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/EscapeChars02.fs +++ /dev/null @@ -1,5 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:4185 -//Assembly reference '\.\.\\n\\r\\a\.dll' was not found or is invalid -//Assembly reference '\.\\r\.dll' was not found or is invalid -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fs deleted file mode 100644 index cc9592ea33a..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fs +++ /dev/null @@ -1,5 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:3310 -//Could not resolve this reference\. Could not locate the assembly "MissingDLL\.dll" - -#light diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fsx deleted file mode 100644 index 62ae1c51daf..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingDLL.fsx +++ /dev/null @@ -1,6 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:3310 -//Could not resolve this reference\. Could not locate the assembly "MissingDLL\.dll" -#light -;; -exit 0;; diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fs deleted file mode 100644 index ee9c559ba21..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fs +++ /dev/null @@ -1,6 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:3310 -//Could not resolve this reference\. Could not locate the assembly "MissingEXE\.exe" - -#light -exit 1 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fsx deleted file mode 100644 index 12032b60023..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/MissingEXE.fsx +++ /dev/null @@ -1,6 +0,0 @@ -// #Regression #NoMT #CompilerOptions -// Regression test for FSHARP1.0:3310 -//Could not resolve this reference\. Could not locate the assembly "MissingEXE\.exe" -#light -;; -exit 0;; diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/reference/env.lst deleted file mode 100644 index 111fa9015ca..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/reference/env.lst +++ /dev/null @@ -1,17 +0,0 @@ - SOURCE=EscapeChars01.fs SCFLAGS="-r:\".\No\nNewLine\" # EscapeChars01.fs - - SOURCE=EscapeChars01.fs SCFLAGS="-r:a\\b\\n.dll" # EscapeChars01.fs (-r:) - SOURCE=EscapeChars01.fs SCFLAGS="-r a\\b\\n.dll" # EscapeChars01.fs (-r ) - - SOURCE=EscapeChars02.fs SCFLAGS="-r:.\\r.dll -r:..\\n\\r\\a.dll" # EscapeChars02.fs (-r: ) - SOURCE=EscapeChars02.fs SCFLAGS="-r .\\r.dll -r:..\\n\\r\\a.dll" # EscapeChars02.fs (-r ) - - SOURCE=MissingDLL.fs SCFLAGS="-r:MissingDLL.dll" # MissingDLL.fs - SOURCE=MissingEXE.fs SCFLAGS="-r:MissingEXE.exe" # MissingEXE.fs - - SOURCE=MissingDLL.fsx SCFLAGS="-r:MissingDLL.dll" FSIMODE=EXEC # MissingDLL.fsx (-r:) - SOURCE=MissingDLL.fsx SCFLAGS="-r MissingDLL.dll" FSIMODE=EXEC # MissingDLL.fsx (-r ) - - SOURCE=MissingEXE.fsx SCFLAGS="-r:MissingEXE.exe" FSIMODE=EXEC # MissingEXE.fsx (-r:) - SOURCE=MissingEXE.fsx SCFLAGS="-r MissingEXE.exe" FSIMODE=EXEC # MissingEXE.fsx (-r ) - diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index a4ec5202557..0932c7a1f49 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -23,7 +23,6 @@ CompilerOptions01,NoMT CompilerOptions\fsc\optimize CompilerOptions01,NoMT CompilerOptions\fsc\out CompilerOptions01,NoMT,pdbs CompilerOptions\fsc\pdb CompilerOptions01,NoMT CompilerOptions\fsc\platform -CompilerOptions01,NoMT CompilerOptions\fsc\reference CompilerOptions01,NoMT CompilerOptions\fsc\Removed CompilerOptions01,NoMT CompilerOptions\fsc\standalone CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\staticlink diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index d96d3a16d61..e147e34f840 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -169,7 +169,7 @@ let g (t : T) = t.Count() "#r \"System2\"" ] TakeCoffeeBreak(this.VS) - checkErrors 2 + checkErrors 1 ReplaceFileInMemory file <| [ diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index 7f854cb01e3..a4e614c48e0 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -160,7 +160,7 @@ type UsingMSBuild() as this = "#r \"Nonexistent\"" ] let (project, _) = createSingleFileFsxFromLines code - AssertExactlyCountErrorSeenContaining(project, "Nonexistent", 2) // ...and not an error on the first line. + AssertExactlyCountErrorSeenContaining(project, "Nonexistent", 1) // ...and not an error on the first line. [] member public this.``Fsx.InvalidHashLoad.ShouldBeASquiggle.Bug3012``() = From 58f56aa6664d98421bb1e13ec748e4af1711e6c9 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 09:24:16 -0700 Subject: [PATCH 075/226] Remove FX_NO_CORHOST_SIGNER (#13589) * Remove FX_NO_CORHOST_SIGNER * dotnet fantomas src -r --- FSharp.Profiles.props | 1 - src/Compiler/AbstractIL/ilsign.fs | 267 +----------------------------- 2 files changed, 6 insertions(+), 262 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 159238eac30..1436432c7fe 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -12,7 +12,6 @@ $(DefineConstants);NETSTANDARD $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_CORHOST_SIGNER $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS $(OtherFlags) --simpleresolution diff --git a/src/Compiler/AbstractIL/ilsign.fs b/src/Compiler/AbstractIL/ilsign.fs index de79383120c..0239f4759c0 100644 --- a/src/Compiler/AbstractIL/ilsign.fs +++ b/src/Compiler/AbstractIL/ilsign.fs @@ -352,233 +352,6 @@ let signerSignFileWithKeyPair (fileName: string) (kp: keyPair) : unit = signFile let signerSignFileWithKeyContainer (_fileName: string) (_kcName: keyContainerName) : unit = raise (NotImplementedException("signerSignFileWithKeyContainer is not yet implemented")) -#if !FX_NO_CORHOST_SIGNER -open System.Runtime.CompilerServices - -// New mscoree functionality -// This type represents methods that we don't currently need, so I'm leaving unimplemented -type UnusedCOMMethod = unit -> unit - -[] -[] -type ICLRMetaHost = - [] - abstract GetRuntime: - [] version: string * [] interfaceId: System.Guid -> - [] System.Object - - // Methods that we don't need are stubbed out for now... - abstract GetVersionFromFile: UnusedCOMMethod - abstract EnumerateInstalledRuntimes: UnusedCOMMethod - abstract EnumerateLoadedRuntimes: UnusedCOMMethod - abstract Reserved01: UnusedCOMMethod - -// We don't currently support ComConversionLoss -[] -[] -type ICLRStrongName = - // Methods that we don't need are stubbed out for now... - abstract GetHashFromAssemblyFile: UnusedCOMMethod - abstract GetHashFromAssemblyFileW: UnusedCOMMethod - abstract GetHashFromBlob: UnusedCOMMethod - abstract GetHashFromFile: UnusedCOMMethod - abstract GetHashFromFileW: UnusedCOMMethod - abstract GetHashFromHandle: UnusedCOMMethod - abstract StrongNameCompareAssemblies: UnusedCOMMethod - - [] - abstract StrongNameFreeBuffer: [] pbMemory: nativeint -> unit - - abstract StrongNameGetBlob: UnusedCOMMethod - abstract StrongNameGetBlobFromImage: UnusedCOMMethod - - [] - abstract StrongNameGetPublicKey: - [] pwzKeyContainer: string * - [] pbKeyBlob: byte[] * - [] cbKeyBlob: uint32 * - [] ppbPublicKeyBlob: nativeint byref * - [] pcbPublicKeyBlob: uint32 byref -> - unit - - abstract StrongNameHashSize: UnusedCOMMethod - - [] - abstract StrongNameKeyDelete: [] pwzKeyContainer: string -> unit - - abstract StrongNameKeyGen: UnusedCOMMethod - abstract StrongNameKeyGenEx: UnusedCOMMethod - abstract StrongNameKeyInstall: UnusedCOMMethod - - [] - abstract StrongNameSignatureGeneration: - [] pwzFilePath: string * - [] pwzKeyContainer: string * - [] pbKeyBlob: byte[] * - [] cbKeyBlob: uint32 * - [] ppbSignatureBlob: nativeint * - [] pcbSignatureBlob: uint32 byref -> - unit - - abstract StrongNameSignatureGenerationEx: UnusedCOMMethod - - [] - abstract StrongNameSignatureSize: - [] pbPublicKeyBlob: byte[] * - [] cbPublicKeyBlob: uint32 * - [] pcbSize: uint32 byref -> - unit - - abstract StrongNameSignatureVerification: UnusedCOMMethod - - [] - abstract StrongNameSignatureVerificationEx: - [] pwzFilePath: string * - [] fForceVerification: bool * - [] pfWasVerified: bool byref -> - [] bool - - abstract StrongNameSignatureVerificationFromImage: UnusedCOMMethod - abstract StrongNameTokenFromAssembly: UnusedCOMMethod - abstract StrongNameTokenFromAssemblyEx: UnusedCOMMethod - abstract StrongNameTokenFromPublicKey: UnusedCOMMethod - -[] -[] -type ICLRRuntimeInfo = - // REVIEW: Methods that we don't need will be stubbed out for now... - abstract GetVersionString: unit -> unit - abstract GetRuntimeDirectory: unit -> unit - abstract IsLoaded: unit -> unit - abstract LoadErrorString: unit -> unit - abstract LoadLibrary: unit -> unit - abstract GetProcAddress: unit -> unit - - [] - abstract GetInterface: - [] coClassId: System.Guid * - [] interfaceId: System.Guid -> - [] System.Object - -[] -[] -let CreateInterface - ( - ([] _clsidguid: System.Guid), - ([] _guid: System.Guid), - ([] _metaHost: ICLRMetaHost byref) - ) : unit = - failwith "CreateInterface" - -let legacySignerOpenPublicKeyFile filePath = - FileSystem.OpenFileForReadShim(filePath).ReadAllBytes() - -let legacySignerOpenKeyPairFile filePath = - FileSystem.OpenFileForReadShim(filePath).ReadAllBytes() - -let mutable iclrsn: ICLRStrongName option = None - -let getICLRStrongName () = - match iclrsn with - | None -> - let CLSID_CLRStrongName = - System.Guid(0xB79B0ACDu, 0xF5CDus, 0x409bus, 0xB5uy, 0xA5uy, 0xA1uy, 0x62uy, 0x44uy, 0x61uy, 0x0Buy, 0x92uy) - - let IID_ICLRStrongName = - System.Guid(0x9FD93CCFu, 0x3280us, 0x4391us, 0xB3uy, 0xA9uy, 0x96uy, 0xE1uy, 0xCDuy, 0xE7uy, 0x7Cuy, 0x8Duy) - - let CLSID_CLRMetaHost = - System.Guid(0x9280188Du, 0x0E8Eus, 0x4867us, 0xB3uy, 0x0Cuy, 0x7Fuy, 0xA8uy, 0x38uy, 0x84uy, 0xE8uy, 0xDEuy) - - let IID_ICLRMetaHost = - System.Guid(0xD332DB9Eu, 0xB9B3us, 0x4125us, 0x82uy, 0x07uy, 0xA1uy, 0x48uy, 0x84uy, 0xF5uy, 0x32uy, 0x16uy) - - let clrRuntimeInfoGuid = - System.Guid(0xBD39D1D2u, 0xBA2Fus, 0x486aus, 0x89uy, 0xB0uy, 0xB4uy, 0xB0uy, 0xCBuy, 0x46uy, 0x68uy, 0x91uy) - - let runtimeVer = - System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion() - - let mutable metaHost = Unchecked.defaultof - CreateInterface(CLSID_CLRMetaHost, IID_ICLRMetaHost, &metaHost) - - if Unchecked.defaultof = metaHost then - failwith "Unable to obtain ICLRMetaHost object - check freshness of mscoree.dll" - - let runtimeInfo = - metaHost.GetRuntime(runtimeVer, clrRuntimeInfoGuid) :?> ICLRRuntimeInfo - - let sn = - runtimeInfo.GetInterface(CLSID_CLRStrongName, IID_ICLRStrongName) :?> ICLRStrongName - - if Unchecked.defaultof = sn then - failwith "Unable to obtain ICLRStrongName object" - - iclrsn <- Some sn - sn - | Some sn -> sn - -let legacySignerGetPublicKeyForKeyPair kp = - let mutable pSize = 0u - let mutable pBuffer: nativeint = (nativeint) 0 - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameGetPublicKey(Unchecked.defaultof, kp, (uint32) kp.Length, &pBuffer, &pSize) - |> ignore - - let mutable keybuffer: byte[] = Bytes.zeroCreate (int pSize) - // Copy the marshalled data over - we'll have to free this ourselves - Marshal.Copy(pBuffer, keybuffer, 0, int pSize) - iclrSN.StrongNameFreeBuffer pBuffer |> ignore - keybuffer - -let legacySignerGetPublicKeyForKeyContainer kc = - let mutable pSize = 0u - let mutable pBuffer: nativeint = (nativeint) 0 - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameGetPublicKey(kc, Unchecked.defaultof, 0u, &pBuffer, &pSize) - |> ignore - - let mutable keybuffer: byte[] = Bytes.zeroCreate (int pSize) - // Copy the marshalled data over - we'll have to free this ourselves later - Marshal.Copy(pBuffer, keybuffer, 0, int pSize) - iclrSN.StrongNameFreeBuffer pBuffer |> ignore - keybuffer - -let legacySignerCloseKeyContainer kc = - let iclrSN = getICLRStrongName () - iclrSN.StrongNameKeyDelete kc |> ignore - -let legacySignerSignatureSize (pk: byte[]) = - let mutable pSize = 0u - let iclrSN = getICLRStrongName () - iclrSN.StrongNameSignatureSize(pk, uint32 pk.Length, &pSize) |> ignore - int pSize - -let legacySignerSignFileWithKeyPair fileName kp = - let mutable pcb = 0u - let mutable ppb = (nativeint) 0 - let mutable ok = false - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameSignatureGeneration(fileName, Unchecked.defaultof, kp, uint32 kp.Length, ppb, &pcb) - |> ignore - - iclrSN.StrongNameSignatureVerificationEx(fileName, true, &ok) |> ignore - -let legacySignerSignFileWithKeyContainer fileName kcName = - let mutable pcb = 0u - let mutable ppb = (nativeint) 0 - let mutable ok = false - let iclrSN = getICLRStrongName () - - iclrSN.StrongNameSignatureGeneration(fileName, kcName, Unchecked.defaultof, 0u, ppb, &pcb) - |> ignore - - iclrSN.StrongNameSignatureVerificationEx(fileName, true, &ok) |> ignore -#endif - let failWithContainerSigningUnsupportedOnThisPlatform () = failwith (FSComp.SR.containerSigningUnsupportedOnThisPlatform () |> snd) @@ -603,13 +376,8 @@ type ILStrongNameSigner = | PublicKeySigner _ | PublicKeyOptionsSigner _ | KeyPair _ -> () - | KeyContainer containerName -> -#if !FX_NO_CORHOST_SIGNER - legacySignerCloseKeyContainer containerName -#else - ignore containerName - failWithContainerSigningUnsupportedOnThisPlatform () -#endif + | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () + member s.IsFullySigned = match s with | PublicKeySigner _ -> false @@ -617,12 +385,7 @@ type ILStrongNameSigner = let _, usePublicSign = pko usePublicSign | KeyPair _ -> true - | KeyContainer _ -> -#if !FX_NO_CORHOST_SIGNER - true -#else - failWithContainerSigningUnsupportedOnThisPlatform () -#endif + | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () member s.PublicKey = match s with @@ -631,13 +394,7 @@ type ILStrongNameSigner = let pk, _ = pko pk | KeyPair kp -> signerGetPublicKeyForKeyPair kp - | KeyContainer containerName -> -#if !FX_NO_CORHOST_SIGNER - legacySignerGetPublicKeyForKeyContainer containerName -#else - ignore containerName - failWithContainerSigningUnsupportedOnThisPlatform () -#endif + | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () member s.SignatureSize = let pkSignatureSize pk = @@ -653,23 +410,11 @@ type ILStrongNameSigner = let pk, _ = pko pkSignatureSize pk | KeyPair kp -> pkSignatureSize (signerGetPublicKeyForKeyPair kp) - | KeyContainer containerName -> -#if !FX_NO_CORHOST_SIGNER - pkSignatureSize (legacySignerGetPublicKeyForKeyContainer containerName) -#else - ignore containerName - failWithContainerSigningUnsupportedOnThisPlatform () -#endif + | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () member s.SignFile file = match s with | PublicKeySigner _ -> () | PublicKeyOptionsSigner _ -> () | KeyPair kp -> signerSignFileWithKeyPair file kp - | KeyContainer containerName -> -#if !FX_NO_CORHOST_SIGNER - legacySignerSignFileWithKeyContainer file containerName -#else - ignore containerName - failWithContainerSigningUnsupportedOnThisPlatform () -#endif + | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () From ca151613407a256b062c81eb63321ead0c13c598 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 29 Jul 2022 07:33:08 -1200 Subject: [PATCH 076/226] Update Result defaultWith to include the error in the compensation function (#13592) * Update Result defaultWith to include the error in the compensation function * Update test SurfaceArea --- src/FSharp.Core/result.fs | 2 +- src/FSharp.Core/result.fsi | 6 +++--- .../FSharp.Core/Microsoft.FSharp.Core/ResultTests.fs | 8 +++++--- tests/FSharp.Core.UnitTests/SurfaceArea.fs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/FSharp.Core/result.fs b/src/FSharp.Core/result.fs index a6e954b73af..00ec26d05d8 100644 --- a/src/FSharp.Core/result.fs +++ b/src/FSharp.Core/result.fs @@ -44,7 +44,7 @@ module Result = [] let defaultWith defThunk result = match result with - | Error _ -> defThunk () + | Error error -> defThunk error | Ok v -> v [] diff --git a/src/FSharp.Core/result.fsi b/src/FSharp.Core/result.fsi index 9c8fb7bbd5a..2641fd1eff3 100644 --- a/src/FSharp.Core/result.fsi +++ b/src/FSharp.Core/result.fsi @@ -124,12 +124,12 @@ module Result = /// /// /// - /// Ok 1 |> Result.defaultWith (fun () -> 99) // evaluates to 1 - /// Error 2 |> Result.defaultWith (fun () -> 99) // evaluates to 99 + /// Ok 1 |> Result.defaultWith (fun error -> 99) // evaluates to 1 + /// Error 2 |> Result.defaultWith (fun error -> 99) // evaluates to 99 /// /// [] - val defaultWith: defThunk: (unit -> 'T) -> result: Result<'T, 'Error> -> 'T + val defaultWith: defThunk: ('Error -> 'T) -> result: Result<'T, 'Error> -> 'T /// count inp evaluates to match inp with Error _ -> 0 | Ok _ -> 1. /// diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ResultTests.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ResultTests.fs index dd597bce129..e2b08e867d7 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ResultTests.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ResultTests.fs @@ -102,8 +102,10 @@ type ResultTests() = [] member this.DefaultWith() = - Assert.AreEqual(Result.defaultWith (fun () -> 3) (Error 42), 3) - Assert.AreEqual(Result.defaultWith (fun () -> "1") (Error "42"), "1") + Assert.AreEqual(Result.defaultWith (fun _ -> 3) (Error 42), 3) + Assert.AreEqual(Result.defaultWith (fun err -> 3 + err) (Error 42), 45) + Assert.AreEqual(Result.defaultWith (fun _ -> "1") (Error "42"), "1") + Assert.AreEqual(Result.defaultWith (fun err -> "1" + err) (Error "42"), "142") Assert.AreEqual(Result.defaultWith assertWasNotCalledThunk (Ok 42), 42) Assert.AreEqual(Result.defaultWith assertWasNotCalledThunk (Ok "1"), "1") @@ -172,4 +174,4 @@ type ResultTests() = [] member this.ToValueOption() = Assert.AreEqual(Result.toValueOption (Error 42), ValueNone) - Assert.AreEqual(Result.toValueOption (Ok 42), ValueSome 42) \ No newline at end of file + Assert.AreEqual(Result.toValueOption (Ok 42), ValueSome 42) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.fs index c214e76daf7..51de2a7a3ff 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.fs @@ -1975,7 +1975,7 @@ Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Collections.FSharpList`1[T] Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpOption`1[T] ToOption[T,TError](Microsoft.FSharp.Core.FSharpResult`2[T,TError]) Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpValueOption`1[T] ToValueOption[T,TError](Microsoft.FSharp.Core.FSharpResult`2[T,TError]) Microsoft.FSharp.Core.ResultModule: T DefaultValue[T,TError](T, Microsoft.FSharp.Core.FSharpResult`2[T,TError]) -Microsoft.FSharp.Core.ResultModule: T DefaultWith[T,TError](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpResult`2[T,TError]) +Microsoft.FSharp.Core.ResultModule: T DefaultWith[TError,T](Microsoft.FSharp.Core.FSharpFunc`2[TError,T], Microsoft.FSharp.Core.FSharpResult`2[T,TError]) Microsoft.FSharp.Core.ResultModule: TState FoldBack[T,TError,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Core.FSharpResult`2[T,TError], TState) Microsoft.FSharp.Core.ResultModule: TState Fold[T,TError,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpResult`2[T,TError]) Microsoft.FSharp.Core.ResultModule: T[] ToArray[T,TError](Microsoft.FSharp.Core.FSharpResult`2[T,TError]) From 729a68f4f6feafe3ce1fbf1ab80a36647615b07f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 29 Jul 2022 17:04:50 -0700 Subject: [PATCH 077/226] Fix merge error (#13595) --- FSharp.Profiles.props | 1 - 1 file changed, 1 deletion(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 1436432c7fe..c06a6e7cb0f 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -12,7 +12,6 @@ $(DefineConstants);NETSTANDARD $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS $(OtherFlags) --simpleresolution From e07a910aa2a5121e4250c198de7e34f5b738c2e6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 30 Jul 2022 18:25:21 +0200 Subject: [PATCH 078/226] Update dependencies from https://github.com/dotnet/arcade build 20220729.10 (#13599) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22378.16 -> To Version 7.0.0-beta.22379.10 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 +- eng/common/SetupNugetSources.ps1 | 18 ++--- eng/common/SetupNugetSources.sh | 68 +++++++------------ eng/common/native/init-compiler.sh | 2 +- .../templates/post-build/post-build.yml | 2 + eng/common/templates/steps/execute-sdl.yml | 21 ++++++ global.json | 2 +- 7 files changed, 60 insertions(+), 57 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d682c728f34..489e5397fb6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 6f93ec8da69a42fbe9a702a33e104f94773c3f03 + 1e73f4ab4c172aa55614f24b2d5c319e1efb8813 diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index 18823840b11..6e997239451 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -146,22 +146,22 @@ $userName = "dn-bot" # Insert credential nodes for Maestro's private feeds InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -Password $Password +# 3.1 uses a different feed url format so it's handled differently here $dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") if ($dotnet31Source -ne $null) { AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password } -$dotnet5Source = $sources.SelectSingleNode("add[@key='dotnet5']") -if ($dotnet5Source -ne $null) { - AddPackageSource -Sources $sources -SourceName "dotnet5-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password - AddPackageSource -Sources $sources -SourceName "dotnet5-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password -} +$dotnetVersions = @('5','6','7') -$dotnet6Source = $sources.SelectSingleNode("add[@key='dotnet6']") -if ($dotnet6Source -ne $null) { - AddPackageSource -Sources $sources -SourceName "dotnet6-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password - AddPackageSource -Sources $sources -SourceName "dotnet6-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet6-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password +foreach ($dotnetVersion in $dotnetVersions) { + $feedPrefix = "dotnet" + $dotnetVersion; + $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") + if ($dotnetSource -ne $null) { + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -Password $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password + } } $doc.Save($filename) diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index ad3fb74fd2c..8af7d899db1 100644 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -105,53 +105,33 @@ if [ "$?" == "0" ]; then PackageSources+=('dotnet3.1-internal-transport') fi -# Ensure dotnet5-internal and dotnet5-internal-transport are in the packageSources if the public dotnet5 feeds are present -grep -i "" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet5-internal') - - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding dotnet5-internal-transport to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet5-internal-transport') -fi - -# Ensure dotnet6-internal and dotnet6-internal-transport are in the packageSources if the public dotnet6 feeds are present -grep -i "" +DotNetVersions=('5' '6' '7') + +for DotNetVersion in ${DotNetVersions[@]} ; do + FeedPrefix="dotnet${DotNetVersion}"; + grep -i "" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=("$FeedPrefix-internal") - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet6-internal') + grep -i "" $ConfigFile + if [ "$?" != "0" ]; then + echo "Adding $FeedPrefix-internal-transport to the packageSources." + PackageSourcesNodeFooter="" + PackageSourceTemplate="${TB}" - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding dotnet6-internal-transport to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=("$FeedPrefix-internal-transport") fi - PackageSources+=('dotnet6-internal-transport') -fi +done # I want things split line by line PrevIFS=$IFS diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 4b99a9cad3b..41a26d802a9 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -71,7 +71,7 @@ if [[ -z "$CLR_CC" ]]; then # Set default versions if [[ -z "$majorVersion" ]]; then # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. - if [[ "$compiler" == "clang" ]]; then versions=( 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) + if [[ "$compiler" == "clang" ]]; then versions=( 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) elif [[ "$compiler" == "gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 5a9056f6b2f..e0beb25d4e7 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -49,6 +49,7 @@ parameters: type: object default: enable: false + publishGdn: false continueOnError: false params: '' artifactNames: '' @@ -235,6 +236,7 @@ stages: - template: /eng/common/templates/job/execute-sdl.yml parameters: enable: ${{ parameters.SDLValidationParameters.enable }} + publishGuardianDirectoryToPipeline: ${{ parameters.SDLValidationParameters.publishGdn }} additionalParameters: ${{ parameters.SDLValidationParameters.params }} continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 7b8ee18a28d..73245593cef 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -62,7 +62,28 @@ steps: c i condition: succeededOrFailed() + - publish: $(Agent.BuildDirectory)/.gdn artifact: GuardianConfiguration displayName: Publish GuardianConfiguration + condition: succeededOrFailed() + + # Publish the SARIF files in a container named CodeAnalysisLogs to enable integration + # with the "SARIF SAST Scans Tab" Azure DevOps extension + - task: CopyFiles@2 + displayName: Copy SARIF files + inputs: + flattenFolders: true + sourceFolder: $(Agent.BuildDirectory)/.gdn/rc/ + contents: '**/*.sarif' + targetFolder: $(Build.SourcesDirectory)/CodeAnalysisLogs + condition: succeededOrFailed() + + # Use PublishBuildArtifacts because the SARIF extension only checks this case + # see microsoft/sarif-azuredevops-extension#4 + - task: PublishBuildArtifacts@1 + displayName: Publish SARIF files to CodeAnalysisLogs container + inputs: + pathToPublish: $(Build.SourcesDirectory)/CodeAnalysisLogs + artifactName: CodeAnalysisLogs condition: succeededOrFailed() \ No newline at end of file diff --git a/global.json b/global.json index 39c5497feee..aeec4b81703 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22378.16", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22379.10", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From dc269a93179963f5c6874eb34dc14b52229349c5 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 30 Jul 2022 22:01:10 -0700 Subject: [PATCH 079/226] Improve tfm /rid aquisition (#13582) * Improve tfm aquisition * revert desktop to net472 * fantomas * use RuntimeInformation.FrameworkDescription --- src/Compiler/Driver/FxResolver.fs | 224 ++++++-------------- src/Compiler/Facilities/CompilerLocation.fs | 1 + 2 files changed, 70 insertions(+), 155 deletions(-) diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index d769b36678e..2fa595ee15b 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -386,124 +386,37 @@ type internal FxResolver // On coreclr it uses the deps.json file // // On-demand because (a) some FxResolver are ephemeral (b) we want to avoid recomputation - let tryRunningDotNetCoreTfm = - lazy - let file = - try - let asm = Assembly.GetEntryAssembly() - - match asm with - | Null -> "" - | NonNull asm -> - let depsJsonPath = Path.ChangeExtension(asm.Location, "deps.json") - - if FileSystem.FileExistsShim(depsJsonPath) then - use stream = FileSystem.OpenFileForReadShim(depsJsonPath) - stream.ReadAllText() - else - "" - with _ -> - // This is defensive coding, we don't expect this exception to happen - // NOTE: consider reporting this exception as a warning - "" + let tryGetRunningTfm = + let runningTfmOpt = + let getTfmNumber (v: string) = + let arr = v.Split([| '.' |], 3) + arr[0] + "." + arr[1] + + // Compute TFM from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription + // System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;; + // val it: string = ".NET 6.0.7" + // val it: string = ".NET Framework 4.8.4515.0" + let name = RuntimeInformation.FrameworkDescription + let arr = name.Split([| ' ' |], 3) + + match arr[0], arr[1] with + | ".NET", "Core" when arr.Length >= 3 -> Some("netcoreapp" + (getTfmNumber arr[2])) + + | ".NET", "Framework" when arr.Length >= 3 -> + if arr[ 2 ].StartsWith("4.8") then + Some "net48" + else + Some "net472" - let tfmPrefix = ".NETCoreApp,Version=v" - let pattern = "\"name\": \"" + tfmPrefix + | ".NET", "Native" -> None - let startPos = - let startPos = file.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) + | ".NET", _ when arr.Length >= 2 -> Some("net" + (getTfmNumber arr[1])) - if startPos >= 0 then - startPos + pattern.Length - else - startPos + | _ -> None - let length = - if startPos >= 0 then - let ep = file.IndexOf("\"", startPos) - if ep >= 0 then ep - startPos else ep - else - -1 - - match startPos, length with - | -1, _ - | _, -1 -> - if isRunningOnCoreClr then - // Running on coreclr but no deps.json was deployed with the host so default to 6.0 - Some "net6.0" - else - // Running on desktop - None - | pos, length -> - // use value from the deps.json file - let suffix = file.Substring(pos, length) - - let prefix = - match Double.TryParse(suffix) with - | true, value when value < 5.0 -> "netcoreapp" - | _ -> "net" - - Some(prefix + suffix) - - let tryGetRunningDotNetCoreTfm () = tryRunningDotNetCoreTfm.Force() - - // Tries to figure out the tfm for the compiler instance on the Windows desktop - // On full clr it uses the mscorlib version number - let getRunningDotNetFrameworkTfm () = - let defaultMscorlibVersion = 4, 8, 3815, 0 - - let desktopProductVersionMonikers = - [| - // major, minor, build, revision, moniker - 4, 8, 3815, 0, "net48" - 4, 8, 3761, 0, "net48" - 4, 7, 3190, 0, "net472" - 4, 7, 3062, 0, "net472" - 4, 7, 2600, 0, "net471" - 4, 7, 2558, 0, "net471" - 4, 7, 2053, 0, "net47" - 4, 7, 2046, 0, "net47" - 4, 6, 1590, 0, "net462" - 4, 6, 57, 0, "net462" - 4, 6, 1055, 0, "net461" - 4, 6, 81, 0, "net46" - 4, 0, 30319, 34209, "net452" - 4, 0, 30319, 17020, "net452" - 4, 0, 30319, 18408, "net451" - 4, 0, 30319, 17929, "net45" - 4, 0, 30319, 1, "net4" - |] - - let majorPart, minorPart, buildPart, privatePart = - try - let attrOpt = - typeof.Assembly.GetCustomAttributes (typeof) - |> Seq.tryHead - - match attrOpt with - | Some attr -> - let fv = - (downcast attr: AssemblyFileVersionAttribute).Version.Split([| '.' |]) - |> Array.map (fun e -> Int32.Parse(e)) - - fv[0], fv[1], fv[2], fv[3] - | _ -> defaultMscorlibVersion - with _ -> - defaultMscorlibVersion - - // Get the ProductVersion of this framework compare with table compatible monikers - match - desktopProductVersionMonikers - |> Array.tryFind (fun (major, minor, build, revision, _) -> - (majorPart >= major) - && (minorPart >= minor) - && (buildPart >= build) - && (privatePart >= revision)) - with - | Some (_, _, _, _, moniker) -> moniker - | None -> - // no TFM could be found, assume latest stable? - "net48" + match runningTfmOpt with + | Some tfm -> tfm + | _ -> if isRunningOnCoreClr then "net7.0" else "net472" let trySdkRefsPackDirectory = lazy @@ -897,58 +810,59 @@ type internal FxResolver member _.GetTfmAndRid() = fxlock.AcquireLock(fun fxtok -> RequireFxResolverLock(fxtok, "assuming all member require lock") - // Interactive processes read their own configuration to find the running tfm - - let tfm = - if isInteractive then - match tryGetRunningDotNetCoreTfm () with - | Some tfm -> tfm - | _ -> getRunningDotNetFrameworkTfm () - else - let sdkDir = tryGetSdkDir () |> replayWarnings - - match sdkDir with - | Some dir -> - let dotnetConfigFile = Path.Combine(dir, "dotnet.runtimeconfig.json") - use stream = FileSystem.OpenFileForReadShim(dotnetConfigFile) - let dotnetConfig = stream.ReadAllText() - let pattern = "\"tfm\": \"" - let startPos = - dotnetConfig.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) - + pattern.Length - - let endPos = dotnetConfig.IndexOf("\"", startPos) - let tfm = dotnetConfig[startPos .. endPos - 1] - //printfn "GetTfmAndRid, tfm = '%s'" tfm - tfm - | None -> - match tryGetRunningDotNetCoreTfm () with - | Some tfm -> tfm - | _ -> getRunningDotNetFrameworkTfm () + let runningTfm = tryGetRunningTfm + // Coreclr has mechanism for getting rid + // System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier + // On Desktop framework compile it using osplatform+processarch+ // Computer valid dotnet-rids for this environment: // https://docs.microsoft.com/en-us/dotnet/core/rid-catalog // // Where rid is: win, win-x64, win-x86, osx-x64, linux-x64 etc ... let runningRid = - let processArchitecture = RuntimeInformation.ProcessArchitecture + let rid = + if isRunningOnCoreClr then + // Use reflection to get the value for rid + let rinfoType: Type option = + Option.ofObj ( + Type.GetType( + "System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.RuntimeInformation", + false + ) + ) + + let ridProperty: PropertyInfo option = + match rinfoType with + | None -> None + | Some t -> Option.ofObj (t.GetProperty("RuntimeIdentifier", BindingFlags.Public ||| BindingFlags.Static)) - let baseRid = - if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then - "win" - elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then - "osx" + match ridProperty with + | None -> None + | Some p -> Some(string (p.GetValue(null))) else - "linux" + None + + match rid with + | Some rid -> rid + | None -> + let processArchitecture = RuntimeInformation.ProcessArchitecture + + let baseRid = + if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then + "win" + elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then + "osx" + else + "linux" - match processArchitecture with - | Architecture.X64 -> baseRid + "-x64" - | Architecture.X86 -> baseRid + "-x86" - | Architecture.Arm64 -> baseRid + "-arm64" - | _ -> baseRid + "-arm" + match processArchitecture with + | Architecture.X64 -> baseRid + "-x64" + | Architecture.X86 -> baseRid + "-x86" + | Architecture.Arm64 -> baseRid + "-arm64" + | _ -> baseRid + "-arm" - tfm, runningRid) + runningTfm, runningRid) static member ClearStaticCaches() = desiredDotNetSdkVersionForDirectoryCache.Clear() diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index d222446b933..24141252ee8 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -123,6 +123,7 @@ module internal FSharpEnvironment = |] elif typeof.Assembly.GetName().Name = "System.Private.CoreLib" then [| + "net7.0" "net6.0" "net5.0" "netcoreapp3.1" From b9942004e8ba19bf73862b69b2d71151a98975ba Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Sun, 31 Jul 2022 13:08:54 +0200 Subject: [PATCH 080/226] Some more refassemblies tests (#13587) --- .../EmittedIL/ReferenceAssemblyTests.fs | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 099369d37c1..8ed8ef5cb9c 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -883,4 +883,103 @@ type Person(name : string, age : int) = } }""" ] + + [] + let ``Internal constructor is emitted for attribute (with fsi)`` () = + let fsSig = + Fsi """ +namespace Microsoft.FSharp.Core + open System + [] + [] + type NoDynamicInvocationAttribute = + inherit Attribute + new: unit -> NoDynamicInvocationAttribute + internal new: isLegacy: bool -> NoDynamicInvocationAttribute + + module Operators = + [] + val inline id: value: 'T -> 'T + """ + + let fsSource = + FsSource """ +namespace Microsoft.FSharp.Core + open System + [] + [] + type NoDynamicInvocationAttribute(isLegacy: bool) = + inherit Attribute() + new () = NoDynamicInvocationAttribute(false) + member _.IsLegacy = isLegacy + + module Operators = + [] + [] + let inline id (value: 'T) = value + """ + fsSig + |> withOptions ["--refonly"] + |> withAdditionalSourceFile fsSource + |> compile + |> shouldSucceed + |> verifyIL [ + referenceAssemblyAttributeExpectedIL + """ +.class public auto ansi serializable sealed Microsoft.FSharp.Core.NoDynamicInvocationAttribute +extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.AttributeUsageAttribute::.ctor(valuetype [runtime]System.AttributeTargets) = ( 01 00 C0 00 00 00 01 00 54 02 0D 41 6C 6C 6F 77 + 4D 75 6C 74 69 70 6C 65 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.SealedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly bool isLegacy + .method assembly specialname rtspecialname + instance void .ctor(bool isLegacy) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method assembly hidebysig specialname + instance bool get_IsLegacy() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .property instance bool IsLegacy() + { + .get instance bool Microsoft.FSharp.Core.NoDynamicInvocationAttribute::get_IsLegacy() + } +} + +.class public abstract auto ansi sealed Microsoft.FSharp.Core.Operators +extends [runtime]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 !!T GetId(!!T 'value') cil managed + { + .custom instance void Microsoft.FSharp.Core.NoDynamicInvocationAttribute::.ctor(bool) = ( 01 00 01 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationSourceNameAttribute::.ctor(string) = ( 01 00 02 69 64 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + +} """ ] // TODO: Add tests for internal functions, types, interfaces, abstract types (with and without IVTs), (private, internal, public) fields, properties (+ different visibility for getters and setters), events. From fb7b6c42462cd6fa550badb2d895e4ce4e15b47a Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Sun, 31 Jul 2022 10:09:50 -0700 Subject: [PATCH 081/226] Improve tfm /rid aquisition (#13582) (#13604) * Improve tfm aquisition * revert desktop to net472 * fantomas * use RuntimeInformation.FrameworkDescription Co-authored-by: Kevin Ransom (msft) --- src/Compiler/Driver/FxResolver.fs | 224 ++++++-------------- src/Compiler/Facilities/CompilerLocation.fs | 1 + 2 files changed, 70 insertions(+), 155 deletions(-) diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index d769b36678e..2fa595ee15b 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -386,124 +386,37 @@ type internal FxResolver // On coreclr it uses the deps.json file // // On-demand because (a) some FxResolver are ephemeral (b) we want to avoid recomputation - let tryRunningDotNetCoreTfm = - lazy - let file = - try - let asm = Assembly.GetEntryAssembly() - - match asm with - | Null -> "" - | NonNull asm -> - let depsJsonPath = Path.ChangeExtension(asm.Location, "deps.json") - - if FileSystem.FileExistsShim(depsJsonPath) then - use stream = FileSystem.OpenFileForReadShim(depsJsonPath) - stream.ReadAllText() - else - "" - with _ -> - // This is defensive coding, we don't expect this exception to happen - // NOTE: consider reporting this exception as a warning - "" + let tryGetRunningTfm = + let runningTfmOpt = + let getTfmNumber (v: string) = + let arr = v.Split([| '.' |], 3) + arr[0] + "." + arr[1] + + // Compute TFM from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription + // System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;; + // val it: string = ".NET 6.0.7" + // val it: string = ".NET Framework 4.8.4515.0" + let name = RuntimeInformation.FrameworkDescription + let arr = name.Split([| ' ' |], 3) + + match arr[0], arr[1] with + | ".NET", "Core" when arr.Length >= 3 -> Some("netcoreapp" + (getTfmNumber arr[2])) + + | ".NET", "Framework" when arr.Length >= 3 -> + if arr[ 2 ].StartsWith("4.8") then + Some "net48" + else + Some "net472" - let tfmPrefix = ".NETCoreApp,Version=v" - let pattern = "\"name\": \"" + tfmPrefix + | ".NET", "Native" -> None - let startPos = - let startPos = file.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) + | ".NET", _ when arr.Length >= 2 -> Some("net" + (getTfmNumber arr[1])) - if startPos >= 0 then - startPos + pattern.Length - else - startPos + | _ -> None - let length = - if startPos >= 0 then - let ep = file.IndexOf("\"", startPos) - if ep >= 0 then ep - startPos else ep - else - -1 - - match startPos, length with - | -1, _ - | _, -1 -> - if isRunningOnCoreClr then - // Running on coreclr but no deps.json was deployed with the host so default to 6.0 - Some "net6.0" - else - // Running on desktop - None - | pos, length -> - // use value from the deps.json file - let suffix = file.Substring(pos, length) - - let prefix = - match Double.TryParse(suffix) with - | true, value when value < 5.0 -> "netcoreapp" - | _ -> "net" - - Some(prefix + suffix) - - let tryGetRunningDotNetCoreTfm () = tryRunningDotNetCoreTfm.Force() - - // Tries to figure out the tfm for the compiler instance on the Windows desktop - // On full clr it uses the mscorlib version number - let getRunningDotNetFrameworkTfm () = - let defaultMscorlibVersion = 4, 8, 3815, 0 - - let desktopProductVersionMonikers = - [| - // major, minor, build, revision, moniker - 4, 8, 3815, 0, "net48" - 4, 8, 3761, 0, "net48" - 4, 7, 3190, 0, "net472" - 4, 7, 3062, 0, "net472" - 4, 7, 2600, 0, "net471" - 4, 7, 2558, 0, "net471" - 4, 7, 2053, 0, "net47" - 4, 7, 2046, 0, "net47" - 4, 6, 1590, 0, "net462" - 4, 6, 57, 0, "net462" - 4, 6, 1055, 0, "net461" - 4, 6, 81, 0, "net46" - 4, 0, 30319, 34209, "net452" - 4, 0, 30319, 17020, "net452" - 4, 0, 30319, 18408, "net451" - 4, 0, 30319, 17929, "net45" - 4, 0, 30319, 1, "net4" - |] - - let majorPart, minorPart, buildPart, privatePart = - try - let attrOpt = - typeof.Assembly.GetCustomAttributes (typeof) - |> Seq.tryHead - - match attrOpt with - | Some attr -> - let fv = - (downcast attr: AssemblyFileVersionAttribute).Version.Split([| '.' |]) - |> Array.map (fun e -> Int32.Parse(e)) - - fv[0], fv[1], fv[2], fv[3] - | _ -> defaultMscorlibVersion - with _ -> - defaultMscorlibVersion - - // Get the ProductVersion of this framework compare with table compatible monikers - match - desktopProductVersionMonikers - |> Array.tryFind (fun (major, minor, build, revision, _) -> - (majorPart >= major) - && (minorPart >= minor) - && (buildPart >= build) - && (privatePart >= revision)) - with - | Some (_, _, _, _, moniker) -> moniker - | None -> - // no TFM could be found, assume latest stable? - "net48" + match runningTfmOpt with + | Some tfm -> tfm + | _ -> if isRunningOnCoreClr then "net7.0" else "net472" let trySdkRefsPackDirectory = lazy @@ -897,58 +810,59 @@ type internal FxResolver member _.GetTfmAndRid() = fxlock.AcquireLock(fun fxtok -> RequireFxResolverLock(fxtok, "assuming all member require lock") - // Interactive processes read their own configuration to find the running tfm - - let tfm = - if isInteractive then - match tryGetRunningDotNetCoreTfm () with - | Some tfm -> tfm - | _ -> getRunningDotNetFrameworkTfm () - else - let sdkDir = tryGetSdkDir () |> replayWarnings - - match sdkDir with - | Some dir -> - let dotnetConfigFile = Path.Combine(dir, "dotnet.runtimeconfig.json") - use stream = FileSystem.OpenFileForReadShim(dotnetConfigFile) - let dotnetConfig = stream.ReadAllText() - let pattern = "\"tfm\": \"" - let startPos = - dotnetConfig.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) - + pattern.Length - - let endPos = dotnetConfig.IndexOf("\"", startPos) - let tfm = dotnetConfig[startPos .. endPos - 1] - //printfn "GetTfmAndRid, tfm = '%s'" tfm - tfm - | None -> - match tryGetRunningDotNetCoreTfm () with - | Some tfm -> tfm - | _ -> getRunningDotNetFrameworkTfm () + let runningTfm = tryGetRunningTfm + // Coreclr has mechanism for getting rid + // System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier + // On Desktop framework compile it using osplatform+processarch+ // Computer valid dotnet-rids for this environment: // https://docs.microsoft.com/en-us/dotnet/core/rid-catalog // // Where rid is: win, win-x64, win-x86, osx-x64, linux-x64 etc ... let runningRid = - let processArchitecture = RuntimeInformation.ProcessArchitecture + let rid = + if isRunningOnCoreClr then + // Use reflection to get the value for rid + let rinfoType: Type option = + Option.ofObj ( + Type.GetType( + "System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.RuntimeInformation", + false + ) + ) + + let ridProperty: PropertyInfo option = + match rinfoType with + | None -> None + | Some t -> Option.ofObj (t.GetProperty("RuntimeIdentifier", BindingFlags.Public ||| BindingFlags.Static)) - let baseRid = - if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then - "win" - elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then - "osx" + match ridProperty with + | None -> None + | Some p -> Some(string (p.GetValue(null))) else - "linux" + None + + match rid with + | Some rid -> rid + | None -> + let processArchitecture = RuntimeInformation.ProcessArchitecture + + let baseRid = + if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then + "win" + elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then + "osx" + else + "linux" - match processArchitecture with - | Architecture.X64 -> baseRid + "-x64" - | Architecture.X86 -> baseRid + "-x86" - | Architecture.Arm64 -> baseRid + "-arm64" - | _ -> baseRid + "-arm" + match processArchitecture with + | Architecture.X64 -> baseRid + "-x64" + | Architecture.X86 -> baseRid + "-x86" + | Architecture.Arm64 -> baseRid + "-arm64" + | _ -> baseRid + "-arm" - tfm, runningRid) + runningTfm, runningRid) static member ClearStaticCaches() = desiredDotNetSdkVersionForDirectoryCache.Clear() diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index d222446b933..24141252ee8 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -123,6 +123,7 @@ module internal FSharpEnvironment = |] elif typeof.Assembly.GetName().Name = "System.Private.CoreLib" then [| + "net7.0" "net6.0" "net5.0" "netcoreapp3.1" From 2f3a78a399cfc10ba46d10e6e23461ace0a53888 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 2 Aug 2022 11:26:57 +0200 Subject: [PATCH 082/226] Update Rider link in FCS docs (#13612) --- docs/fcs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fcs/index.md b/docs/fcs/index.md index 5a21747f4c3..645e0d2f8ab 100644 --- a/docs/fcs/index.md +++ b/docs/fcs/index.md @@ -93,7 +93,7 @@ Some of the projects using the F# Compiler Services are: * [**F# in Visual Studio**](https://github.com/dotnet/fsharp/) * [**F# in Visual Studio for Mac**](https://github.com/mono/monodevelop/tree/master/main/external/fsharpbinding) * [**FsAutoComplete**](https://github.com/fsharp/FsAutoComplete) -* [**F# in JetBrains Rider**](https://www.jetbrains.com/help/rider/F_Sharp.html) +* [**F# in JetBrains Rider**](https://github.com/JetBrains/resharper-fsharp) * [**F# in .NET Interactive Notebooks**](https://github.com/dotnet/interactive) * [**Fantomas**](https://github.com/fsprojects/fantomas/) - Source code formatting for F# * [**FSharpLint**](https://fsprojects.github.io/FSharpLint/) - Lint tool for F# From eb72891948f98f67b9620e9d61a1d991c415350a Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 2 Aug 2022 16:41:39 +0200 Subject: [PATCH 083/226] Fixing a few edge cases around display name (+cleanup) (#13552) * cleanup some things around names * more rigorously separate display names, core display names and logical names * fix build * Fixing build * Update * Fixed a test * Fixed a test * Fixing more tests * Update PrettyNaming.fs * Update * Update * ok * conflict * Added a test * Added another test * And another test * Minor stuff Co-authored-by: Peter Semkin Co-authored-by: Petr --- .gitignore | 2 + docs/names.md | 206 ++++++++++++++++++ release-notes.md | 3 + .../Checking/CheckComputationExpressions.fs | 12 +- src/Compiler/Checking/CheckExpressions.fs | 34 +-- src/Compiler/Checking/ConstraintSolver.fs | 10 +- src/Compiler/Checking/NameResolution.fs | 68 +++--- src/Compiler/Checking/NameResolution.fsi | 12 +- src/Compiler/Checking/NicePrint.fs | 48 ++-- .../Checking/PatternMatchCompilation.fs | 4 +- src/Compiler/Checking/infos.fs | 37 +++- src/Compiler/Checking/infos.fsi | 23 +- src/Compiler/Driver/CompilerDiagnostics.fs | 14 +- src/Compiler/Service/FSharpCheckerResults.fs | 2 +- .../Service/ServiceDeclarationLists.fs | 24 +- .../Service/ServiceDeclarationLists.fsi | 12 + src/Compiler/Service/ServiceLexing.fs | 6 - src/Compiler/Service/ServiceLexing.fsi | 8 +- src/Compiler/Service/ServiceNavigation.fs | 44 ++-- src/Compiler/Service/ServiceNavigation.fsi | 14 +- src/Compiler/Symbols/SymbolHelpers.fs | 20 +- src/Compiler/Symbols/Symbols.fs | 103 +++++---- src/Compiler/Symbols/Symbols.fsi | 2 + src/Compiler/SyntaxTree/PrettyNaming.fs | 75 ++++--- src/Compiler/SyntaxTree/PrettyNaming.fsi | 108 +++++---- src/Compiler/TypedTree/TypeProviders.fs | 4 +- src/Compiler/TypedTree/TypedTree.fs | 28 ++- src/Compiler/TypedTree/TypedTree.fsi | 54 ++++- src/Compiler/TypedTree/TypedTreeOps.fs | 13 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 14 +- .../CompletionTests.fs | 34 +-- ...erService.SurfaceArea.netstandard.expected | 28 ++- .../ManglingNameOfProvidedTypes.fs | 16 +- tests/service/EditorTests.fs | 18 +- tests/service/PrettyNaming.fs | 98 +++++---- tests/service/ProjectAnalysisTests.fs | 2 +- .../CodeFix/RenameParamToMatchSignature.fs | 2 +- .../CodeFix/ReplaceWithSuggestion.fs | 4 +- .../Completion/CompletionProvider.fs | 8 +- .../FSharp.Editor/Completion/SignatureHelp.fs | 5 +- .../Navigation/NavigateToSearchService.fs | 29 +-- .../Navigation/NavigationBarItemService.fs | 4 +- .../FSharp.LanguageService/Intellisense.fs | 18 +- .../tests/UnitTests/QuickInfoTests.fs | 84 ++++++- .../UnitTests/SignatureHelpProviderTests.fs | 93 +++++--- 45 files changed, 996 insertions(+), 451 deletions(-) create mode 100644 docs/names.md diff --git a/.gitignore b/.gitignore index 7bb9a91aed9..95851a4bc83 100644 --- a/.gitignore +++ b/.gitignore @@ -123,3 +123,5 @@ nCrunchTemp_* /test.fs /test.fsx + +tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.actual diff --git a/docs/names.md b/docs/names.md new file mode 100644 index 00000000000..cb2bb35d4ea --- /dev/null +++ b/docs/names.md @@ -0,0 +1,206 @@ +--- +title: Display names, logical names and compiled names +category: Compiler Internals +categoryindex: 200 +index: 350 +--- +# Names of entities and values in the F# Compiler + +The F# tooling distinguishes between the following concepts of "name" for values, union cases, class/record fields and entities: + +* Display names as they appear in code + + Characteristics: + - For most identifiers, have double backticks, e.g. ` ``Module name with spaces`` ` + - For operator names, are short and parenthesized, e.g. `(+)` for the logical name `op_Addition` + - For active patterns, are parenthesized, e.g. `(|A|_|)` + - etc., see exact specification below + + Used in: + - Code outputs, e.g. signature files + - Diagnostics (BUG: not consistently the case today) + + Current aliases in code: + - `vref.DisplayName` + - `entity.DisplayName` + - `entity.DisplayNameWithStaticParameters` + - `entity.DisplayNameWithStaticParametersAndUnderscoreTypars` + - `minfo.DisplayName` + - `pinfo.DisplayName` + - `einfo.DisplayName` + - etc. + +* Display names as they appear in declaration lists, navigation etc. + + Characteristics: + - Same as above without the double backticks or parentheses + + Current aliases in code: + - `vref.DisplayNameCore` + - `entity.DisplayNameCore` + - `minfo.DisplayNameCore` + - `pinfo.DisplayNameCore` + - `einfo.DisplayNameCore` + - etc. + +* Logical names + + Characteristics: + - Are used in `TypedTree`, often "canonical" + - Sometimes require extra flags to qualify the meaning of the name + + Current aliases in code: + - `vref.LogicalName` + - `entity.LogicalName` + - `minfo.LogicalName` + - `pinfo.PropertyName` + - `einfo.EventName` + - etc. + +* Compiled names + + Characterists: + - Mark the names that appear in the .NET IL + + Current aliases in code: + - `vref.CompiledName` + - `entity.CompiledName` + - etc. + + +## Specification of all logical names + +The following tables loosely characterise the variations in logical names, how +they correspond to F# source constructs and the `SyntaxTree`/`TypedTree` metadata for these. + +Entities: + +Display name in code | Logical name | Notes +----------------------------|----------------|------- +C | C | type definition +C | C`1 | e.g. generic type, see notes below for variations of display names +M | M | module definition +M | MModule | "ModuleSuffix" attribute for F# modules, now somewhat legacy, rarely used, but still allowed; also where "ModuleSuffix" is implied because type and module have the same name +JsonProvider<"foo.json"> | JsonProvider,Schema=\"xyz\" | static parameters, see notes below for variations of display names + +Values: + + Display name in code | Relation | Logical name | Notes + ---------------------|----------|----------------------|------ + (+) | <--> | op_Addition | + (+ ) | --> | op_Addition | not reversed + op_Addition | --> | op_Addition | not reversed + (*) | <--> | op_Multiply | + ( * ) | --> | op_Multiply | not reversed + op_Multiply | --> | op_Multiply | not reversed + ( *+ ) | <--> | op_MultiplyPlus | + ( *+ ) | --> | op_MultiplyPlus | not reversed + op_MultiplyPlus | --> | op_MultiplyPlus | not reversed + (+++) | <--> | op_PlusPlusPlus | + op_PlusPlusPlus | --> | op_PlusPlusPlus | not reversed + (%) | <--> | op_Modulus | + op_Modulus | --> | op_Modulus | + (?) | <--> | op_Dynamic | not defined by default, for x?SomeThing + (?<-) | <--> | op_DynamicAssignment | not defined by default, for x?SomeThing <- "a" + (..) | <--> | op_Range | for "3 .. 5" + (.. ..) | <--> | op_RangeStep | for "5 .. -1 .. 3" + or | <--> | or | + mod | <--> | mod | + ``let`` | <--> | let | this is a keyword, in code it appears as ``let`` + ``type`` | <--> | type | this is a keyword, in code it appears as ``type`` + base | <--> | base | for IsBaseVal=true only. Base is a keyword, this is a special base val + ``base`` | <--> | base | for IsBaseVal=false only. Base is a keyword, this is not a special base val + SomeClass | <--> | .ctor | IsConstructor=true + ``.ctor`` | <--> | .ctor | IsConstructor=false, this is only allowed for let-definitions, e.g. let ``.ctor`` x = 1 + | <--> | .cctor | IsClassConstructor=true, should never really appear in diagnostics or user-facing output + ``.cctor`` | <--> | .cctor | IsClassConstructor=false, this is only allowed for let-definitions, e.g. let ``.cctor`` x = 1 + (\|A\|_\|) | <--> | \|A\|_\| | + (\|A \|_ \|) | --> | \|A\|_\| | not reversed + P | <--> | get_P | IsPropertyGetterMethod = true + P | <--> | set_P | IsPropertySetterMethod = true + +Other Val constructs less problematic for naming are: + +Display name in code | Relation | Logical name | Notes +---------------------|----------|----------------------|------ +this | <--> | this | IsCtorThisVal = true; From `type C() as this`; Can have any name, not particularly special with regard to names; This has a 'ref' type for initialization checks +this | <--> | this | IsMemberThisVal = true; From `member this.M() = ...`; This can have a 'ref' type for initialization checks; Can have any name, not particularly special with regard to names +\ | <--> | System.IDisposable.Dispose | ImplementedSlotSigs is non-empty, i.e. length 1, should never really appear in diagnostics or user-facing output + +Union cases: + +Display name in code | Relation | Logical name | Notes +---------------------|----------|----------------------|------ +SomeCase | <--> | SomeCase +` ``Case with space`` ` | <--> | Case with space +` ``type`` ` | <--> | type | This is a keyword +(::) | <--> | op_ColonColon | This is the logical name for the cons union case on `FSharpList` only +[] | <--> | op_Nil | This is the logical name for the nil case on `FSharpList` only + +Class and record fields, enum cases, active pattern cases, anonymous record fields: + +Display name in code | Relation | Logical name | Notes +---------------------|----------|----------------------|------ +SomeField | <--> | SomeField +` ``Field with space`` `| <--> | Field with space +` ``type`` ` | <--> | type | This is a keyword + +Generic parameters: + +Display name in code | Relation | Logical name | Notes +---------------------|----------|----------------------|------ +'T | <--> | T +'` ``T T T`` ` | <--> | T T T | BUG: the backticks are not currently added +'` ``type`` ` | <--> | type | This is a keyword, BUG: the backticks are not currently added + +## Variations on display names + +In different display settings, Entities/Types/Modules can have some variations on display names. For example, when showing some kinds of output we may set `shortTypeNames=true` which will never show full names. + +* `SomeTypeProvider` + - Used for omitting static parameters + - Alias in code: `entity.CompiledName` + +* `SomeTypeProvider<...>` + - Used for eliding static parameters + +* `SomeTypeProvider<"foo.json">` + - Used for showing static parameters. These can be very large, e.g. entire connection strings, so better to elide or omit. + - Alias in code: `entity.DisplayNameWithStaticParameters` + +* `List<_>` + - Used with underscore typars + - Alias in code: `entity.DisplayNameWithStaticParametersAndUnderscoreTypars` + +* `Dictionary<'TKey,'TResult>` + - Used with general typars + +* Full name + +Examples: + - `SomeNamespace.OtherNamespace.SomeType` + - ``` ``Some Namespace With Spaces``.SomeType``` <-- BUG: not double-ticks today + - `SomeEnclosingType<_>.SomeStaticMethod` <-- BUG: the mangled generic type counts are shown today + + +## Compiled names + +The name that appears in the .NET IL. + +Affected by: +- `CompiledName` attribute +- some heuristics for generic type parameters + +Also the name from signature is generally preferred; if there is any difference, a warning is emitted. + +Example of how signature affects compiled names + +```fsharp +Foo.fsi + + val SomeFunction: x: int -> y: int -> int + +Foo.fs + + let SomeFunction a b = a + b // compiled name of parameters is x, y - warning emitted +``` diff --git a/release-notes.md b/release-notes.md index 2b30ad027a9..8671501a864 100644 --- a/release-notes.md +++ b/release-notes.md @@ -35,6 +35,9 @@ These release notes track our current efforts to document changes to the F# proj * `SynMeasure` was extended with [SynMeasure.Paren](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax-synmeasure.html#Paren) case. * Dynamic expressions (like `x?y`) are now represented as [SynExpr.Dynamic](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax-synexpr.html#Dynamic) in the Untyped Syntax Tree. * Members with `get` and/or `set` are now represented as [SynMemberDefn.GetSetMember](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-syntax-synmemberdefn.html#GetSetMember) in the Untyped Syntax Tree. +* `DoesIdentifierNeedBackticks` is removed, it should always be sufficient to call `NormalizeIdentifierBackticks` or else call something in `PrettyNaming` +* `AddBackticksToIdentifierIfNeeded` is removed, it should always be sufficient to call `NormalizeIdentifierBackticks` +* `DeclarationListItem.Name` --> `DeclarationListItem.NameInList` ### F# 6.0 / Visual Studio 17.0 diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index c8a9501e475..523a0aa10c7 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -728,7 +728,7 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol let checkForBinaryApp comp = match comp with | StripApps(SingleIdent nm, [StripApps(SingleIdent nm2, args); arg2]) when - IsMangledInfixOperator nm.idText && + IsLogicalInfixOpName nm.idText && (match tryExpectedArgCountForCustomOperator nm2 with Some n -> n > 0 | _ -> false) && not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range arg2.Range @@ -876,8 +876,12 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol SynExpr.Sequential (DebugPointAtSequential.SuppressNeither, true, l, (arbExpr(caption, l.Range.EndRange)), l.Range) let mkOverallExprGivenVarSpaceExpr, varSpaceInner = + let isNullableOp opId = - match DecompileOpName opId with "?=" | "=?" | "?=?" -> true | _ -> false + match ConvertValLogicalNameToDisplayNameCore opId with + | "?=" | "=?" | "?=?" -> true + | _ -> false + match secondResultPatOpt, keySelectorsOpt with // groupJoin | Some secondResultPat, Some relExpr when customOperationIsLikeGroupJoin nm -> @@ -889,7 +893,7 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol | BinOpExpr (opId, l, r) -> if isNullableOp opId.idText then // When we cannot resolve NullableOps, recommend the relevant namespace to be added - errorR(Error(FSComp.SR.cannotResolveNullableOperators(DecompileOpName opId.idText), relExpr.Range)) + errorR(Error(FSComp.SR.cannotResolveNullableOperators(ConvertValLogicalNameToDisplayNameCore opId.idText), relExpr.Range)) else errorR(Error(FSComp.SR.tcInvalidRelationInJoin(nm.idText), relExpr.Range)) let l = wrapInArbErrSequence l "_keySelector1" @@ -911,7 +915,7 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol | BinOpExpr (opId, l, r) -> if isNullableOp opId.idText then // When we cannot resolve NullableOps, recommend the relevant namespace to be added - errorR(Error(FSComp.SR.cannotResolveNullableOperators(DecompileOpName opId.idText), relExpr.Range)) + errorR(Error(FSComp.SR.cannotResolveNullableOperators(ConvertValLogicalNameToDisplayNameCore opId.idText), relExpr.Range)) else errorR(Error(FSComp.SR.tcInvalidRelationInJoin(nm.idText), relExpr.Range)) // this is not correct JoinRelation but it is still binary operation diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index fa9546d9482..1e4063aa00f 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -1339,19 +1339,19 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS else List.foldBack (fun x -> qualifiedMangledNameOfTyconRef (tcrefOfAppTy g x)) intfSlotTys logicalName - if not isCompGen && IsMangledOpName id.idText && IsMangledInfixOperator id.idText then + if not isCompGen && IsLogicalInfixOpName id.idText then let m = id.idRange - let name = DecompileOpName id.idText + let name = ConvertValLogicalNameToDisplayNameCore id.idText // Check symbolic members. Expect valSynData implied arity to be [[2]]. match SynInfo.AritiesOfArgs valSynData with | [] | [0] -> warning(Error(FSComp.SR.memberOperatorDefinitionWithNoArguments name, m)) | n :: otherArgs -> - let opTakesThreeArgs = IsTernaryOperator name + let opTakesThreeArgs = IsLogicalTernaryOperator name if n<>2 && not opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonPairArgument(name, n), m)) if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(name, n), m)) if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments name, m)) - if isExtrinsic && IsMangledOpName id.idText then + if isExtrinsic && IsLogicalOpName id.idText then warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) PrelimMemberInfo(memberInfo, logicalName, compiledName) @@ -1471,7 +1471,7 @@ let CheckForAbnormalOperatorNames (cenv: cenv) (idRange: range) coreDisplayName if (idRange.EndColumn - idRange.StartColumn <= 5) && not g.compilingFSharpCore then - let opName = DecompileOpName coreDisplayName + let opName = ConvertValLogicalNameToDisplayNameCore coreDisplayName let isMember = memberInfoOpt.IsSome match opName with | Relational -> @@ -4316,7 +4316,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = let argTys = List.map fst argTys let logicalCompiledName = ComputeLogicalName id memberFlags - let item = Item.ArgName (id, memberConstraintTy, None) + let item = Item.ArgName (Some id, memberConstraintTy, None, id.idRange) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.AccessRights) TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None), tpenv @@ -4903,7 +4903,7 @@ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (StripParenTypes v) i let record ttype = match idOpt with | Some id -> - let item = Item.ArgName (id, ttype, Some container) + let item = Item.ArgName (Some id, ttype, Some container, id.idRange) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.AccessRights) | _ -> () @@ -5236,7 +5236,7 @@ and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv let activePatArgsAsSynExprs = List.map ConvSynPatToSynExpr activePatArgsAsSynPats - let activePatResTys = NewInferenceTypes g apinfo.Names + let activePatResTys = NewInferenceTypes g apinfo.ActiveTags let activePatType = apinfo.OverallType g m ty activePatResTys isStructRetTy let delayed = @@ -8083,8 +8083,8 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = | Some (IdentTrivia.OriginalNotation(text = text)) | Some (IdentTrivia.OriginalNotationWithParen(text = text)) -> ident(text, result.idRange) | _ -> - if IsMangledOpName result.idText then - let demangled = DecompileOpName result.idText + if IsLogicalOpName result.idText then + let demangled = ConvertValLogicalNameToDisplayNameCore result.idText if demangled.Length = result.idRange.EndColumn - result.idRange.StartColumn then ident(demangled, result.idRange) else result @@ -8386,7 +8386,7 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen cenv overallTy env item tp let mkConstrApp, argTys, argNames = match item with | Item.ActivePatternResult(apinfo, _apOverallTy, n, _) -> - let aparity = apinfo.Names.Length + let aparity = apinfo.ActiveTags.Length match aparity with | 0 | 1 -> let mkConstrApp _mArgs = function [arg] -> arg | _ -> error(InternalError("ApplyUnionCaseOrExn", mItem)) @@ -8658,8 +8658,8 @@ and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem and TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed = let g = cenv.g - let isPrefix = IsPrefixOperator id.idText - let isTernary = IsTernaryOperator id.idText + let isPrefix = IsLogicalPrefixOperator id.idText + let isTernary = IsLogicalTernaryOperator id.idText let argData = if isPrefix then @@ -9748,7 +9748,13 @@ and TcMethodApplication match assignedArg.NamedArgIdOpt with | None -> () | Some id -> - let item = Item.ArgName (defaultArg assignedArg.CalledArg.NameOpt id, assignedArg.CalledArg.CalledArgumentType, Some(ArgumentContainer.Method finalCalledMethInfo)) + let idOpt = Some (defaultArg assignedArg.CalledArg.NameOpt id) + let m = + match assignedArg.CalledArg.NameOpt with + | Some id -> id.idRange + | None -> id.idRange + let container = ArgumentContainer.Method finalCalledMethInfo + let item = Item.ArgName (idOpt, assignedArg.CalledArg.CalledArgumentType, Some container, m) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, ad)) /// STEP 6. Build the call expression, then adjust for byref-returns, out-parameters-as-tuples, post-hoc property assignments, methods-as-first-class-value, diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index dd9fd013553..cb70cd5835e 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -1689,9 +1689,9 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload match minfos, recdPropSearch, anonRecdPropSearch with | [], None, None when MemberConstraintIsReadyForStrongResolution csenv traitInfo -> if tys |> List.exists (isFunTy g) then - return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(DecompileOpName nm), m, m2)) + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) elif tys |> List.exists (isAnyTupleTy g) then - return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(DecompileOpName nm), m, m2)) + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) else match nm, argTys with | "op_Explicit", [argTy] -> @@ -1703,7 +1703,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload match tys with | [ty] -> NicePrint.minimalStringOfType denv ty | _ -> tys |> List.map (NicePrint.minimalStringOfType denv) |> String.concat ", " - let opName = DecompileOpName nm + let opName = ConvertValLogicalNameToDisplayNameCore nm let err = match opName with | "?>=" | "?>" | "?<=" | "?<" | "?=" | "?<>" @@ -1757,9 +1757,9 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload if isInstance <> memFlags.IsInstance then return! if isInstance then - ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsNotStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (DecompileOpName nm), nm), m, m2 )) + ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsNotStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (ConvertValLogicalNameToDisplayNameCore nm), nm), m, m2 )) else - ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (DecompileOpName nm), nm), m, m2 )) + ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (ConvertValLogicalNameToDisplayNameCore nm), nm), m, m2 )) else do! CheckMethInfoAttributes g m None minfo return TTraitSolved (minfo, calledMeth.CalledTyArgs) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 0f3daba1d0f..910cec2ab9e 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -122,7 +122,7 @@ let ActivePatternElemsOfModuleOrNamespace g (modref: ModuleOrNamespaceRef) : Nam cacheOptRef mtyp.ActivePatternElemRefLookupTable (fun () -> mtyp.AllValsAndMembers |> Seq.collect (ActivePatternElemsOfVal g modref) - |> Seq.fold (fun acc apref -> NameMap.add apref.Name apref acc) Map.empty) + |> Seq.fold (fun acc apref -> NameMap.add apref.LogicalName apref acc) Map.empty) //--------------------------------------------------------------------------- // Name Resolution Items @@ -228,7 +228,17 @@ type Item = | ImplicitOp of Ident * TraitConstraintSln option ref /// Represents the resolution of a name to a named argument - | ArgName of Ident * TType * ArgumentContainer option + // + // In the FCS API, Item.ArgName corresponds to FSharpParameter symbols. + // Not all parameters have names, e.g. for 'g' in this: + // + // let f (g: int -> int) x = ... + // + // then the symbol for 'g' reports FSharpParameters via CurriedParameterGroups + // based on analyzing the type of g as a function type. + // + // For these parameters, the identifier will be missing. + | ArgName of ident: Ident option * argType: TType * container: ArgumentContainer option * range: range /// Represents the resolution of a name to a named property setter | SetterArg of Ident * Item @@ -247,21 +257,20 @@ type Item = member d.DisplayNameCore = match d with | Item.Value v -> v.DisplayNameCore - | Item.ActivePatternResult (apinfo, _ty, n, _) -> apinfo.ActiveTags[n] - | Item.ActivePatternCase apref -> apref.Name + | Item.ActivePatternResult (apinfo, _ty, n, _) -> apinfo.DisplayNameCoreByIdx n + | Item.ActivePatternCase apref -> apref.DisplayNameCore | Item.UnionCase(uinfo, _) -> uinfo.DisplayNameCore | Item.ExnCase tcref -> tcref.DisplayNameCore | Item.RecdField rfinfo -> rfinfo.DisplayNameCore | Item.UnionCaseField (uci, fieldIndex) -> uci.UnionCase.GetFieldByIndex(fieldIndex).DisplayNameCore - | Item.AnonRecdField (anonInfo, _tys, i, _m) -> anonInfo.SortedNames[i] + | Item.AnonRecdField (anonInfo, _tys, fieldIndex, _m) -> anonInfo.DisplayNameCoreByIdx fieldIndex | Item.NewDef id -> id.idText - | Item.ILField finfo -> finfo.FieldName - | Item.Event einfo -> einfo.EventName - | Item.Property(_, FSProp(_, _, Some v, _) :: _) - | Item.Property(_, FSProp(_, _, _, Some v) :: _) -> v.DisplayNameCore - | Item.Property(nm, _) -> nm |> DecompileOpName + | Item.ILField finfo -> finfo.DisplayNameCore + | Item.Event einfo -> einfo.DisplayNameCore + | Item.Property(_, pinfo :: _) -> pinfo.DisplayNameCore + | Item.Property(nm, _) -> nm |> ConvertValLogicalNameToDisplayNameCore | Item.MethodGroup(_, FSMeth(_, _, v, _) :: _, _) -> v.DisplayNameCore - | Item.MethodGroup(nm, _, _) -> nm |> DecompileOpName + | Item.MethodGroup(nm, _, _) -> nm |> ConvertValLogicalNameToDisplayNameCore | Item.CtorGroup(nm, _) -> nm |> DemangleGenericTypeName | Item.FakeInterfaceCtor (AbbrevOrAppTy tcref) | Item.DelegateCtor (AbbrevOrAppTy tcref) -> tcref.DisplayNameCore @@ -269,7 +278,8 @@ type Item = | Item.UnqualifiedType(tcref :: _) -> tcref.DisplayNameCore | Item.TypeVar (nm, _) -> nm | Item.ModuleOrNamespaces(modref :: _) -> modref.DisplayNameCore - | Item.ArgName (id, _, _) -> id.idText + | Item.ArgName (Some id, _, _, _) -> id.idText + | Item.ArgName (None, _, _, _) -> "" | Item.SetterArg (id, _) -> id.idText | Item.CustomOperation (customOpName, _, _) -> customOpName | Item.CustomBuilder (nm, _) -> nm @@ -282,14 +292,18 @@ type Item = | Item.ExnCase tcref -> tcref.DisplayName | Item.RecdField rfinfo -> rfinfo.DisplayName | Item.UnionCaseField (uci, fieldIndex) -> uci.UnionCase.GetFieldByIndex(fieldIndex).DisplayName - | Item.Property(_, FSProp(_, _, Some v, _) :: _) - | Item.Property(_, FSProp(_, _, _, Some v) :: _) -> v.DisplayName - | Item.MethodGroup(_, FSMeth(_, _, v, _) :: _, _) -> v.DisplayName + | Item.AnonRecdField (anonInfo, _tys, fieldIndex, _m) -> anonInfo.DisplayNameByIdx fieldIndex + | Item.ActivePatternCase apref -> apref.DisplayName + | Item.Property(_, pinfo :: _) -> pinfo.DisplayName + | Item.Event einfo -> einfo.DisplayName + | Item.MethodGroup(_, minfo :: _, _) -> minfo.DisplayName | Item.DelegateCtor (AbbrevOrAppTy tcref) -> tcref.DisplayName | Item.UnqualifiedType(tcref :: _) -> tcref.DisplayName | Item.ModuleOrNamespaces(modref :: _) -> modref.DisplayName - | Item.TypeVar (nm, _) -> nm - | _ -> d.DisplayNameCore |> ConvertNameToDisplayName + | Item.TypeVar (nm, _) -> nm |> ConvertLogicalNameToDisplayName + | Item.ArgName (Some id, _, _, _) -> id.idText |> ConvertValLogicalNameToDisplayName false + | Item.ArgName (None, _, _, _) -> "" + | _ -> d.DisplayNameCore |> ConvertLogicalNameToDisplayName let valRefHash (vref: ValRef) = match vref.TryDeref with @@ -730,7 +744,7 @@ let AddValRefsToActivePatternsNameEnv g ePatItems (vref: ValRef) = let ePatItems = (ActivePatternElemsOfValRef g vref, ePatItems) ||> List.foldBack (fun apref tab -> - NameMap.add apref.Name (Item.ActivePatternCase apref) tab) + NameMap.add apref.LogicalName (Item.ActivePatternCase apref) tab) // Add literal constants to the environment available for resolving items in patterns let ePatItems = @@ -763,8 +777,8 @@ let AddValRefToNameEnv g nenv (vref: ValRef) = /// Add a set of active pattern result tags to the environment. let AddActivePatternResultTagsToNameEnv (apinfo: ActivePatternInfo) nenv apOverallTy m = - if List.isEmpty apinfo.Names then nenv else - let apResultNameList = List.indexed apinfo.Names + if List.isEmpty apinfo.ActiveTags then nenv else + let apResultNameList = List.indexed apinfo.ActiveTags { nenv with eUnqualifiedItems = (apResultNameList, nenv.eUnqualifiedItems) @@ -1059,7 +1073,7 @@ let ChooseMethInfosForNameEnv g m ty (minfos: MethInfo list) = |> List.filter (fun minfo -> not (minfo.IsInstance || minfo.IsClassConstructor || minfo.IsConstructor) && typeEquiv g minfo.ApparentEnclosingType ty && not (IsMethInfoPlainCSharpStyleExtensionMember g m isExtTy minfo) && - not (IsMangledOpName minfo.LogicalName)) + not (IsLogicalOpName minfo.LogicalName)) |> List.groupBy (fun minfo -> minfo.LogicalName) |> List.filter (fun (_, methGroup) -> not methGroup.IsEmpty) |> List.map (fun (methName, methGroup) -> KeyValuePair(methName, Item.MethodGroup(methName, methGroup, None))) @@ -1804,10 +1818,10 @@ let ItemsAreEffectivelyEqual g orig other = | Some vref1, Some vref2 -> valRefDefnEq g vref1 vref2 | _ -> false - | Item.ArgName (id1, _, _), Item.ArgName (id2, _, _) -> - (id1.idText = id2.idText && equals id1.idRange id2.idRange) + | Item.ArgName (Some id1, _, _, m1), Item.ArgName (Some id2, _, _, m2) -> + (id1.idText = id2.idText && equals m1 m2) - | Item.ArgName (id, _, _), ValUse vref | ValUse vref, Item.ArgName (id, _, _) -> + | Item.ArgName (Some id, _, _, _), ValUse vref | ValUse vref, Item.ArgName (Some id, _, _, _) -> ((equals id.idRange vref.DefinitionRange || equals id.idRange vref.SigRange) && id.idText = vref.DisplayName) | Item.AnonRecdField(anon1, _, i1, _), Item.AnonRecdField(anon2, _, i2, _) -> anonInfoEquiv anon1 anon2 && i1 = i2 @@ -1845,7 +1859,7 @@ let ItemsAreEffectivelyEqualHash (g: TcGlobals) orig = | ActivePatternCaseUse (_, _, idx)-> hash idx | MethodUse minfo -> minfo.ComputeHashCode() | PropertyUse pinfo -> pinfo.ComputeHashCode() - | Item.ArgName (id, _, _) -> hash id.idText + | Item.ArgName (Some id, _, _, _) -> hash id.idText | ILFieldUse ilfinfo -> ilfinfo.ComputeHashCode() | UnionCaseUse ucase -> hash ucase.CaseName | RecordFieldUse (name, _) -> hash name @@ -1969,7 +1983,7 @@ type TcResultsSinkImpl(tcGlobals, ?sourceText: ISourceText) = let keyOpt = match item with | Item.Value vref -> Some (endPos, vref.DisplayName) - | Item.ArgName (id, _, _) -> Some (endPos, id.idText) + | Item.ArgName (Some id, _, _, _) -> Some (endPos, id.idText) | _ -> None match keyOpt with @@ -2862,7 +2876,7 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, tcrefs) let implicitOpSearch() = - if IsMangledOpName id.idText then + if IsLogicalOpName id.idText then success [(ResolutionInfo.Empty, Item.ImplicitOp(id, ref None))] else NoResultsOrUsefulErrors diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 969e22c0207..1494c029b85 100644 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -122,7 +122,17 @@ type Item = | ImplicitOp of Ident * TraitConstraintSln option ref /// Represents the resolution of a name to a named argument - | ArgName of Ident * TType * ArgumentContainer option + // + // In the FCS API, Item.ArgName corresponds to FSharpParameter symbols. + // Not all parameters have names, e.g. for 'g' in this: + // + // let f (g: int -> int) x = ... + // + // then the symbol for 'g' reports FSharpParameters via CurriedParameterGroups + // based on analyzing the type of g as a function type. + // + // For these parameters, the identifier will be missing. + | ArgName of ident: Ident option * argType: TType * container: ArgumentContainer option * range: range /// Represents the resolution of a name to a named property setter | SetterArg of Ident * Item diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index f9ede5721e7..efaafc194f3 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -445,7 +445,7 @@ module PrintIL = | Some s -> WordL.equals ^^ wordL s let layoutILEnumCase nm litVal = - let nameL = ConvertNameToDisplayLayout (tagEnum >> wordL) nm + let nameL = ConvertLogicalNameToDisplayLayout (tagEnum >> wordL) nm WordL.bar ^^ nameL ^^ layoutILFieldInit litVal module PrintTypes = @@ -796,7 +796,7 @@ module PrintTypes = (layoutTyparRefWithInfo denv env tp)) |> longConstraintPrefix] and layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argTys, retTy, _)) = - let nameL = ConvertValNameToDisplayLayout false (tagMember >> wordL) nm + let nameL = ConvertValLogicalNameToDisplayLayout false (tagMember >> wordL) nm if denv.shortConstraints then WordL.keywordMember ^^ nameL else @@ -935,7 +935,7 @@ module PrintTypes = match argInfo.Name, isOptionalArg, isParamArray, tryDestOptionTy g ty with // Layout an optional argument | Some id, true, _, ValueSome ty -> - let idL = ConvertValNameToDisplayLayout false (tagParameter >> rightL) id.idText + let idL = ConvertValLogicalNameToDisplayLayout false (tagParameter >> rightL) id.idText LeftL.questionMark ^^ (idL |> addColonL) ^^ layoutTypeWithInfoAndPrec denv env 2 ty @@ -946,7 +946,7 @@ module PrintTypes = // Layout a named argument | Some id, _, isParamArray, _ -> - let idL = ConvertValNameToDisplayLayout false (tagParameter >> wordL) id.idText + let idL = ConvertValLogicalNameToDisplayLayout false (tagParameter >> wordL) id.idText let prefix = if isParamArray then layoutBuiltinAttribute denv g.attrib_ParamArrayAttribute ^^ idL @@ -1063,7 +1063,7 @@ module PrintTypes = let prettyLayoutOfMemberSig denv (memberToParentInst, nm, methTypars, argInfos, retTy) = let _, niceMethodTypars, tauL = prettyLayoutOfMemberSigCore denv memberToParentInst (emptyTyparInst, methTypars, argInfos, retTy) - let nameL = ConvertValNameToDisplayLayout false (tagMember >> wordL) nm + let nameL = ConvertValLogicalNameToDisplayLayout false (tagMember >> wordL) nm let nameL = if denv.showTyparBinding then layoutTyparDecls denv nameL true niceMethodTypars @@ -1151,7 +1151,7 @@ module PrintTastMemberOrVals = nameL let layoutMemberName (denv: DisplayEnv) (vref: ValRef) niceMethodTypars tagFunction name = - let nameL = ConvertValNameToDisplayLayout vref.IsBaseVal (tagFunction >> mkNav vref.DefinitionRange >> wordL) name + let nameL = ConvertValLogicalNameToDisplayLayout vref.IsBaseVal (tagFunction >> mkNav vref.DefinitionRange >> wordL) name let nameL = if denv.showMemberContainers then layoutTyconRef denv vref.MemberApparentEntity ^^ SepL.dot ^^ nameL @@ -1376,7 +1376,7 @@ module InfoMemberPrinting = match isParamArray, nmOpt, isOptArg with // Layout an optional argument | _, Some id, true -> - let idL = ConvertValNameToDisplayLayout false (tagParameter >> rightL) id.idText + let idL = ConvertValLogicalNameToDisplayLayout false (tagParameter >> rightL) id.idText let pty = match ptyOpt with ValueSome x -> x | _ -> pty LeftL.questionMark ^^ (idL |> addColonL) ^^ @@ -1388,14 +1388,14 @@ module InfoMemberPrinting = // Layout a named ParamArray argument | true, Some id, _ -> - let idL = ConvertValNameToDisplayLayout false (tagParameter >> wordL) id.idText + let idL = ConvertValLogicalNameToDisplayLayout false (tagParameter >> wordL) id.idText layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute ^^ (idL |> addColonL) ^^ PrintTypes.layoutType denv pty // Layout a named normal argument | false, Some id, _ -> - let idL = ConvertValNameToDisplayLayout false (tagParameter >> wordL) id.idText + let idL = ConvertValLogicalNameToDisplayLayout false (tagParameter >> wordL) id.idText (idL |> addColonL) ^^ PrintTypes.layoutType denv pty @@ -1423,7 +1423,7 @@ module InfoMemberPrinting = if minfo.IsConstructor then WordL.keywordNew else - let idL = ConvertValNameToDisplayLayout false (tagMethod >> tagNavArbValRef minfo.ArbitraryValRef >> wordL) minfo.LogicalName + let idL = ConvertValLogicalNameToDisplayLayout false (tagMethod >> tagNavArbValRef minfo.ArbitraryValRef >> wordL) minfo.LogicalName WordL.keywordMember ^^ PrintTypes.layoutTyparDecls denv idL true minfo.FormalMethodTypars @@ -1469,7 +1469,7 @@ module InfoMemberPrinting = if minfo.IsConstructor then SepL.leftParen else - let idL = ConvertValNameToDisplayLayout false (tagMethod >> tagNavArbValRef minfo.ArbitraryValRef >> wordL) minfo.LogicalName + let idL = ConvertValLogicalNameToDisplayLayout false (tagMethod >> tagNavArbValRef minfo.ArbitraryValRef >> wordL) minfo.LogicalName SepL.dot ^^ PrintTypes.layoutTyparDecls denv idL true minfo.FormalMethodTypars ^^ SepL.leftParen @@ -1537,7 +1537,7 @@ module InfoMemberPrinting = let retTy = pinfo.GetPropertyType(amap, m) let retTy = if pinfo.IsIndexer then mkFunTy g (mkRefTupledTy g (pinfo.GetParamTypes(amap, m))) retTy else retTy let retTy, _ = PrettyTypes.PrettifyType g retTy - let nameL = ConvertValNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName + let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName let getterSetter = match pinfo.HasGetter, pinfo.HasSetter with | true, false -> @@ -1591,7 +1591,7 @@ module TastDefinitionPrinting = aboveListL (List.map (layoutExtensionMember denv infoReader) vs) let layoutRecdField prefix isClassDecl denv infoReader (enclosingTcref: TyconRef) (fld: RecdField) = - let lhs = ConvertNameToDisplayLayout (tagRecordField >> mkNav fld.DefinitionRange >> wordL) fld.DisplayNameCore + let lhs = ConvertLogicalNameToDisplayLayout (tagRecordField >> mkNav fld.DefinitionRange >> wordL) fld.DisplayNameCore let lhs = (if isClassDecl then layoutAccessibility denv fld.Accessibility lhs else lhs) let lhs = if fld.IsMutable then wordL (tagKeyword "mutable") --- lhs else lhs let fieldL = @@ -1632,7 +1632,7 @@ module TastDefinitionPrinting = sepListL WordL.star (List.mapi (layoutUnionOrExceptionField denv infoReader isGenerated enclosingTcref) fields) let layoutUnionCase denv infoReader prefixL enclosingTcref (ucase: UnionCase) = - let nmL = ConvertNameToDisplayLayout (tagUnionCase >> mkNav ucase.DefinitionRange >> wordL) ucase.Id.idText + let nmL = ConvertLogicalNameToDisplayLayout (tagUnionCase >> mkNav ucase.DefinitionRange >> wordL) ucase.Id.idText //let nmL = layoutAccessibility denv ucase.Accessibility nmL let caseL = match ucase.RecdFields with @@ -1664,7 +1664,7 @@ module TastDefinitionPrinting = let layoutILFieldInfo denv (infoReader: InfoReader) m (finfo: ILFieldInfo) = let staticL = if finfo.IsStatic then WordL.keywordStatic else emptyL - let nameL = ConvertNameToDisplayLayout (tagField >> wordL) finfo.FieldName + let nameL = ConvertLogicalNameToDisplayLayout (tagField >> wordL) finfo.FieldName let typL = layoutType denv (finfo.FieldType(infoReader.amap, m)) let fieldL = staticL ^^ WordL.keywordVal ^^ (nameL |> addColonL) ^^ typL layoutXmlDocOfILFieldInfo denv infoReader finfo fieldL @@ -1672,7 +1672,7 @@ module TastDefinitionPrinting = let layoutEventInfo denv (infoReader: InfoReader) m (einfo: EventInfo) = let amap = infoReader.amap let staticL = if einfo.IsStatic then WordL.keywordStatic else emptyL - let nameL = ConvertValNameToDisplayLayout false (tagEvent >> tagNavArbValRef einfo.ArbitraryValRef >> wordL) einfo.EventName + let nameL = ConvertValLogicalNameToDisplayLayout false (tagEvent >> tagNavArbValRef einfo.ArbitraryValRef >> wordL) einfo.EventName let typL = layoutType denv (einfo.GetDelegateType(amap, m)) let overallL = staticL ^^ WordL.keywordMember ^^ (nameL |> addColonL) ^^ typL layoutXmlDocOfEventInfo denv infoReader einfo overallL @@ -1691,7 +1691,7 @@ module TastDefinitionPrinting = else WordL.keywordMember - let nameL = ConvertValNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName + let nameL = ConvertValLogicalNameToDisplayLayout false (tagProperty >> tagNavArbValRef pinfo.ArbitraryValRef >> wordL) pinfo.PropertyName let typL = layoutType denv (pinfo.GetPropertyType(amap, m)) let overallL = modifierAndMember ^^ (nameL |> addColonL) ^^ typL layoutXmlDocOfPropInfo denv infoReader pinfo overallL @@ -1726,7 +1726,7 @@ module TastDefinitionPrinting = else None, tagUnknownType - let nameL = ConvertNameToDisplayLayout (tagger >> mkNav tycon.DefinitionRange >> wordL) tycon.DisplayNameCore + let nameL = ConvertLogicalNameToDisplayLayout (tagger >> mkNav tycon.DefinitionRange >> wordL) tycon.DisplayNameCore let nameL = layoutAccessibility denv tycon.Accessibility nameL let denv = denv.AddAccessibility tycon.Accessibility @@ -2081,7 +2081,7 @@ module TastDefinitionPrinting = let layoutExnDefn denv infoReader (exncref: EntityRef) = let (-*) = if denv.printVerboseSignatures then (-----) else (---) let exnc = exncref.Deref - let nameL = ConvertNameToDisplayLayout (tagClass >> mkNav exncref.DefinitionRange >> wordL) exnc.DisplayNameCore + let nameL = ConvertLogicalNameToDisplayLayout (tagClass >> mkNav exncref.DefinitionRange >> wordL) exnc.DisplayNameCore let nameL = layoutAccessibility denv exnc.TypeReprAccessibility nameL let exnL = wordL (tagKeyword "exception") ^^ nameL // need to tack on the Exception at the right of the name for goto definition let reprL = @@ -2132,19 +2132,19 @@ module TastDefinitionPrinting = let headerL = if mspec.IsNamespace then // This is a container namespace. We print the header when we get to the first concrete module. - let pathL = path |> List.map (ConvertNameToDisplayLayout (tagNamespace >> wordL)) + let pathL = path |> List.map (ConvertLogicalNameToDisplayLayout (tagNamespace >> wordL)) wordL (tagKeyword "namespace") ^^ sepListL SepL.dot pathL else // This is a module let name = path |> List.last - let nameL = ConvertNameToDisplayLayout (tagModule >> mkNav mspec.DefinitionRange >> wordL) name + let nameL = ConvertLogicalNameToDisplayLayout (tagModule >> mkNav mspec.DefinitionRange >> wordL) name let nameL = match path with | [_] -> nameL | _ -> let innerPath = path[..path.Length - 2] - let innerPathL = innerPath |> List.map (ConvertNameToDisplayLayout (tagNamespace >> wordL)) + let innerPathL = innerPath |> List.map (ConvertLogicalNameToDisplayLayout (tagNamespace >> wordL)) sepListL SepL.dot innerPathL ^^ SepL.dot ^^ nameL let modNameL = wordL (tagKeyword "module") ^^ nameL @@ -2324,7 +2324,7 @@ module InferredSigPrinting = let basicL = // Check if this namespace contains anything interesting if isConcreteNamespace def then - let pathL = innerPath |> List.map (fst >> ConvertNameToDisplayLayout (tagNamespace >> wordL)) + let pathL = innerPath |> List.map (fst >> ConvertLogicalNameToDisplayLayout (tagNamespace >> wordL)) // This is a container namespace. We print the header when we get to the first concrete module. let headerL = wordL (tagKeyword "namespace") ^^ sepListL SepL.dot pathL @@ -2338,7 +2338,7 @@ module InferredSigPrinting = basicL else // This is a module - let nmL = ConvertNameToDisplayLayout (tagModule >> mkNav mspec.DefinitionRange >> wordL) mspec.DisplayNameCore + let nmL = ConvertLogicalNameToDisplayLayout (tagModule >> mkNav mspec.DefinitionRange >> wordL) mspec.DisplayNameCore let nmL = layoutAccessibility denv mspec.Accessibility nmL let denv = denv.AddAccessibility mspec.Accessibility let basic = imdefL denv def diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index ec5c5488f81..5972ccf30fb 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -1328,7 +1328,7 @@ let CompilePatternBasic let discrim' = match discrim with | DecisionTreeTest.ActivePatternCase(_pexp, resTys, isStructRetTy, _apatVrefOpt, idx, apinfo) -> - let aparity = apinfo.Names.Length + let aparity = apinfo.ActiveTags.Length let total = apinfo.IsTotal if not total && aparity > 1 then error(Error(FSComp.SR.patcPartialActivePatternsGenerateOneResult(), m)) @@ -1410,7 +1410,7 @@ let CompilePatternBasic // Total active patterns always return choice values let hasParam = (match apatVrefOpt with None -> true | Some (vref, _) -> doesActivePatternHaveFreeTypars g vref) if (hasParam && i = iInvestigated) || (discrimsEq g discrim (Option.get (getDiscrimOfPattern patAtActive))) then - let aparity = apinfo.Names.Length + let aparity = apinfo.ActiveTags.Length let subAccess j tpinst _e' = assert inpExprOpt.IsSome if aparity <= 1 then diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index ddaf2e35b0c..10c8d6fd5a4 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -653,13 +653,13 @@ type MethInfo = member x.DisplayName = match x with | FSMeth(_, _, vref, _) -> vref.DisplayName - | _ -> x.LogicalName |> PrettyNaming.ConvertValNameToDisplayName false + | _ -> x.LogicalName |> PrettyNaming.ConvertValLogicalNameToDisplayName false /// Get the method name in DisplayName form member x.DisplayNameCore = match x with | FSMeth(_, _, vref, _) -> vref.DisplayNameCore - | _ -> x.LogicalName |> PrettyNaming.DecompileOpName + | _ -> x.LogicalName |> PrettyNaming.ConvertValLogicalNameToDisplayNameCore /// Indicates if this is a method defined in this assembly with an internal XML comment member x.HasDirectXmlComment = @@ -1377,6 +1377,8 @@ type ILFieldInfo = | ProvidedField(_, fi, m) -> fi.PUntaint((fun fi -> fi.Name), m) #endif + member x.DisplayNameCore = x.FieldName + /// Indicates if the field is readonly (in the .NET/C# sense of readonly) member x.IsInitOnly = match x with @@ -1523,14 +1525,14 @@ type UnionCaseInfo = /// /// Backticks and parens are not added for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become [] and :: respectively. + /// Note logical names op_Nil and op_ColonColon become [] and :: respectively. member x.DisplayNameCore = x.UnionCase.DisplayNameCore /// Get the display name of the union case /// /// Backticks and parens are added implicitly for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become ([]) and (::) respectively. + /// Note logical names op_Nil and op_ColonColon become ([]) and (::) respectively. member x.DisplayName = x.UnionCase.DisplayName /// Get the instantiation of the type parameters of the declaring type of the union case @@ -1696,6 +1698,20 @@ type PropInfo = #endif | FSProp _ -> failwith "unreachable" + /// Get the property name in DisplayName form + member x.DisplayName = + match x with + | FSProp(_, _, Some vref, _) + | FSProp(_, _, _, Some vref) -> vref.DisplayName + | _ -> x.PropertyName |> PrettyNaming.ConvertValLogicalNameToDisplayName false + + /// Get the property name in DisplayNameCore form + member x.DisplayNameCore = + match x with + | FSProp(_, _, Some vref, _) + | FSProp(_, _, _, Some vref) -> vref.DisplayNameCore + | _ -> x.PropertyName |> PrettyNaming.ConvertValLogicalNameToDisplayNameCore + /// Indicates if this property has an associated getter method. member x.HasGetter = match x with @@ -2083,6 +2099,7 @@ type EventInfo = #if !NO_TYPEPROVIDERS | ProvidedEvent (amap, ei, m) -> ImportProvidedType amap m (ei.PApply((fun ei -> ei.DeclaringType), m)) #endif + /// Get the enclosing type of the method info, using a nominal type for tuple types member x.ApparentEnclosingAppType = match x with @@ -2129,6 +2146,18 @@ type EventInfo = | ProvidedEvent (_, ei, m) -> ei.PUntaint((fun ei -> ei.Name), m) #endif + /// Get the event name in DisplayName form + member x.DisplayName = + match x with + | FSEvent (_, p, _, _) -> p.DisplayName + | _ -> x.EventName |> PrettyNaming.ConvertValLogicalNameToDisplayName false + + /// Get the event name in DisplayNameCore form + member x.DisplayNameCore = + match x with + | FSEvent (_, p, _, _) -> p.DisplayNameCore + | _ -> x.EventName |> PrettyNaming.ConvertValLogicalNameToDisplayNameCore + /// Indicates if this property is static. member x.IsStatic = match x with diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 9d4fd965a67..ed9964db644 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -552,6 +552,9 @@ type ILFieldInfo = /// Get the name of the field member FieldName: string + /// Get the core of the display name for the field. This is the same as the logical name. + member DisplayNameCore: string + /// Get an (uninstantiated) reference to the field as an Abstract IL ILFieldRef member ILFieldRef: ILFieldRef @@ -648,14 +651,14 @@ type UnionCaseInfo = /// /// Backticks and parens are not added for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become [] and :: respectively. + /// Note logical names op_Nil and op_ColonColon become [] and :: respectively. member DisplayNameCore: string /// Get the display name of the union case /// /// Backticks and parens are added implicitly for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become ([]) and (::) respectively. + /// Note logical names op_Nil and op_ColonColon become ([]) and (::) respectively. member DisplayName: string /// Get the F# metadata for the declaring union type @@ -838,6 +841,14 @@ type PropInfo = /// Get the logical name of the property. member PropertyName: string + /// Get the display name of the property. + /// + /// Backticks and parens are added implicitly for non-identifiers. + member DisplayName: string + + /// Get the property name in core DisplayName form (no backticks or parens added) + member DisplayNameCore: string + /// Get a MethInfo for the 'setter' method associated with the property member SetterMethod: MethInfo @@ -942,6 +953,14 @@ type EventInfo = /// Get the logical name of the event. member EventName: string + /// Get the display name of the event. + /// + /// Backticks and parens are added implicitly for non-identifiers. + member DisplayName: string + + /// Get the event name in core DisplayName form (no backticks or parens added) + member DisplayNameCore: string + /// Indicates if this event has an associated XML comment authored in this assembly. member HasDirectXmlComment: bool diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 056f2f19a78..acf3da6e515 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -610,7 +610,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu for value in buffer do os.AppendLine() |> ignore os.AppendString " " - os.AppendString(DecompileOpName value) + os.AppendString(ConvertValLogicalNameToDisplayNameCore value) let rec OutputExceptionR (os: StringBuilder) error = @@ -937,12 +937,12 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Duplicate (k, s, _) -> if k = "member" then - os.AppendString(Duplicate1E().Format(DecompileOpName s)) + os.AppendString(Duplicate1E().Format(ConvertValLogicalNameToDisplayNameCore s)) else - os.AppendString(Duplicate2E().Format k (DecompileOpName s)) + os.AppendString(Duplicate2E().Format k (ConvertValLogicalNameToDisplayNameCore s)) | UndefinedName (_, k, id, suggestionsF) -> - os.AppendString(k (DecompileOpName id.idText)) + os.AppendString(k (ConvertValLogicalNameToDisplayNameCore id.idText)) suggestNames suggestionsF id.idText | InternalUndefinedItemRef (f, smr, ccuName, s) -> @@ -954,11 +954,11 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | FieldsFromDifferentTypes (_, fref1, fref2, _) -> os.AppendString(FieldsFromDifferentTypesE().Format fref1.FieldName fref2.FieldName) - | VarBoundTwice id -> os.AppendString(VarBoundTwiceE().Format(DecompileOpName id.idText)) + | VarBoundTwice id -> os.AppendString(VarBoundTwiceE().Format(ConvertValLogicalNameToDisplayNameCore id.idText)) | Recursion (denv, id, ty1, ty2, _) -> let ty1, ty2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.AppendString(RecursionE().Format (DecompileOpName id.idText) ty1 ty2 tpcs) + os.AppendString(RecursionE().Format (ConvertValLogicalNameToDisplayNameCore id.idText) ty1 ty2 tpcs) | InvalidRuntimeCoercion (denv, ty1, ty2, _) -> let ty1, ty2, tpcs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 @@ -1648,7 +1648,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | DiagnosticWithText (_, s, _) -> os.AppendString s | DiagnosticWithSuggestions (_, s, _, idText, suggestionF) -> - os.AppendString(DecompileOpName s) + os.AppendString(ConvertValLogicalNameToDisplayNameCore s) suggestNames suggestionF idText | InternalError (s, _) diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 6f84923f6c7..bfdb97fa0cc 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -549,7 +549,7 @@ type internal TypeCheckInfo x |> List.choose (fun (ParamData (_isParamArray, _isInArg, _isOutArg, _optArgInfo, _callerInfo, name, _, ty)) -> match name with - | Some n -> Some(Item.ArgName(n, ty, Some(ArgumentContainer.Method meth))) + | Some id -> Some(Item.ArgName(Some id, ty, Some(ArgumentContainer.Method meth), id.idRange)) | None -> None) | _ -> []) diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 30d024d646a..7d625985e2d 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -175,7 +175,7 @@ module DeclarationListHelpers = wordL (tagText (FSComp.SR.typeInfoUnionCase())) ^^ NicePrint.layoutTyconRef denv ucinfo.TyconRef ^^ sepL (tagPunctuation ".") ^^ - wordL (tagUnionCase (DecompileOpName uc.Id.idText) |> mkNav uc.DefinitionRange) ^^ + 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 @@ -196,14 +196,13 @@ module DeclarationListHelpers = // Active pattern tags | Item.ActivePatternCase apref -> let v = apref.ActivePatternVal - // Format the type parameters to get e.g. ('a -> 'a) rather than ('?1234 -> '?1234) let vTauTy = v.TauType // REVIEW: use _cxs here let (prettyTyparInst, prettyTy), _cxs = PrettyTypes.PrettifyInstAndType denv.g (item.TyparInstantiation, vTauTy) let remarks = OutputFullName displayFullName pubpathOfValRef fullDisplayTextOfValRefAsLayout v let layout = wordL (tagText (FSComp.SR.typeInfoActiveRecognizer())) ^^ - wordL (tagActivePatternCase apref.Name |> mkNav v.DefinitionRange) ^^ + wordL (tagActivePatternCase apref.DisplayName |> mkNav v.DefinitionRange) ^^ RightL.colon ^^ NicePrint.layoutType denv prettyTy @@ -224,14 +223,14 @@ module DeclarationListHelpers = | Item.RecdField rfinfo when rfinfo.TyconRef.IsFSharpException -> let ty, _ = PrettyTypes.PrettifyType g rfinfo.FieldType - let id = rfinfo.RecdField.Id + let id = rfinfo.DisplayName let layout = wordL (tagText (FSComp.SR.typeInfoArgument())) ^^ - wordL (tagParameter id.idText) ^^ + wordL (tagParameter id) ^^ RightL.colon ^^ NicePrint.layoutType denv ty let layout = toArray layout - ToolTipElement.Single (layout, xml, paramName = id.idText) + ToolTipElement.Single (layout, xml, paramName = id) // F# record field names | Item.RecdField rfinfo -> @@ -430,7 +429,7 @@ module DeclarationListHelpers = | Item.AnonRecdField(anon, argTys, i, _) -> let argTy = argTys[i] - let nm = anon.SortedNames[i] + let nm = anon.DisplayNameByIdx i let argTy, _ = PrettyTypes.PrettifyType g argTy let layout = wordL (tagText (FSComp.SR.typeInfoAnonRecdField())) ^^ @@ -441,7 +440,7 @@ module DeclarationListHelpers = ToolTipElement.Single (layout, FSharpXmlDoc.None) // Named parameters - | Item.ArgName (id, argTy, _) -> + | Item.ArgName (Some id, argTy, _, _) -> let argTy, _ = PrettyTypes.PrettifyType g argTy let layout = wordL (tagText (FSComp.SR.typeInfoArgument())) ^^ @@ -655,10 +654,10 @@ module internal DescriptionListsImpl = // in this case use old approach and return only information about types getPrettyParamsOfTypes () - | Some valRefInfo -> + | Some valReprInfo -> // ValReprInfo will exist for top-level syntactic functions // per spec: binding is considered to define a syntactic function if it is either a function or its immediate right-hand-side is a anonymous function - let _, argInfos, lastRetTy, _ = GetTopValTypeInFSharpForm g valRefInfo vref.Type m + let _, argInfos, lastRetTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m match argInfos with | [] -> // handles cases like 'let foo = List.map' @@ -700,7 +699,7 @@ module internal DescriptionListsImpl = let args, resTy = stripFunTy denv.g vTauTy let apinfo = Option.get (TryGetActivePatternInfo v) - let aparity = apinfo.Names.Length + let aparity = apinfo.ActiveTags.Length let caseTy = if aparity <= 1 then resTy else (argsOfAppTy g resTy)[apref.CaseIndex] @@ -918,8 +917,11 @@ module internal DescriptionListsImpl = [] type DeclarationListItem(textInDeclList: string, textInCode: string, fullName: string, glyph: FSharpGlyph, info, accessibility: FSharpAccessibility, kind: CompletionItemKind, isOwnMember: bool, priority: int, isResolved: bool, namespaceToOpen: string option) = + member _.Name = textInDeclList + member _.NameInList = textInDeclList + member _.NameInCode = textInCode member _.Description = diff --git a/src/Compiler/Service/ServiceDeclarationLists.fsi b/src/Compiler/Service/ServiceDeclarationLists.fsi index f01f05b9143..db07edf66ba 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fsi +++ b/src/Compiler/Service/ServiceDeclarationLists.fsi @@ -3,6 +3,7 @@ // API for declaration lists and method overload lists namespace FSharp.Compiler.EditorServices +open System open FSharp.Compiler.NameResolution open FSharp.Compiler.InfoReader open FSharp.Compiler.Symbols @@ -94,10 +95,21 @@ type internal CompletionItem = // Note: this type holds a weak reference to compiler resources. [] type public DeclarationListItem = + /// Get the text to display in the declaration list for the declaration. + /// + /// This is a display name without backticks. + [] member Name: string + /// Get the text to display in the declaration list for the declaration. + /// + /// This is a display name without backticks. + member NameInList: string + /// Get the text for the declaration as it's to be inserted into source code. + /// + /// This is a display name with backticks if necessary. member NameInCode: string /// Get the description diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index ba2490c3f9d..884afb3901a 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1211,12 +1211,6 @@ type FSharpSourceTokenizer(conditionalDefines: string list, fileName: string opt module FSharpKeywords = - let DoesIdentifierNeedBackticks s = - PrettyNaming.DoesIdentifierNeedBackticks s - - let AddBackticksToIdentifierIfNeeded s = - PrettyNaming.AddBackticksToIdentifierIfNeeded s - let NormalizeIdentifierBackticks s = PrettyNaming.NormalizeIdentifierBackticks s diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index df1dfdde294..2c2b928febb 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -337,14 +337,8 @@ module internal TestExpose = val TokenInfo: Parser.token -> FSharpTokenColorKind * FSharpTokenCharKind * FSharpTokenTriggerClass module FSharpKeywords = - /// Checks if adding backticks to identifier is needed. - val DoesIdentifierNeedBackticks: string -> bool - /// Add backticks if the identifier is a keyword. - /// A utility to help determine if an identifier needs to be quoted, this doesn't quote F# keywords. - val AddBackticksToIdentifierIfNeeded: string -> string - - /// Remove backticks if present. + /// Remove backticks if present and not needed. val NormalizeIdentifierBackticks: string -> string /// Keywords paired with their descriptions. Used in completion and quick info. diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 0751225c890..11ebea8a668 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -43,7 +43,7 @@ type NavigationEntityKind = type NavigationItem ( uniqueName: string, - name: string, + logicalName: string, kind: NavigationItemKind, glyph: FSharpGlyph, range: range, @@ -58,7 +58,7 @@ type NavigationItem member _.UniqueName = uniqueName - member _.Name = name + member _.LogicalName = logicalName member _.Glyph = glyph @@ -77,7 +77,7 @@ type NavigationItem member _.Access = access member _.WithUniqueName(uniqueName: string) = - NavigationItem(uniqueName, name, kind, glyph, range, bodyRange, singleTopLevel, enclosingEntityKind, isAbstract, access) + NavigationItem(uniqueName, logicalName, kind, glyph, range, bodyRange, singleTopLevel, enclosingEntityKind, isAbstract, access) static member Create(name, kind, glyph, range, bodyRange, singleTopLevel, enclosingEntityKind, isAbstract, access) = NavigationItem("", name, kind, glyph, range, bodyRange, singleTopLevel, enclosingEntityKind, isAbstract, access) @@ -432,18 +432,18 @@ module NavigationImpl = let nested = nested |> Array.ofList - |> Array.map (fun (decl, idx) -> decl.WithUniqueName(uniqueName d.Name idx)) + |> Array.map (fun (decl, idx) -> decl.WithUniqueName(uniqueName d.LogicalName idx)) - nested |> Array.sortInPlaceWith (fun a b -> compare a.Name b.Name) + nested |> Array.sortInPlaceWith (fun a b -> compare a.LogicalName b.LogicalName) { - Declaration = d.WithUniqueName(uniqueName d.Name idx) + Declaration = d.WithUniqueName(uniqueName d.LogicalName idx) Nested = nested } |] items - |> Array.sortInPlaceWith (fun a b -> compare a.Declaration.Name b.Declaration.Name) + |> Array.sortInPlaceWith (fun a b -> compare a.Declaration.LogicalName b.Declaration.LogicalName) NavigationItems(items) @@ -639,20 +639,22 @@ module NavigationImpl = let nested = nested |> Array.ofList - |> Array.map (fun (decl, idx) -> decl.WithUniqueName(uniqueName d.Name idx)) + |> Array.map (fun (decl, idx) -> decl.WithUniqueName(uniqueName d.LogicalName idx)) - nested |> Array.sortInPlaceWith (fun a b -> compare a.Name b.Name) + nested |> Array.sortInPlaceWith (fun a b -> compare a.LogicalName b.LogicalName) - let nested = nested |> Array.distinctBy (fun x -> x.Range, x.BodyRange, x.Name, x.Kind) + let nested = + nested + |> Array.distinctBy (fun x -> x.Range, x.BodyRange, x.LogicalName, x.Kind) { - Declaration = d.WithUniqueName(uniqueName d.Name idx) + Declaration = d.WithUniqueName(uniqueName d.LogicalName idx) Nested = nested } |] items - |> Array.sortInPlaceWith (fun a b -> compare a.Declaration.Name b.Declaration.Name) + |> Array.sortInPlaceWith (fun a b -> compare a.Declaration.LogicalName b.Declaration.LogicalName) NavigationItems(items) @@ -692,12 +694,12 @@ type NavigableContainerType = type NavigableContainer = { Type: NavigableContainerType - Name: string + LogicalName: string } type NavigableItem = { - Name: string + LogicalName: string Range: range IsSignature: bool Kind: NavigableItemKind @@ -722,7 +724,7 @@ module NavigateTo = if not (String.IsNullOrEmpty id.idText) then let item = { - Name = id.idText + LogicalName = id.idText Range = id.idRange IsSignature = isSignature Kind = kind @@ -745,7 +747,7 @@ module NavigateTo = { Type = NavigableContainerType.Exception - Name = id.idText + LogicalName = id.idText } let addComponentInfo containerType kind info isSig container = @@ -757,7 +759,7 @@ module NavigateTo = { Type = containerType - Name = formatLongIdent lid + LogicalName = formatLongIdent lid } let addValSig kind synValSig isSig container = @@ -825,7 +827,7 @@ module NavigateTo = item { Type = NavigableContainerType.File - Name = fileName + LogicalName = fileName } and walkSynModuleOrNamespaceSig (inp: SynModuleOrNamespaceSig) container = @@ -842,7 +844,7 @@ module NavigateTo = NavigableContainerType.Module else NavigableContainerType.Namespace - Name = formatLongIdent lid + LogicalName = formatLongIdent lid } for decl in decls do @@ -893,7 +895,7 @@ module NavigateTo = let container = { Type = NavigableContainerType.File - Name = fileName + LogicalName = fileName } for item in moduleOrNamespaceList do @@ -913,7 +915,7 @@ module NavigateTo = NavigableContainerType.Module else NavigableContainerType.Namespace - Name = formatLongIdent lid + LogicalName = formatLongIdent lid } for decl in decls do diff --git a/src/Compiler/Service/ServiceNavigation.fsi b/src/Compiler/Service/ServiceNavigation.fsi index 72f6e6c9fb6..7b1749f1416 100755 --- a/src/Compiler/Service/ServiceNavigation.fsi +++ b/src/Compiler/Service/ServiceNavigation.fsi @@ -37,7 +37,7 @@ type public NavigationEntityKind = /// Represents an item to be displayed in the navigation bar [] type public NavigationItem = - member Name: string + member LogicalName: string member UniqueName: string @@ -99,11 +99,17 @@ type NavigableContainerType = | Exception type NavigableContainer = - { Type: NavigableContainerType - Name: string } + { + /// The kind of container. + Type: NavigableContainerType + + /// If Type = File, this is the name of the file + /// In other cases it is the logical name of the entity. + LogicalName: string + } type NavigableItem = - { Name: string + { LogicalName: string Range: range IsSignature: bool Kind: NavigableItemKind diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index c265024fc40..1ca718d8165 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -108,7 +108,7 @@ module internal SymbolHelpers = | Item.CtorGroup(_, minfos) -> minfos |> List.tryPick (rangeOfMethInfo g preferFlag) | Item.ActivePatternResult(APInfo _, _, _, m) -> Some m | Item.SetterArg (_, item) -> rangeOfItem g preferFlag item - | Item.ArgName (id, _, _) -> Some id.idRange + | Item.ArgName (_, _, _, m) -> Some m | Item.CustomOperation (_, _, implOpt) -> implOpt |> Option.bind (rangeOfMethInfo g preferFlag) | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(_, vref, _))}) -> Some vref.Range | Item.ImplicitOp _ -> None @@ -167,7 +167,7 @@ module internal SymbolHelpers = |> Option.bind ccuOfValRef |> Option.orElseWith (fun () -> pinfo.DeclaringTyconRef |> computeCcuOfTyconRef)) - | Item.ArgName (_, _, Some (ArgumentContainer.Method minfo)) -> + | Item.ArgName (_, _, Some (ArgumentContainer.Method minfo), _) -> ccuOfMethInfo g minfo | Item.MethodGroup(_, minfos, _) @@ -180,7 +180,7 @@ module internal SymbolHelpers = | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.bind computeCcuOfTyconRef) - | Item.ArgName (_, _, Some (ArgumentContainer.Type eref)) -> + | Item.ArgName (_, _, Some (ArgumentContainer.Type eref), _) -> computeCcuOfTyconRef eref | Item.ModuleOrNamespaces erefs @@ -290,7 +290,7 @@ module internal SymbolHelpers = | Item.CtorGroup(_, minfo :: _) -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) - | Item.ArgName(_, _, Some argContainer) -> + | Item.ArgName(_, _, Some argContainer, _) -> match argContainer with | ArgumentContainer.Method minfo -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) | ArgumentContainer.Type tcref -> mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) @@ -494,10 +494,10 @@ module internal SymbolHelpers = | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> fullDisplayTextOfValRef vref | Item.UnionCase (ucinfo, _) -> fullDisplayTextOfUnionCaseRef ucinfo.UnionCaseRef - | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.Names[idx] - | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.Name + | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.DisplayNameByIdx idx + | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.DisplayName | Item.ExnCase ecref -> fullDisplayTextOfExnRef ecref - | Item.AnonRecdField(anon, _argTys, i, _) -> anon.SortedNames[i] + | Item.AnonRecdField(anon, _argTys, i, _) -> anon.DisplayNameByIdx i | Item.RecdField rfinfo -> fullDisplayTextOfRecdFieldRef rfinfo.RecdFieldRef | Item.NewDef id -> id.idText | Item.ILField finfo -> buildString (fun os -> NicePrint.outputType denv os finfo.ApparentEnclosingType; bprintf os ".%s" finfo.FieldName) @@ -517,8 +517,8 @@ module internal SymbolHelpers = | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> let definiteNamespace = modrefs |> List.forall (fun modref -> modref.IsNamespace) if definiteNamespace then fullDisplayTextOfModRef modref else modref.DisplayName - | Item.TypeVar (id, _) -> id - | Item.ArgName (id, _, _) -> id.idText + | Item.TypeVar _ + | Item.ArgName _ -> item.DisplayName | Item.SetterArg (_, item) -> FullNameOfItem g item | Item.ImplicitOp(id, _) -> id.idText | Item.UnionCaseField (UnionCaseInfo (_, ucref), fieldIndex) -> ucref.FieldByIndex(fieldIndex).DisplayName @@ -583,7 +583,7 @@ module internal SymbolHelpers = else GetXmlCommentForItemAux None infoReader m item - | Item.ArgName (_, _, argContainer) -> + | Item.ArgName (_, _, argContainer, _) -> let xmldoc = match argContainer with | Some(ArgumentContainer.Method minfo) -> diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 043624bbc63..4f7be4cc58c 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -316,8 +316,8 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C | Item.ActivePatternResult (apinfo, ty, n, _) -> FSharpActivePatternCase(cenv, apinfo, ty, n, None, item) :> _ - | Item.ArgName(id, ty, argOwner) -> - FSharpParameter(cenv, id, ty, argOwner) :> _ + | Item.ArgName(id, ty, argOwner, m) -> + FSharpParameter(cenv, id, ty, argOwner, m) :> _ | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _ @@ -1298,7 +1298,7 @@ type FSharpActivePatternGroup(cenv, apinfo:ActivePatternInfo, ty, valOpt) = member _.Name = valOpt |> Option.map (fun vref -> vref.LogicalName) - member _.Names = makeReadOnlyCollection apinfo.Names + member _.Names = makeReadOnlyCollection apinfo.ActiveTags member _.IsTotal = apinfo.IsTotal @@ -2025,7 +2025,14 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = // INCOMPLETENESS: Attribs is empty here, so we can't look at attributes for // either .NET or F# parameters let argInfo: ArgReprInfo = { Name=nmOpt; Attribs= [] } - yield FSharpParameter(cenv, pty, argInfo, None, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional, false) ] + let m = + match nmOpt with + | Some v -> v.idRange + | None -> + + defaultArg x.DeclarationLocationOpt range0 + + yield FSharpParameter(cenv, pty, argInfo, None, m, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional, false) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection @@ -2037,7 +2044,13 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = // INCOMPLETENESS: Attribs is empty here, so we can't look at attributes for // either .NET or F# parameters let argInfo: ArgReprInfo = { Name=nmOpt; Attribs= [] } - yield FSharpParameter(cenv, pty, argInfo, None, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional, false) ] + let m = + match nmOpt with + | Some v -> v.idRange + | None -> + + defaultArg x.DeclarationLocationOpt range0 + yield FSharpParameter(cenv, pty, argInfo, None, m, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional, false) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection @@ -2052,9 +2065,10 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = if isRefTupleTy cenv.g ty then tryDestRefTupleTy cenv.g ty else [ty] + let m = defaultArg x.DeclarationLocationOpt range0 yield allArguments - |> List.map (fun arg -> FSharpParameter(cenv, arg, ValReprInfo.unnamedTopArg1, x.DeclarationLocationOpt)) + |> List.map (fun arg -> FSharpParameter(cenv, arg, ValReprInfo.unnamedTopArg1, m)) |> makeReadOnlyCollection ] |> makeReadOnlyCollection else makeReadOnlyCollection [] @@ -2069,40 +2083,51 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = let isInArg = HasFSharpAttribute cenv.g cenv.g.attrib_InAttribute argInfo.Attribs && isByrefTy cenv.g argTy let isOutArg = HasFSharpAttribute cenv.g cenv.g.attrib_OutAttribute argInfo.Attribs && isByrefTy cenv.g argTy let isOptionalArg = HasFSharpAttribute cenv.g cenv.g.attrib_OptionalArgumentAttribute argInfo.Attribs - yield FSharpParameter(cenv, argTy, argInfo, None, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg, false) ] + let m = + match argInfo.Name with + | Some v -> v.idRange + | None -> defaultArg x.DeclarationLocationOpt range0 + yield FSharpParameter(cenv, argTy, argInfo, None, m, isParamArrayArg, isInArg, isOutArg, isOptionalArg, false) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection member x.ReturnParameter = checkIsResolved() match d with - | E e -> + | E einfo -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods + let m = defaultArg x.DeclarationLocationOpt range0 let retTy = - try PropTypeOfEventInfo cenv.infoReader range0 AccessibleFromSomewhere e + try PropTypeOfEventInfo cenv.infoReader m AccessibleFromSomewhere einfo with _ -> // For non-standard events, just use the delegate type as the ReturnParameter type - e.GetDelegateType(cenv.amap, range0) - FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, x.DeclarationLocationOpt) + einfo.GetDelegateType(cenv.amap, m) + FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, m) - | P p -> + | P pinfo -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods - let retTy = p.GetPropertyType(cenv.amap, range0) - FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, x.DeclarationLocationOpt) - | M m | C m -> + let m = defaultArg x.DeclarationLocationOpt range0 + let retTy = pinfo.GetPropertyType(cenv.amap, m) + FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, m) + + | M minfo | C minfo -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods - let retTy = m.GetFSharpReturnType(cenv.amap, range0, m.FormalMethodInst) - FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, x.DeclarationLocationOpt) + let m = defaultArg x.DeclarationLocationOpt range0 + let retTy = minfo.GetFSharpReturnType(cenv.amap, m, minfo.FormalMethodInst) + FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, m) + | V v -> match v.ValReprInfo with | None -> let _, tau = v.GeneralizedType let _argTysl, retTy = stripFunTy cenv.g tau - FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, x.DeclarationLocationOpt) + let m = defaultArg x.DeclarationLocationOpt range0 + FSharpParameter(cenv, retTy, ValReprInfo.unnamedRetVal, m) | Some (ValReprInfo(_typars, argInfos, retInfo)) -> let tau = v.TauType - let _c, retTy = GetTopTauTypeInFSharpForm cenv.g argInfos tau range0 - FSharpParameter(cenv, retTy, retInfo, x.DeclarationLocationOpt) + let m = defaultArg x.DeclarationLocationOpt range0 + let _c, retTy = GetTopTauTypeInFSharpForm cenv.g argInfos tau m + FSharpParameter(cenv, retTy, retInfo, m) override _.Attributes = @@ -2293,8 +2318,9 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = let paramTy = GenWitnessTy cenv.g witnessInfo let nm = String.uncapitalize witnessInfo.MemberName let nm = if used.Contains nm then nm + string i else nm - let argReprInfo : ArgReprInfo = { Attribs=[]; Name=Some (mkSynId x.DeclarationLocation nm) } - let p = FSharpParameter(cenv, paramTy, argReprInfo, None, None, false, false, false, false, true) + let m = x.DeclarationLocation + let argReprInfo : ArgReprInfo = { Attribs=[]; Name=Some (mkSynId m nm) } + let p = FSharpParameter(cenv, paramTy, argReprInfo, None, m, false, false, false, false, true) p, (used.Add nm, i + 1)) |> fst let witnessMethName = ExtraWitnessMethodName x.CompiledName @@ -2389,7 +2415,7 @@ type FSharpType(cenv, ty:TType) = member _.ProvidedArguments = let typeName, argNamesAndValues = try - PrettyNaming.demangleProvidedTypeName typeLogicalName + PrettyNaming.DemangleProvidedTypeName typeLogicalName with PrettyNaming.InvalidMangledStaticArg piece -> error(Error(FSComp.SR.etProvidedTypeReferenceInvalidText(piece), range0)) *) @@ -2598,7 +2624,8 @@ type FSharpStaticParameter(cenv, sp: Tainted< TypeProviders.ProvidedParameterInf protect <| fun () -> let paramTy = Import.ImportProvidedType cenv.amap m (sp.PApply((fun x -> x.ParameterType), m)) let nm = sp.PUntaint((fun p -> p.Name), m) - Item.ArgName((mkSynId m nm, paramTy, None))), + let id = mkSynId m nm + Item.ArgName(Some id, paramTy, None, m)), (fun _ _ _ -> true)) member _.Name = @@ -2634,39 +2661,29 @@ type FSharpStaticParameter(cenv, sp: Tainted< TypeProviders.ProvidedParameterInf "static parameter " + x.Name #endif -type FSharpParameter(cenv, paramTy: TType, topArgInfo: ArgReprInfo, ownerOpt, ownerRangeOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg, isWitnessArg) = +type FSharpParameter(cenv, paramTy: TType, topArgInfo: ArgReprInfo, ownerOpt, m: range, isParamArrayArg, isInArg, isOutArg, isOptionalArg, isWitnessArg) = inherit FSharpSymbol(cenv, - (fun () -> - let m = defaultArg ownerRangeOpt range0 - let id = match topArgInfo.Name with | Some id -> id | None -> mkSynId m "" - Item.ArgName(id, paramTy, ownerOpt)), + (fun () -> Item.ArgName(topArgInfo.Name, paramTy, ownerOpt, m)), (fun _ _ _ -> true)) - new (cenv, id, ty, container) = - let argInfo: ArgReprInfo = { Name = Some id; Attribs = [] } - FSharpParameter(cenv, ty, argInfo, container, None, false, false, false, false, false) + new (cenv, idOpt, ty, ownerOpt, m) = + let argInfo: ArgReprInfo = { Name = idOpt; Attribs = [] } + FSharpParameter(cenv, ty, argInfo, ownerOpt, m, false, false, false, false, false) - new (cenv, ty, argInfo: ArgReprInfo, ownerRangeOpt) = - FSharpParameter(cenv, ty, argInfo, None, ownerRangeOpt, false, false, false, false, false) + new (cenv, ty, argInfo: ArgReprInfo, m: range) = + FSharpParameter(cenv, ty, argInfo, None, m, false, false, false, false, false) member _.Name = match topArgInfo.Name with None -> None | Some v -> Some v.idText member _.cenv: SymbolEnv = cenv - member _.AdjustType ty = FSharpParameter(cenv, ty, topArgInfo, ownerOpt, ownerRangeOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg, isWitnessArg) + member _.AdjustType ty = FSharpParameter(cenv, ty, topArgInfo, ownerOpt, m, isParamArrayArg, isInArg, isOutArg, isOptionalArg, isWitnessArg) member _.Type: FSharpType = FSharpType(cenv, paramTy) member _.V = paramTy - member _.DeclarationLocation = - match topArgInfo.Name with - | Some v -> v.idRange - | None -> - - match ownerRangeOpt with - | Some m -> m - | None -> range0 + member _.DeclarationLocation = m member _.Owner = match ownerOpt with diff --git a/src/Compiler/Symbols/Symbols.fsi b/src/Compiler/Symbols/Symbols.fsi index 5a296058eb3..e8a88b65804 100644 --- a/src/Compiler/Symbols/Symbols.fsi +++ b/src/Compiler/Symbols/Symbols.fsi @@ -106,6 +106,8 @@ type FSharpSymbol = member DisplayNameCore: string /// Gets the display name for the symbol. Double backticks are added if the name is not a valid identifier. + /// + /// For FSharpParameter symbols without a name for the paramater, this returns "````" member DisplayName: string /// Get the implementation location for the symbol if it was declared in a signature that has an implementation diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index 65bdbede5e8..19174d2e782 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -358,7 +358,7 @@ let IsOperatorDisplayName (name: string) = //IsOperatorDisplayName "( )" // false //IsOperatorDisplayName "( +)" // false -let IsMangledOpName (name: string) = name.StartsWithOrdinal(opNamePrefix) +let IsPossibleOpName (name: string) = name.StartsWithOrdinal(opNamePrefix) /// Compiles a custom operator into a mangled operator name. /// For example, "!%" becomes "op_DereferencePercent". @@ -432,7 +432,7 @@ let CompileOpName op = /// For example, "op_DereferencePercent" becomes "!%". /// This function should only be used for mangled names of custom operators /// if a mangled name potentially represents a built-in operator, -/// use the 'DecompileOpName' function instead. +/// use the 'ConvertValLogicalNameToDisplayNameCore' function instead. let decompileCustomOpName = // Memoize this operation. Custom operators are typically used more than once // so this avoids repeating decompilation. @@ -510,11 +510,11 @@ let standardOpsDecompile = ops -let DecompileOpName opName = +let ConvertValLogicalNameToDisplayNameCore opName = match standardOpsDecompile.TryGetValue opName with | true, res -> res | false, _ -> - if IsMangledOpName opName then + if IsPossibleOpName opName then decompileCustomOpName opName else opName @@ -545,15 +545,15 @@ let NormalizeIdentifierBackticks (name: string) : string = AddBackticksToIdentifierIfNeeded s -let ConvertNameToDisplayName name = AddBackticksToIdentifierIfNeeded name +let ConvertLogicalNameToDisplayName name = AddBackticksToIdentifierIfNeeded name -let ConvertValNameToDisplayName isBaseVal name = +let ConvertValLogicalNameToDisplayName isBaseVal name = if isBaseVal && name = "base" then "base" - elif IsUnencodedOpName name || IsMangledOpName name || IsActivePatternName name then - let nm = DecompileOpName name + elif IsUnencodedOpName name || IsPossibleOpName name || IsActivePatternName name then + let nm = ConvertValLogicalNameToDisplayNameCore name // Check for no decompilation, e.g. op_Implicit, op_NotAMangledOpName, op_A-B - if IsMangledOpName name && (nm = name) then + if IsPossibleOpName name && (nm = name) then AddBackticksToIdentifierIfNeeded nm // Add parentheses for multiply-like symbols, with spacing to avoid confusion with comments elif nm <> "*" && (nm.StartsWithOrdinal "*" || nm.EndsWithOrdinal "*") then @@ -562,23 +562,23 @@ let ConvertValNameToDisplayName isBaseVal name = else "(" + nm + ")" else - ConvertNameToDisplayName name + ConvertLogicalNameToDisplayName name -let ConvertNameToDisplayLayout nonOpLayout name = +let ConvertLogicalNameToDisplayLayout nonOpLayout name = if DoesIdentifierNeedBackticks name then leftL (TaggedText.tagPunctuation "``") ^^ wordL (TaggedText.tagOperator name) ^^ rightL (TaggedText.tagPunctuation "``") else nonOpLayout name -let ConvertValNameToDisplayLayout isBaseVal nonOpLayout name = +let ConvertValLogicalNameToDisplayLayout isBaseVal nonOpLayout name = if isBaseVal && name = "base" then nonOpLayout "base" - elif IsUnencodedOpName name || IsMangledOpName name || IsActivePatternName name then - let nm = DecompileOpName name + elif IsUnencodedOpName name || IsPossibleOpName name || IsActivePatternName name then + let nm = ConvertValLogicalNameToDisplayNameCore name // Check for no decompilation, e.g. op_Implicit, op_NotAMangledOpName, op_A-B - if IsMangledOpName name && (nm = name) then - ConvertNameToDisplayLayout nonOpLayout name + if IsPossibleOpName name && (nm = name) then + ConvertLogicalNameToDisplayLayout nonOpLayout name elif nm.StartsWithOrdinal "*" || nm.EndsWithOrdinal "*" then wordL (TaggedText.tagPunctuation "(") ^^ wordL (TaggedText.tagOperator nm) ^^ wordL (TaggedText.tagPunctuation ")") @@ -586,9 +586,9 @@ let ConvertValNameToDisplayLayout isBaseVal nonOpLayout name = leftL (TaggedText.tagPunctuation "(") ^^ wordL (TaggedText.tagOperator nm) ^^ rightL (TaggedText.tagPunctuation ")") elif name = "get_Zero" then - ConvertNameToDisplayLayout nonOpLayout "Zero" + ConvertLogicalNameToDisplayLayout nonOpLayout "Zero" else - ConvertNameToDisplayLayout nonOpLayout name + ConvertLogicalNameToDisplayLayout nonOpLayout name let opNameCons = CompileOpName "::" @@ -656,12 +656,16 @@ let IsValidPrefixOperatorDefinitionName s = | '!' -> s <> "!=" | _ -> false -let IsPrefixOperator s = - if String.IsNullOrEmpty s then +let IsLogicalPrefixOperator logicalName = + if String.IsNullOrEmpty logicalName then false else - let s = DecompileOpName s - IsValidPrefixOperatorDefinitionName s + let displayName = ConvertValLogicalNameToDisplayNameCore logicalName + displayName <> logicalName && IsValidPrefixOperatorDefinitionName displayName + +let IsLogicalTernaryOperator logicalName = + let displayName = ConvertValLogicalNameToDisplayNameCore logicalName + displayName <> logicalName && (displayName = qmarkSet) let IsPunctuation s = if String.IsNullOrEmpty s then @@ -688,8 +692,6 @@ let IsPunctuation s = | ">]" -> true | _ -> false -let IsTernaryOperator s = (DecompileOpName s = qmarkSet) - /// EQUALS, INFIX_COMPARE_OP, LESS, GREATER let relational = [| "="; "!="; "<"; ">"; "$" |] @@ -712,8 +714,8 @@ let ignoredChars = [| '.'; '?' |] // The lexer defines the strings that lead to those tokens. //------ // This function recognises these "infix operator" names. -let IsMangledInfixOperator mangled = (* where mangled is assumed to be a compiled name *) - let s = DecompileOpName mangled +let IsLogicalInfixOpName logicalName = + let s = ConvertValLogicalNameToDisplayNameCore logicalName let skipIgnoredChars = s.TrimStart(ignoredChars) let afterSkipStartsWith prefix = @@ -723,7 +725,7 @@ let IsMangledInfixOperator mangled = (* where mangled is assumed to be a compile Array.exists afterSkipStartsWith prefixes // The following conditions follow the declExpr infix clauses. // The test corresponds to the lexer definition for the token. - s <> mangled + s <> logicalName && ((s = // COLON_EQUALS ":=") || @@ -744,6 +746,10 @@ let IsMangledInfixOperator mangled = (* where mangled is assumed to be a compile || // COLON_COLON (s = "::") + || (s = qmark) + || (s = qmarkSet) + || (s = parenGet) + || (s = parenSet) || // PLUS_MINUS_OP, MINUS afterSkipStarts plusMinus @@ -754,6 +760,11 @@ let IsMangledInfixOperator mangled = (* where mangled is assumed to be a compile // INFIX_STAR_STAR_OP (s = "**")) +let IsLogicalOpName (logicalName: string) = + IsLogicalPrefixOperator logicalName + || IsLogicalInfixOpName logicalName + || IsLogicalTernaryOperator logicalName + let (|Control|Equality|Relational|Indexer|FixedTypes|Other|) opName = match opName with | "&" @@ -965,7 +976,7 @@ let ActivePatternInfoOfValName nm (m: range) = [ (nm, m1) ] - let nm = DecompileOpName nm + let nm = ConvertValLogicalNameToDisplayNameCore nm if IsActivePatternName nm then // Skip the '|' at each end when recovering ranges @@ -999,7 +1010,7 @@ let tryDemangleStaticStringArg (mangledText: string) = exception InvalidMangledStaticArg of string /// Demangle the static parameters -let demangleProvidedTypeName (typeLogicalName: string) = +let DemangleProvidedTypeName (typeLogicalName: string) = if typeLogicalName.Contains "," then let pieces = splitAroundQuotation typeLogicalName ',' @@ -1016,7 +1027,7 @@ let demangleProvidedTypeName (typeLogicalName: string) = typeLogicalName, [||] /// Mangle the static parameters for a provided type or method -let mangleProvidedTypeName (typeLogicalName, nonDefaultArgs) = +let MangleProvidedTypeName (typeLogicalName, nonDefaultArgs) = let nonDefaultArgsText = nonDefaultArgs |> Array.map mangleStaticStringArg |> String.concat "," @@ -1026,7 +1037,7 @@ let mangleProvidedTypeName (typeLogicalName, nonDefaultArgs) = typeLogicalName + "," + nonDefaultArgsText /// Mangle the static parameters for a provided type or method -let computeMangledNameWithoutDefaultArgValues (nm, staticArgs, defaultArgValues) = +let ComputeMangledNameWithoutDefaultArgValues (nm, staticArgs, defaultArgValues) = let nonDefaultArgs = (staticArgs, defaultArgValues) ||> Array.zip @@ -1037,7 +1048,7 @@ let computeMangledNameWithoutDefaultArgValues (nm, staticArgs, defaultArgValues) | Some v when v = actualArgValue -> None | _ -> Some(defaultArgName, actualArgValue)) - mangleProvidedTypeName (nm, nonDefaultArgs) + MangleProvidedTypeName(nm, nonDefaultArgs) let outArgCompilerGeneratedName = "outArg" diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index ea12bae0325..01f2918712f 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -28,7 +28,12 @@ val internal opNamePrefix: string = "op_" /// .. val IsOperatorDisplayName: name: string -> bool -/// Is the name a valid F# identifier +/// Is the name a valid F# identifier, primarily used internally in PrettyNaming.fs for determining if an +/// identifier needs backticks. +/// +/// In general do not use this routine. It is only used in one quick fix, for determining if it is valid +/// to add "_" in front of an identifier. +/// /// A --> true /// A' --> true /// _A --> true @@ -36,6 +41,10 @@ val IsOperatorDisplayName: name: string -> bool /// |A|B| --> false /// op_Addition --> true /// + --> false +/// let --> false +/// base --> false +/// +/// TBD: needs unit testing val IsIdentifierName: name: string -> bool /// Determines if the specified name is a valid name for an active pattern. @@ -45,16 +54,10 @@ val IsIdentifierName: name: string -> bool /// | --> false /// || --> false /// op_Addition --> false +/// +/// TBD: needs unit testing val IsActivePatternName: name: string -> bool -/// Returns `true` if given string requires double backticks to be a valid identifier, e.g. -/// + true, e.g. ``+`` (this is not op_Addition) -/// |>> true, e.g. ``|>>`` (this is not op_Addition) -/// A-B true, e.g. ``A-B`` -/// AB false, e.g. AB -/// |A|_| false // this is an active pattern name, needs parens not backticks -val DoesIdentifierNeedBackticks: name: string -> bool - /// Adds double backticks if necessary to make a valid identifier, e.g. /// op_Addition --> op_Addition /// + --> ``+`` (this is not op_Addition) @@ -62,40 +65,63 @@ val DoesIdentifierNeedBackticks: name: string -> bool /// A-B --> ``A-B`` /// AB --> AB /// |A|_| --> |A|_| this is an active pattern name, needs parens not backticks -val AddBackticksToIdentifierIfNeeded: name: string -> string - /// Removes double backticks if not necessary to make a valid identifier, e.g. /// ``A`` --> A /// ``A-B`` --> ``A-B`` val NormalizeIdentifierBackticks: name: string -> string -/// Is the name a mangled operator name (approximate) -/// op_Addition - yes -/// op_Quack - yes -val IsMangledOpName: name: string -> bool - -/// Compiles an operator into a mangled operator name. For example, +/// Is the name a logical operator name, including unary, binary and ternary operators +/// op_UnaryPlus - yes +/// op_Addition - yes +/// op_Range - yes (?) +/// op_RangeStep - yes (?) +/// op_DynamicAssignment - yes +/// op_Quack - no +/// + - no +/// ABC - no +/// ABC DEF - no +/// base - no +/// |A|_| - no +val IsLogicalOpName: logicalName: string -> bool + +/// Converts the core of an operator name into a logical name. For example, /// + --> op_Addition /// !% --> op_DereferencePercent /// Only used on actual operator names -val CompileOpName: string -> string +val CompileOpName: op: string -> string + +/// Take a core display name (e.g. "List" or "Strange module name") and convert it to display text +/// by adding backticks if necessary. +/// Foo --> Foo +/// + --> ``+`` +/// A-B --> ``A-B`` +val internal ConvertLogicalNameToDisplayName: name: string -> string -/// Decompiles a potentially-mangled operator name back into a display name. For example: +/// Converts the logical name for and operator back into the core of a display name. For example: /// Foo --> Foo /// + --> + /// op_Addition --> + /// op_DereferencePercent --> !% /// A-B --> A-B /// |A|_| --> |A|_| +/// base --> base regardless of IsBaseVal /// Used on names of all kinds -val DecompileOpName: string -> string - -/// Take a core display name (e.g. "List" or "Strange module name") and convert it to display text -/// by adding backticks if necessary. -/// Foo --> Foo -/// + --> ``+`` -/// A-B --> ``A-B`` -val internal ConvertNameToDisplayName: name: string -> string +/// +/// TODO: We should assess uses of this function. +/// +/// In any cases it is used it probably indicates that text is being +/// generated which: +/// 1. does not contain double-backticks for non-identifiers +/// 2. does not put parentheses arounf operators or active pattern names +/// +/// If the text is immediately in quotes, this is generally ok, e.g. +/// +/// error FS0038: '+' is bound twice in this pattern +/// error FS0038: '|A|_|' is bound twice in this pattern +/// error FS0038: 'a a' is bound twice in this pattern +/// +/// If not, the it is likely this should be replaced by ConvertValLogicalNameToDisplayName. +val ConvertValLogicalNameToDisplayNameCore: opName: string -> string /// Take a core display name for a value (e.g. op_Addition or PropertyName) and convert it to display text /// Foo --> Foo @@ -105,16 +131,20 @@ val internal ConvertNameToDisplayName: name: string -> string /// op_DereferencePercent --> (!%) /// A-B --> ``A-B`` /// |A|_| --> (|A|_|) +/// let --> ``let`` +/// type --> ``type`` +/// params --> ``params`` /// base --> base /// or --> or /// mod --> mod -val internal ConvertValNameToDisplayName: isBaseVal: bool -> name: string -> string +val internal ConvertValLogicalNameToDisplayName: isBaseVal: bool -> name: string -> string -/// Like ConvertNameToDisplayName but produces a tagged layout -val internal ConvertNameToDisplayLayout: nonOpLayout: (string -> Layout) -> name: string -> Layout +/// Like ConvertLogicalNameToDisplayName but produces a tagged layout +val internal ConvertLogicalNameToDisplayLayout: nonOpLayout: (string -> Layout) -> name: string -> Layout -/// Like ConvertValNameToDisplayName but produces a tagged layout -val internal ConvertValNameToDisplayLayout: isBaseVal: bool -> nonOpLayout: (string -> Layout) -> name: string -> Layout +/// Like ConvertValLogicalNameToDisplayName but produces a tagged layout +val internal ConvertValLogicalNameToDisplayLayout: + isBaseVal: bool -> nonOpLayout: (string -> Layout) -> name: string -> Layout val internal opNameCons: string @@ -143,13 +173,13 @@ val internal IsValidPrefixOperatorUse: s: string -> bool val internal IsValidPrefixOperatorDefinitionName: s: string -> bool -val IsPrefixOperator: s: string -> bool +val IsLogicalPrefixOperator: logicalName: string -> bool -val IsPunctuation: s: string -> bool +val IsLogicalInfixOpName: logicalName: string -> bool -val IsTernaryOperator: s: string -> bool +val IsLogicalTernaryOperator: logicalName: string -> bool -val IsMangledInfixOperator: string -> bool +val IsPunctuation: s: string -> bool val internal (|Control|Equality|Relational|Indexer|FixedTypes|Other|): opName: string -> Choice @@ -203,13 +233,13 @@ val internal ActivePatternInfoOfValName: nm: string -> m: range -> ActivePattern exception internal InvalidMangledStaticArg of string -val internal demangleProvidedTypeName: typeLogicalName: string -> string * (string * string)[] +val internal DemangleProvidedTypeName: typeLogicalName: string -> string * (string * string)[] /// Mangle the static parameters for a provided type or method -val internal mangleProvidedTypeName: typeLogicalName: string * nonDefaultArgs: (string * string)[] -> string +val internal MangleProvidedTypeName: typeLogicalName: string * nonDefaultArgs: (string * string)[] -> string /// Mangle the static parameters for a provided type or method -val internal computeMangledNameWithoutDefaultArgValues: +val internal ComputeMangledNameWithoutDefaultArgValues: nm: string * staticArgs: 'a[] * defaultArgValues: (string * string option)[] -> string val internal outArgCompilerGeneratedName: string diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index dd29a44d36d..c0b48c22584 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -1186,7 +1186,7 @@ let ComputeMangledNameForApplyStaticParameters(nm, staticArgs, staticParams: Tai staticParams.PApply((fun ps -> ps |> Array.map (fun sp -> sp.Name, (if sp.IsOptional then Some (string sp.RawDefaultValue) else None ))), range=m) let defaultArgValues = defaultArgValues.PUntaint(id, m) - PrettyNaming.computeMangledNameWithoutDefaultArgValues(nm, staticArgs, defaultArgValues) + PrettyNaming.ComputeMangledNameWithoutDefaultArgValues(nm, staticArgs, defaultArgValues) /// Apply the given provided method to the given static arguments (the arguments are assumed to have been sorted into application order) let TryApplyProvidedMethod(methBeforeArgs: Tainted, staticArgs: obj[], m: range) = @@ -1243,7 +1243,7 @@ let TryLinkProvidedType(resolver: Tainted, moduleOrNamespace: str // Demangle the static parameters let typeName, argNamesAndValues = try - PrettyNaming.demangleProvidedTypeName typeLogicalName + PrettyNaming.DemangleProvidedTypeName typeLogicalName with PrettyNaming.InvalidMangledStaticArg piece -> error(Error(FSComp.SR.etProvidedTypeReferenceInvalidText piece, range0)) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 53c88172dd1..80e62652f8b 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -686,7 +686,7 @@ type Entity = #if !NO_TYPEPROVIDERS member x.IsStaticInstantiationTycon = x.IsProvidedErasedTycon && - let _nm, args = demangleProvidedTypeName x.LogicalName + let _nm, args = DemangleProvidedTypeName x.LogicalName args.Length > 0 #endif @@ -697,7 +697,7 @@ type Entity = if x.IsModuleOrNamespace then x.DemangledModuleOrNamespaceName #if !NO_TYPEPROVIDERS elif x.IsProvidedErasedTycon then - let nm, args = demangleProvidedTypeName nm + let nm, args = DemangleProvidedTypeName nm if withStaticParameters && args.Length > 0 then nm + "<" + String.concat "," (Array.map snd args) + ">" else @@ -710,7 +710,7 @@ type Entity = | tps -> let nm = DemangleGenericTypeName nm let isArray = nm.StartsWithOrdinal("[") && nm.EndsWithOrdinal("]") - let nm = if coreName || isArray then nm else ConvertNameToDisplayName nm + let nm = if coreName || isArray then nm else ConvertLogicalNameToDisplayName nm if withUnderscoreTypars then let typarNames = tps |> List.map (fun _ -> "_") nm + "<" + String.concat "," typarNames + ">" @@ -1680,18 +1680,18 @@ type UnionCase = /// /// Backticks and parens are not added for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become [] and :: respectively. - member uc.DisplayNameCore = uc.LogicalName |> DecompileOpName + /// Note logical names op_Nil and op_ColonColon become [] and :: respectively. + member uc.DisplayNameCore = uc.LogicalName |> ConvertValLogicalNameToDisplayNameCore /// Get the display name of the union case /// /// Backticks and parens are added for non-identifiers. /// - /// Note logical names op_Nil and op_ConsCons become ([]) and (::) respectively. - member uc.DisplayName = uc.LogicalName |> ConvertValNameToDisplayName false + /// Note logical names op_Nil and op_ColonColon become ([]) and (::) respectively. + member uc.DisplayName = uc.LogicalName |> ConvertValLogicalNameToDisplayName false /// Get the name of the case in generated IL code. - /// Note logical names `op_Nil` and `op_ConsCons` become `Empty` and `Cons` respectively. + /// Note logical names `op_Nil` and `op_ColonColon` become `Empty` and `Cons` respectively. /// This is because this is how ILX union code gen expects to see them. member uc.CompiledName = let idText = uc.Id.idText @@ -1803,7 +1803,7 @@ type RecdField = member v.DisplayNameCore = v.LogicalName /// Name of the field - member v.DisplayName = v.DisplayNameCore |> ConvertNameToDisplayName + member v.DisplayName = v.DisplayNameCore |> ConvertLogicalNameToDisplayName /// Indicates a compiler generated field, not visible to Intellisense or name resolution member v.IsCompilerGenerated = v.rfield_secret @@ -2977,7 +2977,7 @@ type Val = /// /// Note: here "Core" means "without added backticks or parens" member x.DisplayNameCore = - x.DisplayNameCoreMangled |> DecompileOpName + x.DisplayNameCoreMangled |> ConvertValLogicalNameToDisplayNameCore /// The full text for the value to show in error messages and to use in code. /// This includes backticks, parens etc. @@ -2990,7 +2990,7 @@ type Val = /// - If this is a base value --> base /// - If this is a value named ``base`` --> ``base`` member x.DisplayName = - ConvertValNameToDisplayName x.IsBaseVal x.DisplayNameCoreMangled + ConvertValLogicalNameToDisplayName x.IsBaseVal x.DisplayNameCoreMangled member x.SetValRec b = x.val_flags <- x.val_flags.WithRecursiveValInfo b @@ -4014,7 +4014,7 @@ type RecdFieldRef = member x.FieldName = let (RecdFieldRef(_, id)) = x in id /// Get the name of the field, with backticks added for non-identifier names - member x.DisplayName = x.FieldName |> ConvertNameToDisplayName + member x.DisplayName = x.FieldName |> ConvertLogicalNameToDisplayName /// Get the Entity for the type containing this union case member x.Tycon = x.TyconRef.Deref @@ -4188,6 +4188,10 @@ type AnonRecdTypeInfo = member x.IsLinked = (match x.SortedIds with null -> true | _ -> false) + member x.DisplayNameCoreByIdx idx = x.SortedNames[idx] + + member x.DisplayNameByIdx idx = x.SortedNames[idx] |> ConvertLogicalNameToDisplayName + [] type TupInfo = /// Some constant, e.g. true or false for tupInfo diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index d201a64af04..01103d5987a 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1136,7 +1136,7 @@ type UnionCase = override ToString: unit -> string /// Get the name of the case in generated IL code. - /// Note logical names `op_Nil` type `op_ConsCons` become `Empty` type `Cons` respectively. + /// Note logical names `op_Nil` type `op_ColonColon` become `Empty` type `Cons` respectively. /// This is because this is how ILX union code gen expects to see them. member CompiledName: string @@ -1148,16 +1148,16 @@ type UnionCase = /// Get the display name of the union case /// - /// Backticks type parens are added for non-identifiers. + /// Backticks are added for non-identifiers. /// - /// Note logical names op_Nil type op_ConsCons become ([]) type (::) respectively. + /// Note logical names op_Nil and op_ColonColon become ([]) and (::) respectively. member DisplayName: string /// Get the core of the display name of the union case /// - /// Backticks type parens are not added for non-identifiers. + /// Backticks and parens are not added for non-identifiers. /// - /// Note logical names op_Nil type op_ConsCons become [] type :: respectively. + /// Note logical names op_Nil type op_ColonColon become [] and :: respectively. member DisplayNameCore: string /// Indicates if the union case has no fields @@ -1940,7 +1940,12 @@ type Val = member DisplayNameCore: string /// The display name of the value or method but without operator names decompiled type without backticks etc. - /// This is very close to LogicalName except that properties have get_ removed. + /// + /// This is very close to LogicalName except that properties have get_ removed and + /// interface implementation methods report the name of the implemented method. + /// + /// Note: avoid using this, we would like to remove it. All uses should be code-reviewed and + /// gradually eliminated in favour of DisplayName, DisplayNameCore or LogicalName. /// /// Note: here "Core" means "without added backticks or parens" /// Note: here "Mangled" means "op_Addition" @@ -2653,10 +2658,39 @@ type ValRef = /// Dereference the ValRef to a Val. member Deref: Val + /// The full text for the value to show in error messages type to use in code. + /// This includes backticks, parens etc. + /// + /// - If this is a property --> Foo + /// - If this is an implementation of an abstract slot then this is the name of the method implemented by the abstract slot + /// - If this is an active pattern --> (|A|_|) + /// - If this is an operator --> (+) + /// - If this is an identifier needing backticks --> ``A-B`` + /// - If this is a base value --> base + /// - If this is a value named ``base`` --> ``base`` member DisplayName: string + /// The display name of the value or method with operator names decompiled but without backticks etc. + /// + /// Note: here "Core" means "without added backticks or parens" member DisplayNameCore: string + /// The display name of the value or method but without operator names decompiled type without backticks etc. + /// + /// This is very close to LogicalName except that properties have get_ removed and + /// interface implementation methods report the name of the implemented method. + /// + /// Note: avoid using this, we would like to remove it. All uses should be code-reviewed and + /// gradually eliminated in favour of DisplayName, DisplayNameCore or LogicalName. + /// + /// Note: here "Core" means "without added backticks or parens" + /// Note: here "Mangled" means "op_Addition" + /// + /// - If this is a property --> Foo + /// - If this is an implementation of an abstract slot then this is the name of the method implemented by the abstract slot + /// - If this is an active pattern --> |A|_| + /// - If this is an operator --> op_Addition + /// - If this is an identifier needing backticks --> A-B member DisplayNameCoreMangled: string /// Get the type of the value including any generic type parameters @@ -2666,7 +2700,7 @@ type ValRef = member Id: Syntax.Ident - /// Gets the dispatch slots implemented by this method + /// Gets the dispatch slots implemented by this method, either 0 or 1 member ImplementedSlotSigs: SlotSig list /// Get the inline declaration on a parameter or other non-function-declaration value, used for optimization @@ -2979,6 +3013,12 @@ type AnonRecdTypeInfo = member IsLinked: bool + /// Get the display name for one of the fields of the anonymous record, by index + member DisplayNameByIdx: idx: int -> string + + /// Get the core of the display name for one of the fields of the anonymous record, by index + member DisplayNameCoreByIdx: idx: int -> string + [] type TupInfo = diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 8229107c74a..f0ad0c6e7e6 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3967,7 +3967,7 @@ module DebugPrint = leftL (tagText "<") ^^ intL tpNames.Length ^^ sepL (tagText ">[") ^^ commaListL (List.map intL ns) ^^ rightL (tagText "]") let valL (v: Val) = - let vsL = wordL (tagText (DecompileOpName v.LogicalName)) |> stampL v.Stamp + let vsL = wordL (tagText (ConvertValLogicalNameToDisplayNameCore v.LogicalName)) |> stampL v.Stamp let vsL = vsL -- layoutAttribs v.Attribs vsL @@ -9015,7 +9015,7 @@ let TryGetActivePatternInfo (vref: ValRef) = ActivePatternInfoOfValName vref.DisplayNameCoreMangled vref.Range type ActivePatternElemRef with - member x.Name = + member x.LogicalName = let (APElemRef(_, vref, n, _)) = x match TryGetActivePatternInfo vref with | None -> error(InternalError("not an active pattern name", vref.Range)) @@ -9024,6 +9024,10 @@ type ActivePatternElemRef with if n < 0 || n >= List.length nms then error(InternalError("name_of_apref: index out of range for active pattern reference", vref.Range)) List.item n nms + member x.DisplayNameCore = x.LogicalName + + member x.DisplayName = x.LogicalName |> ConvertLogicalNameToDisplayName + let mkChoiceTyconRef (g: TcGlobals) m n = match n with | 0 | 1 -> error(InternalError("mkChoiceTyconRef", m)) @@ -9045,7 +9049,10 @@ let mkChoiceCaseRef g m n i = mkUnionCaseRef (mkChoiceTyconRef g m n) ("Choice"+string (i+1)+"Of"+string n) type ActivePatternInfo with - member x.Names = x.ActiveTags + + member x.DisplayNameCoreByIdx idx = x.ActiveTags[idx] + + member x.DisplayNameByIdx idx = x.ActiveTags[idx] |> ConvertLogicalNameToDisplayName member apinfo.ResultType g m retTys isStruct = let choicety = mkChoiceTy g m retTys diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 5d27bff7fbc..b3e4c630476 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2395,7 +2395,11 @@ val mkFastForLoop: TcGlobals -> DebugPointAtFor * DebugPointAtInOrTo * range * V type ActivePatternElemRef with - member Name: string + member LogicalName: string + + member DisplayNameCore: string + + member DisplayName: string val TryGetActivePatternInfo: ValRef -> PrettyNaming.ActivePatternInfo option @@ -2403,10 +2407,16 @@ val mkChoiceCaseRef: g: TcGlobals -> m: range -> n: int -> i: int -> UnionCaseRe type PrettyNaming.ActivePatternInfo with - member Names: string list + /// Get the core of the display name for one of the cases of the active pattern, by index + member DisplayNameCoreByIdx: idx: int -> string + + /// Get the display name for one of the cases of the active pattern, by index + member DisplayNameByIdx: idx: int -> string + /// Get the result type for the active pattern member ResultType: g: TcGlobals -> range -> TType list -> bool -> TType + /// Get the overall type for a function that implements the active pattern member OverallType: g: TcGlobals -> m: range -> argTy: TType -> retTys: TType list -> isStruct: bool -> TType val doesActivePatternHaveFreeTypars: TcGlobals -> ValRef -> bool diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/CompletionTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/CompletionTests.fs index 74062d0b028..8bc7fa581a1 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/CompletionTests.fs @@ -16,7 +16,7 @@ type CompletionTests() = let lines = [ "let x = 1" "x." ] let! completions = script.GetCompletionItems(String.Join("\n", lines), 2, 2) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "CompareTo") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "CompareTo") Assert.Equal(1, matchingCompletions.Length) } |> Async.StartAsTask :> Task @@ -26,7 +26,7 @@ type CompletionTests() = use script = new FSharpScript() script.Eval("let x = 1") |> ignoreValue let! completions = script.GetCompletionItems("x.", 1, 2) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "CompareTo") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "CompareTo") Assert.Equal(1, matchingCompletions.Length) } |> Async.StartAsTask :> Task @@ -37,7 +37,7 @@ type CompletionTests() = script.Eval("open System") |> ignoreValue script.Eval("let t = TimeSpan.FromHours(1.0)") |> ignoreValue let! completions = script.GetCompletionItems("t.", 1, 2) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "TotalHours") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "TotalHours") Assert.Equal(1, matchingCompletions.Length) } |> Async.StartAsTask :> Task @@ -46,7 +46,7 @@ type CompletionTests() = async { use script = new FSharpScript() let! completions = script.GetCompletionItems("System.String.", 1, 14) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Join") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "Join") Assert.True(matchingCompletions.Length >= 1) } |> Async.StartAsTask :> Task @@ -55,7 +55,7 @@ type CompletionTests() = async { use script = new FSharpScript() let! completions = script.GetCompletionItems("System.", 1, 7) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "String") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "String") Assert.True(matchingCompletions.Length >= 1) } |> Async.StartAsTask :> Task @@ -64,7 +64,7 @@ type CompletionTests() = async { use script = new FSharpScript() let! completions = script.GetCompletionItems("System.", 1, 7) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Collections") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "Collections") Assert.Equal(1, matchingCompletions.Length) } |> Async.StartAsTask :> Task @@ -76,7 +76,7 @@ type CompletionTests() = "let list = new System.Collections.Generic.List()" "list." ] let! completions = script.GetCompletionItems(String.Join("\n", lines), 3, 5) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Select") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "Select") Assert.Equal(1, matchingCompletions.Length) } |> Async.StartAsTask :> Task @@ -91,30 +91,30 @@ type CompletionTests() = " static member ``|A|_|``(a:C, b:C) = C()" "C." ] let completions = script.GetCompletionItems(String.Join("\n", lines), 7, 2) |> Async.RunSynchronously - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Long Name") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "Long Name") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``Long Name``", matchingCompletions.[0].NameInCode) // Things with names like op_Addition are suppressed from completion by FCS - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "+") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "+") Assert.Equal(0, matchingCompletions.Length) // Strange names like ``+`` and ``-`` are just normal text and not operators // and are present in competion lists - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "-") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "-") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``-``", matchingCompletions.[0].NameInCode) // ``base`` is a strange name but is still present. In this case the inserted // text NameInCode is ``base`` because the thing is not a base value mapping to // the base keyword - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "base") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "base") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``base``", matchingCompletions.[0].NameInCode) // ``|A|_|`` is a strange name like the name of an active pattern but is still present. // In this case the inserted is (|A|_|) - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "|A|_|") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "|A|_|") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("(|A|_|)", matchingCompletions.[0].NameInCode) @@ -130,30 +130,30 @@ type CompletionTests() = " let (|A|_|)(a:int, b:int) = None" "M." ] let completions = script.GetCompletionItems(String.Join("\n", lines), 7, 2) |> Async.RunSynchronously - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Long Name") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "Long Name") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``Long Name``", matchingCompletions.[0].NameInCode) // Things with names like op_Addition are suppressed from completion by FCS - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "+") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "+") Assert.Equal(0, matchingCompletions.Length) // Strange names like ``+`` and ``-`` are just normal text and not operators // and are present in competion lists - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "-") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "-") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``-``", matchingCompletions.[0].NameInCode) // ``base`` is a strange name but is still present. In this case the inserted // text NameInCode is ``base`` because the thing is not a base value mapping to // the base keyword - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "base") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "base") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("``base``", matchingCompletions.[0].NameInCode) // (|A|_|) is an active pattern and the completion item is the // active pattern case A. In this case the inserted is A - let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "A") + let matchingCompletions = completions |> Array.filter (fun d -> d.NameInList = "A") Assert.Equal(1, matchingCompletions.Length) Assert.Equal("A", matchingCompletions.[0].NameInCode) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index a6b0635a936..2fad3357478 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2596,9 +2596,11 @@ FSharp.Compiler.EditorServices.DeclarationListItem: Microsoft.FSharp.Core.FSharp FSharp.Compiler.EditorServices.DeclarationListItem: System.String FullName FSharp.Compiler.EditorServices.DeclarationListItem: System.String Name FSharp.Compiler.EditorServices.DeclarationListItem: System.String NameInCode +FSharp.Compiler.EditorServices.DeclarationListItem: System.String NameInList FSharp.Compiler.EditorServices.DeclarationListItem: System.String get_FullName() FSharp.Compiler.EditorServices.DeclarationListItem: System.String get_Name() FSharp.Compiler.EditorServices.DeclarationListItem: System.String get_NameInCode() +FSharp.Compiler.EditorServices.DeclarationListItem: System.String get_NameInList() FSharp.Compiler.EditorServices.EntityCache FSharp.Compiler.EditorServices.EntityCache: T Locking[T](Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.EditorServices.IAssemblyContentCache,T]) FSharp.Compiler.EditorServices.EntityCache: Void .ctor() @@ -3154,9 +3156,9 @@ FSharp.Compiler.EditorServices.NavigableContainer: Int32 CompareTo(System.Object FSharp.Compiler.EditorServices.NavigableContainer: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.EditorServices.NavigableContainer: Int32 GetHashCode() FSharp.Compiler.EditorServices.NavigableContainer: Int32 GetHashCode(System.Collections.IEqualityComparer) -FSharp.Compiler.EditorServices.NavigableContainer: System.String Name +FSharp.Compiler.EditorServices.NavigableContainer: System.String LogicalName FSharp.Compiler.EditorServices.NavigableContainer: System.String ToString() -FSharp.Compiler.EditorServices.NavigableContainer: System.String get_Name() +FSharp.Compiler.EditorServices.NavigableContainer: System.String get_LogicalName() FSharp.Compiler.EditorServices.NavigableContainer: Void .ctor(FSharp.Compiler.EditorServices.NavigableContainerType, System.String) FSharp.Compiler.EditorServices.NavigableContainerType FSharp.Compiler.EditorServices.NavigableContainerType+Tags: Int32 Exception @@ -3210,9 +3212,9 @@ FSharp.Compiler.EditorServices.NavigableItem: FSharp.Compiler.Text.Range Range FSharp.Compiler.EditorServices.NavigableItem: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.EditorServices.NavigableItem: Int32 GetHashCode() FSharp.Compiler.EditorServices.NavigableItem: Int32 GetHashCode(System.Collections.IEqualityComparer) -FSharp.Compiler.EditorServices.NavigableItem: System.String Name +FSharp.Compiler.EditorServices.NavigableItem: System.String LogicalName FSharp.Compiler.EditorServices.NavigableItem: System.String ToString() -FSharp.Compiler.EditorServices.NavigableItem: System.String get_Name() +FSharp.Compiler.EditorServices.NavigableItem: System.String get_LogicalName() FSharp.Compiler.EditorServices.NavigableItem: Void .ctor(System.String, FSharp.Compiler.Text.Range, Boolean, FSharp.Compiler.EditorServices.NavigableItemKind, FSharp.Compiler.EditorServices.NavigableContainer) FSharp.Compiler.EditorServices.NavigableItemKind FSharp.Compiler.EditorServices.NavigableItemKind+Tags: Int32 Constructor @@ -3356,9 +3358,9 @@ FSharp.Compiler.EditorServices.NavigationItem: FSharp.Compiler.Text.Range get_Bo FSharp.Compiler.EditorServices.NavigationItem: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.EditorServices.NavigationItem: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] Access FSharp.Compiler.EditorServices.NavigationItem: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_Access() -FSharp.Compiler.EditorServices.NavigationItem: System.String Name +FSharp.Compiler.EditorServices.NavigationItem: System.String LogicalName FSharp.Compiler.EditorServices.NavigationItem: System.String UniqueName -FSharp.Compiler.EditorServices.NavigationItem: System.String get_Name() +FSharp.Compiler.EditorServices.NavigationItem: System.String get_LogicalName() FSharp.Compiler.EditorServices.NavigationItem: System.String get_UniqueName() FSharp.Compiler.EditorServices.NavigationItemKind FSharp.Compiler.EditorServices.NavigationItemKind+Tags: Int32 Exception @@ -5684,24 +5686,22 @@ FSharp.Compiler.Syntax.ParserDetail: Int32 Tag FSharp.Compiler.Syntax.ParserDetail: Int32 get_Tag() FSharp.Compiler.Syntax.ParserDetail: System.String ToString() FSharp.Compiler.Syntax.PrettyNaming -FSharp.Compiler.Syntax.PrettyNaming: Boolean DoesIdentifierNeedBackticks(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsActivePatternName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsCompilerGeneratedName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsIdentifierFirstCharacter(Char) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsIdentifierName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsIdentifierPartCharacter(Char) +FSharp.Compiler.Syntax.PrettyNaming: Boolean IsLogicalInfixOpName(System.String) +FSharp.Compiler.Syntax.PrettyNaming: Boolean IsLogicalOpName(System.String) +FSharp.Compiler.Syntax.PrettyNaming: Boolean IsLogicalPrefixOperator(System.String) +FSharp.Compiler.Syntax.PrettyNaming: Boolean IsLogicalTernaryOperator(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsLongIdentifierPartCharacter(Char) -FSharp.Compiler.Syntax.PrettyNaming: Boolean IsMangledInfixOperator(System.String) -FSharp.Compiler.Syntax.PrettyNaming: Boolean IsMangledOpName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsOperatorDisplayName(System.String) -FSharp.Compiler.Syntax.PrettyNaming: Boolean IsPrefixOperator(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsPunctuation(System.String) -FSharp.Compiler.Syntax.PrettyNaming: Boolean IsTernaryOperator(System.String) FSharp.Compiler.Syntax.PrettyNaming: Microsoft.FSharp.Collections.FSharpList`1[System.String] GetLongNameFromString(System.String) FSharp.Compiler.Syntax.PrettyNaming: Microsoft.FSharp.Core.FSharpOption`1[System.String] TryChopPropertyName(System.String) -FSharp.Compiler.Syntax.PrettyNaming: System.String AddBackticksToIdentifierIfNeeded(System.String) FSharp.Compiler.Syntax.PrettyNaming: System.String CompileOpName(System.String) -FSharp.Compiler.Syntax.PrettyNaming: System.String DecompileOpName(System.String) +FSharp.Compiler.Syntax.PrettyNaming: System.String ConvertValLogicalNameToDisplayNameCore(System.String) FSharp.Compiler.Syntax.PrettyNaming: System.String FormatAndOtherOverloadsString(Int32) FSharp.Compiler.Syntax.PrettyNaming: System.String FsiDynamicModulePrefix FSharp.Compiler.Syntax.PrettyNaming: System.String NormalizeIdentifierBackticks(System.String) @@ -9829,12 +9829,10 @@ FSharp.Compiler.Text.TextTag: Int32 Tag FSharp.Compiler.Text.TextTag: Int32 get_Tag() FSharp.Compiler.Text.TextTag: System.String ToString() FSharp.Compiler.Tokenization.FSharpKeywords -FSharp.Compiler.Tokenization.FSharpKeywords: Boolean DoesIdentifierNeedBackticks(System.String) FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.String] KeywordNames FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_KeywordNames() FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] KeywordsWithDescription FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_KeywordsWithDescription() -FSharp.Compiler.Tokenization.FSharpKeywords: System.String AddBackticksToIdentifierIfNeeded(System.String) FSharp.Compiler.Tokenization.FSharpKeywords: System.String NormalizeIdentifierBackticks(System.String) FSharp.Compiler.Tokenization.FSharpLexer FSharp.Compiler.Tokenization.FSharpLexer: Void Tokenize(FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Tokenization.FSharpToken,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Tokenization.FSharpLexerFlags], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpMap`2[System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) diff --git a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs index 5ccac1bb871..3d6651df05d 100644 --- a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs @@ -13,30 +13,30 @@ type ManglingNamesOfProvidedTypesWithSingleParameter() = [] member this.MangleWithNonDefaultValue() = let mangled = - PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "abc" |]) + PrettyNaming.ComputeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "abc" |]) Assert.shouldBe "MyNamespace.Test,Foo=\"xyz\"" mangled [] member this.MangleWithDefaultValue() = let mangled = - PrettyNaming.computeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "xyz" |]) + PrettyNaming.ComputeMangledNameWithoutDefaultArgValues("MyNamespace.Test", [| "xyz" |], [| "Foo", Some "xyz" |]) Assert.shouldBe "MyNamespace.Test" mangled [] member this.DemangleNonDefaultValue() = - let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test,Foo=\"xyz\"" + let name, parameters = PrettyNaming.DemangleProvidedTypeName "MyNamespace.Test,Foo=\"xyz\"" Assert.shouldBe "MyNamespace.Test" name Assert.shouldBeEquivalentTo [| "Foo", "xyz" |] parameters [] member this.DemangleDefaultValue() = - let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test," + let name, parameters = PrettyNaming.DemangleProvidedTypeName "MyNamespace.Test," Assert.shouldBe "MyNamespace.Test" name Assert.shouldBeEquivalentTo [||] parameters [] member this.DemangleNewDefaultValue() = - let name, parameters = PrettyNaming.demangleProvidedTypeName "MyNamespace.Test" + let name, parameters = PrettyNaming.DemangleProvidedTypeName "MyNamespace.Test" Assert.shouldBe "MyNamespace.Test" name Assert.shouldBeEquivalentTo [||] parameters @@ -46,7 +46,7 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = [] member this.MangleWithNonDefaultValue() = let mangled = - PrettyNaming.computeMangledNameWithoutDefaultArgValues + PrettyNaming.ComputeMangledNameWithoutDefaultArgValues ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "foo" "Foo2", Some "foo2" |]) @@ -55,7 +55,7 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = [] member this.MangleWithDefaultValue() = let mangled = - PrettyNaming.computeMangledNameWithoutDefaultArgValues + PrettyNaming.ComputeMangledNameWithoutDefaultArgValues ("MyNamespace.Test", [| "xyz"; "abc" |], [| "Foo", Some "xyz" "Foo2", Some "abc" |]) @@ -63,7 +63,7 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = [] member this.DemangleMultiParameter() = - let name, parameters = PrettyNaming.demangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" + let name, parameters = PrettyNaming.DemangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" Assert.shouldBe "TestType" name Assert.shouldBe([| "Foo", "xyz" "Foo2", "abc" |], parameters) diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index 3d3705bf2c8..abb8dcbe10a 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -89,7 +89,7 @@ let ``Intro test`` () = // Get declarations (autocomplete) for a location let partialName = { QualifyingIdents = []; PartialIdent = "msg"; EndColumn = 22; LastDotPos = None } let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 7, inputLines[6], partialName, (fun _ -> [])) - CollectionAssert.AreEquivalent(stringMethods,[ for item in decls.Items -> item.Name ]) + CollectionAssert.AreEquivalent(stringMethods,[ for item in decls.Items -> item.NameInList ]) // Get overloads of the String.Concat method let methods = typeCheckResults.GetMethods(5, 27, inputLines[4], Some ["String"; "Concat"]) @@ -280,7 +280,7 @@ let ``Expression typing test`` () = // for col in 42..43 do let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 2, inputLines[1], PartialLongName.Empty(col), (fun _ -> [])) - let autoCompleteSet = set [ for item in decls.Items -> item.Name ] + let autoCompleteSet = set [ for item in decls.Items -> item.NameInList ] autoCompleteSet |> shouldEqual (set stringMethods) // The underlying problem is that the parser error recovery doesn't include _any_ information for @@ -301,8 +301,8 @@ type Test() = let parseResult, typeCheckResults = parseAndCheckScript(file, input) let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 4, inputLines[3], PartialLongName.Empty(20), (fun _ -> [])) - let item = decls.Items |> Array.tryFind (fun d -> d.Name = "abc") - decls.Items |> Seq.exists (fun d -> d.Name = "abc") |> shouldEqual true + let item = decls.Items |> Array.tryFind (fun d -> d.NameInList = "abc") + decls.Items |> Seq.exists (fun d -> d.NameInList = "abc") |> shouldEqual true [] let ``Find function from member 2`` () = @@ -318,8 +318,8 @@ type Test() = let parseResult, typeCheckResults = parseAndCheckScript(file, input) let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 4, inputLines[3], PartialLongName.Empty(21), (fun _ -> [])) - let item = decls.Items |> Array.tryFind (fun d -> d.Name = "abc") - decls.Items |> Seq.exists (fun d -> d.Name = "abc") |> shouldEqual true + let item = decls.Items |> Array.tryFind (fun d -> d.NameInList = "abc") + decls.Items |> Seq.exists (fun d -> d.NameInList = "abc") |> shouldEqual true [] let ``Find function from var`` () = @@ -335,7 +335,7 @@ type Test() = let parseResult, typeCheckResults = parseAndCheckScript(file, input) let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 4, inputLines[3], PartialLongName.Empty(14), (fun _ -> [])) - decls.Items |> Seq.exists (fun d -> d.Name = "abc") |> shouldEqual true + decls.Items |> Seq.exists (fun d -> d.NameInList = "abc") |> shouldEqual true [] @@ -355,7 +355,7 @@ type B(bar) = let parseResult, typeCheckResults = parseAndCheckScript(file, input) let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 7, inputLines[6], PartialLongName.Empty(17), (fun _ -> [])) - decls.Items |> Seq.exists (fun d -> d.Name = "bar") |> shouldEqual true + decls.Items |> Seq.exists (fun d -> d.NameInList = "bar") |> shouldEqual true @@ -378,7 +378,7 @@ type B(bar) = let parseResult, typeCheckResults = parseAndCheckScript(file, input) let decls = typeCheckResults.GetDeclarationListInfo(Some parseResult, 9, inputLines[8], PartialLongName.Empty(7), (fun _ -> [])) - decls.Items |> Seq.exists (fun d -> d.Name = "bar") |> shouldEqual true + decls.Items |> Seq.exists (fun d -> d.NameInList = "bar") |> shouldEqual true [] diff --git a/tests/service/PrettyNaming.fs b/tests/service/PrettyNaming.fs index e704e04bc9e..160096dc078 100644 --- a/tests/service/PrettyNaming.fs +++ b/tests/service/PrettyNaming.fs @@ -4,42 +4,66 @@ open FSharp.Compiler.Syntax.PrettyNaming open FsUnit open NUnit.Framework -[] -let ``words in operator name should not be considered as mangled infix operator`` () = - IsMangledInfixOperator "$foo hoo" - |> should equal false +// invalid operator name +[] +// random stuff +[] +// operator display representations +[] +[] +// not infix operators +[] +[] +// valid logical names +[] +[] +let ``IsLogicalPrefixOperator`` logicalName result = + IsLogicalPrefixOperator logicalName + |> should equal result - IsMangledInfixOperator "@foo hoo" - |> should equal false +// empty string +[] +// invalid opearators +[] +[] +// display representation +[] +// correct option +[] +let ``IsLogicalTernaryOperator`` logicalName result = + IsLogicalTernaryOperator logicalName + |> should equal result -[] -let ``typo in mangled operator name should not be considered as mangled infix operator`` () = - IsMangledInfixOperator "op_Nagation" - |> should equal false - -[] -let ``valid mangled operator name should be considered as mangled infix operator`` () = - IsMangledInfixOperator "op_Addition" - |> should equal true - - IsMangledInfixOperator "op_Append" - |> should equal true - -[] -let ``invalid mangled operator name should not be considered as mangled infix operator`` () = - IsMangledInfixOperator "op_Dollarfoo" - |> should equal false - - IsMangledInfixOperator "foo" - |> should equal false - -[] -let ``symbols in mangled operator name should not be considered as mangled infix operator`` () = - IsMangledInfixOperator "$foo" - |> should equal false - - IsMangledInfixOperator "$" - |> should equal false - - IsMangledInfixOperator "+" - |> should equal false \ No newline at end of file +// words in operator name +[] +[] +// typo in operator name +[] +// invalid operator name +[] +[] +[] +// random symbols +[] +// operator display representations +[] +[] +[] +[] +[] +// not infix operators +[] +[] +// valid logical names +[] +[] +[] +[] +[] +[] +[] +[] +[] +let ``IsLogicalInfixOpName`` logicalName result = + IsLogicalInfixOpName logicalName + |> should equal result diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index d552caf10aa..0c343ee58c4 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -4013,7 +4013,7 @@ let ``Test project28 all symbols in signature`` () = ("FSharpEntity", "Use", "T:M.Use"); ("FSharpMemberOrFunctionOrValue", "``.ctor``", "M:M.Use.#ctor"); ("FSharpMemberOrFunctionOrValue", "Test", "M:M.Use.Test``1(``0)"); - ("FSharpGenericParameter", "?", "")|] + ("FSharpGenericParameter", "``?``", "")|] |> Array.iter (fun x -> if xmlDocSigs |> Array.exists (fun y -> x = y) |> not then failwithf "%A does not exist in the collection." x diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs index 2564dd3af4b..9b3aecb7377 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs @@ -36,7 +36,7 @@ type internal FSharpRenameParamToMatchSignature let diagnostics = ImmutableArray.Create diagnostic let suggestion = parts.Groups.[1].Value - let replacement = AddBackticksToIdentifierIfNeeded suggestion + let replacement = NormalizeIdentifierBackticks suggestion let computeChanges() = asyncMaybe { let document = context.Document diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs index 3e4a6e1c57a..818aef1d12b 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs @@ -46,7 +46,7 @@ type internal FSharpReplaceWithSuggestionCodeFixProvider let declInfo = checkFileResults.GetDeclarationListInfo(Some parseFileResults, fcsCaretLineNumber, lineText, partialName) let addNames (addToBuffer:string -> unit) = for item in declInfo.Items do - addToBuffer item.Name + addToBuffer item.NameInList let diagnostics = context.Diagnostics @@ -54,7 +54,7 @@ type internal FSharpReplaceWithSuggestionCodeFixProvider |> Seq.toImmutableArray for suggestion in CompilerDiagnostics.GetSuggestedNames addNames unresolvedIdentifierText do - let replacement = PrettyNaming.AddBackticksToIdentifierIfNeeded suggestion + let replacement = PrettyNaming.NormalizeIdentifierBackticks suggestion let codeFix = CodeFixHelpers.createTextChangeCodeFix( CompilerDiagnostics.GetErrorMessage (FSharpDiagnosticKind.ReplaceWithSuggestion suggestion), diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 3d93c28d3b8..a35b903bfb3 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -128,7 +128,7 @@ type internal FSharpCompletionProvider if n <> 0 then n else n <- (not x.IsOwnMember).CompareTo(not y.IsOwnMember) if n <> 0 then n else - n <- String.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase) + n <- String.Compare(x.NameInList, y.NameInList, StringComparison.OrdinalIgnoreCase) if n <> 0 then n else x.MinorPriority.CompareTo(y.MinorPriority)) @@ -142,7 +142,7 @@ type internal FSharpCompletionProvider | _ -> null // Icky, but this is how roslyn handles it let filterText = - match declarationItem.NamespaceToOpen, declarationItem.Name.Split '.' with + match declarationItem.NamespaceToOpen, declarationItem.NameInList.Split '.' with // There is no namespace to open and the item name does not contain dots, so we don't need to pass special FilterText to Roslyn. | None, [|_|] -> null // Either we have a namespace to open ("DateTime (open System)") or item name contains dots ("Array.map"), or both. @@ -151,7 +151,7 @@ type internal FSharpCompletionProvider let completionItem = FSharpCommonCompletionItem.Create( - declarationItem.Name, + declarationItem.NameInList, null, rules = noCommitOnSpaceRules, glyph = Nullable glyph, @@ -166,7 +166,7 @@ type internal FSharpCompletionProvider | _ -> completionItem let completionItem = - if declarationItem.Name <> declarationItem.NameInCode then + if declarationItem.NameInList <> declarationItem.NameInCode then completionItem.AddProperty(NameInCodePropName, declarationItem.NameInCode) else completionItem diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index 709d6f7fcfa..6f8b4e7301a 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -363,10 +363,11 @@ type internal FSharpSignatureHelpProvider taggedText |> Seq.iter (RoslynHelpers.CollectTaggedText tt) let name = - if String.IsNullOrWhiteSpace(argument.DisplayName) then + let displayName = argument.DisplayName + if String.IsNullOrWhiteSpace displayName then "arg" + string index else - argument.DisplayName + displayName let display = [| diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs index 6fd2bf231cf..b1dfdb2a684 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs @@ -21,15 +21,16 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Syntax -type internal NavigableItem(document: Document, sourceSpan: TextSpan, glyph: Glyph, name: string, kind: string, additionalInfo: string) = - inherit FSharpNavigableItem(glyph, ImmutableArray.Create (TaggedText(TextTags.Text, name)), document, sourceSpan) +type internal NavigableItem(document: Document, sourceSpan: TextSpan, glyph: Glyph, logicalName: string, kind: string, additionalInfo: string) = + inherit FSharpNavigableItem(glyph, ImmutableArray.Create (TaggedText(TextTags.Text, logicalName)), document, sourceSpan) - member _.Name = name + // This use of compiler logical names is leaking out into the IDE. We should only report display names here. + member _.LogicalName = logicalName member _.Kind = kind member _.AdditionalInfo = additionalInfo type internal NavigateToSearchResult(item: NavigableItem, matchKind: FSharpNavigateToMatchKind) = - inherit FSharpNavigateToSearchResult(item.AdditionalInfo, item.Kind, matchKind, item.Name, item) + inherit FSharpNavigateToSearchResult(item.AdditionalInfo, item.Kind, matchKind, item.LogicalName, item) module private Index = [] @@ -69,10 +70,12 @@ module private Index = for item in items do let name = - if PrettyNaming.IsMangledOpName item.Name then - PrettyNaming.DecompileOpName item.Name + // This conversion back from logical names to display names should never be needed, because + // the FCS API should only report display names in the first place. + if PrettyNaming.IsLogicalOpName item.LogicalName then + PrettyNaming.ConvertValLogicalNameToDisplayNameCore item.LogicalName else - item.Name + item.LogicalName for i = 0 to name.Length - 1 do entries.Add(IndexEntry(name, i, item)) @@ -153,8 +156,8 @@ module private Utils = let name = match container.Type with | NavigableContainerType.File -> - (Path.GetFileNameWithoutExtension project.Name) + ", " + (Path.GetFileName container.Name) - | _ -> container.Name + (Path.GetFileNameWithoutExtension project.Name) + ", " + (Path.GetFileName container.LogicalName) + | _ -> container.LogicalName let combined = typeAsString + name @@ -197,10 +200,10 @@ type internal FSharpNavigateToSearchService let additionalInfo = containerToString item.Container document let _name = if isSignatureFile document.FilePath then - item.Name + " (signature)" + item.LogicalName + " (signature)" else - item.Name - yield NavigableItem(document, sourceSpan, glyph, item.Name, kind, additionalInfo) + item.LogicalName + yield NavigableItem(document, sourceSpan, glyph, item.LogicalName, kind, additionalInfo) |] return navigableItems } @@ -251,7 +254,7 @@ type internal FSharpNavigateToSearchService yield! items |> Array.collect (fun item -> item.AllItems) |> Array.Parallel.collect (fun x -> - patternMatcher.GetMatches(x.Name) + patternMatcher.GetMatches(x.LogicalName) |> Seq.map (fun pm -> NavigateToSearchResult(x, patternMatchKindToNavigateToMatchKind pm.Kind) :> FSharpNavigateToSearchResult) |> Seq.toArray) |] diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs index d09647a2396..b90bf2dc591 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs @@ -38,9 +38,9 @@ type internal FSharpNavigationBarItemService |> Array.choose (fun decl -> rangeToTextSpan(decl.Range) |> Option.map(fun textSpan -> - NavigationBarSymbolItem(decl.Name, decl.RoslynGlyph, [| textSpan |], null) :> FSharpNavigationBarItem)) + NavigationBarSymbolItem(decl.LogicalName, decl.RoslynGlyph, [| textSpan |], null) :> FSharpNavigationBarItem)) - NavigationBarSymbolItem(topLevelDecl.Declaration.Name, topLevelDecl.Declaration.RoslynGlyph, [| topLevelTextSpan |], childItems) + NavigationBarSymbolItem(topLevelDecl.Declaration.LogicalName, topLevelDecl.Declaration.RoslynGlyph, [| topLevelTextSpan |], childItems) :> FSharpNavigationBarItem)) :> IList<_> } |> Async.map (Option.defaultValue emptyResult) diff --git a/vsintegration/src/FSharp.LanguageService/Intellisense.fs b/vsintegration/src/FSharp.LanguageService/Intellisense.fs index c95cf70191b..76121ca3d83 100644 --- a/vsintegration/src/FSharp.LanguageService/Intellisense.fs +++ b/vsintegration/src/FSharp.LanguageService/Intellisense.fs @@ -127,7 +127,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: inherit Declarations_DEPRECATED() // Sort the declarations, NOTE: we used ORDINAL comparison here, this is "by design" from F# 2.0, partly because it puts lowercase last. - let declarations = declarations |> Array.sortWith (fun d1 d2 -> compare d1.Name d2.Name) + let declarations = declarations |> Array.sortWith (fun d1 d2 -> compare d1.NameInList d2.NameInList) let mutable lastBestMatch = "" let isEmpty = (declarations.Length = 0) @@ -146,7 +146,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: let filterTextPrefix = filterText.[0..i] match tab.TryGetValue filterTextPrefix with | true, decls -> yield decls - | false, _ -> yield declarations |> Array.filter (fun s -> matcher.MatchSingleWordPattern(s.Name, filterTextPrefix)<>null) + | false, _ -> yield declarations |> Array.filter (fun s -> matcher.MatchSingleWordPattern(s.NameInList, filterTextPrefix)<>null) yield declarations } |> Seq.tryFind (fun arr -> arr.Length > 0) |> (function None -> declarations | Some s -> s) @@ -160,7 +160,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: override decl.GetDisplayText(filterText, index) = let decls = trimmedDeclarations filterText if (index >= 0 && index < decls.Length) then - decls.[index].Name + decls.[index].NameInList else "" override decl.IsEmpty() = isEmpty @@ -172,7 +172,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: if (item.Glyph = FSharpGlyph.Error) then "" else - item.Name + item.NameInList else String.Empty override decl.GetNameInCode(filterText, index) = @@ -231,7 +231,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: // We intercept this call only to get the initial extent // of what was committed to the source buffer. let result = decl.GetName(filterText, index) - PrettyNaming.AddBackticksToIdentifierIfNeeded result + PrettyNaming.NormalizeIdentifierBackticks result override decl.IsCommitChar(commitCharacter) = // Usual language identifier rules... @@ -246,7 +246,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: let compareStrings(s,t,l,b : bool) = System.String.Compare(s,0,t,0,l,b) let tryFindDeclIndex text length ignoreCase = decls - |> Array.tryFindIndex (fun d -> compareStrings(d.Name, text, length, ignoreCase) = 0) + |> Array.tryFindIndex (fun d -> compareStrings(d.NameInList, text, length, ignoreCase) = 0) // The best match is the first item that begins with the longest prefix of the // given word (value). let rec findMatchOfLength len ignoreCase = @@ -259,9 +259,9 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: let firstMatchingLenChars = tryFindDeclIndex textSoFar len ignoreCase match firstMatchingLenChars with | Some index -> - lastBestMatch <- decls.[index].Name + lastBestMatch <- decls.[index].NameInList let select = len = textSoFar.Length - if (index <> decls.Length- 1) && (compareStrings(decls.[index+1].Name , textSoFar, len, ignoreCase) = 0) + if (index <> decls.Length- 1) && (compareStrings(decls.[index+1].NameInList , textSoFar, len, ignoreCase) = 0) then (index, false, select) else (index, select, select) | None -> @@ -278,7 +278,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations: // for example, "System.Console.WrL" will filter down to one, and still be a match, whereas // "System.Console.WrLx" will filter down to one, but no longer be a match decls.Length = 1 && - AbstractPatternMatcher.Singleton.MatchSingleWordPattern(decls.[0].Name, textSoFar)<>null + AbstractPatternMatcher.Singleton.MatchSingleWordPattern(decls.[0].NameInList, textSoFar)<>null ) shouldSelectItem <- preselect diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index 0e65489a70d..9492088f753 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -428,38 +428,104 @@ module Test = Assert.AreEqual(expected, quickInfo) () -[] +let ``Automation.LetBindings.InModule``() = + let code = """ namespace FsTest module Test = let fu$$nc x = () -""">] -[] +let ``Automation.LetBindings.InClass``() = + let code = """ namespace FsTest module Test = type T() = let fu$$nc x = () -""">] -[] +let ``Automation.LetBindings.StaticLet``() = + let code = """ namespace FsTest module Test = type T() = static let fu$$nc x = () -""">] -[] +let ``Automation.LetBindings.InDoBinding``() = + let code = """ namespace FsTest module Test = do let fu$$nc x = () () -""">] -let ``Automation.LetBindings`` code = +""" let expectedSignature = "val func: x: 'a -> unit" let tooltip = GetQuickInfoTextFromCode code StringAssert.StartsWith(expectedSignature, tooltip) () + +[] +let ``Display names for exceptions with backticks preserve backticks``() = + let code = """ +exception SomeError of ``thing wi$$th space``: string +""" + let expected = "``thing with space``" + + let actual = GetQuickInfoTextFromCode code + StringAssert.Contains(expected, actual) + () + +[] +let ``Display names for anonymous record fields with backticks preserve backticks``() = + let code = """ +type R = {| ``thing wi$$th space``: string |} +""" + let expected = "``thing with space``" + + let actual = GetQuickInfoTextFromCode code + + StringAssert.Contains(expected, actual) + () + +[] +let ``Display names identifiers for active patterns with backticks preserve backticks``() = + let code = """ +let (|``Thing with space``|_|) x = if x % 2 = 0 then Some (x/2) else None + +match 4 with +| ``Thing wi$$th space`` _ -> "yes" +| _ -> "no" +""" + let expected = "``Thing with space``" + + let actual = GetQuickInfoTextFromCode code + + StringAssert.Contains(expected, actual) + () diff --git a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs index 77b8038e98c..7f173d259bc 100644 --- a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs @@ -130,7 +130,7 @@ let assertSignatureHelpForMethodCalls (fileContents: string) (marker: string) (e Assert.AreEqual(expected, actual) -let assertSignatureHelpForFunctionApplication (fileContents: string) (marker: string) expectedArgumentCount expectedArgumentIndex = +let assertSignatureHelpForFunctionApplication (fileContents: string) (marker: string) expectedArgumentCount expectedArgumentIndex expectedArgumentName = let caretPosition = fileContents.LastIndexOf(marker) + marker.Length let document, sourceText = RoslynTestHelpers.CreateDocument(filePath, fileContents) @@ -166,12 +166,15 @@ let assertSignatureHelpForFunctionApplication (fileContents: string) (marker: st | Some sigHelp -> Assert.AreEqual(expectedArgumentCount, sigHelp.ArgumentCount) Assert.AreEqual(expectedArgumentIndex, sigHelp.ArgumentIndex) + Assert.AreEqual(1, sigHelp.SignatureHelpItems.Length) + Assert.IsTrue(expectedArgumentIndex < sigHelp.SignatureHelpItems[0].Parameters.Length) + Assert.AreEqual(expectedArgumentName, sigHelp.SignatureHelpItems[0].Parameters[expectedArgumentIndex].ParameterName) [] module ``Gives signature help in method calls`` = [] - let ``dot``() = + let ``dot``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -180,7 +183,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker None [] - let ``System``() = + let ``System``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -189,7 +192,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker None [] - let ``WriteLine``() = + let ``WriteLine``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -198,7 +201,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker None [] - let ``open paren``() = + let ``open paren``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -207,7 +210,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker (Some ("[7..64)", 0, 2, Some "format")) [] - let ``named arg``() = + let ``named arg``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -216,7 +219,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker (Some ("[7..64)", 0, 2, Some "format")) [] - let ``comma``() = + let ``comma``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -225,7 +228,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker None [] - let ``second comma``() = + let ``second comma``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -233,7 +236,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents """",""" (Some ("[7..64)", 1, 2, Some "arg0")) [] - let ``second named arg``() = + let ``second named arg``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -242,7 +245,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker (Some ("[7..64)", 1, 2, Some "arg0")) [] - let ``second named arg equals``() = + let ``second named arg equals``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -251,7 +254,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker (Some ("[7..64)", 1, 2, Some "arg0")) [] - let ``World``() = + let ``World``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -260,7 +263,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") assertSignatureHelpForMethodCalls fileContents marker (Some ("[7..64)", 1, 2, Some "arg0")) [] - let ``end paren``() = + let ``end paren``() : unit = let fileContents = """ //1 System.Console.WriteLine(format="Hello, {0}",arg0="World") @@ -271,7 +274,7 @@ System.Console.WriteLine(format="Hello, {0}",arg0="World") [] module ``Signature help with list literals, parens, etc`` = [] - let ``Open paren``() = + let ``Open paren``() : unit = let fileContents = """ //2 open System @@ -281,7 +284,7 @@ Console.WriteLine([(1,2)]) assertSignatureHelpForMethodCalls fileContents marker (Some ("[20..45)", 0, 0, None)) [] - let ``comma``() = + let ``comma``() : unit = let fileContents = """ //2 open System @@ -291,7 +294,7 @@ Console.WriteLine([(1,2)]) assertSignatureHelpForMethodCalls fileContents marker None [] - let ``list and tuple bracket pair start``() = + let ``list and tuple bracket pair start``() : unit = let fileContents = """ //2 open System @@ -303,7 +306,7 @@ Console.WriteLine([(1,2)]) [] module ``Unfinished parentheses`` = [] - let ``Unfinished parentheses``() = + let ``Unfinished parentheses``() : unit = let fileContents = """ let _ = System.DateTime( """ @@ -311,7 +314,7 @@ let _ = System.DateTime( assertSignatureHelpForMethodCalls fileContents marker (Some ("[10..26)", 0, 0, None)) [] - let ``Unfinished parentheses with comma``() = + let ``Unfinished parentheses with comma``() : unit = let fileContents = """ let _ = System.DateTime(1L, """ @@ -319,7 +322,7 @@ let _ = System.DateTime(1L, assertSignatureHelpForMethodCalls fileContents marker (Some ("[10..31)", 1, 2, None )) [] -let ``type provider static parameter tests``() = +let ``type provider static parameter tests``() : unit = // This is old code and I'm too lazy to move it all out. - Phillip Carter let manyTestCases = [ @@ -379,34 +382,34 @@ type foo5 = N1.T [] module ``Function argument applications`` = [] - let ``single argument function application``() = + let ``single argument function application``() : unit = let fileContents = """ sqrt """ let marker = "sqrt " - assertSignatureHelpForFunctionApplication fileContents marker 1 0 + assertSignatureHelpForFunctionApplication fileContents marker 1 0 "value" [] - let ``multi-argument function application``() = + let ``multi-argument function application``() : unit = let fileContents = """ let add2 x y = x + y add2 1 """ let marker = "add2 1 " - assertSignatureHelpForFunctionApplication fileContents marker 2 1 + assertSignatureHelpForFunctionApplication fileContents marker 2 1 "y" [] - let ``qualified function application``() = + let ``qualified function application``() : unit = let fileContents = """ module M = let f x = x M.f """ let marker = "M.f " - assertSignatureHelpForFunctionApplication fileContents marker 1 0 + assertSignatureHelpForFunctionApplication fileContents marker 1 0 "x" [] - let ``function application in single pipeline with no additional args``() = + let ``function application in single pipeline with no additional args``() : unit = let fileContents = """ [1..10] |> id """ @@ -445,35 +448,61 @@ M.f Assert.True(sigHelp.IsNone, "No signature help is expected because there are no additional args to apply.") [] - let ``function application in single pipeline with an additional argument``() = + let ``function application in single pipeline with an additional argument``() : unit = let fileContents = """ [1..10] |> List.map """ let marker = "List.map " - assertSignatureHelpForFunctionApplication fileContents marker 1 0 + assertSignatureHelpForFunctionApplication fileContents marker 1 0 "mapping" [] - let ``function application in middle of pipeline with an additional argument``() = + let ``function application in middle of pipeline with an additional argument``() : unit = let fileContents = """ [1..10] |> List.map |> List.filer (fun x -> x > 3) """ let marker = "List.map " - assertSignatureHelpForFunctionApplication fileContents marker 1 0 + assertSignatureHelpForFunctionApplication fileContents marker 1 0 "mapping" [] - let ``function application with function as parameter``() = + let ``function application with function as parameter``() : unit = let fileContents = """ let derp (f: int -> int -> int) x = f x 1 derp """ let marker = "derp " - assertSignatureHelpForFunctionApplication fileContents marker 2 0 + assertSignatureHelpForFunctionApplication fileContents marker 2 0 "f" + + [] + let ``function application with function as second parameter 1``() : unit = + let fileContents = """ +let derp (f: int -> int -> int) x = f x 1 +let add x y = x + y +derp add +""" + let marker = "derp add " + assertSignatureHelpForFunctionApplication fileContents marker 2 1 "x" + + [] + let ``function application with function as second parameter 2``() : unit = + let fileContents = """ +let f (derp: int -> int) x = derp x +""" + let marker = "derp " + assertSignatureHelpForFunctionApplication fileContents marker 1 0 "arg0" + + [] + let ``function application with curried function as parameter``() : unit = + let fileContents = """ +let f (derp: int -> int -> int) x = derp x +""" + let marker = "derp x " + assertSignatureHelpForFunctionApplication fileContents marker 2 1 "arg1" // migrated from legacy test [] -let ``Multi.ReferenceToProjectLibrary``() = +let ``Multi.ReferenceToProjectLibrary``() : unit = let completionNames = GetCompletionTypeNamesFromXmlString @" From b5796ee8add1cafda335468beef0d39180fdc388 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 09:32:44 -0700 Subject: [PATCH 084/226] Update dependencies from https://github.com/dotnet/arcade build 20220801.3 (#13616) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22379.10 -> To Version 7.0.0-beta.22401.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 489e5397fb6..e867b11e154 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 1e73f4ab4c172aa55614f24b2d5c319e1efb8813 + aa90e21c63248b4d6d61e8de14a0d8e7a9275130 diff --git a/global.json b/global.json index aeec4b81703..9dba4e4278b 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22379.10", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22401.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From b6127f9cba1a8cfb8c08e3160da2602cc0268377 Mon Sep 17 00:00:00 2001 From: Shurunov Andrei <26199107+ettud@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:34:22 +0300 Subject: [PATCH 085/226] Fixes #10621 (#13556) Co-authored-by: Shurunov Andrey --- src/Compiler/Checking/CheckExpressions.fs | 1 - .../Language/NameofTests.fs | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 1e4063aa00f..0892bd58a75 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -8104,7 +8104,6 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = | Result (_, item, _, _, _ as res) when (match item with - | Item.Types _ | Item.DelegateCtor _ | Item.CtorGroup _ | Item.FakeInterfaceCtor _ -> false diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs index bbe14823416..3c338e02203 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NameofTests.fs @@ -17,6 +17,42 @@ module NameofTests = let source = $""" let expected = "{operator}" let actual = nameof({operator}) +if actual <> expected then failwith $"Expected nameof({{expected}}) to be '{{expected}}', but got '{{actual}}'" + """ + Fsx source + |> asExe + |> withLangVersion50 + |> compileAndRun + |> shouldSucceed + + [] + let ``nameof() with member of a generic type should return the name without types provided`` () = + let source = $""" +type A<'a>() = + static member P = () + +let expected = "P" +let actual = nameof(A.P) +if actual <> expected then failwith $"Expected nameof({{expected}}) to be '{{expected}}', but got '{{actual}}'" + """ + Fsx source + |> asExe + |> withLangVersion50 + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + + [] + [] + [] + [] + let ``nameof() with member of a generic type should return the name`` numberOfGenericParameters = + let source = $""" +type A<{(seq {for i in 1 .. numberOfGenericParameters -> "'a" + string i } |> String.concat ", ")}>() = + static member P = () + +let expected = "P" +let actual = nameof(A<{(seq {for _ in 1 .. numberOfGenericParameters -> "_" } |> String.concat ", ")}>.P) if actual <> expected then failwith $"Expected nameof({{expected}}) to be '{{expected}}', but got '{{actual}}'" """ Fsx source From 636013c4fa8ec6fb73b3fa464d831cef01f4f6bf Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:17:46 +0200 Subject: [PATCH 086/226] [main] Update dependencies from dotnet/arcade (#13623) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e867b11e154..cc8cb937f11 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - aa90e21c63248b4d6d61e8de14a0d8e7a9275130 + f7e668c691281e5ba69447e938627522e7be852e diff --git a/global.json b/global.json index 9dba4e4278b..24c793fb5a0 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22401.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22402.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From d482ea2aaf4ab1c61648e6090ff89fb80fbc88b1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 14:05:23 +0000 Subject: [PATCH 087/226] Update dependencies from https://github.com/dotnet/arcade build 20220803.1 (#13633) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cc8cb937f11..49366038db7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - f7e668c691281e5ba69447e938627522e7be852e + 4ee620cc1b57da45d93135e064d43a83e65bbb6e diff --git a/global.json b/global.json index 24c793fb5a0..8cec0f070c3 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22402.4", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22403.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From b2f4718f2ead3e4efc4699b4d14cde31eac11c63 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 4 Aug 2022 18:46:27 +0200 Subject: [PATCH 088/226] Consolidating TopVal and ValRepr terms (#13624) Co-authored-by: Don Syme --- src/Compiler/Checking/CheckDeclarations.fs | 12 +- src/Compiler/Checking/CheckExpressions.fs | 114 +++++++++--------- src/Compiler/Checking/CheckExpressions.fsi | 23 +--- .../Checking/CheckIncrementalClasses.fs | 10 +- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/InfoReader.fs | 12 +- src/Compiler/Checking/MethodCalls.fs | 4 +- src/Compiler/Checking/MethodOverrides.fs | 10 +- .../Checking/PatternMatchCompilation.fs | 10 +- src/Compiler/Checking/PostInferenceChecks.fs | 14 +-- src/Compiler/Checking/QuotationTranslator.fs | 20 +-- src/Compiler/Checking/TypeRelations.fs | 39 +++--- src/Compiler/Checking/TypeRelations.fsi | 22 ++-- src/Compiler/Checking/infos.fs | 10 +- src/Compiler/CodeGen/IlxGen.fs | 95 ++++++++------- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 10 +- src/Compiler/Optimize/LowerCalls.fs | 4 +- src/Compiler/Optimize/LowerLocalMutables.fs | 2 +- src/Compiler/Optimize/Optimizer.fs | 6 +- src/Compiler/Service/ItemKey.fs | 4 +- .../Service/ServiceDeclarationLists.fs | 2 +- src/Compiler/Symbols/Exprs.fs | 10 +- src/Compiler/Symbols/SymbolHelpers.fs | 10 +- src/Compiler/Symbols/Symbols.fs | 8 +- src/Compiler/TypedTree/TypedTree.fs | 18 +-- src/Compiler/TypedTree/TypedTree.fsi | 14 ++- src/Compiler/TypedTree/TypedTreeOps.fs | 42 +++---- src/Compiler/TypedTree/TypedTreeOps.fsi | 20 +-- src/Compiler/TypedTree/TypedTreePickle.fs | 2 +- 29 files changed, 282 insertions(+), 267 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index cc55ee5f23c..5cf36acb80d 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -900,7 +900,7 @@ module MutRecBindingChecking = | Some _ -> envForTycon let rbind = NormalizedRecBindingDefn(containerInfo, newslotsOK, declKind, bind) - let overridesOK = DeclKind.CanOverrideOrImplement declKind + let overridesOK = declKind.CanOverrideOrImplement let (binds, _values), (tpenv, recBindIdx) = AnalyzeAndMakeAndPublishRecursiveValue overridesOK false cenv envForMember (tpenv, recBindIdx) rbind let cbinds = [ for rbind in binds -> Phase2AMember rbind ] @@ -1604,8 +1604,10 @@ module MutRecBindingChecking = // Phase2E - rewrite values to initialization graphs let defnsEs = EliminateInitializationGraphs - //(fun morpher (tyconOpt, fixupValueExprBinds, methodBinds) -> (tyconOpt, morpher fixupValueExprBinds @ methodBinds)) - g true denv defnsDs + g + true + denv + defnsDs (fun morpher shape -> shape |> MutRecShapes.iterTyconsAndLets (p23 >> morpher) morpher) MutRecShape.Lets (fun morpher shape -> shape |> MutRecShapes.mapTyconsAndLets (fun (tyconOpt, fixupValueExprBinds, methodBinds) -> tyconOpt, (morpher fixupValueExprBinds @ methodBinds)) morpher) @@ -1618,7 +1620,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (env let g = cenv.g let interfacesFromTypeDefn envForTycon tyconMembersData = let (MutRecDefnsPhase2DataForTycon(_, _, declKind, tcref, _, _, declaredTyconTypars, members, _, _, _)) = tyconMembersData - let overridesOK = DeclKind.CanOverrideOrImplement declKind + let overridesOK = declKind.CanOverrideOrImplement members |> List.collect (function | SynMemberDefn.Interface(interfaceType=intfTy; members=defnOpt) -> let ty = if tcref.Deref.IsFSharpException then g.exn_ty else generalizedTyconRef g tcref @@ -3338,7 +3340,7 @@ module EstablishTypeDefinitionCores = noFieldsCheck userFields primaryConstructorInDelegateCheck(implicitCtorSynPats) let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType envinner tpenv ty - let _, _, curriedArgInfos, returnTy, _ = GetTopValTypeInCompiledForm g (arity |> TranslateSynValInfo m (TcAttributes cenv envinner) |> TranslatePartialValReprInfo []) 0 tyR m + let _, _, curriedArgInfos, returnTy, _ = GetValReprTypeInCompiledForm g (arity |> TranslateSynValInfo m (TcAttributes cenv envinner) |> TranslatePartialValReprInfo []) 0 tyR m if curriedArgInfos.Length < 1 then error(Error(FSComp.SR.tcInvalidDelegateSpecification(), m)) if curriedArgInfos.Length > 1 then error(Error(FSComp.SR.tcDelegatesCannotBeCurried(), m)) let ttps = thisTyconRef.Typars m diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 0892bd58a75..d659fc28967 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -452,7 +452,7 @@ type DeclKind = | ExpressionBinding - static member IsModuleOrMemberOrExtensionBinding x = + member x.IsModuleOrMemberOrExtensionBinding = match x with | ModuleOrMemberBinding -> true | IntrinsicExtensionBinding -> true @@ -461,7 +461,7 @@ type DeclKind = | ObjectExpressionOverrideBinding -> false | ExpressionBinding -> false - static member MustHaveArity x = DeclKind.IsModuleOrMemberOrExtensionBinding x + member x.MustHaveValReprInfo = x.IsModuleOrMemberOrExtensionBinding member x.CanBeDllImport = match x with @@ -472,11 +472,9 @@ type DeclKind = | ObjectExpressionOverrideBinding -> false | ExpressionBinding -> false - static member IsAccessModifierPermitted x = DeclKind.IsModuleOrMemberOrExtensionBinding x + member x.IsAccessModifierPermitted = x.IsModuleOrMemberOrExtensionBinding - static member ImplicitlyStatic x = DeclKind.IsModuleOrMemberOrExtensionBinding x - - static member AllowedAttribTargets (memberFlagsOpt: SynMemberFlags option) x = + member x.AllowedAttribTargets (memberFlagsOpt: SynMemberFlags option) = match x with | ModuleOrMemberBinding | ObjectExpressionOverrideBinding -> match memberFlagsOpt with @@ -492,7 +490,7 @@ type DeclKind = | ExpressionBinding -> enum 0 // indicates attributes not allowed on expression 'let' bindings // Note: now always true - static member CanGeneralizeConstrainedTypars x = + member x.CanGeneralizeConstrainedTypars = match x with | ModuleOrMemberBinding -> true | IntrinsicExtensionBinding -> true @@ -501,7 +499,7 @@ type DeclKind = | ObjectExpressionOverrideBinding -> true | ExpressionBinding -> true - static member ConvertToLinearBindings x = + member x.IsConvertToLinearBindings = match x with | ModuleOrMemberBinding -> true | IntrinsicExtensionBinding -> true @@ -510,7 +508,7 @@ type DeclKind = | ObjectExpressionOverrideBinding -> true | ExpressionBinding -> false - static member CanOverrideOrImplement x = + member x.CanOverrideOrImplement = match x with | ModuleOrMemberBinding -> OverridesOK | IntrinsicExtensionBinding -> WarnOnOverrides @@ -993,7 +991,7 @@ let ReportImplicitlyIgnoredBoolExpression denv m ty expr = if propRef.IsPropertyGetterMethod then let propertyName = propRef.PropertyName let hasCorrespondingSetter = - match propRef.DeclaringEntity with + match propRef.TryDeclaringEntity with | Parent entityRef -> entityRef.MembersOfFSharpTyconSorted |> List.exists (fun vref -> vref.IsPropertySetterMethod && vref.PropertyName = propertyName) @@ -1440,12 +1438,12 @@ let CombineVisibilityAttribs vis1 vis2 m = vis1 | _ -> vis2 -let ComputeAccessAndCompPath env declKindOpt m vis overrideVis actualParent = +let ComputeAccessAndCompPath env (declKindOpt: DeclKind option) m vis overrideVis actualParent = let accessPath = env.eAccessPath let accessModPermitted = match declKindOpt with | None -> true - | Some declKind -> DeclKind.IsAccessModifierPermitted declKind + | Some declKind -> declKind.IsAccessModifierPermitted if Option.isSome vis && not accessModPermitted then errorR(Error(FSComp.SR.tcMultipleVisibilityAttributesWithLet(), m)) @@ -1860,14 +1858,14 @@ let ComputeIsTyFunc(id: Ident, hasDeclaredTypars, arityInfo: ValReprInfo option) | None -> error(Error(FSComp.SR.tcExplicitTypeParameterInvalid(), id.idRange)) | Some info -> info.NumCurriedArgs = 0) -let UseSyntacticArity declKind typeScheme prelimValReprInfo = +let UseSyntacticValReprInfo (declKind: DeclKind) typeScheme prelimValReprInfo = let valReprInfo = InferGenericArityFromTyScheme typeScheme prelimValReprInfo - if DeclKind.MustHaveArity declKind then + if declKind.MustHaveValReprInfo then Some valReprInfo, None else None, Some valReprInfo -/// Combine the results of InferSynValData and InferArityOfExpr. +/// Combine the results of InferSynValData and InferValReprInfoOfExpr. // // The F# spec says that we infer arities from declaration forms and types. // @@ -1879,7 +1877,7 @@ let UseSyntacticArity declKind typeScheme prelimValReprInfo = // let f = (fun (x: int*int) y -> 1) // gets arity [2;1] // // Some of this arity inference is purely syntax directed and done in InferSynValData in ast.fs -// Some is done by InferArityOfExpr. +// Some is done by InferValReprInfoOfExpr. // // However, there are some corner cases in this specification. In particular, consider // let f () () = 1 // [0;1] or [0;0]? Answer: [0;1] @@ -1900,7 +1898,7 @@ let UseSyntacticArity declKind typeScheme prelimValReprInfo = // { new Base with // member x.M(v: unit) = () } // -let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = +let CombineSyntacticAndInferredValReprInfo g rhsExpr prelimScheme = let (PrelimVal2(_, typeScheme, partialValReprInfoOpt, memberInfoOpt, isMutable, _, _, ArgAndRetAttribs(argAttribs, retAttribs), _, _, _)) = prelimScheme match partialValReprInfoOpt with | None -> Some(PrelimValReprInfo([], ValReprInfo.unnamedRetVal)) @@ -1918,7 +1916,7 @@ let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = else let (ValReprInfo (_, curriedArgInfosFromExpression, _)) = - InferArityOfExpr g AllowTypeDirectedDetupling.Yes (GeneralizedTypeForTypeScheme typeScheme) argAttribs retAttribs rhsExpr + InferValReprInfoOfExpr g AllowTypeDirectedDetupling.Yes (GeneralizedTypeForTypeScheme typeScheme) argAttribs retAttribs rhsExpr // Choose between the syntactic arity and the expression-inferred arity // If the syntax specifies an eliminated unit arg, then use that @@ -1941,31 +1939,32 @@ let CombineSyntacticAndInferredArities g rhsExpr prelimScheme = Some partialArityInfo -let BuildValScheme declKind partialArityInfoOpt prelimScheme = +let BuildValScheme (declKind: DeclKind) partialValReprInfoOpt prelimScheme = let (PrelimVal2(id, typeScheme, _, memberInfoOpt, isMutable, inlineFlag, baseOrThis, _, vis, isCompGen, hasDeclaredTypars)) = prelimScheme let valReprInfoOpt = - partialArityInfoOpt + partialValReprInfoOpt |> Option.map (InferGenericArityFromTyScheme typeScheme) let valReprInfo, valReprInfoForDisplay = - if DeclKind.MustHaveArity declKind then + if declKind.MustHaveValReprInfo then valReprInfoOpt, None else None, valReprInfoOpt + let isTyFunc = ComputeIsTyFunc(id, hasDeclaredTypars, valReprInfo) ValScheme(id, typeScheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, isCompGen, false, isTyFunc, hasDeclaredTypars) -let UseCombinedArity g declKind rhsExpr prelimScheme = - let partialArityInfoOpt = CombineSyntacticAndInferredArities g rhsExpr prelimScheme - BuildValScheme declKind partialArityInfoOpt prelimScheme +let UseCombinedValReprInfo g declKind rhsExpr prelimScheme = + let partialValReprInfoOpt = CombineSyntacticAndInferredValReprInfo g rhsExpr prelimScheme + BuildValScheme declKind partialValReprInfoOpt prelimScheme -let UseNoArity prelimScheme = +let UseNoValReprInfo prelimScheme = BuildValScheme ExpressionBinding None prelimScheme /// Make and publish the Val nodes for a collection of simple (non-generic) value specifications let MakeAndPublishSimpleVals cenv env names = let tyschemes = DontGeneralizeVals names - let valSchemes = NameMap.map UseNoArity tyschemes + let valSchemes = NameMap.map UseNoValReprInfo tyschemes let values = MakeAndPublishVals cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valSchemes, [], XmlDoc.Empty, None) let vspecMap = NameMap.map fst values values, vspecMap @@ -2326,10 +2325,11 @@ module GeneralizationHelpers = | _ -> false - let CanGeneralizeConstrainedTyparsForDecl declKind = - if DeclKind.CanGeneralizeConstrainedTypars declKind - then CanGeneralizeConstrainedTypars - else DoNotGeneralizeConstrainedTypars + let CanGeneralizeConstrainedTyparsForDecl (declKind: DeclKind) = + if declKind.CanGeneralizeConstrainedTypars then + CanGeneralizeConstrainedTypars + else + DoNotGeneralizeConstrainedTypars /// Recursively knock out typars we can't generalize. /// For non-generalized type variables be careful to iteratively knock out @@ -3638,7 +3638,7 @@ type PreInitializationGraphEliminationBinding = /// Check for safety and determine if we need to insert lazy thunks let EliminateInitializationGraphs g - mustHaveArity + mustHaveValReprInfo denv (bindings: 'Bindings list) (iterBindings: (PreInitializationGraphEliminationBinding list -> unit) -> 'Bindings list -> unit) @@ -3816,12 +3816,16 @@ let EliminateInitializationGraphs let fty = mkFunTy g g.unit_ty ty let flazy, felazy = mkCompGenLocal m v.LogicalName fty let frhs = mkUnitDelayLambda g m e - if mustHaveArity then flazy.SetValReprInfo (Some(InferArityOfExpr g AllowTypeDirectedDetupling.Yes fty [] [] frhs)) + + if mustHaveValReprInfo then + flazy.SetValReprInfo (Some(InferValReprInfoOfExpr g AllowTypeDirectedDetupling.Yes fty [] [] frhs)) let vlazy, velazy = mkCompGenLocal m v.LogicalName vTy let vrhs = (mkLazyDelayed g m ty felazy) - if mustHaveArity then vlazy.SetValReprInfo (Some(InferArityOfExpr g AllowTypeDirectedDetupling.Yes vTy [] [] vrhs)) + if mustHaveValReprInfo then + vlazy.SetValReprInfo (Some(InferValReprInfoOfExpr g AllowTypeDirectedDetupling.Yes vTy [] [] vrhs)) + for (fixupPoint, _) in fixupPoints do fixupPoint.Value <- mkLazyForce g fixupPoint.Value.Range ty velazy @@ -4310,7 +4314,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = | [ValSpecResult(_, _, id, _, _, memberConstraintTy, prelimValReprInfo, _)] -> let memberConstraintTypars, _ = tryDestForallTy g memberConstraintTy let valReprInfo = TranslatePartialValReprInfo memberConstraintTypars prelimValReprInfo - let _, _, curriedArgInfos, returnTy, _ = GetTopValTypeInCompiledForm g valReprInfo 0 memberConstraintTy m + let _, _, curriedArgInfos, returnTy, _ = GetValReprTypeInCompiledForm g valReprInfo 0 memberConstraintTy m //if curriedArgInfos.Length > 1 then error(Error(FSComp.SR.tcInvalidConstraint(), m)) let argTys = List.concat curriedArgInfos let argTys = List.map fst argTys @@ -6781,7 +6785,7 @@ and TcRecordConstruction cenv (overallTy: TType) env tpenv withExprInfoOpt objTy // TcObjectExpr //------------------------------------------------------------------------- -and GetNameAndArityOfObjExprBinding _cenv _env b = +and GetNameAndSynValInfoOfObjExprBinding _cenv _env b = let (NormalizedBinding (_, _, _, _, _, _, _, valSynData, pat, rhsExpr, mBinding, _)) = b let (SynValData(memberFlagsOpt, valSynInfo, _)) = valSynData match pat, memberFlagsOpt with @@ -6827,7 +6831,7 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implTy: TType) virtNameAndArit else "" // Compute the argument counts of the member arguments - let _, synValInfo = GetNameAndArityOfObjExprBinding cenv env bind + let _, synValInfo = GetNameAndSynValInfoOfObjExprBinding cenv env bind let arity = match SynInfo.AritiesOfArgs synValInfo with | _ :: x :: _ -> x @@ -6956,7 +6960,7 @@ and ComputeObjectExprOverrides cenv (env: TcEnv) tpenv impls = [ for binding in binds do let (NormalizedBinding(_, _, _, _, bindingSynAttribs, _, _, valSynData, _, _, _, _)) = binding let (SynValData(memberFlagsOpt, _, _)) = valSynData - let attrTgt = DeclKind.AllowedAttribTargets memberFlagsOpt ObjectExpressionOverrideBinding + let attrTgt = ObjectExpressionOverrideBinding.AllowedAttribTargets memberFlagsOpt let bindingAttribs = TcAttributes cenv env attrTgt bindingSynAttribs yield binding, bindingAttribs for extraBinding in EventDeclarationNormalization.GenerateExtraBindings cenv (bindingAttribs, binding) do @@ -6971,7 +6975,7 @@ and ComputeObjectExprOverrides cenv (env: TcEnv) tpenv impls = //dprintfn "vkey = %A" vkey (vkey, virt)) - let bindNameAndSynInfoPairs = binds |> List.map (GetNameAndArityOfObjExprBinding cenv env) + let bindNameAndSynInfoPairs = binds |> List.map (GetNameAndSynValInfoOfObjExprBinding cenv env) let bindNames = bindNameAndSynInfoPairs |> List.map fst let bindKeys = bindNameAndSynInfoPairs |> List.map (fun (name, valSynData) -> @@ -10276,7 +10280,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt let envinner = {envinner with eCallerMemberName = callerName } - let attrTgt = DeclKind.AllowedAttribTargets memberFlagsOpt declKind + let attrTgt = declKind.AllowedAttribTargets memberFlagsOpt let isFixed, rhsExpr, overallPatTy, overallExprTy = match rhsExpr with @@ -10431,7 +10435,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt // Don't do this for lambdas, because we always check for suppression for all lambda bodies in TcIteratedLambdas let rhsExprChecked, tpenv = let atTopNonLambdaDefn = - DeclKind.IsModuleOrMemberOrExtensionBinding declKind && + declKind.IsModuleOrMemberOrExtensionBinding && (match rhsExpr with SynExpr.Lambda _ -> false | _ -> true) && synExprContainsError rhsExpr @@ -10816,7 +10820,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds // REVIEW: this scopes generalized type variables. Ensure this is handled properly // on all other paths. let tpenv = HideUnscopedTypars generalizedTypars tpenv - let valSchemes = NameMap.map (UseCombinedArity g declKind rhsExpr) prelimValSchemes2 + let valSchemes = NameMap.map (UseCombinedValReprInfo g declKind rhsExpr) prelimValSchemes2 let values = MakeAndPublishVals cenv env (altActualParent, false, declKind, ValNotInRecScope, valSchemes, attrs, xmlDoc, literalValue) let checkedPat = tcPatPhase2 (TcPatPhase2Input (values, true)) let prelimRecValues = NameMap.map fst values @@ -10864,8 +10868,8 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds // If the overall declaration is declaring statics or a module value, then force the patternInputTmp to also // have representation as module value. - if DeclKind.MustHaveArity declKind then - AdjustValToTopVal tmp altActualParent (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes tmp rhsExpr) + if declKind.MustHaveValReprInfo then + AdjustValToHaveValReprInfo tmp altActualParent (InferValReprInfoOfBinding g AllowTypeDirectedDetupling.Yes tmp rhsExpr) tmp, checkedPat @@ -10883,7 +10887,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds let matchExpr = CompilePatternForMatch cenv env m m true ThrowIncompleteMatchException (patternInputTmp, generalizedTypars, Some rhsExpr) clauses tauTy bodyExprTy let matchExpr = - if DeclKind.ConvertToLinearBindings declKind then + if declKind.IsConvertToLinearBindings then LinearizeTopMatch g altActualParent matchExpr else matchExpr @@ -10914,10 +10918,10 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds /// So let bindings could contain a fork at a match construct, with one branch being the match failure. /// If bindings are linearised, then this fork is pushed to the RHS. /// In this case, the let bindings type check to a sequence of bindings. -and TcLetBindings cenv env containerInfo declKind tpenv (binds, bindsm, scopem) = +and TcLetBindings cenv env containerInfo (declKind: DeclKind) tpenv (binds, bindsm, scopem) = let g = cenv.g - assert(DeclKind.ConvertToLinearBindings declKind) + assert declKind.IsConvertToLinearBindings let mkf, env, tpenv = TcLetBinding cenv false env containerInfo declKind tpenv (binds, bindsm, scopem) let unite = mkUnit g bindsm let expr, _ = mkf (unite, g.unit_ty) @@ -11402,7 +11406,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue let (SynValData(memberFlagsOpt, valSynInfo, thisIdOpt)) = valSynData let (ContainerInfo(altActualParent, tcrefContainerInfo)) = containerInfo - let attrTgt = DeclKind.AllowedAttribTargets memberFlagsOpt declKind + let attrTgt = declKind.AllowedAttribTargets memberFlagsOpt // Check the attributes on the declaration let bindingAttribs = TcAttributes cenv env attrTgt bindingSynAttribs @@ -11439,7 +11443,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue // NOTE: top arity, type and typars get fixed-up after inference let prelimTyscheme = GeneralizedType(enclosingDeclaredTypars@declaredTypars, ty) let prelimValReprInfo = TranslateSynValInfo mBinding (TcAttributes cenv envinner) valSynInfo - let valReprInfo, valReprInfoForDisplay = UseSyntacticArity declKind prelimTyscheme prelimValReprInfo + let valReprInfo, valReprInfoForDisplay = UseSyntacticValReprInfo declKind prelimTyscheme prelimValReprInfo let hasDeclaredTypars = not (List.isEmpty declaredTypars) let prelimValScheme = ValScheme(bindingId, prelimTyscheme, valReprInfo, valReprInfoForDisplay, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) @@ -11818,7 +11822,7 @@ and TcLetrecGeneralizeBinding cenv denv generalizedTypars (pgrbind: PreGeneraliz let prelimVal1 = PrelimVal1(vspec.Id, explicitTyparInfo, tau, Some prelimValReprInfo, memberInfoOpt, false, inlineFlag, NormalVal, argAttribs, vis, isCompGen) let prelimVal2 = GeneralizeVal cenv denv enclosingDeclaredTypars generalizedTypars prelimVal1 - let valscheme = UseCombinedArity g declKind expr prelimVal2 + let valscheme = UseCombinedValReprInfo g declKind expr prelimVal2 AdjustRecType vspec valscheme { ValScheme = valscheme @@ -11985,14 +11989,16 @@ and TcLetrecBindings overridesOK cenv env tpenv (binds, bindsm, scopem) = // Now eliminate any initialization graphs let binds = let bindsWithoutLaziness = vxbinds - let mustHaveArity = + let mustHaveValReprInfo = match uncheckedRecBinds with | [] -> false - | rbind :: _ -> DeclKind.MustHaveArity rbind.RecBindingInfo.DeclKind + | rbind :: _ -> rbind.RecBindingInfo.DeclKind.MustHaveValReprInfo let results = EliminateInitializationGraphs - g mustHaveArity env.DisplayEnv + g + mustHaveValReprInfo + env.DisplayEnv bindsWithoutLaziness //(fun (fun doBindings bindings -> doBindings bindings) @@ -12009,7 +12015,7 @@ and TcLetrecBindings overridesOK cenv env tpenv (binds, bindsm, scopem) = // Bind specifications of values //------------------------------------------------------------------------- -let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind, memFlagsOpt, tpenv, synValSig) = +let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind : DeclKind, memFlagsOpt, tpenv, synValSig) = let g = cenv.g @@ -12020,7 +12026,7 @@ let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind, memF let canInferTypars = GeneralizationHelpers.ComputeCanInferExtraGeneralizableTypars (containerInfo.ParentRef, synCanInferTypars, memFlagsOpt) - let attrTgt = DeclKind.AllowedAttribTargets memFlagsOpt declKind + let attrTgt = declKind.AllowedAttribTargets memFlagsOpt let attrs = TcAttributes cenv env attrTgt synAttrs let newOk = if canInferTypars then NewTyparsOK else NoNewTypars diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 2a83a61d50f..696e5d31932 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -480,24 +480,7 @@ type DeclKind = /// A binding in an expression | ExpressionBinding - static member IsModuleOrMemberOrExtensionBinding: DeclKind -> bool - - static member MustHaveArity: DeclKind -> bool - - member CanBeDllImport: bool - - static member IsAccessModifierPermitted: DeclKind -> bool - - static member ImplicitlyStatic: DeclKind -> bool - - static member AllowedAttribTargets: SynMemberFlags option -> DeclKind -> AttributeTargets - - // Note: now always true - static member CanGeneralizeConstrainedTypars: DeclKind -> bool - - static member ConvertToLinearBindings: DeclKind -> bool - - static member CanOverrideOrImplement: DeclKind -> OverridesOK + member CanOverrideOrImplement: OverridesOK /// Indicates whether a syntactic type is allowed to include new type variables /// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` @@ -745,7 +728,7 @@ val CompilePatternForMatchClauses: /// The functions must iterate the actual bindings and process them to the overall result. val EliminateInitializationGraphs: g: TcGlobals -> - mustHaveArity: bool -> + mustHaveValReprInfo: bool -> denv: DisplayEnv -> bindings: 'Binding list -> iterBindings: ((PreInitializationGraphEliminationBinding list -> unit) -> 'Binding list -> unit) -> @@ -989,7 +972,7 @@ val TcMatchPattern: val (|BinOpExpr|_|): SynExpr -> (Ident * SynExpr * SynExpr) option -/// Check a set of let bindings +/// Check a set of let bindings in a class or module val TcLetBindings: cenv: TcFileState -> env: TcEnv -> diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index f225a9927e8..6a52133379f 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -245,7 +245,7 @@ type IncrClassReprInfo = if isUnitTy g v.Type then false else - let arity = InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v bind.Expr + let arity = InferValReprInfoOfBinding g AllowTypeDirectedDetupling.Yes v bind.Expr not arity.HasNoArgs && not v.IsMutable @@ -292,7 +292,7 @@ type IncrClassReprInfo = warning (Error(FSComp.SR.chkUnusedValue(v.DisplayName), v.Range)) let repr = - match InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v bind.Expr with + match InferValReprInfoOfBinding g AllowTypeDirectedDetupling.Yes v bind.Expr with | arity when arity.HasNoArgs || v.IsMutable -> // all mutable variables are forced into fields, since they may escape into closures within the implicit constructor // e.g. @@ -319,7 +319,7 @@ type IncrClassReprInfo = InVar isCtorArg | valReprInfo -> //dprintfn "Representing %s as a method %s" v.LogicalName name - let tps, _, argInfos, _, _ = GetTopValTypeInCompiledForm g valReprInfo 0 v.Type v.Range + let tps, _, argInfos, _, _ = GetValReprTypeInCompiledForm g valReprInfo 0 v.Type v.Range let valSynInfo = SynValInfo(argInfos |> List.mapSquared (fun (_, argInfo) -> SynArgInfo([], false, argInfo.Name)), SynInfo.unnamedRetVal) let memberFlags = (if isStatic then StaticMemberFlags else NonVirtualMemberFlags) SynMemberFlagsTrivia.Zero SynMemberKind.Member @@ -328,7 +328,7 @@ type IncrClassReprInfo = let copyOfTyconTypars = ctorInfo.GetNormalizedInstanceCtorDeclaredTypars cenv env.DisplayEnv ctorInfo.TyconRef.Range - AdjustValToTopVal v (Parent tcref) valReprInfo + AdjustValToHaveValReprInfo v (Parent tcref) valReprInfo // Add the 'this' pointer on to the function let memberTauTy, valReprInfo = @@ -403,7 +403,7 @@ type IncrClassReprInfo = | InMethod(isStatic, methodVal, valReprInfo), _ -> //dprintfn "Rewriting application of %s to be call to method %s" v.LogicalName methodVal.LogicalName - let expr, exprTy = AdjustValForExpectedArity g m (mkLocalValRef methodVal) NormalValUse valReprInfo + let expr, exprTy = AdjustValForExpectedValReprInfo g m (mkLocalValRef methodVal) NormalValUse valReprInfo // Prepend the the type arguments for the class let tyargs = tinst @ tyargs let thisArgs = diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index 93f452abd7d..754a6215206 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -166,7 +166,7 @@ and accLambdas cenv env valReprInfo expr exprTy = | Expr.TyChoose (_tps, bodyExpr, _m) -> accLambdas cenv env valReprInfo bodyExpr exprTy | Expr.Lambda _ | Expr.TyLambda _ -> - let _tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda cenv.g cenv.amap valReprInfo (expr, exprTy) + let _tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destLambdaWithValReprInfo cenv.g cenv.amap valReprInfo (expr, exprTy) accTy cenv env bodyTy vsl |> List.iterSquared (accVal cenv env) baseValOpt |> Option.iter (accVal cenv env) diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 96f65890160..e2cc31a265d 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -1029,11 +1029,11 @@ let GetXmlDocSigOfScopedValRef g (tcref: TyconRef) (vref: ValRef) = let ccuFileName = libFileOfEntityRef tcref let v = vref.Deref if v.XmlDocSig = "" && v.HasDeclaringEntity then - let ap = buildAccessPath vref.TopValDeclaringEntity.CompilationPathOpt + let ap = buildAccessPath vref.DeclaringEntity.CompilationPathOpt let path = - if vref.TopValDeclaringEntity.IsModule then + if vref.DeclaringEntity.IsModule then let sep = if ap.Length > 0 then "." else "" - ap + sep + vref.TopValDeclaringEntity.CompiledName + ap + sep + vref.DeclaringEntity.CompiledName else ap v.XmlDocSig <- XmlDocSigOfVal g false path v @@ -1061,7 +1061,7 @@ let GetXmlDocSigOfMethInfo (infoReader: InfoReader) m (minfo: MethInfo) = | ILMeth (g, ilminfo, _) -> let actualTypeName = ilminfo.DeclaringTyconRef.CompiledRepresentationForNamedType.FullName let fmtps = ilminfo.FormalMethodTypars - let genArity = if fmtps.Length=0 then "" else sprintf "``%d" fmtps.Length + let genericArity = if fmtps.Length=0 then "" else sprintf "``%d" fmtps.Length match TryFindMetadataInfoOfExternalEntityRef infoReader m ilminfo.DeclaringTyconRef with | None -> None @@ -1079,7 +1079,7 @@ let GetXmlDocSigOfMethInfo (infoReader: InfoReader) m (minfo: MethInfo) = // qualified name of the String constructor would be "System.String.#ctor". let normalizedName = ilminfo.ILName.Replace(".", "#") - Some (ccuFileName, "M:"+actualTypeName+"."+normalizedName+genArity+XmlDocArgsEnc g (formalTypars, fmtps) args) + Some (ccuFileName, "M:"+actualTypeName+"."+normalizedName+genericArity+XmlDocArgsEnc g (formalTypars, fmtps) args) | DefaultStructCtor(g, ty) -> match tryTcrefOfAppTy g ty with @@ -1096,7 +1096,7 @@ let GetXmlDocSigOfValRef g (vref: ValRef) = let ccuFileName = vref.nlr.Ccu.FileName let v = vref.Deref if v.XmlDocSig = "" && v.HasDeclaringEntity then - v.XmlDocSig <- XmlDocSigOfVal g false vref.TopValDeclaringEntity.CompiledRepresentationForNamedType.Name v + v.XmlDocSig <- XmlDocSigOfVal g false vref.DeclaringEntity.CompiledRepresentationForNamedType.Name v Some (ccuFileName, v.XmlDocSig) else match vref.ApparentEnclosingEntity with diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 7c8c07cb883..8f89c68d55e 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -1219,7 +1219,7 @@ let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, d if Option.isSome eventInfoOpt then None else - tryDestTopLambda g amap valReprInfo (delFuncExpr, delFuncTy) + tryDestLambdaWithValReprInfo g amap valReprInfo (delFuncExpr, delFuncTy) match lambdaContents with | None -> @@ -1244,7 +1244,7 @@ let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, d delArgVals, expr | Some _ -> - let _, _, _, vsl, body, _ = IteratedAdjustArityOfLambda g amap valReprInfo delFuncExpr + let _, _, _, vsl, body, _ = IteratedAdjustLambdaToMatchValReprInfo g amap valReprInfo delFuncExpr List.concat vsl, body let meth = TObjExprMethod(slotsig, [], [], [delArgVals], expr, m) diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 7c5e9934a77..618c66df399 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -182,8 +182,10 @@ module DispatchSlotChecking = // Dissect the type. The '0' indicates there are no enclosing generic class type parameters relevant here. let tps, _, argInfos, retTy, _ = GetMemberTypeInMemberForm g memberFlags arityInfo 0 ty id.idRange let argTys = argInfos |> List.mapSquared fst + // Dissect the implementation - let _, ctorThisValOpt, baseValOpt, vsl, rhsExpr, _ = destTopLambda g amap arityInfo (rhsExpr, ty) + let _, ctorThisValOpt, baseValOpt, vsl, rhsExpr, _ = destLambdaWithValReprInfo g amap arityInfo (rhsExpr, ty) + assert ctorThisValOpt.IsNone // Drop 'this' @@ -927,9 +929,9 @@ let GetAbstractMethInfosForSynMethodDecl(infoReader: InfoReader, ad, memberName: | ty, None -> GetIntrinsicMethInfosOfType infoReader (Some memberName.idText) ad AllowMultiIntfInstantiations.Yes IgnoreOverrides bindm ty let dispatchSlots = minfos |> List.filter (fun minfo -> minfo.IsDispatchSlot) - let topValSynArities = SynInfo.AritiesOfArgs valSynData - let topValSynArities = if List.isEmpty topValSynArities then topValSynArities else topValSynArities.Tail - let dispatchSlotsArityMatch = dispatchSlots |> List.filter (fun minfo -> minfo.NumArgs = topValSynArities) + let valReprSynArities = SynInfo.AritiesOfArgs valSynData + let valReprSynArities = if List.isEmpty valReprSynArities then valReprSynArities else valReprSynArities.Tail + let dispatchSlotsArityMatch = dispatchSlots |> List.filter (fun minfo -> minfo.NumArgs = valReprSynArities) dispatchSlots, dispatchSlotsArityMatch /// Get the properties relevant to determining if a uniquely-identified-override exists based on the syntactic information diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 5972ccf30fb..60b5e2aac52 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -1219,7 +1219,7 @@ let CompilePatternBasic let v, vExpr = mkCompGenLocal m "typeTestResult" tgtTy if origInputVal.IsMemberOrModuleBinding then - AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData + AdjustValToHaveValReprInfo v origInputVal.TryDeclaringEntity ValReprInfo.emptyValData let argExpr = GetSubExprOfInput subexpr let appExpr = mkIsInst tgtTy argExpr mMatch Some vExpr, Some(mkInvisibleBind v appExpr) @@ -1239,7 +1239,7 @@ let CompilePatternBasic | None -> Some addrExp, None | Some (v, e) -> if origInputVal.IsMemberOrModuleBinding then - AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData + AdjustValToHaveValReprInfo v origInputVal.TryDeclaringEntity ValReprInfo.emptyValData Some addrExp, Some (mkInvisibleBind v e) @@ -1255,7 +1255,7 @@ let CompilePatternBasic let ucaseTy = (mkProvenUnionCaseTy g.cons_ucref tinst) let v, vExpr = mkCompGenLocal m "unionTestResult" ucaseTy if origInputVal.IsMemberOrModuleBinding then - AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData + AdjustValToHaveValReprInfo v origInputVal.DeclaringEntity ValReprInfo.emptyValData let argExpr = GetSubExprOfInput subexpr let appExpr = mkIsInst ucaseTy argExpr mMatch Some vExpr, Some (mkInvisibleBind v appExpr) @@ -1276,11 +1276,11 @@ let CompilePatternBasic | None -> let v, vExpr = mkCompGenLocal m ("activePatternResult" + string (newUnique())) resTy if origInputVal.IsMemberOrModuleBinding then - AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData + AdjustValToHaveValReprInfo v origInputVal.TryDeclaringEntity ValReprInfo.emptyValData Some vExpr, Some(mkInvisibleBind v addrExp) | Some (v, e) -> if origInputVal.IsMemberOrModuleBinding then - AdjustValToTopVal v origInputVal.DeclaringEntity ValReprInfo.emptyValData + AdjustValToHaveValReprInfo v origInputVal.TryDeclaringEntity ValReprInfo.emptyValData Some addrExp, Some (mkInvisibleBind v e) | _ -> None, None diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index d8bca9c223c..035e5a237ce 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -807,7 +807,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (ctxt: PermitB let isCallOfConstructorOfAbstractType = (match vFlags with NormalValUse -> true | _ -> false) && vref.IsConstructor && - (match vref.DeclaringEntity with Parent tcref -> isAbstractTycon tcref.Deref | _ -> false) + (match vref.TryDeclaringEntity with Parent tcref -> isAbstractTycon tcref.Deref | _ -> false) if isCallOfConstructorOfAbstractType then errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(), m)) @@ -1715,7 +1715,7 @@ and CheckLambdas isTop (memberVal: Val option) cenv env inlined valReprInfo alwa | Expr.Lambda (_, _, _, _, _, m, _) | Expr.TyLambda (_, _, _, m, _) -> - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g cenv.amap valReprInfo (expr, ety) + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destLambdaWithValReprInfo g cenv.amap valReprInfo (expr, ety) let env = BindTypars g env tps let thisAndBase = Option.toList ctorThisValOpt @ Option.toList baseValOpt let restArgs = List.concat vsl @@ -2007,7 +2007,7 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin // Check accessibility if (v.IsMemberOrModuleBinding || v.IsMember) && not v.IsIncrClassGeneratedMember then - let access = AdjustAccess (IsHiddenVal env.sigToImplRemapInfo v) (fun () -> v.TopValDeclaringEntity.CompilationPath) v.Accessibility + let access = AdjustAccess (IsHiddenVal env.sigToImplRemapInfo v) (fun () -> v.DeclaringEntity.CompilationPath) v.Accessibility CheckTypeForAccess cenv env (fun () -> NicePrint.stringOfQualifiedValOrMember cenv.denv cenv.infoReader vref) access v.Range v.Type let env = if v.IsConstructor && not v.IsIncrClassConstructor then { env with ctorLimitedZone=true } else env @@ -2035,7 +2035,7 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin // Also check the enclosing type for members - for historical reasons, in the TAST member values // are stored in the entity that encloses the type, hence we will not have noticed the ReflectedDefinition // on the enclosing type at this point. - HasFSharpAttribute g g.attrib_ReflectedDefinitionAttribute v.TopValDeclaringEntity.Attribs) then + HasFSharpAttribute g g.attrib_ReflectedDefinitionAttribute v.DeclaringEntity.Attribs) then if v.IsInstanceMember && v.MemberApparentEntity.IsStructOrEnumTycon then errorR(Error(FSComp.SR.chkNoReflectedDefinitionOnStructMember(), v.Range)) @@ -2132,10 +2132,10 @@ let CheckModuleBinding cenv env (TBind(v, e, _) as bind) = // Skip explicit implementations of interface methods if ValIsExplicitImpl g v then () else - match v.DeclaringEntity with + match v.TryDeclaringEntity with | ParentNone -> () // this case can happen after error recovery from earlier error | Parent _ -> - let tcref = v.TopValDeclaringEntity + let tcref = v.DeclaringEntity let hasDefaultAugmentation = tcref.IsUnionTycon && match TryFindFSharpAttribute g g.attrib_DefaultAugmentationAttribute tcref.Attribs with @@ -2483,7 +2483,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = for vref in abstractSlotValsOfTycons [tycon] do match vref.ValReprInfo with | Some valReprInfo -> - let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m + let tps, argTysl, retTy, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type m let env = BindTypars g env tps for argTys in argTysl do for argTy, _ in argTys do diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index 089de7b4a7f..949cc59de7c 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -174,7 +174,7 @@ let (|ModuleValueOrMemberUse|_|) g expr = Some(vref, vFlags, f, fty, tyargs, actualArgs @ args) | Expr.App (f, _fTy, [], actualArgs, _) -> loop f (actualArgs @ args) - | Expr.Val (vref, vFlags, _m) as f when (match vref.DeclaringEntity with ParentNone -> false | _ -> true) -> + | Expr.Val (vref, vFlags, _m) as f when (match vref.TryDeclaringEntity with ParentNone -> false | _ -> true) -> let fty = tyOfExpr g f Some(vref, vFlags, f, fty, [], args) | _ -> @@ -323,7 +323,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // This is an application of a module value or extension member let arities = arityOfVal vref.Deref let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref - let tps, witnessInfos, curriedArgInfos, retTy, _ = GetTopValTypeInCompiledForm g arities numEnclosingTypars vref.Type m + let tps, witnessInfos, curriedArgInfos, retTy, _ = GetValReprTypeInCompiledForm g arities numEnclosingTypars vref.Type m false, tps, witnessInfos, curriedArgInfos, retTy // Compute the object arguments as they appear in a compiled call @@ -353,7 +353,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | None -> error(InternalError("no arity information found for F# value " + vref.LogicalName, vref.Range)) | Some a -> a - let expr, exprTy = AdjustValForExpectedArity g m vref vFlags valReprInfo + let expr, exprTy = AdjustValForExpectedValReprInfo g m vref vFlags valReprInfo ConvExpr cenv env (MakeApplicationAndBetaReduce g (expr, exprTy, [tyargs], curriedArgs, m)) else // Too many arguments? Chop @@ -385,7 +385,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let subCall = if isMember then - let parentTyconR = ConvTyconRef cenv vref.TopValDeclaringEntity m + let parentTyconR = ConvTyconRef cenv vref.DeclaringEntity m let isNewObj = isNewObj || valUseFlags || isSelfInit // The signature types are w.r.t. to the formal context let envinner = BindFormalTypars env tps @@ -636,7 +636,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | TOp.LValueOp (LSet, vref), [], [e] -> // Sets of module values become property sets - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref when IsCompiledAsStaticProperty g vref.Deref -> let parentTyconR = ConvTyconRef cenv tcref m let propName = vref.CompiledName g.CompilerGlobalState @@ -901,7 +901,7 @@ and ConvModuleValueApp cenv env m (vref:ValRef) tyargs witnessArgs (args: Expr l EmitDebugInfoIfNecessary cenv env m (ConvModuleValueAppCore cenv env m vref tyargs witnessArgs args) and ConvModuleValueAppCore cenv env m (vref: ValRef) tyargs witnessArgsR (curriedArgs: Expr list list) = - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | ParentNone -> failwith "ConvModuleValueAppCore" | Parent(tcref) -> let isProperty = IsCompiledAsStaticProperty cenv.g vref.Deref @@ -938,7 +938,7 @@ and private ConvValRefCore holeOk cenv env m (vref: ValRef) tyargs = QP.mkThisVar(ConvType cenv env m v.Type) else let vTy = v.Type - match v.DeclaringEntity with + match v.TryDeclaringEntity with | ParentNone -> // References to local values are embedded by value if not holeOk then wfail(Error(FSComp.SR.crefNoSetOfHole(), m)) @@ -1264,7 +1264,7 @@ let ConvExprPublic cenv suppressWitnesses e = let ConvMethodBase cenv env (methName, v: Val) = let m = v.Range - let parentTyconR = ConvTyconRef cenv v.TopValDeclaringEntity m + let parentTyconR = ConvTyconRef cenv v.DeclaringEntity m match v.MemberInfo with | Some vspr when not v.IsExtensionMember -> @@ -1300,7 +1300,7 @@ let ConvMethodBase cenv env (methName, v: Val) = | _ when v.IsExtensionMember -> let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let tps, witnessInfos, argInfos, retTy, _ = GetTopValTypeInCompiledForm cenv.g v.ValReprInfo.Value numEnclosingTypars v.Type v.Range + let tps, witnessInfos, argInfos, retTy, _ = GetValReprTypeInCompiledForm cenv.g v.ValReprInfo.Value numEnclosingTypars v.Type v.Range let argTys = argInfos |> List.concat |> List.map fst let envinner = BindFormalTypars env tps let witnessArgTysR = ConvTypes cenv envinner m (GenWitnessTys cenv.g witnessInfos) @@ -1317,7 +1317,7 @@ let ConvMethodBase cenv env (methName, v: Val) = | _ -> let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let tps, witnessInfos, _argInfos, _retTy, _ = GetTopValTypeInCompiledForm cenv.g v.ValReprInfo.Value numEnclosingTypars v.Type v.Range + let tps, witnessInfos, _argInfos, _retTy, _ = GetValReprTypeInCompiledForm cenv.g v.ValReprInfo.Value numEnclosingTypars v.Type v.Range let envinner = BindFormalTypars env tps let witnessArgTysR = ConvTypes cenv envinner m (GenWitnessTys cenv.g witnessInfos) let nWitnesses = witnessArgTysR.Length diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index d714e1b1a60..90d5bed1fcb 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -228,9 +228,11 @@ let ChooseTyparSolutionsForFreeChoiceTypars g amap e = | _ -> e -/// Break apart lambdas. Needs ChooseTyparSolutionsForFreeChoiceTypars because it's used in +/// Break apart lambdas according to a given expected ValReprInfo that the lambda implements. +/// Needs ChooseTyparSolutionsForFreeChoiceTypars because it's used in /// PostTypeCheckSemanticChecks before we've eliminated these nodes. -let tryDestTopLambda g amap (ValReprInfo (tpNames, _, _) as tvd) (e, ty) = +let tryDestLambdaWithValReprInfo g amap valReprInfo (lambdaExpr, ty) = + let (ValReprInfo (tpNames, _, _)) = valReprInfo let rec stripLambdaUpto n (e, ty) = match stripDebugPoints e with | Expr.Lambda (_, None, None, v, b, _, retTy) when n > 0 -> @@ -249,20 +251,23 @@ let tryDestTopLambda g amap (ValReprInfo (tpNames, _, _) as tvd) (e, ty) = | _ -> (None, None, [], e, ty) - let n = tvd.NumCurriedArgs + let n = valReprInfo.NumCurriedArgs + let tps, bodyExpr, bodyTy = - match stripDebugPoints e with + match stripDebugPoints lambdaExpr with | Expr.TyLambda (_, tps, b, _, retTy) when not (isNil tpNames) -> tps, b, retTy - | _ -> [], e, ty + | _ -> [], lambdaExpr, ty + let ctorThisValOpt, baseValOpt, vsl, body, retTy = startStripLambdaUpto n (bodyExpr, bodyTy) + if vsl.Length <> n then None else Some (tps, ctorThisValOpt, baseValOpt, vsl, body, retTy) -let destTopLambda g amap valReprInfo (e, ty) = - match tryDestTopLambda g amap valReprInfo (e, ty) with - | None -> error(Error(FSComp.SR.typrelInvalidValue(), e.Range)) +let destLambdaWithValReprInfo g amap valReprInfo (lambdaExpr, ty) = + match tryDestLambdaWithValReprInfo g amap valReprInfo (lambdaExpr, ty) with + | None -> error(Error(FSComp.SR.typrelInvalidValue(), lambdaExpr.Range)) | Some res -> res let IteratedAdjustArityOfLambdaBody g arities vsl body = @@ -270,16 +275,22 @@ let IteratedAdjustArityOfLambdaBody g arities vsl body = let vs, body = AdjustArityOfLambdaBody g arities vs body vs :: allvs, body) -/// Do AdjustArityOfLambdaBody for a series of -/// iterated lambdas, producing one method. +/// Do IteratedAdjustArityOfLambdaBody for a series of iterated lambdas, producing one method. /// The required iterated function arity (List.length valReprInfo) must be identical /// to the iterated function arity of the input lambda (List.length vsl) -let IteratedAdjustArityOfLambda g amap valReprInfo e = - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destTopLambda g amap valReprInfo (e, tyOfExpr g e) +let IteratedAdjustLambdaToMatchValReprInfo g amap valReprInfo lambdaExpr = + + let lambdaExprTy = tyOfExpr g lambdaExpr + + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = destLambdaWithValReprInfo g amap valReprInfo (lambdaExpr, lambdaExprTy) + let arities = valReprInfo.AritiesOfArgs + if arities.Length <> vsl.Length then - errorR(InternalError(sprintf "IteratedAdjustArityOfLambda, List.length arities = %d, List.length vsl = %d" arities.Length vsl.Length, body.Range)) + errorR(InternalError(sprintf "IteratedAdjustLambdaToMatchValReprInfo, #arities = %d, #vsl = %d" arities.Length vsl.Length, body.Range)) + let vsl, body = IteratedAdjustArityOfLambdaBody g arities vsl body + tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy /// "Single Feasible Type" inference @@ -287,5 +298,3 @@ let IteratedAdjustArityOfLambda g amap valReprInfo e = let FindUniqueFeasibleSupertype g amap m ty1 ty2 = let supertypes = Option.toList (GetSuperTypeOfType g amap m ty2) @ (GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes g amap m ty2) supertypes |> List.tryFind (TypeFeasiblySubsumesType 0 g amap m ty1 NoCoerce) - - diff --git a/src/Compiler/Checking/TypeRelations.fsi b/src/Compiler/Checking/TypeRelations.fsi index cdaa7aab8a6..b33852fae53 100644 --- a/src/Compiler/Checking/TypeRelations.fsi +++ b/src/Compiler/Checking/TypeRelations.fsi @@ -51,30 +51,28 @@ val IterativelySubstituteTyparSolutions: g: TcGlobals -> tps: Typars -> solution val ChooseTyparSolutionsForFreeChoiceTypars: g: TcGlobals -> amap: ImportMap -> e: Expr -> Expr -/// Break apart lambdas. Needs ChooseTyparSolutionsForFreeChoiceTypars because it's used in -/// PostTypeCheckSemanticChecks before we've eliminated these nodes. -val tryDestTopLambda: +/// Break apart lambdas according to a given expected ValReprInfo that the lambda implements. +val tryDestLambdaWithValReprInfo: g: TcGlobals -> amap: ImportMap -> - ValReprInfo -> - e: Expr * ty: TType -> + valReprInfo: ValReprInfo -> + lambdaExpr: Expr * ty: TType -> (Typars * Val option * Val option * Val list list * Expr * TType) option -val destTopLambda: +/// Break apart lambdas according to a given expected ValReprInfo that the lambda implements. +val destLambdaWithValReprInfo: g: TcGlobals -> amap: ImportMap -> valReprInfo: ValReprInfo -> - e: Expr * ty: TType -> + lambdaExpr: Expr * ty: TType -> Typars * Val option * Val option * Val list list * Expr * TType -/// Do AdjustArityOfLambdaBody for a series of iterated lambdas, producing one method. -/// The required iterated function arity (List.length valReprInfo) must be identical -/// to the iterated function arity of the input lambda (List.length vsl) -val IteratedAdjustArityOfLambda: +/// Adjust a lambda expression to match the argument counts expected in the ValReprInfo +val IteratedAdjustLambdaToMatchValReprInfo: g: TcGlobals -> amap: ImportMap -> valReprInfo: ValReprInfo -> - e: Expr -> + lambdaExpr: Expr -> Typars * Val option * Val option * Val list list * Expr * TType /// "Single Feasible Type" inference diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 10c8d6fd5a4..f77563eae62 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -118,14 +118,14 @@ let private AnalyzeTypeOfMemberVal isCSharpExt g (ty, vref: ValRef) = /// Get the object type for a member value which is an extension method (C#-style or F#-style) let private GetObjTypeOfInstanceExtensionMethod g (vref: ValRef) = let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref - let _, _, curriedArgInfos, _, _ = GetTopValTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type vref.Range + let _, _, curriedArgInfos, _, _ = GetValReprTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type vref.Range curriedArgInfos.Head.Head |> fst /// Get the object type for a member value, which might be a C#-style extension method let private GetArgInfosOfMember isCSharpExt g (vref: ValRef) = if isCSharpExt then let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref - let _, _, curriedArgInfos, _, _ = GetTopValTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type vref.Range + let _, _, curriedArgInfos, _, _ = GetValReprTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type vref.Range [ curriedArgInfos.Head.Tail ] else ArgInfosOfMember g vref @@ -596,7 +596,7 @@ type MethInfo = member x.DeclaringTyconRef = match x with | ILMeth(_, ilminfo, _) when x.IsExtensionMember -> ilminfo.DeclaringTyconRef - | FSMeth(_, _, vref, _) when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.TopValDeclaringEntity + | FSMeth(_, _, vref, _) when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.DeclaringEntity | _ -> x.ApparentEnclosingTyconRef /// Get the information about provided static parameters, if any @@ -1666,7 +1666,7 @@ type PropInfo = /// holding the value for the extension method. member x.DeclaringTyconRef = match x.ArbitraryValRef with - | Some vref when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.TopValDeclaringEntity + | Some vref when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.DeclaringEntity | _ -> x.ApparentEnclosingTyconRef /// Try to get an arbitrary F# ValRef associated with the member. This is to determine if the member is virtual, amongst other things. @@ -2114,7 +2114,7 @@ type EventInfo = /// holding the value for the extension method. member x.DeclaringTyconRef = match x.ArbitraryValRef with - | Some vref when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.TopValDeclaringEntity + | Some vref when x.IsExtensionMember && vref.HasDeclaringEntity -> vref.DeclaringEntity | _ -> x.ApparentEnclosingTyconRef /// Indicates if this event has an associated XML comment authored in this assembly. diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 40b96f22861..28d06545589 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1360,13 +1360,13 @@ let GetMethodSpecForMemberVal cenv (memberInfo: ValMemberInfo) (vref: ValRef) = let tps, witnessInfos, curriedArgInfos, returnTy, retInfo = assert vref.ValReprInfo.IsSome - GetTopValTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type m + GetValReprTypeInCompiledForm g vref.ValReprInfo.Value numEnclosingTypars vref.Type m let tyenvUnderTypars = TypeReprEnv.Empty.ForTypars tps let flatArgInfos = List.concat curriedArgInfos let isCtor = (memberInfo.MemberFlags.MemberKind = SynMemberKind.Constructor) let cctor = (memberInfo.MemberFlags.MemberKind = SynMemberKind.ClassConstructor) - let parentTcref = vref.TopValDeclaringEntity + let parentTcref = vref.DeclaringEntity let parentTypars = parentTcref.TyparsNoRange let numParentTypars = parentTypars.Length @@ -1538,7 +1538,7 @@ let ComputeStorageForFSharpFunctionOrFSharpExtensionMember (cenv: cenv) cloc val let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref let tps, witnessInfos, curriedArgInfos, returnTy, retInfo = - GetTopValTypeInCompiledForm g valReprInfo numEnclosingTypars vref.Type m + GetValReprTypeInCompiledForm g valReprInfo numEnclosingTypars vref.Type m let tyenvUnderTypars = TypeReprEnv.Empty.ForTypars tps let methodArgTys, paramInfos = curriedArgInfos |> List.concat |> List.unzip @@ -1568,7 +1568,7 @@ let IsFSharpValCompiledAsMethod g (v: Val) = | Some valReprInfo -> not (isUnitTy g v.Type && not v.IsMemberOrModuleBinding && not v.IsMutable) && not v.IsCompiledAsStaticPropertyWithoutField - && match GetTopValTypeInFSharpForm g valReprInfo v.Type v.Range with + && match GetValReprTypeInFSharpForm g valReprInfo v.Type v.Range with | [], [], _, _ when not v.IsMember -> false | _ -> true @@ -1577,7 +1577,7 @@ let IsFSharpValCompiledAsMethod g (v: Val) = /// If it's a function or is polymorphic, then it gets represented as a /// method (possibly and instance method). Otherwise it gets represented as a /// static field and property. -let ComputeStorageForTopVal +let ComputeStorageForValWithValReprInfo ( cenv, g, @@ -1593,7 +1593,14 @@ let ComputeStorageForTopVal else let valReprInfo = match vref.ValReprInfo with - | None -> error (InternalError("ComputeStorageForTopVal: no arity found for " + showL (valRefL vref), vref.Range)) + | None -> + error ( + InternalError( + "ComputeStorageForValWithValReprInfo: no ValReprInfo found for " + + showL (valRefL vref), + vref.Range + ) + ) | Some a -> a let m = vref.Range @@ -1611,9 +1618,9 @@ let ComputeStorageForTopVal // Determine when a static field is required. // - // REVIEW: This call to GetTopValTypeInFSharpForm is only needed to determine if this is a (type) function or a value + // REVIEW: This call to GetValReprTypeInFSharpForm is only needed to determine if this is a (type) function or a value // We should just look at the arity - match GetTopValTypeInFSharpForm g valReprInfo vref.Type vref.Range with + match GetValReprTypeInFSharpForm g valReprInfo vref.Type vref.Range with | [], [], returnTy, _ when not vref.IsMember -> ComputeStorageForFSharpValue cenv g cloc optIntraAssemblyInfo optShadowLocal isInteractive returnTy vref m | _ -> @@ -1622,17 +1629,17 @@ let ComputeStorageForTopVal | _ -> ComputeStorageForFSharpFunctionOrFSharpExtensionMember cenv cloc valReprInfo vref m /// Determine how an F#-declared value, function or member is represented, if it is in the assembly being compiled. -let ComputeAndAddStorageForLocalTopVal (cenv, g, intraAssemblyFieldTable, isInteractive, optShadowLocal) cloc (v: Val) eenv = +let ComputeAndAddStorageForLocalValWithValReprInfo (cenv, g, intraAssemblyFieldTable, isInteractive, optShadowLocal) cloc (v: Val) eenv = let storage = - ComputeStorageForTopVal(cenv, g, Some intraAssemblyFieldTable, isInteractive, optShadowLocal, mkLocalValRef v, cloc) + ComputeStorageForValWithValReprInfo(cenv, g, Some intraAssemblyFieldTable, isInteractive, optShadowLocal, mkLocalValRef v, cloc) AddStorageForVal g (v, notlazy storage) eenv /// Determine how an F#-declared value, function or member is represented, if it is an external assembly. -let ComputeStorageForNonLocalTopVal cenv g cloc modref (v: Val) = +let ComputeStorageForNonLocalVal cenv g cloc modref (v: Val) = match v.ValReprInfo with - | None -> error (InternalError("ComputeStorageForNonLocalTopVal, expected an arity for " + v.LogicalName, v.Range)) - | Some _ -> ComputeStorageForTopVal(cenv, g, None, false, NoShadowLocal, mkNestedValRef modref v, cloc) + | None -> error (InternalError("ComputeStorageForNonLocalVal, expected an ValReprInfo for " + v.LogicalName, v.Range)) + | Some _ -> ComputeStorageForValWithValReprInfo(cenv, g, None, false, NoShadowLocal, mkNestedValRef modref v, cloc) /// Determine how all the F#-declared top level values, functions and members are represented, for an external module or namespace. let rec AddStorageForNonLocalModuleOrNamespaceRef cenv g cloc acc (modref: ModuleOrNamespaceRef) (modul: ModuleOrNamespace) = @@ -1649,7 +1656,7 @@ let rec AddStorageForNonLocalModuleOrNamespaceRef cenv g cloc acc (modref: Modul let acc = (acc, modul.ModuleOrNamespaceType.AllValsAndMembers) - ||> Seq.fold (fun acc v -> AddStorageForVal g (v, lazy (ComputeStorageForNonLocalTopVal cenv g cloc modref v)) acc) + ||> Seq.fold (fun acc v -> AddStorageForVal g (v, lazy (ComputeStorageForNonLocalVal cenv g cloc modref v)) acc) acc @@ -1673,16 +1680,20 @@ let AddStorageForExternalCcu cenv g eenv (ccu: CcuThunk) = let eref = ERefNonLocalPreResolved ccu.Contents (mkNonLocalEntityRef ccu [||]) (eenv, ccu.Contents.ModuleOrNamespaceType.AllValsAndMembers) - ||> Seq.fold (fun acc v -> AddStorageForVal g (v, lazy (ComputeStorageForNonLocalTopVal cenv g cloc eref v)) acc) + ||> Seq.fold (fun acc v -> AddStorageForVal g (v, lazy (ComputeStorageForNonLocalVal cenv g cloc eref v)) acc) eenv /// Record how all the top level F#-declared values, functions and members are represented, for a local module or namespace. -let rec AddBindingsForLocalModuleType allocVal cloc eenv (mty: ModuleOrNamespaceType) = +let rec AddBindingsForLocalModuleOrNamespaceType allocVal cloc eenv (mty: ModuleOrNamespaceType) = let eenv = List.fold (fun eenv submodul -> - AddBindingsForLocalModuleType allocVal (CompLocForSubModuleOrNamespace cloc submodul) eenv submodul.ModuleOrNamespaceType) + AddBindingsForLocalModuleOrNamespaceType + allocVal + (CompLocForSubModuleOrNamespace cloc submodul) + eenv + submodul.ModuleOrNamespaceType) eenv mty.ModuleAndNamespaceDefinitions @@ -1753,20 +1764,25 @@ let AddDebugImportsToEnv (cenv: cenv) eenv (openDecls: OpenDeclaration list) = imports = Some { Parent = None; Imports = imports } } -let rec AddBindingsForModuleContents allocVal cloc eenv x = +let rec AddBindingsForModuleOrNamespaceContents allocVal cloc eenv x = match x with | TMDefRec (_isRec, _opens, tycons, mbinds, _) -> // Virtual don't have 'let' bindings and must be added to the environment let eenv = List.foldBack (AddBindingsForTycon allocVal cloc) tycons eenv - let eenv = List.foldBack (AddBindingsForModuleBinding allocVal cloc) mbinds eenv + + let eenv = + List.foldBack (AddBindingsForModuleOrNamespaceBinding allocVal cloc) mbinds eenv + eenv | TMDefLet (bind, _) -> allocVal cloc bind.Var eenv | TMDefDo _ -> eenv | TMDefOpens _ -> eenv - | TMDefs mdefs -> (eenv, mdefs) ||> List.fold (AddBindingsForModuleContents allocVal cloc) + | TMDefs mdefs -> + (eenv, mdefs) + ||> List.fold (AddBindingsForModuleOrNamespaceContents allocVal cloc) /// Record how constructs are represented, for a module or namespace. -and AddBindingsForModuleBinding allocVal cloc x eenv = +and AddBindingsForModuleOrNamespaceBinding allocVal cloc x eenv = match x with | ModuleOrNamespaceBinding.Binding bind -> allocVal cloc bind.Var eenv | ModuleOrNamespaceBinding.Module (mspec, mdef) -> @@ -1776,10 +1792,7 @@ and AddBindingsForModuleBinding allocVal cloc x eenv = else CompLocForFixedModule cloc.QualifiedNameOfFile cloc.TopImplQualifiedName mspec - AddBindingsForModuleContents allocVal cloc eenv mdef - -/// Record how constructs are represented, for the values and functions defined in a module or namespace fragment. -and AddBindingsForModuleTopVals _g allocVal _cloc eenv vs = List.foldBack allocVal vs eenv + AddBindingsForModuleOrNamespaceContents allocVal cloc eenv mdef /// Put the partial results for a generated fragment (i.e. a part of a CCU generated by FSI) /// into the stored results for the whole CCU. @@ -1799,7 +1812,7 @@ let AddIncrementalLocalAssemblyFragmentToIlxGenEnv let cloc = CompLocForFragment fragName ccu let allocVal = - ComputeAndAddStorageForLocalTopVal(cenv, g, intraAssemblyInfo, true, NoShadowLocal) + ComputeAndAddStorageForLocalValWithValReprInfo(cenv, g, intraAssemblyInfo, true, NoShadowLocal) (eenv, implFiles) ||> List.fold (fun eenv implFile -> @@ -1812,9 +1825,9 @@ let AddIncrementalLocalAssemblyFragmentToIlxGenEnv } if isIncrementalFragment then - AddBindingsForModuleContents allocVal cloc eenv contents + AddBindingsForModuleOrNamespaceContents allocVal cloc eenv contents else - AddBindingsForLocalModuleType allocVal cloc eenv signature) + AddBindingsForLocalModuleOrNamespaceType allocVal cloc eenv signature) //-------------------------------------------------------------------------- // Generate debugging marks @@ -4188,7 +4201,7 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = match storage with | Method (valReprInfo, vref, _, _, _, _, _, _, _, _, _, _) -> - (let tps, argTys, _, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m + (let tps, argTys, _, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type m tps.Length = tyargs.Length && argTys.Length <= curriedArgs.Length) | _ -> false) -> @@ -4203,7 +4216,7 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = let actualRetTy = applyTys cenv.g vref.Type (tyargs, nowArgs) let _, witnessInfos, curriedArgInfos, returnTy, _ = - GetTopValTypeInCompiledForm cenv.g valReprInfo ctps.Length vref.Type m + GetValReprTypeInCompiledForm cenv.g valReprInfo ctps.Length vref.Type m let mspec = let generateWitnesses = ComputeGenerateWitnesses g eenv @@ -8142,11 +8155,11 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = // The initialization code for static 'let' and 'do' bindings gets compiled into the initialization .cctor for the whole file | _ when vspec.IsClassConstructor - && isNil vspec.TopValDeclaringEntity.TyparsNoRange + && isNil vspec.DeclaringEntity.TyparsNoRange && not isStateVar -> let tps, _, _, _, cctorBody, _ = - IteratedAdjustArityOfLambda g cenv.amap vspec.ValReprInfo.Value rhsExpr + IteratedAdjustLambdaToMatchValReprInfo g cenv.amap vspec.ValReprInfo.Value rhsExpr let eenv = EnvForTypars tps eenv CommitStartScope cgbuf startMarkOpt @@ -8155,7 +8168,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = | Method (valReprInfo, _, mspec, mspecW, _, ctps, mtps, curriedArgInfos, paramInfos, witnessInfos, argTys, retInfo) when not isStateVar -> let methLambdaTypars, methLambdaCtorThisValOpt, methLambdaBaseValOpt, methLambdaCurriedVars, methLambdaBody, methLambdaBodyTy = - IteratedAdjustArityOfLambda g cenv.amap valReprInfo rhsExpr + IteratedAdjustLambdaToMatchValReprInfo g cenv.amap valReprInfo rhsExpr let methLambdaVars = List.concat methLambdaCurriedVars @@ -9429,7 +9442,7 @@ and GenGetStorageAndSequel (cenv: cenv) cgbuf eenv m (ty, ilTy) storage storeSeq // First build a lambda expression for the saturated use of the toplevel value... // REVIEW: we should NOT be doing this in the backend... - let expr, exprTy = AdjustValForExpectedArity g m vref NormalValUse valReprInfo + let expr, exprTy = AdjustValForExpectedValReprInfo g m vref NormalValUse valReprInfo // Then reduce out any arguments (i.e. apply the sequel immediately if we can...) match storeSequel with @@ -9569,9 +9582,9 @@ and AllocValForBind cenv cgbuf (scopeMarks: Mark * Mark) eenv (TBind (v, repr, _ | None -> let repr, eenv = AllocLocalVal cenv cgbuf v eenv (Some repr) scopeMarks Some repr, eenv - | Some _ -> None, AllocTopValWithinExpr cenv cgbuf (snd scopeMarks) eenv.cloc v eenv + | Some _ -> None, AllocValReprWithinExpr cenv cgbuf (snd scopeMarks) eenv.cloc v eenv -and AllocTopValWithinExpr cenv cgbuf endMark cloc v eenv = +and AllocValReprWithinExpr cenv cgbuf endMark cloc v eenv = let g = cenv.g // decide whether to use a shadow local or not @@ -9592,7 +9605,7 @@ and AllocTopValWithinExpr cenv cgbuf endMark cloc v eenv = else NoShadowLocal, eenv - ComputeAndAddStorageForLocalTopVal (cenv, g, cenv.intraAssemblyInfo, cenv.options.isInteractive, optShadowLocal) cloc v eenv + ComputeAndAddStorageForLocalValWithValReprInfo (cenv, g, cenv.intraAssemblyInfo, cenv.options.isInteractive, optShadowLocal) cloc v eenv //-------------------------------------------------------------------------- // Generate stack save/restore and assertions - pulled into letrec by alloc* @@ -9829,7 +9842,7 @@ and GenImplFileContents cenv cgbuf qname lazyInitInfo eenv mty def = // Allocate all the values, including any shadow locals for static fields let eenv = - AddBindingsForModuleContents (AllocTopValWithinExpr cenv cgbuf endMark) eenv.cloc eenv def + AddBindingsForModuleOrNamespaceContents (AllocValReprWithinExpr cenv cgbuf endMark) eenv.cloc eenv def let _eenvEnd = GenModuleOrNamespaceContents cenv cgbuf qname lazyInitInfo eenv def ()) @@ -10140,9 +10153,9 @@ and GenImplFile cenv (mgbuf: AssemblyBuilder) mainInfoOpt eenv (implFile: Checke // We add the module type all over again. Note no shadow locals for static fields needed here since they are only relevant to the main/.cctor let eenvafter = let allocVal = - ComputeAndAddStorageForLocalTopVal(cenv, g, cenv.intraAssemblyInfo, cenv.options.isInteractive, NoShadowLocal) + ComputeAndAddStorageForLocalValWithValReprInfo(cenv, g, cenv.intraAssemblyInfo, cenv.options.isInteractive, NoShadowLocal) - AddBindingsForLocalModuleType allocVal clocCcu eenv signature + AddBindingsForLocalModuleOrNamespaceType allocVal clocCcu eenv signature eenvafter @@ -11440,7 +11453,7 @@ let CodegenAssembly cenv eenv mgbuf implFiles = LocalScope "module" cgbuf (fun (_, endMark) -> let eenv = - AddBindingsForModuleContents (AllocTopValWithinExpr cenv cgbuf endMark) eenv.cloc eenv mexpr + AddBindingsForModuleOrNamespaceContents (AllocValReprWithinExpr cenv cgbuf endMark) eenv.cloc eenv mexpr let _eenvEnv = GenModuleOrNamespaceContents cenv cgbuf qname lazyInitInfo eenv mexpr ())), diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index a8e15eac7b1..a4b3620b780 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -758,7 +758,7 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap List.map (fun (v, aenv) -> mkInvisibleBind aenv (exprForVal env.m v)) let unpack = - let unpackCarrier (v, aenv) = mkInvisibleBind (setValHasNoArity v) (exprForVal env.m aenv) + let unpackCarrier (v, aenv) = mkInvisibleBind (ClearValReprInfo v) (exprForVal env.m aenv) let unpackSubenv f = let subCMap = carrierMapFor f let vaenvs = Zmap.toList subCMap @@ -947,10 +947,10 @@ module Pass4_RewriteAssembly = // pass4: lowertop - convert_vterm_bind on TopLevel binds //------------------------------------------------------------------------- - let AdjustBindToTopVal g (TBind(v, repr, _)) = + let AdjustBindToValRepr g (TBind(v, repr, _)) = match v.ValReprInfo with | None -> - v.SetValReprInfo (Some (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v repr )) + v.SetValReprInfo (Some (InferValReprInfoOfBinding g AllowTypeDirectedDetupling.Yes v repr )) // Things that don't have an arity from type inference but are top-level are compiler-generated v.SetIsCompilerGenerated(true) | Some _ -> () @@ -979,7 +979,7 @@ module Pass4_RewriteAssembly = // REVIEW: is this mutation really, really necessary? // Why are we applying TLR if the thing already has an arity? - let fOrig = setValHasNoArity fOrig + let fOrig = ClearValReprInfo fOrig let fBind = mkMultiLambdaBind g fOrig letSeqPtOpt m tps vss @@ -1028,7 +1028,7 @@ module Pass4_RewriteAssembly = | Some envp -> envp.ep_pack // environment pack bindings let forceTopBindToHaveArity penv (bind: Binding) = - if penv.topValS.Contains(bind.Var) then AdjustBindToTopVal penv.g bind + if penv.topValS.Contains(bind.Var) then AdjustBindToValRepr penv.g bind let TransBindings xisRec penv (binds: Bindings) = let tlrBs, nonTlrBs = binds |> List.partition (fun b -> Zset.contains b.Var penv.tlrS) diff --git a/src/Compiler/Optimize/LowerCalls.fs b/src/Compiler/Optimize/LowerCalls.fs index 3eebcc4437b..5cf047f7e47 100644 --- a/src/Compiler/Optimize/LowerCalls.fs +++ b/src/Compiler/Optimize/LowerCalls.fs @@ -17,7 +17,7 @@ let InterceptExpr g cont expr = match expr with | Expr.Val (vref, flags, m) -> match vref.ValReprInfo with - | Some arity -> Some (fst (AdjustValForExpectedArity g m vref flags arity)) + | Some arity -> Some (fst (AdjustValForExpectedValReprInfo g m vref flags arity)) | None -> None // App (Val v, tys, args) @@ -28,7 +28,7 @@ let InterceptExpr g cont expr = let argsl = List.map cont argsl let f0 = if valReprInfo.AritiesOfArgs.Length > argsl.Length - then fst(AdjustValForExpectedArity g m vref flags valReprInfo) + then fst(AdjustValForExpectedValReprInfo g m vref flags valReprInfo) else f0 Some (MakeApplicationAndBetaReduce g (f0, f0ty, [tyargsl], argsl, m)) diff --git a/src/Compiler/Optimize/LowerLocalMutables.fs b/src/Compiler/Optimize/LowerLocalMutables.fs index a4ff9ba8f08..320df36ce37 100644 --- a/src/Compiler/Optimize/LowerLocalMutables.fs +++ b/src/Compiler/Optimize/LowerLocalMutables.fs @@ -40,7 +40,7 @@ let DecideLambda exprF cenv valReprInfo expr exprTy z = match stripDebugPoints expr with | Expr.Lambda _ | Expr.TyLambda _ -> - let _tps, ctorThisValOpt, baseValOpt, vsl, body, _bodyty = destTopLambda cenv.g cenv.amap valReprInfo (expr, exprTy) + let _tps, ctorThisValOpt, baseValOpt, vsl, body, _bodyty = destLambdaWithValReprInfo cenv.g cenv.amap valReprInfo (expr, exprTy) let snoc = fun x y -> y :: x let args = List.concat vsl let args = Option.fold snoc args baseValOpt diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index f4462122337..368993e7cc2 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -3738,7 +3738,7 @@ and OptimizeLambdas (vspec: Val option) cenv env valReprInfo expr exprTy = | Expr.Lambda (lambdaId, _, _, _, _, m, _) | Expr.TyLambda (lambdaId, _, _, m, _) -> let env = { env with methEnv = { pipelineCount = 0 }} - let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = IteratedAdjustArityOfLambda g cenv.amap valReprInfo expr + let tps, ctorThisValOpt, baseValOpt, vsl, body, bodyTy = IteratedAdjustLambdaToMatchValReprInfo g cenv.amap valReprInfo expr let env = { env with functionVal = (match vspec with None -> None | Some v -> Some (v, valReprInfo)) } let env = Option.foldBack (BindInternalValToUnknown cenv) ctorThisValOpt env let env = Option.foldBack (BindInternalValToUnknown cenv) baseValOpt env @@ -4043,7 +4043,7 @@ and OptimizeBinding cenv isRec env (TBind(vref, expr, spBind)) = let exprOptimized, einfo = let env = if vref.IsCompilerGenerated && Option.isSome env.latestBoundId then env else {env with latestBoundId=Some vref.Id} let cenv = if vref.InlineInfo.MustInline then { cenv with optimizing=false} else cenv - let arityInfo = InferArityOfExprBinding g AllowTypeDirectedDetupling.No vref expr + let arityInfo = InferValReprInfoOfBinding g AllowTypeDirectedDetupling.No vref expr let exprOptimized, einfo = OptimizeLambdas (Some vref) cenv env arityInfo expr vref.Type let size = localVarSize exprOptimized, {einfo with FunctionSize=einfo.FunctionSize+size; TotalSize = einfo.TotalSize+size} @@ -4083,7 +4083,7 @@ and OptimizeBinding cenv isRec env (TBind(vref, expr, spBind)) = (vref.InlineInfo = ValInline.Never) || // MarshalByRef methods may not be inlined - (match vref.DeclaringEntity with + (match vref.TryDeclaringEntity with | Parent tcref -> match g.system_MarshalByRefObject_tcref with | None -> false diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index d2621715b10..73caa8c5736 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -291,7 +291,7 @@ and [] ItemKeyStoreBuilder() = writeString ItemKeyTags.parameters writeType false vref.Type - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | ParentNone -> writeChar '%' | Parent eref -> writeEntityRef eref @@ -308,7 +308,7 @@ and [] ItemKeyStoreBuilder() = writeString ItemKeyTags.itemProperty writeString vref.PropertyName - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | ParentRef.Parent parent -> writeEntityRef parent | _ -> () else diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 7d625985e2d..9491e8fa07a 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -657,7 +657,7 @@ module internal DescriptionListsImpl = | Some valReprInfo -> // ValReprInfo will exist for top-level syntactic functions // per spec: binding is considered to define a syntactic function if it is either a function or its immediate right-hand-side is a anonymous function - let _, argInfos, lastRetTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m + let _, argInfos, lastRetTy, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type m match argInfos with | [] -> // handles cases like 'let foo = List.map' diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 0de02d99948..3320dd4ec73 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -453,7 +453,7 @@ module FSharpExprConvert = | _ -> // This is an application of a module value or extension member let arities = arityOfVal vref.Deref - let tps, curriedArgInfos, _, _ = GetTopValTypeInFSharpForm g arities vref.Type m + let tps, curriedArgInfos, _, _ = GetValReprTypeInFSharpForm g arities vref.Type m false, tps, curriedArgInfos // Compute the object arguments as they appear in a compiled call @@ -476,7 +476,7 @@ module FSharpExprConvert = | None -> failwith ("no arity information found for F# value "+vref.LogicalName) | Some a -> a - let expr, exprTy = AdjustValForExpectedArity g m vref vFlags valReprInfo + let expr, exprTy = AdjustValForExpectedValReprInfo g m vref vFlags valReprInfo let splitCallExpr = MakeApplicationAndBetaReduce g (expr, exprTy, [tyargs], curriedArgs, m) // tailcall ConvExprPrimLinear cenv env splitCallExpr contF @@ -1028,7 +1028,7 @@ module FSharpExprConvert = enclosingEntity.ModuleOrNamespaceType.AllValsAndMembers |> Seq.filter (fun v -> (v.CompiledName g.CompilerGlobalState) = vName && - match v.DeclaringEntity with + match v.TryDeclaringEntity with | Parent p -> p.PublicPath = enclosingEntity.PublicPath | _ -> false ) |> List.ofSeq @@ -1356,8 +1356,8 @@ and FSharpImplementationFileContents(cenv, mimpl) = let rec getBind (bind: Binding) = let v = bind.Var assert v.IsCompiledAsTopLevel - let valReprInfo = InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v bind.Expr - let tps, _ctorThisValOpt, _baseValOpt, vsl, body, _bodyty = IteratedAdjustArityOfLambda g cenv.amap valReprInfo bind.Expr + let valReprInfo = InferValReprInfoOfBinding g AllowTypeDirectedDetupling.Yes v bind.Expr + let tps, _ctorThisValOpt, _baseValOpt, vsl, body, _bodyty = IteratedAdjustLambdaToMatchValReprInfo g cenv.amap valReprInfo bind.Expr let v = FSharpMemberOrFunctionOrValue(cenv, mkLocalValRef v) let gps = v.GenericParameters let vslR = List.mapSquared (FSharpExprConvert.ConvVal cenv) vsl diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index 1ca718d8165..f385e3575e1 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -686,7 +686,7 @@ module internal SymbolHelpers = let getKeywordForMethInfo (minfo : MethInfo) = match minfo with | FSMeth(_, _, vref, _) -> - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef) + "." + vref.CompiledName g.CompilerGlobalState |> Some | ParentNone -> None @@ -707,7 +707,7 @@ module internal SymbolHelpers = | Item.Value vref | Item.CustomBuilder (_, vref) -> let v = vref.Deref if v.IsModuleBinding && v.HasDeclaringEntity then - let tyconRef = v.TopValDeclaringEntity + let tyconRef = v.DeclaringEntity let paramsString = match v.Typars with | [] -> "" @@ -777,7 +777,7 @@ module internal SymbolHelpers = | FSProp(_, _, Some vref, _) | FSProp(_, _, _, Some vref) -> // per spec, extension members in F1 keywords are qualified with definition class - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some | ParentNone -> None @@ -800,7 +800,7 @@ module internal SymbolHelpers = match pinfo.ArbitraryValRef with | Some vref -> // per spec, members in F1 keywords are qualified with definition class - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some | ParentNone -> None | None -> None @@ -811,7 +811,7 @@ module internal SymbolHelpers = match minfos with | [] -> None | FSMeth(_, _, vref, _) :: _ -> - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef) + ".#ctor"|> Some | ParentNone -> None #if !NO_TYPEPROVIDERS diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 4f7be4cc58c..daf77871cc0 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -1307,7 +1307,7 @@ type FSharpActivePatternGroup(cenv, apinfo:ActivePatternInfo, ty, valOpt) = member _.DeclaringEntity = valOpt |> Option.bind (fun vref -> - match vref.DeclaringEntity with + match vref.TryDeclaringEntity with | ParentNone -> None | Parent tcref -> Some (FSharpEntity(cenv, tcref))) @@ -1652,7 +1652,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | P p -> FSharpEntity(cenv, p.DeclaringTyconRef) |> Some | M m | C m -> FSharpEntity(cenv, m.DeclaringTyconRef) |> Some | V v -> - match v.DeclaringEntity with + match v.TryDeclaringEntity with | ParentNone -> None | Parent p -> FSharpEntity(cenv, p) |> Some @@ -1994,7 +1994,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | Some (_, docsig) -> docsig | _ -> "" | V v -> - match v.DeclaringEntity with + match v.TryDeclaringEntity with | Parent entityRef -> match GetXmlDocSigOfScopedValRef cenv.g entityRef v with | Some (_, docsig) -> docsig @@ -2306,7 +2306,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | V vref -> let arities = arityOfVal vref.Deref let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal vref.Deref - let _tps, witnessInfos, _curriedArgInfos, _retTy, _ = GetTopValTypeInCompiledForm cenv.g arities numEnclosingTypars vref.Type vref.DefinitionRange + let _tps, witnessInfos, _curriedArgInfos, _retTy, _ = GetValReprTypeInCompiledForm cenv.g arities numEnclosingTypars vref.Type vref.DefinitionRange witnessInfos | E _ | P _ | M _ | C _ -> [] match witnessInfos with diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 80e62652f8b..47c343babd7 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2812,7 +2812,7 @@ type Val = | _ -> x.val_opt_data <- Some { Val.NewEmptyValOptData() with val_xmldocsig = v } /// The parent type or module, if any (None for expression bindings and parameters) - member x.DeclaringEntity = + member x.TryDeclaringEntity = match x.val_opt_data with | Some optData -> optData.val_declaring_entity | _ -> ParentNone @@ -2820,13 +2820,13 @@ type Val = /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member /// is declared. - member x.TopValDeclaringEntity = - match x.DeclaringEntity with + member x.DeclaringEntity = + match x.TryDeclaringEntity with | Parent tcref -> tcref - | ParentNone -> error(InternalError("TopValDeclaringEntity: does not have a parent", x.Range)) + | ParentNone -> error(InternalError("DeclaringEntity: does not have a parent", x.Range)) member x.HasDeclaringEntity = - match x.DeclaringEntity with + match x.TryDeclaringEntity with | Parent _ -> true | ParentNone -> false @@ -2848,7 +2848,7 @@ type Val = member x.ApparentEnclosingEntity = match x.MemberInfo with | Some membInfo -> Parent(membInfo.ApparentEnclosingEntity) - | None -> x.DeclaringEntity + | None -> x.TryDeclaringEntity /// Get the public path to the value, if any? Should be set if and only if /// IsMemberOrModuleBinding is set. @@ -2862,7 +2862,7 @@ type Val = // - in ilxgen.fs: as a boolean to detect public values for saving quotations // - in MakeExportRemapping, to build non-local references for values member x.PublicPath = - match x.DeclaringEntity with + match x.TryDeclaringEntity with | Parent eref -> match eref.PublicPath with | None -> None @@ -3777,7 +3777,7 @@ type ValRef = member x.Accessibility = x.Deref.Accessibility /// The parent type or module, if any (None for expression bindings and parameters) - member x.DeclaringEntity = x.Deref.DeclaringEntity + member x.TryDeclaringEntity = x.Deref.TryDeclaringEntity /// Get the apparent parent entity for the value, i.e. the entity under with which the /// value is associated. For extension members this is the nominal type the member extends. @@ -3925,7 +3925,7 @@ type ValRef = /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member /// is declared. - member x.TopValDeclaringEntity = x.Deref.TopValDeclaringEntity + member x.DeclaringEntity = x.Deref.DeclaringEntity // Can be false for members after error recovery member x.HasDeclaringEntity = x.Deref.HasDeclaringEntity diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 01103d5987a..efbda2d6561 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -769,7 +769,7 @@ type Entity = type EntityData = Entity -/// Represents the parent entity of a type definition, if any +/// Represents the declaring entity of a type definition, if any type ParentRef = | Parent of parent: EntityRef | ParentNone @@ -1917,7 +1917,7 @@ type Val = member DebugText: string /// The parent type or module, if any (None for expression bindings type parameters) - member DeclaringEntity: ParentRef + member TryDeclaringEntity: ParentRef /// Range of the definition (implementation) of the value, used by Visual Studio member DefinitionRange: range @@ -2122,7 +2122,7 @@ type Val = /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member /// is declared. - member TopValDeclaringEntity: EntityRef + member DeclaringEntity: EntityRef /// Get the generic type parameters for the value member Typars: Typars @@ -2650,8 +2650,8 @@ type ValRef = [] member DebugText: string - /// The parent type or module, if any (None for expression bindings type parameters) - member DeclaringEntity: ParentRef + /// The parent type or module, if any (ParentNone for expression bindings type parameters) + member TryDeclaringEntity: ParentRef member DefinitionRange: range @@ -2830,7 +2830,9 @@ type ValRef = /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member /// is declared. - member TopValDeclaringEntity: EntityRef + /// + /// This may fail for expression-bound values and parameters. + member DeclaringEntity: EntityRef /// Dereference the ValRef to a Val option. member TryDeref: Val voption diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index f0ad0c6e7e6..e62c6f9309d 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -1751,7 +1751,7 @@ let destTopForallTy g (ValReprInfo (ntps, _, _)) ty = let tps = NormalizeDeclaredTyparsForEquiRecursiveInference g tps tps, tau -let GetTopValTypeInFSharpForm g (ValReprInfo(_, argInfos, retInfo) as valReprInfo) ty m = +let GetValReprTypeInFSharpForm g (ValReprInfo(_, argInfos, retInfo) as valReprInfo) ty m = let tps, tau = destTopForallTy g valReprInfo ty let curriedArgTys, returnTy = GetTopTauTypeInFSharpForm g argInfos tau m tps, curriedArgTys, returnTy, retInfo @@ -1759,7 +1759,7 @@ let GetTopValTypeInFSharpForm g (ValReprInfo(_, argInfos, retInfo) as valReprInf let IsCompiledAsStaticProperty g (v: Val) = match v.ValReprInfo with | Some valReprInfoValue -> - match GetTopValTypeInFSharpForm g valReprInfoValue v.Type v.Range with + match GetValReprTypeInFSharpForm g valReprInfoValue v.Type v.Range with | [], [], _, _ when not v.IsMember -> true | _ -> false | _ -> false @@ -2464,7 +2464,7 @@ let valsOfBinds (binds: Bindings) = binds |> List.map (fun b -> b.Var) // Pull apart the type for an F# value that represents an object model method. Do not strip off a 'unit' argument. // Review: Should GetMemberTypeInFSharpForm have any other direct callers? let GetMemberTypeInFSharpForm g (memberFlags: SynMemberFlags) arities ty m = - let tps, argInfos, retTy, retInfo = GetTopValTypeInFSharpForm g arities ty m + let tps, argInfos, retTy, retInfo = GetValReprTypeInFSharpForm g arities ty m let argInfos = if memberFlags.IsInstance then @@ -2513,8 +2513,8 @@ let CountEnclosingTyparsOfActualParentOfVal (v: Val) = elif not v.IsMember then 0 else v.MemberApparentEntity.TyparsNoRange.Length -let GetTopValTypeInCompiledForm g valReprInfo numEnclosingTypars ty m = - let tps, paramArgInfos, retTy, retInfo = GetTopValTypeInFSharpForm g valReprInfo ty m +let GetValReprTypeInCompiledForm g valReprInfo numEnclosingTypars ty m = + let tps, paramArgInfos, retTy, retInfo = GetValReprTypeInFSharpForm g valReprInfo ty m let witnessInfos = GetTraitWitnessInfosOfTypars g numEnclosingTypars tps // Eliminate lone single unit arguments let paramArgInfos = @@ -5318,7 +5318,7 @@ type AllowTypeDirectedDetupling = Yes | No // This is used to infer arities of expressions // i.e. base the chosen arity on the syntactic expression shape and type of arguments -let InferArityOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttribs expr = +let InferValReprInfoOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttribs expr = let rec stripLambda_notypes e = match stripDebugPoints e with | Expr.Lambda (_, _, _, vs, b, _, _) -> @@ -5363,10 +5363,10 @@ let InferArityOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL retAttri let info = ValReprInfo (ValReprInfo.InferTyparInfo tps, curriedArgInfos, retInfo) if ValReprInfo.IsEmpty info then ValReprInfo.emptyValData else info -let InferArityOfExprBinding g allowTypeDirectedDetupling (v: Val) expr = +let InferValReprInfoOfBinding g allowTypeDirectedDetupling (v: Val) expr = match v.ValReprInfo with | Some info -> info - | None -> InferArityOfExpr g allowTypeDirectedDetupling v.Type [] [] expr + | None -> InferValReprInfoOfExpr g allowTypeDirectedDetupling v.Type [] [] expr //------------------------------------------------------------------------- // Check if constraints are satisfied that allow us to use more optimized @@ -5404,7 +5404,7 @@ let underlyingTypeOfEnumTy (g: TcGlobals) ty = | None -> error(InternalError("no 'value__' field found for enumeration type " + tycon.LogicalName, tycon.Range)) // CLEANUP NOTE: Get rid of this mutation. -let setValHasNoArity (f: Val) = +let ClearValReprInfo (f: Val) = f.SetValReprInfo None; f //-------------------------------------------------------------------------- @@ -5550,7 +5550,7 @@ and remapValData ctxt tmenv (d: ValData) = let ty = d.val_type let valReprInfo = d.ValReprInfo let tyR = ty |> remapPossibleForallTyImpl ctxt tmenv - let declaringEntityR = d.DeclaringEntity |> remapParentRef tmenv + let declaringEntityR = d.TryDeclaringEntity |> remapParentRef tmenv let reprInfoR = d.ValReprInfo |> Option.map (remapValReprInfo ctxt tmenv) let memberInfoR = d.MemberInfo |> Option.map (remapMemberInfo ctxt d.val_range valReprInfo ty tyR tmenv) let attribsR = d.Attribs |> remapAttribs ctxt tmenv @@ -8109,9 +8109,9 @@ let MakeArgsForTopArgs _g m argTysl tpenv = | Some id -> id.idText fst (mkCompGenLocal m nm ty))) -let AdjustValForExpectedArity g m (vref: ValRef) flags valReprInfo = +let AdjustValForExpectedValReprInfo g m (vref: ValRef) flags valReprInfo = - let tps, argTysl, retTy, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type m + let tps, argTysl, retTy, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type m let tpsR = copyTypars tps let tyargsR = List.map mkTyparTy tpsR let tpenv = bindTypars tps tyargsR emptyTyparInst @@ -8213,7 +8213,7 @@ let AdjustPossibleSubsumptionExpr g (expr: Expr) (suppliedArgs: Expr list) : (Ex match stripExpr exprWithActualTy with | ExprValWithPossibleTypeInst(vref, _, _, _) when vref.ValReprInfo.IsSome -> - let _, argTysl, _, _ = GetTopValTypeInFSharpForm g vref.ValReprInfo.Value vref.Type expr.Range + let _, argTysl, _, _ = GetValReprTypeInFSharpForm g vref.ValReprInfo.Value vref.Type expr.Range argTysl |> List.mapi (fun i argTys -> argTys |> List.mapi (fun j (_, argInfo) -> match argInfo.Name with @@ -8469,7 +8469,7 @@ let NormalizeAndAdjustPossibleSubsumptionExprs g inputExpr = let etaExpandTypeLambda g m tps (tm, ty) = if isNil tps then tm else mkTypeLambda m tps (mkApps g ((tm, ty), [(List.map mkTyparTy tps)], [], m), ty) -let AdjustValToTopVal (tmp: Val) parent valData = +let AdjustValToHaveValReprInfo (tmp: Val) parent valData = tmp.SetValReprInfo (Some valData) tmp.SetDeclaringEntity parent tmp.SetIsMemberOrModuleBinding() @@ -8501,7 +8501,7 @@ let LinearizeTopMatchAux g parent (spBind, m, tree, targets, m2, ty) = let tmpTy = mkRefTupledVarsTy g vs let tmp, tmpe = mkCompGenLocal m "matchResultHolder" tmpTy - AdjustValToTopVal tmp parent ValReprInfo.emptyValData + AdjustValToHaveValReprInfo tmp parent ValReprInfo.emptyValData let newTg = TTarget (fvs, mkRefTupledVars g m fvs, None) let fixup (TTarget (tvs, tx, flags)) = @@ -8517,7 +8517,7 @@ let LinearizeTopMatchAux g parent (spBind, m, tree, targets, m2, ty) = let ty = v.Type let rhs = etaExpandTypeLambda g m v.Typars (itemsProj vtys i tmpe, ty) // update the arity of the value - v.SetValReprInfo (Some (InferArityOfExpr g AllowTypeDirectedDetupling.Yes ty [] [] rhs)) + v.SetValReprInfo (Some (InferValReprInfoOfExpr g AllowTypeDirectedDetupling.Yes ty [] [] rhs)) // This binding is deliberately non-sticky - any sequence point for 'rhs' goes on 'rhs' _after_ the binding has been evaluated mkInvisibleBind v rhs) in (* vi = proj tmp *) mkCompGenLet m @@ -8629,7 +8629,7 @@ let XmlDocSigOfVal g full path (v: Val) = let parentTypars, methTypars, cxs, argInfos, retTy, prefix, path, name = // CLEANUP: this is one of several code paths that treat module values and members - // separately when really it would be cleaner to make sure GetTopValTypeInFSharpForm, GetMemberTypeInFSharpForm etc. + // separately when really it would be cleaner to make sure GetValReprTypeInFSharpForm, GetMemberTypeInFSharpForm etc. // were lined up so code paths like this could be uniform match v.MemberInfo with @@ -8648,7 +8648,7 @@ let XmlDocSigOfVal g full path (v: Val) = | SynMemberKind.PropertySet | SynMemberKind.PropertyGet -> "P:", v.PropertyName - let path = if v.HasDeclaringEntity then prependPath path v.TopValDeclaringEntity.CompiledName else path + let path = if v.HasDeclaringEntity then prependPath path v.DeclaringEntity.CompiledName else path let parentTypars, methTypars = match PartitionValTypars g v with @@ -8661,7 +8661,7 @@ let XmlDocSigOfVal g full path (v: Val) = // Regular F# values and extension members let w = arityOfVal v let numEnclosingTypars = CountEnclosingTyparsOfActualParentOfVal v - let tps, witnessInfos, argInfos, retTy, _ = GetTopValTypeInCompiledForm g w numEnclosingTypars v.Type v.Range + let tps, witnessInfos, argInfos, retTy, _ = GetValReprTypeInCompiledForm g w numEnclosingTypars v.Type v.Range let name = v.CompiledName g.CompilerGlobalState let prefix = if w.NumCurriedArgs = 0 && isNil tps then "P:" @@ -8969,7 +8969,7 @@ let isComInteropTy g ty = let ValSpecIsCompiledAsInstance g (v: Val) = match v.MemberInfo with | Some membInfo -> - // Note it doesn't matter if we pass 'v.TopValDeclaringEntity' or 'v.MemberApparentEntity' here. + // Note it doesn't matter if we pass 'v.DeclaringEntity' or 'v.MemberApparentEntity' here. // These only differ if the value is an extension member, and in that case MemberIsCompiledAsInstance always returns // false anyway MemberIsCompiledAsInstance g v.MemberApparentEntity v.IsExtensionMember membInfo v.Attribs @@ -9639,7 +9639,7 @@ let GetTypeOfIntrinsicMemberInCompiledForm g (vref: ValRef) = // Check if the thing is really an instance member compiled as a static member // If so, the object argument counts as a normal argument in the compiled form if membInfo.MemberFlags.IsInstance && not (ValRefIsCompiledAsInstanceMember g vref) then - let _, origArgInfos, _, _ = GetTopValTypeInFSharpForm g valReprInfo vref.Type vref.Range + let _, origArgInfos, _, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type vref.Range match origArgInfos with | [] -> errorR(InternalError("value does not have a valid member type", vref.Range)) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index b3e4c630476..acb6eee7361 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -749,14 +749,14 @@ val destTopForallTy: TcGlobals -> ValReprInfo -> TType -> Typars * TType val GetTopTauTypeInFSharpForm: TcGlobals -> ArgReprInfo list list -> TType -> range -> CurriedArgInfos * TType -val GetTopValTypeInFSharpForm: +val GetValReprTypeInFSharpForm: TcGlobals -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType * ArgReprInfo val IsCompiledAsStaticProperty: TcGlobals -> Val -> bool val IsCompiledAsStaticPropertyWithField: TcGlobals -> Val -> bool -val GetTopValTypeInCompiledForm: +val GetValReprTypeInCompiledForm: TcGlobals -> ValReprInfo -> int -> @@ -1167,8 +1167,8 @@ val freeVarsAllPublic: FreeVars -> bool /// Compute the type of an expression from the expression itself val tyOfExpr: TcGlobals -> Expr -> TType -/// A flag to govern whether arity inference should be type-directed or syntax-directed when -/// inferring an arity from a lambda expression. +/// A flag to govern whether ValReprInfo inference should be type-directed or syntax-directed when +/// inferring from a lambda expression. [] type AllowTypeDirectedDetupling = | Yes @@ -1178,15 +1178,15 @@ type AllowTypeDirectedDetupling = val stripTopLambda: Expr * TType -> Typars * Val list list * Expr * TType /// Given a lambda expression, extract the ValReprInfo for its arguments and other details -val InferArityOfExpr: +val InferValReprInfoOfExpr: TcGlobals -> AllowTypeDirectedDetupling -> TType -> Attribs list list -> Attribs -> Expr -> ValReprInfo /// Given a lambda binding, extract the ValReprInfo for its arguments and other details -val InferArityOfExprBinding: TcGlobals -> AllowTypeDirectedDetupling -> Val -> Expr -> ValReprInfo +val InferValReprInfoOfBinding: TcGlobals -> AllowTypeDirectedDetupling -> Val -> Expr -> ValReprInfo /// Mutate a value to indicate it should be considered a local rather than a module-bound definition // REVIEW: this mutation should not be needed -val setValHasNoArity: Val -> Val +val ClearValReprInfo: Val -> Val /// Indicate what should happen to value definitions when copying expressions type ValCopyFlag = @@ -1385,7 +1385,7 @@ val IterateRecursiveFixups: val MultiLambdaToTupledLambda: TcGlobals -> Val list -> Expr -> Val * Expr /// Given a lambda expression, adjust it to have be one or two lambda expressions (fun a -> (fun b -> ...)) -/// where the first has the given arity. +/// where the first has the given arguments. val AdjustArityOfLambdaBody: TcGlobals -> int -> Val list -> Expr -> Val list * Expr /// Make an application expression, doing beta reduction by introducing let-bindings @@ -2341,9 +2341,9 @@ val mkAnyAnonRecdTy: TcGlobals -> AnonRecdTypeInfo -> TType list -> TType val mkAnonRecd: TcGlobals -> range -> AnonRecdTypeInfo -> Ident[] -> Exprs -> TType list -> Expr -val AdjustValForExpectedArity: TcGlobals -> range -> ValRef -> ValUseFlag -> ValReprInfo -> Expr * TType +val AdjustValForExpectedValReprInfo: TcGlobals -> range -> ValRef -> ValUseFlag -> ValReprInfo -> Expr * TType -val AdjustValToTopVal: Val -> ParentRef -> ValReprInfo -> unit +val AdjustValToHaveValReprInfo: Val -> ParentRef -> ValReprInfo -> unit val LinearizeTopMatch: TcGlobals -> ParentRef -> Expr -> Expr diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index f97e293c9a8..87308b2409e 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -2051,7 +2051,7 @@ and p_ValData x st = p_option p_ValReprInfo x.ValReprInfo st p_string x.XmlDocSig st p_access x.Accessibility st - p_parentref x.DeclaringEntity st + p_parentref x.TryDeclaringEntity st p_option p_const x.LiteralValue st if st.oInMem then p_used_space1 (p_xmldoc x.XmlDoc) st From 192b86dbc86bb45b38aa23570486e574ed58c920 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 4 Aug 2022 09:55:13 -0700 Subject: [PATCH 089/226] Remove FX_NO_APP_DOMAINS (#13603) * WIP: Remove FX_NO_APP_DOMAINS * shadowcopy * fantomas --- FSharp.Profiles.props | 1 - src/Compiler/AbstractIL/ilreflect.fs | 8 +++----- src/Compiler/Driver/CompilerImports.fs | 19 ++++++++----------- src/Compiler/Interactive/fsi.fs | 12 +----------- src/Compiler/Service/service.fs | 6 +----- src/fsc/fscmain.fs | 2 -- src/fsi/fsimain.fs | 10 ++-------- tests/FSharp.Test.Utilities/CompilerAssert.fs | 4 +--- .../FSharp.Test.Utilities.fsproj | 1 + tests/FSharp.Test.Utilities/Utilities.fs | 2 +- .../FCSBenchmarks/FCSSourceFiles/Program.fs | 16 ---------------- 11 files changed, 18 insertions(+), 63 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index c06a6e7cb0f..e4226b6461e 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -11,7 +11,6 @@ $(DefineConstants);NETSTANDARD - $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_WINFORMS $(OtherFlags) --simpleresolution diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index e7e1e548e1a..a53af4220f3 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -162,6 +162,7 @@ type TypeBuilder with member typB.CreateTypeAndLog() = if logRefEmitCalls then printfn "typeBuilder%d.CreateType()" (abs <| hash typB) + typB.CreateTypeInfo().AsType() member typB.DefineNestedTypeAndLog(name, attrs) = @@ -2516,12 +2517,8 @@ let buildModuleFragment cenv emEnv (modB: ModuleBuilder) (m: ILModuleDef) = // test hook //---------------------------------------------------------------------------- let defineDynamicAssemblyAndLog (asmName, flags, asmDir: string) = -#if FX_NO_APP_DOMAINS let asmB = AssemblyBuilder.DefineDynamicAssembly(asmName, flags) -#else - let currentDom = System.AppDomain.CurrentDomain - let asmB = currentDom.DefineDynamicAssembly(asmName, flags, asmDir) -#endif + if logRefEmitCalls then printfn "open System" printfn "open System.Reflection" @@ -2546,6 +2543,7 @@ let mkDynamicAssemblyAndModule (assemblyName, optimize, collectible) = AssemblyBuilderAccess.RunAndCollect else AssemblyBuilderAccess.Run + let asmB = defineDynamicAssemblyAndLog (asmName, asmAccess, asmDir) if not optimize then diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index c40ce184463..60722df6c9d 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics open System.IO +open System.Reflection open Internal.Utilities open Internal.Utilities.Collections @@ -231,19 +232,15 @@ let OpenILBinary (fileName, reduceMemoryUsage, pdbDirPath, shadowCopyReferences, } let location = -#if FX_NO_APP_DOMAINS // In order to use memory mapped files on the shadow copied version of the Assembly, we `preload the assembly // We swallow all exceptions so that we do not change the exception contract of this API - if shadowCopyReferences then + if shadowCopyReferences && not isRunningOnCoreClr then try - System.Reflection.Assembly.ReflectionOnlyLoadFrom(fileName).Location + Assembly.ReflectionOnlyLoadFrom(fileName).Location with _ -> fileName else -#else - ignore shadowCopyReferences -#endif - fileName + fileName AssemblyReader.GetILModuleReader(location, opts) @@ -314,7 +311,7 @@ type ImportedBinary = FileName: string RawMetadata: IRawFSharpAssemblyData #if !NO_TYPEPROVIDERS - ProviderGeneratedAssembly: System.Reflection.Assembly option + ProviderGeneratedAssembly: Assembly option IsProviderGenerated: bool ProviderGeneratedStaticLinkMap: ProvidedAssemblyStaticLinkingMap option #endif @@ -418,7 +415,7 @@ type TcConfig with resolvedPath = resolved prepareToolTip = (fun () -> - let fusionName = System.Reflection.AssemblyName.GetAssemblyName(resolved).ToString() + let fusionName = AssemblyName.GetAssemblyName(resolved).ToString() let line (append: string) = append.Trim(' ') + "\n" line resolved + line fusionName) sysdir = sysdir @@ -1688,7 +1685,7 @@ and [] TcImports tcConfig.ResolveLibWithDirectories(CcuLoadFailureAction.RaiseError, primaryAssemblyRef) |> Option.get // MSDN: this method causes the file to be opened and closed, but the assembly is not added to this domain - let name = System.Reflection.AssemblyName.GetAssemblyName(resolution.resolvedPath) + let name = AssemblyName.GetAssemblyName(resolution.resolvedPath) name.Version let typeProviderEnvironment = @@ -2192,7 +2189,7 @@ and [] TcImports tryFile (assemblyName + ".exe") |> ignore #if !NO_TYPEPROVIDERS - member tcImports.TryFindProviderGeneratedAssemblyByName(ctok, assemblyName: string) : System.Reflection.Assembly option = + member tcImports.TryFindProviderGeneratedAssemblyByName(ctok, assemblyName: string) : Assembly option = // The assembly may not be in the resolutions, but may be in the load set including EST injected assemblies match tcImports.TryFindDllInfo(ctok, range0, assemblyName, lookupOnly = true) with | Some res -> diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 37b5bca7a35..71d0ef67f91 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -994,11 +994,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, if tcConfigB.utf8output then let prev = Console.OutputEncoding Console.OutputEncoding <- Encoding.UTF8 -#if FX_NO_APP_DOMAINS - ignore prev -#else System.AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> Console.OutputEncoding <- prev) -#endif do let firstArg = match sourceFiles with @@ -3462,10 +3458,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i /// A host calls this to get the active language ID if provided by fsi-server-lcid member _.LCID = fsiOptions.FsiLCID -#if FX_NO_APP_DOMAINS - member _.ReportUnhandledException (exn:exn) = ignore exn; () -#else - /// A host calls this to report an unhandled exception in a standard way, e.g. an exception on the GUI thread gets printed to stderr member x.ReportUnhandledException exn = x.ReportUnhandledExceptionSafe true exn @@ -3529,7 +3521,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i else reraise() ) -#endif member _.PartialAssemblySignatureUpdated = fsiInteractionProcessor.PartialAssemblySignatureUpdated @@ -3655,13 +3646,12 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i fsiInteractionProcessor.LoadDummyInteraction(ctokStartup, diagnosticsLogger) if progress then fprintfn fsiConsoleOutput.Out "MAIN: got initial state, creating form"; -#if !FX_NO_APP_DOMAINS // Route background exceptions to the exception handlers AppDomain.CurrentDomain.UnhandledException.Add (fun args -> match args.ExceptionObject with | :? System.Exception as err -> x.ReportUnhandledExceptionSafe false err | _ -> ()) -#endif + fsiInteractionProcessor.LoadInitialFiles(ctokRun, diagnosticsLogger) fsiInteractionProcessor.StartStdinReadAndProcessThread(diagnosticsLogger) diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 3ff00eeb31a..e58b5be8261 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -204,13 +204,9 @@ module CompileHelpers = // Create an assembly builder let assemblyName = AssemblyName(Path.GetFileNameWithoutExtension outfile) let flags = AssemblyBuilderAccess.Run -#if FX_NO_APP_DOMAINS let assemblyBuilder = System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly(assemblyName, flags) let moduleBuilder = assemblyBuilder.DefineDynamicModule("IncrementalModule") -#else - let assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, flags) - let moduleBuilder = assemblyBuilder.DefineDynamicModule("IncrementalModule", debugInfo) -#endif + // Omit resources in dynamic assemblies, because the module builder is constructed without a file name the module // is tagged as transient and as such DefineManifestResource will throw an invalid operation if resources are present. // diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index ebdf21af60d..667affcb504 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -60,7 +60,6 @@ let main (argv) = System.Console.ReadLine() |> ignore // Set up things for the --times testing flag -#if !FX_NO_APP_DOMAINS let timesFlag = argv |> Array.exists (fun x -> x = "/times" || x = "--times") if timesFlag then @@ -74,7 +73,6 @@ let main (argv) = stats.memoryMapFileClosedCount stats.rawMemoryFileCount stats.weakByteFileCount) -#endif // This object gets invoked when two many errors have been accumulated, or an abort-on-error condition // has been reached (e.g. type checking failed, so don't proceed to optimization). diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index 4bd0c1903ed..ce4f41231e9 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -211,12 +211,8 @@ let evaluateSession (argv: string[]) = //#if USE_FSharp_Compiler_Interactive_Settings let fsiObjOpt = - let defaultFSharpBinariesDir = -#if FX_NO_APP_DOMAINS - System.AppContext.BaseDirectory -#else - System.AppDomain.CurrentDomain.BaseDirectory -#endif + let defaultFSharpBinariesDir = System.AppContext.BaseDirectory + // We use LoadFrom to make sure we get the copy of this assembly from the right load context let fsiAssemblyPath = Path.Combine(defaultFSharpBinariesDir, "FSharp.Compiler.Interactive.Settings.dll") @@ -381,7 +377,6 @@ let MainMain argv = () } -#if !FX_NO_APP_DOMAINS let timesFlag = argv |> Array.exists (fun x -> x = "/times" || x = "--times") if timesFlag then @@ -395,7 +390,6 @@ let MainMain argv = stats.memoryMapFileClosedCount stats.rawMemoryFileCount stats.weakByteFileCount) -#endif #if FSI_SHADOW_COPY_REFERENCES let isShadowCopy x = diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index ef6a973bb50..6378786e97d 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -11,9 +11,7 @@ open FSharp.Compiler.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Diagnostics open FSharp.Compiler.Text -#if FX_NO_APP_DOMAINS open System.Runtime.Loader -#endif open FSharp.Test.Utilities open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.CSharp @@ -256,7 +254,7 @@ module rec CompilerAssertHelpers = yield Array.empty |] -#if FX_NO_APP_DOMAINS +#if NETCOREAPP let executeBuiltApp assembly deps = let ctxt = AssemblyLoadContext("ContextName", true) try diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index a20052b3f66..278ee438053 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -46,6 +46,7 @@ + diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index e20b98068af..ca893b3a91c 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -7,6 +7,7 @@ open System.IO open System.Reflection open System.Collections.Immutable open System.Diagnostics +open System.Threading open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.CSharp @@ -14,7 +15,6 @@ open TestFramework open NUnit.Framework // This file mimics how Roslyn handles their compilation references for compilation testing - module Utilities = type Async with diff --git a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs index a5b798e072e..8c21e2dafc3 100644 --- a/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs +++ b/tests/benchmarks/FCSBenchmarks/FCSSourceFiles/Program.fs @@ -100,15 +100,7 @@ module Project = @"--define:FSHARP_CORE" @"--define:DEBUG" @"--define:NETSTANDARD" - @"--define:FX_NO_APP_DOMAINS" - @"--define:FX_NO_CORHOST_SIGNER" - @"--define:FX_NO_PDB_READER" - @"--define:FX_NO_PDB_WRITER" - @"--define:FX_NO_SYMBOLSTORE" - @"--define:FX_NO_SYSTEM_CONFIGURATION" - @"--define:FX_NO_WIN_REGISTRY" @"--define:FX_NO_WINFORMS" - @"--define:FX_RESHAPED_REFEMIT" @"--define:NETSTANDARD" @"--define:NETSTANDARD2_1" @"--define:NETSTANDARD1_0_OR_GREATER" @@ -307,15 +299,7 @@ module Project = @"--define:COMPILER" @"--define:DEBUG" @"--define:NETSTANDARD" - @"--define:FX_NO_APP_DOMAINS" - @"--define:FX_NO_CORHOST_SIGNER" - @"--define:FX_NO_PDB_READER" - @"--define:FX_NO_PDB_WRITER" - @"--define:FX_NO_SYMBOLSTORE" - @"--define:FX_NO_SYSTEM_CONFIGURATION" - @"--define:FX_NO_WIN_REGISTRY" @"--define:FX_NO_WINFORMS" - @"--define:FX_RESHAPED_REFEMIT" @"--define:NETSTANDARD" @"--define:NETSTANDARD2_0" @"--define:NETSTANDARD1_0_OR_GREATER" From da1e3e3dca549acfc361543551d1cb8f715f8258 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 4 Aug 2022 10:04:12 -0700 Subject: [PATCH 090/226] Remove Cross_Platform_Compiler (#13630) * Remove Cross_Platform_Compiler (mono) --- FSharp.Profiles.props | 3 - .../Legacy/LegacyMSBuildReferenceResolver.fs | 16 -- src/FSharp.Core/prim-types.fs | 3 - src/fsc/fscmain.fs | 7 +- src/fsi/fsimain.fs | 8 +- .../Microsoft.FSharp.Core/BigIntType.fs | 180 ++++-------------- 6 files changed, 38 insertions(+), 179 deletions(-) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index e4226b6461e..4222cace487 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -4,9 +4,6 @@ - - $(DefineConstants);CROSS_PLATFORM_COMPILER - diff --git a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs b/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs index 0509157d425..516695e7e18 100644 --- a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs +++ b/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs @@ -184,27 +184,15 @@ module FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver | AssemblyFolders -> lineIfExists resolvedPath + lineIfExists fusionName -#if CROSS_PLATFORM_COMPILER - + "Found by AssemblyFolders registry key" -#else + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersKey() -#endif | AssemblyFoldersEx -> lineIfExists resolvedPath + lineIfExists fusionName -#if CROSS_PLATFORM_COMPILER - + "Found by AssemblyFoldersEx registry key" -#else + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersExKey() -#endif | TargetFrameworkDirectory -> lineIfExists resolvedPath + lineIfExists fusionName -#if CROSS_PLATFORM_COMPILER - + ".NET Framework" -#else + FSComp.SR.assemblyResolutionNetFramework() -#endif | Unknown -> // Unknown when resolved by plain directory search without help from MSBuild resolver. lineIfExists resolvedPath @@ -213,11 +201,7 @@ module FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver lineIfExists fusionName | GlobalAssemblyCache -> lineIfExists fusionName -#if CROSS_PLATFORM_COMPILER - + "Global Assembly Cache" -#else + lineIfExists (FSComp.SR.assemblyResolutionGAC()) -#endif + lineIfExists redist | Path _ -> lineIfExists resolvedPath diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 1d5dcc28d05..bed3157a649 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -5117,9 +5117,6 @@ namespace Microsoft.FSharp.Core [] [] [] // assembly is fully transparent -#if !CROSS_PLATFORM_COMPILER - [] // v4 transparency; soon to be the default, but not yet -#endif do () #if FX_NO_MONITOR_REPORTS_LOCKTAKEN diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 667affcb504..9cd6e63df1c 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -88,12 +88,7 @@ let main (argv) = } // Get the handler for legacy resolution of references via MSBuild. - let legacyReferenceResolver = -#if CROSS_PLATFORM_COMPILER - SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver -#else - LegacyMSBuildReferenceResolver.getResolver () -#endif + let legacyReferenceResolver = LegacyMSBuildReferenceResolver.getResolver () // Perform the main compilation. // diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index ce4f41231e9..57aee5ca360 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -249,12 +249,8 @@ let evaluateSession (argv: string[]) = None #endif - let legacyReferenceResolver = -#if CROSS_PLATFORM_COMPILER - SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver -#else - LegacyMSBuildReferenceResolver.getResolver () -#endif + let legacyReferenceResolver = LegacyMSBuildReferenceResolver.getResolver () + // Update the configuration to include 'StartServer', WinFormsEventLoop and 'GetOptionalConsoleReadLine()' let rec fsiConfig = { new FsiEvaluationSessionHostConfig() with diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs index 6a4eb596d14..caa7e84591c 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs @@ -47,10 +47,7 @@ type BigIntType() = Assert.AreEqual((new BigInteger(168)).ToString(), "168") Assert.AreEqual(-168I.ToString(), "-168") Assert.AreEqual(-0I.ToString(), "0") -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger()).ToString(), "0") -#endif [] @@ -70,53 +67,35 @@ type BigIntType() = Assert.True( (c = a) ) Assert.True( (z1 = z2) ) Assert.True( (z2 = z3) ) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True( (z3 = z4) ) Assert.True( (z4 = z1) ) -#endif Assert.True( (z1 = -z2) ) Assert.True( (z2 = -z3) ) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True( (z3 = -z4) ) Assert.True( (z4 = -z1) ) -#endif Assert.True( a.Equals(b) ); Assert.True( b.Equals(a) ) Assert.True( b.Equals(c) ); Assert.True( c.Equals(b) ) Assert.True( c.Equals(a) ); Assert.True( a.Equals(c) ) Assert.True( z1.Equals(z2) ); Assert.True( z2.Equals(z3) ) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True( z3.Equals(z4) ); Assert.True( z4.Equals(z1) ) -#endif - + // Self equality let a = new BigInteger(168) - Assert.True( (a = a) ) + Assert.True( (a = a) ) Assert.True( (z1 = z1) ) Assert.True( (z2 = z2) ) Assert.True( (z3 = z3) ) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True( (z4 = z4) ) -#endif Assert.True(a.Equals(a)) Assert.True(z1.Equals(z1)) Assert.True(z2.Equals(z2)) Assert.True(z3.Equals(z3)) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True(z4.Equals(z4)) -#endif - + // Null Assert.False(a.Equals(null)) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True(0I.GetHashCode() = (BigInteger()).GetHashCode()) -#endif // static methods [] @@ -130,13 +109,10 @@ type BigIntType() = Assert.AreEqual(BigInteger.Abs(bigNegativeB), bigPositiveB) Assert.AreEqual(BigInteger.Abs(0I), 0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(BigInteger.Abs(BigInteger()), 0I) -#endif - + () - + [] member this.DivRem() = let mutable r = BigInteger(0) @@ -159,38 +135,31 @@ type BigIntType() = Assert.AreEqual((q,r), (0I, -100I)) q <- BigInteger.DivRem(-123I, -100I, &r) - Assert.AreEqual((q,r), (1I, -23I)) + Assert.AreEqual((q,r), (1I, -23I)) q <- BigInteger.DivRem(0I, 100I, &r) Assert.AreEqual((q,r), (0I, 0I)) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else qr <- BigInteger.DivRem(BigInteger(), 1I) Assert.AreEqual(qr, (0I, 0I)) CheckThrowsDivideByZeroException(fun () -> BigInteger.DivRem(100I, BigInteger()) |> ignore) CheckThrowsDivideByZeroException(fun () -> BigInteger.DivRem(BigInteger(), BigInteger()) |> ignore) -#endif - + CheckThrowsDivideByZeroException(fun () -> BigInteger.DivRem(100I,0I) |> ignore) - + () - - + [] member this.GreatestCommonDivisor() = Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigPositiveA, bigPositiveB), 900000000090I) Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigNegativeA, bigNegativeB), 900000000090I) Assert.AreEqual(BigInteger.GreatestCommonDivisor(0I, bigPositiveA), bigPositiveA) -#if !CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 Assert.AreEqual(BigInteger.GreatestCommonDivisor(BigInteger(), bigPositiveA), bigPositiveA) Assert.AreEqual(BigInteger.GreatestCommonDivisor(bigPositiveA, BigInteger()), bigPositiveA) Assert.AreEqual(BigInteger.GreatestCommonDivisor(BigInteger(), bigNegativeA), bigPositiveA) Assert.AreEqual(BigInteger.GreatestCommonDivisor(BigInteger(), BigInteger()), 0I) -#endif - () - + [] member this.One() = Assert.AreEqual(BigInteger.One,1I) @@ -225,15 +194,12 @@ type BigIntType() = Assert.AreEqual(BigInteger.Pow(2I, 0), 1I) Assert.AreEqual(BigInteger.Pow(-10I, 2), 100I) Assert.AreEqual(BigInteger.Pow(0I, 0), 1I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(BigInteger.Pow(BigInteger(), 0), 1I) Assert.AreEqual(BigInteger.Pow(BigInteger(), 1), 0I) -#endif Assert.AreEqual(BigInteger.Pow(0I, 1), 0I) CheckThrowsArgumentOutOfRangeException(fun() -> BigInteger.Pow(100I, -2) |> ignore) () - + [] member this.Sign() = Assert.AreEqual(0I.Sign, 0) @@ -248,11 +214,8 @@ type BigIntType() = Assert.True(-0I.IsZero) Assert.True(BigInteger.Zero.IsZero) Assert.True((-BigInteger.Zero).IsZero) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.True(BigInteger().IsZero) Assert.True((-BigInteger()).IsZero) -#endif Assert.True(BigInteger(0).IsZero) Assert.True((-BigInteger(0)).IsZero) Assert.False(1I.IsZero) @@ -266,11 +229,8 @@ type BigIntType() = Assert.False(-0I.IsOne) Assert.False(BigInteger.Zero.IsOne) Assert.False((-BigInteger.Zero).IsOne) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.False(BigInteger().IsOne) Assert.False((-BigInteger()).IsOne) -#endif Assert.False(BigInteger(0).IsOne) Assert.False((-BigInteger(0)).IsOne) Assert.True(1I.IsOne) @@ -282,10 +242,7 @@ type BigIntType() = [] member this.ToDouble() = Assert.AreEqual(double 0I, 0.0) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(double (BigInteger()), 0.0) -#endif Assert.AreEqual(double 123I, 123.0) Assert.AreEqual(double -123I, -123.0) () @@ -293,10 +250,7 @@ type BigIntType() = [] member this.ToInt32() = Assert.AreEqual(int32 0I, 0) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(int32 (BigInteger()), 0) -#endif Assert.AreEqual(int32 123I, 123) Assert.AreEqual(int32 -123I, -123) () @@ -304,10 +258,7 @@ type BigIntType() = [] member this.ToInt64() = Assert.AreEqual(int64 0I, 0L) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(int64 (BigInteger()), 0L) -#endif Assert.AreEqual(int64 123I, 123L) Assert.AreEqual(int64 -123I, -123L) @@ -316,149 +267,110 @@ type BigIntType() = [] member this.Zero() = Assert.AreEqual(BigInteger.Zero,0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(BigInteger.Zero, BigInteger()) -#endif () - - // operators + + // operators [] member this.Addition() = Assert.AreEqual((123I + 456I),579I) Assert.AreEqual((-123I + (-456I)),-579I) Assert.AreEqual((0I + 123I),123I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger() + 123I),123I) Assert.AreEqual((123I + BigInteger()),123I) -#endif Assert.AreEqual((bigPositiveA + 0I),bigPositiveA) Assert.AreEqual((bigPositiveA + bigNegativeA),0I) - () - + [] member this.Division() = Assert.AreEqual((123I / 124I),0I) Assert.AreEqual((123I / (-124I)),0I) Assert.AreEqual((0I / 123I),0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger() / 123I),0I) -#endif - () - - [] + + [] member this.Equality() = Assert.AreEqual((bigPositiveA = bigPositiveA),true) Assert.AreEqual((bigPositiveA = bigNegativeA),false) Assert.AreEqual((bigNegativeA = bigPositiveA),false) Assert.AreEqual((bigNegativeA = (-123I)),false) Assert.AreEqual((0I = new BigInteger(0)),true) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((0I = new BigInteger()),true) -#endif - () - - [] + + [] member this.GreaterThan() = Assert.AreEqual((bigPositiveA > bigPositiveB),false) Assert.AreEqual((bigNegativeA > bigPositiveB),false) Assert.AreEqual((bigNegativeA > (-123I)),false) Assert.AreEqual((0I > new BigInteger(0)),false) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((0I > new BigInteger()),false) Assert.AreEqual((BigInteger() > BigInteger()),false) Assert.AreEqual((BigInteger() > 1I),false) Assert.AreEqual((BigInteger() > -1I),true) -#endif - () - - [] + + [] member this.GreaterThanOrEqual() = Assert.AreEqual((bigPositiveA >= bigPositiveB),false) Assert.AreEqual((bigPositiveA >= bigNegativeB),true) Assert.AreEqual((bigPositiveB >= bigPositiveA),true) Assert.AreEqual((bigNegativeA >= bigNegativeA),true) Assert.AreEqual((0I >= new BigInteger(0)),true) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((0I >= new BigInteger()),true) Assert.AreEqual((BigInteger() >= BigInteger()),true) Assert.AreEqual((BigInteger() >= 1I),false) Assert.AreEqual((BigInteger() >= -1I),true) -#endif - () - - [] + + [] member this.LessThan() = Assert.AreEqual((bigPositiveA < bigPositiveB),true) Assert.AreEqual((bigNegativeA < bigPositiveB),true) Assert.AreEqual((bigPositiveA < bigNegativeB),false) Assert.AreEqual((bigNegativeA < bigPositiveB),true) Assert.AreEqual((0I < new BigInteger(0)),false) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((0I < new BigInteger()),false) Assert.AreEqual((BigInteger() < BigInteger()),false) Assert.AreEqual((BigInteger() < 1I),true) Assert.AreEqual((BigInteger() < -1I),false) -#endif - () - - [] + + [] member this.LessThanOrEqual() = Assert.AreEqual((bigPositiveA <= bigPositiveB),true) Assert.AreEqual((bigPositiveA <= bigNegativeB),false) Assert.AreEqual((bigNegativeB <= bigPositiveA),true) Assert.AreEqual((bigNegativeA <= bigNegativeA),true) Assert.AreEqual((0I <= new BigInteger(-0)),true) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((0I <= new BigInteger()),true) Assert.AreEqual((BigInteger() <= BigInteger()),true) Assert.AreEqual((BigInteger() <= 1I),true) Assert.AreEqual((BigInteger() <= -1I),false) -#endif - () - + [] member this.Modulus() = Assert.AreEqual((bigPositiveA % bigPositiveB),bigPositiveA) Assert.AreEqual((bigNegativeA % bigNegativeB),bigNegativeA) Assert.AreEqual((0I % bigPositiveA),0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger() % bigPositiveA),0I) CheckThrowsDivideByZeroException(fun () -> 2I % 0I |> ignore) CheckThrowsDivideByZeroException(fun () -> 2I % (BigInteger()) |> ignore) -#endif - () - + [] member this.Multiply() = Assert.AreEqual((123I * 100I),12300I) Assert.AreEqual((123I * (-100I)),-12300I) Assert.AreEqual((-123I * (-100I)),12300I) Assert.AreEqual((0I * bigPositiveA),0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger() * bigPositiveA),0I) -#endif Assert.AreEqual((1I * 0I),0I) - () - + [] member this.Range() = let resultPos = [123I..128I] @@ -470,10 +382,10 @@ type BigIntType() = 126I 127I 128I - ] + ] VerifySeqsEqual resultPos seqPos - - let resultNeg = [(-128I) .. (-123I)] + + let resultNeg = [(-128I) .. (-123I)] let seqNeg = [ -128I @@ -489,15 +401,10 @@ type BigIntType() = let seqSmall = [0I;1I;2I;3I;4I;5I] VerifySeqsEqual resultSmall1 seqSmall -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else let resultSmall2 = [BigInteger()..5I] VerifySeqsEqual resultSmall2 seqSmall -#endif - () - - + [] member this.RangeStep() = let resultPos = [100I .. 3I .. 109I] @@ -521,29 +428,22 @@ type BigIntType() = VerifySeqsEqual resultNeg seqNeg let resultSmall1 = [0I..3I..9I] -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else let resultSmall1 = [BigInteger()..3I..9I] let seqSmall = [0I;3I;6I;9I] VerifySeqsEqual resultSmall1 seqSmall CheckThrowsArgumentException(fun () -> [0I .. BigInteger() .. 3I] |> ignore) -#endif VerifySeqsEqual [0I .. -2I .. 10I] [] - () - + [] member this.Subtraction() = Assert.AreEqual((100I - 123I),-23I) Assert.AreEqual((0I - bigPositiveB),bigNegativeB) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual((BigInteger() - bigPositiveB),bigNegativeB) Assert.AreEqual((bigPositiveB - BigInteger()),bigPositiveB) -#endif - Assert.AreEqual((bigPositiveB - 0I),bigPositiveB) + Assert.AreEqual((bigPositiveB - 0I),bigPositiveB) Assert.AreEqual((-100I - (-123I)),23I) Assert.AreEqual((100I - (-123I)),223I) Assert.AreEqual((-100I - 123I),-223I) @@ -555,25 +455,17 @@ type BigIntType() = Assert.AreEqual(-bigPositiveA,bigNegativeA) Assert.AreEqual(-bigNegativeA,bigPositiveA) Assert.AreEqual(-0I,0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(-BigInteger(),0I) -#endif - () - + [] member this.UnaryPlus() = Assert.AreEqual(+bigPositiveA,bigPositiveA) Assert.AreEqual(+bigNegativeA,bigNegativeA) Assert.AreEqual(+0I,0I) -#if CROSS_PLATFORM_COMPILER // see https://bugzilla.xamarin.com/show_bug.cgi?id=22591 -#else Assert.AreEqual(+BigInteger(),0I) -#endif - () - + // instance methods [] member this.New_int32() = @@ -590,5 +482,3 @@ type BigIntType() = Assert.AreEqual(new BigInteger(System.Int64.MinValue), -9223372036854775808I) () - - From 314e144d1d9db8d0d24e946d4789197429978317 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 4 Aug 2022 10:18:07 -0700 Subject: [PATCH 091/226] On arm64 vs default to platform specific compiler (#13632) --- src/FSharp.Build/Microsoft.FSharp.Targets | 14 +++++++--- ...piler - Explicit Desktop - AnyCpuWins.proj | 27 +++++++++++++++++++ ... Explicit Desktop - PreferAnyCpuFalse.proj | 26 ++++++++++++++++++ ...- Explicit Desktop - PreferAnyCpuTrue.proj | 26 ++++++++++++++++++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - AnyCpuWins.proj create mode 100644 tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuFalse.proj create mode 100644 tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuTrue.proj diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 3495d1b304d..22d010e10db 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -57,9 +57,13 @@ this file. boolean: true or false === default value true Suggest that the compiler used be the 64 Bit compiler. On computers without Visual Studio this property is ignored. + boolean: true or false === default value true boolean: true or false === default value true - If Shim helpers are present then the values are valid and set by the Microsoft.FSharp.Helpers.props + These are stupidly complex for performance reasons: + Arm64 is faster than AnyCpu on an Arm64 machine + + On Windows Arm64 default to Arm64 build, otherwise default to AnyCpu. --> @@ -67,9 +71,13 @@ this file. + + false + $(FSharpPrefer64BitTools) $(Fsc_NetFramework_ToolPath) - $(Fsc_NetFramework_AnyCpu_ToolExe) - $(Fsc_NetFramework_PlatformSpecific_ToolExe) + $(Fsc_NetFramework_AnyCpu_ToolExe) + $(Fsc_NetFramework_PlatformSpecific_ToolExe) + diff --git a/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - AnyCpuWins.proj b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - AnyCpuWins.proj new file mode 100644 index 00000000000..14a2ac06e8c --- /dev/null +++ b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - AnyCpuWins.proj @@ -0,0 +1,27 @@ + + + + + + + + + + true + /Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + fsc.exe + _VsInstallRoot_/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + + + + + + + true + false + true + + + + + diff --git a/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuFalse.proj b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuFalse.proj new file mode 100644 index 00000000000..69e5be7095a --- /dev/null +++ b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuFalse.proj @@ -0,0 +1,26 @@ + + + + + + + + + + true + /Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + fsc.exe + _VsInstallRoot_/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + + + + + + + true + false + + + + + diff --git a/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuTrue.proj b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuTrue.proj new file mode 100644 index 00000000000..9a0f2438299 --- /dev/null +++ b/tests/fsharp/SDKTests/tests/WhichFSharpCompiler - Explicit Desktop - PreferAnyCpuTrue.proj @@ -0,0 +1,26 @@ + + + + + + + + + + true + /Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + fscAnyCpu.exe + _VsInstallRoot_/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ + + + + + + + true + true + + + + + From 11692d9d05e22cce4da3064e28caf09651550d0d Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 5 Aug 2022 10:57:25 -0700 Subject: [PATCH 092/226] Remove net472 from FSharp.Compiler.Service (#13532) * remove net472 * fantomas --- .../Microsoft.FSharp.Compiler.MSBuild.csproj | 2 +- src/Compiler/Driver/CompilerOptions.fs | 7 ++----- src/Compiler/FSharp.Compiler.Service.fsproj | 2 +- src/Compiler/Interactive/fsi.fs | 9 ++++----- .../Vsix/VisualFSharpFull/VisualFSharp.Core.targets | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj index 77de746c4ce..d96bbf1e59d 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj +++ b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj @@ -49,7 +49,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\%(_XlfLanguages.Identity)" file source="$(BinariesFolder)FSharp.Build\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Build.resources.dll" file source="$(BinariesFolder)FSharp.Compiler.Interactive.Settings\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Compiler.Interactive.Settings.resources.dll" - file source="$(BinariesFolder)FSharp.Compiler.Service\$(Configuration)\$(TargetFramework)\%(_XlfLanguages.Identity)\FSharp.Compiler.Service.resources.dll" + file source="$(BinariesFolder)FSharp.Compiler.Service\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Compiler.Service.resources.dll" file source="$(BinariesFolder)FSharp.Core\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Core.resources.dll" ]]> diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 1a892bf37f8..90fa3728838 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -767,13 +767,10 @@ let compilerToolFlagAbbrev (tcConfigB: TcConfigBuilder) = let inputFileFlagsFsc tcConfigB = inputFileFlagsBoth tcConfigB let inputFileFlagsFsiBase (_tcConfigB: TcConfigBuilder) = -#if NETSTANDARD [ - CompilerOption("usesdkrefs", tagNone, OptionSwitch(SetUseSdkSwitch _tcConfigB), None, Some(FSComp.SR.useSdkRefs ())) + if FSharpEnvironment.isRunningOnCoreClr then + yield CompilerOption("usesdkrefs", tagNone, OptionSwitch(SetUseSdkSwitch _tcConfigB), None, Some(FSComp.SR.useSdkRefs ())) ] -#else - List.empty -#endif let inputFileFlagsFsi (tcConfigB: TcConfigBuilder) = List.append (inputFileFlagsBoth tcConfigB) (inputFileFlagsFsiBase tcConfigB) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index e5cbff8394d..36f0a788a6a 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -3,7 +3,7 @@ - net472;netstandard2.0 + netstandard2.0 Library $(NoWarn);44 $(NoWarn);57 diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 71d0ef67f91..08453ef34bb 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -962,11 +962,10 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, CompilerOption("readline", tagNone, OptionSwitch(fun flag -> enableConsoleKeyProcessing <- (flag = OptionSwitch.On)), None, Some(FSIstrings.SR.fsiReadline())) CompilerOption("quotations-debug", tagNone, OptionSwitch(fun switch -> tcConfigB.emitDebugInfoInQuotations <- switch = OptionSwitch.On),None, Some(FSIstrings.SR.fsiEmitDebugInfoInQuotations())) CompilerOption("shadowcopyreferences", tagNone, OptionSwitch(fun flag -> tcConfigB.shadowCopyReferences <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.shadowCopyReferences())) -#if NETSTANDARD - CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOption())) -#else - CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOptionOffByDefault())) -#endif + if FSharpEnvironment.isRunningOnCoreClr then + CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOption())) + else + CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOptionOffByDefault())) ]); ] diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets index 8205ac783f3..4d86ad05cc5 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets @@ -69,7 +69,7 @@ All 2 True - TargetFramework=$(DependencyTargetFramework) + TargetFramework=netstandard2.0 From 6b1aee38be1c0058320de769a579b7b4459d6a87 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 6 Aug 2022 11:05:14 -0700 Subject: [PATCH 093/226] Update dependencies from https://github.com/dotnet/arcade build 20220805.2 (#13641) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22403.1 -> To Version 7.0.0-beta.22405.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/common/templates/job/source-index-stage1.yml | 2 +- global.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 49366038db7..1a5848d0390 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 4ee620cc1b57da45d93135e064d43a83e65bbb6e + be709269603a9a3e90b189e6145b8450969ab067 diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index c2d51098d35..4e37210857d 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -1,6 +1,6 @@ parameters: runAsPublic: false - sourceIndexPackageVersion: 1.0.1-20210614.1 + sourceIndexPackageVersion: 1.0.1-20220804.1 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] diff --git a/global.json b/global.json index 8cec0f070c3..a2d0a813d56 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22403.1", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22405.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 4e99f79b863d94e4a4781a473f8b63022fdc4721 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:39:57 +0200 Subject: [PATCH 094/226] Update dependencies from https://github.com/dotnet/arcade build 20220805.6 (#13642) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22405.2 -> To Version 7.0.0-beta.22405.6 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1a5848d0390..9cb14371fcb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - be709269603a9a3e90b189e6145b8450969ab067 + 58aed6cc9fde5155c79cf706eeccf31b03e9a8a7 diff --git a/global.json b/global.json index a2d0a813d56..070687d73b7 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22405.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22405.6", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From c29a3329a0d15d2e114f566740b2f53796c4a37b Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 8 Aug 2022 20:46:42 +0200 Subject: [PATCH 095/226] Update Fantomas to the latest beta. (#13622) --- .config/dotnet-tools.json | 2 +- src/Compiler/AbstractIL/ilread.fs | 2 +- src/Compiler/Service/ServiceParsedInputOps.fsi | 2 +- src/Compiler/Service/service.fsi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9a25558c924..0fdcde7e13a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "5.0.0-alpha-011", + "version": "5.0.0-beta-005", "commands": [ "fantomas" ] diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 964d4d2b779..22c65d5f1c3 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -4843,7 +4843,7 @@ let openPEMetadataOnly (fileName, peinfo, pectxtEager, pevEager, mdfile: BinaryF openMetadataReader (fileName, mdfile, 0, peinfo, pectxtEager, pevEager, None, reduceMemoryUsage) type ILReaderMetadataSnapshot = obj * nativeint * int -type ILReaderTryGetMetadataSnapshot = (* path: *) string (* snapshotTimeStamp: *) * DateTime -> ILReaderMetadataSnapshot option +type ILReaderTryGetMetadataSnapshot = (* path: *) string (* snapshotTimeStamp: *) * DateTime -> ILReaderMetadataSnapshot option [] type MetadataOnlyFlag = diff --git a/src/Compiler/Service/ServiceParsedInputOps.fsi b/src/Compiler/Service/ServiceParsedInputOps.fsi index 07a1ac56fe6..2c7a0e20d83 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fsi +++ b/src/Compiler/Service/ServiceParsedInputOps.fsi @@ -138,7 +138,7 @@ module public ParsedInput = parsedInput: ParsedInput -> partiallyQualifiedName: MaybeUnresolvedIdent[] -> insertionPoint: OpenStatementInsertionPoint -> - (( (* requiresQualifiedAccessParent: *) ShortIdents option (* autoOpenParent: *) * ShortIdents option (* entityNamespace *) * ShortIdents option (* entity: *) * ShortIdents) -> (InsertionContextEntity * InsertionContext)[]) + (( (* requiresQualifiedAccessParent: *) ShortIdents option (* autoOpenParent: *) * ShortIdents option (* entityNamespace *) * ShortIdents option (* entity: *) * ShortIdents) -> (InsertionContextEntity * InsertionContext)[]) /// Returns `InsertContext` based on current position and symbol idents. val FindNearestPointToInsertOpenDeclaration: diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index f9da3677f34..25a5a2b412e 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -404,7 +404,7 @@ type public FSharpChecker = /// An optional string used for tracing compiler operations associated with this request. member TryGetRecentCheckResultsForFile: fileName: string * options: FSharpProjectOptions * ?sourceText: ISourceText * ?userOpName: string -> - (FSharpParseFileResults * FSharpCheckFileResults (* hash *) * int64) option + (FSharpParseFileResults * FSharpCheckFileResults (* hash *) * int64) option /// This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation. member InvalidateAll: unit -> unit From 1aefc2f54217bddf7098f08eecaf37b63744e7dc Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Mon, 8 Aug 2022 13:48:04 -0500 Subject: [PATCH 096/226] Add typecheck symbol help description (#13643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix typo in ànd`keyword description name * add description for type-test symbol --- src/Compiler/FSComp.txt | 3 ++- src/Compiler/SyntaxTree/PrettyNaming.fs | 3 ++- src/Compiler/xlf/FSComp.txt.cs.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.de.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.es.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.fr.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.it.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.ja.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.ko.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.pl.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.ru.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.tr.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 7 ++++++- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 7 ++++++- 15 files changed, 82 insertions(+), 15 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 60e5702d449..7dfd7f10221 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1384,7 +1384,7 @@ tcAnonRecdFieldNameSubset,"This anonymous record does not have enough fields. Ad tcAnonRecdFieldNameSuperset,"This anonymous record has too many fields. Remove the extra fields %s." tcAnonRecdFieldNameDifferent,"This is the wrong anonymous record. It should have the fields %s." keywordDescriptionAbstract,"Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation." -keyworkDescriptionAnd,"Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters." +keywordDescriptionAnd,"Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters." keywordDescriptionAs,"Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match." keywordDescriptionAssert,"Used to verify code during debugging." keywordDescriptionBase,"Used as the name of the base class object." @@ -1442,6 +1442,7 @@ keywordDescriptionThen,"Used in conditional expressions. Also used to perform si keywordDescriptionTo,"Used in for loops to indicate a range." keywordDescriptionTry,"Used to introduce a block of code that might generate an exception. Used together with with or finally." keywordDescriptionType,"Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation." +keywordDescriptionTypeTest,"Used to check if an object is of the given type in a pattern or binding." keywordDescriptionUpcast,"Used to convert to a type that is higher in the inheritance chain." keywordDescriptionUse,"Used instead of let for values that implement IDisposable" keywordDescriptionUseBang,"Used instead of let! in computation expressions for computation expression results that implement IDisposable." diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index 19174d2e782..b4ba20670f8 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -173,7 +173,7 @@ let IsIdentifierPartCharacter c = let keywordsWithDescription: (string * string) list = [ "abstract", FSComp.SR.keywordDescriptionAbstract () - "and", FSComp.SR.keyworkDescriptionAnd () + "and", FSComp.SR.keywordDescriptionAnd () "as", FSComp.SR.keywordDescriptionAs () "assert", FSComp.SR.keywordDescriptionAssert () "base", FSComp.SR.keywordDescriptionBase () @@ -244,6 +244,7 @@ let keywordsWithDescription: (string * string) list = "->", FSComp.SR.keywordDescriptionRightArrow () "<-", FSComp.SR.keywordDescriptionLeftArrow () ":>", FSComp.SR.keywordDescriptionCast () + ":?", FSComp.SR.keywordDescriptionTypeTest () ":?>", FSComp.SR.keywordDescriptionDynamicCast () "<@", FSComp.SR.keywordDescriptionTypedQuotation () "@>", FSComp.SR.keywordDescriptionTypedQuotation () diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8052182cecb..0274845f194 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -357,6 +357,11 @@ Klíčové slovo, které specifikuje konstantní literál jako argument parametru typu v poskytovatelích typů + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated Bajtový řetězec se nedá interpolovat. @@ -7442,7 +7447,7 @@ Označuje metodu, která buď nemá implementaci v typu, ve kterém je deklarovaná, nebo která je virtuální a má výchozí implementaci. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 3d3dc8c2604..d252f75a423 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -357,6 +357,11 @@ Schlüsselwort, um ein konstantes Literal als Typparameterargument in Typanbietern anzugeben. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated Eine Bytezeichenfolge darf nicht interpoliert werden. @@ -7442,7 +7447,7 @@ Gibt eine Methode an, die entweder im Typ, in dem sie deklariert wird, über keine Implementierung verfügt oder die virtuell ist und über eine Standardimplementierung verfügt. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index ba19316436e..17871b3624a 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -357,6 +357,11 @@ Palabra clave para especificar un literal de constante como argumento de parámetro de tipo en los proveedores de tipo. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated no se puede interpolar una cadena de bytes @@ -7442,7 +7447,7 @@ Indica un método que no tiene ninguna implementación en el tipo en el que se declara o un método que es virtual y tiene una implementación predeterminada. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 4ed2c0da2a9..6705cdcb761 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -357,6 +357,11 @@ Mot clé permettant de spécifier une constante littérale en tant qu'argument de paramètre de type dans les fournisseurs de types. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated une chaîne d'octets ne peut pas être interpolée @@ -7442,7 +7447,7 @@ Indique une méthode qui n'a aucune implémentation dans le type dans lequel elle est déclarée, ou qui est virtuelle avec une implémentation par défaut. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 01af391840a..26e67bcd381 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -357,6 +357,11 @@ Parola chiave per specificare un valore letterale di costante come argomento del parametro di tipo in Provider di tipi. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated non è possibile interpolare una stringa di byte @@ -7442,7 +7447,7 @@ Indica un metodo per il quale non esiste alcuna implementazione nel tipo in cui viene dichiarato oppure che è virtuale e per il quale esiste un'implementazione predefinita. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 54fbab4b514..65af4937797 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -357,6 +357,11 @@ 定数リテラルを型プロバイダーの型パラメーター引数として指定するキーワード。 + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated バイト文字列は補間されていない可能性があります @@ -7442,7 +7447,7 @@ 宣言された型に実装がないメソッド、または既定の実装がある仮想のメソッドを示します。 - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 7ed437b2763..72b63d1aa2e 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -357,6 +357,11 @@ 상수 리터럴을 형식 공급자의 형식 매개 변수 인수로 지정하는 키워드입니다. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated 바이트 문자열을 보간하지 못할 수 있습니다. @@ -7442,7 +7447,7 @@ 선언된 형식에 구현이 없는 메서드 또는 기본 구현이 있는 가상 메서드를 나타냅니다. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 19e01c91485..d9a2fb6441d 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -357,6 +357,11 @@ Słowo kluczowe na potrzeby określania literału stałej jako argumentu parametru typu w przypadku dostawców typów. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated ciąg bajtowy nie może być interpolowany @@ -7442,7 +7447,7 @@ Wskazuje metodę, która nie ma implementacji w typie, w którym została zadeklarowana, lub jest wirtualna i ma implementację domyślną. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 615e716bd0f..581a7f5fbd2 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -357,6 +357,11 @@ Palavra-chave para especificar um literal constante como um argumento de parâmetro de tipo nos Provedores de Tipo. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated uma cadeia de caracteres de byte não pode ser interpolada @@ -7442,7 +7447,7 @@ Indica um método que não tem implementação no tipo no qual ele é declarado ou que é virtual e tem uma implementação padrão. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index f534378e99f..fd9829a3faa 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -357,6 +357,11 @@ Ключевое слово для указания константного литерала в качестве аргумента параметра типа в поставщиках типов. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated невозможно выполнить интерполяцию для строки байтов @@ -7442,7 +7447,7 @@ Обозначает метод, который не имеет реализации в типе, в котором он объявлен, или является виртуальным и имеет реализацию по умолчанию. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 70335d09d9d..6e5ab25c917 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -357,6 +357,11 @@ Tür Sağlayıcılarında tür parametresi bağımsız değişkeni olarak sabit değişmez değeri belirtmek için anahtar sözcük. + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated bir bayt dizesi, düz metin arasına kod eklenerek kullanılamaz @@ -7442,7 +7447,7 @@ İçinde bildirildiği türde hiç uygulaması olmayan veya sanal olup varsayılan uygulaması olan bir metodu belirtir. - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 4e7e55a375c..2dcc9052685 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -357,6 +357,11 @@ 用于将常量文本指定为类型提供程序中的类型形参实参的关键字。 + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated 不能内插字节字符串 @@ -7442,7 +7447,7 @@ 表示一种方法,该方法在进行声明的类型中没有任何实现,或该方法为虚拟方法且包含默认实现。 - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 965a9c231b6..29accc26a8e 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -357,6 +357,11 @@ 用於在型別提供者中,將常數常值指定為型別參數引數的關鍵字。 + + Used to check if an object is of the given type in a pattern or binding. + Used to check if an object is of the given type in a pattern or binding. + + a byte string may not be interpolated 位元組字串不能是插補字串 @@ -7442,7 +7447,7 @@ 指出方法,此方法可能在其宣告的類型中沒有實作,或者是虛擬方法而具有預設實作。 - + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 From f8b56cb6db3c90348810263fd7a5d37dc5719e92 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Mon, 8 Aug 2022 20:48:30 +0200 Subject: [PATCH 097/226] Include star in topTupleType rule. (#13621) --- src/Compiler/pars.fsy | 3 +- tests/service/SyntaxTreeTests/BindingTests.fs | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 001dc57bc2d..9e859307710 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5030,7 +5030,8 @@ topType: topTupleType: | topAppType STAR topTupleTypeElements { let t, argInfo = $1 - let path = SynTupleTypeSegment.Type t :: (List.map fst $3) + let mStar = rhs parseState 2 + let path = SynTupleTypeSegment.Type t :: SynTupleTypeSegment.Star mStar :: (List.map fst $3) let mdata = argInfo :: (List.choose snd $3) mkSynTypeTuple false path, mdata } diff --git a/tests/service/SyntaxTreeTests/BindingTests.fs b/tests/service/SyntaxTreeTests/BindingTests.fs index b8f8ed54bfd..c132b306ecd 100644 --- a/tests/service/SyntaxTreeTests/BindingTests.fs +++ b/tests/service/SyntaxTreeTests/BindingTests.fs @@ -366,3 +366,35 @@ let a = ]) ])) -> assertRange (3, 4) (3, 7) mLet | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Tuple return type of binding should contain stars`` () = + let parseResults = + getParseResults """ +let a : int * string = failwith "todo" +let b : int * string * bool = 1, "", false +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(returnInfo = + Some (SynBindingReturnInfo(typeName = SynType.Tuple(path = [ + SynTupleTypeSegment.Type _ + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type _ + ])))) + ]) + SynModuleDecl.Let(bindings = [ + SynBinding(returnInfo = + Some (SynBindingReturnInfo(typeName = SynType.Tuple(path = [ + SynTupleTypeSegment.Type _ + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type _ + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type _ + ])))) + ]) + ]) ])) -> + Assert.Pass () + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" From bdb64624f0ca220ca4433c83d02dd5822fe767a5 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 9 Aug 2022 14:46:58 +0200 Subject: [PATCH 098/226] RFC FS-1124 - Interfaces with static abstract methods (#13119) Co-authored-by: Don Syme Co-authored-by: Don Syme Co-authored-by: Petr Pokorny --- .vscode/launch.json | 4 +- src/Compiler/AbstractIL/il.fs | 38 +- src/Compiler/AbstractIL/il.fsi | 9 +- src/Compiler/AbstractIL/ilmorph.fs | 3 +- src/Compiler/AbstractIL/ilprint.fs | 4 +- src/Compiler/AbstractIL/ilread.fs | 22 +- src/Compiler/AbstractIL/ilreflect.fs | 5 +- src/Compiler/AbstractIL/ilwrite.fs | 5 +- .../Checking/CheckComputationExpressions.fs | 2 +- src/Compiler/Checking/CheckDeclarations.fs | 41 +- src/Compiler/Checking/CheckExpressions.fs | 646 ++++++++++---- src/Compiler/Checking/CheckExpressions.fsi | 10 + src/Compiler/Checking/CheckFormatStrings.fs | 14 +- src/Compiler/Checking/CheckPatterns.fs | 8 +- src/Compiler/Checking/ConstraintSolver.fs | 677 ++++++++------ src/Compiler/Checking/ConstraintSolver.fsi | 21 +- src/Compiler/Checking/InfoReader.fs | 135 ++- src/Compiler/Checking/InfoReader.fsi | 24 +- src/Compiler/Checking/MethodCalls.fs | 97 +- src/Compiler/Checking/MethodCalls.fsi | 18 +- src/Compiler/Checking/MethodOverrides.fs | 33 +- src/Compiler/Checking/MethodOverrides.fsi | 3 +- src/Compiler/Checking/NameResolution.fs | 68 +- src/Compiler/Checking/NameResolution.fsi | 7 +- src/Compiler/Checking/NicePrint.fs | 62 +- src/Compiler/Checking/NicePrint.fsi | 2 + .../Checking/PatternMatchCompilation.fs | 4 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/Checking/QuotationTranslator.fs | 5 +- src/Compiler/Checking/SignatureConformance.fs | 11 +- src/Compiler/Checking/TypeHierarchy.fs | 31 +- src/Compiler/Checking/infos.fs | 145 +-- src/Compiler/Checking/infos.fsi | 15 +- src/Compiler/CodeGen/EraseClosures.fs | 5 +- src/Compiler/CodeGen/IlxGen.fs | 273 ++++-- src/Compiler/Driver/CompilerDiagnostics.fs | 3 +- src/Compiler/FSComp.txt | 16 +- src/Compiler/Facilities/LanguageFeatures.fs | 6 + src/Compiler/Facilities/LanguageFeatures.fsi | 2 + src/Compiler/Facilities/prim-lexing.fs | 2 +- src/Compiler/Facilities/prim-lexing.fsi | 2 +- .../Optimize/LowerComputedCollections.fs | 6 +- src/Compiler/Optimize/Optimizer.fs | 22 +- src/Compiler/Service/FSharpCheckerResults.fs | 155 ++-- .../Service/FSharpParseFileResults.fs | 3 +- src/Compiler/Service/ItemKey.fs | 32 +- .../Service/SemanticClassification.fs | 147 ++-- .../Service/ServiceDeclarationLists.fs | 115 ++- src/Compiler/Service/ServiceParseTreeWalk.fs | 2 + src/Compiler/Service/ServiceParsedInputOps.fs | 8 +- .../Service/ServiceParsedInputOps.fsi | 2 +- src/Compiler/Symbols/Exprs.fs | 42 +- src/Compiler/Symbols/SymbolHelpers.fs | 252 ++++-- src/Compiler/Symbols/SymbolHelpers.fsi | 2 +- src/Compiler/Symbols/Symbols.fs | 9 +- src/Compiler/Symbols/Symbols.fsi | 2 + src/Compiler/SyntaxTree/LexFilter.fs | 28 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 34 + src/Compiler/SyntaxTree/ParseHelpers.fsi | 3 + src/Compiler/SyntaxTree/SyntaxTree.fs | 11 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 15 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 34 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 9 +- src/Compiler/TypedTree/TcGlobals.fs | 10 +- src/Compiler/TypedTree/TypedTree.fs | 64 +- src/Compiler/TypedTree/TypedTree.fsi | 52 +- src/Compiler/TypedTree/TypedTreeBasics.fs | 15 +- src/Compiler/TypedTree/TypedTreeBasics.fsi | 7 +- src/Compiler/TypedTree/TypedTreeOps.fs | 204 ++++- src/Compiler/TypedTree/TypedTreeOps.fsi | 33 +- src/Compiler/TypedTree/TypedTreePickle.fs | 18 +- src/Compiler/pars.fsy | 157 ++-- src/Compiler/xlf/FSComp.txt.cs.xlf | 65 +- src/Compiler/xlf/FSComp.txt.de.xlf | 65 +- src/Compiler/xlf/FSComp.txt.es.xlf | 65 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 65 +- src/Compiler/xlf/FSComp.txt.it.xlf | 65 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 65 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 65 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 65 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 65 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 65 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 65 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 65 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 65 +- src/FSharp.Build/FSharp.Build.fsproj | 7 +- .../LexicalAnalysis/SymbolicOperators.fs | 2 +- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 831 ++++++++++++++++++ .../IWSAMsAndSRTPs/Types.fs | 39 + .../IWSAMsAndSRTPs/testFiles/BasicTests.fs | 61 ++ .../testFiles/CheckNewSyntax.fs | 60 ++ .../testFiles/CheckSelfConstrainedIWSAM.fs | 51 ++ .../testFiles/CheckSelfConstrainedSRTP.fs | 18 + .../TestLegacyThingsThatRegressedDuringRFC.fs | 17 + .../testFiles/UseSRTPFromIWSAMGenericCode.fs | 33 + .../FSharp.Compiler.ComponentTests.fsproj | 2 + .../Interop/StaticsInInterfaces.fs | 507 ++++++++++- ...erService.SurfaceArea.netstandard.expected | 32 +- .../Microsoft.FSharp.Control/TasksDynamic.fs | 28 +- tests/FSharp.Test.Utilities/Compiler.fs | 184 ++-- tests/FSharp.Test.Utilities/CompilerAssert.fs | 18 +- .../DirectoryAttribute.fs | 28 +- .../Language/DefaultInterfaceMemberTests.fs | 16 +- .../E_LessThanDotOpenParen001.bsl | 2 +- tests/fsharp/core/members/ops/test.fsx | 2 +- tests/fsharp/core/subtype/test.fsx | 2 +- tests/fsharp/core/syntax/test.fsx | 4 +- tests/fsharp/regression/5531/test.fs | 2 +- .../neg_generic_known_argument_types.bsl | 2 +- ...n_return_type_and_known_type_arguments.bsl | 16 +- ...n_return_type_and_known_type_arguments.fsx | 2 +- tests/fsharp/typecheck/sigs/neg02.bsl | 2 - tests/fsharp/typecheck/sigs/neg02.vsbsl | 10 + tests/fsharp/typecheck/sigs/neg112.bsl | 6 +- tests/fsharp/typecheck/sigs/neg112.fs | 4 +- tests/fsharp/typecheck/sigs/neg116.bsl | 2 +- tests/fsharp/typecheck/sigs/neg117.bsl | 4 +- tests/fsharp/typecheck/sigs/neg119.bsl | 2 +- tests/fsharp/typecheck/sigs/neg129.bsl | 4 +- tests/fsharp/typecheck/sigs/neg131.bsl | 2 +- tests/fsharp/typecheck/sigs/neg132.bsl | 2 +- tests/fsharp/typecheck/sigs/neg61.bsl | 2 +- tests/fsharp/typecheck/sigs/pos35.fs | 2 +- .../E_MalformedShortUnicode01.fs | 4 +- .../CheckingSyntacticTypes/ByRef04.fsx | 6 +- .../Sample_ConsoleApp_net7/Program.fs | 117 +++ .../Sample_ConsoleApp_net7.fsproj | 20 + tests/service/EditorTests.fs | 1 + tests/service/ExprTests.fs | 10 +- .../SyntaxTreeTests/MemberFlagTests.fs | 16 +- vsintegration/tests/Directory.Build.props | 10 - .../UnitTests/BraceMatchingServiceTests.fs | 2 +- .../UnitTests/BreakpointResolutionService.fs | 4 +- .../UnitTests/CompletionProviderTests.fs | 72 +- .../DocumentDiagnosticAnalyzerTests.fs | 4 +- .../DocumentHighlightsServiceTests.fs | 4 +- .../UnitTests/EditorFormattingServiceTests.fs | 2 +- .../UnitTests/FsxCompletionProviderTests.fs | 7 +- .../UnitTests/GoToDefinitionServiceTests.fs | 35 +- .../UnitTests/HelpContextServiceTests.fs | 198 +++-- .../UnitTests/IndentationServiceTests.fs | 2 +- .../LanguageDebugInfoServiceTests.fs | 2 +- .../Tests.LanguageService.ErrorList.fs | 8 +- .../Tests.ProjectSystem.References.fs | 67 +- .../tests/UnitTests/ProjectOptionsBuilder.fs | 2 +- .../tests/UnitTests/QuickInfoProviderTests.fs | 6 +- .../tests/UnitTests/QuickInfoTests.fs | 68 +- .../tests/UnitTests/RoslynSourceTextTests.fs | 2 +- .../SemanticColorizationServiceTests.fs | 4 +- .../UnitTests/SignatureHelpProviderTests.fs | 12 +- .../SyntacticColorizationServiceTests.fs | 2 +- .../tests/UnitTests/Tests.RoslynHelpers.fs | 9 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 43 +- .../UnitTests/Workspace/WorkspaceTests.fs | 2 +- 154 files changed, 5853 insertions(+), 1714 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/Types.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/BasicTests.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckNewSyntax.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedIWSAM.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedSRTP.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/TestLegacyThingsThatRegressedDuringRFC.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/UseSRTPFromIWSAMGenericCode.fs create mode 100644 tests/fsharp/typecheck/sigs/neg02.vsbsl create mode 100644 tests/projects/Sample_ConsoleApp_net7/Program.fs create mode 100644 tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj delete mode 100644 vsintegration/tests/Directory.Build.props diff --git a/.vscode/launch.json b/.vscode/launch.json index d00e32e86bd..9d8255dfbee 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,7 +23,7 @@ "internalConsoleOptions": "neverOpen", "suppressJITOptimizations": true, "stopAtEntry": false, - "justMyCode": false, + "justMyCode": true, "enableStepFiltering": true, "symbolOptions": { "searchMicrosoftSymbolServer": true, @@ -73,7 +73,7 @@ "enabled": true } }, - "justMyCode": false, + "justMyCode": true, "enableStepFiltering": false, } ] diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 23e6186253a..c0104807dcc 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -1370,7 +1370,7 @@ type ILInstr = | I_call of ILTailcall * ILMethodSpec * ILVarArgs | I_callvirt of ILTailcall * ILMethodSpec * ILVarArgs - | I_callconstraint of ILTailcall * ILType * ILMethodSpec * ILVarArgs + | I_callconstraint of callvirt: bool * ILTailcall * ILType * ILMethodSpec * ILVarArgs | I_calli of ILTailcall * ILCallingSignature * ILVarArgs | I_ldftn of ILMethodSpec | I_newobj of ILMethodSpec * ILVarArgs @@ -3410,9 +3410,6 @@ let mkNormalCall mspec = I_call(Normalcall, mspec, None) let mkNormalCallvirt mspec = I_callvirt(Normalcall, mspec, None) -let mkNormalCallconstraint (ty, mspec) = - I_callconstraint(Normalcall, ty, mspec, None) - let mkNormalNewobj mspec = I_newobj(mspec, None) /// Comment on common object cache sizes: @@ -3822,18 +3819,24 @@ let mkILClassCtor impl = let mk_ospec (ty: ILType, callconv, nm, genparams, formal_args, formal_ret) = OverridesSpec(mkILMethRef (ty.TypeRef, callconv, nm, genparams, formal_args, formal_ret), ty) -let mkILGenericVirtualMethod (nm, access, genparams, actual_args, actual_ret, impl) = +let mkILGenericVirtualMethod (nm, callconv: ILCallingConv, access, genparams, actual_args, actual_ret, impl) = + let attributes = + convertMemberAccess access + ||| MethodAttributes.CheckAccessOnOverride + ||| (match impl with + | MethodBody.Abstract -> MethodAttributes.Abstract ||| MethodAttributes.Virtual + | _ -> MethodAttributes.Virtual) + ||| (if callconv.IsInstance then + enum 0 + else + MethodAttributes.Static) + ILMethodDef( name = nm, - attributes = - (convertMemberAccess access - ||| MethodAttributes.CheckAccessOnOverride - ||| (match impl with - | MethodBody.Abstract -> MethodAttributes.Abstract ||| MethodAttributes.Virtual - | _ -> MethodAttributes.Virtual)), + attributes = attributes, implAttributes = MethodImplAttributes.Managed, genericParams = genparams, - callingConv = ILCallingConv.Instance, + callingConv = callconv, parameters = actual_args, ret = actual_ret, isEntryPoint = false, @@ -3842,8 +3845,11 @@ let mkILGenericVirtualMethod (nm, access, genparams, actual_args, actual_ret, im body = notlazy impl ) -let mkILNonGenericVirtualMethod (nm, access, args, ret, impl) = - mkILGenericVirtualMethod (nm, access, mkILEmptyGenericParams, args, ret, impl) +let mkILNonGenericVirtualMethod (nm, callconv, access, args, ret, impl) = + mkILGenericVirtualMethod (nm, callconv, access, mkILEmptyGenericParams, args, ret, impl) + +let mkILNonGenericVirtualInstanceMethod (nm, access, args, ret, impl) = + mkILNonGenericVirtualMethod (nm, ILCallingConv.Instance, access, args, ret, impl) let mkILGenericNonVirtualMethod (nm, access, genparams, actual_args, actual_ret, impl) = ILMethodDef( @@ -4267,7 +4273,7 @@ let mkILDelegateMethods access (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IAsy let one nm args ret = let mdef = - mkILNonGenericVirtualMethod (nm, access, args, mkILReturn ret, MethodBody.Abstract) + mkILNonGenericVirtualInstanceMethod (nm, access, args, mkILReturn ret, MethodBody.Abstract) mdef.WithAbstract(false).WithHideBySig(true).WithRuntime(true) @@ -5298,7 +5304,7 @@ and refsOfILInstr s x = | I_callvirt (_, mr, varargs) -> refsOfILMethodSpec s mr refsOfILVarArgs s varargs - | I_callconstraint (_, tr, mr, varargs) -> + | I_callconstraint (_, _, tr, mr, varargs) -> refsOfILType s tr refsOfILMethodSpec s mr refsOfILVarArgs s varargs diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 8b5a3160c06..32528348907 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -523,7 +523,7 @@ type internal ILInstr = // Method call | I_call of ILTailcall * ILMethodSpec * ILVarArgs | I_callvirt of ILTailcall * ILMethodSpec * ILVarArgs - | I_callconstraint of ILTailcall * ILType * ILMethodSpec * ILVarArgs + | I_callconstraint of callvirt: bool * ILTailcall * ILType * ILMethodSpec * ILVarArgs | I_calli of ILTailcall * ILCallingSignature * ILVarArgs | I_ldftn of ILMethodSpec | I_newobj of ILMethodSpec * ILVarArgs @@ -1970,7 +1970,6 @@ type internal ILLocalsAllocator = /// Derived functions for making some common patterns of instructions. val internal mkNormalCall: ILMethodSpec -> ILInstr val internal mkNormalCallvirt: ILMethodSpec -> ILInstr -val internal mkNormalCallconstraint: ILType * ILMethodSpec -> ILInstr val internal mkNormalNewobj: ILMethodSpec -> ILInstr val internal mkCallBaseConstructor: ILType * ILType list -> ILInstr list val internal mkNormalStfld: ILFieldSpec -> ILInstr @@ -2025,12 +2024,16 @@ val internal mkILNonGenericStaticMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef val internal mkILGenericVirtualMethod: - string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef + string * ILCallingConv * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> + ILMethodDef val internal mkILGenericNonVirtualMethod: string * ILMemberAccess * ILGenericParameterDefs * ILParameter list * ILReturn * MethodBody -> ILMethodDef val internal mkILNonGenericVirtualMethod: + string * ILCallingConv * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef + +val internal mkILNonGenericVirtualInstanceMethod: string * ILMemberAccess * ILParameter list * ILReturn * MethodBody -> ILMethodDef val internal mkILNonGenericInstanceMethod: diff --git a/src/Compiler/AbstractIL/ilmorph.fs b/src/Compiler/AbstractIL/ilmorph.fs index bcc65878d1a..dad1e16369d 100644 --- a/src/Compiler/AbstractIL/ilmorph.fs +++ b/src/Compiler/AbstractIL/ilmorph.fs @@ -212,7 +212,8 @@ let morphILTypesInILInstr ((factualTy, fformalTy)) i = | I_calli (a, mref, varargs) -> I_calli(a, callsig_ty2ty factualTy mref, morphILVarArgs factualTy varargs) | I_call (a, mr, varargs) -> I_call(a, conv_mspec mr, morphILVarArgs factualTy varargs) | I_callvirt (a, mr, varargs) -> I_callvirt(a, conv_mspec mr, morphILVarArgs factualTy varargs) - | I_callconstraint (a, ty, mr, varargs) -> I_callconstraint(a, factualTy ty, conv_mspec mr, morphILVarArgs factualTy varargs) + | I_callconstraint (callvirt, a, ty, mr, varargs) -> + I_callconstraint(callvirt, a, factualTy ty, conv_mspec mr, morphILVarArgs factualTy varargs) | I_newobj (mr, varargs) -> I_newobj(conv_mspec mr, morphILVarArgs factualTy varargs) | I_ldftn mr -> I_ldftn(conv_mspec mr) | I_ldvirtftn mr -> I_ldvirtftn(conv_mspec mr) diff --git a/src/Compiler/AbstractIL/ilprint.fs b/src/Compiler/AbstractIL/ilprint.fs index 1c777f278b9..0335e28ef22 100644 --- a/src/Compiler/AbstractIL/ilprint.fs +++ b/src/Compiler/AbstractIL/ilprint.fs @@ -893,11 +893,11 @@ let rec goutput_instr env os inst = output_string os "callvirt " goutput_vararg_mspec env os (mspec, varargs) output_after_tailcall os tl - | I_callconstraint (tl, ty, mspec, varargs) -> + | I_callconstraint (callvirt, tl, ty, mspec, varargs) -> output_tailness os tl output_string os "constraint. " goutput_typ env os ty - output_string os " callvirt " + output_string os (if callvirt then " callvirt " else " call ") goutput_vararg_mspec env os (mspec, varargs) output_after_tailcall os tl | I_castclass ty -> diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 22c65d5f1c3..c323a9eb939 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -626,17 +626,23 @@ let instrs () = i_stsfld, I_field_instr(volatilePrefix (fun x fspec -> I_stsfld(x, fspec))) i_ldflda, I_field_instr(noPrefixes I_ldflda) i_ldsflda, I_field_instr(noPrefixes I_ldsflda) - i_call, I_method_instr(tailPrefix (fun tl (mspec, y) -> I_call(tl, mspec, y))) + (i_call, + I_method_instr( + constraintOrTailPrefix (fun (c, tl) (mspec, y) -> + match c with + | Some ty -> I_callconstraint(false, tl, ty, mspec, y) + | None -> I_call(tl, mspec, y)) + )) i_ldftn, I_method_instr(noPrefixes (fun (mspec, _y) -> I_ldftn mspec)) i_ldvirtftn, I_method_instr(noPrefixes (fun (mspec, _y) -> I_ldvirtftn mspec)) i_newobj, I_method_instr(noPrefixes I_newobj) - i_callvirt, - I_method_instr( - constraintOrTailPrefix (fun (c, tl) (mspec, y) -> - match c with - | Some ty -> I_callconstraint(tl, ty, mspec, y) - | None -> I_callvirt(tl, mspec, y)) - ) + (i_callvirt, + I_method_instr( + constraintOrTailPrefix (fun (c, tl) (mspec, y) -> + match c with + | Some ty -> I_callconstraint(true, tl, ty, mspec, y) + | None -> I_callvirt(tl, mspec, y)) + )) i_leave_s, I_unconditional_i8_instr(noPrefixes (fun x -> I_leave x)) i_br_s, I_unconditional_i8_instr(noPrefixes I_br) i_leave, I_unconditional_i32_instr(noPrefixes (fun x -> I_leave x)) diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index a53af4220f3..86787b11f00 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -1391,9 +1391,10 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = emitSilverlightCheck ilG emitInstrCall cenv emEnv ilG OpCodes.Callvirt tail mspec varargs - | I_callconstraint (tail, ty, mspec, varargs) -> + | I_callconstraint (callvirt, tail, ty, mspec, varargs) -> ilG.Emit(OpCodes.Constrained, convType cenv emEnv ty) - emitInstrCall cenv emEnv ilG OpCodes.Callvirt tail mspec varargs + let instr = if callvirt then OpCodes.Callvirt else OpCodes.Call + emitInstrCall cenv emEnv ilG instr tail mspec varargs | I_calli (tail, callsig, None) -> emitInstrTail cenv ilG tail (fun () -> diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 9349020f4f6..702fbd5eedb 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -1922,10 +1922,11 @@ module Codebuf = emitTailness cenv codebuf tl emitMethodSpecInstr cenv codebuf env i_callvirt (mspec, varargs) //emitAfterTailcall codebuf tl - | I_callconstraint (tl, ty, mspec, varargs) -> + | I_callconstraint (callvirt, tl, ty, mspec, varargs) -> emitTailness cenv codebuf tl emitConstrained cenv codebuf env ty - emitMethodSpecInstr cenv codebuf env i_callvirt (mspec, varargs) + let instr = if callvirt then i_callvirt else i_call + emitMethodSpecInstr cenv codebuf env instr (mspec, varargs) //emitAfterTailcall codebuf tl | I_newobj (mspec, varargs) -> emitMethodSpecInstr cenv codebuf env i_newobj (mspec, varargs) diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index 523a0aa10c7..0693609fa64 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -468,7 +468,7 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol match info with | None -> false | Some args -> - args |> List.exists (fun (isParamArrayArg, _isInArg, isOutArg, optArgInfo, _callerInfo, _reflArgInfo) -> isParamArrayArg || isOutArg || optArgInfo.IsOptional)) + args |> List.exists (fun (ParamAttribs(isParamArrayArg, _isInArg, isOutArg, optArgInfo, _callerInfo, _reflArgInfo)) -> isParamArrayArg || isOutArg || optArgInfo.IsOptional)) else false diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 5cf36acb80d..08bffa54a57 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -414,7 +414,7 @@ module TcRecdUnionAndEnumDeclarations = let attrsForProperty, attrsForField = attrs |> List.partition (fun (attrTargets, _) -> (attrTargets &&& AttributeTargets.Property) <> enum 0) let attrsForProperty = (List.map snd attrsForProperty) let attrsForField = (List.map snd attrsForField) - let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty let zeroInit = HasFSharpAttribute g g.attrib_DefaultValueAttribute attrsForField let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute attrsForField @@ -512,7 +512,7 @@ module TcRecdUnionAndEnumDeclarations = rfields, thisTy | SynUnionCaseKind.FullType (ty, arity) -> - let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty let curriedArgTys, recordTy = GetTopTauTypeInFSharpForm g (arity |> TranslateSynValInfo m (TcAttributes cenv env) |> TranslatePartialValReprInfo []).ArgInfos tyR m if curriedArgTys.Length > 1 then @@ -666,7 +666,7 @@ let TcOpenTypeDecl (cenv: cenv) mOpenDecl scopem env (synType: SynType, m) = checkLanguageFeatureError g.langVersion LanguageFeature.OpenTypeDeclaration mOpenDecl - let ty, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open env emptyUnscopedTyparEnv synType + let ty, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Open WarnOnIWSAM.Yes env emptyUnscopedTyparEnv synType if not (isAppTy g ty) then error(Error(FSComp.SR.tcNamedTypeRequired("open type"), m)) @@ -1054,7 +1054,7 @@ module MutRecBindingChecking = // Phase2B: typecheck the argument to an 'inherits' call and build the new object expr for the inherit-call | Phase2AInherit (synBaseTy, arg, baseValOpt, m) -> - let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Use envInstance tpenv synBaseTy + let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Use WarnOnIWSAM.Yes envInstance tpenv synBaseTy let baseTy = baseTy |> convertToTypeWithMetadataIfPossible g let inheritsExpr, tpenv = try @@ -1630,7 +1630,7 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (env let intfTyR = let envinner = AddDeclaredTypars CheckForDuplicateTypars declaredTyconTypars envForTycon - TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType envinner emptyUnscopedTyparEnv intfTy |> fst + TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType WarnOnIWSAM.No envinner emptyUnscopedTyparEnv intfTy |> fst if not (tcref.HasInterface g intfTyR) then error(Error(FSComp.SR.tcAllImplementedInterfacesShouldBeDeclared(), intfTy.Range)) @@ -2358,11 +2358,11 @@ module EstablishTypeDefinitionCores = match args with | SynUnionCaseKind.Fields flds -> for SynField(_, _, _, ty, _, _, _, m) in flds do - let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty yield (tyR, m) | SynUnionCaseKind.FullType (ty, arity) -> - let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty let curriedArgTys, _ = GetTopTauTypeInFSharpForm g (arity |> TranslateSynValInfo m (TcAttributes cenv env) |> TranslatePartialValReprInfo []).ArgInfos tyR m if curriedArgTys.Length > 1 then @@ -2373,9 +2373,10 @@ module EstablishTypeDefinitionCores = yield (argTy, m) | SynTypeDefnSimpleRepr.General (_, _, _, fields, _, _, implicitCtorSynPats, _) when tycon.IsFSharpStructOrEnumTycon -> // for structs - for SynField(_, isStatic, _, ty, _, _, _, m) in fields do + for field in fields do + let (SynField(_, isStatic, _, ty, _, _, _, m)) = field if not isStatic then - let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty yield (tyR, m) match implicitCtorSynPats with @@ -2394,7 +2395,7 @@ module EstablishTypeDefinitionCores = | SynTypeDefnSimpleRepr.Record (_, fields, _) -> for SynField(_, _, _, ty, _, _, _, m) in fields do - let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars NoCheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty yield (tyR, m) | _ -> @@ -2928,7 +2929,7 @@ module EstablishTypeDefinitionCores = // This case deals with ordinary type and measure abbreviations if not hasMeasureableAttr then let kind = if hasMeasureAttr then TyparKind.Measure else TyparKind.Type - let ty, _ = TcTypeOrMeasureAndRecover (Some kind) cenv NoNewTypars checkConstraints ItemOccurence.UseInType envinner tpenv rhsType + let ty, _ = TcTypeOrMeasureAndRecover (Some kind) cenv NoNewTypars checkConstraints ItemOccurence.UseInType WarnOnIWSAM.No envinner tpenv rhsType if not firstPass then let ftyvs = freeInTypeLeftToRight g false ty @@ -2962,7 +2963,7 @@ module EstablishTypeDefinitionCores = let envinner = AddDeclaredTypars CheckForDuplicateTypars (tycon.Typars m) envinner let envinner = MakeInnerEnvForTyconRef envinner tcref false - let implementedTys, _ = List.mapFold (mapFoldFst (TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurence.UseInType envinner)) tpenv explicitImplements + let implementedTys, _ = List.mapFold (mapFoldFst (TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurence.UseInType WarnOnIWSAM.No envinner)) tpenv explicitImplements if firstPass then tycon.entity_attribs <- attrs @@ -2974,7 +2975,7 @@ module EstablishTypeDefinitionCores = let kind = InferTyconKind g (kind, attrs, slotsigs, fields, inSig, isConcrete, m) let inherits = inherits |> List.map (fun (ty, m, _) -> (ty, m)) - let inheritedTys = fst (List.mapFold (mapFoldFst (TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurence.UseInType envinner)) tpenv inherits) + let inheritedTys = fst (List.mapFold (mapFoldFst (TcTypeAndRecover cenv NoNewTypars checkConstraints ItemOccurence.UseInType WarnOnIWSAM.No envinner)) tpenv inherits) let implementedTys, inheritedTys = match kind with | SynTypeDefnKind.Interface -> @@ -3215,7 +3216,7 @@ module EstablishTypeDefinitionCores = noAllowNullLiteralAttributeCheck() if hasMeasureableAttr then let kind = if hasMeasureAttr then TyparKind.Measure else TyparKind.Type - let theTypeAbbrev, _ = TcTypeOrMeasureAndRecover (Some kind) cenv NoNewTypars CheckCxs ItemOccurence.UseInType envinner tpenv rhsType + let theTypeAbbrev, _ = TcTypeOrMeasureAndRecover (Some kind) cenv NoNewTypars CheckCxs ItemOccurence.UseInType WarnOnIWSAM.No envinner tpenv rhsType TMeasureableRepr theTypeAbbrev, None, NoSafeInitInfo // If we already computed a representation, e.g. for a generative type definition, then don't change it here. @@ -3339,7 +3340,7 @@ module EstablishTypeDefinitionCores = noAbstractClassAttributeCheck() noFieldsCheck userFields primaryConstructorInDelegateCheck(implicitCtorSynPats) - let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType envinner tpenv ty + let tyR, _ = TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes envinner tpenv ty let _, _, curriedArgInfos, returnTy, _ = GetValReprTypeInCompiledForm g (arity |> TranslateSynValInfo m (TcAttributes cenv envinner) |> TranslatePartialValReprInfo []) 0 tyR m if curriedArgInfos.Length < 1 then error(Error(FSComp.SR.tcInvalidDelegateSpecification(), m)) if curriedArgInfos.Length > 1 then error(Error(FSComp.SR.tcDelegatesCannotBeCurried(), m)) @@ -4027,14 +4028,15 @@ module TcDeclarations = // Convert auto properties to member bindings in the post-list let rec postAutoProps memb = match memb with - | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; xmlDoc=xmlDoc; accessibility=access; getSetRange=mGetSetOpt) -> + | SynMemberDefn.AutoProperty(attributes=Attributes attribs; isStatic=isStatic; ident=id; typeOpt=tyOpt; propKind=propKind; memberFlags=memberFlags; memberFlagsForSet=memberFlagsForSet; xmlDoc=xmlDoc; accessibility=access; getSetRange=mGetSetOpt) -> let mMemberPortion = id.idRange // Only the keep the non-field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true) let fldId = ident (CompilerGeneratedName id.idText, mMemberPortion) let headPatIds = if isStatic then [id] else [ident ("__", mMemberPortion);id] let headPat = SynPat.LongIdent (SynLongIdent(headPatIds, [], List.replicate headPatIds.Length None), None, Some noInferredTypars, SynArgPats.Pats [], None, mMemberPortion) - let memberFlags kind = Some { memberFlags kind with GetterOrSetterIsCompilerGenerated = true } + let memberFlags = { memberFlags with GetterOrSetterIsCompilerGenerated = true } + let memberFlagsForSet = { memberFlagsForSet with GetterOrSetterIsCompilerGenerated = true } match propKind, mGetSetOpt with | SynMemberKind.PropertySet, Some m -> errorR(Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSetNotJustSet(), m)) @@ -4049,7 +4051,7 @@ module TcDeclarations = let rhsExpr = SynExpr.Ident fldId let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) let attribs = mkAttributeList attribs mMemberPortion - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, memberFlags SynMemberKind.Member, SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some memberFlags, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield getter | _ -> () @@ -4061,8 +4063,7 @@ module TcDeclarations = let vId = ident("v", mMemberPortion) let headPat = SynPat.LongIdent (SynLongIdent(headPatIds, [], List.replicate headPatIds.Length None), None, Some noInferredTypars, SynArgPats.Pats [mkSynPatVar None vId], None, mMemberPortion) let rhsExpr = mkSynAssign (SynExpr.Ident fldId) (SynExpr.Ident vId) - //let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) - let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], memberFlags SynMemberKind.PropertySet, SynBindingTrivia.Zero) + let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], Some memberFlagsForSet, SynBindingTrivia.Zero) SynMemberDefn.Member (binding, mMemberPortion) yield setter | _ -> ()] diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index d659fc28967..8f034836dd9 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -717,7 +717,7 @@ type TcFileState = tcComputationExpression) = let infoReader = InfoReader(g, amap) - let instantiationGenerator m tpsorig = FreshenTypars m tpsorig + let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) { g = g amap = amap @@ -749,8 +749,8 @@ type TcFileState = type cenv = TcFileState -let CopyAndFixupTypars m rigid tpsorig = - FreshenAndFixupTypars m rigid [] [] tpsorig +let CopyAndFixupTypars g m rigid tpsorig = + FreshenAndFixupTypars g m rigid [] [] tpsorig let UnifyTypes (cenv: cenv) (env: TcEnv) m actualTy expectedTy = let g = cenv.g @@ -1314,13 +1314,16 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS let isInstance = MemberIsCompiledAsInstance g tcref isExtrinsic memberInfo attrs - if (memberFlags.IsDispatchSlot || not (isNil intfSlotTys)) then - if not isInstance then - errorR(VirtualAugmentationOnNullValuedType(id.idRange)) + let hasUseNullAsTrueAttr = TyconHasUseNullAsTrueValueAttribute g tcref.Deref - elif not memberFlags.IsOverrideOrExplicitImpl && memberFlags.IsInstance then - if not isExtrinsic && not isInstance then - warning(NonVirtualAugmentationOnNullValuedType(id.idRange)) + if hasUseNullAsTrueAttr then + if (memberFlags.IsDispatchSlot || not (isNil intfSlotTys)) then + if not isInstance then + errorR(VirtualAugmentationOnNullValuedType(id.idRange)) + + elif not memberFlags.IsOverrideOrExplicitImpl && memberFlags.IsInstance then + if not isExtrinsic && not isInstance then + warning(NonVirtualAugmentationOnNullValuedType(id.idRange)) let compiledName = if isExtrinsic then @@ -1524,7 +1527,7 @@ let CheckRequiredProperties (g:TcGlobals) (env: TcEnv) (cenv: TcFileState) (minf if requiredProps.Length > 0 then let setterPropNames = finalAssignedItemSetters - |> List.choose (function | AssignedItemSetter(_, AssignedPropSetter (pinfo, _, _), _) -> Some pinfo.PropertyName | _ -> None) + |> List.choose (function | AssignedItemSetter(_, AssignedPropSetter (_, pinfo, _, _), _) -> Some pinfo.PropertyName | _ -> None) let missingProps = requiredProps @@ -1804,11 +1807,11 @@ let SetTyparRigid denv m (tp: Typar) = errorR(Error(FSComp.SR.tcTypeParameterHasBeenConstrained(NicePrint.prettyStringOfTy denv ty), tp.Range)) tp.SetRigidity TyparRigidity.Rigid -let GeneralizeVal (cenv: cenv) denv enclosingDeclaredTypars generalizedTyparsForThisBinding - (PrelimVal1(id, explicitTyparInfo, ty, prelimValReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, argAttribs, vis, isCompGen)) = +let GeneralizeVal (cenv: cenv) denv enclosingDeclaredTypars generalizedTyparsForThisBinding prelimVal = let g = cenv.g + let (PrelimVal1(id, explicitTyparInfo, ty, prelimValReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, argAttribs, vis, isCompGen)) = prelimVal let (ExplicitTyparInfo(_rigidCopyOfDeclaredTypars, declaredTypars, _)) = explicitTyparInfo let m = id.idRange @@ -1837,8 +1840,10 @@ let GeneralizeVal (cenv: cenv) denv enclosingDeclaredTypars generalizedTyparsFor warning(Error(FSComp.SR.tcTypeParametersInferredAreNotStable(), m)) let hasDeclaredTypars = not (isNil declaredTypars) + // This is just about the only place we form a GeneralizedType let tyScheme = GeneralizedType(generalizedTypars, ty) + PrelimVal2(id, tyScheme, prelimValReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, argAttribs, vis, isCompGen, hasDeclaredTypars) let GeneralizeVals cenv denv enclosingDeclaredTypars generalizedTypars types = @@ -2041,7 +2046,8 @@ let MakeAndPublishSimpleValsForMergedScope (cenv: cenv) env m (names: NameMap<_> let FreshenTyconRef (g: TcGlobals) m rigid (tcref: TyconRef) declaredTyconTypars = let origTypars = declaredTyconTypars - let freshTypars = copyTypars origTypars + let clearStaticReq = g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers + let freshTypars = copyTypars clearStaticReq origTypars if rigid <> TyparRigidity.Rigid then for tp in freshTypars do tp.SetRigidity rigid @@ -2058,11 +2064,11 @@ let FreshenPossibleForallTy g m rigid ty = else // tps may be have been equated to other tps in equi-recursive type inference and units-of-measure type inference. Normalize them here let origTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g origTypars - let tps, renaming, tinst = CopyAndFixupTypars m rigid origTypars + let tps, renaming, tinst = CopyAndFixupTypars g m rigid origTypars origTypars, tps, tinst, instType renaming tau let FreshenTyconRef2 (g: TcGlobals) m (tcref: TyconRef) = - let tps, renaming, tinst = FreshenTypeInst m (tcref.Typars m) + let tps, renaming, tinst = FreshenTypeInst g m (tcref.Typars m) tps, renaming, tinst, TType_app (tcref, tinst, g.knownWithoutNull) /// Given a abstract method, which may be a generic method, freshen the type in preparation @@ -2089,7 +2095,7 @@ let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = let ttps = absMethInfo.GetFormalTyparsOfDeclaringType m let ttinst = argsOfAppTy g absMethInfo.ApparentEnclosingType let rigid = if typarsFromAbsSlotAreRigid then TyparRigidity.Rigid else TyparRigidity.Flexible - FreshenAndFixupTypars m rigid ttps ttinst fmtps + FreshenAndFixupTypars g m rigid ttps ttinst fmtps // Work out the required type of the member let argTysFromAbsSlot = argTys |> List.mapSquared (instType typarInstFromAbsSlot) @@ -2447,6 +2453,10 @@ module GeneralizationHelpers = then (ListSet.unionFavourLeft typarEq allDeclaredTypars maxInferredTypars) else allDeclaredTypars + // Update the StaticReq of type variables prior to assessing generalization + for typar in typarsToAttemptToGeneralize do + UpdateStaticReqOfTypar denv cenv.css m NoTrace typar + let generalizedTypars, freeInEnv = TrimUngeneralizableTypars genConstrainedTyparFlag inlineFlag typarsToAttemptToGeneralize freeInEnv @@ -3055,18 +3065,20 @@ type ApplicableExpr = // the function-valued expression expr: Expr * // is this the first in an application series - isFirst: bool + isFirst: bool * + // Is this a traitCall, where we don't build a lambda + traitCallInfo: (Val list * Expr) option member x.Range = - let (ApplicableExpr (_, expr, _)) = x + let (ApplicableExpr (_, expr, _, _)) = x expr.Range member x.Type = match x with - | ApplicableExpr (cenv, expr, _) -> tyOfExpr cenv.g expr + | ApplicableExpr (cenv, expr, _, _) -> tyOfExpr cenv.g expr member x.SupplyArgument(expr2, m) = - let (ApplicableExpr (cenv, funcExpr, first)) = x + let (ApplicableExpr (cenv, funcExpr, first, traitCallInfo)) = x let g = cenv.g let combinedExpr = @@ -3076,16 +3088,24 @@ type ApplicableExpr = (not (isForallTy g funcExpr0Ty) || isFunTy g (applyTys g funcExpr0Ty (tyargs0, args0))) -> Expr.App (funcExpr0, funcExpr0Ty, tyargs0, args0@[expr2], unionRanges m0 m) | _ -> - Expr.App (funcExpr, tyOfExpr g funcExpr, [], [expr2], m) + // Trait calls do not build a lambda if applied immediately to a tuple of arguments or a unit argument + match traitCallInfo, tryDestRefTupleExpr expr2 with + | Some (vs, traitCall), exprs when vs.Length = exprs.Length -> + mkLetsBind m (mkCompGenBinds vs exprs) traitCall + | _ -> + Expr.App (funcExpr, tyOfExpr g funcExpr, [], [expr2], m) - ApplicableExpr(cenv, combinedExpr, false) + ApplicableExpr(cenv, combinedExpr, false, None) member x.Expr = - let (ApplicableExpr (_, expr, _)) = x + let (ApplicableExpr (_, expr, _, _)) = x expr let MakeApplicableExprNoFlex cenv expr = - ApplicableExpr (cenv, expr, true) + ApplicableExpr (cenv, expr, true, None) + +let MakeApplicableExprForTraitCall cenv expr traitCallInfo = + ApplicableExpr (cenv, expr, true, Some traitCallInfo) /// This function reverses the effect of condensation for a named function value (indeed it can /// work for any expression, though we only invoke it immediately after a call to TcVal). @@ -3131,7 +3151,7 @@ let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = curriedActualTys |> List.exists (List.exists (isByrefTy g)) || curriedActualTys |> List.forall (List.forall (isNonFlexibleTy g))) then - ApplicableExpr (cenv, expr, true) + ApplicableExpr (cenv, expr, true, None) else let curriedFlexibleTys = curriedActualTys |> List.mapSquared (fun actualTy -> @@ -3144,7 +3164,7 @@ let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = // Create a coercion to represent the expansion of the application let expr = mkCoerceExpr (expr, mkIteratedFunTy g (List.map (mkRefTupledTy g) curriedFlexibleTys) retTy, m, exprTy) - ApplicableExpr (cenv, expr, true) + ApplicableExpr (cenv, expr, true, None) /// Checks, warnings and constraint assertions for downcasts let TcRuntimeTypeTest isCast isOperator cenv denv m tgtTy srcTy = @@ -3192,7 +3212,7 @@ let TcStaticUpcast cenv denv m tgtTy srcTy = AddCxTypeMustSubsumeType ContextInfo.NoContext denv cenv.css m NoTrace tgtTy srcTy -let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo valUseFlags minst objArgs args = +let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo valUseFlags minst objArgs args staticTyOpt = let g = cenv.g @@ -3226,7 +3246,7 @@ let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo let _, exprForVal, _, tau, _, _ = TcVal true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m exprForVal, tau - BuildMethodCall tcVal g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args + BuildMethodCall tcVal g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args staticTyOpt let TryFindIntrinsicOrExtensionMethInfo collectionSettings (cenv: cenv) (env: TcEnv) m ad nm ty = @@ -3269,13 +3289,13 @@ let BuildDisposableCleanup (cenv: cenv) env m (v: Val) = if TypeFeasiblySubsumesType 0 g cenv.amap m g.system_IDisposable_ty CanCoerce v.Type then // We can use NeverMutates here because the variable is going out of scope, there is no need to take a defensive // copy of it. - let disposeExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false disposeMethod NormalValUse [] [exprForVal v.Range v] [] + let disposeExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false disposeMethod NormalValUse [] [exprForVal v.Range v] [] None disposeExpr else mkUnit g m else let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposable_ty - let disposeExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] + let disposeExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] None let inputExpr = mkCoerceExpr(exprForVal v.Range v, g.obj_ty, m, v.Type) mkIsInstConditional g m g.system_IDisposable_ty inputExpr disposeObjVar disposeExpr (mkUnit g m) @@ -3289,7 +3309,7 @@ let BuildOffsetToStringData cenv env m = | [x] -> x | _ -> error(Error(FSComp.SR.tcCouldNotFindOffsetToStringData(), m)) - let offsetExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false offsetToStringDataMethod NormalValUse [] [] [] + let offsetExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false offsetToStringDataMethod NormalValUse [] [] [] None offsetExpr let BuildILFieldGet g amap m objExpr (finfo: ILFieldInfo) = @@ -3550,7 +3570,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr mkCompGenLocal m "enumerator" getEnumeratorRetTy, getEnumeratorRetTy let getEnumExpr, getEnumTy = - let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumeratorMethInfo NormalValUse getEnumeratorMethInst [exprToSearchForGetEnumeratorAndItem] [] + let getEnumExpr, getEnumTy as res = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false getEnumeratorMethInfo NormalValUse getEnumeratorMethInst [exprToSearchForGetEnumeratorAndItem] [] None if not isEnumeratorTypeStruct || localAlloc then res else // wrap enumerators that are represented as mutable structs into ref cells @@ -3558,8 +3578,8 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr let getEnumTy = mkRefCellTy g getEnumTy getEnumExpr, getEnumTy - let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNextMethInfo NormalValUse moveNextMethInst [enumeratorExpr] [] - let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true getCurrentMethInfo NormalValUse getCurrentMethInst [enumeratorExpr] [] + let guardExpr, guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNextMethInfo NormalValUse moveNextMethInst [enumeratorExpr] [] None + let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true getCurrentMethInfo NormalValUse getCurrentMethInst [enumeratorExpr] [] None let currentExpr = mkCoerceExpr(currentExpr, enumElemTy, currentExpr.Range, currentTy) let currentExpr, enumElemTy = // Implicitly dereference byref for expr 'for x in ...' @@ -3963,19 +3983,19 @@ let buildApp cenv expr resultTy arg m = match expr, arg with // Special rule for building applications of the 'x && y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [x0], _)), _ when valRefEq g vref g.and_vref || valRefEq g vref g.and2_vref -> MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg), resultTy // Special rule for building applications of the 'x || y' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [x0], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [x0], _)), _ when valRefEq g vref g.or_vref || valRefEq g vref g.or2_vref -> MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ), resultTy // Special rule for building applications of the 'reraise' operator - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [], _)), _ when valRefEq g vref g.reraise_vref -> // exprTy is of type: "unit -> 'a". Break it and store the 'a type here, used later as return type. @@ -3983,7 +4003,7 @@ let buildApp cenv expr resultTy arg m = // Special rules for NativePtr.ofByRef to generalize result. // See RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [], _)), _ when (valRefEq g vref g.nativeptr_tobyref_vref) -> let argTy = NewInferenceType g @@ -3994,7 +4014,7 @@ let buildApp cenv expr resultTy arg m = // address of an expression. // // See also RFC FS-1053.md - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [], _)), _ when valRefEq g vref g.addrof_vref -> let wrap, e1a', readonly, _writeonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some vref) m @@ -4019,7 +4039,7 @@ let buildApp cenv expr resultTy arg m = // Special rules for building applications of the &&expr' operators, which gets the // address of an expression. - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _), _ + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [], _)), _ when valRefEq g vref g.addrof2_vref -> warning(UseOfAddressOfOperator m) @@ -4083,6 +4103,13 @@ type ImplicitlyBoundTyparsAllowed = | NewTyparsOK | NoNewTypars +/// Indicates whether the position being checked is precisely the r.h.s. of a "'T :> ***" constraint or a similar +/// places where IWSAM types do not generate a warning +[] +type WarnOnIWSAM = + | Yes + | No + /// Represents information about the module or type in which a member or value is declared. type MemberOrValContainerInfo = | MemberOrValContainerInfo of @@ -4214,13 +4241,13 @@ let rec TcTyparConstraint ridx cenv newOk checkConstraints occ (env: TcEnv) tpen match c with | SynTypeConstraint.WhereTyparDefaultsToType(tp, ty, m) -> - let tyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty + let tyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv ty let tpR, tpenv = TcTypar cenv env newOk tpenv tp AddCxTyparDefaultsTo env.DisplayEnv cenv.css m env.eContextInfo tpR ridx tyR tpenv | SynTypeConstraint.WhereTyparSubtypeOfType(tp, ty, m) -> - let tyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType env tpenv ty + let tyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType WarnOnIWSAM.No env tpenv ty let tpR, tpenv = TcTypar cenv env newOk tpenv tp if newOk = NoNewTypars && isSealedTy g tyR then errorR(Error(FSComp.SR.tcInvalidConstraintTypeSealed(), m)) @@ -4254,12 +4281,32 @@ let rec TcTyparConstraint ridx cenv newOk checkConstraints occ (env: TcEnv) tpen | SynTypeConstraint.WhereTyparSupportsMember(synSupportTys, synMemberSig, m) -> TcConstraintWhereTyparSupportsMember cenv env newOk tpenv synSupportTys synMemberSig m + | SynTypeConstraint.WhereSelfConstrained(ty, m) -> + checkLanguageFeatureAndRecover g.langVersion LanguageFeature.SelfTypeConstraints m + let tyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType WarnOnIWSAM.No env tpenv ty + match tyR with + | TType_app(tcref, tinst, _) when (tcref.IsTypeAbbrev && (isTyparTy g tcref.TypeAbbrev.Value) && tinst |> List.forall (isTyparTy g)) -> + match checkConstraints with + | NoCheckCxs -> + //let formalEnclosingTypars = [] + let tpsorig = tcref.Typars(m) //List.map (destTyparTy g) inst //, _, tinst, _ = FreshenTyconRef2 g m tcref + let tps = List.map (destTyparTy g) tinst //, _, tinst, _ = FreshenTyconRef2 g m tcref + let tprefInst, _tptys = mkTyparToTyparRenaming tpsorig tps + //let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (tp.Constraints @ CopyTyparConstraints m tprefInst tporig)) + | CheckCxs -> () + | AppTy g (_tcref, selfTy :: _rest) when isTyparTy g selfTy && isInterfaceTy g tyR -> + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace tyR selfTy + | _ -> + errorR(Error(FSComp.SR.tcInvalidSelfConstraint(), m)) + tpenv + and TcConstraintWhereTyparIsEnum cenv env newOk checkConstraints tpenv tp synUnderlingTys m = let tpR, tpenv = TcTypar cenv env newOk tpenv tp let tpenv = match synUnderlingTys with | [synUnderlyingTy] -> - let underlyingTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType env tpenv synUnderlyingTy + let underlyingTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synUnderlyingTy AddCxTypeIsEnum env.DisplayEnv cenv.css m NoTrace (mkTyparTy tpR) underlyingTy tpenv | _ -> @@ -4271,8 +4318,8 @@ and TcConstraintWhereTyparIsDelegate cenv env newOk checkConstraints occ tpenv t let tpR, tpenv = TcTypar cenv env newOk tpenv tp match synTys with | [a;b] -> - let a', tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv a - let b', tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv b + let a', tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv a + let b', tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv b AddCxTypeIsDelegate env.DisplayEnv cenv.css m NoTrace (mkTyparTy tpR) a' b' tpenv | _ -> @@ -4303,7 +4350,7 @@ and TcSimpleTyparConstraint cenv env newOk tpenv tp m constraintAdder = and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = let g = cenv.g - let tys, tpenv = List.mapFold (TcTypeAndRecover cenv newOk CheckCxs ItemOccurence.UseInType env) tpenv synTypes + let tys, tpenv = List.mapFold (TcTypeAndRecover cenv newOk CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env) tpenv synTypes match synMemberSig with | SynMemberSig.Member (synValSig, memberFlags, m) -> @@ -4319,6 +4366,15 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = let argTys = List.concat curriedArgInfos let argTys = List.map fst argTys let logicalCompiledName = ComputeLogicalName id memberFlags + for argInfos in curriedArgInfos do + for argInfo in argInfos do + let info = CrackParamAttribsInfo g argInfo + let (ParamAttribs(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo)) = info + if isParamArrayArg || isInArg || isOutArg || optArgInfo.IsOptional || callerInfo <> CallerInfo.NoCallerInfo || reflArgInfo <> ReflectedArgInfo.None then + if g.langVersion.SupportsFeature(LanguageFeature.InterfacesWithAbstractStaticMembers) then + errorR(Error(FSComp.SR.tcTraitMayNotUseComplexThings(), m)) + else + warning(Error(FSComp.SR.tcTraitMayNotUseComplexThings(), m)) let item = Item.ArgName (Some id, memberConstraintTy, None, id.idRange) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.AccessRights) @@ -4370,7 +4426,7 @@ and TcValSpec cenv env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv allDeclaredTypars |> List.iter (SetTyparRigid env.DisplayEnv m) // Process the type, including any constraints - let declaredTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType envinner tpenv ty + let declaredTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints ItemOccurence.UseInType WarnOnIWSAM.Yes envinner tpenv ty match memFlagsOpt, thisTyOpt with | Some memberFlags, Some thisTy -> @@ -4528,7 +4584,7 @@ and TcTypeOrMeasureParameter kindOpt cenv (env: TcEnv) newOk tpenv (SynTypar(id, tpR, AddUnscopedTypar key tpR tpenv -and TcTypar cenv env newOk tpenv tp = +and TcTypar cenv env newOk tpenv tp : Typar * UnscopedTyparEnv = TcTypeOrMeasureParameter (Some TyparKind.Type) cenv env newOk tpenv tp and TcTyparDecl cenv env synTyparDecl = @@ -4563,7 +4619,7 @@ and TcTyparDecls cenv env synTypars = /// If kindOpt=Some kind, then this is the kind we're expecting (we're doing kind checking) /// If kindOpt=None, we need to determine the kind (we're doing kind inference) /// -and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) synTy = +and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ (iwsam: WarnOnIWSAM) env (tpenv: UnscopedTyparEnv) synTy = let g = cenv.g match synTy with @@ -4572,13 +4628,13 @@ and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env (tpenv: Unscoped g.obj_ty, tpenv | SynType.LongIdent synLongId -> - TcLongIdent kindOpt cenv newOk checkConstraints occ env tpenv synLongId + TcLongIdentType kindOpt cenv newOk checkConstraints occ iwsam env tpenv synLongId | SynType.App (StripParenTypes (SynType.LongIdent longId), _, args, _, _, postfix, m) -> - TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId postfix args m + TcLongIdentAppType kindOpt cenv newOk checkConstraints occ iwsam env tpenv longId postfix args m | SynType.LongIdentApp (synLeftTy, synLongId, _, args, _commas, _, m) -> - TcNestedAppType cenv newOk checkConstraints occ env tpenv synLeftTy synLongId args m + TcNestedAppType cenv newOk checkConstraints occ iwsam env tpenv synLeftTy synLongId args m | SynType.Tuple(isStruct, segments, m) -> TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct segments m @@ -4625,13 +4681,27 @@ and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env (tpenv: Unscoped TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m | SynType.Paren(innerType, _) -> - TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env tpenv innerType + TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv innerType -and TcLongIdent kindOpt cenv newOk checkConstraints occ env tpenv synLongId = +and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref = + let g = cenv.g + let ad = env.eAccessRights + let ty = generalizedTyconRef g tcref + if iwsam = WarnOnIWSAM.Yes && isInterfaceTy g ty && checkConstraints = CheckCxs then + let tcref = tcrefOfAppTy g ty + let meths = AllMethInfosOfTypeInScope ResultCollectionSettings.AllResults cenv.infoReader env.NameEnv None ad IgnoreOverrides m ty + if meths |> List.exists (fun meth -> not meth.IsInstance && meth.IsDispatchSlot) then + warning(Error(FSComp.SR.tcUsingInterfaceWithStaticAbstractMethodAsType(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) + +and TcLongIdentType kindOpt cenv newOk checkConstraints occ iwsam env tpenv synLongId = let (SynLongIdent(tc, _, _)) = synLongId let m = synLongId.Range let ad = env.eAccessRights + let tinstEnclosing, tcref = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver occ OpenQualified env.NameEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) + + CheckIWSAM cenv env checkConstraints iwsam m tcref + match kindOpt, tcref.TypeOrMeasureKind with | Some TyparKind.Type, TyparKind.Measure -> error(Error(FSComp.SR.tcExpectedTypeNotUnitOfMeasure(), m)) @@ -4646,7 +4716,7 @@ and TcLongIdent kindOpt cenv newOk checkConstraints occ env tpenv synLongId = /// Some.Long.TypeName /// ty1 SomeLongTypeName -and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId postfix args m = +and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ iwsam env tpenv longId postfix args m = let (SynLongIdent(tc, _, _)) = longId let ad = env.eAccessRights @@ -4655,6 +4725,8 @@ and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInType OpenQualified env.eNameResEnv ad tc tyResInfo PermitDirectReferenceToGeneratedType.No |> ForceRaise + CheckIWSAM cenv env checkConstraints iwsam m tcref + match kindOpt, tcref.TypeOrMeasureKind with | Some TyparKind.Type, TyparKind.Measure -> error(Error(FSComp.SR.tcExpectedTypeNotUnitOfMeasure(), m)) @@ -4679,11 +4751,11 @@ and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ env tpenv longId errorR(Error(FSComp.SR.tcUnitsOfMeasureInvalidInTypeConstructor(), m)) NewErrorType (), tpenv -and TcNestedAppType cenv newOk checkConstraints occ env tpenv synLeftTy synLongId args m = +and TcNestedAppType cenv newOk checkConstraints occ iwsam env tpenv synLeftTy synLongId args m = let g = cenv.g let ad = env.eAccessRights let (SynLongIdent(longId, _, _)) = synLongId - let leftTy, tpenv = TcType cenv newOk checkConstraints occ env tpenv synLeftTy + let leftTy, tpenv = TcType cenv newOk checkConstraints occ iwsam env tpenv synLeftTy match leftTy with | AppTy g (tcref, tinst) -> let tcref = ResolveTypeLongIdentInTyconRef cenv.tcSink cenv.nameResolver env.eNameResEnv (TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length)) ad m tcref longId @@ -4734,14 +4806,14 @@ and TcAnonRecdType cenv newOk checkConstraints occ env tpenv isStruct args m = and TcFunctionType cenv newOk checkConstraints occ env tpenv domainTy resultTy = let g = cenv.g - let domainTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv domainTy - let resultTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv resultTy + let domainTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv domainTy + let resultTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv resultTy let tyR = mkFunTy g domainTyR resultTyR tyR, tpenv and TcElementType cenv newOk checkConstraints occ env tpenv rank elemTy m = let g = cenv.g - let elemTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv elemTy + let elemTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv elemTy let tyR = mkArrayTy g rank elemTy m tyR, tpenv @@ -4759,14 +4831,14 @@ and TcAnonType kindOpt cenv newOk tpenv m = | TyparKind.Type -> mkTyparTy tp, tpenv and TcTypeWithConstraints cenv env newOk checkConstraints occ tpenv synTy synConstraints = - let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv synTy + let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv synTy let tpenv = TcTyparConstraints cenv newOk checkConstraints occ env tpenv synConstraints ty, tpenv // #typ and TcTypeHashConstraint cenv env newOk checkConstraints occ tpenv synTy m = let tp = TcAnonTypeOrMeasure (Some TyparKind.Type) cenv TyparRigidity.WarnIfNotRigid TyparDynamicReq.Yes newOk m - let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv synTy + let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.No env tpenv synTy AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace ty (mkTyparTy tp) tp.AsType, tpenv @@ -4816,8 +4888,8 @@ and TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args errorR(Error(FSComp.SR.tcIllegalSyntaxInTypeExpression(), m)) NewErrorType (), tpenv -and TcType cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) ty = - TcTypeOrMeasure (Some TyparKind.Type) cenv newOk checkConstraints occ env tpenv ty +and TcType cenv newOk checkConstraints occ iwsam env (tpenv: UnscopedTyparEnv) ty = + TcTypeOrMeasure (Some TyparKind.Type) cenv newOk checkConstraints occ iwsam env tpenv ty and TcMeasure cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (StripParenTypes ty) m = match ty with @@ -4825,7 +4897,7 @@ and TcMeasure cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (Str error(Error(FSComp.SR.tcAnonymousUnitsOfMeasureCannotBeNested(), m)) NewErrorMeasure (), tpenv | _ -> - match TcTypeOrMeasure (Some TyparKind.Measure) cenv newOk checkConstraints occ env tpenv ty with + match TcTypeOrMeasure (Some TyparKind.Measure) cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv ty with | TType_measure ms, tpenv -> ms, tpenv | _ -> error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) @@ -4847,8 +4919,8 @@ and TcAnonTypeOrMeasure kindOpt _cenv rigid dyn newOk m = NewAnonTypar (kind, m, rigid, TyparStaticReq.None, dyn) -and TcTypes cenv newOk checkConstraints occ env tpenv args = - List.mapFold (TcTypeAndRecover cenv newOk checkConstraints occ env) tpenv args +and TcTypes cenv newOk checkConstraints occ iwsam env tpenv args = + List.mapFold (TcTypeAndRecover cenv newOk checkConstraints occ iwsam env) tpenv args and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv (args: SynTupleTypeSegment list) m = let hasASlash = @@ -4860,9 +4932,9 @@ and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv (args: SynTupleType let args : SynType list = getTypeFromTuplePath args match args with | [] -> error(InternalError("empty tuple type", m)) - | [ty] -> let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty in [ty], tpenv + | [ty] -> let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv ty in [ty], tpenv | ty :: args -> - let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty + let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv ty let args = List.map SynTupleTypeSegment.Type args let tys, tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m ty :: tys, tpenv @@ -4887,10 +4959,10 @@ and TcMeasuresAsTuple cenv newOk checkConstraints occ env (tpenv: UnscopedTyparE and TcTypesOrMeasures optKinds cenv newOk checkConstraints occ env tpenv args m = match optKinds with | None -> - List.mapFold (TcTypeOrMeasure None cenv newOk checkConstraints occ env) tpenv args + List.mapFold (TcTypeOrMeasure None cenv newOk checkConstraints occ WarnOnIWSAM.Yes env) tpenv args | Some kinds -> if List.length kinds = List.length args then - List.mapFold (fun tpenv (arg, kind) -> TcTypeOrMeasure (Some kind) cenv newOk checkConstraints occ env tpenv arg) tpenv (List.zip args kinds) + List.mapFold (fun tpenv (arg, kind) -> TcTypeOrMeasure (Some kind) cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv arg) tpenv (List.zip args kinds) elif isNil kinds then error(Error(FSComp.SR.tcUnexpectedTypeArguments(), m)) else error(Error(FSComp.SR.tcTypeParameterArityMismatch((List.length kinds), (List.length args)), m)) @@ -5122,15 +5194,15 @@ and TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref pathTypeArgs (sy if checkConstraints = CheckCxs then List.iter2 (UnifyTypes cenv env m) tinst actualArgTys - // Try to decode System.Tuple --> F~ tuple types etc. + // Try to decode System.Tuple --> F# tuple types etc. let ty = g.decompileType tcref actualArgTys ty, tpenv -and TcTypeOrMeasureAndRecover kindOpt cenv newOk checkConstraints occ env tpenv ty = +and TcTypeOrMeasureAndRecover kindOpt cenv newOk checkConstraints occ iwsam env tpenv ty = let g = cenv.g try - TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ env tpenv ty + TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv ty with e -> errorRecovery e ty.Range @@ -5143,10 +5215,10 @@ and TcTypeOrMeasureAndRecover kindOpt cenv newOk checkConstraints occ env tpenv recoveryTy, tpenv -and TcTypeAndRecover cenv newOk checkConstraints occ env tpenv ty = - TcTypeOrMeasureAndRecover (Some TyparKind.Type) cenv newOk checkConstraints occ env tpenv ty +and TcTypeAndRecover cenv newOk checkConstraints occ iwsam env tpenv ty = + TcTypeOrMeasureAndRecover (Some TyparKind.Type) cenv newOk checkConstraints occ iwsam env tpenv ty -and TcNestedTypeApplication cenv newOk checkConstraints occ env tpenv mWholeTypeApp ty pathTypeArgs tyargs = +and TcNestedTypeApplication cenv newOk checkConstraints occ iwsam env tpenv mWholeTypeApp ty pathTypeArgs tyargs = let g = cenv.g let ty = convertToTypeWithMetadataIfPossible g ty @@ -5156,6 +5228,7 @@ and TcNestedTypeApplication cenv newOk checkConstraints occ env tpenv mWholeType match ty with | TType_app(tcref, _, _) -> + CheckIWSAM cenv env checkConstraints iwsam mWholeTypeApp tcref TcTypeApp cenv newOk checkConstraints occ env tpenv mWholeTypeApp tcref pathTypeArgs tyargs | _ -> error(InternalError("TcNestedTypeApplication: expected type application", mWholeTypeApp)) @@ -5498,6 +5571,17 @@ and TcExprThen cenv overallTy env tpenv isArg synExpr delayed = warning(Error(FSComp.SR.tcIndexNotationDeprecated(), mDot)) TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv (Some (expr3, mOfLeftOfSet)) expr1 indexArgs delayed + // Part of 'T.Ident + | SynExpr.Typar (typar, m) -> + TcTyparExprThen cenv overallTy env tpenv typar m delayed + + // ^expr + | SynExpr.IndexFromEnd (rightExpr, m) -> + errorR(Error(FSComp.SR.tcTraitInvocationShouldUseTick(), m)) + // Incorporate the '^' into the rightExpr, producing a nested SynExpr.Typar + let adjustedExpr = ParseHelpers.adjustHatPrefixToTyparLookup m rightExpr + TcExprThen cenv overallTy env tpenv isArg adjustedExpr delayed + | _ -> match delayed with | [] -> TcExprUndelayed cenv overallTy env tpenv synExpr @@ -5680,8 +5764,16 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = let env = ShrinkContext env mWholeExprIncludingParentheses expr2.Range TcExpr cenv overallTy env tpenv expr2 - | SynExpr.DotIndexedGet _ | SynExpr.DotIndexedSet _ - | SynExpr.TypeApp _ | SynExpr.Ident _ | SynExpr.LongIdent _ | SynExpr.App _ | SynExpr.Dynamic _ | SynExpr.DotGet _ -> error(Error(FSComp.SR.tcExprUndelayed(), synExpr.Range)) + | SynExpr.DotIndexedGet _ + | SynExpr.DotIndexedSet _ + | SynExpr.Typar _ + | SynExpr.TypeApp _ + | SynExpr.Ident _ + | SynExpr.LongIdent _ + | SynExpr.App _ + | SynExpr.Dynamic _ + | SynExpr.DotGet _ -> + error(Error(FSComp.SR.tcExprUndelayed(), synExpr.Range)) | SynExpr.Const (SynConst.String (s, _, m), _) -> TcNonControlFlowExpr env <| fun env -> @@ -5768,7 +5860,7 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = TcExprArrayOrList cenv overallTy env tpenv (isArray, args, m) | SynExpr.New (superInit, synObjTy, arg, mNewExpr) -> - let objTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.Use env tpenv synObjTy + let objTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.Use WarnOnIWSAM.Yes env tpenv synObjTy TcNonControlFlowExpr env <| fun env -> TcPropagatingExprLeafThenConvert cenv overallTy objTy env (* true *) mNewExpr (fun () -> @@ -5918,7 +6010,15 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = | SynExpr.MatchBang (range=m) -> error(Error(FSComp.SR.tcConstructRequiresComputationExpression(), m)) - | SynExpr.IndexFromEnd (range=m) + // Part of 'T.Ident + | SynExpr.Typar (typar, m) -> + TcTyparExprThen cenv overallTy env tpenv typar m [] + + | SynExpr.IndexFromEnd (rightExpr, m) -> + errorR(Error(FSComp.SR.tcTraitInvocationShouldUseTick(), m)) + let adjustedExpr = ParseHelpers.adjustHatPrefixToTyparLookup m rightExpr + TcExprUndelayed cenv overallTy env tpenv adjustedExpr + | SynExpr.IndexRange (range=m) -> error(Error(FSComp.SR.tcInvalidIndexerExpression(), m)) @@ -5951,7 +6051,7 @@ and TcExprMatchLambda cenv overallTy env tpenv (isExnMatch, mArg, clauses, spMat overallExpr, tpenv and TcExprTypeAnnotated cenv overallTy env tpenv (synBodyExpr, synType, m) = - let tgtTy, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synType + let tgtTy, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synType UnifyOverallType cenv env m overallTy tgtTy let bodyExpr, tpenv = TcExpr cenv (MustConvertTo (false, tgtTy)) env tpenv synBodyExpr let bodyExpr2 = TcAdjustExprForTypeDirectedConversions cenv overallTy tgtTy env m bodyExpr @@ -5961,7 +6061,7 @@ and TcExprTypeTest cenv overallTy env tpenv (synInnerExpr, tgtTy, m) = let g = cenv.g let innerExpr, srcTy, tpenv = TcExprOfUnknownType cenv env tpenv synInnerExpr UnifyTypes cenv env m overallTy.Commit g.bool_ty - let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tgtTy + let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv tgtTy TcRuntimeTypeTest false true cenv env.DisplayEnv m tgtTy srcTy let expr = mkCallTypeTest g m tgtTy innerExpr expr, tpenv @@ -5971,7 +6071,7 @@ and TcExprUpcast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = let tgtTy, tpenv = match synExpr with | SynExpr.Upcast (_, tgtTy, m) -> - let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tgtTy + let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv tgtTy UnifyTypes cenv env m tgtTy overallTy.Commit tgtTy, tpenv | SynExpr.InferredUpcast _ -> @@ -5989,7 +6089,7 @@ and TcExprDowncast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = let tgtTy, tpenv, isOperator = match synExpr with | SynExpr.Downcast (_, tgtTy, m) -> - let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tgtTy + let tgtTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv tgtTy UnifyTypes cenv env m tgtTy overallTy.Commit tgtTy, tpenv, true | SynExpr.InferredDowncast _ -> overallTy.Commit, tpenv, false @@ -6071,13 +6171,13 @@ and TcExprObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImp let mObjTy = synObjTy.Range - let objTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synObjTy + let objTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synObjTy // Work out the type of any interfaces to implement let extraImpls, tpenv = (tpenv, extraImpls) ||> List.mapFold (fun tpenv (SynInterfaceImpl(synIntfTy, _mWith, bindings, members, m)) -> let overrides = unionBindingAndMembers bindings members - let intfTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synIntfTy + let intfTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synIntfTy if not (isInterfaceTy g intfTy) then error(Error(FSComp.SR.tcExpectedInterfaceType(), m)) if isErasedType g intfTy then @@ -6248,16 +6348,15 @@ and TcExprNamedIndexPropertySet cenv overallTy env tpenv (synLongId, synExpr1, s [ DelayedApp(ExprAtomicFlag.Atomic, false, None, synExpr1, mStmt) MakeDelayedSet(synExpr2, mStmt) ] -and TcExprTraitCall cenv overallTy env tpenv (tps, synMemberSig, arg, m) = +and TcExprTraitCall cenv overallTy env tpenv (synTypes, synMemberSig, arg, m) = let g = cenv.g TcNonPropagatingExprLeafThenConvert cenv overallTy env m (fun () -> - let synTypes = tps |> List.map (fun tp -> SynType.Var(tp, m)) let traitInfo, tpenv = TcPseudoMemberSpec cenv NewTyparsOK env synTypes tpenv synMemberSig m - if BakedInTraitConstraintNames.Contains traitInfo.MemberName then - warning(BakedInMemberConstraintName(traitInfo.MemberName, m)) + if BakedInTraitConstraintNames.Contains traitInfo.MemberLogicalName then + warning(BakedInMemberConstraintName(traitInfo.MemberLogicalName, m)) - let argTys = traitInfo.ArgumentTypes - let returnTy = GetFSharpViewOfReturnType g traitInfo.ReturnType + let argTys = traitInfo.CompiledObjectAndArgumentTypes + let returnTy = traitInfo.GetReturnType g let args, namedCallerArgs = GetMethodArgs arg if not (isNil namedCallerArgs) then errorR(Error(FSComp.SR.tcNamedArgumentsCannotBeUsedInMemberTraits(), m)) // Subsumption at trait calls if arguments have nominal type prior to unification of any arguments or return type @@ -6297,11 +6396,11 @@ and TcExprILAssembly cenv overallTy env tpenv (ilInstrs, synTyArgs, synArgs, syn let g = cenv.g let ilInstrs = (ilInstrs :?> ILInstr[]) let argTys = NewInferenceTypes g synArgs - let tyargs, tpenv = TcTypes cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synTyArgs + let tyargs, tpenv = TcTypes cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synTyArgs // No subsumption at uses of IL assembly code let flexes = argTys |> List.map (fun _ -> false) let args, tpenv = TcExprsWithFlexes cenv env m tpenv flexes argTys synArgs - let retTys, tpenv = TcTypes cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synRetTys + let retTys, tpenv = TcTypes cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synRetTys let returnTy = match retTys with | [] -> g.unit_ty @@ -6373,26 +6472,57 @@ and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = conditionallySuppressErrorReporting (not isFirst && synExprContainsError e) (fun () -> TcExpr cenv overallTy env tpenv e) -and (|IndexArgOptionalFromEnd|) indexArg = +and TcTyparExprThen cenv overallTy env tpenv synTypar m delayed = + match delayed with + //'T .Ident + //^T .Ident (args) .. + | DelayedDotLookup (ident :: rest, m2) :: delayed2 -> + let ad = env.eAccessRights + let tp, tpenv = TcTypar cenv env NoNewTypars tpenv synTypar + let mExprAndLongId = unionRanges synTypar.Range ident.idRange + let ty = mkTyparTy tp + let item, _rest = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr ident.idRange ad ident IgnoreOverrides TypeNameResolutionInfo.Default ty + let delayed3 = + match rest with + | [] -> delayed2 + | _ -> DelayedDotLookup (rest, m2) :: delayed2 + CallNameResolutionSink cenv.tcSink (ident.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.AccessRights) + TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 + //TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution + | _ -> + let (SynTypar(_, q, _)) = synTypar + let msg = + match q with + | TyparStaticReq.None -> FSComp.SR.parsIncompleteTyparExpr1() + | TyparStaticReq.HeadType -> FSComp.SR.parsIncompleteTyparExpr2() + error (Error(msg, m)) + +and (|IndexArgOptionalFromEnd|) (cenv: cenv) indexArg = match indexArg with - | SynExpr.IndexFromEnd (a, m) -> (a, true, m) + | SynExpr.IndexFromEnd (a, m) -> + if not (cenv.g.langVersion.SupportsFeature LanguageFeature.FromEndSlicing) then + errorR (Error(FSComp.SR.fromEndSlicingRequiresVFive(), m)) + (a, true, m) | _ -> (indexArg, false, indexArg.Range) -and DecodeIndexArg indexArg = +and DecodeIndexArg cenv indexArg = match indexArg with | SynExpr.IndexRange (info1, _opm, info2, m1, m2, _) -> let info1 = match info1 with - | Some (IndexArgOptionalFromEnd (expr1, isFromEnd1, _)) -> Some (expr1, isFromEnd1) + | Some (IndexArgOptionalFromEnd cenv (expr1, isFromEnd1, _)) -> Some (expr1, isFromEnd1) | None -> None let info2 = match info2 with - | Some (IndexArgOptionalFromEnd (synExpr2, isFromEnd2, _)) -> Some (synExpr2, isFromEnd2) + | Some (IndexArgOptionalFromEnd cenv (synExpr2, isFromEnd2, _)) -> Some (synExpr2, isFromEnd2) | None -> None IndexArgRange (info1, info2, m1, m2) - | IndexArgOptionalFromEnd (expr, isFromEnd, m) -> + | IndexArgOptionalFromEnd cenv (expr, isFromEnd, m) -> IndexArgItem(expr, isFromEnd, m) +and DecodeIndexArgs cenv indexArgs = + indexArgs |> List.map (DecodeIndexArg cenv) + and (|IndexerArgs|) expr = match expr with | SynExpr.Tuple (false, argExprs, _, _) -> argExprs @@ -6400,11 +6530,11 @@ and (|IndexerArgs|) expr = and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv (setInfo: _ option) synLeftExpr indexArgs delayed = let leftExpr, leftExprTy, tpenv = TcExprOfUnknownType cenv env tpenv synLeftExpr - let expandedIndexArgs = ExpandIndexArgs (Some synLeftExpr) indexArgs + let expandedIndexArgs = ExpandIndexArgs cenv (Some synLeftExpr) indexArgs TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo (Some synLeftExpr) leftExpr leftExprTy expandedIndexArgs indexArgs delayed // Eliminate GetReverseIndex from index args -and ExpandIndexArgs (synLeftExprOpt: SynExpr option) indexArgs = +and ExpandIndexArgs cenv (synLeftExprOpt: SynExpr option) indexArgs = // xs.GetReverseIndex rank offset - 1 let rewriteReverseExpr (rank: int) (offset: SynExpr) (range: range) = @@ -6429,7 +6559,7 @@ and ExpandIndexArgs (synLeftExprOpt: SynExpr option) indexArgs = let expandedIndexArgs = indexArgs |> List.mapi ( fun pos indexerArg -> - match DecodeIndexArg indexerArg with + match DecodeIndexArg cenv indexerArg with | IndexArgItem(expr, fromEnd, range) -> [ if fromEnd then rewriteReverseExpr pos expr range else expr ] | IndexArgRange(info1, info2, range1, range2) -> @@ -6461,7 +6591,7 @@ and TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo synLeftExprO // Find the first type in the effective hierarchy that either has a DefaultMember attribute OR // has a member called 'Item' - let isIndex = indexArgs |> List.forall (fun indexArg -> match DecodeIndexArg indexArg with IndexArgItem _ -> true | _ -> false) + let isIndex = indexArgs |> List.forall (fun indexArg -> match DecodeIndexArg cenv indexArg with IndexArgItem _ -> true | _ -> false) let propName = if isIndex then FoldPrimaryHierarchyOfType (fun ty acc -> @@ -6492,7 +6622,7 @@ and TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo synLeftExprO let idxRange = indexArgs |> List.map (fun e -> e.Range) |> List.reduce unionRanges let MakeIndexParam setSliceArrayOption = - match List.map DecodeIndexArg indexArgs with + match DecodeIndexArgs cenv indexArgs with | [] -> failwith "unexpected empty index list" | [IndexArgItem _] -> SynExpr.Paren (expandedIndexArgs.Head, range0, None, idxRange) | _ -> SynExpr.Paren (SynExpr.Tuple (false, expandedIndexArgs @ Option.toList setSliceArrayOption, [], idxRange), range0, None, idxRange) @@ -6504,7 +6634,7 @@ and TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo synLeftExprO let info = if isArray then let fixedIndex3d4dEnabled = g.langVersion.SupportsFeature LanguageFeature.FixedIndexSlice3d4d - let indexArgs = List.map DecodeIndexArg indexArgs + let indexArgs = List.map (DecodeIndexArg cenv) indexArgs match indexArgs, setInfo with | [IndexArgItem _; IndexArgItem _], None -> Some (indexOpPath, "GetArray2D", expandedIndexArgs) | [IndexArgItem _; IndexArgItem _; IndexArgItem _;], None -> Some (indexOpPath, "GetArray3D", expandedIndexArgs) @@ -6572,7 +6702,7 @@ and TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo synLeftExprO | _ -> None elif isString then - match List.map DecodeIndexArg indexArgs, setInfo with + match DecodeIndexArgs cenv indexArgs, setInfo with | [IndexArgRange _], None -> Some (sliceOpPath, "GetStringSlice", expandedIndexArgs) | [IndexArgItem _], None -> Some (indexOpPath, "GetString", expandedIndexArgs) | _ -> None @@ -6675,7 +6805,7 @@ and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt ite | Some mObjTy, None -> ForNewConstructors cenv.tcSink env mObjTy methodName minfos | None, _ -> AfterResolution.DoNothing - TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic delayed + TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic None delayed | Item.DelegateCtor ty, [arg] -> // Re-record the name resolution since we now know it's a constructor call @@ -7068,7 +7198,7 @@ and TcObjectExpr cenv env tpenv (objTy, realObjTy, argopt, binds, extraImpls, mO let afterResolution = ForNewConstructors cenv.tcSink env mObjTy methodName minfos let ad = env.AccessRights - let expr, tpenv = TcMethodApplicationThen cenv env (MustEqual objTy) None tpenv None [] mWholeExpr mObjTy methodName ad PossiblyMutates false meths afterResolution CtorValUsedAsSuperInit [arg] ExprAtomicFlag.Atomic [] + let expr, tpenv = TcMethodApplicationThen cenv env (MustEqual objTy) None tpenv None [] mWholeExpr mObjTy methodName ad PossiblyMutates false meths afterResolution CtorValUsedAsSuperInit [arg] ExprAtomicFlag.Atomic None [] // The 'base' value is always bound let baseIdOpt = (match baseIdOpt with None -> Some(ident("base", mObjTy)) | Some id -> Some id) expr, baseIdOpt, tpenv @@ -7344,7 +7474,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn let tyExprs = percentATys |> Array.map (mkCallTypeOf g m) |> Array.toList mkArray (g.system_Type_ty, tyExprs, m) - let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr] + let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr] None if isString then TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () -> @@ -7367,7 +7497,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn let argsExpr = mkArray (g.obj_ty, fillExprsBoxed, m) // FormattableString are *always* turned into FormattableStringFactory.Create calls, boxing each argument - let createExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false createFormattableStringMethod NormalValUse [] [dotnetFormatStringExpr; argsExpr] [] + let createExpr, _ = BuildPossiblyConditionalMethodCall cenv env NeverMutates m false createFormattableStringMethod NormalValUse [] [dotnetFormatStringExpr; argsExpr] [] None let resultExpr = if typeEquiv g overallTy.Commit g.system_IFormattable_ty then @@ -7785,13 +7915,13 @@ and TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, synPat, s let bodyExprFixup elemVar bodyExpr = let elemAddrVar, _ = mkCompGenLocal mIn "addr" elemAddrTy let e = mkInvisibleLet mIn elemVar (mkAddrGet mIn (mkLocalValRef elemAddrVar)) bodyExpr - let getItemCallExpr, _ = BuildMethodCall tcVal g cenv.amap PossiblyMutates mWholeExpr true getItemMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [ idxExpr ] + let getItemCallExpr, _ = BuildMethodCall tcVal g cenv.amap PossiblyMutates mWholeExpr true getItemMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [ idxExpr ] None mkInvisibleLet mIn elemAddrVar getItemCallExpr e // Evaluate the span expression once and put it in spanVar let overallExprFixup overallExpr = mkLet spForBind mFor spanVar enumExpr overallExpr - let getLengthCallExpr, _ = BuildMethodCall tcVal g cenv.amap PossiblyMutates mWholeExpr true getLengthMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [] + let getLengthCallExpr, _ = BuildMethodCall tcVal g cenv.amap PossiblyMutates mWholeExpr true getLengthMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [] None // Ask for a loop over integers for the given range (elemTy, bodyExprFixup, overallExprFixup, Choice2Of3 (idxVar, mkZero g mFor, mkDecr g mFor getLengthCallExpr)) @@ -7939,7 +8069,7 @@ and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableEx // See RFC FS-1053.md let isAddrOf = match expr with - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [], _), _) + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [], _)) when (valRefEq g vref g.addrof_vref || valRefEq g vref g.nativeptr_tobyref_vref) -> true | _ -> false @@ -8113,7 +8243,7 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = | Item.FakeInterfaceCtor _ -> false | _ -> true) -> let overallTy = match overallTyOpt with None -> MustEqual (NewInferenceType g) | Some t -> t - let _, _ = TcItemThen cenv overallTy env tpenv res delayed + let _, _ = TcItemThen cenv overallTy env tpenv res None delayed true | _ -> false @@ -8168,7 +8298,7 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = // expr : type" allowed with no subsequent qualifications | SynExpr.Typed (synBodyExpr, synType, _) when delayed.IsEmpty && overallTyOpt.IsNone -> - let tgtTy, _tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synType + let tgtTy, _tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synType check (Some (MustEqual tgtTy)) resultOpt synBodyExpr delayed | _ -> @@ -8230,9 +8360,9 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE | _ -> () match leftExpr with - | ApplicableExpr(_, NameOfExpr g _, _) when g.langVersion.SupportsFeature LanguageFeature.NameOf -> + | ApplicableExpr(expr=NameOfExpr g _) when g.langVersion.SupportsFeature LanguageFeature.NameOf -> let replacementExpr = TcNameOfExpr cenv env tpenv synArg - TcDelayed cenv overallTy env tpenv mExprAndArg (ApplicableExpr(cenv, replacementExpr, true)) g.string_ty ExprAtomicFlag.Atomic delayed + TcDelayed cenv overallTy env tpenv mExprAndArg (ApplicableExpr(cenv, replacementExpr, true, None)) g.string_ty ExprAtomicFlag.Atomic delayed | _ -> // Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library. // Set a flag in the syntax tree to say we noticed a leading 'seq' @@ -8243,7 +8373,7 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE match synArg with | SynExpr.ComputationExpr (false, comp, m) when (match leftExpr with - | ApplicableExpr(_, Expr.Op(TOp.Coerce, _, [SeqExpr g], _), _) -> true + | ApplicableExpr(expr=Expr.Op(TOp.Coerce, _, [SeqExpr g], _)) -> true | _ -> false) -> SynExpr.ComputationExpr (true, comp, m) | _ -> synArg @@ -8254,8 +8384,8 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE // will have debug points on "f expr1" and "g expr2" let env = match leftExpr with - | ApplicableExpr(_, Expr.Val (vref, _, _), _) - | ApplicableExpr(_, Expr.App (Expr.Val (vref, _, _), _, _, [_], _), _) + | ApplicableExpr(expr=Expr.Val (vref, _, _)) + | ApplicableExpr(expr=Expr.App (Expr.Val (vref, _, _), _, _, [_], _)) when valRefEq g vref g.and_vref || valRefEq g vref g.and2_vref || valRefEq g vref g.or_vref @@ -8279,7 +8409,7 @@ and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftE isAdjacentListExpr isSugar atomicFlag synLeftExprOpt synArg && g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot -> - let expandedIndexArgs = ExpandIndexArgs synLeftExprOpt indexArgs + let expandedIndexArgs = ExpandIndexArgs cenv synLeftExprOpt indexArgs let setInfo, delayed = match delayed with | DelayedSet(expr3, _) :: rest -> Some (expr3, unionRanges leftExpr.Range synArg.Range), rest @@ -8321,14 +8451,14 @@ and TcLongIdentThen cenv (overallTy: OverallTy) env tpenv (SynLongIdent(longId, let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId |> ForceRaise - TcItemThen cenv overallTy env tpenv nameResolutionResult delayed + TcItemThen cenv overallTy env tpenv nameResolutionResult None delayed //------------------------------------------------------------------------- // Typecheck "item+projections" //------------------------------------------------------------------------- *) // mItem is the textual range covered by the long identifiers that make up the item -and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) delayed = +and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = let delayed = delayRest rest mItem delayed match item with // x where x is a union case or active pattern result tag. @@ -8339,7 +8469,10 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed | Item.MethodGroup (methodName, minfos, _) -> - TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution delayed + TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed + + | Item.Trait traitInfo -> + TcTraitItemThen cenv overallTy env None traitInfo tpenv mItem delayed | Item.CtorGroup(nm, minfos) -> TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed @@ -8357,7 +8490,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed | Item.Property (nm, pinfos) -> - TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution delayed + TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution staticTyOpt delayed | Item.ILField finfo -> TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed @@ -8375,7 +8508,19 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte | None -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly nm, mItem)) | Some usageText -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly2(nm, usageText), mItem)) - | _ -> error(Error(FSComp.SR.tcLookupMayNotBeUsedHere(), mItem)) + // These items are not expected here - they are only used for reporting symbols from name resolution to language service + | Item.ActivePatternCase _ + | Item.AnonRecdField _ + | Item.ArgName _ + | Item.CustomBuilder _ + | Item.ModuleOrNamespaces _ + | Item.NewDef _ + | Item.SetterArg _ + | Item.TypeVar _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.Types(_, []) -> + error(Error(FSComp.SR.tcLookupMayNotBeUsedHere(), mItem)) /// Type check the application of a union case. Also used to cover constructions of F# exception values, and /// applications of active pattern result labels. @@ -8537,18 +8682,18 @@ and TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed = // If Item.Types is returned then the ty will be of the form TType_app(tcref, genericTyargs) where tyargs // is a fresh instantiation for tcref. TcNestedTypeApplication will chop off precisely #genericTyargs args // and replace them by 'tyargs' - let ty, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs ty tinstEnclosing tyargs + let ty, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv mExprAndTypeArgs ty tinstEnclosing tyargs // Report information about the whole expression including type arguments to VS let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) let typeNameResInfo = GetLongIdentTypeNameInfo otherDelayed let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true - TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) otherDelayed + TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) None otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: _delayed' -> // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! - let ty, _ = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs ty tinstEnclosing tyargs + let ty, _ = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv mExprAndTypeArgs ty tinstEnclosing tyargs let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights) @@ -8561,13 +8706,13 @@ and TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed = // call to ResolveLongIdentAsExprAndComputeRange error(Error(FSComp.SR.tcInvalidUseOfTypeName(), mItem)) -and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution delayed = +and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed = let ad = env.eAccessRights // Static method calls Type.Foo(arg1, ..., argn) let meths = List.map (fun minfo -> minfo, None) minfos match delayed with | DelayedApp (atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | DelayedTypeApp(tys, mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -8581,9 +8726,9 @@ and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem after match otherDelayed with | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [arg] atomicFlag otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | _ -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndTypeArgs mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [] ExprAtomicFlag.Atomic otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndTypeArgs mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed | None -> #endif @@ -8597,16 +8742,16 @@ and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem after match otherDelayed with | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | _ -> - TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed | _ -> #if !NO_TYPEPROVIDERS if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) #endif - TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic delayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = #if !NO_TYPEPROVIDERS @@ -8625,7 +8770,7 @@ and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> - let objTyAfterTyArgs, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs objTy tinstEnclosing tyargs + let objTyAfterTyArgs, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv mExprAndTypeArgs objTy tinstEnclosing tyargs CallExprHasTypeSink cenv.tcSink (mExprAndArg, env.NameEnv, objTyAfterTyArgs, env.eAccessRights) let itemAfterTyArgs, minfosAfterTyArgs = #if !NO_TYPEPROVIDERS @@ -8646,7 +8791,7 @@ and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> - let objTy, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mExprAndTypeArgs objTy tinstEnclosing tyargs + let objTy, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv mExprAndTypeArgs objTy tinstEnclosing tyargs // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! let resolvedItem = Item.Types(nm, [objTy]) @@ -8659,6 +8804,68 @@ and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [] mItem delayed (Some afterResolution) +and TcTraitItemThen cenv overallTy env objOpt traitInfo tpenv mItem delayed = + let g = cenv.g + + let argTys = traitInfo.GetLogicalArgumentTypes(g) + let retTy = traitInfo.GetReturnType(g) + + match traitInfo.SupportTypes with + | tys when tys.Length > 1 -> + error(Error (FSComp.SR.tcTraitHasMultipleSupportTypes(traitInfo.MemberDisplayNameCore), mItem)) + | _ -> () + + match objOpt, traitInfo.MemberFlags.IsInstance with + | Some _, false -> error (Error (FSComp.SR.tcTraitIsStatic traitInfo.MemberDisplayNameCore, mItem)) + | None, true -> error (Error (FSComp.SR.tcTraitIsNotStatic traitInfo.MemberDisplayNameCore, mItem)) + | _ -> () + + // If this is an instance trait the object must be evaluated, just in case this is a first-class use of the trait, e.g. + // (Compute()).SomeMethod --> + // let obj = Compute() in (fun arg -> SomeMethod(arg)) + // (Compute()).SomeMethod(3) --> + // let obj = Compute() in (fun arg -> SomeMethod(arg)) 3 + let wrapper, objArgs = + match argTys with + | [] -> + id, Option.toList objOpt + | _ -> + match objOpt with + | None -> + id, [] + | Some objExpr -> + // Evaluate the object first + let objVal, objValExpr = mkCompGenLocal mItem "obj" (tyOfExpr g objExpr) + mkCompGenLet mItem objVal objExpr, [objValExpr] + + // Build a lambda for the trait call + let applicableExpr, exprTy = + // Empty arguments indicates a non-indexer property constraint + match argTys with + | [] -> + let expr = Expr.Op (TOp.TraitCall traitInfo, [], objArgs, mItem) + let exprTy = tyOfExpr g expr + let applicableExpr = MakeApplicableExprNoFlex cenv expr + applicableExpr, exprTy + | _ -> + let vs, ves = argTys |> List.mapi (fun i ty -> mkCompGenLocal mItem ("arg" + string i) ty) |> List.unzip + let traitCall = Expr.Op (TOp.TraitCall traitInfo, [], objArgs@ves, mItem) + let v, body = MultiLambdaToTupledLambda g vs traitCall + let expr = mkLambda mItem v (body, retTy) + let exprTy = tyOfExpr g expr + let applicableExpr = MakeApplicableExprForTraitCall cenv expr (vs, traitCall) + applicableExpr, exprTy + + // Propagate the types from the known application structure + + Propagate cenv overallTy env tpenv applicableExpr exprTy delayed + + // Check and apply the arguments + let resExpr, tpenv = TcDelayed cenv overallTy env tpenv mItem applicableExpr exprTy ExprAtomicFlag.NonAtomic delayed + + // Aply the wrapper to pre-evaluate the object if any + wrapper resExpr, tpenv + and TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed = let g = cenv.g let isPrefix = IsLogicalPrefixOperator id.idText @@ -8666,16 +8873,16 @@ and TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed = let argData = if isPrefix then - [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) ] + [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) ] elif isTernary then - [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) - SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) - SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) ] + [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) + SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) + SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) ] else - [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) - SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) ] + [ SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) + SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) ] - let retTyData = SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.HeadType, true) + let retTyData = SynTypar(mkSynId mItem (cenv.synArgNameGenerator.New()), TyparStaticReq.None, true) let argTypars = argData |> List.map (fun d -> Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, d, false, TyparDynamicReq.Yes, [], false, false)) let retTypar = Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, retTyData, false, TyparDynamicReq.Yes, [], false, false) let argTys = argTypars |> List.map mkTyparTy @@ -8710,6 +8917,7 @@ and TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed = | SynExpr.Null _ | SynExpr.Ident _ | SynExpr.Const _ + | SynExpr.Typar _ | SynExpr.LongIdent _ | SynExpr.Dynamic _ -> true @@ -8787,7 +8995,7 @@ and TcDelegateCtorItemThen cenv overallTy env ty tinstEnclosing tpenv mItem dela | DelayedApp (atomicFlag, _, _, arg, mItemAndArg) :: otherDelayed -> TcNewDelegateThen cenv overallTy env tpenv mItem mItemAndArg ty arg atomicFlag otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mItemAndTypeArgs) :: DelayedApp (atomicFlag, _, _, arg, mItemAndArg) :: otherDelayed -> - let ty, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv mItemAndTypeArgs ty tinstEnclosing tyargs + let ty, tpenv = TcNestedTypeApplication cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv mItemAndTypeArgs ty tinstEnclosing tyargs // Report information about the whole expression including type arguments to VS let item = Item.DelegateCtor ty @@ -8859,7 +9067,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed -and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution delayed = +and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution staticTyOpt delayed = let g = cenv.g let ad = env.eAccessRights @@ -8897,19 +9105,19 @@ and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution // x.P <- ... byref setter if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed else let args = if pinfo.IsIndexer then args else [] if isNil meths then errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) // Note: static calls never mutate a struct object argument - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mStmt mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[expr2]) ExprAtomicFlag.NonAtomic otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mStmt mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[expr2]) ExprAtomicFlag.NonAtomic staticTyOpt otherDelayed | _ -> // Static Property Get (possibly indexer) let meths = pinfos |> GettersOfPropInfos if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) // Note: static calls never mutate a struct object argument - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed and TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed = let g = cenv.g @@ -9023,9 +9231,14 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight g false objExprTy) let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId TypeNameResolutionInfo.Default findFlag false + TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution + +and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution = + let g = cenv.g + let ad = env.eAccessRights + let objArgs = [objExpr] let mExprAndItem = unionRanges mObjExpr mItem let delayed = delayRest rest mExprAndItem delayed - match item with | Item.MethodGroup (methodName, minfos, _) -> let atomicFlag, tyArgsOpt, args, delayed, tpenv = GetSynMemberApplicationArgs delayed tpenv @@ -9043,7 +9256,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela let item = Item.MethodGroup(methodName, [minfoAfterStaticArguments], Some minfos[0]) CallNameResolutionSinkReplacing cenv.tcSink (mExprAndItem, env.NameEnv, item, [], ItemOccurence.Use, env.eAccessRights) - TcMethodApplicationThen cenv env overallTy None tpenv None objArgs mExprAndItem mItem methodName ad mutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse args atomicFlag delayed + TcMethodApplicationThen cenv env overallTy None tpenv None objArgs mExprAndItem mItem methodName ad mutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse args atomicFlag None delayed | None -> if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) @@ -9052,7 +9265,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela let tyArgsOpt, tpenv = TcMemberTyArgsOpt cenv env tpenv tyArgsOpt let meths = minfos |> List.map (fun minfo -> minfo, None) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem methodName ad mutates false meths afterResolution NormalValUse args atomicFlag delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem methodName ad mutates false meths afterResolution NormalValUse args atomicFlag None delayed | Item.Property (nm, pinfos) -> // Instance property @@ -9080,7 +9293,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) // x.P <- ... byref setter if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed else if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly then @@ -9088,12 +9301,12 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela let args = if pinfo.IsIndexer then args else [] let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [expr2]) atomicFlag [] + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [expr2]) atomicFlag None [] | _ -> // Instance property getter let meths = GettersOfPropInfos pinfos if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed | Item.RecdField rfinfo -> // Get or set instance F# field or literal @@ -9152,8 +9365,31 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela // Instance IL event (fake up event-as-value) TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem (Some(objExpr, objExprTy)) einfo delayed + | Item.Trait traitInfo -> + TcTraitItemThen cenv overallTy env (Some objExpr) traitInfo tpenv mItem delayed + | Item.FakeInterfaceCtor _ | Item.DelegateCtor _ -> error (Error (FSComp.SR.tcConstructorsCannotBeFirstClassValues(), mItem)) - | _ -> error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItem)) + + // These items are not expected here - they can't be the result of a instance member dot-lookup "expr.Ident" + | Item.ActivePatternResult _ + | Item.CustomOperation _ + | Item.CtorGroup _ + | Item.ExnCase _ + | Item.ImplicitOp _ + | Item.ModuleOrNamespaces _ + | Item.TypeVar _ + | Item.Types _ + | Item.UnionCase _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.Value _ + // These items are not expected here - they are only used for reporting symbols from name resolution to language service + | Item.NewDef _ + | Item.SetterArg _ + | Item.CustomBuilder _ + | Item.ArgName _ + | Item.ActivePatternCase _ -> + error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItem)) // Instance IL event (fake up event-as-value) and TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem objDetails (einfo: EventInfo) delayed = @@ -9189,10 +9425,10 @@ and TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem objDetails (einf // EventHelper ((fun d -> e.add_X(d)), (fun d -> e.remove_X(d)), (fun f -> new 'Delegate(f))) mkCallCreateEvent g mItem delTy argsTy (let dv, de = mkCompGenLocal mItem "eventDelegate" delTy - let callExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates mItem false einfo.AddMethod NormalValUse [] objVars [de] + let callExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates mItem false einfo.AddMethod NormalValUse [] objVars [de] None mkLambda mItem dv (callExpr, g.unit_ty)) (let dv, de = mkCompGenLocal mItem "eventDelegate" delTy - let callExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates mItem false einfo.RemoveMethod NormalValUse [] objVars [de] + let callExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates mItem false einfo.RemoveMethod NormalValUse [] objVars [de] None mkLambda mItem dv (callExpr, g.unit_ty)) (let fvty = mkFunTy g g.obj_ty (mkFunTy g argsTy g.unit_ty) let fv, fe = mkCompGenLocal mItem "callback" fvty @@ -9229,6 +9465,7 @@ and TcMethodApplicationThen isSuperInit // is this a special invocation, e.g. a super-class constructor call. Passed through to BuildMethodCall args // the _syntactic_ method arguments, not yet type checked. atomicFlag // is the expression atomic or not? + staticTyOpt // is there a static type that governs the call, different to the nominal type containing the member, e.g. 'T.CallSomeMethod() delayed // further lookups and applications that follow this = @@ -9243,7 +9480,7 @@ and TcMethodApplicationThen // Call the helper below to do the real checking let (expr, attributeAssignedNamedItems, delayed), tpenv = - TcMethodApplication false cenv env tpenv callerTyArgs objArgs mWholeExpr mItem methodName objTyOpt ad mut isProp meths afterResolution isSuperInit args exprTy delayed + TcMethodApplication false cenv env tpenv callerTyArgs objArgs mWholeExpr mItem methodName objTyOpt ad mut isProp meths afterResolution isSuperInit args exprTy staticTyOpt delayed // Give errors if some things couldn't be assigned if not (isNil attributeAssignedNamedItems) then @@ -9278,7 +9515,8 @@ and CalledMethHasSingleArgumentGroupOfThisLength n (calledMeth: MethInfo) = | [argAttribs] -> argAttribs = n | _ -> false -and isSimpleFormalArg (isParamArrayArg, _isInArg, isOutArg, optArgInfo: OptionalArgInfo, callerInfo: CallerInfo, _reflArgInfo: ReflectedArgInfo) = +and isSimpleFormalArg info = + let (ParamAttribs(isParamArrayArg, _isInArg, isOutArg, optArgInfo, callerInfo, _reflArgInfo)) = info not isParamArrayArg && not isOutArg && not optArgInfo.IsOptional && callerInfo = NoCallerInfo and GenerateMatchingSimpleArgumentTypes cenv (calledMeth: MethInfo) mItem = @@ -9399,7 +9637,8 @@ and TcMethodApplication_UniqueOverloadInference candidateMethsAndProps candidates mMethExpr - mItem = + mItem + staticTyOpt = let g = cenv.g let denv = env.DisplayEnv @@ -9457,7 +9696,7 @@ and TcMethodApplication_UniqueOverloadInference match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt) let preArgumentTypeCheckingCalledMethGroup = [ for minfo, pinfoOpt in candidateMethsAndProps do @@ -9599,6 +9838,7 @@ and TcMethodApplication isSuperInit curriedCallerArgs (exprTy: OverallTy) + staticTyOpt // is there a static type that governs the call, different to the nominal type containing the member, e.g. 'T.CallSomeMethod() delayed = @@ -9637,7 +9877,7 @@ and TcMethodApplication // Extract what we know about the caller arguments, either type-directed if // no arguments are given or else based on the syntax of the arguments. let uniquelyResolved, preArgumentTypeCheckingCalledMethGroup = - TcMethodApplication_UniqueOverloadInference cenv env exprTy tyArgsOpt ad objTyOpt isCheckingAttributeCall callerObjArgTys methodName curriedCallerArgsOpt candidateMethsAndProps candidates mMethExpr mItem + TcMethodApplication_UniqueOverloadInference cenv env exprTy tyArgsOpt ad objTyOpt isCheckingAttributeCall callerObjArgTys methodName curriedCallerArgsOpt candidateMethsAndProps candidates mMethExpr mItem staticTyOpt // STEP 2. Check arguments let unnamedCurriedCallerArgs, namedCurriedCallerArgs, lambdaVars, returnTy, tpenv = @@ -9668,7 +9908,7 @@ and TcMethodApplication match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt)) // Commit unassociated constraints prior to member overload resolution where there is ambiguity // about the possible target of the call. @@ -9763,7 +10003,7 @@ and TcMethodApplication /// STEP 6. Build the call expression, then adjust for byref-returns, out-parameters-as-tuples, post-hoc property assignments, methods-as-first-class-value, let callExpr0, exprTy = - BuildPossiblyConditionalMethodCall cenv env mut mMethExpr isProp finalCalledMethInfo isSuperInit finalCalledMethInst objArgs allArgsCoerced + BuildPossiblyConditionalMethodCall cenv env mut mMethExpr isProp finalCalledMethInfo isSuperInit finalCalledMethInst objArgs allArgsCoerced staticTyOpt // Handle byref returns let callExpr1, exprTy = @@ -9855,15 +10095,17 @@ and TcMethodApplication (callExpr6, finalAttributeAssignedNamedItems, delayed), tpenv /// For Method(X = expr) 'X' can be a property, IL Field or F# record field -and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) calledFromConstructor = +and TcSetterArgExpr cenv env denv objExpr ad assignedSetter calledFromConstructor = let g = cenv.g + let (AssignedItemSetter(id, setter, callerArg)) = assignedSetter + let (CallerArg(callerArgTy, m, isOptCallerArg, argExpr)) = callerArg if isOptCallerArg then error(Error(FSComp.SR.tcInvalidOptionalAssignmentToPropertyOrField(), m)) let argExprPrebinder, action, defnItem = match setter with - | AssignedPropSetter (pinfo, pminfo, pminst) -> + | AssignedPropSetter (propStaticTyOpt, pinfo, pminfo, pminst) -> if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly && not calledFromConstructor then errorR (Error (FSComp.SR.tcInitOnlyPropertyCannotBeSet1 pinfo.PropertyName, m)) @@ -9873,7 +10115,7 @@ and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, Cal let tcVal = LightweightTcValForUsingInBuildMethodCall g let argExprPrebinder, argExpr = MethodCalls.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] |> fst + let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] propStaticTyOpt |> fst argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo]) | AssignedILFieldSetter finfo -> @@ -10160,7 +10402,7 @@ and TcStaticOptimizationConstraint cenv env tpenv c = | SynStaticOptimizationConstraint.WhenTyparTyconEqualsTycon(tp, ty, m) -> if not g.compilingFSharpCore then errorR(Error(FSComp.SR.tcStaticOptimizationConditionalsOnlyForFSharpLibrary(), m)) - let tyR, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv ty + let tyR, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv ty let tpR, tpenv = TcTypar cenv env NewTyparsOK tpenv tp TTyconEqualsTycon(mkTyparTy tpR, tyR), tpenv | SynStaticOptimizationConstraint.WhenTyparIsStruct(tp, m) -> @@ -10539,7 +10781,7 @@ and TcBindingTyparDecls alwaysRigid cenv env tpenv (ValTyparDecls(synTypars, syn declaredTypars |> List.iter (fun tp -> SetTyparRigid env.DisplayEnv tp.Range tp) declaredTypars else - let rigidCopyOfDeclaredTypars = copyTypars declaredTypars + let rigidCopyOfDeclaredTypars = copyTypars false declaredTypars // The type parameters used to check rigidity after inference are marked rigid straight away rigidCopyOfDeclaredTypars |> List.iter (fun tp -> SetTyparRigid env.DisplayEnv tp.Range tp) // The type parameters using during inference will be marked rigid after inference @@ -10584,7 +10826,7 @@ and TcAttributeEx canFail cenv (env: TcEnv) attrTgt attrEx (synAttr: SynAttribut let ad = env.eAccessRights match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with | Exception err -> raze err - | _ -> success(TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInAttribute env tpenv (SynType.App(SynType.LongIdent(SynLongIdent(tycon, [], List.replicate tycon.Length None)), None, [], [], None, false, mAttr)) ) + | _ -> success(TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInAttribute WarnOnIWSAM.Yes env tpenv (SynType.App(SynType.LongIdent(SynLongIdent(tycon, [], List.replicate tycon.Length None)), None, [], [], None, false, mAttr)) ) ForceRaise ((try1 (tyid.idText + "Attribute")) |> otherwise (fun () -> (try1 tyid.idText))) let ad = env.eAccessRights @@ -10671,7 +10913,7 @@ and TcAttributeEx canFail cenv (env: TcEnv) attrTgt attrEx (synAttr: SynAttribut let meths = minfos |> List.map (fun minfo -> minfo, None) let afterResolution = ForNewConstructors cenv.tcSink env tyid.idRange methodName minfos let (expr, attributeAssignedNamedItems, _), _ = - TcMethodApplication true cenv env tpenv None [] mAttr mAttr methodName None ad PossiblyMutates false meths afterResolution NormalValUse [arg] (MustEqual ty) [] + TcMethodApplication true cenv env tpenv None [] mAttr mAttr methodName None ad PossiblyMutates false meths afterResolution NormalValUse [arg] (MustEqual ty) None [] UnifyTypes cenv env mAttr ty (tyOfExpr g expr) @@ -10959,7 +11201,7 @@ and ApplyTypesFromArgumentPatterns (cenv, env, optionalArgsOK, ty, m, tpenv, Nor match retInfoOpt with | None -> () | Some (SynBindingReturnInfo (retInfoTy, m, _)) -> - let retInfoTy, _ = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv retInfoTy + let retInfoTy, _ = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv retInfoTy UnifyTypes cenv env m ty retInfoTy // Property setters always have "unit" return type match memberFlagsOpt with @@ -10984,7 +11226,7 @@ and ComputeIsComplete enclosingDeclaredTypars declaredTypars ty = /// Determine if a uniquely-identified-abstract-slot exists for an override member (or interface member implementation) based on the information available /// at the syntactic definition of the member (i.e. prior to type inference). If so, we know the expected signature of the override, and the full slotsig /// it implements. Apply the inferred slotsig. -and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, synTyparDecls, declaredTypars, memberId, tcrefObjTy, renaming, _objTy, intfSlotTyOpt, valSynData, memberFlags: SynMemberFlags, attribs) = +and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (argsAndRetTy, m, synTyparDecls, declaredTypars, memberId, tcrefObjTy, renaming, _objTy, intfSlotTyOpt, valSynData, memberFlags: SynMemberFlags, attribs) = let g = cenv.g let ad = envinner.eAccessRights @@ -11013,7 +11255,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn match memberFlags.MemberKind with | SynMemberKind.Member -> let dispatchSlots, dispatchSlotsArityMatch = - GetAbstractMethInfosForSynMethodDecl(cenv.infoReader, ad, memberId, m, typToSearchForAbstractMembers, valSynData) + GetAbstractMethInfosForSynMethodDecl(cenv.infoReader, ad, memberId, m, typToSearchForAbstractMembers, valSynData, memberFlags) let uniqueAbstractMethSigs = match dispatchSlots with @@ -11047,7 +11289,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn let absSlotTy = mkMethodTy g argTysFromAbsSlot retTyFromAbsSlot - UnifyTypes cenv envinner m bindingTy absSlotTy + UnifyTypes cenv envinner m argsAndRetTy absSlotTy declaredTypars | _ -> declaredTypars @@ -11114,7 +11356,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn error(Error(FSComp.SR.tcInvalidSignatureForSet(), memberId.idRange)) mkFunTy g retTyFromAbsSlot g.unit_ty - UnifyTypes cenv envinner m bindingTy absSlotTy) + UnifyTypes cenv envinner m argsAndRetTy absSlotTy) // What's the type containing the abstract slot we're implementing? Used later on in MakeMemberDataAndMangledNameForMemberVal. // This type must be in terms of the enclosing type's formal type parameters, hence the application of revRenaming. @@ -11155,6 +11397,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl envinner: TcEnv, tpenv, declKind, + synTyparDecls, newslotsOK, overridesOK, tcrefContainerInfo, @@ -11162,7 +11405,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl id: Ident, vis2, declaredTypars, - memberFlagsOpt, + memberFlagsOpt: SynMemberFlags option, thisIdOpt, bindingAttribs, valSynInfo, @@ -11178,6 +11421,35 @@ and AnalyzeRecursiveStaticMemberOrValDecl // name for the member and the information about which type it is augmenting match tcrefContainerInfo, memberFlagsOpt with + | Some(MemberOrValContainerInfo(tcref, intfSlotTyOpt, _, _, declaredTyconTypars)), Some memberFlags + when (match memberFlags.MemberKind with + | SynMemberKind.Member -> true + | SynMemberKind.PropertyGet -> true + | SynMemberKind.PropertySet -> true + | SynMemberKind.PropertyGetSet -> true + | _ -> false) && + not memberFlags.IsInstance && + memberFlags.IsOverrideOrExplicitImpl -> + + CheckMemberFlags intfSlotTyOpt newslotsOK overridesOK memberFlags id.idRange + CheckForNonAbstractInterface declKind tcref memberFlags id.idRange + + let isExtrinsic = (declKind = ExtrinsicExtensionBinding) + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, _ = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner + let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic + + let (ExplicitTyparInfo(_, declaredTypars, infer)) = explicitTyparInfo + + let optInferredImplSlotTys, declaredTypars = + ApplyAbstractSlotInference cenv envinner (ty, mBinding, synTyparDecls, declaredTypars, id, tcrefObjTy, renaming, objTy, intfSlotTyOpt, valSynInfo, memberFlags, bindingAttribs) + + let explicitTyparInfo = ExplicitTyparInfo(declaredTypars, declaredTypars, infer) + + let memberInfo = MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, bindingAttribs, optInferredImplSlotTys, memberFlags, valSynInfo, id, false) + + envinner, tpenv, id, None, Some memberInfo, vis, vis2, None, enclosingDeclaredTypars, None, explicitTyparInfo, bindingRhs, declaredTypars + | Some(MemberOrValContainerInfo(tcref, intfSlotTyOpt, baseValOpt, _safeInitInfo, declaredTyconTypars)), Some memberFlags -> assert (Option.isNone intfSlotTyOpt) @@ -11285,8 +11557,8 @@ and AnalyzeRecursiveInstanceMemberDecl let baseValOpt = if tcref.IsFSharpObjectModelTycon then baseValOpt else None // Apply the known type of 'this' - let bindingTy = NewInferenceType g - UnifyTypes cenv envinner mBinding ty (mkFunTy g thisTy bindingTy) + let argsAndRetTy = NewInferenceType g + UnifyTypes cenv envinner mBinding ty (mkFunTy g thisTy argsAndRetTy) CheckForNonAbstractInterface declKind tcref memberFlags memberId.idRange @@ -11294,7 +11566,7 @@ and AnalyzeRecursiveInstanceMemberDecl // at the member signature. If so, we know the type of this member, and the full slotsig // it implements. Apply the inferred slotsig. let optInferredImplSlotTys, declaredTypars = - ApplyAbstractSlotInference cenv envinner (bindingTy, mBinding, synTyparDecls, declaredTypars, memberId, tcrefObjTy, renaming, objTy, intfSlotTyOpt, valSynInfo, memberFlags, bindingAttribs) + ApplyAbstractSlotInference cenv envinner (argsAndRetTy, mBinding, synTyparDecls, declaredTypars, memberId, tcrefObjTy, renaming, objTy, intfSlotTyOpt, valSynInfo, memberFlags, bindingAttribs) // Update the ExplicitTyparInfo to reflect the declaredTypars inferred from the abstract slot let explicitTyparInfo = ExplicitTyparInfo(declaredTypars, declaredTypars, infer) @@ -11345,8 +11617,8 @@ and AnalyzeRecursiveDecl match pat with | SynPat.FromParseError(innerPat, _) -> analyzeRecursiveDeclPat tpenv innerPat | SynPat.Typed(innerPat, tgtTy, _) -> - let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType envinner tpenv tgtTy - UnifyTypes cenv envinner mBinding ty ctyR + let tgtTyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes envinner tpenv tgtTy + UnifyTypes cenv envinner mBinding ty tgtTyR analyzeRecursiveDeclPat tpenv innerPat | SynPat.Attrib(_innerPat, _attribs, m) -> error(Error(FSComp.SR.tcAttributesInvalidInPatterns(), m)) @@ -11363,7 +11635,7 @@ and AnalyzeRecursiveDecl | SynPat.Named (SynIdent(id,_), _, vis2, _) -> AnalyzeRecursiveStaticMemberOrValDecl - (cenv, envinner, tpenv, declKind, + (cenv, envinner, tpenv, declKind, synTyparDecls, newslotsOK, overridesOK, tcrefContainerInfo, vis1, id, vis2, declaredTypars, memberFlagsOpt, thisIdOpt, bindingAttribs, diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 696e5d31932..f7a7fc217bd 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -489,6 +489,13 @@ type ImplicitlyBoundTyparsAllowed = | NewTyparsOK | NoNewTypars +/// Indicates whether the position being checked is precisely the r.h.s. of a "'T :> ***" constraint or a similar +/// places where IWSAM types do not generate a warning +[] +type WarnOnIWSAM = + | Yes + | No + /// Indicates if a member binding is an object expression binding type IsObjExprBinding = | ObjExprBinding @@ -1065,6 +1072,7 @@ val TcType: newOk: ImplicitlyBoundTyparsAllowed -> checkConstraints: CheckConstraints -> occ: ItemOccurence -> + iwsam: WarnOnIWSAM -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> @@ -1077,6 +1085,7 @@ val TcTypeOrMeasureAndRecover: newOk: ImplicitlyBoundTyparsAllowed -> checkConstraints: CheckConstraints -> occ: ItemOccurence -> + iwsam: WarnOnIWSAM -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> @@ -1088,6 +1097,7 @@ val TcTypeAndRecover: newOk: ImplicitlyBoundTyparsAllowed -> checkConstraints: CheckConstraints -> occ: ItemOccurence -> + iwsam: WarnOnIWSAM -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index 1334b1bf54c..31471ba32b2 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -16,25 +16,25 @@ open FSharp.Compiler.TcGlobals type FormatItem = Simple of TType | FuncAndVal -let copyAndFixupFormatTypar m tp = - let _,_,tinst = FreshenAndFixupTypars m TyparRigidity.Flexible [] [] [tp] +let copyAndFixupFormatTypar g m tp = + let _,_,tinst = FreshenAndFixupTypars g m TyparRigidity.Flexible [] [] [tp] List.head tinst let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) -let mkFlexibleFormatTypar m tys dfltTy = +let mkFlexibleFormatTypar g m tys dfltTy = let tp = Construct.NewTypar (TyparKind.Type, TyparRigidity.Rigid, SynTypar(mkSynId m "fmt",TyparStaticReq.HeadType,true),false,TyparDynamicReq.Yes,[],false,false) tp.SetConstraints [ TyparConstraint.SimpleChoice (tys,m); TyparConstraint.DefaultsTo (lowestDefaultPriority,dfltTy,m)] - copyAndFixupFormatTypar m tp + copyAndFixupFormatTypar g m tp let mkFlexibleIntFormatTypar (g: TcGlobals) m = - mkFlexibleFormatTypar m [ g.byte_ty; g.int16_ty; g.int32_ty; g.int64_ty; g.sbyte_ty; g.uint16_ty; g.uint32_ty; g.uint64_ty;g.nativeint_ty;g.unativeint_ty; ] g.int_ty + mkFlexibleFormatTypar g m [ g.byte_ty; g.int16_ty; g.int32_ty; g.int64_ty; g.sbyte_ty; g.uint16_ty; g.uint32_ty; g.uint64_ty;g.nativeint_ty;g.unativeint_ty; ] g.int_ty let mkFlexibleDecimalFormatTypar (g: TcGlobals) m = - mkFlexibleFormatTypar m [ g.decimal_ty ] g.decimal_ty + mkFlexibleFormatTypar g m [ g.decimal_ty ] g.decimal_ty let mkFlexibleFloatFormatTypar (g: TcGlobals) m = - mkFlexibleFormatTypar m [ g.float_ty; g.float32_ty; g.decimal_ty ] g.float_ty + mkFlexibleFormatTypar g m [ g.float_ty; g.float32_ty; g.decimal_ty ] g.float_ty type FormatInfoRegister = { mutable leftJustify : bool diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 7ced746b6a1..90695abf692 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -96,7 +96,7 @@ and TcSimplePat optionalArgsOK checkConstraints (cenv: cenv) ty env patEnv p = id.idText, patEnvR | SynSimplePat.Typed (p, cty, m) -> - let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK checkConstraints ItemOccurence.UseInType env tpenv cty + let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK checkConstraints ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv cty match p with // Optional arguments on members @@ -166,7 +166,7 @@ and TcSimplePats (cenv: cenv) optionalArgsOK checkConstraints ty env patEnv synS ps', patEnvR | SynSimplePats.Typed (p, cty, m) -> - let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv cty + let ctyR, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv cty match p with // Solitary optional arguments on members @@ -277,7 +277,7 @@ and TcPat warnOnUpper (cenv: cenv) env valReprInfo vFlags (patEnv: TcPatLinearEn | SynPat.Typed (p, cty, m) -> let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv - let ctyR, tpenvR = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv cty + let ctyR, tpenvR = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv cty UnifyTypes cenv env m ty ctyR let patEnvR = TcPatLinearEnv(tpenvR, names, takenNames) TcPat warnOnUpper cenv env valReprInfo vFlags patEnvR ty p @@ -369,7 +369,7 @@ and TcPatNamed warnOnUpper cenv env vFlags patEnv id ty isMemberThis vis valRepr and TcPatIsInstance warnOnUpper cenv env valReprInfo vFlags patEnv srcTy synPat synTargetTy m = let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv - let tgtTy, tpenv = TcTypeAndRecover cenv NewTyparsOKButWarnIfNotRigid CheckCxs ItemOccurence.UseInType env tpenv synTargetTy + let tgtTy, tpenv = TcTypeAndRecover cenv NewTyparsOKButWarnIfNotRigid CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synTargetTy TcRuntimeTypeTest false true cenv env.DisplayEnv m tgtTy srcTy let patEnv = TcPatLinearEnv(tpenv, names, takenNames) match synPat with diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index cb70cd5835e..77b3cb3486a 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -115,32 +115,37 @@ let NewByRefKindInferenceType (g: TcGlobals) m = let NewInferenceTypes g l = l |> List.map (fun _ -> NewInferenceType g) -// QUERY: should 'rigid' ever really be 'true'? We set this when we know +let FreshenTypar (g: TcGlobals) rigid (tp: Typar) = + let clearStaticReq = g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers + let staticReq = if clearStaticReq then TyparStaticReq.None else tp.StaticReq + let dynamicReq = if rigid = TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No + NewCompGenTypar (tp.Kind, rigid, staticReq, dynamicReq, false) + +// QUERY: should 'rigid' ever really be 'true'? We set this when we know // we are going to have to generalize a typar, e.g. when implementing a // abstract generic method slot. But we later check the generalization // condition anyway, so we could get away with a non-rigid typar. This // would sort of be cleaner, though give errors later. -let FreshenAndFixupTypars m rigid fctps tinst tpsorig = - let copy_tyvar (tp: Typar) = NewCompGenTypar (tp.Kind, rigid, tp.StaticReq, (if rigid=TyparRigidity.Rigid then TyparDynamicReq.Yes else TyparDynamicReq.No), false) - let tps = tpsorig |> List.map copy_tyvar +let FreshenAndFixupTypars g m rigid fctps tinst tpsorig = + let tps = tpsorig |> List.map (FreshenTypar g rigid) let renaming, tinst = FixupNewTypars m fctps tinst tpsorig tps tps, renaming, tinst -let FreshenTypeInst m tpsorig = - FreshenAndFixupTypars m TyparRigidity.Flexible [] [] tpsorig +let FreshenTypeInst g m tpsorig = + FreshenAndFixupTypars g m TyparRigidity.Flexible [] [] tpsorig -let FreshMethInst m fctps tinst tpsorig = - FreshenAndFixupTypars m TyparRigidity.Flexible fctps tinst tpsorig +let FreshMethInst g m fctps tinst tpsorig = + FreshenAndFixupTypars g m TyparRigidity.Flexible fctps tinst tpsorig -let FreshenTypars m tpsorig = +let FreshenTypars g m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tpTys = FreshenTypeInst m tpsorig + let _, _, tpTys = FreshenTypeInst g m tpsorig tpTys let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tpTys = FreshMethInst m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars + let _, _, tpTys = FreshMethInst minfo.TcGlobals m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tpTys //------------------------------------------------------------------------- @@ -465,9 +470,9 @@ let IsSignType g ty = type TraitConstraintSolution = | TTraitUnsolved | TTraitBuiltIn - | TTraitSolved of MethInfo * TypeInst - | TTraitSolvedRecdProp of RecdFieldInfo * bool - | TTraitSolvedAnonRecdProp of AnonRecdTypeInfo * TypeInst * int + | TTraitSolved of minfo: MethInfo * minst: TypeInst * staticTyOpt: TType option + | TTraitSolvedRecdProp of fieldInfo: RecdFieldInfo * isSetProp: bool + | TTraitSolvedAnonRecdProp of anonRecdTypeInfo: AnonRecdTypeInfo * typeInst: TypeInst * index: int let BakedInTraitConstraintNames = [ "op_Division" ; "op_Multiply"; "op_Addition" @@ -694,7 +699,12 @@ let SubstMeasure (r: Typar) ms = let rec TransactStaticReq (csenv: ConstraintSolverEnv) (trace: OptionalTrace) (tpr: Typar) req = let m = csenv.m - if tpr.Rigidity.ErrorIfUnified && tpr.StaticReq <> req then + let g = csenv.g + + // Prior to feature InterfacesWithAbstractStaticMembers the StaticReq must match the + // declared StaticReq. With feature InterfacesWithAbstractStaticMembers it is inferred + // from the finalized constraints on the type variable. + if not (g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers) && tpr.Rigidity.ErrorIfUnified && tpr.StaticReq <> req then ErrorD(ConstraintSolverError(FSComp.SR.csTypeCannotBeResolvedAtCompileTime(tpr.Name), m, m)) else let orig = tpr.StaticReq @@ -996,23 +1006,30 @@ and SolveTyparEqualsTypePart2 (csenv: ConstraintSolverEnv) ndeep m2 (trace: Opti do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep PermitWeakResolution.No trace r) // Re-solve the other constraints associated with this type variable - return! solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r + return! SolveTypMeetsTyparConstraints csenv ndeep m2 trace ty r } /// Apply the constraints on 'typar' to the type 'ty' -and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = trackErrors { +and SolveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = trackErrors { let g = csenv.g // Propagate compat flex requirements from 'tp' to 'ty' do! SolveTypIsCompatFlex csenv trace r.IsCompatFlex ty - // Propagate dynamic requirements from 'tp' to 'ty' + // Propagate dynamic requirements from 'tp' to 'ty' do! SolveTypDynamicReq csenv trace r.DynamicReq ty // Propagate static requirements from 'tp' to 'ty' do! SolveTypStaticReq csenv trace r.StaticReq ty - + + if not (g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers) then + // Propagate static requirements from 'tp' to 'ty' + // + // If IWSAMs are not supported then this is done on a per-type-variable basis when constraints + // are applied - see other calls to SolveTypStaticReq + do! SolveTypStaticReq csenv trace r.StaticReq ty + // Solve constraints on 'tp' w.r.t. 'ty' for e in r.Constraints do do! @@ -1367,45 +1384,60 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// /// 2. Some additional solutions are forced prior to generalization (permitWeakResolution= Yes or YesDuringCodeGen). See above and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace traitInfo : OperationResult = trackErrors { - let (TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln)) = traitInfo + let (TTrait(supportTys, nm, memFlags, traitObjAndArgTys, retTy, sln)) = traitInfo // Do not re-solve if already solved if sln.Value.IsSome then return true else + let g = csenv.g let m = csenv.m let amap = csenv.amap let aenv = csenv.EquivEnv let denv = csenv.DisplayEnv + let ndeep = ndeep + 1 do! DepthCheck ndeep m // Remove duplicates from the set of types in the support - let tys = ListSet.setify (typeAEquiv g aenv) tys + let supportTys = ListSet.setify (typeAEquiv g aenv) supportTys // Rebuild the trait info after removing duplicates - let traitInfo = TTrait(tys, nm, memFlags, traitObjAndArgTys, retTy, sln) + let traitInfo = TTrait(supportTys, nm, memFlags, traitObjAndArgTys, retTy, sln) let retTy = GetFSharpViewOfReturnType g retTy // Assert the object type if the constraint is for an instance member if memFlags.IsInstance then - match tys, traitObjAndArgTys with + match supportTys, traitObjAndArgTys with | [ty], h :: _ -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) - // Trait calls are only supported on pseudo type (variables) - for e in tys do - do! SolveTypStaticReq csenv trace TyparStaticReq.HeadType e - + + // Trait calls are only supported on pseudo type (variables) + if not (g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers) then + for e in supportTys do + do! SolveTypStaticReq csenv trace TyparStaticReq.HeadType e + + // SRTP constraints on rigid type parameters do not need to be solved + let isRigid = + supportTys |> List.forall (fun ty -> + match tryDestTyparTy g ty with + | ValueSome tp -> + match tp.Rigidity with + | TyparRigidity.Rigid + | TyparRigidity.WillBeRigid -> true + | _ -> false + | ValueNone -> false) + let argTys = if memFlags.IsInstance then List.tail traitObjAndArgTys else traitObjAndArgTys let minfos = GetRelevantMethodsForTrait csenv permitWeakResolution nm traitInfo let! res = trackErrors { - match minfos, tys, memFlags.IsInstance, nm, argTys with + match minfos, supportTys, memFlags.IsInstance, nm, argTys with | _, _, false, ("op_Division" | "op_Multiply"), [argTy1;argTy2] when // This simulates the existence of // float * float -> float - // float32 * float32 -> float32 + // float32 * float32 -> float32 // float<'u> * float<'v> -> float<'u 'v> // float32<'u> * float32<'v> -> float32<'u 'v> // decimal<'u> * decimal<'v> -> decimal<'u 'v> @@ -1464,7 +1496,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _, _, false, ("op_Addition" | "op_Subtraction" | "op_Modulus"), [argTy1;argTy2] when // Ignore any explicit +/- overloads from any basic integral types - (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && + (minfos |> List.forall (fun (_, minfo) -> isIntegerTy g minfo.ApparentEnclosingType ) && ( IsAddSubModType nm g argTy1 && IsBinaryOpOtherArgType g permitWeakResolution argTy2 || IsAddSubModType nm g argTy2 && IsBinaryOpOtherArgType g permitWeakResolution argTy1)) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 @@ -1473,7 +1505,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _, _, false, ("op_LessThan" | "op_LessThanOrEqual" | "op_GreaterThan" | "op_GreaterThanOrEqual" | "op_Equality" | "op_Inequality" ), [argTy1;argTy2] when // Ignore any explicit overloads from any basic integral types - (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && + (minfos |> List.forall (fun (_, minfo) -> isIntegerTy g minfo.ApparentEnclosingType ) && ( IsRelationalType g argTy1 && IsBinaryOpOtherArgType g permitWeakResolution argTy2 || IsRelationalType g argTy2 && IsBinaryOpOtherArgType g permitWeakResolution argTy1)) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 @@ -1564,7 +1596,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return TTraitBuiltIn | _, _, true, "get_Sign", [] - when IsSignType g tys.Head -> + when IsSignType g supportTys.Head -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy g.int32_ty return TTraitBuiltIn @@ -1651,11 +1683,11 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let recdPropSearch = let isGetProp = nm.StartsWithOrdinal("get_") let isSetProp = nm.StartsWithOrdinal("set_") - if argTys.IsEmpty && isGetProp || isSetProp then + if not isRigid && ((argTys.IsEmpty && isGetProp) || isSetProp) then let propName = nm[4..] let props = - tys |> List.choose (fun ty -> - match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, AccessibleFromEverywhere) FindMemberFlag.IgnoreOverrides m ty with + supportTys |> List.choose (fun ty -> + match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, AccessibleFromEverywhere, false) FindMemberFlag.IgnoreOverrides m ty with | Some (RecdFieldItem rfinfo) when (isGetProp || rfinfo.RecdField.IsMutable) && (rfinfo.IsStatic = not memFlags.IsInstance) && @@ -1672,10 +1704,10 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let anonRecdPropSearch = let isGetProp = nm.StartsWith "get_" - if isGetProp && memFlags.IsInstance then + if not isRigid && isGetProp && memFlags.IsInstance then let propName = nm[4..] let props = - tys |> List.choose (fun ty -> + supportTys |> List.choose (fun ty -> match NameResolution.TryFindAnonRecdFieldOfType g ty propName with | Some (NameResolution.Item.AnonRecdField(anonInfo, tinst, i, _)) -> Some (anonInfo, tinst, i) | _ -> None) @@ -1688,10 +1720,10 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // Now check if there are no feasible solutions at all match minfos, recdPropSearch, anonRecdPropSearch with | [], None, None when MemberConstraintIsReadyForStrongResolution csenv traitInfo -> - if tys |> List.exists (isFunTy g) then - return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) - elif tys |> List.exists (isAnyTupleTy g) then - return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) + if supportTys |> List.exists (isFunTy g) then + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) + elif supportTys |> List.exists (isAnyTupleTy g) then + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(ConvertValLogicalNameToDisplayNameCore nm), m, m2)) else match nm, argTys with | "op_Explicit", [argTy] -> @@ -1700,19 +1732,19 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload return! ErrorD (ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportConversion(argTyString, rtyString), m, m2)) | _ -> let tyString = - match tys with + match supportTys with | [ty] -> NicePrint.minimalStringOfType denv ty - | _ -> tys |> List.map (NicePrint.minimalStringOfType denv) |> String.concat ", " + | _ -> supportTys |> List.map (NicePrint.minimalStringOfType denv) |> String.concat ", " let opName = ConvertValLogicalNameToDisplayNameCore nm let err = match opName with | "?>=" | "?>" | "?<=" | "?<" | "?=" | "?<>" | ">=?" | ">?" | "<=?" | "?" | "?>=?" | "?>?" | "?<=?" | "??" -> - if List.isSingleton tys then FSComp.SR.csTypeDoesNotSupportOperatorNullable(tyString, opName) + if List.isSingleton supportTys then FSComp.SR.csTypeDoesNotSupportOperatorNullable(tyString, opName) else FSComp.SR.csTypesDoNotSupportOperatorNullable(tyString, opName) | _ -> - if List.isSingleton tys then FSComp.SR.csTypeDoesNotSupportOperator(tyString, opName) + if List.isSingleton supportTys then FSComp.SR.csTypeDoesNotSupportOperator(tyString, opName) else FSComp.SR.csTypesDoNotSupportOperator(tyString, opName) return! ErrorD(ConstraintSolverError(err, m, m2)) @@ -1721,14 +1753,14 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let calledMethGroup = minfos // curried members may not be used to satisfy constraints - |> List.choose (fun minfo -> + |> List.choose (fun (staticTy, minfo) -> if minfo.IsCurried then None else let callerArgs = { Unnamed = [ (argTys |> List.map (fun argTy -> CallerArg(argTy, m, false, dummyExpr))) ] Named = [ [ ] ] } let minst = FreshenMethInfo m minfo let objtys = minfo.GetObjArgTypes(amap, m, minst) - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, callerArgs, false, false, None))) + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, callerArgs, false, false, None, Some staticTy))) let methOverloadResult, errors = trace.CollectThenUndoOrCommit @@ -1762,43 +1794,60 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (ConvertValLogicalNameToDisplayNameCore nm), nm), m, m2 )) else do! CheckMethInfoAttributes g m None minfo - return TTraitSolved (minfo, calledMeth.CalledTyArgs) + return TTraitSolved (minfo, calledMeth.CalledTyArgs, calledMeth.OptionalStaticType) | _ -> - let support = GetSupportOfMemberConstraint csenv traitInfo - let frees = GetFreeTyparsOfMemberConstraint csenv traitInfo - - // If there's nothing left to learn then raise the errors. - // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability - // reasons we use the more restrictive isNil frees. - if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then - do! errors - // Otherwise re-record the trait waiting for canonicalization - else - do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees - - match errors with - | ErrorResult (_, UnresolvedOverloading _) - when - not ignoreUnresolvedOverload && - csenv.ErrorOnFailedMemberConstraintResolution && - (not (nm = "op_Explicit" || nm = "op_Implicit")) -> - return! ErrorD AbortForFailedMemberConstraintResolution - | _ -> - return TTraitUnsolved + do! AddUnsolvedMemberConstraint csenv ndeep m2 trace permitWeakResolution ignoreUnresolvedOverload traitInfo errors + return TTraitUnsolved } return! RecordMemberConstraintSolution csenv.SolverState m trace traitInfo res } +and AddUnsolvedMemberConstraint csenv ndeep m2 trace permitWeakResolution ignoreUnresolvedOverload traitInfo errors = + trackErrors { + let g = csenv.g + + let nm = traitInfo.MemberLogicalName + let supportTypars = GetTyparSupportOfMemberConstraint csenv traitInfo + let frees = GetFreeTyparsOfMemberConstraint csenv traitInfo + + // Trait calls are only supported on pseudo type (variables) unless supported by IWSAM constraints + // + // SolveTypStaticReq is applied here if IWSAMs are supported + if g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + for supportTypar in supportTypars do + if not (SupportTypeOfMemberConstraintIsSolved csenv traitInfo supportTypar) then + do! SolveTypStaticReqTypar csenv trace TyparStaticReq.HeadType supportTypar + + // If there's nothing left to learn then raise the errors. + // Note: we should likely call MemberConstraintIsReadyForResolution here when permitWeakResolution=false but for stability + // reasons we use the more restrictive isNil frees. + if (permitWeakResolution.Permit && MemberConstraintIsReadyForWeakResolution csenv traitInfo) || isNil frees then + do! errors + // Otherwise re-record the trait waiting for canonicalization + else + do! AddMemberConstraint csenv ndeep m2 trace traitInfo supportTypars frees + + match errors with + | ErrorResult (_, UnresolvedOverloading _) + when + not ignoreUnresolvedOverload && + csenv.ErrorOnFailedMemberConstraintResolution && + (not (nm = "op_Explicit" || nm = "op_Implicit")) -> + return! ErrorD AbortForFailedMemberConstraintResolution + | _ -> + () + } + /// Record the solution to a member constraint in the mutable reference cell attached to /// each member constraint. -and RecordMemberConstraintSolution css m trace traitInfo res = - match res with +and RecordMemberConstraintSolution css m trace traitInfo traitConstraintSln = + match traitConstraintSln with | TTraitUnsolved -> ResultD false - | TTraitSolved (minfo, minst) -> - let sln = MemberConstraintSolutionOfMethInfo css m minfo minst + | TTraitSolved (minfo, minst, staticTyOpt) -> + let sln = MemberConstraintSolutionOfMethInfo css m minfo minst staticTyOpt TransactMemberConstraintSolution traitInfo trace sln ResultD true @@ -1817,7 +1866,7 @@ and RecordMemberConstraintSolution css m trace traitInfo res = ResultD true /// Convert a MethInfo into the data we save in the TAST -and MemberConstraintSolutionOfMethInfo css m minfo minst = +and MemberConstraintSolutionOfMethInfo css m minfo minst staticTyOpt = #if !NO_TYPEPROVIDERS #else // to prevent unused parameter warning @@ -1827,10 +1876,10 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = | ILMeth(_, ilMeth, _) -> let mref = IL.mkRefToILMethod (ilMeth.DeclaringTyconRef.CompiledRepresentationForNamedType, ilMeth.RawMetadata) let iltref = ilMeth.ILExtensionMethodDeclaringTyconRef |> Option.map (fun tcref -> tcref.CompiledRepresentationForNamedType) - ILMethSln(ilMeth.ApparentEnclosingType, iltref, mref, minst) + ILMethSln(ilMeth.ApparentEnclosingType, iltref, mref, minst, staticTyOpt) | FSMeth(_, ty, vref, _) -> - FSMethSln(ty, vref, minst) + FSMethSln(ty, vref, minst, staticTyOpt) | MethInfo.DefaultStructCtor _ -> error(InternalError("the default struct constructor was the unexpected solution to a trait constraint", m)) @@ -1853,7 +1902,7 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = let declaringTy = ImportProvidedType amap m (methInfo.PApply((fun x -> x.DeclaringType), m)) if isILAppTy g declaringTy then let extOpt = None // EXTENSION METHODS FROM TYPE PROVIDERS: for extension methods coming from the type providers we would have something here. - ILMethSln(declaringTy, extOpt, ilMethRef, methInst) + ILMethSln(declaringTy, extOpt, ilMethRef, methInst, staticTyOpt) else closedExprSln | _ -> @@ -1868,45 +1917,91 @@ and TransactMemberConstraintSolution traitInfo (trace: OptionalTrace) sln = /// Only consider overload resolution if canonicalizing or all the types are now nominal. /// That is, don't perform resolution if more nominal information may influence the set of available overloads -and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm (TTrait(tys, _, memFlags, argTys, retTy, soln) as traitInfo): MethInfo list = +and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolution: PermitWeakResolution) nm traitInfo : (TType * MethInfo) list = + let (TTrait(_, _, memFlags, _, _, _)) = traitInfo let results = if permitWeakResolution.Permit || MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo then let m = csenv.m - let minfos = - match memFlags.MemberKind with - | SynMemberKind.Constructor -> - tys |> List.map (GetIntrinsicConstructorInfosOfType csenv.SolverState.InfoReader m) - | _ -> - tys |> List.map (GetIntrinsicMethInfosOfType csenv.SolverState.InfoReader (Some nm) AccessibleFromSomeFSharpCode AllowMultiIntfInstantiations.Yes IgnoreOverrides m) + + let nominalTys = GetNominalSupportOfMemberConstraint csenv nm traitInfo + + let minfos = + [ for (supportTy, nominalTy) in nominalTys do + let infos = + match memFlags.MemberKind with + | SynMemberKind.Constructor -> + GetIntrinsicConstructorInfosOfType csenv.SolverState.InfoReader m nominalTy + | _ -> + GetIntrinsicMethInfosOfType csenv.SolverState.InfoReader (Some nm) AccessibleFromSomeFSharpCode AllowMultiIntfInstantiations.Yes IgnoreOverrides m nominalTy + for info in infos do + supportTy, info ] // Merge the sets so we don't get the same minfo from each side // We merge based on whether minfos use identical metadata or not. - let minfos = List.reduce (ListSet.unionFavourLeft MethInfo.MethInfosUseIdenticalDefinitions) minfos + let minfos = ListSet.setify (fun (_,minfo1) (_, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) minfos /// Check that the available members aren't hiding a member from the parent (depth 1 only) - let relevantMinfos = minfos |> List.filter(fun minfo -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) + let relevantMinfos = minfos |> List.filter(fun (_, minfo) -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) minfos - |> List.filter(fun minfo1 -> + |> List.filter(fun (_, minfo1) -> not(minfo1.IsDispatchSlot && relevantMinfos - |> List.exists (fun minfo2 -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) + |> List.exists (fun (_, minfo2) -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) else [] // The trait name "op_Explicit" also covers "op_Implicit", so look for that one too. if nm = "op_Explicit" then - results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" (TTrait(tys, "op_Implicit", memFlags, argTys, retTy, soln)) + let (TTrait(supportTys, _, memFlags, argTys, retTy, soln)) = traitInfo + let traitInfo2 = TTrait(supportTys, "op_Implicit", memFlags, argTys, retTy, soln) + results @ GetRelevantMethodsForTrait csenv permitWeakResolution "op_Implicit" traitInfo2 else results -/// The nominal support of the member constraint -and GetSupportOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _)) = - tys |> List.choose (tryAnyParTyOption csenv.g) +/// The typar support of the member constraint. +and GetTyparSupportOfMemberConstraint csenv traitInfo = + traitInfo.SupportTypes |> List.choose (tryAnyParTyOption csenv.g) -/// Check if the support is fully solved. -and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _)) = - tys |> List.forall (isAnyParTy csenv.g >> not) +/// The nominal types supporting the solution of a particular named SRTP constraint. +/// Constraints providing interfaces with static abstract methods can be +/// used to solve SRTP static member constraints on type parameters. +and GetNominalSupportOfMemberConstraint csenv nm traitInfo = + let m = csenv.m + let g = csenv.g + let infoReader = csenv.InfoReader + [ for supportTy in traitInfo.SupportTypes do + if isTyparTy g supportTy then + let mutable replaced = false + for cx in (destTyparTy g supportTy).Constraints do + match cx with + | TyparConstraint.CoercesTo(interfaceTy, _) when infoReader.IsInterfaceTypeWithMatchingStaticAbstractMember m nm AccessibleFromSomeFSharpCode interfaceTy -> + replaced <- true + (supportTy, interfaceTy) + | _ -> () + if not replaced then + (supportTy, supportTy) + else + (supportTy, supportTy) ] + +and SupportTypeHasInterfaceWithMatchingStaticAbstractMember (csenv: ConstraintSolverEnv) (traitInfo: TraitConstraintInfo) (supportTyPar: Typar) = + let g = csenv.g + let m = csenv.m + let infoReader = csenv.InfoReader + + if g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + let mutable found = false + for cx in supportTyPar.Constraints do + match cx with + | TyparConstraint.CoercesTo(interfaceTy, _) when infoReader.IsInterfaceTypeWithMatchingStaticAbstractMember m traitInfo.MemberLogicalName AccessibleFromSomeFSharpCode interfaceTy -> + found <- true + | _ -> () + found + else + false + +and SupportTypeOfMemberConstraintIsSolved (csenv: ConstraintSolverEnv) (traitInfo: TraitConstraintInfo) supportTypar = + SupportTypeHasInterfaceWithMatchingStaticAbstractMember csenv traitInfo supportTypar // This may be relevant to future bug fixes, see https://github.com/dotnet/fsharp/issues/3814 // /// Check if some part of the support is solved. @@ -1914,8 +2009,9 @@ and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) (TTrait( // tys |> List.exists (isAnyParTy csenv.g >> not) /// Get all the unsolved typars (statically resolved or not) relevant to the member constraint -and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) (TTrait(tys, _, _, argTys, retTy, _)) = - freeInTypesLeftToRightSkippingConstraints csenv.g (tys @ argTys @ Option.toList retTy) +and GetFreeTyparsOfMemberConstraint (csenv: ConstraintSolverEnv) traitInfo = + let (TTrait(supportTys, _, _, argTys, retTy, _)) = traitInfo + freeInTypesLeftToRightSkippingConstraints csenv.g (supportTys @ argTys @ Option.toList retTy) and MemberConstraintIsReadyForWeakResolution csenv traitInfo = SupportOfMemberConstraintIsFullySolved csenv traitInfo @@ -1924,7 +2020,17 @@ and MemberConstraintIsReadyForStrongResolution csenv traitInfo = SupportOfMemberConstraintIsFullySolved csenv traitInfo and MemberConstraintSupportIsReadyForDeterminingOverloads csenv traitInfo = - SupportOfMemberConstraintIsFullySolved csenv traitInfo + SupportOfMemberConstraintIsFullySolved csenv traitInfo || + // Left-bias for SRTP constraints where the first is constrained by an IWSAM type. This is because typical IWSAM hierarchies + // such as System.Numerics hierarchy math are left-biased. + (match traitInfo.SupportTypes with + | firstSupportTy :: _ -> isAnyParTy csenv.g firstSupportTy && SupportTypeHasInterfaceWithMatchingStaticAbstractMember csenv traitInfo (destAnyParTy csenv.g firstSupportTy) + | _ -> false) + +/// Check if the support is fully solved. +and SupportOfMemberConstraintIsFullySolved (csenv: ConstraintSolverEnv) traitInfo = + let g = csenv.g + traitInfo.SupportTypes |> List.forall (fun ty -> if isAnyParTy g ty then SupportTypeOfMemberConstraintIsSolved csenv traitInfo (destAnyParTy g ty) else true) /// Re-solve the global constraints involving any of the given type variables. /// Trait constraints can't always be solved using the pessimistic rules. We only canonicalize @@ -1986,138 +2092,181 @@ and AddMemberConstraint (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr } -/// Record a constraint on an inference type variable. -and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint = +and TraitsAreRelated (csenv: ConstraintSolverEnv) retry traitInfo1 traitInfo2 = + let g = csenv.g + let (TTrait(tys1, nm1, memFlags1, argTys1, _, _)) = traitInfo1 + let (TTrait(tys2, nm2, memFlags2, argTys2, _, _)) = traitInfo2 + memFlags1.IsInstance = memFlags2.IsInstance && + nm1 = nm2 && + // Multiple op_Explicit and op_Implicit constraints can exist for the same type variable. + // See FSharp 1.0 bug 6477. + not (nm1 = "op_Explicit" || nm1 = "op_Implicit") && + argTys1.Length = argTys2.Length && + (List.lengthsEqAndForall2 (typeEquiv g) tys1 tys2 || retry) + +// Type variable sets may not have two trait constraints with the same name, nor +// be constrained by different instantiations of the same interface type. +// +// This results in limitations on generic code, especially "inline" code, which +// may require type annotations. +// +// The 'retry' flag is passed when a rigid type variable is about to raise a missing constraint error +// and the lengths of the support types are not equal (i.e. one is length 1, the other is length 2). +// In this case the support types are first forced to be equal. +and EnforceConstraintConsistency (csenv: ConstraintSolverEnv) ndeep m2 trace retry tpc1 tpc2 = trackErrors { let g = csenv.g - let aenv = csenv.EquivEnv let amap = csenv.amap - let denv = csenv.DisplayEnv let m = csenv.m - - // Type variable sets may not have two trait constraints with the same name, nor - // be constrained by different instantiations of the same interface type. - // - // This results in limitations on generic code, especially "inline" code, which - // may require type annotations. See FSharp 1.0 bug 6477. - let consistent tpc1 tpc2 = - match tpc1, tpc2 with - | (TyparConstraint.MayResolveMember(TTrait(tys1, nm1, memFlags1, argTys1, rty1, _), _), - TyparConstraint.MayResolveMember(TTrait(tys2, nm2, memFlags2, argTys2, rty2, _), _)) - when (memFlags1 = memFlags2 && - nm1 = nm2 && - // Multiple op_Explicit and op_Implicit constraints can exist for the same type variable. - // See FSharp 1.0 bug 6477. - not (nm1 = "op_Explicit" || nm1 = "op_Implicit") && - argTys1.Length = argTys2.Length && - List.lengthsEqAndForall2 (typeEquiv g) tys1 tys2) -> - - let rty1 = GetFSharpViewOfReturnType g rty1 - let rty2 = GetFSharpViewOfReturnType g rty2 - trackErrors { - do! Iterate2D (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace) argTys1 argTys2 - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 - () - } + match tpc1, tpc2 with + | TyparConstraint.MayResolveMember(traitInfo1, _), TyparConstraint.MayResolveMember(traitInfo2, _) + when TraitsAreRelated csenv retry traitInfo1 traitInfo2 -> + let (TTrait(tys1, _, _, argTys1, rty1, _)) = traitInfo1 + let (TTrait(tys2, _, _, argTys2, rty2, _)) = traitInfo2 + if retry then + match tys1, tys2 with + | [ty1], [ty2] -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1 ty2 + | [ty1], _ -> do! IterateD (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1) tys2 + | _, [ty2] -> do! IterateD (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty2) tys1 + | _ -> () + do! Iterate2D (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace) argTys1 argTys2 + let rty1 = GetFSharpViewOfReturnType g rty1 + let rty2 = GetFSharpViewOfReturnType g rty2 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 - | (TyparConstraint.CoercesTo(ty1, _), - TyparConstraint.CoercesTo(ty2, _)) -> - // Record at most one subtype constraint for each head type. - // That is, we forbid constraints by both I and I. - // This works because the types on the r.h.s. of subtype - // constraints are head-types and so any further inferences are equational. - let collect ty = - let mutable res = [] - IterateEntireHierarchyOfType (fun x -> res <- x :: res) g amap m AllowMultiIntfInstantiations.No ty - List.rev res - let parents1 = collect ty1 - let parents2 = collect ty2 - trackErrors { - for ty1Parent in parents1 do - for ty2Parent in parents2 do - do! if not (HaveSameHeadType g ty1Parent ty2Parent) then CompleteD else - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1Parent ty2Parent - } - - | (TyparConstraint.IsEnum (u1, _), - TyparConstraint.IsEnum (u2, m2)) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace u1 u2 + | TyparConstraint.CoercesTo(ty1, _), TyparConstraint.CoercesTo(ty2, _) -> + // Record at most one subtype constraint for each head type. + // That is, we forbid constraints by both I and I. + // This works because the types on the r.h.s. of subtype + // constraints are head-types and so any further inferences are equational. + let collect ty = + let mutable res = [] + IterateEntireHierarchyOfType (fun x -> res <- x :: res) g amap m AllowMultiIntfInstantiations.No ty + List.rev res + let parents1 = collect ty1 + let parents2 = collect ty2 + for ty1Parent in parents1 do + for ty2Parent in parents2 do + if HaveSameHeadType g ty1Parent ty2Parent then + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1Parent ty2Parent + + | TyparConstraint.IsEnum (unerlyingTy1, _), + TyparConstraint.IsEnum (unerlyingTy2, m2) -> + return! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace unerlyingTy1 unerlyingTy2 - | (TyparConstraint.IsDelegate (aty1, bty1, _), - TyparConstraint.IsDelegate (aty2, bty2, m2)) -> trackErrors { - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace aty1 aty2 - return! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace bty1 bty2 - } - - | TyparConstraint.SupportsComparison _, TyparConstraint.IsDelegate _ - | TyparConstraint.IsDelegate _, TyparConstraint.SupportsComparison _ - | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsReferenceType _ - | TyparConstraint.IsReferenceType _, TyparConstraint.IsNonNullableStruct _ -> - ErrorD (Error(FSComp.SR.csStructConstraintInconsistent(), m)) - - - | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsComparison _ - | TyparConstraint.SupportsEquality _, TyparConstraint.SupportsEquality _ - | TyparConstraint.SupportsNull _, TyparConstraint.SupportsNull _ - | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsNonNullableStruct _ - | TyparConstraint.IsUnmanaged _, TyparConstraint.IsUnmanaged _ - | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ - | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ - | TyparConstraint.SimpleChoice _, TyparConstraint.SimpleChoice _ -> - CompleteD + | TyparConstraint.IsDelegate (argsTy1, retTy1, _), + TyparConstraint.IsDelegate (argsTy2, retTy2, m2) -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argsTy1 argsTy2 + return! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy1 retTy2 + + | TyparConstraint.SupportsComparison _, TyparConstraint.IsDelegate _ + | TyparConstraint.IsDelegate _, TyparConstraint.SupportsComparison _ + | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsReferenceType _ + | TyparConstraint.IsReferenceType _, TyparConstraint.IsNonNullableStruct _ -> + return! ErrorD (Error(FSComp.SR.csStructConstraintInconsistent(), m)) + + | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsComparison _ + | TyparConstraint.SupportsEquality _, TyparConstraint.SupportsEquality _ + | TyparConstraint.SupportsNull _, TyparConstraint.SupportsNull _ + | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsNonNullableStruct _ + | TyparConstraint.IsUnmanaged _, TyparConstraint.IsUnmanaged _ + | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ + | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ + | TyparConstraint.SimpleChoice _, TyparConstraint.SimpleChoice _ -> + () - | _ -> CompleteD + | _ -> () + } - // See when one constraint implies implies another. - // 'a :> ty1 implies 'a :> 'ty2 if the head type name of ty2 (say T2) occursCheck anywhere in the hierarchy of ty1 - // If it does occur, e.g. at instantiation T2, then the check above will have enforced that - // T2 = ty2 - let implies tpc1 tpc2 = - match tpc1, tpc2 with - | TyparConstraint.MayResolveMember(trait1, _), - TyparConstraint.MayResolveMember(trait2, _) -> - traitsAEquiv g aenv trait1 trait2 - - | TyparConstraint.CoercesTo(ty1, _), TyparConstraint.CoercesTo(ty2, _) -> - ExistsSameHeadTypeInHierarchy g amap m ty1 ty2 - - | TyparConstraint.IsEnum(u1, _), TyparConstraint.IsEnum(u2, _) -> typeEquiv g u1 u2 - - | TyparConstraint.IsDelegate(aty1, bty1, _), TyparConstraint.IsDelegate(aty2, bty2, _) -> - typeEquiv g aty1 aty2 && typeEquiv g bty1 bty2 - - | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsComparison _ - | TyparConstraint.SupportsEquality _, TyparConstraint.SupportsEquality _ - // comparison implies equality - | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsEquality _ - | TyparConstraint.SupportsNull _, TyparConstraint.SupportsNull _ - | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsNonNullableStruct _ - | TyparConstraint.IsUnmanaged _, TyparConstraint.IsUnmanaged _ - | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ - | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ -> true - | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice (tys2, _) -> ListSet.isSubsetOf (typeEquiv g) tys1 tys2 - | TyparConstraint.DefaultsTo (priority1, defaultTy1, _), TyparConstraint.DefaultsTo (priority2, defaultTy2, _) -> - (priority1 = priority2) && typeEquiv g defaultTy1 defaultTy2 - | _ -> false +// See when one constraint implies implies another. +// 'a :> ty1 implies 'a :> 'ty2 if the head type name of ty2 (say T2) occursCheck anywhere in the hierarchy of ty1 +// If it does occur, e.g. at instantiation T2, then the check above will have enforced that +// T2 = ty2 +and CheckConstraintImplication (csenv: ConstraintSolverEnv) tpc1 tpc2 = + let g = csenv.g + let aenv = csenv.EquivEnv + let amap = csenv.amap + let m = csenv.m + match tpc1, tpc2 with + | TyparConstraint.MayResolveMember(trait1, _), TyparConstraint.MayResolveMember(trait2, _) -> + traitsAEquiv g aenv trait1 trait2 + + | TyparConstraint.CoercesTo(ty1, _), TyparConstraint.CoercesTo(ty2, _) -> + ExistsSameHeadTypeInHierarchy g amap m ty1 ty2 + + | TyparConstraint.IsEnum(u1, _), TyparConstraint.IsEnum(u2, _) -> typeEquiv g u1 u2 + + | TyparConstraint.IsDelegate(argsTy1, retyTy1, _), TyparConstraint.IsDelegate(argsTy2, retyTy2, _) -> + typeEquiv g argsTy1 argsTy2 && typeEquiv g retyTy1 retyTy2 + + | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsComparison _ + | TyparConstraint.SupportsEquality _, TyparConstraint.SupportsEquality _ + // comparison implies equality + | TyparConstraint.SupportsComparison _, TyparConstraint.SupportsEquality _ + | TyparConstraint.SupportsNull _, TyparConstraint.SupportsNull _ + | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsNonNullableStruct _ + | TyparConstraint.IsUnmanaged _, TyparConstraint.IsUnmanaged _ + | TyparConstraint.IsReferenceType _, TyparConstraint.IsReferenceType _ + | TyparConstraint.RequiresDefaultConstructor _, TyparConstraint.RequiresDefaultConstructor _ -> true + | TyparConstraint.SimpleChoice (tys1, _), TyparConstraint.SimpleChoice (tys2, _) -> ListSet.isSubsetOf (typeEquiv g) tys1 tys2 + | TyparConstraint.DefaultsTo (priority1, defaultTy1, _), TyparConstraint.DefaultsTo (priority2, defaultTy2, _) -> + (priority1 = priority2) && typeEquiv g defaultTy1 defaultTy2 + | _ -> false - - // First ensure constraint conforms with existing constraints - // NOTE: QUADRATIC +and CheckConstraintsImplication csenv existingConstraints newConstraint = + existingConstraints |> List.exists (fun tpc2 -> CheckConstraintImplication csenv tpc2 newConstraint) + +// Ensure constraint conforms with existing constraints +// NOTE: QUADRATIC +and EnforceConstraintSetConsistency csenv ndeep m2 trace retry allCxs i cxs = + match cxs with + | [] -> CompleteD + | cx :: rest -> + trackErrors { + do! IterateIdxD (fun j cx2 -> if i = j then CompleteD else EnforceConstraintConsistency csenv ndeep m2 trace retry cx cx2) allCxs + return! EnforceConstraintSetConsistency csenv ndeep m2 trace retry allCxs (i+1) rest + } + +// Eliminate any constraints where one constraint implies another +// Keep constraints in the left-to-right form according to the order they are asserted. +// NOTE: QUADRATIC +and EliminateRedundantConstraints csenv cxs acc = + match cxs with + | [] -> acc + | cx :: rest -> + let acc = + if List.exists (fun cx2 -> CheckConstraintImplication csenv cx2 cx) acc then acc + else (cx :: acc) + EliminateRedundantConstraints csenv rest acc + +/// Record a constraint on an inference type variable. +and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint = + let denv = csenv.DisplayEnv + let m = csenv.m + let g = csenv.g + let existingConstraints = tp.Constraints let allCxs = newConstraint :: List.rev existingConstraints trackErrors { - let rec enforceMutualConsistency i cxs = - match cxs with - | [] -> CompleteD - | cx :: rest -> - trackErrors { - do! IterateIdxD (fun j cx2 -> if i = j then CompleteD else consistent cx cx2) allCxs - return! enforceMutualConsistency (i+1) rest - } - do! enforceMutualConsistency 0 allCxs - - let impliedByExistingConstraints = existingConstraints |> List.exists (fun tpc2 -> implies tpc2 newConstraint) + do! EnforceConstraintSetConsistency csenv ndeep m2 trace false allCxs 0 allCxs + let mutable impliedByExistingConstraints = CheckConstraintsImplication csenv existingConstraints newConstraint + + // When InterfacesWithAbstractStaticMembers enabled, retry constraint consistency and implication when one of the constraints is known to have + // a single support type, and the other has two support types. + // (T1 : static member Foo: int) + // and the constraint we're adding is this: + // ((T2 or ?inf) : static member Foo: int) + // + // Then the only logical solution is ?inf = T1 = T2. So just enforce this and try again. + if + not impliedByExistingConstraints && + (IsRigid csenv tp || tp.Rigidity.WarnIfMissingConstraint) && + g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers + then + do! EnforceConstraintSetConsistency csenv ndeep m2 trace true allCxs 0 allCxs + impliedByExistingConstraints <- CheckConstraintsImplication csenv existingConstraints newConstraint + if impliedByExistingConstraints then () // "Default" constraints propagate softly and can be omitted from explicit declarations of type parameters elif (match tp.Rigidity, newConstraint with @@ -2125,7 +2274,8 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint | _ -> false) then () elif IsRigid csenv tp then - return! ErrorD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) + if not impliedByExistingConstraints then + return! ErrorD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) else // It is important that we give a warning if a constraint is missing from a // will-be-made-rigid type variable. This is because the existence of these warnings @@ -2134,20 +2284,7 @@ and AddConstraint (csenv: ConstraintSolverEnv) ndeep m2 trace tp newConstraint if tp.Rigidity.WarnIfMissingConstraint then do! WarnD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) - let newConstraints = - // Eliminate any constraints where one constraint implies another - // Keep constraints in the left-to-right form according to the order they are asserted. - // NOTE: QUADRATIC - let rec eliminateRedundant cxs acc = - match cxs with - | [] -> acc - | cx :: rest -> - let acc = - if List.exists (fun cx2 -> implies cx2 cx) acc then acc - else (cx :: acc) - eliminateRedundant rest acc - - eliminateRedundant allCxs [] + let newConstraints = EliminateRedundantConstraints csenv allCxs [] // Write the constraint into the type variable // Record a entry in the undo trace if one is provided @@ -2321,19 +2458,24 @@ and SolveTypeIsUnmanaged (csenv: ConstraintSolverEnv) ndeep m2 trace ty = ErrorD (ConstraintSolverError(FSComp.SR.csGenericConstructRequiresUnmanagedType(NicePrint.minimalStringOfType denv ty), m, m2)) -and SolveTypeChoice (csenv: ConstraintSolverEnv) ndeep m2 trace ty tys = - let g = csenv.g - let m = csenv.m - let denv = csenv.DisplayEnv - match tryDestTyparTy g ty with - | ValueSome destTypar -> - AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SimpleChoice(tys, m)) - | _ -> - if List.exists (typeEquivAux Erasure.EraseMeasures g ty) tys then CompleteD - else - let tyString = NicePrint.minimalStringOfType denv ty - let tysString = tys |> List.map (NicePrint.prettyStringOfTy denv) |> String.concat "," - ErrorD (ConstraintSolverError(FSComp.SR.csTypeNotCompatibleBecauseOfPrintf(tyString, tysString), m, m2)) +and SolveTypeChoice (csenv: ConstraintSolverEnv) ndeep m2 trace ty choiceTys = + trackErrors { + let g = csenv.g + let m = csenv.m + let denv = csenv.DisplayEnv + match tryDestTyparTy g ty with + | ValueSome destTypar -> + // SolveTypStaticReq is applied here if IWSAMs are supported + if g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + do! SolveTypStaticReq csenv trace TyparStaticReq.HeadType ty + + return! AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SimpleChoice(choiceTys, m)) + | _ -> + if not (choiceTys |> List.exists (typeEquivAux Erasure.EraseMeasures g ty)) then + let tyString = NicePrint.minimalStringOfType denv ty + let tysString = choiceTys |> List.map (NicePrint.prettyStringOfTy denv) |> String.concat "," + return! ErrorD (ConstraintSolverError(FSComp.SR.csTypeNotCompatibleBecauseOfPrintf(tyString, tysString), m, m2)) + } and SolveTypeIsReferenceType (csenv: ConstraintSolverEnv) ndeep m2 trace ty = let g = csenv.g @@ -2499,12 +2641,11 @@ and CanMemberSigsMatchUpToCheck assignedItemSetters |> MapCombineTDCD (fun (AssignedItemSetter(_, item, caller)) -> let name, calledArgTy = match item with - | AssignedPropSetter(_, pminfo, pminst) -> + | AssignedPropSetter(_, _, pminfo, pminst) -> let calledArgTy = List.head (List.head (pminfo.GetParamTypes(amap, m, pminst))) pminfo.LogicalName, calledArgTy | AssignedILFieldSetter(finfo) -> - (* Get or set instance IL field *) let calledArgTy = finfo.FieldType(amap, m) finfo.FieldName, calledArgTy @@ -2814,7 +2955,8 @@ and ReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMet and AssumeMethodSolvesTrait (csenv: ConstraintSolverEnv) (cx: TraitConstraintInfo option) m trace (calledMeth: CalledMeth<_>) = match cx with | Some traitInfo when traitInfo.Solution.IsNone -> - let traitSln = MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs + let staticTyOpt = if calledMeth.Method.IsInstance then None else calledMeth.OptionalStaticType + let traitSln = MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs staticTyOpt #if TRAIT_CONSTRAINT_CORRECTIONS if csenv.g.langVersion.SupportsFeature LanguageFeature.TraitConstraintCorrections then TransactMemberConstraintSolution traitInfo trace traitSln @@ -2960,7 +3102,7 @@ and ResolveOverloading // Static IL interfaces methods are not supported in lower F# versions. if calledMeth.Method.IsILMethod && not calledMeth.Method.IsInstance && isInterfaceTy g calledMeth.Method.ApparentEnclosingType then - checkLanguageFeatureRuntimeErrorRecover csenv.InfoReader LanguageFeature.DefaultInterfaceMemberConsumption m + checkLanguageFeatureRuntimeAndRecover csenv.InfoReader LanguageFeature.DefaultInterfaceMemberConsumption m checkLanguageFeatureAndRecover g.langVersion LanguageFeature.DefaultInterfaceMemberConsumption m calledMethOpt, @@ -3270,9 +3412,26 @@ let UnifyUniqueOverloading | _ -> ResultD false -/// Remove the global constraints where these type variables appear in the support of the constraint -let EliminateConstraintsForGeneralizedTypars denv css m (trace: OptionalTrace) (generalizedTypars: Typars) = +/// Re-assess the staticness of the type parameters. Necessary prior to assessing generalization. +let UpdateStaticReqOfTypar (denv: DisplayEnv) css m (trace: OptionalTrace) (typar: Typar) = + let g = denv.g + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + trackErrors { + if g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + for cx in typar.Constraints do + match cx with + | TyparConstraint.MayResolveMember(traitInfo,_) -> + for supportTy in traitInfo.SupportTypes do + do! SolveTypStaticReq csenv trace TyparStaticReq.HeadType supportTy + | TyparConstraint.SimpleChoice _ -> + do! SolveTypStaticReqTypar csenv trace TyparStaticReq.HeadType typar + | _ -> () + } |> RaiseOperationResult + +/// Remove the global constraints related to generalized type variables +let EliminateConstraintsForGeneralizedTypars (denv: DisplayEnv) css m (trace: OptionalTrace) (generalizedTypars: Typars) = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + for tp in generalizedTypars do let tpn = tp.Stamp let cxst = csenv.SolverState.ExtraCxs @@ -3476,6 +3635,19 @@ let CreateCodegenState tcVal g amap = PostInferenceChecksPreDefaults = ResizeArray() PostInferenceChecksFinal = ResizeArray() } +/// Determine if a codegen witness for a trait will require witness args to be available, e.g. in generic code +let CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs tcVal g amap m (traitInfo:TraitConstraintInfo) = trackErrors { + let css = CreateCodegenState tcVal g amap + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) + let! _res = SolveMemberConstraint csenv true PermitWeakResolution.Yes 0 m NoTrace traitInfo + let res = + match traitInfo.Solution with + | None + | Some BuiltInSln -> true + | _ -> false + return res + } + /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code let CodegenWitnessExprForTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { let css = CreateCodegenState tcVal g amap @@ -3488,7 +3660,7 @@ let CodegenWitnessExprForTraitConstraint tcVal g amap m (traitInfo:TraitConstrai let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let ftps, _renaming, tinst = FreshenTypeInst m typars + let ftps, _renaming, tinst = FreshenTypeInst g m typars let traitInfos = GetTraitConstraintInfosOfTypars g ftps do! SolveTyparsEqualTypes csenv 0 m NoTrace tinst tyargs return GenWitnessArgs amap g m traitInfos @@ -3562,4 +3734,3 @@ let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = | _ -> true else true - diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index 7891763dd44..c45db538fc2 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -41,7 +41,13 @@ val NewInferenceTypes: TcGlobals -> 'T list -> TType list /// 2. the instantiation mapping old type parameters to inference variables /// 3. the inference type variables as a list of types. val FreshenAndFixupTypars: - m: range -> rigid: TyparRigidity -> Typars -> TType list -> Typars -> Typars * TyparInstantiation * TType list + g: TcGlobals -> + m: range -> + rigid: TyparRigidity -> + Typars -> + TType list -> + Typars -> + Typars * TyparInstantiation * TType list /// Given a set of type parameters, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted. @@ -50,13 +56,13 @@ val FreshenAndFixupTypars: /// 1. the new type parameters /// 2. the instantiation mapping old type parameters to inference variables /// 3. the inference type variables as a list of types. -val FreshenTypeInst: range -> Typars -> Typars * TyparInstantiation * TType list +val FreshenTypeInst: g: TcGlobals -> range -> Typars -> Typars * TyparInstantiation * TType list /// Given a set of type parameters, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted. /// /// Returns the inference type variables as a list of types. -val FreshenTypars: range -> Typars -> TType list +val FreshenTypars: g: TcGlobals -> range -> Typars -> TType list /// Given a method, which may be generic, make new inference type variables for /// its generic parameters, and ensure that the constraints the new type variables are adjusted. @@ -251,7 +257,10 @@ val UnifyUniqueOverloading: OverallTy -> OperationResult -/// Remove the global constraints where these type variables appear in the support of the constraint +/// Re-assess the staticness of the type parameters +val UpdateStaticReqOfTypar: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> Typar -> unit + +/// Remove the global constraints related to generalized type variables val EliminateConstraintsForGeneralizedTypars: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> Typars -> unit @@ -304,6 +313,10 @@ val ApplyTyparDefaultAtPriority: DisplayEnv -> ConstraintSolverState -> priority val CodegenWitnessExprForTraitConstraint: TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> Expr list -> OperationResult +/// Determine if a codegen witness for a trait will require witness args to be available, e.g. in generic code +val CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs: + TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> OperationResult + /// Generate the arguments passed when using a generic construct that accepts traits witnesses val CodegenWitnessesForTyparInst: TcValF -> diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index e2cc31a265d..48b3ee82694 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -5,6 +5,7 @@ module internal FSharp.Compiler.InfoReader open System.Collections.Concurrent +open System.Collections.Generic open Internal.Utilities.Library open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL @@ -95,6 +96,51 @@ let rec GetImmediateIntrinsicMethInfosOfTypeAux (optFilter, ad) g amap m origTy let GetImmediateIntrinsicMethInfosOfType (optFilter, ad) g amap m ty = GetImmediateIntrinsicMethInfosOfTypeAux (optFilter, ad) g amap m ty ty +/// Query the immediate methods of an F# type, not taking into account inherited methods. The optFilter +/// parameter is an optional name to restrict the set of properties returned. +let GetImmediateTraitsInfosOfType optFilter g ty = + match tryDestTyparTy g ty with + | ValueSome tp -> + let infos = GetTraitConstraintInfosOfTypars g [tp] + match optFilter with + | None -> + [ for traitInfo in infos do + match traitInfo.MemberFlags.MemberKind with + | SynMemberKind.PropertySet -> + // A setter property trait only can be utilized via + // ^T.set_Property(v) + traitInfo.WithMemberKind(SynMemberKind.Member) + | _ -> + traitInfo ] + | Some nm -> + [ for traitInfo in infos do + match traitInfo.MemberFlags.MemberKind with + | SynMemberKind.PropertyGet -> + // A getter property trait can be utilized via + // ^T.Property + // ^T.get_Property() + // The latter doesn't appear in intellisense + if nm = traitInfo.MemberDisplayNameCore then + traitInfo + let traitInfo2 = traitInfo.WithMemberKind(SynMemberKind.Member) + if nm = traitInfo2.MemberDisplayNameCore then + traitInfo2 + | SynMemberKind.PropertySet -> + // A setter property trait only can be utilized via + // ^T.set_Property(v) + let traitInfo2 = traitInfo.WithMemberKind(SynMemberKind.Member) + if nm = traitInfo2.MemberDisplayNameCore then + traitInfo2 + | _ -> + // Method traits can be utilized via + // ^T.Member(v) + if nm = traitInfo.MemberDisplayNameCore then + traitInfo + ] + + | _ -> + [] + /// A helper type to help collect properties. /// /// Join up getters and setters which are not associated in the F# data structure @@ -247,6 +293,7 @@ let FilterMostSpecificMethInfoSets g amap m (minfoSets: NameMultiMap<_>) : NameM /// Used to collect sets of virtual methods, protected methods, protected /// properties etc. type HierarchyItem = + | TraitItem of TraitConstraintInfo list | MethodItem of MethInfo list list | PropertyItem of PropInfo list list | RecdFieldItem of RecdFieldInfo @@ -393,16 +440,18 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = FoldPrimaryHierarchyOfType (fun ty acc -> ty :: acc) g amap m allowMultiIntfInst ty [] /// The primitive reader for the named items up a hierarchy - let GetIntrinsicNamedItemsUncached ((nm, ad), m, ty) = + let GetIntrinsicNamedItemsUncached ((nm, ad, includeConstraints), m, ty) = if nm = ".ctor" then None else // '.ctor' lookups only ever happen via constructor syntax let optFilter = Some nm FoldPrimaryHierarchyOfType (fun ty acc -> + let qinfos = if includeConstraints then GetImmediateTraitsInfosOfType optFilter g ty else [] let minfos = GetImmediateIntrinsicMethInfosOfType (optFilter, ad) g amap m ty let pinfos = GetImmediateIntrinsicPropInfosOfType (optFilter, ad) g amap m ty let finfos = GetImmediateIntrinsicILFieldsOfType (optFilter, ad) m ty let einfos = ComputeImmediateIntrinsicEventsOfType (optFilter, ad) m ty let rfinfos = GetImmediateIntrinsicRecdOrClassFieldsOfType (optFilter, ad) m ty match acc with + | _ 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)) @@ -615,7 +664,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = /// Make a cache for function 'f' keyed by type (plus some additional 'flags') that only /// caches computations for monomorphic types. - let MakeInfoCache f (flagsEq : System.Collections.Generic.IEqualityComparer<_>) = + let MakeInfoCache f (flagsEq : IEqualityComparer<_>) = MemoizationTable<_, _> (compute=f, // Only cache closed, monomorphic types (closed = all members for the type @@ -627,7 +676,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = | _ -> false), keyComparer= - { new System.Collections.Generic.IEqualityComparer<_> with + { new IEqualityComparer<_> with member _.Equals((flags1, _, ty1), (flags2, _, ty2)) = // Ignoring the ranges - that's OK. flagsEq.Equals(flags1, flags2) && @@ -650,27 +699,44 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = else this.TryFindIntrinsicMethInfo m ad "op_Implicit" ty + let IsInterfaceTypeWithMatchingStaticAbstractMemberUncached ((ad, nm), m, ty) = + ExistsInEntireHierarchyOfType (fun parentTy -> + let meths = this.TryFindIntrinsicMethInfo m ad nm parentTy + meths |> List.exists (fun meth -> + not meth.IsInstance && + meth.IsDispatchSlot && + isInterfaceTy g meth.ApparentEnclosingAppType + )) + g amap m AllowMultiIntfInstantiations.Yes ty + let hashFlags0 = - { new System.Collections.Generic.IEqualityComparer with + { new IEqualityComparer with member _.GetHashCode((filter: string option, ad: AccessorDomain, _allowMultiIntfInst1)) = hash filter + AccessorDomain.CustomGetHashCode ad member _.Equals((filter1, ad1, allowMultiIntfInst1), (filter2, ad2, allowMultiIntfInst2)) = (filter1 = filter2) && AccessorDomain.CustomEquals(g, ad1, ad2) && allowMultiIntfInst1 = allowMultiIntfInst2 } let hashFlags1 = - { new System.Collections.Generic.IEqualityComparer with + { new IEqualityComparer with member _.GetHashCode((filter: string option, ad: AccessorDomain)) = hash filter + AccessorDomain.CustomGetHashCode ad member _.Equals((filter1, ad1), (filter2, ad2)) = (filter1 = filter2) && AccessorDomain.CustomEquals(g, ad1, ad2) } let hashFlags2 = - { new System.Collections.Generic.IEqualityComparer with - member _.GetHashCode((nm: string, ad: AccessorDomain)) = hash nm + AccessorDomain.CustomGetHashCode ad - member _.Equals((nm1, ad1), (nm2, ad2)) = (nm1 = nm2) && AccessorDomain.CustomEquals(g, ad1, ad2) } + { new IEqualityComparer with + member _.GetHashCode((nm: string, ad: AccessorDomain, includeConstraints)) = + hash nm + AccessorDomain.CustomGetHashCode ad + hash includeConstraints + member _.Equals((nm1, ad1, includeConstraints1), (nm2, ad2, includeConstraints2)) = + (nm1 = nm2) && AccessorDomain.CustomEquals(g, ad1, ad2) && (includeConstraints1 = includeConstraints2) } let hashFlags3 = - { new System.Collections.Generic.IEqualityComparer with + { new IEqualityComparer with member _.GetHashCode((ad: AccessorDomain)) = AccessorDomain.CustomGetHashCode ad member _.Equals((ad1), (ad2)) = AccessorDomain.CustomEquals(g, ad1, ad2) } + let hashFlags4 = + { new IEqualityComparer with + member _.GetHashCode((ad, nm)) = AccessorDomain.CustomGetHashCode ad + hash nm + member _.Equals((ad1, nm1), (ad2, nm2)) = AccessorDomain.CustomEquals(g, ad1, ad2) && (nm1 = nm2) } + let methodInfoCache = MakeInfoCache GetIntrinsicMethodSetsUncached hashFlags0 let propertyInfoCache = MakeInfoCache GetIntrinsicPropertySetsUncached hashFlags0 let recdOrClassFieldInfoCache = MakeInfoCache GetIntrinsicRecdOrClassFieldInfosUncached hashFlags1 @@ -682,23 +748,27 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = let entireTypeHierarchyCache = MakeInfoCache GetEntireTypeHierarchyUncached HashIdentity.Structural let primaryTypeHierarchyCache = MakeInfoCache GetPrimaryTypeHierarchyUncached HashIdentity.Structural let implicitConversionCache = MakeInfoCache FindImplicitConversionsUncached hashFlags3 + let isInterfaceWithStaticAbstractMethodCache = MakeInfoCache IsInterfaceTypeWithMatchingStaticAbstractMemberUncached hashFlags4 // Runtime feature support - let isRuntimeFeatureSupported (infoReader: InfoReader) runtimeFeature = + let isRuntimeFeatureSupported runtimeFeature = match g.System_Runtime_CompilerServices_RuntimeFeature_ty with | Some runtimeFeatureTy -> - infoReader.GetILFieldInfosOfType (None, AccessorDomain.AccessibleFromEverywhere, range0, runtimeFeatureTy) + GetIntrinsicILFieldInfosUncached ((None, AccessorDomain.AccessibleFromEverywhere), range0, runtimeFeatureTy) |> List.exists (fun (ilFieldInfo: ILFieldInfo) -> ilFieldInfo.FieldName = runtimeFeature) | _ -> false let isRuntimeFeatureDefaultImplementationsOfInterfacesSupported = - lazy isRuntimeFeatureSupported this "DefaultImplementationsOfInterfaces" - + lazy isRuntimeFeatureSupported "DefaultImplementationsOfInterfaces" + + let isRuntimeFeatureVirtualStaticsInInterfacesSupported = + lazy isRuntimeFeatureSupported "VirtualStaticsInInterfaces" + member _.g = g member _.amap = amap - + /// Read the raw method sets of a type, including inherited ones. Cache the result for monomorphic types member _.GetRawIntrinsicMethodSetsOfType (optFilter, ad, allowMultiIntfInst, m, ty) = methodInfoCache.Apply(((optFilter, ad, allowMultiIntfInst), m, ty)) @@ -739,8 +809,8 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = | _ -> failwith "unexpected multiple fields with same name" // Because it should have been already reported as duplicate fields /// Try and find an item with the given name in a type. - member _.TryFindNamedItemOfType (nm, ad, m, ty) = - namedItemsCache.Apply(((nm, ad), m, ty)) + member _.TryFindNamedItemOfType ((nm, ad, includeConstraints), m, ty) = + namedItemsCache.Apply(((nm, ad, includeConstraints), m, ty)) /// Read the raw method sets of a type that are the most specific overrides. Cache the result for monomorphic types member _.GetIntrinsicMostSpecificOverrideMethodSetsOfType (optFilter, ad, allowMultiIntfInst, m, ty) = @@ -759,6 +829,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = match langFeature with // Both default and static interface method consumption features are tied to the runtime support of DIMs. | LanguageFeature.DefaultInterfaceMemberConsumption -> isRuntimeFeatureDefaultImplementationsOfInterfacesSupported.Value + | LanguageFeature.InterfacesWithAbstractStaticMembers -> isRuntimeFeatureVirtualStaticsInInterfacesSupported.Value | _ -> true /// Get the declared constructors of any F# type @@ -822,8 +893,11 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = member infoReader.GetIntrinsicPropInfosOfType optFilter ad allowMultiIntfInst findFlag m ty = infoReader.GetIntrinsicPropInfoSetsOfType optFilter ad allowMultiIntfInst findFlag m ty |> List.concat - member infoReader.TryFindIntrinsicNamedItemOfType (nm, ad) findFlag m ty = - match infoReader.TryFindNamedItemOfType(nm, ad, m, ty) with + member _.GetTraitInfosInType optFilter ty = + GetImmediateTraitsInfosOfType optFilter g ty + + member infoReader.TryFindIntrinsicNamedItemOfType (nm, ad, includeConstraints) findFlag m ty = + match infoReader.TryFindNamedItemOfType((nm, ad, includeConstraints), m, ty) with | Some item -> match item with | PropertyItem psets -> Some(PropertyItem (psets |> FilterOverridesOfPropInfos findFlag infoReader.g infoReader.amap m)) @@ -832,7 +906,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = | None -> None /// Try to detect the existence of a method on a type. - member infoReader.TryFindIntrinsicMethInfo m ad nm ty = + member infoReader.TryFindIntrinsicMethInfo m ad nm ty : MethInfo list = infoReader.GetIntrinsicMethInfosOfType (Some nm) ad AllowMultiIntfInstantiations.Yes IgnoreOverrides m ty /// Try to find a particular named property on a type. Only used to ensure that local 'let' definitions and property names @@ -843,22 +917,13 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = member _.FindImplicitConversions m ad ty = implicitConversionCache.Apply((ad, m, ty)) -let private tryLanguageFeatureRuntimeErrorAux (infoReader: InfoReader) langFeature m error = + member _.IsInterfaceTypeWithMatchingStaticAbstractMember m nm ad ty = + isInterfaceWithStaticAbstractMethodCache.Apply((ad, nm), m, ty) + +let checkLanguageFeatureRuntimeAndRecover (infoReader: InfoReader) langFeature m = if not (infoReader.IsLanguageFeatureRuntimeSupported langFeature) then let featureStr = infoReader.g.langVersion.GetFeatureString langFeature - error (Error(FSComp.SR.chkFeatureNotRuntimeSupported featureStr, m)) - false - else - true - -let checkLanguageFeatureRuntimeError infoReader langFeature m = - tryLanguageFeatureRuntimeErrorAux infoReader langFeature m error |> ignore - -let checkLanguageFeatureRuntimeErrorRecover infoReader langFeature m = - tryLanguageFeatureRuntimeErrorAux infoReader langFeature m errorR |> ignore - -let tryLanguageFeatureRuntimeErrorRecover infoReader langFeature m = - tryLanguageFeatureRuntimeErrorAux infoReader langFeature m errorR + errorR (Error(FSComp.SR.chkFeatureNotRuntimeSupported featureStr, m)) let GetIntrinsicConstructorInfosOfType (infoReader: InfoReader) m ty = infoReader.GetIntrinsicConstructorInfosOfTypeAux m ty ty @@ -881,8 +946,8 @@ let GetIntrinsicMethInfosOfType (infoReader: InfoReader) optFilter ad allowMulti let GetIntrinsicPropInfosOfType (infoReader: InfoReader) optFilter ad allowMultiIntfInst findFlag m ty = infoReader.GetIntrinsicPropInfosOfType optFilter ad allowMultiIntfInst findFlag m ty -let TryFindIntrinsicNamedItemOfType (infoReader: InfoReader) (nm, ad) findFlag m ty = - infoReader.TryFindIntrinsicNamedItemOfType (nm, ad) findFlag m ty +let TryFindIntrinsicNamedItemOfType (infoReader: InfoReader) (nm, ad, includeConstraints) findFlag m ty = + infoReader.TryFindIntrinsicNamedItemOfType (nm, ad, includeConstraints) findFlag m ty let TryFindIntrinsicMethInfo (infoReader: InfoReader) m ad nm ty = infoReader.TryFindIntrinsicMethInfo m ad nm ty diff --git a/src/Compiler/Checking/InfoReader.fsi b/src/Compiler/Checking/InfoReader.fsi index c8cec7f82da..da24ec26d9e 100644 --- a/src/Compiler/Checking/InfoReader.fsi +++ b/src/Compiler/Checking/InfoReader.fsi @@ -73,6 +73,7 @@ val FilterMostSpecificMethInfoSets: /// Used to collect sets of virtual methods, protected methods, protected /// properties etc. type HierarchyItem = + | TraitItem of TraitConstraintInfo list | MethodItem of MethInfo list list | PropertyItem of PropInfo list list | RecdFieldItem of RecdFieldInfo @@ -150,7 +151,10 @@ type InfoReader = ty: TType -> MethInfo list list - /// Get the sets intrinsic properties in the hierarchy (not including extension properties) + /// Get the trait infos for a type variable (empty for everything else) + member GetTraitInfosInType: optFilter: string option -> ty: TType -> TraitConstraintInfo list + + /// Get the sets of intrinsic properties in the hierarchy (not including extension properties) member GetIntrinsicPropInfoSetsOfType: optFilter: string option -> ad: AccessorDomain -> @@ -182,20 +186,22 @@ type InfoReader = /// Perform type-directed name resolution of a particular named member in an F# type member TryFindIntrinsicNamedItemOfType: - nm: string * ad: AccessorDomain -> findFlag: FindMemberFlag -> m: range -> ty: TType -> HierarchyItem option + nm: string * ad: AccessorDomain * includeConstraints: bool -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + HierarchyItem option /// Find the op_Implicit for a type member FindImplicitConversions: m: range -> ad: AccessorDomain -> ty: TType -> MethInfo list -val checkLanguageFeatureRuntimeError: - infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> unit + /// Determine if a type has a static abstract method with the given name somewhere in its hierarchy + member IsInterfaceTypeWithMatchingStaticAbstractMember: + m: range -> nm: string -> ad: AccessorDomain -> ty: TType -> bool -val checkLanguageFeatureRuntimeErrorRecover: +val checkLanguageFeatureRuntimeAndRecover: infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> unit -val tryLanguageFeatureRuntimeErrorRecover: - infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> bool - /// Get the declared constructors of any F# type val GetIntrinsicConstructorInfosOfType: infoReader: InfoReader -> m: range -> ty: TType -> MethInfo list @@ -252,7 +258,7 @@ val GetIntrinsicPropInfosOfType: /// Perform type-directed name resolution of a particular named member in an F# type val TryFindIntrinsicNamedItemOfType: infoReader: InfoReader -> - nm: string * ad: AccessorDomain -> + nm: string * ad: AccessorDomain * includeConstraints: bool -> findFlag: FindMemberFlag -> m: range -> ty: TType -> diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 8f89c68d55e..76d0560349d 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -12,6 +12,7 @@ open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features +open FSharp.Compiler.Import open FSharp.Compiler.InfoReader open FSharp.Compiler.Infos open FSharp.Compiler.IO @@ -101,7 +102,8 @@ type AssignedCalledArg<'T> = /// Represents the possibilities for a named-setter argument (a property, field, or a record field setter) type AssignedItemSetterTarget = - | AssignedPropSetter of PropInfo * MethInfo * TypeInst (* the MethInfo is a non-indexer setter property *) + // the MethInfo is a non-indexer setter property + | AssignedPropSetter of staticTyOpt: TType option * pinfo: PropInfo * minfo: MethInfo * pminst: TypeInst | AssignedILFieldSetter of ILFieldInfo | AssignedRecdFieldSetter of RecdFieldInfo @@ -197,11 +199,13 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT isTyparTy g actualTy && (let ftyvs = freeInType CollectAll reqdTy2 in ftyvs.FreeTypars.Contains(destTyparTy g actualTy))) then let implicits = - infoReader.FindImplicitConversions m ad actualTy @ - infoReader.FindImplicitConversions m ad reqdTy2 + [ for conv in infoReader.FindImplicitConversions m ad actualTy do + (conv, actualTy) + for conv in infoReader.FindImplicitConversions m ad reqdTy2 do + (conv, reqdTy2) ] let implicits = - implicits |> List.filter (fun minfo -> + implicits |> List.filter (fun (minfo, _staticTy) -> not minfo.IsInstance && minfo.FormalMethodTyparInst.IsEmpty && (match minfo.GetParamTypes(amap, m, []) with @@ -212,12 +216,12 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT ) match implicits with - | [minfo] -> - Some (minfo, (reqdTy, reqdTy2, ignore)) - | minfo :: _ -> - Some (minfo, (reqdTy, reqdTy2, fun denv -> + | [(minfo, staticTy) ] -> + Some (minfo, staticTy, (reqdTy, reqdTy2, ignore)) + | (minfo, staticTy) :: _ -> + Some (minfo, staticTy, (reqdTy, reqdTy2, fun denv -> let reqdTy2Text, actualTyText, _cxs = NicePrint.minimalStringsOfTwoTypes denv reqdTy2 actualTy - let implicitsText = NicePrint.multiLineStringOfMethInfos infoReader m denv implicits + let implicitsText = NicePrint.multiLineStringOfMethInfos infoReader m denv (List.map fst implicits) errorR(Error(FSComp.SR.tcAmbiguousImplicitConversion(actualTyText, reqdTy2Text, implicitsText), m)))) | _ -> None else @@ -289,7 +293,7 @@ let rec AdjustRequiredTypeForTypeDirectedConversions (infoReader: InfoReader) ad // eliminate articifical constrained type variables. elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions then match TryFindRelevantImplicitConversion infoReader ad reqdTy actualTy m with - | Some (minfo, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn (TypeDirectedConversion.Implicit minfo)), Some eqn + | Some (minfo, _staticTy, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn (TypeDirectedConversion.Implicit minfo)), Some eqn | None -> reqdTy, TypeDirectedConversionUsed.No, None else reqdTy, TypeDirectedConversionUsed.No, None @@ -488,6 +492,7 @@ let MakeCalledArgs amap m (minfo: MethInfo) minst = /// Do we allow the use of a param args method in its "expanded" form? /// Do we allow the use of the transformation that converts out arguments as tuple returns? /// Method parameters +/// The optional static type governing a constrained static virtual interface call type CalledMeth<'T> (infoReader: InfoReader, nameEnv: NameResolutionEnv option, @@ -503,7 +508,8 @@ type CalledMeth<'T> callerArgs: CallerArgs<'T>, allowParamArgs: bool, allowOutAndOptArgs: bool, - tyargsOpt: TType option) + tyargsOpt: TType option, + staticTyOpt: TType option) = let g = infoReader.g let methodRetTy = if minfo.IsConstructor then minfo.ApparentEnclosingType else minfo.GetFSharpReturnType(infoReader.amap, m, calledTyArgs) @@ -617,7 +623,8 @@ type CalledMeth<'T> | [pinfo] when pinfo.HasSetter && not pinfo.IsIndexer -> let pminfo = pinfo.SetterMethod let pminst = freshenMethInfo m pminfo - Choice1Of2(AssignedItemSetter(id, AssignedPropSetter(pinfo, pminfo, pminst), e)) + let propStaticTyOpt = if isTyparTy g returnedObjTy then Some returnedObjTy else None + Choice1Of2(AssignedItemSetter(id, AssignedPropSetter(propStaticTyOpt, pinfo, pminfo, pminst), e)) | _ -> let epinfos = match nameEnv with @@ -636,7 +643,8 @@ type CalledMeth<'T> | Some(TType_app(_, types, _)) -> types | _ -> pminst - Choice1Of2(AssignedItemSetter(id, AssignedPropSetter(pinfo, pminfo, pminst), e)) + let propStaticTyOpt = if isTyparTy g returnedObjTy then Some returnedObjTy else None + Choice1Of2(AssignedItemSetter(id, AssignedPropSetter(propStaticTyOpt, pinfo, pminfo, pminst), e)) | _ -> match infoReader.GetILFieldInfosOfType(Some(nm), ad, m, returnedObjTy) with | finfo :: _ -> @@ -792,6 +800,8 @@ type CalledMeth<'T> member x.TotalNumAssignedNamedArgs = x.ArgSets |> List.sumBy (fun x -> x.NumAssignedNamedArgs) + member x.OptionalStaticType = staticTyOpt + override x.ToString() = "call to " + minfo.ToString() let NamesOfCalledArgs (calledArgs: CalledArg list) = @@ -869,11 +879,14 @@ let IsBaseCall objArgs = /// Compute whether we insert a 'coerce' on the 'this' pointer for an object model call /// For example, when calling an interface method on a struct, or a method on a constrained /// variable type. -let ComputeConstrainedCallInfo g amap m (objArgs, minfo: MethInfo) = - match objArgs with - | [objArgExpr] when not minfo.IsExtensionMember -> +let ComputeConstrainedCallInfo g amap m staticTyOpt args (minfo: MethInfo) = + match args, staticTyOpt with + | _, Some staticTy when not minfo.IsExtensionMember && not minfo.IsInstance && minfo.IsAbstract -> Some staticTy + + | (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 if TypeDefinitelySubsumesTypeNoCoercion 0 g amap m methObjTy objArgTy // Constrained calls to class types can only ever be needed for the three class types that // are base types of value types @@ -891,8 +904,8 @@ let ComputeConstrainedCallInfo g amap m (objArgs, minfo: MethInfo) = /// Adjust the 'this' pointer before making a call /// Take the address of a struct, and coerce to an interface/base/constraint type if necessary -let TakeObjAddrForMethodCall g amap (minfo: MethInfo) isMutable m objArgs f = - let ccallInfo = ComputeConstrainedCallInfo g amap m (objArgs, minfo) +let TakeObjAddrForMethodCall g amap (minfo: MethInfo) isMutable m staticTyOpt objArgs f = + let ccallInfo = ComputeConstrainedCallInfo g amap m staticTyOpt objArgs minfo let wrap, objArgs = @@ -1007,11 +1020,18 @@ let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = /// Make a call to a method info. Used by the optimizer and code generator to build /// calls to the type-directed solutions to member constraints. -let MakeMethInfoCall amap m minfo minst args = - let valUseFlags = NormalValUse // correct unless if we allow wild trait constraints like "T has a ctor and can be used as a parent class" +let MakeMethInfoCall (amap: ImportMap) m (minfo: MethInfo) minst args staticTyOpt = + let g = amap.g + let ccallInfo = ComputeConstrainedCallInfo g amap m staticTyOpt args minfo + let valUseFlags = + match ccallInfo with + | Some ty -> + // printfn "possible constrained call to '%s' at %A" minfo.LogicalName m + PossibleConstrainedCall ty + | None -> + NormalValUse match minfo with - | ILMeth(g, ilminfo, _) -> let direct = not minfo.IsVirtual let isProp = false // not necessarily correct, but this is only used post-creflect where this flag is irrelevant @@ -1069,10 +1089,10 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: ra // minst: the instantiation to apply for a generic method // objArgs: the 'this' argument, if any // args: the arguments, if any -let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objArgs args = +let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objArgs args staticTyOpt = let direct = IsBaseCall objArgs - TakeObjAddrForMethodCall g amap minfo isMutable m objArgs (fun ccallInfo objArgs -> + TakeObjAddrForMethodCall g amap minfo isMutable m staticTyOpt objArgs (fun ccallInfo objArgs -> let allArgs = objArgs @ args let valUseFlags = if direct && (match valUseFlags with NormalValUse -> true | _ -> false) then @@ -1154,7 +1174,7 @@ let ILFieldStaticChecks g amap infoReader ad m (finfo : ILFieldInfo) = // Static IL interfaces fields are not supported in lower F# versions. if isInterfaceTy g finfo.ApparentEnclosingType then - checkLanguageFeatureRuntimeErrorRecover infoReader LanguageFeature.DefaultInterfaceMemberConsumption m + checkLanguageFeatureRuntimeAndRecover infoReader LanguageFeature.DefaultInterfaceMemberConsumption m checkLanguageFeatureAndRecover g.langVersion LanguageFeature.DefaultInterfaceMemberConsumption m CheckILFieldAttributes g finfo m @@ -1287,9 +1307,10 @@ let rec AdjustExprForTypeDirectedConversions tcVal (g: TcGlobals) amap infoReade else match TryFindRelevantImplicitConversion infoReader ad reqdTy actualTy m with - | Some (minfo, _) -> + | Some (minfo, staticTy, _) -> MethInfoChecks g amap false None [] ad m minfo - let callExpr, _ = BuildMethodCall tcVal g amap Mutates.NeverMutates m false minfo ValUseFlag.NormalValUse [] [] [expr] + let staticTyOpt = if isTyparTy g staticTy then Some staticTy else None + let callExpr, _ = BuildMethodCall tcVal g amap Mutates.NeverMutates m false minfo ValUseFlag.NormalValUse [] [] [expr] staticTyOpt assert (let resTy = tyOfExpr g callExpr in typeEquiv g reqdTy resTy) callExpr | None -> mkCoerceIfNeeded g reqdTy actualTy expr @@ -1438,7 +1459,7 @@ let MakeNullableExprIfNeeded (infoReader: InfoReader) calledArgTy callerArgTy ca let calledNonOptTy = destNullableTy g calledArgTy let minfo = GetIntrinsicConstructorInfosOfType infoReader m calledArgTy |> List.head let callerArgExprCoerced = mkCoerceIfNeeded g calledNonOptTy callerArgTy callerArgExpr - MakeMethInfoCall amap m minfo [] [callerArgExprCoerced] + MakeMethInfoCall amap m minfo [] [callerArgExprCoerced] None // Adjust all the optional arguments, filling in values for defaults, let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) ad (assignedArg: AssignedCalledArg<_>) = @@ -1949,7 +1970,7 @@ module ProvidedMethodCalls = let targetMethInfo = ProvidedMeth(amap, ctor.PApply((fun ne -> upcast ne), m), None, m) let objArgs = [] let arguments = [ for ea in args.PApplyArray(id, "GetInvokerExpression", m) -> exprToExpr ea ] - let callExpr = BuildMethodCall tcVal g amap Mutates.PossiblyMutates m false targetMethInfo isSuperInit [] objArgs arguments + let callExpr = BuildMethodCall tcVal g amap Mutates.PossiblyMutates m false targetMethInfo isSuperInit [] objArgs arguments None callExpr and addVar (v: Tainted) = @@ -1984,7 +2005,7 @@ module ProvidedMethodCalls = let mut = if top then mut else PossiblyMutates let isSuperInit = if top then isSuperInit else ValUseFlag.NormalValUse let isProp = if top then isProp else false - let callExpr = BuildMethodCall tcVal g amap mut m isProp targetMethInfo isSuperInit replacementGenericArguments objArgs arguments + let callExpr = BuildMethodCall tcVal g amap mut m isProp targetMethInfo isSuperInit replacementGenericArguments objArgs arguments None Some meth, callExpr and varToExpr (pe: Tainted) = @@ -2059,7 +2080,7 @@ let CheckRecdFieldMutation m denv (rfinfo: RecdFieldInfo) = if not rfinfo.RecdField.IsMutable then errorR (FieldNotMutable (denv, rfinfo.RecdFieldRef, m)) -/// Generate a witness for the given (solved) constraint. Five possiblilities are taken +/// Generate a witness for the given (solved) constraint. Five possibilities are taken /// into account. /// 1. The constraint is solved by a .NET-declared method or an F#-declared method /// 2. The constraint is solved by an F# record field @@ -2081,7 +2102,7 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = // Given the solution information, reconstruct the MethInfo for the solution match sln with - | ILMethSln(origTy, extOpt, mref, minst) -> + | ILMethSln(origTy, extOpt, mref, minst, staticTyOpt) -> let metadataTy = convertToTypeWithMetadataIfPossible g origTy let tcref = tcrefOfAppTy g metadataTy let mdef = resolveILMethodRef tcref.ILTyconRawMetadata mref @@ -2091,10 +2112,10 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = | Some ilActualTypeRef -> let actualTyconRef = Import.ImportILTypeRef amap m ilActualTypeRef MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef) - Choice1Of5 (ilMethInfo, minst) + Choice1Of5 (ilMethInfo, minst, staticTyOpt) - | FSMethSln(ty, vref, minst) -> - Choice1Of5 (FSMeth(g, ty, vref, None), minst) + | FSMethSln(ty, vref, minst, staticTyOpt) -> + Choice1Of5 (FSMeth(g, ty, vref, None), minst, staticTyOpt) | FSRecdFieldSln(tinst, rfref, isSetProp) -> Choice2Of5 (tinst, rfref, isSetProp) @@ -2109,7 +2130,7 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = Choice5Of5 () match sln with - | Choice1Of5(minfo, methArgTys) -> + | Choice1Of5(minfo, methArgTys, staticTyOpt) -> let argExprs = // FIX for #421894 - typechecker assumes that coercion can be applied for the trait // calls arguments but codegen doesn't emit coercion operations @@ -2149,9 +2170,9 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = let wrap, h', _readonly, _writeonly = mkExprAddrOfExpr g true false PossiblyMutates h None m Some (wrap (Expr.Op (TOp.TraitCall traitInfo, [], (h' :: t), m))) | _ -> - Some (MakeMethInfoCall amap m minfo methArgTys argExprs) + Some (MakeMethInfoCall amap m minfo methArgTys argExprs staticTyOpt) else - Some (MakeMethInfoCall amap m minfo methArgTys argExprs) + Some (MakeMethInfoCall amap m minfo methArgTys argExprs staticTyOpt) | Choice2Of5 (tinst, rfref, isSet) -> match isSet, rfref.RecdField.IsStatic, argExprs.Length with @@ -2208,7 +2229,7 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = /// Generate a lambda expression for the given solved trait. let GenWitnessExprLambda amap g m (traitInfo: TraitConstraintInfo) = - let witnessInfo = traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() let argTysl = GenWitnessArgTys g witnessInfo let vse = argTysl |> List.mapiSquared (fun i j ty -> mkCompGenLocal m ("arg" + string i + "_" + string j) ty) let vsl = List.mapSquared fst vse diff --git a/src/Compiler/Checking/MethodCalls.fsi b/src/Compiler/Checking/MethodCalls.fsi index 5a54954eeff..ad5bb10ebaa 100644 --- a/src/Compiler/Checking/MethodCalls.fsi +++ b/src/Compiler/Checking/MethodCalls.fsi @@ -83,7 +83,7 @@ type AssignedCalledArg<'T> = /// Represents the possibilities for a named-setter argument (a property, field, or a record field setter) type AssignedItemSetterTarget = - | AssignedPropSetter of PropInfo * MethInfo * TypeInst + | AssignedPropSetter of staticTyOpt: TType option * pinfo: PropInfo * minfo: MethInfo * pminst: TypeInst | AssignedILFieldSetter of ILFieldInfo | AssignedRecdFieldSetter of RecdFieldInfo @@ -205,7 +205,8 @@ type CalledMeth<'T> = callerArgs: CallerArgs<'T> * allowParamArgs: bool * allowOutAndOptArgs: bool * - tyargsOpt: TType option -> + tyargsOpt: TType option * + staticTyOpt: TType option -> CalledMeth<'T> static member GetMethod: x: CalledMeth<'T> -> MethInfo @@ -302,6 +303,8 @@ type CalledMeth<'T> = member UsesParamArrayConversion: bool + member OptionalStaticType: TType option + member amap: ImportMap member infoReader: InfoReader @@ -338,7 +341,14 @@ val BuildILMethInfoCall: /// Make a call to a method info. Used by the optimizer and code generator to build /// calls to the type-directed solutions to member constraints. -val MakeMethInfoCall: amap: ImportMap -> m: range -> minfo: MethInfo -> minst: TType list -> args: Exprs -> Expr +val MakeMethInfoCall: + amap: ImportMap -> + m: range -> + minfo: MethInfo -> + minst: TType list -> + args: Exprs -> + staticTyOpt: TType option -> + Expr /// Build an expression that calls a given method info. /// This is called after overload resolution, and also to call other @@ -348,6 +358,7 @@ val MakeMethInfoCall: amap: ImportMap -> m: range -> minfo: MethInfo -> minst: T // minst: the instantiation to apply for a generic method // objArgs: the 'this' argument, if any // args: the arguments, if any +// staticTyOpt: the static type that governs the call, different to the nominal type containing the member, e.g. 'T.CallSomeMethod() val BuildMethodCall: tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> g: TcGlobals -> @@ -360,6 +371,7 @@ val BuildMethodCall: minst: TType list -> objArgs: Expr list -> args: Expr list -> + staticTyOpt: TType option -> Expr * TType /// Build a call to the System.Object constructor taking no arguments, diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 618c66df399..e317772dac4 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -346,7 +346,7 @@ module DispatchSlotChecking = // Always try to raise a target runtime error if we have a DIM. if reqdSlot.HasDefaultInterfaceImplementation then - checkLanguageFeatureRuntimeErrorRecover infoReader LanguageFeature.DefaultInterfaceMemberConsumption m + checkLanguageFeatureRuntimeAndRecover infoReader LanguageFeature.DefaultInterfaceMemberConsumption m let maybeResolvedSlot = NameMultiMap.find dispatchSlot.LogicalName overridesKeyed @@ -743,6 +743,8 @@ module DispatchSlotChecking = yield SlotImplSet(dispatchSlots, dispatchSlotsKeyed, availPriorOverrides, reqdProperties) ] + let IsStaticAbstractImpl (overrideBy: ValRef) = (not overrideBy.IsInstanceMember) && overrideBy.IsOverrideOrExplicitImpl + /// Check that a type definition implements all its required interfaces after processing all declarations /// within a file. let CheckImplementationRelationAtEndOfInferenceScope (infoReader : InfoReader, denv, nenv, sink, tycon: Tycon, isImplementation) = @@ -767,10 +769,14 @@ module DispatchSlotChecking = let allImpls = List.zip allReqdTys slotImplSets // Find the methods relevant to implementing the abstract slots listed under the reqdType being checked. + // + // Methods that are + // - Not static OR Static in the interface + // - override/default let allImmediateMembersThatMightImplementDispatchSlots = allImmediateMembers |> List.filter (fun overrideBy -> - overrideBy.IsInstanceMember && // exclude static - overrideBy.IsVirtualMember && // exclude non virtual (e.g. keep override/default). [4469] + (overrideBy.IsInstanceMember || IsStaticAbstractImpl overrideBy) && + overrideBy.IsVirtualMember && not overrideBy.IsDispatchSlotMember) let mustOverrideSomething reqdTy (overrideBy: ValRef) = @@ -918,10 +924,16 @@ let FinalTypeDefinitionChecksAtEndOfInferenceScope (infoReader: InfoReader, nenv && not tycon.IsFSharpDelegateTycon then DispatchSlotChecking.CheckImplementationRelationAtEndOfInferenceScope (infoReader, denv, nenv, sink, tycon, isImplementation) - + /// Get the methods relevant to determining if a uniquely-identified-override exists based on the syntactic information /// at the member signature prior to type inference. This is used to pre-assign type information if it does -let GetAbstractMethInfosForSynMethodDecl(infoReader: InfoReader, ad, memberName: Ident, bindm, typToSearchForAbstractMembers, valSynData) = +let GetAbstractMethInfosForSynMethodDecl(infoReader: InfoReader, ad, memberName: Ident, bindm, typToSearchForAbstractMembers, valSynData, memberFlags: SynMemberFlags) = + + let g = infoReader.g + if not memberFlags.IsInstance && memberFlags.IsOverrideOrExplicitImpl then + checkLanguageFeatureRuntimeAndRecover infoReader LanguageFeature.InterfacesWithAbstractStaticMembers bindm + checkLanguageFeatureAndRecover g.langVersion LanguageFeature.InterfacesWithAbstractStaticMembers bindm + let minfos = match typToSearchForAbstractMembers with | _, Some(SlotImplSet(_, dispatchSlotsKeyed, _, _)) -> @@ -930,9 +942,16 @@ let GetAbstractMethInfosForSynMethodDecl(infoReader: InfoReader, ad, memberName: GetIntrinsicMethInfosOfType infoReader (Some memberName.idText) ad AllowMultiIntfInstantiations.Yes IgnoreOverrides bindm ty let dispatchSlots = minfos |> List.filter (fun minfo -> minfo.IsDispatchSlot) let valReprSynArities = SynInfo.AritiesOfArgs valSynData - let valReprSynArities = if List.isEmpty valReprSynArities then valReprSynArities else valReprSynArities.Tail + + // We only return everything if it's empty or if it's a non-instance member. + // If it's an instance member, we are getting rid of `this` (by only taking tail). + let valReprSynArities = + if List.isEmpty valReprSynArities || (not memberFlags.IsInstance) then + valReprSynArities + else + valReprSynArities.Tail let dispatchSlotsArityMatch = dispatchSlots |> List.filter (fun minfo -> minfo.NumArgs = valReprSynArities) - dispatchSlots, dispatchSlotsArityMatch + dispatchSlots, dispatchSlotsArityMatch /// Get the properties relevant to determining if a uniquely-identified-override exists based on the syntactic information /// at the member signature prior to type inference. This is used to pre-assign type information if it does diff --git a/src/Compiler/Checking/MethodOverrides.fsi b/src/Compiler/Checking/MethodOverrides.fsi index b93b290f5d3..1c671e6bdb5 100644 --- a/src/Compiler/Checking/MethodOverrides.fsi +++ b/src/Compiler/Checking/MethodOverrides.fsi @@ -155,7 +155,8 @@ val GetAbstractMethInfosForSynMethodDecl: memberName: Ident * bindm: range * typToSearchForAbstractMembers: (TType * SlotImplSet option) * - valSynData: SynValInfo -> + valSynData: SynValInfo * + memberFlags: SynMemberFlags -> MethInfo list * MethInfo list /// Get the properties relevant to determining if a uniquely-identified-override exists based on the syntactic information diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 910cec2ab9e..56002f6e0e9 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -128,14 +128,6 @@ let ActivePatternElemsOfModuleOrNamespace g (modref: ModuleOrNamespaceRef) : Nam // Name Resolution Items //------------------------------------------------------------------------- -/// Detect a use of a nominal type, including type abbreviations. -/// -/// When reporting symbols, we care about abbreviations, e.g. 'int' and 'int32' count as two separate symbols -let (|AbbrevOrAppTy|_|) (ty: TType) = - match stripTyparEqns ty with - | TType_app (tcref, _, _) -> Some tcref - | _ -> None - /// Represents the item with which a named argument is associated. [] type ArgumentContainer = @@ -174,6 +166,9 @@ type Item = /// Represents the resolution of a name to an F# record or exception field. | RecdField of RecdFieldInfo + /// Represents the resolution of a name to an F# trait + | Trait of TraitConstraintInfo + /// Represents the resolution of a name to a union case field. | UnionCaseField of UnionCaseInfo * fieldIndex: int @@ -272,18 +267,27 @@ type Item = | Item.MethodGroup(_, FSMeth(_, _, v, _) :: _, _) -> v.DisplayNameCore | Item.MethodGroup(nm, _, _) -> nm |> ConvertValLogicalNameToDisplayNameCore | Item.CtorGroup(nm, _) -> nm |> DemangleGenericTypeName - | Item.FakeInterfaceCtor (AbbrevOrAppTy tcref) - | Item.DelegateCtor (AbbrevOrAppTy tcref) -> tcref.DisplayNameCore - | Item.Types(nm, _) -> nm |> DemangleGenericTypeName + | Item.FakeInterfaceCtor ty + | Item.DelegateCtor ty -> + match ty with + | AbbrevOrAppTy tcref -> tcref.DisplayNameCore + // This case is not expected + | _ -> "" | Item.UnqualifiedType(tcref :: _) -> tcref.DisplayNameCore + | Item.Types(nm, _) -> nm |> DemangleGenericTypeName | Item.TypeVar (nm, _) -> nm + | Item.Trait traitInfo -> traitInfo.MemberDisplayNameCore | Item.ModuleOrNamespaces(modref :: _) -> modref.DisplayNameCore | Item.ArgName (Some id, _, _, _) -> id.idText | Item.ArgName (None, _, _, _) -> "" | Item.SetterArg (id, _) -> id.idText | Item.CustomOperation (customOpName, _, _) -> customOpName | Item.CustomBuilder (nm, _) -> nm - | _ -> "" + | Item.ImplicitOp (id, _) -> id.idText + //| _ -> "" + // These singleton cases are not expected + | Item.ModuleOrNamespaces [] -> "" + | Item.UnqualifiedType [] -> "" member d.DisplayName = match d with @@ -1848,6 +1852,9 @@ let ItemsAreEffectivelyEqual g orig other = | Item.ModuleOrNamespaces modrefs1, Item.ModuleOrNamespaces modrefs2 -> modrefs1 |> List.exists (fun modref1 -> modrefs2 |> List.exists (fun r -> tyconRefDefnEq g modref1 r || fullDisplayTextOfModRef modref1 = fullDisplayTextOfModRef r)) + | Item.Trait traitInfo1, Item.Trait traitInfo2 -> + traitInfo1.MemberLogicalName = traitInfo2.MemberLogicalName + | _ -> false /// Given the Item 'orig' - returns function 'other: Item -> bool', that will yield true if other and orig represents the same item and false - otherwise @@ -1855,6 +1862,7 @@ let ItemsAreEffectivelyEqualHash (g: TcGlobals) orig = match orig with | EntityUse tcref -> tyconRefDefnHash g tcref | Item.TypeVar (nm, _)-> hash nm + | Item.Trait traitInfo -> hash traitInfo.MemberLogicalName | ValUse vref -> valRefDefnHash g vref | ActivePatternCaseUse (_, _, idx)-> hash idx | MethodUse minfo -> minfo.ComputeHashCode() @@ -2142,6 +2150,7 @@ let CheckAllTyparsInferrable amap m item = let free = Zset.diff freeInDeclaringType.FreeTypars freeInArgsAndRetType.FreeTypars free.IsEmpty) + | Item.Trait _ | Item.CtorGroup _ | Item.FakeInterfaceCtor _ | Item.DelegateCtor _ @@ -2521,7 +2530,10 @@ let rec ResolveLongIdentInTypePrim (ncenv: NameResolver) nenv lookupKind (resInf OneResult (success(resInfo, item, rest)) | None -> let isLookUpExpr = (lookupKind = LookupKind.Expr) - match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm, ad) findFlag m ty with + match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm, ad, true) findFlag m ty with + | Some (TraitItem (traitInfo :: _)) when isLookUpExpr -> + success [resInfo, Item.Trait traitInfo, rest] + | Some (PropertyItem psets) when isLookUpExpr -> let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m @@ -3649,7 +3661,7 @@ let NeedsWorkAfterResolution namedItem = | Item.MethodGroup(_, minfos, _) | Item.CtorGroup(_, minfos) -> minfos.Length > 1 || minfos |> List.exists (fun minfo -> not (isNil minfo.FormalMethodInst)) | Item.Property(_, pinfos) -> pinfos.Length > 1 - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> not (List.isEmpty vref.Typars) | Item.CustomOperation (_, _, Some minfo) -> not (isNil minfo.FormalMethodInst) | Item.ActivePatternCase apref -> not (List.isEmpty apref.ActivePatternVal.Typars) @@ -3922,6 +3934,11 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso x.IsStatic = statics && IsILFieldInfoAccessible g amap m ad x) + let qinfos = + ncenv.InfoReader.GetTraitInfosInType None ty + |> List.filter (fun x -> + x.MemberFlags.IsInstance = not statics) + let pinfosIncludingUnseen = AllPropInfosOfTypeInScope ResultCollectionSettings.AllResults ncenv.InfoReader nenv None ad PreferOverrides m ty |> List.filter (fun x -> @@ -4085,6 +4102,7 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso List.map Item.RecdField rfinfos @ pinfoItems @ anonFields @ + List.map Item.Trait qinfos @ List.map Item.ILField finfos @ List.map Item.Event einfos @ List.map (ItemOfTy g) nestedTypes @ @@ -4441,7 +4459,15 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE for tcref in LookupTypeNameInEnvNoArity OpenQualified id nenv do let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m let ty = FreshenTycon ncenv m tcref - yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad true rest ty ] + yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad true rest ty + + // 'T.Ident: lookup a static something in a type parameter + // ^T.Ident: lookup a static something in a type parameter + match nenv.eTypars.TryGetValue id with + | true, tp -> + let ty = mkTyparTy tp + yield! ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad true rest ty + | _ -> () ] namespaces @ values @ staticSomethingInType @@ -4601,6 +4627,8 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv: | _-> [] modsOrNs @ qualifiedFields +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty (item: Item) : seq = seq { let g = ncenv.g @@ -4790,6 +4818,8 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( | _ -> () } +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad statics plid (item: Item) ty = seq { let g = ncenv.g @@ -4838,6 +4868,8 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta yield! finfo.FieldType(amap, m) |> ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item } +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) nenv m ad (modref: ModuleOrNamespaceRef) plid (item: Item) = let g = ncenv.g let mty = modref.ModuleOrNamespaceType @@ -4928,6 +4960,8 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad true rest item ty } +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let rec PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f plid (modref: ModuleOrNamespaceRef) = let mty = modref.ModuleOrNamespaceType match plid with @@ -4938,6 +4972,8 @@ let rec PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f pli PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f rest (modref.NestedTyconRef mty) | _ -> Seq.empty +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let PartialResolveLongIdentAsModuleOrNamespaceThenLazy (nenv: NameResolutionEnv) plid f = seq { match plid with @@ -4950,6 +4986,8 @@ let PartialResolveLongIdentAsModuleOrNamespaceThenLazy (nenv: NameResolutionEnv) | [] -> () } +// This is "on-demand" reimplementation of completion logic that is only used along one +// pathway - `IsRelativeNameResolvableFromSymbol` - in the editor support for simplifying names let rec GetCompletionForItem (ncenv: NameResolver) (nenv: NameResolutionEnv) m ad plid (item: Item) : seq = seq { let g = ncenv.g diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 1494c029b85..d0be9852589 100644 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -41,10 +41,6 @@ type ArgumentContainer = /// The named argument is a static parameter to a provided type. | Type of TyconRef -/// Detect a use of a nominal type, including type abbreviations. -/// When reporting symbols, we care about abbreviations, e.g. 'int' and 'int32' count as two separate symbols. -val (|AbbrevOrAppTy|_|): TType -> TyconRef option - type EnclosingTypeInst = TypeInst /// Represents an item that results from name resolution @@ -68,6 +64,9 @@ type Item = /// Represents the resolution of a name to an F# record or exception field. | RecdField of RecdFieldInfo + /// Represents the resolution of a name to an F# trait + | Trait of TraitConstraintInfo + /// Represents the resolution of a name to a union case field. | UnionCaseField of UnionCaseInfo * fieldIndex: int diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index efaafc194f3..ed7e92bf0ef 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -795,26 +795,49 @@ module PrintTypes = WordL.arrow ^^ (layoutTyparRefWithInfo denv env tp)) |> longConstraintPrefix] - and layoutTraitWithInfo denv env (TTrait(tys, nm, memFlags, argTys, retTy, _)) = + and layoutTraitWithInfo denv env traitInfo = + let g = denv.g + let (TTrait(tys, _, memFlags, _, _, _)) = traitInfo + let nm = traitInfo.MemberDisplayNameCore let nameL = ConvertValLogicalNameToDisplayLayout false (tagMember >> wordL) nm if denv.shortConstraints then WordL.keywordMember ^^ nameL else - let retTy = GetFSharpViewOfReturnType denv.g retTy + let retTy = traitInfo.GetReturnType(g) + let argTys = traitInfo.GetLogicalArgumentTypes(g) + let argTys, retTy = + match memFlags.MemberKind with + | SynMemberKind.PropertySet -> + match List.tryFrontAndBack argTys with + | Some res -> res + | None -> argTys, retTy + | _ -> + argTys, retTy + let stat = layoutMemberFlags memFlags - let tys = ListSet.setify (typeEquiv denv.g) tys + let tys = ListSet.setify (typeEquiv g) tys let tysL = match tys with | [ty] -> layoutTypeWithInfo denv env ty | tys -> bracketL (layoutTypesWithInfoAndPrec denv env 2 (wordL (tagKeyword "or")) tys) - let argTysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argTys let retTyL = layoutReturnType denv env retTy let sigL = match argTys with + // Empty arguments indicates a non-indexer property constraint | [] -> retTyL - | _ -> curriedLayoutsL "->" [argTysL] retTyL - (tysL |> addColonL) --- bracketL (stat ++ (nameL |> addColonL) --- sigL) + | _ -> + let argTysL = layoutTypesWithInfoAndPrec denv env 2 (wordL (tagPunctuation "*")) argTys + curriedLayoutsL "->" [argTysL] retTyL + let getterSetterL = + match memFlags.MemberKind with + | SynMemberKind.PropertyGet when not argTys.IsEmpty -> + wordL (tagKeyword "with") ^^ wordL (tagText "get") + | SynMemberKind.PropertySet -> + wordL (tagKeyword "with") ^^ wordL (tagText "set") + | _ -> + emptyL + (tysL |> addColonL) --- bracketL (stat ++ (nameL |> addColonL) --- sigL --- getterSetterL) /// Layout a unit of measure expression and layoutMeasure denv unt = @@ -1003,7 +1026,10 @@ module PrintTypes = else bracketL coreL --- nmL - let layoutTyparConstraint denv (tp, tpc) = + let layoutTrait denv traitInfo = + layoutTraitWithInfo denv SimplifyTypes.typeSimplificationInfo0 traitInfo + + let layoutTyparConstraint denv (tp, tpc) = match layoutConstraintWithInfo denv SimplifyTypes.typeSimplificationInfo0 (tp, tpc) with | h :: _ -> h | [] -> emptyL @@ -1122,7 +1148,20 @@ module PrintTypes = let cxsL = layoutConstraintsWithInfo denv env env.postfixConstraints layoutTypeWithInfoAndPrec denv env 2 ty --- cxsL - let prettyLayoutOfTypeNoConstraints denv ty = + let prettyLayoutOfTrait denv traitInfo = + let compgenId = SyntaxTreeOps.mkSynId Range.range0 unassignedTyparName + let fakeTypar = Construct.NewTypar (TyparKind.Type, TyparRigidity.Flexible, SynTypar(compgenId, TyparStaticReq.None, true), false, TyparDynamicReq.No, [], false, false) + fakeTypar.SetConstraints [TyparConstraint.MayResolveMember(traitInfo, Range.range0)] + let ty, cxs = PrettyTypes.PrettifyType denv.g (mkTyparTy fakeTypar) + let env = SimplifyTypes.CollectInfo true [ty] cxs + // We expect one constraint, since we put one in. + match env.postfixConstraints with + | cx :: _ -> + // We expect at most one per constraint + sepListL emptyL (layoutConstraintWithInfo denv env cx) + | [] -> emptyL + + let prettyLayoutOfTypeNoConstraints denv ty = let ty, _cxs = PrettyTypes.PrettifyType denv.g ty layoutTypeWithInfoAndPrec denv SimplifyTypes.typeSimplificationInfo0 5 ty @@ -1342,7 +1381,9 @@ module PrintTastMemberOrVals = let prettyLayoutOfValOrMemberNoInst denv infoReader v = prettyLayoutOfValOrMember denv infoReader emptyTyparInst v |> snd -let layoutTyparConstraint denv x = x |> PrintTypes.layoutTyparConstraint denv +let layoutTrait denv x = x |> PrintTypes.layoutTrait denv + +let layoutTyparConstraint denv x = x |> PrintTypes.layoutTyparConstraint denv let outputType denv os x = x |> PrintTypes.layoutType denv |> bufferL os @@ -2512,6 +2553,8 @@ let stringOfTy denv x = x |> PrintTypes.layoutType denv |> showL let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv +let prettyLayoutOfTrait denv x = x |> PrintTypes.prettyLayoutOfTrait denv + let prettyLayoutOfTypeNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv let prettyLayoutOfTypar denv x = x |> PrintTypes.layoutTyparRef denv @@ -2621,4 +2664,3 @@ let minimalStringOfType denv ty = let ty, _cxs = PrettyTypes.PrettifyType denv.g ty let denvMin = { denv with showInferenceTyparAnnotations=false; showStaticallyResolvedTyparAnnotations=false } showL (PrintTypes.layoutTypeWithInfoAndPrec denvMin SimplifyTypes.typeSimplificationInfo0 2 ty) - diff --git a/src/Compiler/Checking/NicePrint.fsi b/src/Compiler/Checking/NicePrint.fsi index f00cd3395e1..75c227b0d99 100644 --- a/src/Compiler/Checking/NicePrint.fsi +++ b/src/Compiler/Checking/NicePrint.fsi @@ -113,6 +113,8 @@ val stringOfTy: denv: DisplayEnv -> x: TType -> string val prettyLayoutOfType: denv: DisplayEnv -> x: TType -> Layout +val prettyLayoutOfTrait: denv: DisplayEnv -> x: TraitConstraintInfo -> Layout + val prettyLayoutOfTypeNoCx: denv: DisplayEnv -> x: TType -> Layout val prettyLayoutOfTypar: denv: DisplayEnv -> x: Typar -> Layout diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 60b5e2aac52..168a9bb7f09 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -1063,11 +1063,11 @@ let CompilePatternBasic | Some (ediCaptureMethInfo, ediThrowMethInfo) -> let edi, _ = BuildMethodCall tcVal g amap NeverMutates mMatch false - ediCaptureMethInfo ValUseFlag.NormalValUse [] [] [ (exprForVal mMatch origInputVal) ] + ediCaptureMethInfo ValUseFlag.NormalValUse [] [] [ (exprForVal mMatch origInputVal) ] None let e, _ = BuildMethodCall tcVal g amap NeverMutates mMatch false - ediThrowMethInfo ValUseFlag.NormalValUse [] [edi] [ ] + ediThrowMethInfo ValUseFlag.NormalValUse [] [edi] [ ] None mkCompGenSequential mMatch e (mkDefault (mMatch, resultTy)) diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 035e5a237ce..031c5ae7991 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -651,7 +651,7 @@ let CheckTypeAux permitByRefLike (cenv: cenv) env m ty onInnerByrefError = let visitTraitSolution info = match info with - | FSMethSln(_, vref, _) -> + | FSMethSln(_, vref, _, _) -> //printfn "considering %s..." vref.DisplayName if valRefInThisAssembly cenv.g.compilingFSharpCore vref && not (cenv.boundVals.ContainsKey(vref.Stamp)) then //printfn "recording %s..." vref.DisplayName diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index 949cc59de7c..80c7e52e7bf 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -260,7 +260,7 @@ and GetWitnessArgs cenv (env : QuotationTranslationEnv) m tps tyargs = and ConvWitnessInfo cenv env m traitInfo = let g = cenv.g - let witnessInfo = traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() let env = { env with suppressWitnesses = true } // First check if this is a witness in ReflectedDefinition code if env.witnessesInScope.ContainsKey witnessInfo then @@ -712,7 +712,8 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let inWitnessPassingScope = not env.witnessesInScope.IsEmpty let witnessArgInfo = if g.generateWitnesses && inWitnessPassingScope then - match env.witnessesInScope.TryGetValue traitInfo.TraitKey with + let witnessInfo = traitInfo.GetWitnessInfo() + match env.witnessesInScope.TryGetValue witnessInfo with | true, storage -> Some storage | _ -> None else diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index 4a689f48a0c..8e10990d11d 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -11,6 +11,7 @@ open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Compiler open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.Infos open FSharp.Compiler.InfoReader open FSharp.Compiler.Syntax @@ -122,9 +123,15 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = let aenv = aenv.BindEquivTypars implTypars sigTypars (implTypars, sigTypars) ||> List.forall2 (fun implTypar sigTypar -> let m = sigTypar.Range - if implTypar.StaticReq <> sigTypar.StaticReq then - errorR (Error(FSComp.SR.typrelSigImplNotCompatibleCompileTimeRequirementsDiffer(), m)) + let check = + if g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + implTypar.StaticReq = TyparStaticReq.HeadType && sigTypar.StaticReq = TyparStaticReq.None + else + implTypar.StaticReq <> sigTypar.StaticReq + if check then + errorR (Error(FSComp.SR.typrelSigImplNotCompatibleCompileTimeRequirementsDiffer(), m)) + // Adjust the actual type parameter name to look like the signature implTypar.SetIdent (mkSynId implTypar.Range sigTypar.Id.idText) diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index fe44b9cf874..feaaf09e71b 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -9,6 +9,7 @@ open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Import +open FSharp.Compiler.Features open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals @@ -151,21 +152,26 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m ty = // This measure-annotated type is considered to support the interfaces on its representation type A, // with the exception that // -// 1. we rewrite the IComparable and IEquatable interfaces, so that +// 1. Rewrite the IComparable and IEquatable interfaces, so that // IComparable --> IComparable> // IEquatable --> IEquatable> // -// 2. we emit any other interfaces that derive from IComparable and IEquatable interfaces +// 2. Omit any other interfaces that derive from IComparable and IEquatable interfaces // // This rule is conservative and only applies to IComparable and IEquatable interfaces. // -// This rule may in future be extended to rewrite the "trait" interfaces associated with .NET 7. +// We also: +// 3. Omit any interfaces in System.Numerics, since pretty much none of them are adequate for units of measure +// There are some exceptions, e.g. IAdditiveIdentity, but these are available3 by different routes in F# and for clarity +// it is better to imply omit all and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = [ - // Report any interfaces that don't derive from IComparable<_> or IEquatable<_> + // Suppress any interfaces that derive from IComparable<_> or IEquatable<_> + // Suppress any interfaces in System.Numerics, since none of them are adequate for units of measure for intfTy in GetImmediateInterfacesOfType skipUnref g amap m reprTy do if not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIComparable_tcref skipUnref g amap m intfTy) && - not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m intfTy) then + not (ExistsHeadTypeInInterfaceHierarchy g.system_GenericIEquatable_tcref skipUnref g amap m intfTy) && + not (ExistsSystemNumericsTypeInInterfaceHierarchy skipUnref g amap m intfTy) then intfTy // NOTE: we should really only report the IComparable> interface for measure-annotated types @@ -180,6 +186,19 @@ and GetImmediateInterfacesOfMeasureAnnotatedType skipUnref g amap m ty reprTy = mkAppTy g.system_GenericIEquatable_tcref [ty] ] +// Check for any System.Numerics type in the interface hierarchy +and ExistsSystemNumericsTypeInInterfaceHierarchy skipUnref g amap m ity = + g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers && + ExistsInInterfaceHierarchy + (fun ity2 -> + match ity2 with + | AppTy g (tcref,_) -> + match tcref.CompilationPath.AccessPath with + | [("System", _); ("Numerics", _)] -> true + | _ -> false + | _ -> false) + skipUnref g amap m ity + // Check for IComparable, IEquatable and interfaces that derive from these and ExistsHeadTypeInInterfaceHierarchy target skipUnref g amap m intfTy = ExistsInInterfaceHierarchy (function AppTy g (tcref,_) -> tyconRefEq g tcref target | _ -> false) skipUnref g amap m intfTy @@ -199,7 +218,7 @@ type AllowMultiIntfInstantiations = Yes | No /// Traverse the type hierarchy, e.g. f D (f C (f System.Object acc)). /// Visit base types and interfaces first. -let private FoldHierarchyOfTypeAux followInterfaces allowMultiIntfInst skipUnref visitor g amap m ty acc = +let FoldHierarchyOfTypeAux followInterfaces allowMultiIntfInst skipUnref visitor g amap m ty acc = let rec loop ndeep ty (visitedTycon, visited: TyconRefMultiMap<_>, acc as state) = let seenThisTycon = diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index f77563eae62..1c0612eb611 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -273,6 +273,70 @@ type ParamData = reflArgInfo: ReflectedArgInfo * ttype: TType +type ParamAttribs = ParamAttribs of isParamArrayArg: bool * isInArg: bool * isOutArg: bool * optArgInfo: OptionalArgInfo * callerInfo: CallerInfo * reflArgInfo: ReflectedArgInfo + +let CrackParamAttribsInfo g (ty: TType, argInfo: ArgReprInfo) = + let isParamArrayArg = HasFSharpAttribute g g.attrib_ParamArrayAttribute argInfo.Attribs + let reflArgInfo = + match TryFindFSharpBoolAttributeAssumeFalse g g.attrib_ReflectedDefinitionAttribute argInfo.Attribs with + | Some b -> ReflectedArgInfo.Quote b + | None -> ReflectedArgInfo.None + let isOutArg = (HasFSharpAttribute g g.attrib_OutAttribute argInfo.Attribs && isByrefTy g ty) || isOutByrefTy g ty + let isInArg = (HasFSharpAttribute g g.attrib_InAttribute argInfo.Attribs && isByrefTy g ty) || isInByrefTy g ty + let isCalleeSideOptArg = HasFSharpAttribute g g.attrib_OptionalArgumentAttribute argInfo.Attribs + let isCallerSideOptArg = HasFSharpAttributeOpt g g.attrib_OptionalAttribute argInfo.Attribs + let optArgInfo = + if isCalleeSideOptArg then + CalleeSide + elif isCallerSideOptArg then + let defaultParameterValueAttribute = TryFindFSharpAttributeOpt g g.attrib_DefaultParameterValueAttribute argInfo.Attribs + match defaultParameterValueAttribute with + | None -> + // Do a type-directed analysis of the type to determine the default value to pass. + // Similar rules as OptionalArgInfo.FromILParameter are applied here, except for the COM and byref-related stuff. + CallerSide (if isObjTy g ty then MissingValue else DefaultValue) + | Some attr -> + let defaultValue = OptionalArgInfo.ValueOfDefaultParameterValueAttrib attr + match defaultValue with + | Some (Expr.Const (_, m, ty2)) when not (typeEquiv g ty2 ty) -> + // the type of the default value does not match the type of the argument. + // Emit a warning, and ignore the DefaultParameterValue argument altogether. + warning(Error(FSComp.SR.DefaultParameterValueNotAppropriateForArgument(), m)) + NotOptional + | Some (Expr.Const (ConstToILFieldInit fi, _, _)) -> + // Good case - all is well. + CallerSide (Constant fi) + | _ -> + // Default value is not appropriate, i.e. not a constant. + // Compiler already gives an error in that case, so just ignore here. + NotOptional + else NotOptional + + let isCallerLineNumberArg = HasFSharpAttribute g g.attrib_CallerLineNumberAttribute argInfo.Attribs + let isCallerFilePathArg = HasFSharpAttribute g g.attrib_CallerFilePathAttribute argInfo.Attribs + let isCallerMemberNameArg = HasFSharpAttribute g g.attrib_CallerMemberNameAttribute argInfo.Attribs + + let callerInfo = + match isCallerLineNumberArg, isCallerFilePathArg, isCallerMemberNameArg with + | false, false, false -> NoCallerInfo + | true, false, false -> CallerLineNumber + | false, true, false -> CallerFilePath + | false, false, true -> CallerMemberName + | false, true, true -> + match TryFindFSharpAttribute g g.attrib_CallerMemberNameAttribute argInfo.Attribs with + | Some(Attrib(_, _, _, _, _, _, callerMemberNameAttributeRange)) -> + warning(Error(FSComp.SR.CallerMemberNameIsOverriden(argInfo.Name.Value.idText), callerMemberNameAttributeRange)) + CallerFilePath + | _ -> failwith "Impossible" + | _, _, _ -> + // if multiple caller info attributes are specified, pick the "wrong" one here + // so that we get an error later + match tryDestOptionTy g ty with + | ValueSome optTy when typeEquiv g g.int32_ty optTy -> CallerFilePath + | _ -> CallerLineNumber + + ParamAttribs(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo) + #if !NO_TYPEPROVIDERS type ILFieldInit with @@ -632,8 +696,9 @@ type MethInfo = /// Get the method name in DebuggerDisplayForm member x.DebuggerDisplayName = match x with - | ILMeth(_, y, _) -> "ILMeth: " + y.ILName - | FSMeth(_, _, vref, _) -> "FSMeth: " + vref.LogicalName + | ILMeth(_, y, _) -> y.DeclaringTyconRef.DisplayNameWithStaticParametersAndUnderscoreTypars + "::" + y.ILName + | FSMeth(_, AbbrevOrAppTy tcref, vref, _) -> tcref.DisplayNameWithStaticParametersAndUnderscoreTypars + "::" + vref.LogicalName + | FSMeth(_, _, vref, _) -> "??::" + vref.LogicalName #if !NO_TYPEPROVIDERS | ProvidedMeth(_, mi, _, m) -> "ProvidedMeth: " + mi.PUntaint((fun mi -> mi.Name), m) #endif @@ -670,7 +735,7 @@ type MethInfo = #endif | _ -> false - override x.ToString() = x.ApparentEnclosingType.ToString() + x.LogicalName + override x.ToString() = x.ApparentEnclosingType.ToString() + "::" + x.LogicalName /// Get the actual type instantiation of the declaring type associated with this use of the method. /// @@ -1105,72 +1170,11 @@ type MethInfo = if p.Type.TypeRef.FullName = "System.Int32" then CallerFilePath else CallerLineNumber - yield (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo) ] ] + ParamAttribs(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo) ] ] | FSMeth(g, _, vref, _) -> GetArgInfosOfMember x.IsCSharpStyleExtensionMember g vref - |> List.mapSquared (fun (ty, argInfo) -> - let isParamArrayArg = HasFSharpAttribute g g.attrib_ParamArrayAttribute argInfo.Attribs - let reflArgInfo = - match TryFindFSharpBoolAttributeAssumeFalse g g.attrib_ReflectedDefinitionAttribute argInfo.Attribs with - | Some b -> ReflectedArgInfo.Quote b - | None -> ReflectedArgInfo.None - let isOutArg = (HasFSharpAttribute g g.attrib_OutAttribute argInfo.Attribs && isByrefTy g ty) || isOutByrefTy g ty - let isInArg = (HasFSharpAttribute g g.attrib_InAttribute argInfo.Attribs && isByrefTy g ty) || isInByrefTy g ty - let isCalleeSideOptArg = HasFSharpAttribute g g.attrib_OptionalArgumentAttribute argInfo.Attribs - let isCallerSideOptArg = HasFSharpAttributeOpt g g.attrib_OptionalAttribute argInfo.Attribs - let optArgInfo = - if isCalleeSideOptArg then - CalleeSide - elif isCallerSideOptArg then - let defaultParameterValueAttribute = TryFindFSharpAttributeOpt g g.attrib_DefaultParameterValueAttribute argInfo.Attribs - match defaultParameterValueAttribute with - | None -> - // Do a type-directed analysis of the type to determine the default value to pass. - // Similar rules as OptionalArgInfo.FromILParameter are applied here, except for the COM and byref-related stuff. - CallerSide (if isObjTy g ty then MissingValue else DefaultValue) - | Some attr -> - let defaultValue = OptionalArgInfo.ValueOfDefaultParameterValueAttrib attr - match defaultValue with - | Some (Expr.Const (_, m, ty2)) when not (typeEquiv g ty2 ty) -> - // the type of the default value does not match the type of the argument. - // Emit a warning, and ignore the DefaultParameterValue argument altogether. - warning(Error(FSComp.SR.DefaultParameterValueNotAppropriateForArgument(), m)) - NotOptional - | Some (Expr.Const (ConstToILFieldInit fi, _, _)) -> - // Good case - all is well. - CallerSide (Constant fi) - | _ -> - // Default value is not appropriate, i.e. not a constant. - // Compiler already gives an error in that case, so just ignore here. - NotOptional - else NotOptional - - let isCallerLineNumberArg = HasFSharpAttribute g g.attrib_CallerLineNumberAttribute argInfo.Attribs - let isCallerFilePathArg = HasFSharpAttribute g g.attrib_CallerFilePathAttribute argInfo.Attribs - let isCallerMemberNameArg = HasFSharpAttribute g g.attrib_CallerMemberNameAttribute argInfo.Attribs - - let callerInfo = - match isCallerLineNumberArg, isCallerFilePathArg, isCallerMemberNameArg with - | false, false, false -> NoCallerInfo - | true, false, false -> CallerLineNumber - | false, true, false -> CallerFilePath - | false, false, true -> CallerMemberName - | false, true, true -> - match TryFindFSharpAttribute g g.attrib_CallerMemberNameAttribute argInfo.Attribs with - | Some(Attrib(_, _, _, _, _, _, callerMemberNameAttributeRange)) -> - warning(Error(FSComp.SR.CallerMemberNameIsOverriden(argInfo.Name.Value.idText), callerMemberNameAttributeRange)) - CallerFilePath - | _ -> failwith "Impossible" - | _, _, _ -> - // if multiple caller info attributes are specified, pick the "wrong" one here - // so that we get an error later - match tryDestOptionTy g ty with - | ValueSome optTy when typeEquiv g g.int32_ty optTy -> CallerFilePath - | _ -> CallerLineNumber - - (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo)) - + |> List.mapSquared (CrackParamAttribsInfo g) | DefaultStructCtor _ -> [[]] @@ -1187,7 +1191,7 @@ type MethInfo = | None -> ReflectedArgInfo.None let isOutArg = p.PUntaint((fun p -> p.IsOut && not p.IsIn), m) let isInArg = p.PUntaint((fun p -> p.IsIn && not p.IsOut), m) - yield (isParamArrayArg, isInArg, isOutArg, optArgInfo, NoCallerInfo, reflArgInfo)] ] + ParamAttribs(isParamArrayArg, isInArg, isOutArg, optArgInfo, NoCallerInfo, reflArgInfo)] ] #endif /// Get the signature of an abstract method slot. @@ -1224,9 +1228,9 @@ type MethInfo = // REVIEW: should we copy down attributes to slot params? let tcref = tcrefOfAppTy g x.ApparentEnclosingAppType let formalEnclosingTyparsOrig = tcref.Typars m - let formalEnclosingTypars = copyTypars formalEnclosingTyparsOrig + let formalEnclosingTypars = copyTypars false formalEnclosingTyparsOrig let _, formalEnclosingTyparTys = FixupNewTypars m [] [] formalEnclosingTyparsOrig formalEnclosingTypars - let formalMethTypars = copyTypars x.FormalMethodTypars + let formalMethTypars = copyTypars false x.FormalMethodTypars let _, formalMethTyparTys = FixupNewTypars m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars let formalRetTy, formalParams = @@ -1288,7 +1292,8 @@ type MethInfo = #endif let paramAttribs = x.GetParamAttribs(amap, m) - (paramAttribs, paramNamesAndTypes) ||> List.map2 (List.map2 (fun (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo) (ParamNameAndType(nmOpt, pty)) -> + (paramAttribs, paramNamesAndTypes) ||> List.map2 (List.map2 (fun info (ParamNameAndType(nmOpt, pty)) -> + let (ParamAttribs(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo)) = info ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, nmOpt, reflArgInfo, pty))) /// Get the ParamData objects for the parameters of a MethInfo diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index ed9964db644..63a24eb6502 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -136,6 +136,18 @@ type ParamData = reflArgInfo: ReflectedArgInfo * ttype: TType +// Adhoc information - could be unified with ParamData +type ParamAttribs = + | ParamAttribs of + isParamArrayArg: bool * + isInArg: bool * + isOutArg: bool * + optArgInfo: OptionalArgInfo * + callerInfo: CallerInfo * + reflArgInfo: ReflectedArgInfo + +val CrackParamAttribsInfo: TcGlobals -> ty: TType * argInfo: ArgReprInfo -> ParamAttribs + /// Describes an F# use of an IL type, including the type instantiation associated with the type at a particular usage point. [] type ILTypeInfo = @@ -500,8 +512,7 @@ type MethInfo = member GetCustomAttrs: unit -> ILAttributes /// Get the parameter attributes of a method info, which get combined with the parameter names and types - member GetParamAttribs: - amap: ImportMap * m: range -> (bool * bool * bool * OptionalArgInfo * CallerInfo * ReflectedArgInfo) list list + member GetParamAttribs: amap: ImportMap * m: range -> ParamAttribs list list /// Get the ParamData objects for the parameters of a MethInfo member GetParamDatas: amap: ImportMap * m: range * minst: TType list -> ParamData list list diff --git a/src/Compiler/CodeGen/EraseClosures.fs b/src/Compiler/CodeGen/EraseClosures.fs index 5ba6c4b50a0..a0c022a01a8 100644 --- a/src/Compiler/CodeGen/EraseClosures.fs +++ b/src/Compiler/CodeGen/EraseClosures.fs @@ -366,7 +366,7 @@ let convReturnInstr ty instr = | I_ret -> [ I_box ty; I_ret ] | I_call (_, mspec, varargs) -> [ I_call(Normalcall, mspec, varargs) ] | I_callvirt (_, mspec, varargs) -> [ I_callvirt(Normalcall, mspec, varargs) ] - | I_callconstraint (_, ty, mspec, varargs) -> [ I_callconstraint(Normalcall, ty, mspec, varargs) ] + | I_callconstraint (callvirt, _, ty, mspec, varargs) -> [ I_callconstraint(callvirt, Normalcall, ty, mspec, varargs) ] | I_calli (_, csig, varargs) -> [ I_calli(Normalcall, csig, varargs) ] | _ -> [ instr ] @@ -573,6 +573,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let nowApplyMethDef = mkILGenericVirtualMethod ( "Specialize", + ILCallingConv.Instance, ILMemberAccess.Public, addedGenParams (* method is generic over added ILGenericParameterDefs *) , [], @@ -707,7 +708,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let convil = convILMethodBody (Some nowCloSpec, None) (Lazy.force clo.cloCode) let nowApplyMethDef = - mkILNonGenericVirtualMethod ( + mkILNonGenericVirtualInstanceMethod ( "Invoke", ILMemberAccess.Public, nowParams, diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 28d06545589..753e7772676 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1389,7 +1389,7 @@ let GetMethodSpecForMemberVal cenv (memberInfo: ValMemberInfo) (vref: ValRef) = // Find the 'this' argument type if any let thisTy, flatArgInfos = if isCtor then - (GetFSharpViewOfReturnType g returnTy), flatArgInfos + GetFSharpViewOfReturnType g returnTy, flatArgInfos else match flatArgInfos with | [] -> error (InternalError("This instance method '" + vref.LogicalName + "' has no arguments", m)) @@ -1408,22 +1408,20 @@ let GetMethodSpecForMemberVal cenv (memberInfo: ValMemberInfo) (vref: ValRef) = warning (InternalError(msg, m)) else - List.iter2 - (fun gtp ty2 -> - if not (typeEquiv g (mkTyparTy gtp) ty2) then - warning ( - InternalError( - "CodeGen check: type checking did not quantify the correct type variables for this method: generalization list contained " - + gtp.Name - + "#" - + string gtp.Stamp - + " and list from 'this' pointer contained " - + (showL (typeL ty2)), - m - ) - )) - ctps - thisArgTys + (ctps, thisArgTys) + ||> List.iter2 (fun gtp ty2 -> + if not (typeEquiv g (mkTyparTy gtp) ty2) then + warning ( + InternalError( + "CodeGen check: type checking did not quantify the correct type variables for this method: generalization list contained " + + gtp.Name + + "#" + + string gtp.Stamp + + " and list from 'this' pointer contained " + + (showL (typeL ty2)), + m + ) + )) let methodArgTys, paramInfos = List.unzip flatArgInfos @@ -3985,7 +3983,8 @@ and GenUntupledArgExpr cenv cgbuf eenv m argInfos expr = and GenWitnessArgFromTraitInfo cenv cgbuf eenv m traitInfo = let g = cenv.g - let storage = TryStorageForWitness g eenv traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() + let storage = TryStorageForWitness g eenv witnessInfo match storage with | None -> @@ -4001,7 +4000,8 @@ and GenWitnessArgFromTraitInfo cenv cgbuf eenv m traitInfo = let eenv = { eenv with suppressWitnesses = true } GenExpr cenv cgbuf eenv arg Continue | Some storage -> - let ty = GenWitnessTy g traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() + let ty = GenWitnessTy g witnessInfo GenGetStorageAndSequel cenv cgbuf eenv m (ty, GenType cenv m eenv.tyenv ty) storage None and GenWitnessArgFromWitnessInfo cenv cgbuf eenv m witnessInfo = @@ -4283,13 +4283,15 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = else Normalcall - let useICallVirt = virtualCall || useCallVirt cenv boxity mspec isBaseCall + let useICallVirt = + (virtualCall || useCallVirt cenv boxity mspec isBaseCall) + && mspec.MethodRef.CallingConv.IsInstance let callInstr = match valUseFlags with | PossibleConstrainedCall ty -> let ilThisTy = GenType cenv m eenv.tyenv ty - I_callconstraint(isTailCall, ilThisTy, mspec, None) + I_callconstraint(useICallVirt, isTailCall, ilThisTy, mspec, None) | _ -> if newobj then I_newobj(mspec, None) elif useICallVirt then I_callvirt(isTailCall, mspec, None) @@ -5354,7 +5356,10 @@ and GenILCall let ilMethArgTys = GenTypeArgs cenv m eenv.tyenv methArgTys let ilReturnTys = GenTypes cenv m eenv.tyenv returnTys let ilMethSpec = mkILMethSpec (ilMethRef, boxity, ilEnclArgTys, ilMethArgTys) - let useICallVirt = virt || useCallVirt cenv boxity ilMethSpec isBaseCall + + let useICallVirt = + (virt || useCallVirt cenv boxity ilMethSpec isBaseCall) + && ilMethRef.CallingConv.IsInstance // Load the 'this' pointer to pass to the superclass constructor. This argument is not // in the expression tree since it can't be treated like an ordinary value @@ -5370,7 +5375,7 @@ and GenILCall match ccallInfo with | Some objArgTy -> let ilObjArgTy = GenType cenv m eenv.tyenv objArgTy - I_callconstraint(tail, ilObjArgTy, ilMethSpec, None) + I_callconstraint(useICallVirt, tail, ilObjArgTy, ilMethSpec, None) | None -> if useICallVirt then I_callvirt(tail, ilMethSpec, None) @@ -5405,14 +5410,16 @@ and GenTraitCall (cenv: cenv) cgbuf eenv (traitInfo: TraitConstraintInfo, argExp let witness = if generateWitnesses then - TryStorageForWitness g eenv traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() + TryStorageForWitness g eenv witnessInfo else None match witness with | Some storage -> - let ty = GenWitnessTy g traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() + let ty = GenWitnessTy g witnessInfo let argExprs = if argExprs.Length = 0 then [ mkUnit g m ] else argExprs GenGetStorageAndSequel cenv cgbuf eenv m (ty, GenType cenv m eenv.tyenv ty) storage (Some([], argExprs, m, sequel)) @@ -5421,13 +5428,13 @@ and GenTraitCall (cenv: cenv) cgbuf eenv (traitInfo: TraitConstraintInfo, argExp // If witnesses are available, we should now always find trait witnesses in scope assert not generateWitnesses - let minfoOpt = + let exprOpt = CommitOperationResult(ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.tcVal g cenv.amap m traitInfo argExprs) - match minfoOpt with + match exprOpt with | None -> let exnArg = - mkString g m (FSComp.SR.ilDynamicInvocationNotSupported (traitInfo.MemberName)) + mkString g m (FSComp.SR.ilDynamicInvocationNotSupported (traitInfo.MemberLogicalName)) let exnExpr = MakeNotSupportedExnExpr cenv eenv (exnArg, m) let replacementExpr = mkThrow m (tyOfExpr g expr) exnExpr @@ -5668,7 +5675,7 @@ and GenFormalSlotsig m cenv eenv slotsig = let ilRet = GenFormalReturnType m cenv eenvForSlotSig returnTy ilTy, ilParams, ilRet -and GenOverridesSpec cenv eenv slotsig m = +and GenOverridesSpec cenv eenv slotsig m isInstance = let (TSlotSig (nameOfOverridenMethod, _, _, methodTypars, _, _)) = slotsig let ilOverrideTy, ilOverrideParams, ilOverrideRet = @@ -5676,10 +5683,16 @@ and GenOverridesSpec cenv eenv slotsig m = let ilOverrideTyRef = ilOverrideTy.TypeRef + let callingConv = + if isInstance then + ILCallingConv.Instance + else + ILCallingConv.Static + let ilOverrideMethRef = mkILMethRef ( ilOverrideTyRef, - ILCallingConv.Instance, + callingConv, nameOfOverridenMethod, List.length (DropErasedTypars methodTypars), typesOfILParams ilOverrideParams, @@ -5742,8 +5755,8 @@ and GenNameOfOverridingMethod cenv (useMethodImpl, slotsig) = else nameOfOverridenMethod -and GenMethodImpl cenv eenv (useMethodImpl, slotsig) m = - let ilOverridesSpec = GenOverridesSpec cenv eenv slotsig m +and GenMethodImpl cenv eenv (useMethodImpl, slotsig) m isInstance = + let ilOverridesSpec = GenOverridesSpec cenv eenv slotsig m isInstance let nameOfOverridingMethod = GenNameOfOverridingMethod cenv (useMethodImpl, slotsig) @@ -5760,13 +5773,22 @@ and GenMethodImpl cenv eenv (useMethodImpl, slotsig) m = let ilOverrideMethGenericArgs = mkILFormalGenericArgs 0 ilOverrideMethGenericParams let ilOverrideBy = - mkILInstanceMethSpecInTy ( - ilTyForOverriding, - nameOfOverridingMethod, - typesOfILParams ilParamsOfOverridingMethod, - ilReturnOfOverridingMethod.Type, - ilOverrideMethGenericArgs - ) + if isInstance then + mkILInstanceMethSpecInTy ( + ilTyForOverriding, + nameOfOverridingMethod, + typesOfILParams ilParamsOfOverridingMethod, + ilReturnOfOverridingMethod.Type, + ilOverrideMethGenericArgs + ) + else + mkILStaticMethSpecInTy ( + ilTyForOverriding, + nameOfOverridingMethod, + typesOfILParams ilParamsOfOverridingMethod, + ilReturnOfOverridingMethod.Type, + ilOverrideMethGenericArgs + ) { Overrides = ilOverridesSpec @@ -5789,7 +5811,9 @@ and fixupMethodImplFlags (mdef: ILMethodDef) = ) .WithNewSlot -and GenObjectMethod cenv eenvinner (cgbuf: CodeGenBuffer) useMethodImpl tmethod = +and fixupStaticAbstractSlotFlags (mdef: ILMethodDef) = mdef.WithHideBySig(true) + +and GenObjectExprMethod cenv eenvinner (cgbuf: CodeGenBuffer) useMethodImpl tmethod = let g = cenv.g let (TObjExprMethod (slotsig, attribs, methTyparsOfOverridingMethod, methParams, methBodyExpr, m)) = @@ -5829,11 +5853,12 @@ and GenObjectMethod cenv eenvinner (cgbuf: CodeGenBuffer) useMethodImpl tmethod CodeGenMethodForExpr cenv cgbuf.mgbuf ([], nameOfOverridenMethod, eenvForMeth, 0, selfArgOpt, methBodyExpr, sequel) let nameOfOverridingMethod, methodImplGenerator = - GenMethodImpl cenv eenvinner (useMethodImpl, slotsig) methBodyExpr.Range + GenMethodImpl cenv eenvinner (useMethodImpl, slotsig) methBodyExpr.Range true let mdef = mkILGenericVirtualMethod ( nameOfOverridingMethod, + ILCallingConv.Instance, ILMemberAccess.Public, GenGenericParams cenv eenvUnderTypars methTyparsOfOverridingMethod, ilParamsOfOverridingMethod, @@ -6015,7 +6040,13 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel (ilArgTys, argVals) ||> List.map2 (fun ty v -> mkILParamNamed (v.LogicalName, ty)) - mkILNonGenericVirtualMethod (imethName, ILMemberAccess.Public, ilParams, mkILReturn ilRetTy, MethodBody.IL(notlazy ilCode)) + mkILNonGenericVirtualInstanceMethod ( + imethName, + ILMemberAccess.Public, + ilParams, + mkILReturn ilRetTy, + MethodBody.IL(notlazy ilCode) + ) ] let mimpls = @@ -6036,7 +6067,9 @@ and GenStructStateMachine cenv cgbuf eenvouter (res: LoweredStateMachine) sequel | _ -> error (InternalError(sprintf "expected method %s not found" imethName, m)) let slotsig = implementedMeth.GetSlotSig(amap, m) - let ilOverridesSpec = GenOverridesSpec cenv eenvinner slotsig m + + let ilOverridesSpec = + GenOverridesSpec cenv eenvinner slotsig m mdef.CallingConv.IsInstance let ilOverrideBy = mkILInstanceMethSpecInTy (ilCloTy, imethName, mdef.ParameterTypes, mdef.Return.Type, []) @@ -6220,7 +6253,7 @@ and GenObjectExpr cenv cgbuf eenvouter objExpr (baseType, baseValOpt, basecall, let genMethodAndOptionalMethodImpl tmethod useMethodImpl = [ for (useMethodImpl, methodImplGeneratorFunction, methTyparsOfOverridingMethod), mdef in - GenObjectMethod cenv eenvinner cgbuf useMethodImpl tmethod do + GenObjectExprMethod cenv eenvinner cgbuf useMethodImpl tmethod do let mimpl = (if useMethodImpl then Some(methodImplGeneratorFunction (ilTyForOverriding, methTyparsOfOverridingMethod)) @@ -6371,7 +6404,7 @@ and GenSequenceExpr GenSequel cenv eenv.cloc cgbuf Return), m) - mkILNonGenericVirtualMethod ( + mkILNonGenericVirtualInstanceMethod ( "GetFreshEnumerator", ILMemberAccess.Public, [], @@ -6384,13 +6417,19 @@ and GenSequenceExpr let ilCode = CodeGenMethodForExpr cenv cgbuf.mgbuf ([], "Close", eenvinner, 1, None, closeExpr, discardAndReturnVoid) - mkILNonGenericVirtualMethod ("Close", ILMemberAccess.Public, [], mkILReturn ILType.Void, MethodBody.IL(lazy ilCode)) + mkILNonGenericVirtualInstanceMethod ("Close", ILMemberAccess.Public, [], mkILReturn ILType.Void, MethodBody.IL(lazy ilCode)) let checkCloseMethod = let ilCode = CodeGenMethodForExpr cenv cgbuf.mgbuf ([], "get_CheckClose", eenvinner, 1, None, checkCloseExpr, Return) - mkILNonGenericVirtualMethod ("get_CheckClose", ILMemberAccess.Public, [], mkILReturn g.ilg.typ_Bool, MethodBody.IL(lazy ilCode)) + mkILNonGenericVirtualInstanceMethod ( + "get_CheckClose", + ILMemberAccess.Public, + [], + mkILReturn g.ilg.typ_Bool, + MethodBody.IL(lazy ilCode) + ) let generateNextMethod = // the 'next enumerator' byref arg is at arg position 1 @@ -6403,13 +6442,19 @@ and GenSequenceExpr let ilCode = MethodBody.IL(lazy (CodeGenMethodForExpr cenv cgbuf.mgbuf ([], "GenerateNext", eenvinner, 2, None, generateNextExpr, Return))) - mkILNonGenericVirtualMethod ("GenerateNext", ILMemberAccess.Public, ilParams, ilReturn, ilCode) + mkILNonGenericVirtualInstanceMethod ("GenerateNext", ILMemberAccess.Public, ilParams, ilReturn, ilCode) let lastGeneratedMethod = let ilCode = CodeGenMethodForExpr cenv cgbuf.mgbuf ([], "get_LastGenerated", eenvinner, 1, None, exprForValRef m currvref, Return) - mkILNonGenericVirtualMethod ("get_LastGenerated", ILMemberAccess.Public, [], mkILReturn ilCloSeqElemTy, MethodBody.IL(lazy ilCode)) + mkILNonGenericVirtualInstanceMethod ( + "get_LastGenerated", + ILMemberAccess.Public, + [], + mkILReturn ilCloSeqElemTy, + MethodBody.IL(lazy ilCode) + ) |> AddNonUserCompilerGeneratedAttribs g let ilCtorBody = @@ -6605,6 +6650,7 @@ and GenClosureAsLocalTypeFunction cenv (cgbuf: CodeGenBuffer) eenv thisVars expr [ mkILGenericVirtualMethod ( "DirectInvoke", + ILCallingConv.Instance, ILMemberAccess.Assembly, ilDirectGenericParams, ilDirectWitnessParams, @@ -7092,26 +7138,76 @@ and GenDelegateExpr cenv cgbuf eenvouter expr (TObjExprMethod (slotsig, _attribs CG.EmitInstr cgbuf (pop 2) (Push [ ilCtxtDelTy ]) (I_newobj(ilDelegeeCtorMethOuter, None)) GenSequel cenv eenvouter.cloc cgbuf sequel -/// Generate statically-resolved conditionals used for type-directed optimizations. -and GenStaticOptimization cenv cgbuf eenv (constraints, e2, e3, _m) sequel = - // Note: during IlxGen, even if answer is StaticOptimizationAnswer.Unknown we discard the static optimization - // This means 'when ^T : ^T' is discarded if not resolved. - // - // This doesn't apply when witnesses are available. In that case, "when ^T : ^T" is resolved as 'Yes', - // this is because all the uses of "when ^T : ^T" in FSharp.Core (e.g. for are for deciding between the - // witness-based implementation and the legacy dynamic implementation, e.g. - // - // let inline ( * ) (x: ^T) (y: ^U) : ^V = - // MultiplyDynamic<(^T),(^U),(^V)> x y - // ... - // when ^T : ^T = ((^T or ^U): (static member (*) : ^T * ^U -> ^V) (x,y)) - // - // When witnesses are not available we use the dynamic implementation. +/// Used to search FSharp.Core implementations of "^T : ^T" and decide whether the conditional activates +and ExprIsTraitCall expr = + match expr with + | Expr.Op (TOp.TraitCall _, _, _, _) -> true + | _ -> false + +/// Used to search FSharp.Core implementations of "^T : ^T" and decide whether the conditional activates +and ExprIndicatesGenericStaticConstrainedCall g expr = + match expr with + | Expr.Val (vref, PossibleConstrainedCall ty, _) -> + vref.IsMember + && not vref.MemberInfo.Value.MemberFlags.IsInstance + && isTyparTy g ty + | Expr.Op (TOp.ILCall (valUseFlag = PossibleConstrainedCall ty; ilMethRef = ilMethRef), _, _, _) -> + not ilMethRef.CallingConv.IsInstance && isTyparTy g ty + | _ -> false + +/// Used to search FSharp.Core implementations of "^T : ^T" and decide whether the conditional activates +and ExprRequiresWitness cenv m expr = + let g = cenv.g + + match expr with + | Expr.Op (TOp.TraitCall (traitInfo), _, _, _) -> + ConstraintSolver.CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs cenv.tcVal g cenv.amap m traitInfo + |> CommitOperationResult + | _ -> false + +/// Generate statically-resolved conditionals used for type-directed optimizations in FSharp.Core only. +and GenStaticOptimization cenv cgbuf eenv (staticConditions, e2, e3, m) sequel = + let g = cenv.g let e = + // See 'decideStaticOptimizationConstraint' + // + // For ^T : ^T we can additionally decide the conditional positively if either + // 1. we're in code generating witnesses + // 2. e2 uses a trait call of some kind + // 2. e2 doesn't require a witness let generateWitnesses = ComputeGenerateWitnesses cenv.g eenv - if DecideStaticOptimizations cenv.g constraints generateWitnesses = StaticOptimizationAnswer.Yes then + let canDecideTyparEqn = + let usesTraitOrConstrainedCall = + (false, e2) + ||> FoldExpr + { ExprFolder0 with + exprIntercept = + (fun _exprF noInterceptF z expr -> + z + || ExprIsTraitCall expr + || ExprIndicatesGenericStaticConstrainedCall g expr + || noInterceptF false expr) + } + + if usesTraitOrConstrainedCall then + if generateWitnesses then + true + else + let requiresWitness = + (false, e2) + ||> FoldExpr + { ExprFolder0 with + exprIntercept = + (fun _exprF noInterceptF z expr -> z || ExprRequiresWitness cenv m expr || noInterceptF false expr) + } + + not requiresWitness + else + false + + if DecideStaticOptimizations cenv.g staticConditions canDecideTyparEqn = StaticOptimizationAnswer.Yes then e2 else e3 @@ -9093,7 +9189,6 @@ and GenMethodForBinding let mdef = match v.MemberInfo with | Some memberInfo when not v.IsExtensionMember -> - let ilMethTypars = ilTypars |> List.skip mspec.DeclaringType.GenericArgs.Length if memberInfo.MemberFlags.MemberKind = SynMemberKind.Constructor then @@ -9118,8 +9213,16 @@ and GenMethodForBinding else let mdef = if not compileAsInstance then - mkILStaticMethod (ilMethTypars, mspec.Name, access, ilParams, ilReturn, ilMethodBody) + if not memberInfo.MemberFlags.IsOverrideOrExplicitImpl then + mkILStaticMethod (ilMethTypars, mspec.Name, access, ilParams, ilReturn, ilMethodBody) + else // We want to get potential fixups and hidebysig for abstract statics: + let flagFixups = [ fixupStaticAbstractSlotFlags ] + + let mdef = + mkILStaticMethod (ilMethTypars, mspec.Name, access, ilParams, ilReturn, ilMethodBody) + let mdef = List.fold (fun mdef f -> f mdef) mdef flagFixups + mdef elif (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) || memberInfo.MemberFlags.IsOverrideOrExplicitImpl @@ -9127,8 +9230,22 @@ and GenMethodForBinding let flagFixups = ComputeFlagFixupsForMemberBinding cenv v + let cconv = + if memberInfo.MemberFlags.IsInstance then + ILCallingConv.Instance + else + ILCallingConv.Static + let mdef = - mkILGenericVirtualMethod (mspec.Name, ILMemberAccess.Public, ilMethTypars, ilParams, ilReturn, ilMethodBody) + mkILGenericVirtualMethod ( + mspec.Name, + cconv, + ILMemberAccess.Public, + ilMethTypars, + ilParams, + ilReturn, + ilMethodBody + ) let mdef = List.fold (fun mdef f -> f mdef) mdef flagFixups @@ -10178,7 +10295,7 @@ and GenEqualsOverrideCallingIComparable cenv (tcref: TyconRef, ilThisTy, _ilThat mkLdarg0 mkLdarg 1us if tcref.IsStructOrEnumTycon then - I_callconstraint(Normalcall, ilThisTy, mspec, None) + I_callconstraint(true, Normalcall, ilThisTy, mspec, None) else I_callvirt(Normalcall, mspec, None) mkLdcInt32 0 @@ -10188,7 +10305,7 @@ and GenEqualsOverrideCallingIComparable cenv (tcref: TyconRef, ilThisTy, _ilThat let ilMethodBody = mkMethodBody (true, [], 2, nonBranchingInstrsToCode ilInstrs, None, None) - mkILNonGenericVirtualMethod ( + mkILNonGenericVirtualInstanceMethod ( "Equals", ILMemberAccess.Public, [ mkILParamNamed ("obj", g.ilg.typ_Object) ], @@ -10271,6 +10388,7 @@ and GenAbstractBinding cenv eenv tref (vref: ValRef) = let mdef = mkILGenericVirtualMethod ( vref.CompiledName g.CompilerGlobalState, + mspec.CallingConv, ILMemberAccess.Public, ilMethTypars, ilParams, @@ -10280,16 +10398,9 @@ and GenAbstractBinding cenv eenv tref (vref: ValRef) = let mdef = fixupVirtualSlotFlags mdef - let mdef = - if mdef.IsVirtual then - mdef - .WithFinal(memberInfo.MemberFlags.IsFinal) - .WithAbstract(memberInfo.MemberFlags.IsDispatchSlot) - else - mdef - let mdef = mdef + .WithFinal(memberInfo.MemberFlags.IsFinal) .WithPreserveSig(hasPreserveSigImplFlag) .WithSynchronized(hasSynchronizedImplFlag) .WithNoInlining(hasNoInliningFlag) @@ -10391,7 +10502,7 @@ and GenPrintingMethod cenv eenv methName ilThisTy m = mkMethodBody (true, [], 2, nonBranchingInstrsToCode ilInstrs, None, eenv.imports) let mdef = - mkILNonGenericVirtualMethod (methName, ILMemberAccess.Public, [], mkILReturn g.ilg.typ_String, ilMethodBody) + mkILNonGenericVirtualInstanceMethod (methName, ILMemberAccess.Public, [], mkILReturn g.ilg.typ_String, ilMethodBody) let mdef = mdef.With(customAttrs = mkILCustomAttrs [ g.CompilerGeneratedAttribute ]) yield mdef @@ -10490,7 +10601,6 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = match vref.ValReprInfo with | Some _ -> - let memberParentTypars, memberMethodTypars = match PartitionValRefTypars g vref with | Some (_, memberParentTypars, memberMethodTypars, _, _) -> @@ -10501,11 +10611,10 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let eenvUnderTypars = EnvForTypars memberParentTypars eenv let _, methodImplGenerator = - GenMethodImpl cenv eenvUnderTypars (useMethodImpl, slotsig) m + GenMethodImpl cenv eenvUnderTypars (useMethodImpl, slotsig) m memberInfo.MemberFlags.IsInstance if useMethodImpl then yield methodImplGenerator (ilThisTy, memberMethodTypars) - | _ -> () ] diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index acf3da6e515..a6e0450af3a 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -788,12 +788,13 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | UnresolvedOverloading (denv, callerArgs, failure, m) -> + let g = denv.g // extract eventual information (return type and type parameters) // from ConstraintTraitInfo let knownReturnType, genericParameterTypes = match failure with | NoOverloadsFound(cx = Some cx) - | PossibleCandidates(cx = Some cx) -> cx.ReturnType, cx.ArgumentTypes + | PossibleCandidates(cx = Some cx) -> Some(cx.GetReturnType(g)), cx.GetCompiledArgumentTypes() | _ -> None, [] // prepare message parts (known arguments, known return type, known generic parameters) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 7dfd7f10221..19f7d040b46 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -463,11 +463,13 @@ parsMultiArgumentGenericTypeFormDeprecated,"The syntax '(typ,...,typ) ident' is 618,parsInvalidLiteralInType,"Invalid literal in type" 619,parsUnexpectedOperatorForUnitOfMeasure,"Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'." 620,parsUnexpectedIntegerLiteralForUnitOfMeasure,"Unexpected integer literal in unit-of-measure expression" -621,parsUnexpectedTypeParameter,"Syntax error: unexpected type parameter specification" +#621,parsUnexpectedTypeParameter,"Syntax error: unexpected type parameter specification" 622,parsMismatchedQuotationName,"Mismatched quotation operator name, beginning with '%s'" 623,parsActivePatternCaseMustBeginWithUpperCase,"Active pattern case identifiers must begin with an uppercase letter" 624,parsActivePatternCaseContainsPipe,"The '|' character is not permitted in active pattern case identifiers" 625,parsIllegalDenominatorForMeasureExponent,"Denominator must not be 0 in unit-of-measure exponent" +626,parsIncompleteTyparExpr1,"Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name)" +626,parsIncompleteTyparExpr2,"Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name)" parsNoEqualShouldFollowNamespace,"No '=' symbol should follow a 'namespace' declaration" parsSyntaxModuleStructEndDeprecated,"The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'" parsSyntaxModuleSigEndDeprecated,"The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end'" @@ -1540,6 +1542,8 @@ featureStructActivePattern,"struct representation for active patterns" featureRelaxWhitespace2,"whitespace relaxation v2" featureReallyLongList,"list literals of any size" featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute" +featureInterfacesWithAbstractStaticMembers,"static abstract interface members" +featureSelfTypeConstraints,"self type constraints" featureRequiredProperties,"support for required properties" featureInitProperties,"support for consuming init properties" featureLowercaseDUWhenRequireQualifiedAccess,"Allow lowercase DU when RequireQualifiedAccess attribute" @@ -1632,4 +1636,12 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form" 3522,tcAnonRecdDuplicateFieldId,"The field '%s' appears multiple times in this record expression." 3523,tcAnonRecdTypeDuplicateFieldId,"The field '%s' appears multiple times in this anonymous record type." 3524,parsExpectingExpressionInTuple,"Expecting expression" -3545,tcMissingRequiredMembers,"The following required properties have to be initalized:%s" \ No newline at end of file +3530,tcTraitIsStatic,"Trait '%s' is static" +3531,tcTraitIsNotStatic,"Trait '%s' is not static" +3532,tcTraitMayNotUseComplexThings,"A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments" +3533,tcInvalidSelfConstraint,"Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints." +3534,tcTraitInvocationShouldUseTick,"Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters." +3535,tcUsingInterfacesWithStaticAbstractMethods,"Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'." +3536,tcUsingInterfaceWithStaticAbstractMethodAsType,"'%s' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'." +3537,tcTraitHasMultipleSupportTypes,"The trait '%s' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance." +3545,tcMissingRequiredMembers,"The following required properties have to be initalized:%s" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 03401823c1a..683dddd2e4f 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -52,6 +52,8 @@ type LanguageFeature = | RequiredPropertiesSupport | InitPropertiesSupport | LowercaseDUWhenRequireQualifiedAccess + | InterfacesWithAbstractStaticMembers + | SelfTypeConstraints /// LanguageVersion management type LanguageVersion(versionText) = @@ -117,6 +119,8 @@ type LanguageVersion(versionText) = LanguageFeature.RequiredPropertiesSupport, previewVersion LanguageFeature.InitPropertiesSupport, previewVersion LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion + LanguageFeature.InterfacesWithAbstractStaticMembers, previewVersion + LanguageFeature.SelfTypeConstraints, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -219,6 +223,8 @@ type LanguageVersion(versionText) = | LanguageFeature.RequiredPropertiesSupport -> FSComp.SR.featureRequiredProperties () | LanguageFeature.InitPropertiesSupport -> FSComp.SR.featureInitProperties () | LanguageFeature.LowercaseDUWhenRequireQualifiedAccess -> FSComp.SR.featureLowercaseDUWhenRequireQualifiedAccess () + | LanguageFeature.InterfacesWithAbstractStaticMembers -> FSComp.SR.featureInterfacesWithAbstractStaticMembers () + | LanguageFeature.SelfTypeConstraints -> FSComp.SR.featureSelfTypeConstraints () /// Get a version string associated with the given feature. member _.GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 1e2c977a4ad..71673cb05e3 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -42,6 +42,8 @@ type LanguageFeature = | RequiredPropertiesSupport | InitPropertiesSupport | LowercaseDUWhenRequireQualifiedAccess + | InterfacesWithAbstractStaticMembers + | SelfTypeConstraints /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Facilities/prim-lexing.fs b/src/Compiler/Facilities/prim-lexing.fs index 58b57ddace0..dee03bb5f7e 100644 --- a/src/Compiler/Facilities/prim-lexing.fs +++ b/src/Compiler/Facilities/prim-lexing.fs @@ -260,7 +260,7 @@ and [] internal LexBuffer<'Char>(filler: LexBufferFiller<'Char>, reportL member _.SupportsFeature featureId = langVersion.SupportsFeature featureId - member _.CheckLanguageFeatureErrorRecover featureId range = + member _.CheckLanguageFeatureAndRecover featureId range = FSharp.Compiler.DiagnosticsLogger.checkLanguageFeatureAndRecover langVersion featureId range static member FromFunction(reportLibraryOnlyFeatures, langVersion, f: 'Char[] * int * int -> int) : LexBuffer<'Char> = diff --git a/src/Compiler/Facilities/prim-lexing.fsi b/src/Compiler/Facilities/prim-lexing.fsi index 290b48b53e8..e662c1edf37 100644 --- a/src/Compiler/Facilities/prim-lexing.fsi +++ b/src/Compiler/Facilities/prim-lexing.fsi @@ -134,7 +134,7 @@ type internal LexBuffer<'Char> = member SupportsFeature: LanguageFeature -> bool /// Logs a recoverable error if a language feature is unsupported, at the specified range. - member CheckLanguageFeatureErrorRecover: LanguageFeature -> range -> unit + member CheckLanguageFeatureAndRecover: LanguageFeature -> range -> unit /// Create a lex buffer suitable for Unicode lexing that reads characters from the given array. /// Important: does take ownership of the array. diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index e3091ec71fe..e3c120d0697 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -28,13 +28,13 @@ let BuildDisposableCleanup tcVal (g: TcGlobals) infoReader m (v: Val) = assert (TypeFeasiblySubsumesType 0 g infoReader.amap m g.system_IDisposable_ty CanCoerce v.Type) // We can use NeverMutates here because the variable is going out of scope, there is no need to take a defensive // copy of it. - let disposeExpr, _ = BuildMethodCall tcVal g infoReader.amap NeverMutates m false disposeMethod NormalValUse [] [exprForVal v.Range v] [] + let disposeExpr, _ = BuildMethodCall tcVal g infoReader.amap NeverMutates m false disposeMethod NormalValUse [] [exprForVal v.Range v] [] None //callNonOverloadedILMethod g infoReader.amap m "Dispose" g.system_IDisposable_ty [exprForVal v.Range v] disposeExpr else let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposable_ty - let disposeExpr, _ = BuildMethodCall tcVal g infoReader.amap PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] + let disposeExpr, _ = BuildMethodCall tcVal g infoReader.amap PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] None let inputExpr = mkCoerceExpr(exprForVal v.Range v, g.obj_ty, m, v.Type) mkIsInstConditional g m g.system_IDisposable_ty inputExpr disposeObjVar disposeExpr (mkUnit g m) @@ -44,7 +44,7 @@ let mkCallCollectorMethod tcVal (g: TcGlobals) infoReader m name collExpr args = match GetIntrinsicMethInfosOfType infoReader (Some name) AccessibleFromSomewhere AllowMultiIntfInstantiations.Yes IgnoreOverrides m listCollectorTy with | [x] -> x | _ -> error(InternalError("no " + name + " method found on Collector", m)) - let expr, _ = BuildMethodCall tcVal g infoReader.amap DefinitelyMutates m false addMethod NormalValUse [] [collExpr] args + let expr, _ = BuildMethodCall tcVal g infoReader.amap DefinitelyMutates m false addMethod NormalValUse [] [collExpr] args None expr let mkCallCollectorAdd tcVal (g: TcGlobals) infoReader m collExpr arg = diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 368993e7cc2..62e8078e8cb 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -2385,15 +2385,19 @@ let rec OptimizeExpr cenv (env: IncrementalOptimizationEnv) expr = | Expr.LetRec (binds, bodyExpr, m, _) -> OptimizeLetRec cenv env (binds, bodyExpr, m) - | Expr.StaticOptimization (constraints, expr2, expr3, m) -> - let expr2R, e2info = OptimizeExpr cenv env expr2 - let expr3R, e3info = OptimizeExpr cenv env expr3 - Expr.StaticOptimization (constraints, expr2R, expr3R, m), - { TotalSize = min e2info.TotalSize e3info.TotalSize - FunctionSize = min e2info.FunctionSize e3info.FunctionSize - HasEffect = e2info.HasEffect || e3info.HasEffect - MightMakeCriticalTailcall=e2info.MightMakeCriticalTailcall || e3info.MightMakeCriticalTailcall // seems conservative - Info= UnknownValue } + | Expr.StaticOptimization (staticConditions, expr2, expr3, m) -> + let d = DecideStaticOptimizations g staticConditions false + if d = StaticOptimizationAnswer.Yes then OptimizeExpr cenv env expr2 + elif d = StaticOptimizationAnswer.No then OptimizeExpr cenv env expr3 + else + let expr2R, e2info = OptimizeExpr cenv env expr2 + let expr3R, e3info = OptimizeExpr cenv env expr3 + Expr.StaticOptimization (staticConditions, expr2R, expr3R, m), + { TotalSize = min e2info.TotalSize e3info.TotalSize + FunctionSize = min e2info.FunctionSize e3info.FunctionSize + HasEffect = e2info.HasEffect || e3info.HasEffect + MightMakeCriticalTailcall=e2info.MightMakeCriticalTailcall || e3info.MightMakeCriticalTailcall // seems conservative + Info= UnknownValue } | Expr.Link _eref -> assert ("unexpected reclink" = "") diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index bfdb97fa0cc..fafdbf0e58c 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -46,6 +46,7 @@ open FSharp.Compiler.Text.Layout open FSharp.Compiler.Text.Position open FSharp.Compiler.Text.Range open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.AbstractIL open System.Reflection.PortableExecutable @@ -463,6 +464,8 @@ type internal TypeCheckInfo match cnrs, membersByResidue with + // Exact resolution via SomeType.$ or SomeType.$ + // // If we're looking for members using a residue, we'd expect only // a single item (pick the first one) and we need the residue (which may be "") | CNR (Item.Types (_, ty :: _), _, denv, nenv, ad, m) :: _, Some _ -> @@ -473,6 +476,15 @@ type internal TypeCheckInfo let items = List.map ItemWithNoInst items ReturnItemsOfType items g denv m filterCtors + // Exact resolution via 'T.$ + | CNR (Item.TypeVar (_, tp), _, denv, nenv, ad, m) :: _, Some _ -> + let targets = + ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m) + + let items = ResolveCompletionsInType ncenv nenv targets m ad true (mkTyparTy tp) + let items = List.map ItemWithNoInst items + ReturnItemsOfType items g denv m filterCtors + // Value reference from the name resolution. Primarily to disallow "let x.$ = 1" // In most of the cases, value references can be obtained from expression typings or from environment, // so we wouldn't have to handle values here. However, if we have something like: @@ -721,27 +733,21 @@ type internal TypeCheckInfo let items = items |> RemoveExplicitlySuppressed g items, nenv.DisplayEnv, m - /// Resolve a location and/or text to items. - // Three techniques are used - // - look for an exact known name resolution from type checking - // - use the known type of an expression, e.g. (expr).Name, to generate an item list - // - lookup an entire name in the name resolution environment, e.g. A.B.Name, to generate an item list - // - // The overall aim is to resolve as accurately as possible based on what we know from type inference - - let GetBaseClassCandidates = - function + /// Is the item suitable for completion at "inherits $" + let IsInheritsCompletionCandidate item = + match item with | Item.ModuleOrNamespaces _ -> true - | Item.Types (_, ty :: _) when (isClassTy g ty) && not (isSealedTy g ty) -> true + | Item.Types (_, ty :: _) when isClassTy g ty && not (isSealedTy g ty) -> true | _ -> false - let GetInterfaceCandidates = - function + /// Is the item suitable for completion at "interface $" + let IsInterfaceCompletionCandidate item = + match item with | Item.ModuleOrNamespaces _ -> true - | Item.Types (_, ty :: _) when (isInterfaceTy g ty) -> true + | Item.Types (_, ty :: _) when isInterfaceTy g ty -> true | _ -> false - // Return only items with the specified name + /// Return only items with the specified name, modulo "Attribute" for type completions let FilterDeclItemsByResidue (getItem: 'a -> Item) residue (items: 'a list) = let attributedResidue = residue + "Attribute" @@ -770,7 +776,7 @@ type internal TypeCheckInfo /// Post-filter items to make sure they have precisely the right name /// This also checks that there are some remaining results /// exactMatchResidueOpt = Some _ -- means that we are looking for exact matches - let FilterRelevantItemsBy (getItem: 'a -> Item) (exactMatchResidueOpt: _ option) check (items: 'a list, denv, m) = + let FilterRelevantItemsBy (getItem: 'a -> Item) (exactMatchResidueOpt: string option) check (items: 'a list, denv, m) = // can throw if type is in located in non-resolved CCU: i.e. bigint if reference to System.Numerics is absent let inline safeCheck item = try @@ -813,17 +819,43 @@ type internal TypeCheckInfo if p >= 0 then Some p else None + /// Build a CompetionItem let CompletionItem (ty: ValueOption) (assemblySymbol: ValueOption) (item: ItemWithInst) = let kind = match item.Item with - | Item.MethodGroup (_, minfo :: _, _) -> CompletionItemKind.Method minfo.IsExtensionMember + | Item.FakeInterfaceCtor _ + | Item.DelegateCtor _ + | Item.CtorGroup _ -> CompletionItemKind.Method false + | Item.MethodGroup (_, minfos, _) -> + match minfos with + | [] -> CompletionItemKind.Method false + | minfo :: _ -> CompletionItemKind.Method minfo.IsExtensionMember | Item.RecdField _ | Item.Property _ -> CompletionItemKind.Property | Item.Event _ -> CompletionItemKind.Event | Item.ILField _ | Item.Value _ -> CompletionItemKind.Field | Item.CustomOperation _ -> CompletionItemKind.CustomOperation - | _ -> CompletionItemKind.Other + // These items are not given a completion kind. This could be reviewed + | Item.AnonRecdField _ + | Item.ActivePatternResult _ + | Item.CustomOperation _ + | Item.CtorGroup _ + | Item.ExnCase _ + | Item.ImplicitOp _ + | Item.ModuleOrNamespaces _ + | Item.Trait _ + | Item.TypeVar _ + | Item.Types _ + | Item.UnionCase _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.Value _ + | Item.NewDef _ + | Item.SetterArg _ + | Item.CustomBuilder _ + | Item.ArgName _ + | Item.ActivePatternCase _ -> CompletionItemKind.Other let isUnresolved = match assemblySymbol with @@ -1115,19 +1147,23 @@ type internal TypeCheckInfo // Completion at 'inherit C(...)" | Some (CompletionContext.Inherit (InheritanceContext.Class, (plid, _))) -> GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> GetBaseClassCandidates) + |> FilterRelevantItemsBy getItem None (getItem >> IsInheritsCompletionCandidate) |> Option.map toCompletionItems // Completion at 'interface ..." | Some (CompletionContext.Inherit (InheritanceContext.Interface, (plid, _))) -> GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> GetInterfaceCandidates) + |> FilterRelevantItemsBy getItem None (getItem >> IsInterfaceCompletionCandidate) |> Option.map toCompletionItems // Completion at 'implement ..." | Some (CompletionContext.Inherit (InheritanceContext.Unknown, (plid, _))) -> GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> (fun t -> GetBaseClassCandidates t || GetInterfaceCandidates t)) + |> FilterRelevantItemsBy + getItem + None + (getItem + >> (fun t -> IsInheritsCompletionCandidate t || IsInterfaceCompletionCandidate t)) |> Option.map toCompletionItems // Completion at ' { XXX = ... } " @@ -1377,6 +1413,7 @@ type internal TypeCheckInfo /// Return 'false' if this is not a completion item valid in an interface file. let IsValidSignatureFileItem item = match item with + | Item.TypeVar _ | Item.Types _ | Item.ModuleOrNamespaces _ -> true | _ -> false @@ -1406,7 +1443,7 @@ type internal TypeCheckInfo /// Get the auto-complete items at a location member _.GetDeclarations(parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities) = - let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName + let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect range0 @@ -1431,7 +1468,7 @@ type internal TypeCheckInfo | None -> DeclarationListInfo.Empty | Some (items, denv, ctx, m) -> let items = - if isInterfaceFile then + if isSigFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items @@ -1463,7 +1500,7 @@ type internal TypeCheckInfo /// Get the symbols for auto-complete items at a location member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities) = - let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName + let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect range0 @@ -1488,7 +1525,7 @@ type internal TypeCheckInfo | None -> List.Empty | Some (items, denv, _, m) -> let items = - if isInterfaceFile then + if isSigFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items @@ -1504,10 +1541,10 @@ type internal TypeCheckInfo |> List.sortBy (fun d -> let n = match d.Item with - | Item.Types (_, TType_app (tcref, _, _) :: _) -> 1 + tcref.TyparsNoRange.Length + | Item.Types (_, AbbrevOrAppTy tcref :: _) -> 1 + tcref.TyparsNoRange.Length // Put delegate ctors after types, sorted by #typars. RemoveDuplicateItems will remove FakeInterfaceCtor and DelegateCtor if an earlier type is also reported with this name - | Item.FakeInterfaceCtor (TType_app (tcref, _, _)) - | Item.DelegateCtor (TType_app (tcref, _, _)) -> 1000 + tcref.TyparsNoRange.Length + | Item.FakeInterfaceCtor (AbbrevOrAppTy tcref) + | Item.DelegateCtor (AbbrevOrAppTy tcref) -> 1000 + tcref.TyparsNoRange.Length // Put type ctors after types, sorted by #typars. RemoveDuplicateItems will remove DefaultStructCtors if a type is also reported with this name | Item.CtorGroup (_, cinfo :: _) -> 1000 + 10 * cinfo.DeclaringTyconRef.TyparsNoRange.Length | _ -> 0 @@ -1523,11 +1560,11 @@ type internal TypeCheckInfo items |> List.groupBy (fun d -> match d.Item with - | Item.Types (_, TType_app (tcref, _, _) :: _) + | Item.Types (_, AbbrevOrAppTy tcref :: _) | Item.ExnCase tcref -> tcref.LogicalName | Item.UnqualifiedType (tcref :: _) - | Item.FakeInterfaceCtor (TType_app (tcref, _, _)) - | Item.DelegateCtor (TType_app (tcref, _, _)) -> tcref.CompiledName + | Item.FakeInterfaceCtor (AbbrevOrAppTy tcref) + | Item.DelegateCtor (AbbrevOrAppTy tcref) -> tcref.CompiledName | Item.CtorGroup (_, cinfo :: _) -> cinfo.ApparentEnclosingTyconRef.CompiledName | _ -> d.Item.DisplayName) @@ -1713,22 +1750,21 @@ type internal TypeCheckInfo | [] -> None | [ item ] -> GetF1Keyword g item.Item | _ -> - // handle new Type() + // For "new Type()" it seems from the code below that multiple items are returned. + // It combine the information from these items preferring a constructor if present. let allTypes, constr, ty = - List.fold - (fun (allTypes, constr, ty) (item: CompletionItem) -> - match item.Item, constr, ty with - | Item.Types _ as t, _, None -> allTypes, constr, Some t - | Item.Types _, _, _ -> allTypes, constr, ty - | Item.CtorGroup _, None, _ -> allTypes, Some item.Item, ty - | _ -> false, None, None) - (true, None, None) - items + ((true, None, None), items) + ||> List.fold (fun (allTypes, constr, ty) (item: CompletionItem) -> + match item.Item, constr, ty with + | Item.Types _ as t, _, None -> allTypes, constr, Some t + | Item.Types _, _, _ -> allTypes, constr, ty + | Item.CtorGroup _, None, _ -> allTypes, Some item.Item, ty + | _ -> false, None, None) match allTypes, constr, ty with - | true, Some (Item.CtorGroup _ as item), _ -> GetF1Keyword g item - | true, _, Some ty -> GetF1Keyword g ty - | _ -> None) + | true, Some item, _ -> GetF1Keyword g item + | true, _, Some item -> GetF1Keyword g item + | _ -> GetF1Keyword g items.Head.Item) (fun msg -> Trace.TraceInformation(sprintf "FCS: recovering from error in GetF1Keyword: '%s'" msg) None) @@ -1799,7 +1835,8 @@ type internal TypeCheckInfo | Some ([], _, _, _) -> None | Some (items, denv, _, m) -> let allItems = - items |> List.collect (fun item -> FlattenItems g m item.ItemWithInst) + items + |> List.collect (fun item -> SelectMethodGroupItems2 g m item.ItemWithInst) let symbols = allItems |> List.map (fun item -> FSharpSymbol.Create(cenv, item.Item), item) @@ -1841,6 +1878,8 @@ type internal TypeCheckInfo let methodTypeParams = ilinfo.FormalMethodTypars |> List.map (fun ty -> ty.Name) classTypeParams @ methodTypeParams |> Array.ofList + // Detect external references. Currently this only labels references to .NET assemblies as external - F# + // references from nuget packages are not labelled as external. let result = match item.Item with | Item.CtorGroup (_, ILMeth (_, ilinfo, _) :: _) -> @@ -1909,21 +1948,19 @@ type internal TypeCheckInfo Some(FindDeclResult.ExternalDecl(assemblyRef.Name, externalSym)) | _ -> None - | Item.ImplicitOp (_, - { - contents = Some (TraitConstraintSln.FSMethSln (_, _vref, _)) - }) -> - //Item.Value(vref) - None - - | Item.Types (_, TType_app (tr, _, _) :: _) when tr.IsLocalRef && tr.IsTypeAbbrev -> None - - | Item.Types (_, [ AppTy g (tr, _) ]) when not tr.IsLocalRef -> - match tr.TypeReprInfo, tr.PublicPath with - | TILObjectRepr (TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) -> - let fullName = parts |> String.concat "." - Some(FindDeclResult.ExternalDecl(assemblyRef.Name, FindDeclExternalSymbol.Type fullName)) + | Item.Types (_, ty :: _) -> + match stripTyparEqns ty with + | TType_app (tr, _, _) -> + if tr.IsLocalRef then + None + else + match tr.TypeReprInfo, tr.PublicPath with + | TILObjectRepr (TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) -> + let fullName = parts |> String.concat "." + Some(FindDeclResult.ExternalDecl(assemblyRef.Name, FindDeclExternalSymbol.Type fullName)) + | _ -> None | _ -> None + | _ -> None match result with diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index c2ee71a022e..fe5afbfc4ab 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -16,7 +16,7 @@ open FSharp.Compiler.Text open FSharp.Compiler.Text.Range module SourceFileImpl = - let IsInterfaceFile file = + let IsSignatureFile file = let ext = Path.GetExtension file 0 = String.Compare(".fsi", ext, StringComparison.OrdinalIgnoreCase) @@ -608,6 +608,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, | SynExpr.LibraryOnlyILAssembly _ | SynExpr.LibraryOnlyStaticOptimization _ | SynExpr.Null _ + | SynExpr.Typar _ | SynExpr.Ident _ | SynExpr.ImplicitZero _ | SynExpr.Const _ diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 73caa8c5736..ef769874226 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -80,6 +80,9 @@ module ItemKeyTags = [] let itemProperty = "p$" + [] + let itemTrait = "T$" + [] let itemTypeVar = "y$" @@ -371,6 +374,13 @@ and [] ItemKeyStoreBuilder() = | Some info -> writeEntityRef info.DeclaringTyconRef | _ -> () + | Item.Trait (info) -> + writeString ItemKeyTags.itemTrait + writeString info.MemberLogicalName + info.SupportTypes |> List.iter (writeType false) + info.CompiledObjectAndArgumentTypes |> List.iter (writeType false) + info.CompiledReturnType |> Option.iter (writeType false) + | Item.TypeVar (_, typar) -> writeTypar true typar | Item.Types (_, [ ty ]) -> writeType true ty @@ -405,17 +415,27 @@ and [] ItemKeyStoreBuilder() = writeString ItemKeyTags.itemDelegateCtor writeType false ty - | Item.MethodGroup _ -> () - | Item.CtorGroup _ -> () + // We should consider writing ItemKey for each of these + | Item.ArgName _ -> () | Item.FakeInterfaceCtor _ -> () - | Item.Types _ -> () | Item.CustomOperation _ -> () | Item.CustomBuilder _ -> () - | Item.ModuleOrNamespaces _ -> () | Item.ImplicitOp _ -> () - | Item.ArgName _ -> () | Item.SetterArg _ -> () - | Item.UnqualifiedType _ -> () + + // Empty lists do not occur + | Item.Types (_, []) -> () + | Item.UnqualifiedType [] -> () + | Item.MethodGroup (_, [], _) -> () + | Item.CtorGroup (_, []) -> () + | Item.ModuleOrNamespaces [] -> () + + // Items are flattened so multiples are not expected + | Item.Types (_, _ :: _ :: _) -> () + | Item.UnqualifiedType (_ :: _ :: _) -> () + | Item.MethodGroup (_, (_ :: _ :: _), _) -> () + | Item.CtorGroup (_, (_ :: _ :: _)) -> () + | Item.ModuleOrNamespaces (_ :: _ :: _) -> () let postCount = b.Count diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index fc4f9d21b75..5da02e32094 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -70,6 +70,69 @@ module TcResolutionsExtensions = let (|CNR|) (cnr: CapturedNameResolution) = (cnr.Item, cnr.ItemOccurence, cnr.DisplayEnv, cnr.NameResolutionEnv, cnr.AccessorDomain, cnr.Range) + let isDisposableTy g amap (ty: TType) = + not (typeEquiv g ty g.system_IDisposable_ty) + && protectAssemblyExplorationNoReraise false false (fun () -> + ExistsHeadTypeInEntireHierarchy g amap range0 ty g.tcref_System_IDisposable) + + let isDiscard (str: string) = str.StartsWith("_") + + let isValRefDisposable g amap (vref: ValRef) = + not (isDiscard vref.DisplayName) + && + // For values, we actually do want to color things if they literally are IDisposables + protectAssemblyExplorationNoReraise false false (fun () -> + ExistsHeadTypeInEntireHierarchy g amap range0 vref.Type g.tcref_System_IDisposable) + + let isStructTyconRef g (tcref: TyconRef) = + let ty = generalizedTyconRef g tcref + let underlyingTy = stripTyEqnsAndMeasureEqns g ty + isStructTy g underlyingTy + + let isValRefMutable g (vref: ValRef) = + // Mutable values, ref cells, and non-inref byrefs are mutable. + vref.IsMutable + || isRefCellTy g vref.Type + || (isByrefTy g vref.Type && not (isInByrefTy g vref.Type)) + + let isRecdFieldMutable g (rfinfo: RecdFieldInfo) = + (rfinfo.RecdField.IsMutable && rfinfo.LiteralValue.IsNone) + || isRefCellTy g rfinfo.RecdField.FormalType + + let reprToClassificationType g repr tcref = + match repr with + | TFSharpObjectRepr om -> + match om.fsobjmodel_kind with + | TFSharpClass -> SemanticClassificationType.ReferenceType + | TFSharpInterface -> SemanticClassificationType.Interface + | TFSharpStruct -> SemanticClassificationType.ValueType + | TFSharpDelegate _ -> SemanticClassificationType.Delegate + | TFSharpEnum _ -> SemanticClassificationType.Enumeration + | TFSharpRecdRepr _ + | TFSharpUnionRepr _ -> + if isStructTyconRef g tcref then + SemanticClassificationType.ValueType + else + SemanticClassificationType.Type + | TILObjectRepr (TILObjectReprData (_, _, td)) -> + if td.IsClass then + SemanticClassificationType.ReferenceType + elif td.IsStruct then + SemanticClassificationType.ValueType + elif td.IsInterface then + SemanticClassificationType.Interface + elif td.IsEnum then + SemanticClassificationType.Enumeration + else + SemanticClassificationType.Delegate + | TAsmRepr _ -> SemanticClassificationType.TypeDef + | TMeasureableRepr _ -> SemanticClassificationType.TypeDef +#if !NO_TYPEPROVIDERS + | TProvidedTypeRepr _ -> SemanticClassificationType.TypeDef + | TProvidedNamespaceRepr _ -> SemanticClassificationType.TypeDef +#endif + | TNoRepr -> SemanticClassificationType.ReferenceType + type TcResolutions with member sResolutions.GetSemanticClassification @@ -138,35 +201,6 @@ module TcResolutionsExtensions = |> Array.concat | None -> sResolutions.CapturedNameResolutions.ToArray() - let isDisposableTy (ty: TType) = - not (typeEquiv g ty g.system_IDisposable_ty) - && protectAssemblyExplorationNoReraise false false (fun () -> - ExistsHeadTypeInEntireHierarchy g amap range0 ty g.tcref_System_IDisposable) - - let isDiscard (str: string) = str.StartsWith("_") - - let isValRefDisposable (vref: ValRef) = - not (isDiscard vref.DisplayName) - && - // For values, we actually do want to color things if they literally are IDisposables - protectAssemblyExplorationNoReraise false false (fun () -> - ExistsHeadTypeInEntireHierarchy g amap range0 vref.Type g.tcref_System_IDisposable) - - let isStructTyconRef (tcref: TyconRef) = - let ty = generalizedTyconRef g tcref - let underlyingTy = stripTyEqnsAndMeasureEqns g ty - isStructTy g underlyingTy - - let isValRefMutable (vref: ValRef) = - // Mutable values, ref cells, and non-inref byrefs are mutable. - vref.IsMutable - || isRefCellTy g vref.Type - || (isByrefTy g vref.Type && not (isInByrefTy g vref.Type)) - - let isRecdFieldMutable (rfinfo: RecdFieldInfo) = - (rfinfo.RecdField.IsMutable && rfinfo.LiteralValue.IsNone) - || isRefCellTy g rfinfo.RecdField.FormalType - let duplicates = HashSet(comparer) let results = ImmutableArray.CreateBuilder() @@ -183,7 +217,7 @@ module TcResolutionsExtensions = ItemOccurence.Use, m -> add m SemanticClassificationType.ComputationExpression - | Item.Value vref, _, m when isValRefMutable vref -> add m SemanticClassificationType.MutableVar + | Item.Value vref, _, m when isValRefMutable g vref -> add m SemanticClassificationType.MutableVar | Item.Value KeywordIntrinsicValue, ItemOccurence.Use, m -> add m SemanticClassificationType.IntrinsicFunction @@ -202,7 +236,7 @@ module TcResolutionsExtensions = add m SemanticClassificationType.Function | Item.Value vref, _, m -> - if isValRefDisposable vref then + if isValRefDisposable g amap vref then if vref.IsCompiledAsTopLevel then add m SemanticClassificationType.DisposableTopLevelValue else @@ -218,7 +252,7 @@ module TcResolutionsExtensions = match rfinfo with | EnumCaseFieldInfo -> add m SemanticClassificationType.Enumeration | _ -> - if isRecdFieldMutable rfinfo then + if isRecdFieldMutable g rfinfo then add m SemanticClassificationType.MutableRecordField elif isFunTy g rfinfo.FieldType then add m SemanticClassificationType.RecordFieldAsFunction @@ -244,7 +278,10 @@ module TcResolutionsExtensions = match minfos with | [] -> add m SemanticClassificationType.ConstructorForReferenceType | _ -> - if minfos |> List.forall (fun minfo -> isDisposableTy minfo.ApparentEnclosingType) then + if + minfos + |> List.forall (fun minfo -> isDisposableTy g amap minfo.ApparentEnclosingType) + then add m SemanticClassificationType.DisposableType elif minfos |> List.forall (fun minfo -> isStructTy g minfo.ApparentEnclosingType) then add m SemanticClassificationType.ConstructorForValueType @@ -269,52 +306,18 @@ module TcResolutionsExtensions = // Special case measures for struct types | Item.Types (_, AppTy g (tyconRef, TType_measure _ :: _) :: _), LegitTypeOccurence, m when - isStructTyconRef tyconRef + isStructTyconRef g tyconRef -> add m SemanticClassificationType.ValueType | Item.Types (_, ty :: _), LegitTypeOccurence, m -> - let reprToClassificationType repr tcref = - match repr with - | TFSharpObjectRepr om -> - match om.fsobjmodel_kind with - | TFSharpClass -> SemanticClassificationType.ReferenceType - | TFSharpInterface -> SemanticClassificationType.Interface - | TFSharpStruct -> SemanticClassificationType.ValueType - | TFSharpDelegate _ -> SemanticClassificationType.Delegate - | TFSharpEnum _ -> SemanticClassificationType.Enumeration - | TFSharpRecdRepr _ - | TFSharpUnionRepr _ -> - if isStructTyconRef tcref then - SemanticClassificationType.ValueType - else - SemanticClassificationType.Type - | TILObjectRepr (TILObjectReprData (_, _, td)) -> - if td.IsClass then - SemanticClassificationType.ReferenceType - elif td.IsStruct then - SemanticClassificationType.ValueType - elif td.IsInterface then - SemanticClassificationType.Interface - elif td.IsEnum then - SemanticClassificationType.Enumeration - else - SemanticClassificationType.Delegate - | TAsmRepr _ -> SemanticClassificationType.TypeDef - | TMeasureableRepr _ -> SemanticClassificationType.TypeDef -#if !NO_TYPEPROVIDERS - | TProvidedTypeRepr _ -> SemanticClassificationType.TypeDef - | TProvidedNamespaceRepr _ -> SemanticClassificationType.TypeDef -#endif - | TNoRepr -> SemanticClassificationType.ReferenceType - let ty = stripTyEqns g ty - if isDisposableTy ty then + if isDisposableTy g amap ty then add m SemanticClassificationType.DisposableType else match tryTcrefOfAppTy g ty with - | ValueSome tcref -> add m (reprToClassificationType tcref.TypeReprInfo tcref) + | ValueSome tcref -> add m (reprToClassificationType g tcref.TypeReprInfo tcref) | ValueNone -> if isStructTupleTy g ty then add m SemanticClassificationType.ValueType @@ -341,6 +344,8 @@ module TcResolutionsExtensions = | Item.UnionCase _, _, m -> add m SemanticClassificationType.UnionCase + | Item.Trait _, _, m -> add m SemanticClassificationType.Method + | Item.ActivePatternResult _, _, m -> add m SemanticClassificationType.UnionCase | Item.UnionCaseField _, _, m -> add m SemanticClassificationType.UnionCaseField @@ -371,7 +376,7 @@ module TcResolutionsExtensions = elif tcref.IsNamespace then add m SemanticClassificationType.Namespace elif tcref.IsUnionTycon || tcref.IsRecordTycon then - if isStructTyconRef tcref then + if isStructTyconRef g tcref then add m SemanticClassificationType.ValueType else add m SemanticClassificationType.UnionCase diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 9491e8fa07a..17f8b27213d 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -153,7 +153,7 @@ module DeclarationListHelpers = let denv = SimplerDisplayEnv denv let xml = GetXmlCommentForItem infoReader m item.Item match item.Item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) -> // operator with solution FormatItemDescriptionToToolTipElement displayFullName infoReader ad m denv { item with Item = Item.Value vref } @@ -384,6 +384,12 @@ module DeclarationListHelpers = let layout = NicePrint.prettyLayoutOfTypar denv typar ToolTipElement.Single (toArray layout, xml) + // Traits + | Item.Trait traitInfo -> + let denv = { denv with shortConstraints = false} + let layout = NicePrint.prettyLayoutOfTrait denv traitInfo + ToolTipElement.Single (toArray layout, xml) + // F# Modules and namespaces | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> //let os = StringBuilder() @@ -453,8 +459,44 @@ module DeclarationListHelpers = | Item.SetterArg (_, item) -> FormatItemDescriptionToToolTipElement displayFullName infoReader ad m denv (ItemWithNoInst item) - | _ -> - ToolTipElement.None + | Item.ArgName (None, _, _, _) + + // TODO: give a decent tooltip for implicit operators that include the resolution of the operator + // + //type C() = + // static member (++++++) (x: C, y: C) = C() + // + //let f (x: C) = + // x ++++++ x + // + // Here hovering over "++++++" in "f" could give a tooltip saying what the thing is and what it has resolved to. + // + // + | Item.ImplicitOp _ + + // TODO: consider why we aren't getting Item.Types for generic type parameters + // let F<'T>() = new System.Collections.Generic.List<'T>() + | Item.Types (_, [TType_var _]) + + // TODO: consider why we aren't getting Item.Types for units of measure + | Item.Types (_, [TType_measure _]) + + // TODO: consider whether we ever get Item.Types with more than one element + | Item.Types (_, _ :: _ :: _) + + // We don't expect Item.Types with an anonymous record type, function types etc. + | Item.Types (_, [TType_anon _]) + | Item.Types (_, [TType_fun _]) + | Item.Types (_, [TType_forall _]) + | Item.Types (_, [TType_tuple _]) + | Item.Types (_, [TType_ucase _]) + + // We don't expect these cases + | Item.Types (_, []) + | Item.Property (_, []) + | Item.UnqualifiedType [] + | Item.ModuleOrNamespaces [] + | Item.CustomOperation (_, _, None) -> ToolTipElement.None /// Format the structured version of a tooltip for an item let FormatStructuredDescriptionOfItem isDecl infoReader ad m denv item = @@ -747,6 +789,14 @@ module internal DescriptionListsImpl = // for display as part of the method group prettyParams, prettyRetTyL + | Item.Trait traitInfo -> + let paramDatas = + [ for pty in traitInfo.GetLogicalArgumentTypes(g) do + ParamData(false, false, false, OptionalArgInfo.NotOptional, CallerInfo.NoCallerInfo, None, ReflectedArgInfo.None, pty) ] + let retTy = traitInfo.GetReturnType(g) + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInstantiation paramDatas retTy + prettyParams, prettyRetTyL + | Item.CustomBuilder (_, vref) -> PrettyParamsAndReturnTypeOfItem infoReader m denv { item with Item = Item.Value vref } @@ -785,7 +835,19 @@ module internal DescriptionListsImpl = // for display as part of the method group prettyParams, prettyRetTyL - | _ -> + | Item.CustomOperation _ // TODO: consider whether this should report parameter help + | Item.ActivePatternResult _ // TODO: consider whether this should report parameter help + | Item.UnqualifiedType _ + | Item.UnionCaseField _ + | Item.Types _ + | Item.SetterArg _ + | Item.NewDef _ + | Item.ModuleOrNamespaces _ + | Item.ImplicitOp _ + | Item.ArgName _ + | Item.MethodGroup(_, [], _) + | Item.CtorGroup(_,[]) + | Item.Property(_,[]) -> [], emptyL @@ -839,7 +901,9 @@ module internal DescriptionListsImpl = else FSharpGlyph.Variable | Item.Types(_, ty :: _) -> typeToGlyph (stripTyEqns denv.g ty) | Item.UnionCase _ - | Item.ActivePatternCase _ -> FSharpGlyph.EnumMember + | Item.ActivePatternResult _ + | Item.ImplicitOp _ + | Item.ActivePatternCase _ -> FSharpGlyph.EnumMember | Item.ExnCase _ -> FSharpGlyph.Exception | Item.AnonRecdField _ -> FSharpGlyph.Field | Item.RecdField _ -> FSharpGlyph.Field @@ -853,6 +917,7 @@ module internal DescriptionListsImpl = | Item.CustomOperation _ -> FSharpGlyph.Method | Item.MethodGroup (_, minfos, _) when minfos |> List.forall (fun minfo -> minfo.IsExtensionMember) -> FSharpGlyph.ExtensionMethod | Item.MethodGroup _ -> FSharpGlyph.Method + | Item.Trait _ -> FSharpGlyph.Method | Item.TypeVar _ -> FSharpGlyph.TypeParameter | Item.Types _ -> FSharpGlyph.Class | Item.UnqualifiedType (tcref :: _) -> @@ -874,17 +939,23 @@ module internal DescriptionListsImpl = else FSharpGlyph.Class | Item.ModuleOrNamespaces(modref :: _) -> if modref.IsNamespace then FSharpGlyph.NameSpace else FSharpGlyph.Module - | Item.ArgName _ -> FSharpGlyph.Variable + | Item.NewDef _ + | Item.ArgName _ | Item.SetterArg _ -> FSharpGlyph.Variable - | _ -> FSharpGlyph.Error) + + // These empty lists are not expected to occur + | Item.ModuleOrNamespaces [] + | Item.UnqualifiedType [] -> + FSharpGlyph.Error + ) - /// Get rid of groups of overloads an replace them with single items. - /// (This looks like it is doing the a similar thing as FlattenItems, this code - /// duplication could potentially be removed) - let AnotherFlattenItems g m item = + /// Select the items that participate in a MethodGroup. + let SelectMethodGroupItems g m item = match item with | Item.CtorGroup(nm, cinfos) -> List.map (fun minfo -> Item.CtorGroup(nm, [minfo])) cinfos + | Item.Trait traitInfo -> + if traitInfo.GetLogicalArgumentTypes(g).IsEmpty then [] else [item] | Item.FakeInterfaceCtor _ | Item.DelegateCtor _ -> [item] | Item.NewDef _ @@ -907,11 +978,20 @@ module internal DescriptionListsImpl = [item] #endif | Item.MethodGroup(nm, minfos, orig) -> minfos |> List.map (fun minfo -> Item.MethodGroup(nm, [minfo], orig)) - | Item.CustomOperation(_name, _helpText, _minfo) -> [item] - | Item.TypeVar _ -> [] - | Item.CustomBuilder _ -> [] - | _ -> [] - + | Item.CustomOperation _ -> [item] + // These are not items that can participate in a method group + | Item.TypeVar _ + | Item.CustomBuilder _ + | Item.ActivePatternCase _ + | Item.AnonRecdField _ + | Item.ArgName _ + | Item.ImplicitOp _ + | Item.ModuleOrNamespaces _ + | Item.SetterArg _ + | Item.Types _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.ActivePatternResult _ -> [] /// An intellisense declaration [] @@ -1181,7 +1261,7 @@ type MethodGroup( name: string, unsortedMethods: MethodGroupItem[] ) = | true, res -> yield! res | false, _ -> #endif - let flatItems = AnotherFlattenItems g m item.Item + let flatItems = SelectMethodGroupItems g m item.Item let methods = flatItems |> Array.ofList |> Array.map (fun flatItem -> @@ -1228,4 +1308,3 @@ type MethodGroup( name: string, unsortedMethods: MethodGroupItem[] ) = MethodGroup(name, methods) static member internal Empty = empty - diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 6e4812eeb6d..9a1a53ac658 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -649,6 +649,8 @@ module SyntaxTraversal = | SynExpr.LongIdent (_, _longIdent, _altNameRefCell, _range) -> None + | SynExpr.Typar (_typar, _range) -> None + | SynExpr.LongIdentSet (_longIdent, synExpr, _range) -> traverseSynExpr synExpr | SynExpr.DotGet (synExpr, _dotm, _longIdent, _range) -> traverseSynExpr synExpr diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 662a420ae0b..d41cef4a04b 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -16,7 +16,7 @@ open FSharp.Compiler.Text.Position open FSharp.Compiler.Text.Range module SourceFileImpl = - let IsInterfaceFile file = + let IsSignatureFile file = let ext = Path.GetExtension file 0 = String.Compare(".fsi", ext, StringComparison.OrdinalIgnoreCase) @@ -611,6 +611,7 @@ module ParsedInput = List.tryPick walkType ts |> Option.orElseWith (fun () -> walkMemberSig sign) | SynTypeConstraint.WhereTyparIsEnum (t, ts, _) -> walkTypar t |> Option.orElseWith (fun () -> List.tryPick walkType ts) | SynTypeConstraint.WhereTyparIsDelegate (t, ts, _) -> walkTypar t |> Option.orElseWith (fun () -> List.tryPick walkType ts) + | SynTypeConstraint.WhereSelfConstrained (ts, _) -> walkType ts and walkPatWithKind (kind: EntityKind option) pat = match pat with @@ -830,7 +831,7 @@ module ParsedInput = | SynExpr.DoBang (e, _) -> walkExprWithKind parentKind e | SynExpr.TraitCall (ts, sign, e, _) -> - List.tryPick walkTypar ts + List.tryPick walkType ts |> Option.orElseWith (fun () -> walkMemberSig sign) |> Option.orElseWith (fun () -> walkExprWithKind parentKind e) @@ -1615,6 +1616,7 @@ module ParsedInput = | SynTypeConstraint.WhereTyparSupportsMember (ts, sign, _) -> List.iter walkType ts walkMemberSig sign + | SynTypeConstraint.WhereSelfConstrained (ty, _) -> walkType ty and walkPat pat = match pat with @@ -1802,7 +1804,7 @@ module ParsedInput = walkExpr e2 | SynExpr.TraitCall (ts, sign, e, _) -> - List.iter walkTypar ts + List.iter walkType ts walkMemberSig sign walkExpr e | SynExpr.Const (SynConst.Measure (_, _, m), _) -> walkMeasure m diff --git a/src/Compiler/Service/ServiceParsedInputOps.fsi b/src/Compiler/Service/ServiceParsedInputOps.fsi index 2c7a0e20d83..36bed4d46fb 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fsi +++ b/src/Compiler/Service/ServiceParsedInputOps.fsi @@ -157,6 +157,6 @@ module public ParsedInput = // implementation details used by other code in the compiler module internal SourceFileImpl = - val IsInterfaceFile: string -> bool + val IsSignatureFile: string -> bool val GetImplicitConditionalDefinesForEditing: isInteractive: bool -> string list diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 3320dd4ec73..eabc11f3410 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -307,22 +307,18 @@ module FSharpExprConvert = let (|TTypeConvOp|_|) (cenv: SymbolEnv) ty = let g = cenv.g match ty with - | TType_app (tcref, _, _) -> - match tcref with - | _ when tyconRefEq g tcref g.sbyte_tcr -> Some mkCallToSByteOperator - | _ when tyconRefEq g tcref g.byte_tcr -> Some mkCallToByteOperator - | _ when tyconRefEq g tcref g.int16_tcr -> Some mkCallToInt16Operator - | _ when tyconRefEq g tcref g.uint16_tcr -> Some mkCallToUInt16Operator - | _ when tyconRefEq g tcref g.int_tcr -> Some mkCallToIntOperator - | _ when tyconRefEq g tcref g.int32_tcr -> Some mkCallToInt32Operator - | _ when tyconRefEq g tcref g.uint32_tcr -> Some mkCallToUInt32Operator - | _ when tyconRefEq g tcref g.int64_tcr -> Some mkCallToInt64Operator - | _ when tyconRefEq g tcref g.uint64_tcr -> Some mkCallToUInt64Operator - | _ when tyconRefEq g tcref g.float32_tcr -> Some mkCallToSingleOperator - | _ when tyconRefEq g tcref g.float_tcr -> Some mkCallToDoubleOperator - | _ when tyconRefEq g tcref g.nativeint_tcr -> Some mkCallToIntPtrOperator - | _ when tyconRefEq g tcref g.unativeint_tcr -> Some mkCallToUIntPtrOperator - | _ -> None + | _ when typeEquiv g ty g.sbyte_ty -> Some mkCallToSByteOperator + | _ when typeEquiv g ty g.byte_ty -> Some mkCallToByteOperator + | _ when typeEquiv g ty g.int16_ty -> Some mkCallToInt16Operator + | _ when typeEquiv g ty g.uint16_ty -> Some mkCallToUInt16Operator + | _ when typeEquiv g ty g.int32_ty -> Some mkCallToInt32Operator + | _ when typeEquiv g ty g.uint32_ty -> Some mkCallToUInt32Operator + | _ when typeEquiv g ty g.int64_ty -> Some mkCallToInt64Operator + | _ when typeEquiv g ty g.uint64_ty -> Some mkCallToUInt64Operator + | _ when typeEquiv g ty g.float32_ty -> Some mkCallToSingleOperator + | _ when typeEquiv g ty g.float_ty -> Some mkCallToDoubleOperator + | _ when typeEquiv g ty g.nativeint_ty -> Some mkCallToIntPtrOperator + | _ when typeEquiv g ty g.unativeint_ty -> Some mkCallToUIntPtrOperator | _ -> None let ConvType cenv ty = FSharpType(cenv, ty) @@ -793,10 +789,10 @@ module FSharpExprConvert = let op2 = convertOp2 g m ty2 op1 ConvExprPrim cenv env op2 - | TOp.ILAsm ([ ILConvertOp convertOp ], [TType_app (tcref, _, _)]), _, [arg] -> + | TOp.ILAsm ([ ILConvertOp convertOp ], [ty2]), _, [arg] -> let ty = tyOfExpr g arg let op = - if tyconRefEq g tcref g.char_tcr then + if typeEquiv g ty2 g.char_ty then mkCallToCharOperator g m ty arg else convertOp g m ty arg ConvExprPrim cenv env op @@ -917,7 +913,7 @@ module FSharpExprConvert = | _ -> wfail (sprintf "unhandled construct in AST", m) | Expr.WitnessArg (traitInfo, _m) -> - ConvWitnessInfoPrim cenv env traitInfo + ConvWitnessInfoPrim env traitInfo | Expr.DebugPoint (_, innerExpr) -> ConvExprPrim cenv env innerExpr @@ -925,8 +921,8 @@ module FSharpExprConvert = | _ -> wfail (sprintf "unhandled construct in AST", expr.Range) - and ConvWitnessInfoPrim _cenv env traitInfo : E = - let witnessInfo = traitInfo.TraitKey + and ConvWitnessInfoPrim env traitInfo : E = + let witnessInfo = traitInfo.GetWitnessInfo() let env = { env with suppressWitnesses = true } // First check if this is a witness in ReflectedDefinition code if env.witnessesInScope.ContainsKey witnessInfo then @@ -939,9 +935,9 @@ module FSharpExprConvert = and ConvWitnessInfo cenv env m traitInfo : FSharpExpr = let g = cenv.g - let witnessInfo = traitInfo.TraitKey + let witnessInfo = traitInfo.GetWitnessInfo() let witnessTy = GenWitnessTy g witnessInfo - let traitInfoR = ConvWitnessInfoPrim cenv env traitInfo + let traitInfoR = ConvWitnessInfoPrim env traitInfo Mk cenv m witnessTy traitInfoR and ConvLetBind cenv env (bind : Binding) = diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index f385e3575e1..a3232c3db39 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -102,6 +102,7 @@ module internal SymbolHelpers = | Item.Property(_, pinfos) -> rangeOfPropInfo preferFlag pinfos.Head | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.map (rangeOfEntityRef preferFlag)) | Item.CustomOperation (_, _, Some minfo) -> rangeOfMethInfo g preferFlag minfo + | Item.Trait _ -> None | Item.TypeVar (_, tp) -> Some tp.Range | Item.ModuleOrNamespaces modrefs -> modrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) | Item.MethodGroup(_, minfos, _) @@ -110,7 +111,7 @@ module internal SymbolHelpers = | Item.SetterArg (_, item) -> rangeOfItem g preferFlag item | Item.ArgName (_, _, _, m) -> Some m | Item.CustomOperation (_, _, implOpt) -> implOpt |> Option.bind (rangeOfMethInfo g preferFlag) - | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(_, vref, _))}) -> Some vref.Range + | Item.ImplicitOp (_, {contents = Some(TraitConstraintSln.FSMethSln(vref=vref))}) -> Some vref.Range | Item.ImplicitOp _ -> None | Item.UnqualifiedType tcrefs -> tcrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) | Item.DelegateCtor ty @@ -167,21 +168,27 @@ module internal SymbolHelpers = |> Option.bind ccuOfValRef |> Option.orElseWith (fun () -> pinfo.DeclaringTyconRef |> computeCcuOfTyconRef)) - | Item.ArgName (_, _, Some (ArgumentContainer.Method minfo), _) -> - ccuOfMethInfo g minfo + | Item.ArgName (_, _, meth, _) -> + match meth with + | None -> None + | Some (ArgumentContainer.Method minfo) -> ccuOfMethInfo g minfo + | Some (ArgumentContainer.Type eref) -> computeCcuOfTyconRef eref | Item.MethodGroup(_, minfos, _) | Item.CtorGroup(_, minfos) -> minfos |> List.tryPick (ccuOfMethInfo g) - | Item.CustomOperation (_, _, Some minfo) -> - ccuOfMethInfo g minfo + | Item.CustomOperation (_, _, meth) -> + match meth with + | None -> None + | Some minfo -> ccuOfMethInfo g minfo | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.bind computeCcuOfTyconRef) - | Item.ArgName (_, _, Some (ArgumentContainer.Type eref), _) -> - computeCcuOfTyconRef eref + | Item.FakeInterfaceCtor(ty) + | Item.DelegateCtor(ty) -> + ty |> tryNiceEntityRefOfTyOption |> Option.bind computeCcuOfTyconRef | Item.ModuleOrNamespaces erefs | Item.UnqualifiedType erefs -> @@ -193,8 +200,20 @@ module internal SymbolHelpers = | Item.AnonRecdField (info, _, _, _) -> Some info.Assembly + // This is not expected: you can't directly refer to trait constraints in other assemblies + | Item.Trait _ -> None + + // This is not expected: you can't directly refer to type variables in other assemblies | Item.TypeVar _ -> None - | _ -> None + + // This is not expected: you can't directly refer to active pattern result tags in other assemblies + | Item.ActivePatternResult _ -> None + + // This is not expected: implicit operator references only occur in the current assembly + | Item.ImplicitOp _ -> None + + // This is not expected: NewDef only occurs within checking + | Item.NewDef _ -> None /// Work out the source file for an item and fix it up relative to the CCU if it is relative. let fileNameOfItem (g: TcGlobals) qualProjectDir (m: range) h = @@ -246,7 +265,7 @@ module internal SymbolHelpers = |> Option.defaultValue xmlDoc /// This function gets the signature to pass to Visual Studio to use its lookup functions for .NET stuff. - let GetXmlDocHelpSigOfItemForLookup (infoReader: InfoReader) m d = + let rec GetXmlDocHelpSigOfItemForLookup (infoReader: InfoReader) m d = let g = infoReader.g match d with | Item.ActivePatternCase (APElemRef(_, vref, _, _)) @@ -256,6 +275,7 @@ module internal SymbolHelpers = | Item.UnionCase (ucinfo, _) -> mkXmlComment (GetXmlDocSigOfUnionCaseRef ucinfo.UnionCaseRef) + | Item.UnqualifiedType (tcref :: _) | Item.ExnCase tcref -> mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) @@ -267,12 +287,19 @@ module internal SymbolHelpers = | Item.ILField finfo -> mkXmlComment (GetXmlDocSigOfILFieldInfo infoReader m finfo) - | Item.Types(_, TType_app(tcref, _, _) :: _) -> - mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) + | Item.FakeInterfaceCtor ty + | Item.DelegateCtor ty + | Item.Types(_, ty :: _) -> + match ty with + | AbbrevOrAppTy tcref -> + mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) + | _ -> FSharpXmlDoc.None | Item.CustomOperation (_, _, Some minfo) -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) + | Item.Trait _ -> FSharpXmlDoc.None + | Item.TypeVar _ -> FSharpXmlDoc.None | Item.ModuleOrNamespaces(modref :: _) -> @@ -290,7 +317,7 @@ module internal SymbolHelpers = | Item.CtorGroup(_, minfo :: _) -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) - | Item.ArgName(_, _, Some argContainer, _) -> + | Item.ArgName(_, _, Some argContainer, _) -> match argContainer with | ArgumentContainer.Method minfo -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) | ArgumentContainer.Type tcref -> mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) @@ -298,7 +325,24 @@ module internal SymbolHelpers = | Item.UnionCaseField (ucinfo, _) -> mkXmlComment (GetXmlDocSigOfUnionCaseRef ucinfo.UnionCaseRef) - | _ -> FSharpXmlDoc.None + | Item.SetterArg (_, item) -> + GetXmlDocHelpSigOfItemForLookup infoReader m item + + // These do not have entires in XML doc files + | Item.CustomOperation _ + | Item.ArgName _ + | Item.ActivePatternResult _ + | Item.AnonRecdField _ + | Item.ImplicitOp _ + + // These empty lists are not expected to occur + | Item.CtorGroup (_, []) + | Item.MethodGroup (_, [], _) + | Item.Property (_, []) + | Item.ModuleOrNamespaces [] + | Item.UnqualifiedType [] + | Item.Types(_, []) -> + FSharpXmlDoc.None |> GetXmlDocFromLoader infoReader @@ -335,8 +379,9 @@ module internal SymbolHelpers = { new IPartialEqualityComparer<_> with member x.InEqualityRelation item = match item with - | Item.Types(_, [_]) -> true - | Item.ILField(ILFieldInfo _) -> true + | Item.Trait _ -> true + | Item.Types(_, _ :: _) -> true + | Item.ILField(_) -> true | Item.RecdField _ -> true | Item.SetterArg _ -> true | Item.TypeVar _ -> true @@ -352,7 +397,21 @@ module internal SymbolHelpers = | Item.Property _ -> true | Item.CtorGroup _ -> true | Item.UnqualifiedType _ -> true - | _ -> false + + // These are never expected to have duplicates in declaration lists etc + | Item.ActivePatternResult _ + | Item.AnonRecdField _ + | Item.ArgName _ + | Item.FakeInterfaceCtor _ + | Item.ImplicitOp _ + | Item.NewDef _ + | Item.UnionCaseField _ + + // These are not expected to occur + | Item.Types(_, []) + | Item.ModuleOrNamespaces [] -> false + + //| _ -> false member x.Equals(item1, item2) = // This may explore assemblies that are not in the reference set. @@ -371,7 +430,7 @@ module internal SymbolHelpers = // Much of this logic is already covered by 'ItemsAreEffectivelyEqual' match item1, item2 with | Item.DelegateCtor ty1, Item.DelegateCtor ty2 -> equalHeadTypes(ty1, ty2) - | Item.Types(dn1, [ty1]), Item.Types(dn2, [ty2]) -> + | Item.Types(dn1, ty1 :: _), Item.Types(dn2, ty2 :: _) -> // Bug 4403: We need to compare names as well, because 'int' and 'Int32' are physically the same type, but we want to show both dn1 = dn2 && equalHeadTypes(ty1, ty2) @@ -379,8 +438,8 @@ module internal SymbolHelpers = | ItemWhereTypIsPreferred ty1, ItemWhereTypIsPreferred ty2 -> equalHeadTypes(ty1, ty2) | Item.ExnCase tcref1, Item.ExnCase tcref2 -> tyconRefEq g tcref1 tcref2 - | Item.ILField(ILFieldInfo(_, fld1)), Item.ILField(ILFieldInfo(_, fld2)) -> - fld1 === fld2 // reference equality on the object identity of the AbstractIL metadata blobs for the fields + | Item.ILField(fld1), Item.ILField(fld2) -> + ILFieldInfo.ILFieldInfosUseIdenticalDefinitions fld1 fld2 | Item.CustomOperation (_, _, Some minfo1), Item.CustomOperation (_, _, Some minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2 | Item.TypeVar (nm1, tp1), Item.TypeVar (nm2, tp2) -> @@ -404,14 +463,16 @@ module internal SymbolHelpers = EventInfo.EventInfosUseIdenticalDefinitions evt1 evt2 | Item.AnonRecdField(anon1, _, i1, _), Item.AnonRecdField(anon2, _, i2, _) -> anonInfoEquiv anon1 anon2 && i1 = i2 - | Item.CtorGroup(_, meths1), Item.CtorGroup(_, meths2) -> + | Item.Trait traitInfo1, Item.Trait traitInfo2 -> + (traitInfo1.MemberLogicalName = traitInfo2.MemberLogicalName) + | Item.CtorGroup(_, meths1), Item.CtorGroup(_, meths2) -> (meths1, meths2) ||> List.forall2 (fun minfo1 minfo2 -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) | Item.UnqualifiedType tcrefs1, Item.UnqualifiedType tcrefs2 -> (tcrefs1, tcrefs2) ||> List.forall2 (fun tcref1 tcref2 -> tyconRefEq g tcref1 tcref2) - | Item.Types(_, [TType_app(tcref1, _, _)]), Item.UnqualifiedType([tcref2]) -> tyconRefEq g tcref1 tcref2 - | Item.UnqualifiedType([tcref1]), Item.Types(_, [TType_app(tcref2, _, _)]) -> tyconRefEq g tcref1 tcref2 + | Item.Types(_, [AbbrevOrAppTy tcref1]), Item.UnqualifiedType([tcref2]) -> tyconRefEq g tcref1 tcref2 + | Item.UnqualifiedType([tcref1]), Item.Types(_, [AbbrevOrAppTy tcref2]) -> tyconRefEq g tcref1 tcref2 | _ -> false) member x.GetHashCode item = @@ -423,8 +484,8 @@ module internal SymbolHelpers = match tryTcrefOfAppTy g ty with | ValueSome tcref -> hash tcref.LogicalName | _ -> 1010 - | Item.ILField(ILFieldInfo(_, fld)) -> - System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode fld // hash on the object identity of the AbstractIL metadata blob for the field + | Item.ILField(fld) -> + fld.ComputeHashCode() | Item.TypeVar (nm, _tp) -> hash nm | Item.CustomOperation (_, _, Some minfo) -> minfo.ComputeHashCode() | Item.CustomOperation (_, _, None) -> 1 @@ -438,10 +499,24 @@ module internal SymbolHelpers = | Item.UnionCase(UnionCaseInfo(_, UnionCaseRef(tcref, n)), _) -> hash(tcref.Stamp, n) | Item.RecdField(RecdFieldInfo(_, RecdFieldRef(tcref, n))) -> hash(tcref.Stamp, n) | Item.AnonRecdField(anon, _, i, _) -> hash anon.SortedNames[i] + | Item.Trait traitInfo -> hash traitInfo.MemberLogicalName | Item.Event evt -> evt.ComputeHashCode() | Item.Property(_name, pis) -> hash (pis |> List.map (fun pi -> pi.ComputeHashCode())) | Item.UnqualifiedType(tcref :: _) -> hash tcref.LogicalName - | _ -> failwith "unreachable") } + + // These are not expected to occur, see InEqualityRelation and ItemWhereTypIsPreferred + | Item.ActivePatternResult _ + | Item.AnonRecdField _ + | Item.ArgName _ + | Item.FakeInterfaceCtor _ + | Item.ImplicitOp _ + | Item.NewDef _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.Types _ + | Item.DelegateCtor _ + | Item.ModuleOrNamespaces [] -> 0 + ) } let ItemWithTypeDisplayPartialEquality g = let itemComparer = ItemDisplayPartialEquality g @@ -491,11 +566,11 @@ module internal SymbolHelpers = let rec FullNameOfItem g item = let denv = DisplayEnv.Empty g match item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) | Item.Value vref | Item.CustomBuilder (_, vref) -> fullDisplayTextOfValRef vref | Item.UnionCase (ucinfo, _) -> fullDisplayTextOfUnionCaseRef ucinfo.UnionCaseRef | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.DisplayNameByIdx idx - | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.DisplayName + | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.DisplayName | Item.ExnCase ecref -> fullDisplayTextOfExnRef ecref | Item.AnonRecdField(anon, _argTys, i, _) -> anon.DisplayNameByIdx i | Item.RecdField rfinfo -> fullDisplayTextOfRecdFieldRef rfinfo.RecdFieldRef @@ -514,7 +589,8 @@ module internal SymbolHelpers = match tryTcrefOfAppTy g ty with | ValueSome tcref -> buildString (fun os -> NicePrint.outputTyconRef denv os tcref) | _ -> "" - | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> + | Item.Trait traitInfo -> traitInfo.MemberLogicalName + | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> let definiteNamespace = modrefs |> List.forall (fun modref -> modref.IsNamespace) if definiteNamespace then fullDisplayTextOfModRef modref else modref.DisplayName | Item.TypeVar _ @@ -530,28 +606,41 @@ module internal SymbolHelpers = | Item.ModuleOrNamespaces [] | Item.Property(_, []) -> "" - /// Output a the description of a language item + /// Output the description of a language item let rec GetXmlCommentForItem (infoReader: InfoReader) m item = let g = infoReader.g match item with - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> - GetXmlCommentForItem infoReader m (Item.Value vref) + | Item.ImplicitOp(_, sln) -> + match sln.Value with + | Some(TraitConstraintSln.FSMethSln(vref=vref)) -> + GetXmlCommentForItem infoReader m (Item.Value vref) + | Some (TraitConstraintSln.ILMethSln _) + | Some (TraitConstraintSln.FSRecdFieldSln _) + | Some (TraitConstraintSln.FSAnonRecdFieldSln _) + | Some (TraitConstraintSln.ClosedExprSln _) + | Some TraitConstraintSln.BuiltInSln + | None -> + GetXmlCommentForItemAux None infoReader m item | Item.Value vref | Item.CustomBuilder (_, vref) -> - GetXmlCommentForItemAux (if valRefInThisAssembly g.compilingFSharpCore vref || vref.XmlDoc.NonEmpty then Some vref.XmlDoc else None) infoReader m item + let doc = if valRefInThisAssembly g.compilingFSharpCore vref || vref.XmlDoc.NonEmpty then Some vref.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item | Item.UnionCase(ucinfo, _) -> - GetXmlCommentForItemAux (if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ucinfo.TyconRef || ucinfo.UnionCase.XmlDoc.NonEmpty then Some ucinfo.UnionCase.XmlDoc else None) infoReader m item + let doc = if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ucinfo.TyconRef || ucinfo.UnionCase.XmlDoc.NonEmpty then Some ucinfo.UnionCase.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item | Item.ActivePatternCase apref -> - GetXmlCommentForItemAux (Some apref.ActivePatternVal.XmlDoc) infoReader m item + let doc = Some apref.ActivePatternVal.XmlDoc + GetXmlCommentForItemAux doc infoReader m item | Item.ExnCase ecref -> - GetXmlCommentForItemAux (if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ecref || ecref.XmlDoc.NonEmpty then Some ecref.XmlDoc else None) infoReader m item + let doc = if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ecref || ecref.XmlDoc.NonEmpty then Some ecref.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item | Item.RecdField rfinfo -> let tcref = rfinfo.TyconRef - let xmldoc = + let doc = if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then if tcref.IsFSharpException then Some tcref.XmlDoc @@ -559,55 +648,89 @@ module internal SymbolHelpers = Some rfinfo.RecdField.XmlDoc else None - GetXmlCommentForItemAux xmldoc infoReader m item + GetXmlCommentForItemAux doc infoReader m item | Item.Event einfo -> - GetXmlCommentForItemAux (if einfo.HasDirectXmlComment || einfo.XmlDoc.NonEmpty then Some einfo.XmlDoc else None) infoReader m item + let doc = if einfo.HasDirectXmlComment || einfo.XmlDoc.NonEmpty then Some einfo.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item | Item.Property(_, pinfos) -> let pinfo = pinfos.Head - GetXmlCommentForItemAux (if pinfo.HasDirectXmlComment || pinfo.XmlDoc.NonEmpty then Some pinfo.XmlDoc else None) infoReader m item + let doc = if pinfo.HasDirectXmlComment || pinfo.XmlDoc.NonEmpty then Some pinfo.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item | Item.CustomOperation (_, _, Some minfo) | Item.CtorGroup(_, minfo :: _) | Item.MethodGroup(_, minfo :: _, _) -> GetXmlCommentForMethInfoItem infoReader m item minfo - | Item.Types(_, TType_app(tcref, _, _) :: _) -> - GetXmlCommentForItemAux (if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then Some tcref.XmlDoc else None) infoReader m item + | Item.Types(_, tys) -> + let doc = + match tys with + | AbbrevOrAppTy tcref :: _ -> + if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then + Some tcref.XmlDoc + else + None + | _ -> None + GetXmlCommentForItemAux doc infoReader m item + + | Item.UnqualifiedType(tcrefs) -> + let doc = + match tcrefs with + | tcref :: _ -> + if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then + Some tcref.XmlDoc + else + None + | _ -> None + GetXmlCommentForItemAux doc infoReader m item | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> let definiteNamespace = modrefs |> List.forall (fun modref -> modref.IsNamespace) if not definiteNamespace then - GetXmlCommentForItemAux (if entityRefInThisAssembly g.compilingFSharpCore modref || modref.XmlDoc.NonEmpty then Some modref.XmlDoc else None) infoReader m item + let doc = if entityRefInThisAssembly g.compilingFSharpCore modref || modref.XmlDoc.NonEmpty then Some modref.XmlDoc else None + GetXmlCommentForItemAux doc infoReader m item else GetXmlCommentForItemAux None infoReader m item - | Item.ArgName (_, _, argContainer, _) -> - let xmldoc = + | Item.ArgName (_, _, argContainer, _) -> + let doc = match argContainer with | Some(ArgumentContainer.Method minfo) -> if minfo.HasDirectXmlComment || minfo.XmlDoc.NonEmpty then Some minfo.XmlDoc else None | Some(ArgumentContainer.Type tcref) -> if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then Some tcref.XmlDoc else None | _ -> None - GetXmlCommentForItemAux xmldoc infoReader m item + GetXmlCommentForItemAux doc infoReader m item | Item.UnionCaseField (ucinfo, _) -> - let xmldoc = - if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ucinfo.TyconRef || ucinfo.UnionCase.XmlDoc.NonEmpty then Some ucinfo.UnionCase.XmlDoc else None - GetXmlCommentForItemAux xmldoc infoReader m item + let doc = + if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ucinfo.TyconRef || ucinfo.UnionCase.XmlDoc.NonEmpty then + Some ucinfo.UnionCase.XmlDoc + else + None + GetXmlCommentForItemAux doc infoReader m item | Item.SetterArg (_, item) -> GetXmlCommentForItem infoReader m item // In all these cases, there is no direct XML documentation from F# comments - | Item.ActivePatternResult _ + | Item.MethodGroup (_, [], _) + | Item.CtorGroup (_, []) + | Item.ModuleOrNamespaces [] + | Item.Types (_, []) + | Item.CustomOperation (_, _, None) + | Item.UnqualifiedType [] + | Item.TypeVar _ + | Item.Trait _ + | Item.AnonRecdField _ + | Item.ActivePatternResult _ | Item.NewDef _ | Item.ILField _ | Item.FakeInterfaceCtor _ - | Item.DelegateCtor _ - | _ -> + | Item.DelegateCtor _ -> + //| _ -> GetXmlCommentForItemAux None infoReader m item |> GetXmlDocFromLoader infoReader @@ -828,14 +951,19 @@ module internal SymbolHelpers = | Item.CustomOperation (_, _, None) // "into" | Item.NewDef _ // "let x$yz = ..." - no keyword | Item.ArgName _ // no keyword on named parameters - | Item.UnionCaseField _ + | Item.Trait _ + | Item.UnionCaseField _ | Item.TypeVar _ | Item.ImplicitOp _ | Item.ActivePatternResult _ // "let (|Foo|Bar|) = .. Fo$o ..." - no keyword -> None - /// Get rid of groups of overloads an replace them with single items. - let FlattenItems g (m: range) (item: ItemWithInst) : ItemWithInst list = + /// Select the items that participate in a MethodGroup. + // + // NOTE: This is almost identical to SelectMethodGroupItems and + // should be merged, and indeed is only used on the TypeCheckInfo::GetMethodsAsSymbols path, which is unused by + // the VS integration. + let SelectMethodGroupItems2 g (m: range) (item: ItemWithInst) : ItemWithInst list = ignore m match item.Item with | Item.MethodGroup(nm, minfos, orig) -> @@ -858,7 +986,19 @@ module internal SymbolHelpers = | ItemIsWithStaticArguments m g _ -> [item] // we pretend that provided-types-with-static-args are method-like in order to get ParamInfo for them #endif | Item.CustomOperation(_name, _helpText, _minfo) -> [item] + | Item.Trait _ -> [item] | Item.TypeVar _ -> [] | Item.CustomBuilder _ -> [] - | _ -> [] - + // These are not items that can participate in a method group + | Item.TypeVar _ + | Item.CustomBuilder _ + | Item.ActivePatternCase _ + | Item.AnonRecdField _ + | Item.ArgName _ + | Item.ImplicitOp _ + | Item.ModuleOrNamespaces _ + | Item.SetterArg _ + | Item.Types _ + | Item.UnionCaseField _ + | Item.UnqualifiedType _ + | Item.ActivePatternResult _ -> [] diff --git a/src/Compiler/Symbols/SymbolHelpers.fsi b/src/Compiler/Symbols/SymbolHelpers.fsi index e862ba3dee6..b25bf18d60f 100755 --- a/src/Compiler/Symbols/SymbolHelpers.fsi +++ b/src/Compiler/Symbols/SymbolHelpers.fsi @@ -56,7 +56,7 @@ module internal SymbolHelpers = val IsExplicitlySuppressed: TcGlobals -> Item -> bool - val FlattenItems: TcGlobals -> range -> ItemWithInst -> ItemWithInst list + val SelectMethodGroupItems2: TcGlobals -> range -> ItemWithInst -> ItemWithInst list #if !NO_TYPEPROVIDERS val (|ItemIsProvidedType|_|): TcGlobals -> Item -> TyconRef option diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index daf77871cc0..ec343ad2a8d 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -310,6 +310,9 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C | Item.TypeVar (_, tp) -> FSharpGenericParameter(cenv, tp) :> _ + | Item.Trait traitInfo -> + FSharpGenericParameterMemberConstraint(cenv, traitInfo) :> _ + | Item.ActivePatternCase apref -> FSharpActivePatternCase(cenv, apref.ActivePatternInfo, apref.ActivePatternVal.Type, apref.CaseIndex, Some apref.ActivePatternVal, item) :> _ @@ -319,7 +322,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: unit -> Item, access: FSharpSymbol -> C | Item.ArgName(id, ty, argOwner, m) -> FSharpParameter(cenv, id, ty, argOwner, m) :> _ - | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) -> + | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) -> FSharpMemberOrFunctionOrValue(cenv, V vref, item) :> _ // TODO: the following don't currently return any interesting subtype @@ -1417,6 +1420,10 @@ type FSharpAbstractSignature(cenv, info: SlotSig) = member _.DeclaringType = FSharpType(cenv, info.DeclaringType) type FSharpGenericParameterMemberConstraint(cenv, info: TraitConstraintInfo) = + inherit FSharpSymbol (cenv, + (fun () -> Item.Trait(info)), + (fun _ _ _ad -> true)) + let (TTrait(tys, nm, flags, atys, retTy, _)) = info member _.MemberSources = tys |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection diff --git a/src/Compiler/Symbols/Symbols.fsi b/src/Compiler/Symbols/Symbols.fsi index e8a88b65804..024448bf170 100644 --- a/src/Compiler/Symbols/Symbols.fsi +++ b/src/Compiler/Symbols/Symbols.fsi @@ -638,6 +638,8 @@ type FSharpStaticParameter = [] type FSharpGenericParameterMemberConstraint = + inherit FSharpSymbol + /// Get the types that may be used to satisfy the constraint member MemberSources: IList diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 9b54f1c9976..88a743a6bf2 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1023,7 +1023,11 @@ type LexFilterImpl ( let peekAdjacentTypars indentation (tokenTup: TokenTup) = let lookaheadTokenTup = peekNextTokenTup() match lookaheadTokenTup.Token with - | INFIX_COMPARE_OP " + | INFIX_COMPARE_OP "", false) + | LESS _ -> let tokenEndPos = tokenTup.LexbufState.EndPos if isAdjacent tokenTup lookaheadTokenTup then let mutable stack = [] @@ -1070,7 +1074,14 @@ type LexFilterImpl ( let dotTokenTup = peekNextTokenTup() stack <- (pool.UseLocation(dotTokenTup, HIGH_PRECEDENCE_PAREN_APP), false) :: stack true - | LPAREN | LESS _ | LBRACK | LBRACK_LESS | INFIX_COMPARE_OP " + | LPAREN + | LESS _ + | LBRACK + | LBRACK_LESS + | INFIX_COMPARE_OP "", false) -> scanAhead (nParen+1) // These tokens CAN occur in non-parenthesized positions in the grammar of types or type parameter definitions @@ -1119,13 +1130,22 @@ type LexFilterImpl ( let res = scanAhead 0 // Put the tokens back on and smash them up if needed - stack |> List.iter (fun (tokenTup, smash) -> + for (tokenTup, smash) in stack do if smash then match tokenTup.Token with | INFIX_COMPARE_OP " delayToken (pool.UseShiftedLocation(tokenTup, INFIX_STAR_DIV_MOD_OP "/", 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) pool.Return tokenTup + | INFIX_COMPARE_OP "<^" -> + delayToken (pool.UseShiftedLocation(tokenTup, INFIX_AT_HAT_OP "^", 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) + pool.Return tokenTup + // NOTE: this is "<@" + | LQUOTE ("<@ @>", false) -> + delayToken (pool.UseShiftedLocation(tokenTup, INFIX_AT_HAT_OP "@", 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) + pool.Return tokenTup | GREATER_BAR_RBRACK -> delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) @@ -1146,7 +1166,7 @@ type LexFilterImpl ( pool.Return tokenTup | _ -> delayToken tokenTup else - delayToken tokenTup) + delayToken tokenTup res else false diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 4cb172651ad..0440d019fa2 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -812,6 +812,40 @@ let mkSynMemberDefnGetSet | _ -> [] | _ -> [] +// Input Text Precedence by Parser Adjustment +// +// ^T.Ident ^(T.Ident) (^T).Ident +// ^T.Ident[idx] ^(T.Ident[idx]) (^T).Ident[idx] +// ^T.Ident.[idx] ^(T.Ident.[idx]) (^T).Ident.[idx] +// ^T.Ident.Ident2 ^(T.Ident.Ident2) (^T).Ident.Ident2 +// ^T.Ident(args).Ident3 ^(T.Ident(args).Ident3) (^T).Ident(args).Ident3 +// ^T.(+)(args) ^(T.(+)(args)) (^T).(+)(args).Ident3 +let adjustHatPrefixToTyparLookup mFull rightExpr = + let rec take inp = + match inp with + | SynExpr.Ident (typarIdent) + | 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, _) -> + let typar = SynTypar(typarIdent, TyparStaticReq.HeadType, false) + let lookup = SynLongIdent(items, dots, itemTrivias) + SynExpr.DotGet(SynExpr.Typar(typar, mFull), dotm, lookup, mFull) + | SynExpr.App (isAtomic, false, funcExpr, argExpr, m) -> + let funcExpr2 = take funcExpr + SynExpr.App(isAtomic, false, funcExpr2, argExpr, unionRanges funcExpr2.Range m) + | SynExpr.DotGet (leftExpr, dotm, lookup, m) -> + let leftExpr2 = take leftExpr + SynExpr.DotGet(leftExpr2, dotm, lookup, m) + | SynExpr.DotIndexedGet (leftExpr, indexArg, dotm, m) -> + let leftExpr2 = take leftExpr + SynExpr.DotIndexedGet(leftExpr2, indexArg, dotm, m) + | _ -> + reportParseErrorAt mFull (FSComp.SR.parsIncompleteTyparExpr2 ()) + arbExpr ("hatExpr1", mFull) + + take rightExpr + // The last element of elementTypes does not have a star or slash let mkSynTypeTuple (isStruct: bool) (elementTypes: SynTupleTypeSegment list) : SynType = let range = diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index e84c3759fbe..1b321cd9302 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -176,4 +176,7 @@ val mkSynMemberDefnGetSet: rangeStart: range -> SynMemberDefn list +/// Incorporate a '^' for an qualified access to a generic type parameter +val adjustHatPrefixToTyparLookup: mFull: range -> rightExpr: SynExpr -> SynExpr + val mkSynTypeTuple: isStruct: bool -> elementTypes: SynTupleTypeSegment list -> SynType diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 9926d7d61fa..8a0b853f63e 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -332,6 +332,8 @@ type SynTypeConstraint = | WhereTyparIsDelegate of typar: SynTypar * typeArgs: SynType list * range: range + | WhereSelfConstrained of selfConstraint: SynType * range: range + member x.Range = match x with | WhereTyparIsValueType (range = range) @@ -345,6 +347,7 @@ type SynTypeConstraint = | WhereTyparSupportsMember (range = range) | WhereTyparIsEnum (range = range) | WhereTyparIsDelegate (range = range) -> range + | WhereSelfConstrained (range = range) -> range [] type SynTyparDecls = @@ -595,6 +598,8 @@ type SynExpr = range: range * trivia: SynExprIfThenElseTrivia + | Typar of typar: SynTypar * range: range + | Ident of ident: Ident | LongIdent of isOptional: bool * longDotId: SynLongIdent * altNameRefCell: SynSimplePatAlternativeIdInfo ref option * range: range @@ -635,7 +640,7 @@ type SynExpr = | AddressOf of isByref: bool * expr: SynExpr * opRange: range * range: range - | TraitCall of supportTys: SynTypar list * traitSig: SynMemberSig * argExpr: SynExpr * range: range + | TraitCall of supportTys: SynType list * traitSig: SynMemberSig * argExpr: SynExpr * range: range | JoinIn of lhsExpr: SynExpr * lhsRange: range * rhsExpr: SynExpr * range: range @@ -769,6 +774,7 @@ type SynExpr = | SynExpr.InterpolatedString (range = m) | SynExpr.Dynamic (range = m) -> m | SynExpr.Ident id -> id.idRange + | SynExpr.Typar (range = m) -> m | SynExpr.DebugPoint (_, _, innerExpr) -> innerExpr.Range member e.RangeWithoutAnyExtraDot = @@ -1417,7 +1423,8 @@ type SynMemberDefn = ident: Ident * typeOpt: SynType option * propKind: SynMemberKind * - memberFlags: (SynMemberKind -> SynMemberFlags) * + memberFlags: SynMemberFlags * + memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * accessibility: SynAccess option * equalsRange: range * diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 874518d28ba..503a7b2faa7 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -413,6 +413,9 @@ type SynTypeConstraint = /// F# syntax is 'typar: delegate<'Args, unit> | WhereTyparIsDelegate of typar: SynTypar * typeArgs: SynType list * range: range + /// F# syntax is SomeThing<'T> + | WhereSelfConstrained of selfConstraint: SynType * range: range + member Range: range /// List of type parameter declarations with optional type constraints, @@ -617,7 +620,7 @@ type SynExpr = range2: range * range: range - /// F# syntax: ^expr + /// F# syntax: ^expr, used for from-end-of-collection indexing and ^T.Operation | IndexFromEnd of expr: SynExpr * range: range /// F# syntax: { expr } @@ -731,6 +734,9 @@ type SynExpr = range: range * trivia: SynExprIfThenElseTrivia + /// F# syntax: 'T (for 'T.ident). + | Typar of typar: SynTypar * range: range + /// F# syntax: ident /// Optimized representation for SynExpr.LongIdent (false, [id], id.idRange) | Ident of ident: Ident @@ -802,8 +808,8 @@ type SynExpr = /// F# syntax: &expr, &&expr | AddressOf of isByref: bool * expr: SynExpr * opRange: range * range: range - /// F# syntax: ((typar1 or ... or typarN): (member-dig) expr) - | TraitCall of supportTys: SynTypar list * traitSig: SynMemberSig * argExpr: SynExpr * range: range + /// F# syntax: ((type1 or ... or typeN): (member-dig) expr) + | TraitCall of supportTys: SynType list * traitSig: SynMemberSig * argExpr: SynExpr * range: range /// F# syntax: ... in ... /// Computation expressions only, based on JOIN_IN token from lex filter @@ -1599,7 +1605,8 @@ type SynMemberDefn = ident: Ident * typeOpt: SynType option * propKind: SynMemberKind * - memberFlags: (SynMemberKind -> SynMemberFlags) * + memberFlags: SynMemberFlags * + memberFlagsForSet: SynMemberFlags * xmlDoc: PreXmlDoc * accessibility: SynAccess option * equalsRange: range * diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index b620ab7985f..590f5523214 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -734,10 +734,10 @@ let OverrideMemberFlags trivia k : SynMemberFlags = Trivia = trivia } -let AbstractMemberFlags trivia k : SynMemberFlags = +let AbstractMemberFlags isInstance trivia k : SynMemberFlags = { MemberKind = k - IsInstance = true + IsInstance = isInstance IsDispatchSlot = true IsOverrideOrExplicitImpl = false IsFinal = false @@ -756,6 +756,17 @@ let StaticMemberFlags trivia k : SynMemberFlags = Trivia = trivia } +let ImplementStaticMemberFlags trivia k : SynMemberFlags = + { + MemberKind = k + IsInstance = false + IsDispatchSlot = false + IsOverrideOrExplicitImpl = true + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + Trivia = trivia + } + let MemberSynMemberFlagsTrivia (mMember: range) : SynMemberFlagsTrivia = { MemberRange = Some mMember @@ -810,6 +821,24 @@ let AbstractMemberSynMemberFlagsTrivia (mAbstract: range) (mMember: range) : Syn DefaultRange = None } +let StaticAbstractSynMemberFlagsTrivia mStatic mAbstract = + { + MemberRange = None + OverrideRange = None + AbstractRange = Some mAbstract + StaticRange = Some mStatic + DefaultRange = None + } + +let StaticAbstractMemberSynMemberFlagsTrivia mStatic mAbstract mMember = + { + MemberRange = Some mMember + OverrideRange = None + AbstractRange = Some mAbstract + StaticRange = Some mStatic + DefaultRange = None + } + let inferredTyparDecls = SynValTyparDecls(None, true) let noInferredTypars = SynValTyparDecls(None, false) @@ -850,6 +879,7 @@ let rec synExprContainsError inpExpr = | SynExpr.LibraryOnlyStaticOptimization _ | SynExpr.Null _ | SynExpr.Ident _ + | SynExpr.Typar _ | SynExpr.ImplicitZero _ | SynExpr.Const _ | SynExpr.Dynamic _ -> false diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 7af4403fac2..cafafaa0ec3 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -296,10 +296,12 @@ val ClassCtorMemberFlags: trivia: SynMemberFlagsTrivia -> SynMemberFlags val OverrideMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags -val AbstractMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags +val AbstractMemberFlags: isInstance: bool -> trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags val StaticMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags +val ImplementStaticMemberFlags: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags + val MemberSynMemberFlagsTrivia: mMember: range -> SynMemberFlagsTrivia val OverrideSynMemberFlagsTrivia: mOverride: range -> SynMemberFlagsTrivia @@ -312,6 +314,11 @@ val AbstractSynMemberFlagsTrivia: mAbstract: range -> SynMemberFlagsTrivia val AbstractMemberSynMemberFlagsTrivia: mAbstract: range -> mMember: range -> SynMemberFlagsTrivia +val StaticAbstractSynMemberFlagsTrivia: mStatic: range -> mAbstract: range -> SynMemberFlagsTrivia + +val StaticAbstractMemberSynMemberFlagsTrivia: + mStatic: range -> mAbstract: range -> mMember: range -> SynMemberFlagsTrivia + val inferredTyparDecls: SynValTyparDecls val noInferredTypars: SynValTyparDecls diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 7b42df06495..a38d87199e0 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1773,15 +1773,16 @@ type TcGlobals( /// AdditionDynamic for op_Addition. Also work out the type instantiation of the dynamic function. member _.MakeBuiltInWitnessInfo (t: TraitConstraintInfo) = let memberName = - let nm = t.MemberName + let nm = t.MemberLogicalName let coreName = if nm.StartsWith "op_" then nm[3..] elif nm = "get_Zero" then "GenericZero" elif nm = "get_One" then "GenericOne" else nm coreName + "Dynamic" + let gtps, argTys, retTy, tinst = - match memberName, t.ArgumentTypes, t.ReturnType with + match memberName, t.CompiledObjectAndArgumentTypes, t.CompiledReturnType with | ("AdditionDynamic" | "MultiplyDynamic" | "SubtractionDynamic"| "DivisionDynamic" | "ModulusDynamic" | "CheckedAdditionDynamic" | "CheckedMultiplyDynamic" | "CheckedSubtractionDynamic" | "LeftShiftDynamic" | "RightShiftDynamic" | "BitwiseAndDynamic" | "BitwiseOrDynamic" | "ExclusiveOrDynamic" | "LessThanDynamic" | "GreaterThanDynamic" | "LessThanOrEqualDynamic" | "GreaterThanOrEqualDynamic" | "EqualityDynamic" | "InequalityDynamic"), [ arg0Ty; arg1Ty ], Some retTy -> @@ -1795,13 +1796,14 @@ type TcGlobals( | ("GenericZeroDynamic" | "GenericOneDynamic"), [], Some retTy -> [vara], [ ], varaTy, [ retTy ] | _ -> failwithf "unknown builtin witness '%s'" memberName + let vref = makeOtherIntrinsicValRef (fslib_MFLanguagePrimitives_nleref, memberName, None, None, gtps, (List.map List.singleton argTys, retTy)) vref, tinst /// Find an FSharp.Core operator that corresponds to a trait witness member g.TryMakeOperatorAsBuiltInWitnessInfo isStringTy isArrayTy (t: TraitConstraintInfo) argExprs = - match t.MemberName, t.ArgumentTypes, t.ReturnType, argExprs with + match t.MemberLogicalName, t.CompiledObjectAndArgumentTypes, t.CompiledReturnType, argExprs with | "get_Sign", [aty], _, objExpr :: _ -> // Call Operators.sign let info = makeOtherIntrinsicValRef (fslib_MFOperators_nleref, "sign", None, Some "Sign", [vara], ([[varaTy]], v_int32_ty)) @@ -1834,7 +1836,7 @@ type TcGlobals( Some (info, tyargs, []) | ("Abs" | "Sin" | "Cos" | "Tan" | "Sinh" | "Cosh" | "Tanh" | "Atan" | "Acos" | "Asin" | "Exp" | "Ceiling" | "Floor" | "Round" | "Truncate" | "Log10"| "Log"), [aty], _, [_] -> // Call corresponding Operators.* - let nm = t.MemberName + let nm = t.MemberLogicalName let lower = if nm = "Ceiling" then "ceil" else nm.ToLowerInvariant() let info = makeOtherIntrinsicValRef (fslib_MFOperators_nleref, lower, None, Some nm, [vara], ([[varaTy]], varaTy)) let tyargs = [aty] diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 47c343babd7..39d09093916 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -300,8 +300,8 @@ type TyparFlags(flags: int32) = TyparFlags((if isFromError then 0b00000000000000010 else 0) ||| (if isCompGen then 0b00000000000000100 else 0) ||| (match staticReq with - | TyparStaticReq.None -> 0b00000000000000000 - | TyparStaticReq.HeadType -> 0b00000000000001000) ||| + | TyparStaticReq.None -> 0b00000000000000000 + | TyparStaticReq.HeadType -> 0b00000000000001000) ||| (match rigidity with | TyparRigidity.Rigid -> 0b00000000000000000 | TyparRigidity.WillBeRigid -> 0b00000000000100000 @@ -376,6 +376,9 @@ type TyparFlags(flags: int32) = else TyparFlags(flags &&& ~~~0b00010000000000000) + member x.WithStaticReq staticReq = + TyparFlags(x.Kind, x.Rigidity, x.IsFromError, x.IsCompilerGenerated, staticReq, x.DynamicReq, x.EqualityConditionalOn, x.ComparisonConditionalOn) + /// Get the flags as included in the F# binary metadata. We pickle this as int64 to allow for future expansion member x.PickledBits = flags @@ -2266,22 +2269,33 @@ type Typar = member x.SetIdent id = x.typar_id <- id /// Sets the rigidity of a type variable - member x.SetRigidity b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, b, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) + member x.SetRigidity b = + let flags = x.typar_flags + x.typar_flags <- TyparFlags(flags.Kind, b, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) /// Sets whether a type variable is compiler generated - member x.SetCompilerGenerated b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, b, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) + member x.SetCompilerGenerated b = + let flags = x.typar_flags + x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, b, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) /// Sets whether a type variable has a static requirement - member x.SetStaticReq b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, b, flags.DynamicReq, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) + member x.SetStaticReq b = + x.typar_flags <- x.typar_flags.WithStaticReq(b) /// Sets whether a type variable is required at runtime - member x.SetDynamicReq b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, b, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) + member x.SetDynamicReq b = + let flags = x.typar_flags + x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, b, flags.EqualityConditionalOn, flags.ComparisonConditionalOn) /// Sets whether the equality constraint of a type definition depends on this type variable - member x.SetEqualityDependsOn b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, b, flags.ComparisonConditionalOn) + member x.SetEqualityDependsOn b = + let flags = x.typar_flags + x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, b, flags.ComparisonConditionalOn) /// Sets whether the comparison constraint of a type definition depends on this type variable - member x.SetComparisonDependsOn b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, b) + member x.SetComparisonDependsOn b = + let flags = x.typar_flags + x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, b) [] member x.DebugText = x.ToString() @@ -2341,7 +2355,7 @@ type TyparConstraint = [] type TraitWitnessInfo = - | TraitWitnessInfo of TTypes * string * SynMemberFlags * TTypes * TType option + | TraitWitnessInfo of tys: TTypes * memberName: string * memberFlags: SynMemberFlags * objAndArgTys: TTypes * returnTy: TType option /// Get the member name associated with the member constraint. member x.MemberName = (let (TraitWitnessInfo(_, b, _, _, _)) = x in b) @@ -2352,7 +2366,7 @@ type TraitWitnessInfo = [] member x.DebugText = x.ToString() - override x.ToString() = "TTrait(" + x.MemberName + ")" + override x.ToString() = "TraitWitnessInfo(" + x.MemberName + ")" /// The specification of a member constraint that must be solved [] @@ -2360,23 +2374,23 @@ type TraitConstraintInfo = /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of tys: TTypes * memberName: string * _memFlags: SynMemberFlags * argTys: TTypes * returnTy: TType option * solution: TraitConstraintSln option ref + | TTrait of tys: TTypes * memberName: string * memberFlags: SynMemberFlags * objAndArgTys: TTypes * returnTyOpt: TType option * solution: TraitConstraintSln option ref - /// Get the key associated with the member constraint. - member x.TraitKey = (let (TTrait(a, b, c, d, e, _)) = x in TraitWitnessInfo(a, b, c, d, e)) + /// Get the types that may provide solutions for the traits + member x.SupportTypes = (let (TTrait(tys, _, _, _, _, _)) = x in tys) - /// Get the member name associated with the member constraint. - member x.MemberName = (let (TTrait(_, nm, _, _, _, _)) = x in nm) + /// Get the logical member name associated with the member constraint. + member x.MemberLogicalName = (let (TTrait(_, nm, _, _, _, _)) = x in nm) /// Get the member flags associated with the member constraint. member x.MemberFlags = (let (TTrait(_, _, flags, _, _, _)) = x in flags) - /// Get the argument types recorded in the member constraint. This includes the object instance type for - /// instance members. - member x.ArgumentTypes = (let (TTrait(_, _, _, argTys, _, _)) = x in argTys) + member x.CompiledObjectAndArgumentTypes = (let (TTrait(_, _, _, objAndArgTys, _, _)) = x in objAndArgTys) - /// Get the return type recorded in the member constraint. - member x.ReturnType = (let (TTrait(_, _, _, _, ty, _)) = x in ty) + member x.WithMemberKind(kind) = (let (TTrait(a, b, c, d, e, f)) = x in TTrait(a, b, { c with MemberKind=kind }, d, e, f)) + + /// Get the optional return type recorded in the member constraint. + member x.CompiledReturnType = (let (TTrait(_, _, _, _, retTy, _)) = x in retTy) /// Get or set the solution of the member constraint during inference member x.Solution @@ -2386,7 +2400,7 @@ type TraitConstraintInfo = [] member x.DebugText = x.ToString() - override x.ToString() = "TTrait(" + x.MemberName + ")" + override x.ToString() = "TTrait(" + x.MemberLogicalName + ")" /// Represents the solution of a member constraint during inference. [] @@ -2398,7 +2412,8 @@ type TraitConstraintSln = /// ty -- the type and its instantiation /// vref -- the method that solves the trait constraint /// minst -- the generic method instantiation - | FSMethSln of ty: TType * vref: ValRef * minst: TypeInst + /// staticTyOpt -- the static type governing a static virtual call, if any + | FSMethSln of ty: TType * vref: ValRef * minst: TypeInst * staticTyOpt: TType option /// FSRecdFieldSln(tinst, rfref, isSetProp) /// @@ -2418,7 +2433,8 @@ type TraitConstraintSln = /// extOpt -- information about an extension member, if any /// ilMethodRef -- the method that solves the trait constraint /// minst -- the generic method instantiation - | ILMethSln of ty: TType * extOpt: ILTypeRef option * ilMethodRef: ILMethodRef * minst: TypeInst + /// staticTyOpt -- the static type governing a static virtual call, if any + | ILMethSln of ty: TType * extOpt: ILTypeRef option * ilMethodRef: ILMethodRef * minst: TypeInst * staticTyOpt: TType option /// ClosedExprSln expr /// @@ -4951,7 +4967,7 @@ type TOp = | Return -> "Return" | Goto n -> "Goto(" + string n + ")" | Label n -> "Label(" + string n + ")" - | TraitCall info -> "TraitCall(" + info.MemberName + ")" + | TraitCall info -> "TraitCall(" + info.MemberLogicalName + ")" | LValueOp (op, vref) -> sprintf "%+A(%s)" op vref.LogicalName | ILCall (_,_,_,_,_,_,_,ilMethRef,_,_,_) -> "ILCall(" + ilMethRef.ToString() + ",..)" diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index efbda2d6561..2487daf3517 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -206,6 +206,8 @@ type TyparFlags = member WithCompatFlex: b: bool -> TyparFlags + member WithStaticReq: staticReq: Syntax.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 @@ -1628,7 +1630,12 @@ type TyparConstraint = [] type TraitWitnessInfo = - | TraitWitnessInfo of TTypes * string * Syntax.SynMemberFlags * TTypes * TType option + | TraitWitnessInfo of + tys: TTypes * + memberName: string * + memberFlags: SynMemberFlags * + objAndArgTys: TTypes * + returnTy: TType option override ToString: unit -> string @@ -1650,34 +1657,42 @@ type TraitConstraintInfo = | TTrait of tys: TTypes * memberName: string * - _memFlags: Syntax.SynMemberFlags * - argTys: TTypes * - returnTy: TType option * + memberFlags: Syntax.SynMemberFlags * + objAndArgTys: TTypes * + returnTyOpt: TType option * solution: TraitConstraintSln option ref override ToString: unit -> string - /// Get the argument types recorded in the member constraint. This includes the object instance type for - /// instance members. - member ArgumentTypes: TTypes - [] member DebugText: string + /// Get the types that may provide solutions for the traits + member SupportTypes: TType list + /// Get the member flags associated with the member constraint. member MemberFlags: Syntax.SynMemberFlags - /// Get the member name associated with the member constraint. - member MemberName: string + /// Get the member name associated with the member constraint. For preop + member MemberLogicalName: string + + /// Get the raw object and argument types recorded in the member constraint. This includes the object instance type + /// instance members. This may be empty for property traits e.g. + /// "(static member Zero: ^T)" + /// or unit-taking methods + /// "(static member get_Zero: unit -> ^T)" + /// See also extension members GetCompiledArgumentTypes and GetLogicalArgumentTypes + member CompiledObjectAndArgumentTypes: TTypes /// Get the return type recorded in the member constraint. - member ReturnType: TType option + member CompiledReturnType: TType option /// Get or set the solution of the member constraint during inference member Solution: TraitConstraintSln option with get, set - /// Get the key associated with the member constraint. - member TraitKey: TraitWitnessInfo + /// The member kind is irrelevant to the logical properties of a trait. However it adjusts + /// the extension property MemberDisplayNameCore + member WithMemberKind: SynMemberKind -> TraitConstraintInfo /// Represents the solution of a member constraint during inference. [] @@ -1688,8 +1703,9 @@ type TraitConstraintSln = /// Indicates a trait is solved by an F# method. /// ty -- the type type its instantiation /// vref -- the method that solves the trait constraint + /// staticTyOpt -- the static type governing a static virtual call, if any /// minst -- the generic method instantiation - | FSMethSln of ty: TType * vref: ValRef * minst: TypeInst + | FSMethSln of ty: TType * vref: ValRef * minst: TypeInst * staticTyOpt: TType option /// FSRecdFieldSln(tinst, rfref, isSetProp) /// @@ -1709,7 +1725,13 @@ type TraitConstraintSln = /// extOpt -- information about an extension member, if any /// ilMethodRef -- the method that solves the trait constraint /// minst -- the generic method instantiation - | ILMethSln of ty: TType * extOpt: ILTypeRef option * ilMethodRef: ILMethodRef * minst: TypeInst + /// staticTyOpt -- the static type governing a static virtual call, if any + | ILMethSln of + ty: TType * + extOpt: ILTypeRef option * + ilMethodRef: ILMethodRef * + minst: TypeInst * + staticTyOpt: TType option /// ClosedExprSln expr /// diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 63a45fb9b9a..511a4cc44f2 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -194,17 +194,20 @@ let mkTyparTy (tp: Typar) = | TyparKind.Type -> tp.AsType | TyparKind.Measure -> TType_measure (Measure.Var tp) -let copyTypar (tp: Typar) = +// For fresh type variables clear the StaticReq when copying because the requirement will be re-established through the +// process of type inference. +let copyTypar clearStaticReq (tp: Typar) = let optData = tp.typar_opt_data |> Option.map (fun tg -> { typar_il_name = tg.typar_il_name; typar_xmldoc = tg.typar_xmldoc; typar_constraints = tg.typar_constraints; typar_attribs = tg.typar_attribs }) + let flags = if clearStaticReq then tp.typar_flags.WithStaticReq(TyparStaticReq.None) else tp.typar_flags Typar.New { typar_id = tp.typar_id - typar_flags = tp.typar_flags + typar_flags = flags typar_stamp = newStamp() typar_solution = tp.typar_solution typar_astype = Unchecked.defaultof<_> // Be careful to clone the mutable optional data too typar_opt_data = optData } -let copyTypars tps = List.map copyTypar tps +let copyTypars clearStaticReq tps = List.map (copyTypar clearStaticReq) tps //-------------------------------------------------------------------------- // Inference variables @@ -259,6 +262,12 @@ let stripTyparEqns ty = stripTyparEqnsAux false ty let stripUnitEqns unt = stripUnitEqnsAux false unt +/// Detect a use of a nominal type, including type abbreviations. +let (|AbbrevOrAppTy|_|) (ty: TType) = + match stripTyparEqns ty with + | TType_app (tcref, _, _) -> Some tcref + | _ -> None + //--------------------------------------------------------------------------- // These make local/non-local references to values according to whether // the item is globally stable ("published") or not. diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index e739aec4062..8a73a609316 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -122,9 +122,7 @@ val ccuOfTyconRef: eref: EntityRef -> CcuThunk option val mkTyparTy: tp: Typar -> TType -val copyTypar: tp: Typar -> Typar - -val copyTypars: tps: Typar list -> Typar list +val copyTypars: clearStaticReq: bool -> tps: Typar list -> Typar list val tryShortcutSolvedUnitPar: canShortcut: bool -> r: Typar -> Measure @@ -136,6 +134,9 @@ val stripTyparEqns: ty: TType -> TType val stripUnitEqns: unt: Measure -> Measure +/// Detect a use of a nominal type, including type abbreviations. +val (|AbbrevOrAppTy|_|): ty: TType -> TyconRef option + val mkLocalValRef: v: Val -> ValRef val mkLocalModuleRef: v: ModuleOrNamespace -> EntityRef diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e62c6f9309d..608ca6e86e5 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -11,7 +11,6 @@ open Internal.Utilities.Library open Internal.Utilities.Library.Extras open Internal.Utilities.Rational -open FSharp.Compiler.AbstractIL open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.DiagnosticsLogger @@ -285,10 +284,10 @@ and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, slnCell)) = | Some sln -> let sln = match sln with - | ILMethSln(ty, extOpt, ilMethRef, minst) -> - ILMethSln(remapTypeAux tyenv ty, extOpt, ilMethRef, remapTypesAux tyenv minst) - | FSMethSln(ty, vref, minst) -> - FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst) + | ILMethSln(ty, extOpt, ilMethRef, minst, staticTyOpt) -> + ILMethSln(remapTypeAux tyenv ty, extOpt, ilMethRef, remapTypesAux tyenv minst, Option.map (remapTypeAux tyenv) staticTyOpt) + | FSMethSln(ty, vref, minst, staticTyOpt) -> + FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst, Option.map (remapTypeAux tyenv) staticTyOpt) | FSRecdFieldSln(tinst, rfref, isSet) -> FSRecdFieldSln(remapTypesAux tyenv tinst, remapRecdFieldRef tyenv.tyconRefRemap rfref, isSet) | FSAnonRecdFieldSln(anonInfo, tinst, n) -> @@ -326,7 +325,7 @@ and copyAndRemapAndBindTyparsFull remapAttrib tyenv tps = match tps with | [] -> tps, tyenv | _ -> - let tpsR = copyTypars tps + let tpsR = copyTypars false tps let tyenv = { tyenv with tpinst = bindTypars tps (generalizeTypars tpsR) tyenv.tpinst } (tps, tpsR) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (remapTyparConstraintsAux tyenv tporig.Constraints) @@ -972,7 +971,7 @@ type TypeEquivEnv with let rec traitsAEquivAux erasureFlag g aenv traitInfo1 traitInfo2 = let (TTrait(tys1, nm, mf1, argTys, retTy, _)) = traitInfo1 let (TTrait(tys2, nm2, mf2, argTys2, retTy2, _)) = traitInfo2 - mf1 = mf2 && + mf1.IsInstance = mf2.IsInstance && nm = nm2 && ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 && returnTypesAEquivAux erasureFlag g aenv retTy retTy2 && @@ -981,7 +980,7 @@ let rec traitsAEquivAux erasureFlag g aenv traitInfo1 traitInfo2 = and traitKeysAEquivAux erasureFlag g aenv witnessInfo1 witnessInfo2 = let (TraitWitnessInfo(tys1, nm, mf1, argTys, retTy)) = witnessInfo1 let (TraitWitnessInfo(tys2, nm2, mf2, argTys2, retTy2)) = witnessInfo2 - mf1 = mf2 && + mf1.IsInstance = mf2.IsInstance && nm = nm2 && ListSet.equals (typeAEquivAux erasureFlag g aenv) tys1 tys2 && returnTypesAEquivAux erasureFlag g aenv retTy retTy2 && @@ -2263,13 +2262,15 @@ and accFreeInWitnessArg opts (TraitWitnessInfo(tys, _nm, _mf, argTys, retTy)) ac and accFreeInTraitSln opts sln acc = match sln with - | ILMethSln(ty, _, _, minst) -> - accFreeInType opts ty - (accFreeInTypes opts minst acc) - | FSMethSln(ty, vref, minst) -> - accFreeInType opts ty + | ILMethSln(ty, _, _, minst, staticTyOpt) -> + Option.foldBack (accFreeInType opts) staticTyOpt + (accFreeInType opts ty + (accFreeInTypes opts minst acc)) + | FSMethSln(ty, vref, minst, staticTyOpt) -> + Option.foldBack (accFreeInType opts) staticTyOpt + (accFreeInType opts ty (accFreeValRefInTraitSln opts vref - (accFreeInTypes opts minst acc)) + (accFreeInTypes opts minst acc))) | FSAnonRecdFieldSln(_anonInfo, tinst, _n) -> accFreeInTypes opts tinst acc | FSRecdFieldSln(tinst, _rfref, _isSet) -> @@ -2487,22 +2488,133 @@ let checkMemberVal membInfo arity m = let checkMemberValRef (vref: ValRef) = checkMemberVal vref.MemberInfo vref.ValReprInfo vref.Range +let GetFSharpViewOfReturnType (g: TcGlobals) retTy = + match retTy with + | None -> g.unit_ty + | Some retTy -> retTy + +type TraitConstraintInfo with + member traitInfo.GetReturnType(g: TcGlobals) = + GetFSharpViewOfReturnType g traitInfo.CompiledReturnType + + member traitInfo.GetObjectType() = + match traitInfo.MemberFlags.IsInstance, traitInfo.CompiledObjectAndArgumentTypes with + | true, objTy :: _ -> + Some objTy + | _ -> + None + + // For static property traits: + // ^T: (static member Zero: ^T) + // The inner representation is + // TraitConstraintInfo([^T], get_Zero, Property, Static, [], ^T) + // and this returns + // [] + // + // For the logically equivalent static get_property traits (i.e. the property as a get_ method) + // ^T: (static member get_Zero: unit -> ^T) + // The inner representation is + // TraitConstraintInfo([^T], get_Zero, Member, Static, [], ^T) + // and this returns + // [] + // + // For instance property traits + // ^T: (member Length: int) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Length, Property, Instance, [], int) + // and this returns + // [] + // + // For the logically equivalent instance get_property traits (i.e. the property as a get_ method) + // ^T: (member get_Length: unit -> int) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Length, Method, Instance, [^T], int) + // and this returns + // [] + // + // For index property traits + // ^T: (member Item: int -> int with get) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Item, Property, Instance, [^T; int], int) + // and this returns + // [int] + member traitInfo.GetCompiledArgumentTypes() = + match traitInfo.MemberFlags.IsInstance, traitInfo.CompiledObjectAndArgumentTypes with + | true, _ :: argTys -> + argTys + | _, argTys -> + argTys + + // For static property traits: + // ^T: (static member Zero: ^T) + // The inner representation is + // TraitConstraintInfo([^T], get_Zero, PropertyGet, Static, [], ^T) + // and this returns + // [] + // + // For the logically equivalent static get_property traits (i.e. the property as a get_ method) + // ^T: (static member get_Zero: unit -> ^T) + // The inner representation is + // TraitConstraintInfo([^T], get_Zero, Member, Static, [], ^T) + // and this returns + // [unit] + // + // For instance property traits + // ^T: (member Length: int) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Length, PropertyGet, Instance, [^T], int) + // and this views the constraint as if it were + // [] + // + // For the logically equivalent instance get_property traits (i.e. the property as a get_ method) + // ^T: (member get_Length: unit -> int) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Length, Member, Instance, [^T], int) + // and this returns + // [unit] + // + // For index property traits + // (member Item: int -> int with get) + // The inner TraitConstraintInfo representation is + // TraitConstraintInfo([^T], get_Item, PropertyGet, [^T; int], int) + // and this returns + // [int] + member traitInfo.GetLogicalArgumentTypes(g: TcGlobals) = + match traitInfo.GetCompiledArgumentTypes(), traitInfo.MemberFlags.MemberKind with + | [], SynMemberKind.Member -> [g.unit_ty] + | argTys, _ -> argTys + + member traitInfo.MemberDisplayNameCore = + let traitName0 = traitInfo.MemberLogicalName + match traitInfo.MemberFlags.MemberKind with + | SynMemberKind.PropertyGet + | SynMemberKind.PropertySet -> + match PrettyNaming.TryChopPropertyName traitName0 with + | Some nm -> nm + | None -> traitName0 + | _ -> traitName0 + + /// Get the key associated with the member constraint. + member traitInfo.GetWitnessInfo() = + let (TTrait(tys, nm, memFlags, objAndArgTys, rty, _)) = traitInfo + TraitWitnessInfo(tys, nm, memFlags, objAndArgTys, rty) + /// Get information about the trait constraints for a set of typars. /// Put these in canonical order. let GetTraitConstraintInfosOfTypars g (tps: Typars) = [ for tp in tps do - for cx in tp.Constraints do + for cx in tp.Constraints do match cx with - | TyparConstraint.MayResolveMember(traitInfo, _) -> yield traitInfo + | TyparConstraint.MayResolveMember(traitInfo, _) -> traitInfo | _ -> () ] |> ListSet.setify (traitsAEquiv g TypeEquivEnv.Empty) - |> List.sortBy (fun traitInfo -> traitInfo.MemberName, traitInfo.ArgumentTypes.Length) + |> List.sortBy (fun traitInfo -> traitInfo.MemberLogicalName, traitInfo.GetCompiledArgumentTypes().Length) /// Get information about the runtime witnesses needed for a set of generalized typars let GetTraitWitnessInfosOfTypars g numParentTypars typars = let typs = typars |> List.skip numParentTypars let cxs = GetTraitConstraintInfosOfTypars g typs - cxs |> List.map (fun cx -> cx.TraitKey) + cxs |> List.map (fun cx -> cx.GetWitnessInfo()) /// Count the number of type parameters on the enclosing type let CountEnclosingTyparsOfActualParentOfVal (v: Val) = @@ -2607,12 +2719,6 @@ let ArgInfosOfMemberVal g (v: Val) = let ArgInfosOfMember g (vref: ValRef) = ArgInfosOfMemberVal g vref.Deref -let GetFSharpViewOfReturnType (g: TcGlobals) retTy = - match retTy with - | None -> g.unit_ty - | Some retTy -> retTy - - /// Get the property "type" (getter return type) for an F# value that represents a getter or setter /// of an object model property. let ReturnTypeOfPropertyVal g (v: Val) = @@ -2674,7 +2780,7 @@ let isTTyparCoercesToType = function TyparConstraint.CoercesTo _ -> true | _ -> let prefixOfStaticReq s = match s with | TyparStaticReq.None -> "'" - | TyparStaticReq.HeadType -> " ^" + | TyparStaticReq.HeadType -> "^" let prefixOfInferenceTypar (typar: Typar) = if typar.Rigidity <> TyparRigidity.Rigid then "_" else "" @@ -2796,7 +2902,6 @@ module PrettyTypes = // Badly formed code may instantiate rigid declared typars to types. // Hence we double check here that the thing is really a type variable let safeDestAnyParTy orig g ty = match tryAnyParTy g ty with ValueNone -> orig | ValueSome x -> x - let tee f x = f x x let foldUnurriedArgInfos f z (x: UncurriedArgInfos) = List.fold (fold1Of2 f) z x let mapUnurriedArgInfos f (x: UncurriedArgInfos) = List.map (map1Of2 f) x @@ -2922,6 +3027,7 @@ module SimplifyTypes = { singletons = singletons inplaceConstraints = Zmap.ofList typarOrder inplace postfixConstraints = postfix } + let CollectInfo simplify tys cxs = categorizeConstraints simplify (accTyparCountsMulti emptyTyparCounts tys) cxs @@ -5418,11 +5524,23 @@ type StaticOptimizationAnswer = | No = -1y | Unknown = 0y -let decideStaticOptimizationConstraint g c haveWitnesses = +// Most static optimization conditionals in FSharp.Core are +// ^T : tycon +// +// These decide positively if ^T is nominal and identical to tycon. +// These decide negatively if ^T is nominal and different to tycon. +// +// The "special" static optimization conditionals +// ^T : ^T +// 'T : 'T +// are used as hacks in FSharp.Core as follows: +// ^T : ^T --> used in (+), (-) etc. to guard witness-invoking implementations added in F# 5 +// 'T : 'T --> used in FastGenericEqualityComparer, FastGenericComparer to guard struct/tuple implementations +// +// canDecideTyparEqn is set to true in IlxGen when the witness-invoking implementation can be used. +let decideStaticOptimizationConstraint g c canDecideTyparEqn = match c with - // When witnesses are available in generic code during codegen, "when ^T : ^T" resolves StaticOptimizationAnswer.Yes - // This doesn't apply to "when 'T : 'T" use for "FastGenericEqualityComparer" and others. - | TTyconEqualsTycon (a, b) when haveWitnesses && typeEquiv g a b && (match tryDestTyparTy g a with ValueSome tp -> tp.StaticReq = TyparStaticReq.HeadType | _ -> false) -> + | TTyconEqualsTycon (a, b) when canDecideTyparEqn && typeEquiv g a b && isTyparTy g a -> StaticOptimizationAnswer.Yes | TTyconEqualsTycon (a, b) -> // Both types must be nominal for a definite result @@ -5459,13 +5577,13 @@ let decideStaticOptimizationConstraint g c haveWitnesses = | ValueSome tcref1 -> if tcref1.IsStructOrEnumTycon then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No | ValueNone -> StaticOptimizationAnswer.Unknown -let rec DecideStaticOptimizations g cs haveWitnesses = +let rec DecideStaticOptimizations g cs canDecideTyparEqn = match cs with | [] -> StaticOptimizationAnswer.Yes | h :: t -> - let d = decideStaticOptimizationConstraint g h haveWitnesses + let d = decideStaticOptimizationConstraint g h canDecideTyparEqn if d = StaticOptimizationAnswer.No then StaticOptimizationAnswer.No - elif d = StaticOptimizationAnswer.Yes then DecideStaticOptimizations g t haveWitnesses + elif d = StaticOptimizationAnswer.Yes then DecideStaticOptimizations g t canDecideTyparEqn else StaticOptimizationAnswer.Unknown let mkStaticOptimizationExpr g (cs, e1, e2, m) = @@ -6409,14 +6527,16 @@ let rec tyOfExpr g expr = | TOp.LValueOp (LByrefGet, v) -> destByrefTy g v.Type | TOp.LValueOp (LAddrOf readonly, v) -> mkByrefTyWithFlag g readonly v.Type | TOp.RefAddrGet readonly -> (match tinst with [ty] -> mkByrefTyWithFlag g readonly ty | _ -> failwith "bad TOp.RefAddrGet node") - | TOp.TraitCall traitInfo -> GetFSharpViewOfReturnType g traitInfo.ReturnType + | TOp.TraitCall traitInfo -> traitInfo.GetReturnType(g) | TOp.Reraise -> (match tinst with [rtn_ty] -> rtn_ty | _ -> failwith "bad TOp.Reraise node") | TOp.Goto _ | TOp.Label _ | TOp.Return -> //assert false //errorR(InternalError("unexpected goto/label/return in tyOfExpr", m)) // It doesn't matter what type we return here. This is only used in free variable analysis in the code generator g.unit_ty - | Expr.WitnessArg (traitInfo, _m) -> GenWitnessTy g traitInfo.TraitKey + | Expr.WitnessArg (traitInfo, _m) -> + let witnessInfo = traitInfo.GetWitnessInfo() + GenWitnessTy g witnessInfo //-------------------------------------------------------------------------- // Make applications @@ -7545,8 +7665,6 @@ let mkCallToInt16Operator (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrins let mkCallToUInt16Operator (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint16_operator_info, [[ty]], [e1], m) -let mkCallToIntOperator (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int_operator_info, [[ty]], [e1], m) - let mkCallToInt32Operator (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.int32_operator_info, [[ty]], [e1], m) let mkCallToUInt32Operator (g: TcGlobals) m ty e1 = mkApps g (typedExprForIntrinsic g m g.uint32_operator_info, [[ty]], [e1], m) @@ -8112,7 +8230,7 @@ let MakeArgsForTopArgs _g m argTysl tpenv = let AdjustValForExpectedValReprInfo g m (vref: ValRef) flags valReprInfo = let tps, argTysl, retTy, _ = GetValReprTypeInFSharpForm g valReprInfo vref.Type m - let tpsR = copyTypars tps + let tpsR = copyTypars false tps let tyargsR = List.map mkTyparTy tpsR let tpenv = bindTypars tps tyargsR emptyTyparInst let rtyR = instType tpenv retTy @@ -8923,10 +9041,11 @@ let CompileAsEvent g attrs = HasFSharpAttribute g g.attrib_CLIEventAttribute att let MemberIsCompiledAsInstance g parent isExtensionMember (membInfo: ValMemberInfo) attrs = // All extension members are compiled as static members - if isExtensionMember then false - // Anything implementing a dispatch slot is compiled as an instance member - elif membInfo.MemberFlags.IsOverrideOrExplicitImpl then true - elif not (isNil membInfo.ImplementedSlotSigs) then true + if isExtensionMember then + false + // Abstract slots, overrides and interface impls are all true to IsInstance + elif membInfo.MemberFlags.IsDispatchSlot || membInfo.MemberFlags.IsOverrideOrExplicitImpl || not (isNil membInfo.ImplementedSlotSigs) then + membInfo.MemberFlags.IsInstance else // Otherwise check attributes to see if there is an explicit instance or explicit static flag let explicitInstance, explicitStatic = @@ -10240,3 +10359,4 @@ let isFSharpExceptionTy g ty = match tryTcrefOfAppTy g ty with | ValueSome tcref -> tcref.IsFSharpException | _ -> false + diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index acb6eee7361..62f76df7e64 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1480,11 +1480,7 @@ module DebugPrint = /// A set of function parameters (visitor) for folding over expressions type ExprFolder<'State> = - { exprIntercept: ('State -> Expr -> 'State) (* noInterceptF *) - -> ('State -> Expr -> 'State) - -> 'State - -> Expr - -> 'State (* recurseF *) + { exprIntercept: ('State -> Expr -> 'State) -> ('State -> Expr -> 'State) -> 'State -> Expr -> 'State valBindingSiteIntercept: 'State -> bool * Val -> 'State nonRecBindingsIntercept: 'State -> Binding -> 'State recBindingsIntercept: 'State -> Bindings -> 'State @@ -1496,10 +1492,10 @@ type ExprFolder<'State> = val ExprFolder0: ExprFolder<'State> /// Fold over all the expressions in an implementation file -val FoldImplFile: ExprFolder<'State> -> ('State -> CheckedImplFile -> 'State) +val FoldImplFile: ExprFolder<'State> -> 'State -> CheckedImplFile -> 'State /// Fold over all the expressions in an expression -val FoldExpr: ExprFolder<'State> -> ('State -> Expr -> 'State) +val FoldExpr: ExprFolder<'State> -> 'State -> Expr -> 'State #if DEBUG /// Extract some statistics from an expression @@ -2089,8 +2085,6 @@ val mkCallToInt16Operator: TcGlobals -> range -> TType -> Expr -> Expr val mkCallToUInt16Operator: TcGlobals -> range -> TType -> Expr -> Expr -val mkCallToIntOperator: TcGlobals -> range -> TType -> Expr -> Expr - val mkCallToInt32Operator: TcGlobals -> range -> TType -> Expr -> Expr val mkCallToUInt32Operator: TcGlobals -> range -> TType -> Expr -> Expr @@ -2382,7 +2376,8 @@ type StaticOptimizationAnswer = | No = -1y | Unknown = 0y -val DecideStaticOptimizations: TcGlobals -> StaticOptimization list -> haveWitnesses: bool -> StaticOptimizationAnswer +val DecideStaticOptimizations: + TcGlobals -> StaticOptimization list -> canDecideTyparEqn: bool -> StaticOptimizationAnswer val mkStaticOptimizationExpr: TcGlobals -> StaticOptimization list * Expr * Expr * range -> Expr @@ -2663,3 +2658,21 @@ val (|Seq|_|): TcGlobals -> Expr -> (Expr * TType) option /// Indicates if an F# type is the type associated with an F# exception declaration val isFSharpExceptionTy: g: TcGlobals -> ty: TType -> bool + +type TraitConstraintInfo with + + /// Get the argument types recorded in the member constraint suitable for building a TypedTree call. + member GetCompiledArgumentTypes: unit -> TType list + + /// Get the argument types when the trait is used as a first-class value "^T.TraitName" which can then be applied + member GetLogicalArgumentTypes: g: TcGlobals -> TType list + + member GetObjectType: unit -> TType option + + member GetReturnType: g: TcGlobals -> TType + + /// Get the name of the trait for textual call. + member MemberDisplayNameCore: string + + /// Get the key associated with the member constraint. + member GetWitnessInfo: unit -> TraitWitnessInfo diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 87308b2409e..a02afa72605 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1514,9 +1514,9 @@ let p_anonInfo x st = let p_trait_sln sln st = match sln with - | ILMethSln(a, b, c, d) -> + | ILMethSln(a, b, c, d, None) -> p_byte 0 st; p_tup4 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys (a, b, c, d) st - | FSMethSln(a, b, c) -> + | FSMethSln(a, b, c, None) -> p_byte 1 st; p_tup3 p_ty (p_vref "trait") p_tys (a, b, c) st | BuiltInSln -> p_byte 2 st @@ -1526,6 +1526,10 @@ let p_trait_sln sln st = p_byte 4 st; p_tup3 p_tys p_rfref p_bool (a, b, c) st | FSAnonRecdFieldSln(a, b, c) -> p_byte 5 st; p_tup3 p_anonInfo p_tys p_int (a, b, c) st + | ILMethSln(a, b, c, d, Some e) -> + p_byte 6 st; p_tup5 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys p_ty (a, b, c, d, e) st + | FSMethSln(a, b, c, Some d) -> + p_byte 7 st; p_tup4 p_ty (p_vref "trait") p_tys p_ty (a, b, c, d) st let p_trait (TTrait(a, b, c, d, e, f)) st = @@ -1544,10 +1548,10 @@ let u_trait_sln st = match tag with | 0 -> let a, b, c, d = u_tup4 u_ty (u_option u_ILTypeRef) u_ILMethodRef u_tys st - ILMethSln(a, b, c, d) + ILMethSln(a, b, c, d, None) | 1 -> let a, b, c = u_tup3 u_ty u_vref u_tys st - FSMethSln(a, b, c) + FSMethSln(a, b, c, None) | 2 -> BuiltInSln | 3 -> @@ -1558,6 +1562,12 @@ let u_trait_sln st = | 5 -> let a, b, c = u_tup3 u_anonInfo u_tys u_int st FSAnonRecdFieldSln(a, b, c) + | 6 -> + let a, b, c, d, e = u_tup5 u_ty (u_option u_ILTypeRef) u_ILMethodRef u_tys u_ty st + ILMethSln(a, b, c, d, Some e) + | 7 -> + let a, b, c, d = u_tup4 u_ty u_vref u_tys u_ty st + FSMethSln(a, b, c, Some d) | _ -> ufailwith st "u_trait_sln" let u_trait st = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 9e859307710..065172f640c 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -680,7 +680,7 @@ signatureFile: moduleIntro: | moduleKeyword opt_attributes opt_access opt_rec path { if not (isNil $2) then - parseState.LexBuffer.CheckLanguageFeatureErrorRecover LanguageFeature.AttributesToRightOfModuleKeyword <| rhs parseState 4 + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AttributesToRightOfModuleKeyword (rhs parseState 4) let mModule = rhs parseState 1 mModule, $4, $5.LongIdent, $3, $2 } @@ -994,7 +994,9 @@ tyconSpfnRhs: | DELEGATE OF topType { let m = lhs parseState let ty, arity = $3 - let invoke = SynMemberSig.Member(SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero), AbstractMemberFlags SynMemberFlagsTrivia.Zero SynMemberKind.Member, m) + let flags = AbstractMemberFlags true SynMemberFlagsTrivia.Zero SynMemberKind.Member + let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero) + let invoke = SynMemberSig.Member(valSig, flags, m) (fun nameRange nameInfo mEquals augmentation -> if not (isNil augmentation) then raiseParseErrorAt m (FSComp.SR.parsAugmentationsIllegalOnDelegateType()) let mWhole = unionRanges nameRange m @@ -1081,9 +1083,10 @@ classMemberSpfn: match optLiteralValue with | None -> m | Some e -> unionRanges m e.Range - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals }) - let _, flags = $3 - SynMemberSig.Member(valSpfn, flags (getSetAdjuster arity), mWhole) } + let trivia = { ValKeyword = None; WithKeyword = mWith; EqualsRange = mEquals } + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, trivia) + let flags = $3 (getSetAdjuster arity) + SynMemberSig.Member(valSpfn, flags, mWhole) } | opt_attributes opt_declVisibility interfaceMember appType { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) @@ -1156,13 +1159,7 @@ classMemberSpfnGetSetElements: memberSpecFlags: | memberFlags { $1 } - | ABSTRACT - { let mAbstract = rhs parseState 1 - (false, AbstractMemberFlags(AbstractSynMemberFlagsTrivia mAbstract)) } - | ABSTRACT MEMBER - { let mAbstract = rhs parseState 1 - let mMember = rhs parseState 2 - (false, AbstractMemberFlags(AbstractMemberSynMemberFlagsTrivia mAbstract mMember)) } + | abstractMemberFlags { $1 } /* Part of an exception definition in a signature file */ @@ -1598,16 +1595,16 @@ memberFlags: | STATIC MEMBER { let mStatic = rhs parseState 1 let mMember = rhs parseState 2 - (true, StaticMemberFlags(StaticMemberSynMemberFlagsTrivia mStatic mMember)) } + StaticMemberFlags(StaticMemberSynMemberFlagsTrivia mStatic mMember) } | MEMBER { let mMember = rhs parseState 1 - (false, NonVirtualMemberFlags(MemberSynMemberFlagsTrivia mMember)) } + NonVirtualMemberFlags(MemberSynMemberFlagsTrivia mMember) } | OVERRIDE { let mOverride = rhs parseState 1 - (false, OverrideMemberFlags(OverrideSynMemberFlagsTrivia mOverride)) } + OverrideMemberFlags(OverrideSynMemberFlagsTrivia mOverride) } | DEFAULT { let mDefault = rhs parseState 1 - (false, OverrideMemberFlags(DefaultSynMemberFlagsTrivia mDefault)) } + OverrideMemberFlags(DefaultSynMemberFlagsTrivia mDefault) } /* The name of a type in a signature or implementation, possibly with type parameters and constraints */ typeNameInfo: @@ -1743,8 +1740,9 @@ tyconDefnRhs: { let m = lhs parseState let ty, arity = $3 (fun nameRange augmentation -> - let valSpfn = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero) - let invoke = SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags SynMemberFlagsTrivia.Zero SynMemberKind.Member, m) + let valSig = SynValSig([], (SynIdent(mkSynId m "Invoke", None)), inferredTyparDecls, ty, arity, false, false, PreXmlDoc.Empty, None, None, m, SynValSigTrivia.Zero) + let flags = AbstractMemberFlags true SynMemberFlagsTrivia.Zero SynMemberKind.Member + let invoke = SynMemberDefn.AbstractSlot(valSig, flags, m) if not (isNil augmentation) then raiseParseErrorAt m (FSComp.SR.parsAugmentationsIllegalOnDelegateType()) SynTypeDefnRepr.ObjectModel (SynTypeDefnKind.Delegate (ty, arity), [invoke], m), []) } @@ -1841,6 +1839,7 @@ classDefnMemberGetSet: classDefnMemberGetSetElements: | classDefnMemberGetSetElement { [$1], None } + | classDefnMemberGetSetElement AND classDefnMemberGetSetElement { let mAnd = rhs parseState 2 [$1;$3], Some mAnd } @@ -1877,16 +1876,34 @@ memberCore: let optPropertyType = $3 mkSynMemberDefnGetSet parseState $1 mWith classDefnMemberGetSetElements mAnd mWhole propertyNameBindingPat optPropertyType } - abstractMemberFlags: | ABSTRACT { let mAbstract = rhs parseState 1 - AbstractSynMemberFlagsTrivia mAbstract } - | ABSTRACT MEMBER + AbstractMemberFlags true (AbstractSynMemberFlagsTrivia mAbstract) } + + | ABSTRACT MEMBER { let mAbstract = rhs parseState 1 let mMember = rhs parseState 2 - AbstractMemberSynMemberFlagsTrivia mAbstract mMember } - + AbstractMemberFlags true (AbstractMemberSynMemberFlagsTrivia mAbstract mMember) } + + | STATIC ABSTRACT + { let mWhole = rhs2 parseState 1 2 + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.InterfacesWithAbstractStaticMembers mWhole + if parseState.LexBuffer.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + warning(Error(FSComp.SR.tcUsingInterfacesWithStaticAbstractMethods(), mWhole)) + let mStatic = rhs parseState 1 + let mAbstract = rhs parseState 2 + AbstractMemberFlags false (StaticAbstractSynMemberFlagsTrivia mStatic mAbstract) } + + | STATIC ABSTRACT MEMBER + { let mWhole = rhs2 parseState 1 2 + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.InterfacesWithAbstractStaticMembers mWhole + if parseState.LexBuffer.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers then + warning(Error(FSComp.SR.tcUsingInterfacesWithStaticAbstractMethods(), mWhole)) + let mStatic = rhs parseState 1 + let mAbstract = rhs parseState 2 + let mMember = rhs parseState 3 + AbstractMemberFlags false (StaticAbstractMemberSynMemberFlagsTrivia mStatic mAbstract mMember) } /* A member definition */ classDefnMember: @@ -1902,7 +1919,7 @@ classDefnMember: { let rangeStart = rhs parseState 1 if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) - let _, flags = $3 + let flags = $3 $4 $2 flags $1 rangeStart } | opt_attributes opt_declVisibility interfaceMember appType opt_interfaceImplDefn @@ -1926,8 +1943,9 @@ classDefnMember: | Some m2 -> unionRanges m m2 |> unionRangeWithXmlDoc doc if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) - let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, { ValKeyword = None; WithKeyword = mWith; EqualsRange = None }) - [ SynMemberDefn.AbstractSlot(valSpfn, AbstractMemberFlags $3 (getSetAdjuster arity), mWhole) ] } + let trivia = { ValKeyword = None; WithKeyword = mWith; EqualsRange = None } + let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, trivia) + [ SynMemberDefn.AbstractSlot(valSpfn, $3 (getSetAdjuster arity), mWhole) ] } | opt_attributes opt_declVisibility inheritsDefn { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalOnInherit(), rhs parseState 1)) @@ -1948,8 +1966,8 @@ classDefnMember: { let rangeStart = rhs parseState 1 if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) - let isStatic, flags = $3 - $4 $1 isStatic flags rangeStart } + let flags = $3 + $4 $1 flags rangeStart } | opt_attributes opt_declVisibility NEW atomicPattern optAsSpec EQUALS typedSequentialExprBlock opt_ODECLEND { let mWholeBindLhs = rhs2 parseState 1 (if Option.isSome $5 then 5 else 4) @@ -1989,11 +2007,13 @@ autoPropsDefnDecl: let mEquals = rhs parseState 6 if $2 then errorR (Error (FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSet (), rhs parseState 3)) - (fun attribs isStatic flags rangeStart -> + (fun attribs flags rangeStart -> let xmlDoc = grabXmlDocAtRangeStart(parseState, attribs, rangeStart) let memberRange = unionRanges rangeStart $7.Range |> unionRangeWithXmlDoc xmlDoc - [ SynMemberDefn.AutoProperty(attribs, isStatic, $4, $5, getSet, flags, xmlDoc, $3, mEquals, $7, mWith, mGetSetOpt, memberRange) ]) } - + let memberFlags = flags SynMemberKind.Member + let memberFlagsForSet = flags SynMemberKind.PropertySet + let isStatic = not memberFlags.IsInstance + [ SynMemberDefn.AutoProperty(attribs, isStatic, $4, $5, getSet, memberFlags, memberFlagsForSet, xmlDoc, $3, mEquals, $7, mWith, mGetSetOpt, memberRange) ]) } /* An optional type on an auto-property definition */ opt_typ: @@ -2152,28 +2172,32 @@ objectImplementationMembers: /* One member in an object expression or interface implementation */ objectImplementationMember: - | opt_attributes memberOrOverride memberCore opt_ODECLEND + | opt_attributes staticMemberOrMemberOrOverride memberCore opt_ODECLEND { let rangeStart = rhs parseState 1 - $3 None (OverrideMemberFlags $2) $1 rangeStart } + $3 None $2 $1 rangeStart } - | opt_attributes memberOrOverride autoPropsDefnDecl opt_ODECLEND + | opt_attributes staticMemberOrMemberOrOverride autoPropsDefnDecl opt_ODECLEND { let rangeStart = rhs parseState 1 - $3 $1 false (OverrideMemberFlags $2) rangeStart } + $3 $1 $2 rangeStart } - | opt_attributes memberOrOverride error + | opt_attributes staticMemberOrMemberOrOverride error { [] } | opt_attributes error memberCore opt_ODECLEND { [] } -memberOrOverride: +staticMemberOrMemberOrOverride: + | STATIC MEMBER + { let mStatic = rhs parseState 1 + let mMember = rhs parseState 2 + ImplementStaticMemberFlags(StaticMemberSynMemberFlagsTrivia mStatic mMember) } | MEMBER { let mMember = rhs parseState 1 - MemberSynMemberFlagsTrivia mMember } + OverrideMemberFlags(MemberSynMemberFlagsTrivia mMember) } | OVERRIDE { let mOverride = rhs parseState 1 - OverrideSynMemberFlagsTrivia mOverride } + OverrideMemberFlags(OverrideSynMemberFlagsTrivia mOverride) } /* The core of the right-hand-side of a simple type definition */ @@ -2369,7 +2393,7 @@ typeConstraint: { let tp = $1 SynTypeConstraint.WhereTyparSupportsMember([ SynType.Var(tp, tp.Range) ], $4, lhs parseState) } - | LPAREN typarAlts rparen COLON LPAREN classMemberSpfn rparen + | LPAREN typeAlts rparen COLON LPAREN classMemberSpfn rparen { SynTypeConstraint.WhereTyparSupportsMember(List.rev($2), $6, lhs parseState) } | typar COLON DELEGATE typeArgsNoHpaDeprecated @@ -2390,8 +2414,11 @@ typeConstraint: | "unmanaged" -> SynTypeConstraint.WhereTyparIsUnmanaged($1, lhs parseState) | nm -> raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedIdentifier(nm)) } -typarAlts: - | typarAlts OR appType + | appType + { SynTypeConstraint.WhereSelfConstrained($1, lhs parseState) } + +typeAlts: + | typeAlts OR appType { $3 :: $1 } | appType @@ -3963,7 +3990,7 @@ declExpr: { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression(">")) exprFromParseError(mkSynInfix (rhs parseState 2) $1 ">" (arbExpr("declExprInfix", (rhs parseState 3).StartRange))) } - | declExpr INFIX_AT_HAT_OP OBLOCKEND_COMING_SOON + | declExpr INFIX_AT_HAT_OP OBLOCKEND_COMING_SOON %prec infix_at_hat_op_binary { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression($2)) exprFromParseError(mkSynInfix (rhs parseState 2) $1 $2 (arbExpr("declExprInfix", (rhs parseState 3).StartRange))) } @@ -4016,13 +4043,6 @@ declExpr: { let m = rhs parseState 1 SynExpr.IndexRange(None, m, None, m, m, m) } - | INFIX_AT_HAT_OP declExpr - { if not (parseState.LexBuffer.SupportsFeature LanguageFeature.FromEndSlicing) then - raiseParseErrorAt (rhs parseState 1) (FSComp.SR.fromEndSlicingRequiresVFive()) - if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidPrefixOperator()) - let m = (rhs2 parseState 1 2) - SynExpr.IndexFromEnd($2, m) } - | minusExpr %prec expr_prefix_plus_minus { $1 } dynamicArg: @@ -4215,6 +4235,11 @@ tupleExpr: [arbExpr ("tupleExpr4", commaRange.EndRange); arbExpr ("tupleExpr5", commaRange.StartRange)], [commaRange] } minusExpr: + | INFIX_AT_HAT_OP minusExpr + { if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidPrefixOperator()) + let m = (rhs2 parseState 1 2) + SynExpr.IndexFromEnd($2, m) } + | MINUS minusExpr %prec expr_prefix_plus_minus { mkSynPrefix (rhs parseState 1) (unionRanges (rhs parseState 1) $2.Range) "~-" $2 } @@ -4263,7 +4288,7 @@ appExpr: | appExpr argExpr %prec expr_app { SynExpr.App (ExprAtomicFlag.NonAtomic, false, $1, $2, unionRanges $1.Range $2.Range) } - | atomicExpr + | atomicExpr { let arg, _ = $1 arg } @@ -4301,6 +4326,12 @@ atomicExpr: if not (IsValidPrefixOperatorUse $1) then reportParseErrorAt arg2.Range (FSComp.SR.parsInvalidPrefixOperator()) mkSynPrefixPrim (rhs parseState 1) (unionRanges (rhs parseState 1) arg2.Range) $1 arg2, hpa2 } + | QUOTE ident + { let id = mkSynId (lhs parseState) ($2).idText + let typar = SynTypar(id, TyparStaticReq.None, false) + let lhsm = rhs2 parseState 1 2 + SynExpr.Typar(typar, lhsm), false } + | atomicExpr DOT atomicExprQualification { let arg1, hpa1 = $1 $3 arg1 (lhs parseState) (rhs parseState 2), hpa1 } @@ -4547,7 +4578,7 @@ parenExpr: //arbExpr("parenExpr2", mLhs) } parenExprBody: - | staticallyKnownHeadTypars COLON LPAREN classMemberSpfn rparen typedSequentialExpr + | typars COLON LPAREN classMemberSpfn rparen typedSequentialExpr { (fun m -> SynExpr.TraitCall ($1, $4, $6, m)) } /* disambiguate: x $a.id(x) */ | typedSequentialExpr @@ -4556,19 +4587,19 @@ parenExprBody: | inlineAssemblyExpr { $1 } -staticallyKnownHeadTypars: - | staticallyKnownHeadTypar - { [$1] } +typars: + | typar + { [SynType.Var($1, rhs parseState 1)] } - | LPAREN staticallyKnownHeadTyparAlts rparen + | LPAREN typarAlts rparen { List.rev $2 } -staticallyKnownHeadTyparAlts: - | staticallyKnownHeadTyparAlts OR staticallyKnownHeadTypar +typarAlts: + | typarAlts OR appType {$3 :: $1} - | staticallyKnownHeadTypar - { [$1] } + | typar + { [SynType.Var($1, rhs parseState 1)] } braceExpr: | LBRACE braceExprBody rbrace @@ -5448,12 +5479,8 @@ typar: { let id = mkSynId (lhs parseState) ($2).idText SynTypar(id, TyparStaticReq.None, false) } - | staticallyKnownHeadTypar - { $1 } - -staticallyKnownHeadTypar: | INFIX_AT_HAT_OP ident - { if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedTypeParameter()); + { if $1 <> "^" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.tcUnexpectedSymbolInTypeExpression($1)); let id = mkSynId (lhs parseState) ($2).idText SynTypar(id, TyparStaticReq.HeadType, false) } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 0274845f194..e712bcb1297 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -187,6 +187,11 @@ Notace expr[idx] pro indexování a vytváření řezů + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ obnovitelné stavové stroje + + self type constraints + self type constraints + + single underscore pattern vzor s jedním podtržítkem @@ -542,6 +552,16 @@ Neočekávaný token v definici typu. Za typem {0} se očekává =. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ Konstruktor {0} je možné použít jenom v platném obnovitelném kódu. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions Použití [<Struct>] u hodnot, funkcí a metod je povolené jenom u částečných aktivních definic vzorů. @@ -887,11 +912,46 @@ Tento výraz implicitně převede typ {0} na typ {1}. Přečtěte si téma https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Neplatný interpolovaný řetězec. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Člen rozhraní {0} nemá nejvíce specifickou implementaci. @@ -3162,11 +3222,6 @@ Neočekávaný celočíselný literál ve výrazu měrné jednotky - - Syntax error: unexpected type parameter specification - Chyba syntaxe: neočekávaná specifikace parametru typu - - Mismatched quotation operator name, beginning with '{0}' Neshoda v názvu operátoru citace (začíná na {0}) diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index d252f75a423..ffe291bbca1 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -187,6 +187,11 @@ expr[idx]-Notation zum Indizieren und Aufteilen + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ Fortsetzbarer Zustand-Maschinen + + self type constraints + self type constraints + + single underscore pattern Muster mit einzelnem Unterstrich @@ -542,6 +552,16 @@ Unerwartetes Token in Typdefinition. Nach Typ "{0}" wurde "=" erwartet. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ Das Konstrukt "{0}" darf nur in einem gültigen fortsetzbaren Code verwendet werden. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions Die Verwendung von "[<Struct>]" für Werte, Funktionen und Methoden ist nur für partielle aktive Musterdefinitionen zulässig. @@ -887,11 +912,46 @@ Dieser Ausdruck konvertiert den Typ "{0}" implizit in den Typ "{1}". Siehe https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Ungültige interpolierte Zeichenfolge. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Der Schnittstellenmember "{0}" weist keine spezifischste Implementierung auf. @@ -3162,11 +3222,6 @@ Unerwartetes Integer-Literal in Maßeinheitenausdruck. - - Syntax error: unexpected type parameter specification - Syntaxfehler: Unerwartete Typparameterangabe. - - Mismatched quotation operator name, beginning with '{0}' Anführungszeichen-Operatorname stimmt nicht überein, beginnt mit "{0}". diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 17871b3624a..459051b3ef0 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -187,6 +187,11 @@ Notación para indexación y segmentación expr[idx] + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ máquinas de estado reanudables + + self type constraints + self type constraints + + single underscore pattern patrón de subrayado simple @@ -542,6 +552,16 @@ Token inesperado en la definición de tipo. Se esperaba "=" después del tipo "{0}". + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ La construcción "{0}" solo se puede usar en un código reanudable válido. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions El uso de «[<Struct>]» en valores, funciones y métodos solo se permite en definiciones de modelos activos parciales. @@ -887,11 +912,46 @@ Esta expresión convierte implícitamente el tipo '{0}' al tipo '{1}'. Consulte https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Cadena interpolada no válida. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. El miembro de interfaz "{0}" no tiene una implementación más específica. @@ -3162,11 +3222,6 @@ Literal entero inesperado en una expresión de unidad de medida. - - Syntax error: unexpected type parameter specification - Error de sintaxis: especificación de parámetro de tipo inesperada. - - Mismatched quotation operator name, beginning with '{0}' Falta el elemento de clausura en un nombre de operador de expresión de código delimitada que comienza con '{0}'. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 6705cdcb761..1f669e7d4ae 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -187,6 +187,11 @@ Notation expr[idx] pour l’indexation et le découpage + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ ordinateurs d’état pouvant être repris + + self type constraints + self type constraints + + single underscore pattern modèle de trait de soulignement unique @@ -542,6 +552,16 @@ Jeton inattendu dans la définition de type. Signe '=' attendu après le type '{0}'. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ La construction «{0}» ne peut être utilisée que dans un code pouvant être repris valide. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions L’utilisation de' [<Struct>] 'sur les valeurs, les fonctions et les méthodes n’est autorisée que sur les définitions de modèle actif partiel @@ -887,11 +912,46 @@ Cette expression convertit implicitement le type « {0} » en type « {1} ». Voir https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Chaîne interpolée non valide. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Le membre d'interface '{0}' n'a pas l'implémentation la plus spécifique. @@ -3162,11 +3222,6 @@ Littéral d'entier inattendu dans l'expression de l'unité de mesure - - Syntax error: unexpected type parameter specification - Erreur de syntaxe : spécification du paramètre de type inattendue - - Mismatched quotation operator name, beginning with '{0}' Incompatibilité du nom d'opérateur de quotation, qui commence par '{0}' diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 26e67bcd381..aed66eb98cc 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -187,6 +187,11 @@ Notazione expr[idx] per l'indicizzazione e il sezionamento + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ macchine a stati ripristinabili + + self type constraints + self type constraints + + single underscore pattern criterio per carattere di sottolineatura singolo @@ -542,6 +552,16 @@ Token imprevisto nella definizione del tipo. Dopo il tipo '{0}' è previsto '='. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ Il costrutto '{0}' può essere usato solo in codice ripristinabile valido. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions L'utilizzo di '[<Struct>]' su valori, funzioni e metodi è consentito solo per definizioni di criteri attivi parziali @@ -887,11 +912,46 @@ Questa espressione converte in modo implicito il tipo '{0}' nel tipo '{1}'. Vedere https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} La stringa interpolata non è valida. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Il membro di interfaccia '{0}' non contiene un'implementazione più specifica. @@ -3162,11 +3222,6 @@ Valore letterale Integer non previsto in espressione di unità di misura - - Syntax error: unexpected type parameter specification - Errore di sintassi: specifica di parametro di tipo non prevista - - Mismatched quotation operator name, beginning with '{0}' Nome operatore di quotation non corrispondente con '{0}' iniziale diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 65af4937797..a718b4ec986 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -187,6 +187,11 @@ インデックス作成とスライス用の expr[idx] 表記 + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ 再開可能なステート マシン + + self type constraints + self type constraints + + single underscore pattern 単一のアンダースコア パターン @@ -542,6 +552,16 @@ 型定義に予期しないトークンがあります。型 '{0}' の後には '=' が必要です。 + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ コンストラクト '{0}' は、有効な再開可能コードでのみ使用できます。 + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions 値、関数、およびメソッドでの '[<Struct>]' は、部分的なアクティブ パターンの定義でのみ使うことができます @@ -887,11 +912,46 @@ この式は、型 '{0}' を型 '{1}' に暗黙的に変換します。https://aka.ms/fsharp-implicit-convs を参照してください。 + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} 補間された文字列が無効です。{0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. インターフェイス メンバー '{0}' には最も固有な実装がありません。 @@ -3162,11 +3222,6 @@ 単位式に予期しない整数リテラルが見つかりました - - Syntax error: unexpected type parameter specification - 構文エラー: 予期しない型パラメーターが指定されました - - Mismatched quotation operator name, beginning with '{0}' '{0}' で始まる演算子名の引用符が対応しません diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 72b63d1aa2e..4c651461002 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -187,6 +187,11 @@ 인덱싱 및 슬라이싱을 위한 expr[idx] 표기법 + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ 다시 시작 가능한 상태 시스템 + + self type constraints + self type constraints + + single underscore pattern 단일 밑줄 패턴 @@ -542,6 +552,16 @@ 형식 정의에 예기치 않은 토큰이 있습니다. '{0}' 형식 뒤에 '='가 필요합니다. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ '{0}' 구문은 유효한 다시 시작 가능한 코드에서만 사용할 수 있습니다. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions 값, 함수 및 메서드에 '[<Struct>]'을(를) 사용하는 것은 부분 활성 패턴 정의에서만 허용됩니다. @@ -887,11 +912,46 @@ 이 식은 암시적으로 '{0}' 형식을 '{1}' 형식으로 변환 합니다. https://aka.ms/fsharp-implicit-convs 참조 + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} 잘못된 보간 문자열. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. 인터페이스 멤버 '{0}'에 가장 한정적인 구현이 없습니다. @@ -3162,11 +3222,6 @@ 측정 단위 식에 예기치 않은 정수 리터럴이 있습니다. - - Syntax error: unexpected type parameter specification - 구문 오류: 예기치 않은 형식 매개 변수 지정입니다. - - Mismatched quotation operator name, beginning with '{0}' 짝이 맞지 않는 인용구 연산자 이름('{0}'(으)로 시작)입니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index d9a2fb6441d..3fe6c74d31a 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -187,6 +187,11 @@ notacja wyrażenia expr[idx] do indeksowania i fragmentowania + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ automaty stanów z możliwością wznowienia + + self type constraints + self type constraints + + single underscore pattern wzorzec z pojedynczym podkreśleniem @@ -542,6 +552,16 @@ Nieoczekiwany token w definicji typu. Oczekiwano znaku „=” po typie „{0}”. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ Konstrukcji "{0}" można używać tylko w prawidłowym kodzie z możliwością wznowienia. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions Używanie elementu "[<Struct>]" na wartościach, funkcjach i metodach jest dozwolone tylko w definicjach częściowo aktywnego wzorca @@ -887,11 +912,46 @@ To wyrażenie bezwzględnie konwertuje typ "{0}" na typ "{1}". Zobacz https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Nieprawidłowy ciąg interpolowany. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Składowa interfejsu „{0}” nie ma najbardziej specyficznej implementacji. @@ -3162,11 +3222,6 @@ Nieoczekiwany literał całkowity w wyrażeniu jednostki miary - - Syntax error: unexpected type parameter specification - Błąd składni: nieoczekiwana specyfikacja parametru typu - - Mismatched quotation operator name, beginning with '{0}' Niezgodna nazwa operatora cytatu, począwszy od „{0}” diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 581a7f5fbd2..6823a8b62c4 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -187,6 +187,11 @@ notação expr[idx] para indexação e fatia + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ máquinas de estado retomável + + self type constraints + self type constraints + + single underscore pattern padrão de sublinhado simples @@ -542,6 +552,16 @@ Token inesperado na definição de tipo. Esperava-se '=' após o tipo '{0}'. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ A construção '{0}' só pode ser usada em código válido e retomável. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions O uso de '[<Struct>]' em valores, funções e métodos somente é permitido em definições de padrões ativos parciais @@ -887,11 +912,46 @@ Essa expressão converte implicitamente o tipo '{0}' ao tipo '{1}'. Consulte https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Cadeia de caracteres interpolada inválida. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. O membro de interface '{0}' não tem uma implementação mais específica. @@ -3162,11 +3222,6 @@ Literal de inteiro inesperado na expressão de unidade de medida - - Syntax error: unexpected type parameter specification - Erro de sintaxe: especificação de parâmetro de tipo inesperada - - Mismatched quotation operator name, beginning with '{0}' Nome de operador de cotação incompatível, começando com '{0}' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index fd9829a3faa..babbf9d24d8 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -187,6 +187,11 @@ expr[idx] для индексации и среза + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ возобновляемые конечные автоматы + + self type constraints + self type constraints + + single underscore pattern шаблон с одним подчеркиванием @@ -542,6 +552,16 @@ Неожиданный токен в определении типа. После типа "{0}" ожидается "=". + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ Конструкция "{0}" может использоваться только в допустимом возобновляемом коде. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions Использование "[<Struct>]" для значений, функций и методов разрешено только для определений частичных активных шаблонов @@ -887,11 +912,46 @@ Это выражение неявно преобразует тип "{0}" в тип "{1}". См. сведения на странице https://aka.ms/fsharp-implicit-convs. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Недопустимая интерполированная строка. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. Элемент интерфейса "{0}" не имеет наиболее конкретной реализации. @@ -3162,11 +3222,6 @@ Недопустимый целочисленный литерал в выражении единицы измерения - - Syntax error: unexpected type parameter specification - Синтаксическая ошибка: недопустимая спецификация параметра типа - - Mismatched quotation operator name, beginning with '{0}' Несоответствующее имя оператора кавычки, начиная с "{0}" diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 6e5ab25c917..89d55c0c123 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -187,6 +187,11 @@ Dizin oluşturma ve dilimleme için expr[idx] gösterimi + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ sürdürülebilir durum makineleri + + self type constraints + self type constraints + + single underscore pattern tek alt çizgi deseni @@ -542,6 +552,16 @@ Tür tanımında beklenmeyen belirteç var. '{0}' türünden sonra '=' bekleniyordu. + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ '{0}' yapısı yalnızca geçerli sürdürülebilir kodda kullanılabilir. + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions Değerlerde, işlevlerde ve yöntemlerde '[<Struct>]' kullanımına yalnızca kısmi etkin desen tanımlarında izin veriliyor @@ -887,11 +912,46 @@ Bu ifade '{0}' türünü örtülü olarak '{1}' türüne dönüştürür. https://aka.ms/fsharp-implicit-convs adresine bakın. + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} Geçersiz düz metin arasına kod eklenmiş dize. {0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. '{0}' arabirim üyesinin en belirgin uygulaması yok. @@ -3162,11 +3222,6 @@ Ölçü birimi ifadesinde beklenmeyen tamsayı sabit değeri - - Syntax error: unexpected type parameter specification - Sözdizimi hatası: beklenmeyen tür parametresi belirtimi - - Mismatched quotation operator name, beginning with '{0}' '{0}' ile başlayan, eşleşmeyen alıntı işleci adı diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 2dcc9052685..c5c09c1a656 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -187,6 +187,11 @@ 用于索引和切片的 expr[idx] 表示法 + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ 可恢复状态机 + + self type constraints + self type constraints + + single underscore pattern 单下划线模式 @@ -542,6 +552,16 @@ 类型定义中出现意外标记。类型“{0}”后应为 "="。 + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ 构造 "{0}" 只能在有效的可恢复代码中使用。 + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions 只允许在部分活动模式定义中对值、函数和方法使用 "[<Struct>]" @@ -887,11 +912,46 @@ 此表达式将类型“{0}”隐式转换为类型“{1}”。请参阅 https://aka.ms/fsharp-implicit-convs。 + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} 内插字符串无效。{0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. 接口成员“{0}”没有最具体的实现。 @@ -3162,11 +3222,6 @@ 度量单位表达式中意外的整数文本 - - Syntax error: unexpected type parameter specification - 语法错误: 意外的类型参数规范 - - Mismatched quotation operator name, beginning with '{0}' 不匹配的引用运算符名称(以“{0}”开头) diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 29accc26a8e..1a9b21cff11 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -187,6 +187,11 @@ 用於編製索引和分割的 expr[idx] 註釋 + + static abstract interface members + static abstract interface members + + support for consuming init properties support for consuming init properties @@ -272,6 +277,11 @@ 可繼續的狀態機器 + + self type constraints + self type constraints + + single underscore pattern 單一底線模式 @@ -542,6 +552,16 @@ 型別定義中出現非預期的權杖。類型 '{0}' 之後應該要有 '='。 + + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + + + + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + + Expecting expression Expecting expression @@ -752,6 +772,11 @@ 建構 '{0}' 只能用於有效的可繼續程式碼。 + + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + + The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions 只允許在部分現用模式定義上對值、函式和方法使用 '[<Struct>]' @@ -887,11 +912,46 @@ 此運算式將類型 '{0}' 隱含轉換為類型 '{1}'。請參閱 https://aka.ms/fsharp-implicit-convs。 + + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + + + + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + + + + Trait '{0}' is not static + Trait '{0}' is not static + + + + Trait '{0}' is static + Trait '{0}' is static + + + + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + + Invalid interpolated string. {0} 插補字串無效。{0} + + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + + + + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + + Interface member '{0}' does not have a most specific implementation. 介面成員 '{0}' 沒有最具體的實作。 @@ -3162,11 +3222,6 @@ 測量單位運算式中未預期的整數常值 - - Syntax error: unexpected type parameter specification - 語法錯誤: 未預期的型別參數規格 - - Mismatched quotation operator name, beginning with '{0}' 不相符的引號運算子名稱,以 '{0}' 開頭 diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 5fcd59b4375..9d67b00e5bc 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -4,14 +4,15 @@ Library - netstandard2.0 + netstandard2.0 + netstandard2.0 FSharp.Build $(NoWarn);75 true $(DefineConstants);LOCALIZATION_FSBUILD NU1701;FS0075 true - 6.0 + 6.0 Debug;Release;Proto @@ -58,7 +59,7 @@ The FSharp.Build built here may be loaded directly into a shipped Visual Studio, to that end, we cannot rely on new API's just being added to FSharp.Core. --> - + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs index b31c2d07bb1..aa8cddcba33 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs @@ -39,7 +39,7 @@ module SymbolicOperators = |> compile |> shouldFail |> withErrorCode 0670 - |> withDiagnosticMessageMatches " \^a\) could not be generalized because it would escape its scope" + |> withDiagnosticMessageMatches " \^a\) could not be generalized because it would escape its scope" |> ignore // This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/SymbolicOperators) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs new file mode 100644 index 00000000000..7ff2a44aaf1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -0,0 +1,831 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +module FSharp.Compiler.ComponentTests.Conformance.TypeAndTypeConstraints.IWSAMsAndSRTPs + +open Xunit +open System.IO +open FSharp.Test +open FSharp.Test.Compiler + +let typesModule = + FSharp (loadSourceFromFile (Path.Combine(__SOURCE_DIRECTORY__, "Types.fs"))) + |> withName "Types" + |> withLangVersionPreview + |> withOptions ["--nowarn:3535"] + +let setupCompilation compilation = + compilation + |> asExe + |> withLangVersionPreview + |> withReferences [typesModule] + + +#if !NETCOREAPP +[] +#else +[] +#endif +let ``IWSAM test files`` compilation = + compilation + |> setupCompilation + |> compileAndRun + |> shouldSucceed + +[] +[ ^T")>] +[ 'T")>] + +[ int when ^T: (static member A: int)")>] + +[ int when (^T or int) : (static member A: int)")>] + +[ int when (^U or ^T) : (static member A: int)")>] + +[ unit")>] +[ unit when ^T: (byte|int16|int32|int64|sbyte|uint16|uint32|uint64|nativeint|unativeint)")>] +[ uint32) (value)) + let inline uint value = uint32 value""", + "val inline uint: value: ^a -> uint32 when ^a: (static member op_Explicit: ^a -> uint32)")>] + +[ 'a -> int) -> x: 'a -> y: 'a -> bool")>] +let ``Check static type parameter inference`` code expectedSignature = + FSharp code + |> ignoreWarnings + |> withLangVersionPreview + |> signaturesShouldContain expectedSignature + + +[] +let ``Static type parameter inference in version 6`` () = + FSharp """ + let inline f0 (x: ^T) = x + let g0 (x: 'T) = f0 x""" + |> withLangVersion60 + |> signaturesShouldContain "val g0: x: obj -> obj" + + +module ``Equivalence of properties and getters`` = + + [] + [() = (^T : (static member StaticProperty: int) ())")>] + [ int) >() = (^T : (static member get_StaticProperty: unit -> int) ())")>] + [ int) >() = (^T : (static member StaticProperty: int) ())")>] + [() = (^T : (static member get_StaticProperty: unit -> int) ())")>] + [() = 'T.StaticProperty")>] + let ``Static property getter`` code = + Fsx code + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static int32 f_StaticProperty() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of get_StaticProperty is not su" + + "pported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static int32 f_StaticProperty$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 get_StaticProperty) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: tail. + IL_0004: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0009: ret + }"""] + + [] + [() = (^T : (static member StaticProperty: int with set) (3))")>] + [ unit) >() = (^T : (static member set_StaticProperty: int -> unit) (3))")>] + [ unit) >() = (^T : (static member StaticProperty: int with set) (3))")>] + [() = (^T : (static member set_StaticProperty: int -> unit) (3))")>] + [() = 'T.set_StaticProperty(3)")>] + let ``Static property setter`` code = + Fsx code + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static void f_set_StaticProperty() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of set_StaticProperty is not su" + + "pported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static void f_set_StaticProperty$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 set_StaticProperty) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.3 + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: pop + IL_0008: ret + }"""] + + [] + [(x: 'T) = (^T : (member Length: int) (x))")>] + [ int) >(x: 'T) = (^T : (member get_Length: unit -> int) (x))")>] + [ int) >(x: 'T) = (^T : (member Length: int) (x))")>] + [(x: 'T) = (^T : (member get_Length: unit -> int) (x))")>] + [(x: 'T) = x.Length")>] + let ``Instance property getter`` code = + Fsx code + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static int32 f_Length(!!T x) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of get_Length is not supported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static int32 f_Length$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 get_Length, + !!T x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: tail. + IL_0004: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0009: ret + }"""] + + [] + [(x: 'T) = (^T : (member Length: int with set) (x, 3))")>] + [ unit) >(x: 'T) = (^T : (member set_Length: int -> unit) (x, 3))")>] + [ unit) >(x: 'T) = (^T : (member Length: int with set) (x, 3))")>] + [(x: 'T) = (^T : (member set_Length: int -> unit) (x, 3))")>] + [(x: 'T) = x.set_Length(3)")>] + let ``Instance property setter`` code = + Fsx code + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static void f_set_Length(!!T x) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of set_Length is not supported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static void f_set_Length$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> set_Length, + !!T x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldc.i4.3 + IL_0003: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_0008: pop + IL_0009: ret + }"""] + + [] + [ string with get) >(x: 'T) = (^T : (member Item: int -> string with get) (x, 3))")>] + [ string) >(x: 'T) = (^T : (member get_Item: int -> string) (x, 3))")>] + [ string) >(x: 'T) = (^T : (member Item: int -> string with get) (x, 3))")>] + [ string with get) >(x: 'T) = (^T : (member get_Item: int -> string) (x, 3))")>] + [ string with get) >(x: 'T) = x.get_Item(3)")>] + let ``Get item`` code = + Fsx code + |> withOptions ["--nowarn:77"] + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static string f_Item(!!T x) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of get_Item is not supported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static string f_Item$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> get_Item, + !!T x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldc.i4.3 + IL_0003: tail. + IL_0005: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_000a: ret + }"""] + + [] + [ string with set) >(x: 'T) = (^T : (member Item: int -> string with set) (x, 3, \"a\"))")>] + [ unit) >(x: 'T) = (^T : (member set_Item: int * string -> unit) (x, 3, \"a\"))")>] + [ unit) >(x: 'T) = (^T : (member Item: int -> string with set) (x, 3, \"a\"))")>] + [ string with set) >(x: 'T) = (^T : (member set_Item: int * string -> unit) (x, 3, \"a\"))")>] + [ string with set) >(x: 'T) = x.set_Item(3, \"a\")")>] + let ``Set item`` code = + Fsx code + |> withOptions ["--nowarn:77"] + |> compile + |> shouldSucceed + |> verifyIL [""" + .method public static void f_set_Item(!!T x) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Dynamic invocation of set_Item is not supported" + IL_0005: newobj instance void [runtime]System.NotSupportedException::.ctor(string) + IL_000a: throw + } + + .method public static void f_set_Item$W(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>> set_Item, + !!T x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldc.i4.3 + IL_0003: ldstr "a" + IL_0008: call !!1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>, + !0, + !1, + !!0) + IL_000d: pop + IL_000e: ret + }"""] + + +module Negative = + + [] + [ int) >() = ()")>] + [ -> int) >() = ()")>] + [ -> int) >() = ()")>] + [] x: int[] -> int) >() = ()")>] + [] x: int[] -> int) >() = ()")>] + [] Name: 'T byref -> bool)> () = ()""")>] + let ``Trait warning or error`` code = + let errorMessage = "A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments" + + Fsx code + |> withLangVersion60 + |> compile + |> shouldFail + |> withWarningCode 3532 + |> withDiagnosticMessage errorMessage + |> ignore + + Fsx code + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 3532 + |> withDiagnosticMessage errorMessage + |> ignore + + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``IWSAM warning`` () = + Fsx "let fExpectAWarning(x: Types.ISinOperator<'T>) = ()" + |> withReferences [typesModule] + |> compile + |> shouldFail + |> withWarningCode 3536 + |> withDiagnosticMessage """'ISinOperator<_>' is normally used as a type constraint in generic code, e.g. "'T when ISomeInterface<'T>" or "let f (x: #ISomeInterface<_>)". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn "3536"' or '--nowarn:3536'.""" + |> ignore + + [] + let ``Multiple support types trait error`` () = + Fsx "let inline f5 (x: 'T when ('T or int) : (static member A: int) ) = 'T.A" + |> compile + |> shouldFail + |> withErrorCode 3537 + |> withDiagnosticMessage "The trait 'A' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance." + |> ignore + + +module InvocationBehavior = + + [] + let ``SRTP Delegate conversion not supported`` () = + Fsx "let inline f_TraitWithDelegate<'T when 'T : (static member StaticMethod: x: System.Func -> int) >() = + 'T.StaticMethod(fun x -> x + 1)" + |> compile + |> shouldFail + |> withErrorMessage "This function takes too many arguments, or is used in a context where a function is not expected" + + [] + let ``SRTP Expression conversion not supported`` () = + Fsx "let inline f_TraitWithExpression<'T when 'T : (static member StaticMethod: x: System.Linq.Expressions.Expression> -> int) >() = + 'T.StaticMethod(fun x -> x + 1)" + |> compile + |> shouldFail + |> withErrorMessage "This function takes too many arguments, or is used in a context where a function is not expected" + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``IWSAM Delegate conversion works`` () = + Fsx + """ + open Types + + let inline f_IwsamWithFunc<'T when IDelegateConversion<'T>>() = + 'T.FuncConversion(fun x -> x + 1) + + if not (f_IwsamWithFunc().Value = 4) then + failwith "Unexpected result" + + """ + |> setupCompilation + |> compileAndRun + |> shouldSucceed + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``IWSAM Expression conversion works`` () = + Fsx + """ + open Types + + let inline f_IwsamWithExpression<'T when IDelegateConversion<'T>>() = + 'T.ExpressionConversion(fun x -> x + 1) + + if not (f_IwsamWithExpression().Value = 4) then + failwith "Unexpected result" + + """ + |> setupCompilation + |> compileAndRun + |> shouldSucceed + + [] + let ``SRTP Byref can be passed with old syntax`` () = + Fsx "let inline f_TraitWithByref<'T when 'T : ( static member TryParse: string * byref -> bool) >() = + let mutable result = 0 + (^T : ( static member TryParse: x: string * byref -> bool) (\"42\", &result))" + |> compile + |> shouldSucceed + + [] + let ``SRTP Byref can be passed with new syntax`` () = + Fsx "let inline f_TraitWithByref<'T when 'T : ( static member TryParse: string * byref -> bool) >() = + let mutable result = 0 + 'T.TryParse(\"42\", &result)" + |> compile + |> shouldSucceed + + +module ``SRTP byref tests`` = + + [] + let ``Call with old syntax`` () = + Fsx """ + type C1() = + static member X(p: C1 byref) = p + + let inline callX<'T when 'T : (static member X: 'T byref -> 'T)> (x: 'T byref) = (^T: (static member X : 'T byref -> 'T) (&x)) + + let mutable c1 = C1() + let g1 = callX &c1 + + if g1 <> c1 then + failwith "Unexpected result" + """ + |> compileExeAndRun + |> shouldSucceed + + [] + let ``Call with new syntax`` () = + Fsx """ + type C2() = + static member X(p: C2 byref) = p + + let inline callX2<'T when 'T : (static member X: 'T byref -> 'T)> (x: 'T byref) = 'T.X &x + let mutable c2 = C2() + let g2 = callX2 &c2 + + if g2 <> c2 then + failwith "Unexpected result" + """ + |> compileExeAndRun + |> shouldSucceed + + [] + let ``Call with tuple`` () = + Fsx """ + + type C3() = + static member X(p: C3 byref, n: int) = p + + let inline callX3<'T when 'T : (static member X: 'T byref * int -> 'T)> (x: 'T byref) = 'T.X (&x, 3) + let mutable c3 = C3() + let g3 = callX3 &c3 + + if g3 <> c3 then + failwith "Unexpected result" + """ + |> compileExeAndRun + |> shouldSucceed + + [] + let test4 () = + Fsx """ + type C4() = + static member X() = C4() + + let inline callX4<'T when 'T : (static member X: unit -> 'T)> () = 'T.X () + let g4 = callX4 () + + if g4.GetType() <> typeof then + failwith "Unexpected result" + """ + |> compileExeAndRun + |> shouldSucceed + + // NOTE: Trait constraints that involve byref returns currently can never be satisfied by any method. No other warning is given. + // This is a bug that may be fixed in the future. + // These tests are pinning down current behavior. + [] + let ``Byref returns not allowed`` () = + Fsx """ + type C5() = + static member X(p: C5 byref) = &p + + let inline callX5<'T when 'T : (static member X: 'T byref -> 'T byref)> (x: 'T byref) = 'T.X &x + let mutable c5 = C5() + let g5 () = callX5 &c5 + """ + |> compile + |> shouldFail + |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'byref'\\s+but here has type\\s+'C5'" + + [] + let ``Byref returns not allowed pt. 2`` () = + Fsx """ + type C6() = + static member X(p: C6 byref) = &p + + // NOTE: you can declare trait call which returns the address of the thing provided, you just can't satisfy the constraint + let inline callX6<'T when 'T : (static member X: 'T byref -> 'T byref)> (x: 'T byref) = &'T.X &x + let mutable c6 = C6() + let g6 () = callX6 &c6 + """ + |> compile + |> shouldFail + |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'byref'\\s+but here has type\\s+'C6'" + + +module ``Implicit conversion`` = + + let library = + FSharp + """ + module Lib + + type ICanBeInt<'T when 'T :> ICanBeInt<'T>> = + static abstract op_Implicit: 'T -> int + + type C(c: int) = + member _.Value = c + + interface ICanBeInt with + static member op_Implicit(x) = x.Value + + static member TakeInt(x: int) = x + + let add1 (x: int) = x + 1 + """ + |> withLangVersionPreview + |> withOptions ["--nowarn:3535"] + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Function implicit conversion not supported on constrained type`` () = + Fsx + """ + open Lib + let f_function_implicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = + add1(a) + """ + |> withReferences [library] + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Method implicit conversion not supported on constrained type`` () = + Fsx + """ + open Lib + let f_method_implicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = + C.TakeInt(a) + """ + |> withReferences [library] + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Function explicit conversion works on constrained type`` () = + Fsx + """ + open Lib + let f_function_explicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = + add1(int(a)) + """ + |> withReferences [library] + |> withLangVersionPreview + |> compile + |> shouldSucceed + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Method explicit conversion works on constrained type`` () = + Fsx + """ + open Lib + let f_method_explicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = + C.TakeInt(int(a)) + """ + |> withReferences [library] + |> withLangVersionPreview + |> compile + |> shouldSucceed + + +module ``Nominal type after or`` = + + [] + let ``Nominal type can be used after or`` () = + Fsx + """ + type C() = + static member X(n, c) = $"{n} OK" + + let inline callX (x: 'T) (y: C) = ((^T or C): (static member X : 'T * C -> string) (x, y));; + + if not (callX 1 (C()) = "1 OK") then + failwith "Unexpected result" + + if not (callX "A" (C()) = "A OK") then + failwith "Unexpected result" + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``Nominal type can't be used before or`` () = + Fsx + """ + type C() = + static member X(n, c) = $"{n} OK" + + let inline callX (x: 'T) (y: C) = ((C or ^T): (static member X : 'T * C -> string) (x, y));; + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnosticMessageMatches "Unexpected keyword 'static' in binding" + + [] + let ``Nominal type is preferred`` () = + Fsx + """ + type C() = + static member X(a, b) = "C" + + type D() = + static member X(d: D, a) = "D" + + let inline callX (x: 'T) (y: C) = ((^T or C): (static member X : 'T * C -> string) (x, y));; + + if not (callX (D()) (C()) = "C") then + failwith "Unexpected result" + + let inline callX2 (x: C) (y: 'T) = ((^T or C): (static member X : 'T * C -> string) (y, x));; + + if not (callX2 (C()) (D()) = "C") then + failwith "Unexpected result" + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + +module ``Active patterns`` = + + let library = + FSharp """ + module Potato.Lib + type IPotato<'T when 'T :> IPotato<'T>> = + static abstract member IsGood: 'T -> bool + static abstract member op_Equality: 'T * 'T -> bool + + type Potato() = + interface IPotato with + static member IsGood c = true + static member op_Equality (a, b) = false + + type Rock() = + interface IPotato with + static member IsGood c = false + static member op_Equality (a, b) = false + """ + |> withLangVersionPreview + |> withName "Potato" + |> withOptions ["--nowarn:3535"] + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Using IWSAM in active pattern`` () = + FSharp """ + module Potato.Test + + open Lib + + let (|GoodPotato|_|) (x : 'T when 'T :> IPotato<'T>) = if 'T.IsGood x then Some () else None + + match Potato() with GoodPotato -> () | _ -> failwith "Unexpected result" + match Rock() with GoodPotato -> failwith "Unexpected result" | _ -> () + """ + |> withReferences [library] + |> withLangVersionPreview + |> compileExeAndRun + |> shouldSucceed + |> verifyIL [ + """ + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 + '|GoodPotato|_|'<(class [Potato]Potato.Lib/IPotato`1) T>(!!T x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: constrained. !!T + IL_0007: call bool class [Potato]Potato.Lib/IPotato`1::IsGood(!0) + IL_000c: brfalse.s IL_0015 + """ + ] + + #if !NETCOREAPP + [] + #else + [] + #endif + let ``Using IWSAM equality in active pattern uses generic equality intrinsic`` () = + FSharp """ + module Potato.Test + + open Lib + + let (|IsEqual|IsNonEqual|) (x: 'T when IPotato<'T>, y: 'T when IPotato<'T>) = + match x with + | x when x = y -> IsEqual + | _ -> IsNonEqual + + match Potato(), Potato() with + | IsEqual -> failwith "Unexpected result" + | IsNonEqual -> () + """ + |> withReferences [library] + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + |> verifyIL [ + """ + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Core.FSharpChoice`2 + '|IsEqual|IsNonEqual|'<(class [Potato]Potato.Lib/IPotato`1) T>(!!T x, + !!T y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + + """ + ] + +module ``Suppression of System Numerics interfaces on unitized types`` = + + [] + let Baseline () = + Fsx """ + open System.Numerics + let f (x: 'T when 'T :> IMultiplyOperators<'T,'T,'T>) = x;; + f 3.0 |> ignore""" + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + let ``Unitized type shouldn't be compatible with System.Numerics.I*`` name paramCount = + let typeParams = Seq.replicate paramCount "'T" |> String.concat "," + let genericType = $"{name}<{typeParams}>" + let potatoParams = Seq.replicate paramCount "float" |> String.concat "," + let potatoType = $"{name}<{potatoParams}>" + Fsx $""" + open System.Numerics + + [] type potato + + let f (x: 'T when {genericType}) = x;; + f 3.0 |> ignore""" + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorMessage $"The type 'float' is not compatible with the type '{potatoType}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/Types.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/Types.fs new file mode 100644 index 00000000000..d8c98028621 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/Types.fs @@ -0,0 +1,39 @@ +module Types + +type IStaticProperty<'T when 'T :> IStaticProperty<'T>> = + static abstract StaticProperty: 'T + +type IStaticMethod<'T when 'T :> IStaticMethod<'T>> = + static abstract StaticMethod: 'T -> 'T + +type IUnitMethod<'T when 'T :> IUnitMethod<'T>> = + static abstract UnitMethod: unit -> unit + +type IAdditionOperator<'T when 'T :> IAdditionOperator<'T>> = + static abstract op_Addition: 'T * 'T -> 'T + +type ISinOperator<'T when 'T :> ISinOperator<'T>> = + static abstract Sin: 'T -> 'T + +type IDelegateConversion<'T when 'T :> IDelegateConversion<'T>> = + static abstract FuncConversion: System.Func -> 'T + static abstract ExpressionConversion: System.Linq.Expressions.Expression> -> 'T + +type C(c: int) = + member _.Value = c + + interface IAdditionOperator with + static member op_Addition(x, y) = C(x.Value + y.Value) + + interface IStaticProperty with + static member StaticProperty = C(7) + + interface IStaticMethod with + static member StaticMethod(x) = C(x.Value + 4) + + interface IUnitMethod with + static member UnitMethod() = () + + interface IDelegateConversion with + static member FuncConversion(f) = C(f.Invoke(3)) + static member ExpressionConversion(e) = C(e.Compile().Invoke(3)) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/BasicTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/BasicTests.fs new file mode 100644 index 00000000000..420b85ab2f5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/BasicTests.fs @@ -0,0 +1,61 @@ +open Types + +module ``Test basic IWSAM generic code`` = + + let f_IWSAM_explicit_operator_name<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.op_Addition(x, y) + + let f_IWSAM_pretty_operator_name<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.(+)(x, y) + + let f_IWSAM_StaticProperty<'T when 'T :> IStaticProperty<'T>>() = + 'T.StaticProperty + + let f_IWSAM_declared_StaticMethod<'T when 'T :> IStaticMethod<'T>>(x: 'T) = + 'T.StaticMethod(x) + + let f_IWSAM_declared_UnitMethod<'T when 'T :> IUnitMethod<'T>>() = + 'T.UnitMethod() + + let f_IWSAM_declared_UnitMethod_list<'T when 'T :> IUnitMethod<'T>>() = + let v = 'T.UnitMethod() + [ v ] + + let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) = + 'T.StaticProperty + + let f_IWSAM_flex_StaticMethod(x: #IStaticMethod<'T>) = + 'T.StaticMethod(x) + + + let inline f3<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.op_Addition(x,y) + + let inline f4<'T when 'T : (static member (+): 'T * 'T -> 'T)>(x: 'T, y: 'T) = + 'T.op_Addition(x,y) + + let inline f5<'T when 'T : (static member (+): 'T * 'T -> 'T)>(x: 'T, y: 'T) = + 'T.(+)(x,y) + + let inline f6<'T when 'T : (static member (+): 'T * 'T -> 'T)>(x: 'T, y: 'T) = + x + y + + let inline f_StaticProperty_IWSAM<'T when 'T :> IStaticProperty<'T>>() = + 'T.StaticProperty + + let inline f_StaticProperty_SRTP<'T when 'T : (static member StaticProperty: 'T) >() = + 'T.StaticProperty + + let inline f_StaticProperty_BOTH<'T when 'T :> IStaticProperty<'T> and 'T : (static member StaticProperty: 'T) >() = + 'T.StaticProperty + + + module CheckExecution = + if f_IWSAM_explicit_operator_name(C(3), C(4)).Value <> 7 then + failwith "incorrect value" + + if f_IWSAM_pretty_operator_name(C(3), C(4)).Value <> 7 then + failwith "incorrect value" + + if f_IWSAM_StaticProperty().Value <> 7 then + failwith "incorrect value" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckNewSyntax.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckNewSyntax.fs new file mode 100644 index 00000000000..f9a593a5cf2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckNewSyntax.fs @@ -0,0 +1,60 @@ +open Types + +module CheckNewSyntax = + + type MyType() = + static member val StaticProperty = 0 with get, set + static member StaticMethod x = x + 5 + member val Length = 0 with get, set + member _.Item with get x = "Hello" + member _.InstanceMethod x = x + 5 + + // Check that "property" and "get_ method" constraints are considered logically equivalent + let inline f_StaticProperty<'T when 'T : (static member StaticProperty: int) >() : int = 'T.StaticProperty + + let inline f_StaticMethod<'T when 'T : (static member StaticMethod: int -> int) >() : int = 'T.StaticMethod(3) + + let inline f_set_StaticProperty<'T when 'T : (static member StaticProperty: int with set) >() = 'T.set_StaticProperty(3) + + let inline f_InstanceMethod<'T when 'T : (member InstanceMethod: int -> int) >(x: 'T) : int = x.InstanceMethod(3) + + let inline f_Length<'T when 'T : (member Length: int) >(x: 'T) = x.Length + + let inline f_set_Length<'T when 'T : (member Length: int with set) >(x: 'T) = x.set_Length(3) + + let inline f_Item<'T when 'T : (member Item: int -> string with get) >(x: 'T) = x.get_Item(3) + + // Limitation by-design: As yet the syntax "'T.StaticProperty <- 3" can't be used + // Limitation by-design: As yet the syntax "x.Length <- 3" can't be used + // Limitation by-design: As yet the syntax "x[3]" can't be used, nor can any slicing syntax + // Limitation by-design: The disposal pattern can't be used with "use" + + //let inline f_set_StaticProperty2<'T when 'T : (static member StaticProperty: int with set) >() = 'T.StaticProperty <- 3 + //let inline f_set_Length2<'T when 'T : (member Length: int with set) >(x: 'T) = x.Length <- 3 + //let inline f_Item2<'T when 'T : (member Item: int -> string with get) >(x: 'T) = x[3] + + if f_StaticMethod() <> 8 then + failwith "Unexpected result" + + if f_set_StaticProperty() <> () then + failwith "Unexpected result" + + if f_StaticProperty() <> 3 then + failwith "Unexpected result" + + let myInstance = MyType() + + if f_Length(myInstance) <> 0 then + failwith "Unexpected result" + + if f_InstanceMethod(myInstance) <> 8 then + failwith "Unexpected result" + + if f_set_Length(myInstance) <> () then + failwith "Unexpected result" + + if f_Length(myInstance) <> 3 then + failwith "Unexpected result" + + if f_Item(myInstance) <> "Hello" then + failwith "Unexpected result" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedIWSAM.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedIWSAM.fs new file mode 100644 index 00000000000..3755c6bfc86 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedIWSAM.fs @@ -0,0 +1,51 @@ +open System +open Types + +module CheckSelfConstrainedIWSAM = + + let f_IWSAM_explicit_operator_name<'T when IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.op_Addition(x, y) + + let f_IWSAM_pretty_operator_name<'T when IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.(+)(x, y) + + let f_IWSAM_StaticProperty<'T when IStaticProperty<'T>>() = + 'T.StaticProperty + + let f_IWSAM_declared_StaticMethod<'T when IStaticMethod<'T>>(x: 'T) = + 'T.StaticMethod(x) + + let f_IWSAM_declared_UnitMethod<'T when IUnitMethod<'T>>() = + 'T.UnitMethod() + + let f_IWSAM_declared_UnitMethod_list<'T when IUnitMethod<'T>>() = + let v = 'T.UnitMethod() + [ v ] + + let inline f3<'T when IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.op_Addition(x,y) + + type WithStaticProperty<'T when 'T : (static member StaticProperty: int)> = 'T + type WithStaticMethod<'T when 'T : (static member StaticMethod: int -> int)> = 'T + type WithBoth<'T when WithStaticProperty<'T> and WithStaticMethod<'T>> = 'T + + let inline f_StaticProperty<'T when WithStaticProperty<'T>>() = 'T.StaticProperty + let inline f_StaticMethod<'T when WithStaticMethod<'T>>() = 'T.StaticMethod(3) + let inline f_Both<'T when WithBoth<'T> >() = + let v1 = 'T.StaticProperty + let v2 = 'T.StaticMethod(3) + v1 + v2 + + let inline f_OK1<'T when WithBoth<'T>>() = + 'T.StaticMethod(3) |> ignore + 'T.StaticMethod(3) + + let inline f_OK2<'T when WithBoth<'T>>() = + 'T.StaticMethod(3) |> ignore + 'T.StaticMethod(3) + + let inline f_OK3<'T when WithBoth<'T>>() = + printfn "" + 'T.StaticMethod(3) + + printfn "" \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedSRTP.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedSRTP.fs new file mode 100644 index 00000000000..c96e1481cdc --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/CheckSelfConstrainedSRTP.fs @@ -0,0 +1,18 @@ +open Types + +module CheckSelfConstrainedSRTP = + + let inline f_StaticProperty_IWSAM<'T when IStaticProperty<'T>>() = + 'T.StaticProperty + + type AverageOps<'T when 'T: (static member (+): 'T * 'T -> 'T) + and 'T: (static member DivideByInt : 'T*int -> 'T) + and 'T: (static member Zero : 'T)> = 'T + + let inline f_AverageOps<'T when AverageOps<'T>>(xs: 'T[]) = + let mutable sum = 'T.Zero + for x in xs do + sum <- sum + x + 'T.DivideByInt(sum, xs.Length) + + printfn "" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/TestLegacyThingsThatRegressedDuringRFC.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/TestLegacyThingsThatRegressedDuringRFC.fs new file mode 100644 index 00000000000..b7080061a72 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/TestLegacyThingsThatRegressedDuringRFC.fs @@ -0,0 +1,17 @@ +#nowarn "62" + +module TestLegacyThingsThatRegressedDuringRFC = + let legacyConcat1 (x: string) (y: string) = x ^ y + let legacyConcat2 (x: string) (y: string) = x ^y + let legacyConcat3 (x: string) (y: string) = x^ y + let legacyConcat4 (x: string) (y: string) = x^y + + let testSlicingOne() = + let arr = [| 1;2;3;4;5 |] + arr.[^3..] + + let testSlicingTwo() = + let arr = [| 1;2;3;4;5 |] + arr[^3..] + + printfn "" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/UseSRTPFromIWSAMGenericCode.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/UseSRTPFromIWSAMGenericCode.fs new file mode 100644 index 00000000000..de287cbf754 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/testFiles/UseSRTPFromIWSAMGenericCode.fs @@ -0,0 +1,33 @@ +#nowarn "64" +open Types + +module ``Use SRTP from IWSAM generic code`` = + module ``Use SRTP operators from generic IWSAM code`` = + let fAdd<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = + x + y + + let fSin<'T when ISinOperator<'T>>(x: 'T) = + sin x + + module ``Use SRTP operators from generic IWSAM code not rigid`` = + let fAdd(x: 'T when 'T :> IAdditionOperator<'T>, y: 'T) = + x + y + + let fSin(x: 'T when ISinOperator<'T>) = + sin x + + module ``Use SRTP operators from generic IWSAM code flex`` = + let fAdd(x: #IAdditionOperator<'T>, y) = + x + y + + let fSin(x: #ISinOperator<'T>) = + sin x + + module ``Use SRTP operators from generic IWSAM code super flex`` = + let fAdd(x: #IAdditionOperator<_>, y) = + x + y + + let fSin(x: #ISinOperator<_>) = + sin x + + printfn "" diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 9c6e84e4a0c..5935d322ccf 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -15,6 +15,7 @@ false $(OtherFlags) --warnon:1182 $(NoWarn);FS0988 + true @@ -83,6 +84,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs index ebbcc958077..2b7f9e8c87a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs @@ -20,6 +20,12 @@ module ``Static Methods In Interfaces`` = { static abstract T Next(T other); } + + public interface IGetNext2 where T : IGetNext2 + { + abstract T Next(T other); + } + public record RepeatSequence : IGetNext { private const char Ch = 'A'; @@ -33,6 +39,78 @@ module ``Static Methods In Interfaces`` = }""" |> withCSharpLanguageVersion CSharpLanguageVersion.Preview |> withName "csLib" + let csharpOperators = + CSharp """ + namespace StaticsInInterfaces + { + public interface IAddable where T : IAddable + { + static abstract T operator +(T left, T right); + } + + + public record MyInteger : IAddable + { + public int Value { get; init; } = default; + public MyInteger(int value) + { + Value = value; + } + + public static MyInteger operator +(MyInteger left, MyInteger right) => new MyInteger(left.Value + right.Value); + } + + } + """ |> withCSharpLanguageVersion CSharpLanguageVersion.Preview |> withName "csOpLib" + + #if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can use operators declared in C#`` () = + + let fsharpSource = + """ +open System +open StaticsInInterfaces + +type MyInteger2 = + val Value : int + new(value: int) = { Value = value } + static member op_Addition(left: MyInteger2, right: MyInteger2) : MyInteger2 = MyInteger2(left.Value + right.Value) + interface IAddable with + static member op_Addition(left: MyInteger2, right: MyInteger2) : MyInteger2 = MyInteger2.op_Addition(left, right) + +[] +let main _ = + let mint1 = new MyInteger(1) + let mint2 = new MyInteger(2) + + let sum = mint1 + mint2 + + let mint21 = new MyInteger2(2) + let mint22 = new MyInteger2(4) + + let sum2 = mint21 + mint22 + + if sum.Value <> 3 then + failwith $"Unexpected result: %d{sum.Value}" + + if sum2.Value <> 6 then + failwith $"Unexpected result: %d{sum2.Value}" + + // TODO: Figure out if we allow something like: + // let add (a: IAddable<_>) (b: IAddable<_>) = a + b + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpOperators] + |> compileAndRun + |> shouldSucceed + #if !NETCOREAPP [] #else @@ -68,4 +146,431 @@ let main _ = |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed - // TODO: test operators, test implementing statics. \ No newline at end of file + + + (* For reference: + Roslyn generates the following interface: + .class interface public auto ansi abstract IGetNext`1<(class IGetNext`1) T> + { + // Methods + .method public hidebysig abstract virtual static + !T Next ( + !T other + ) cil managed + { + } // end of method IGetNext`1::Next + + } // end of class IGetNext`1 + + And the following implementation: + .method public hidebysig static + class RepeatSequence Next (class RepeatSequence other) cil managed + { + .override method !0 class IGetNext`1::Next(!0) + ... + } + *) + #if !NETCOREAPP + [] + #else + [] + #endif + let ``F# generates valid IL for abstract static interface methods`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +module StaticsTesting +open StaticsInInterfaces + +type MyRepeatSequence() = + interface IGetNext with + static member Next(other: MyRepeatSequence) : MyRepeatSequence = other + +type MyRepeatSequence2() = + static member Next(other: MyRepeatSequence2) = other + interface IGetNext with + static member Next(other: MyRepeatSequence2) : MyRepeatSequence2 = MyRepeatSequence2.Next(other) +""" + Fsx fsharpSource + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compile + |> shouldSucceed + |> verifyIL [ + """ +.class auto ansi serializable nested public MyRepeatSequence +extends [runtime]System.Object +implements class [csLib]StaticsInInterfaces.IGetNext`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public specialname rtspecialname +instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ret + } + + .method public hidebysig static class StaticsTesting/MyRepeatSequence +'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence other) cil managed + { + .override method !0 class [csLib]StaticsInInterfaces.IGetNext`1::Next(!0) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ret + } + + } + + .class auto ansi serializable nested public MyRepeatSequence2 +extends [runtime]System.Object +implements class [csLib]StaticsInInterfaces.IGetNext`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public specialname rtspecialname +instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ret + } + + .method public static class StaticsTesting/MyRepeatSequence2 +Next(class StaticsTesting/MyRepeatSequence2 other) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ret + } + + .method public hidebysig static class StaticsTesting/MyRepeatSequence2 +'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence2 other) cil managed + { + .override method !0 class [csLib]StaticsInInterfaces.IGetNext`1::Next(!0) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ret + } + + } + """] + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can implement static methods declared in interfaces from C#`` () = + + let csharpLib = csharpBaseClass + + let fsharpSource = + """ +open System +open StaticsInInterfaces + +type MyRepeatSequence() = + [] val mutable Text : string + + override this.ToString() = this.Text + + static member Next(other: MyRepeatSequence) = + other.Text <- other.Text + "A" + other + + interface IGetNext with + static member Next(other: MyRepeatSequence) : MyRepeatSequence = MyRepeatSequence.Next(other) + +[] +let main _ = + + let mutable str = MyRepeatSequence () + str.Text <- "A" + let res = [ for i in 0..10 do + yield str.ToString() + str <- MyRepeatSequence.Next(str) ] + + if res <> ["A"; "AA"; "AAA"; "AAAA"; "AAAAA"; "AAAAAA"; "AAAAAAA"; "AAAAAAAA"; "AAAAAAAAA"; "AAAAAAAAAA"; "AAAAAAAAAAA"] then + failwith $"Unexpected result: %A{res}" + + if string(str) <> "AAAAAAAAAAAA" then + failwith $"Unexpected result %s{string(str)}" + 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> withReferences [csharpLib] + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can implement interfaces with static abstract methods`` () = + + let fsharpSource = + """ +#nowarn "3535" +type IAdditionOperator<'T> = + static abstract op_Addition: 'T * 'T -> 'T + +type C() = + interface IAdditionOperator with + static member op_Addition(x: C, y: C) = C() + +[] +let main _ = 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# supports inference for types of arguments when implementing interfaces`` () = + + let fsharpSource = + """ +#nowarn "3535" +type IAdditionOperator<'T> = + static abstract op_Addition: 'T * 'T -> 'T + +type C() = + interface IAdditionOperator with + static member op_Addition(x, y) = C() // no type annotation needed on 'x' and 'y' + +[] +let main _ = 0 +""" + FSharp fsharpSource + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``F# can call interface with static abstract method`` () = + FSharp + """ +#nowarn "3535" +namespace Tests + +[] +do() + +module Test = + + type IAdditionOperator<'T> = + static abstract op_Addition: 'T * 'T -> 'T + + type C(c: int) = + member _.Value = c + interface IAdditionOperator with + static member op_Addition(x, y) = C(x.Value + y.Value) + + let f<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = + 'T.op_Addition(x, y) + + [] + let main _ = + if f(C(3), C(4)).Value <> 7 then + failwith "incorrect value" + 0 +""" + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + |> verifyIL [ + """ +.class public abstract auto ansi sealed Tests.Test + extends [runtime]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 ) + .class interface abstract auto ansi serializable nested public IAdditionOperator`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig static abstract virtual + !T op_Addition(!T A_0, + !T A_1) cil managed + { + } + + } + + .class auto ansi serializable nested public C + extends [runtime]System.Object + implements class Tests.Test/IAdditionOperator`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 c + .method public specialname rtspecialname + instance void .ctor(int32 c) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 Tests.Test/C::c + IL_000f: ret + } + + .method public hidebysig specialname + instance int32 get_Value() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Tests.Test/C::c + IL_0006: ret + } + + .method public hidebysig static class Tests.Test/C + 'Tests.Test.IAdditionOperator.op_Addition'(class Tests.Test/C x, + class Tests.Test/C y) cil managed + { + .override method !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Tests.Test/C::c + IL_0006: ldarg.1 + IL_0007: ldfld int32 Tests.Test/C::c + IL_000c: add + IL_000d: newobj instance void Tests.Test/C::.ctor(int32) + IL_0012: ret + } + + .property instance int32 Value() + { + .get instance int32 Tests.Test/C::get_Value() + } + } + + .method public static !!T f<(class Tests.Test/IAdditionOperator`1) T>(!!T x, + !!T y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: constrained. !!T + IL_0008: call !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + IL_000d: ret + } + + .method public static int32 main(string[] _arg1) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class Tests.Test/C V_0, + class Tests.Test/C V_1) + IL_0000: ldc.i4.3 + IL_0001: newobj instance void Tests.Test/C::.ctor(int32) + IL_0006: stloc.0 + IL_0007: ldc.i4.4 + IL_0008: newobj instance void Tests.Test/C::.ctor(int32) + IL_000d: stloc.1 + IL_000e: ldloc.0 + IL_000f: ldloc.1 + IL_0010: constrained. Tests.Test/C + IL_0016: call !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + IL_001b: ldfld int32 Tests.Test/C::c + IL_0020: ldc.i4.7 + IL_0021: beq.s IL_002e + + IL_0023: ldstr "incorrect value" + IL_0028: newobj instance void [netstandard]System.Exception::.ctor(string) + IL_002d: throw + + IL_002e: ldc.i4.0 + IL_002f: ret + } + +} + """ ] + +#if !NETCOREAPP + [] +#else + [] +#endif + let ``C# can call constrained method defined in F#`` () = + let FSharpLib = + FSharp """ + namespace MyNamespace + + type IFoo<'T> = + static abstract Foo: 'T * 'T -> 'T + + module Stuff = + let F<'T when 'T :> IFoo<'T>>(x: 'T, y: 'T) = + 'T.Foo(x, y) + """ + |> withLangVersionPreview + |> withName "FsLibAssembly" + |> withOptions ["--nowarn:3535"] + + CSharp """ + namespace MyNamespace { + + class Potato : IFoo + { + public Potato(int x) => this.x = x; + + public int x; + + public static Potato Foo(Potato x, Potato y) => new Potato(x.x + y.x); + + public static void Main(string[] args) + { + var x = new Potato(4); + var y = new Potato(9); + var z = Stuff.F(x, y); + if (z.x != 13) + { + throw new System.Exception("incorrect value"); + } + } + } + } + """ + |> withReferences [FSharpLib] + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "CsProgram" + |> compileExeAndRun + |> shouldSucceed diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 2fad3357478..c9f58e3ca78 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -6709,6 +6709,7 @@ FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Sequential FSharp.Compiler.Syntax.SynExpr+Tags: Int32 SequentialOrImplicitYield FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Set FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TraitCall +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Typar FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TryFinally FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TryWith FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Tuple @@ -6725,8 +6726,8 @@ FSharp.Compiler.Syntax.SynExpr+TraitCall: FSharp.Compiler.Syntax.SynMemberSig ge FSharp.Compiler.Syntax.SynExpr+TraitCall: FSharp.Compiler.Syntax.SynMemberSig traitSig FSharp.Compiler.Syntax.SynExpr+TraitCall: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynExpr+TraitCall: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynExpr+TraitCall: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypar] get_supportTys() -FSharp.Compiler.Syntax.SynExpr+TraitCall: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypar] supportTys +FSharp.Compiler.Syntax.SynExpr+TraitCall: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType] get_supportTys() +FSharp.Compiler.Syntax.SynExpr+TraitCall: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType] supportTys FSharp.Compiler.Syntax.SynExpr+TryFinally: FSharp.Compiler.Syntax.DebugPointAtFinally finallyDebugPoint FSharp.Compiler.Syntax.SynExpr+TryFinally: FSharp.Compiler.Syntax.DebugPointAtFinally get_finallyDebugPoint() FSharp.Compiler.Syntax.SynExpr+TryFinally: FSharp.Compiler.Syntax.DebugPointAtTry get_tryDebugPoint() @@ -6759,6 +6760,10 @@ FSharp.Compiler.Syntax.SynExpr+Tuple: Microsoft.FSharp.Collections.FSharpList`1[ FSharp.Compiler.Syntax.SynExpr+Tuple: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr] get_exprs() FSharp.Compiler.Syntax.SynExpr+Tuple: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range] commaRanges FSharp.Compiler.Syntax.SynExpr+Tuple: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range] get_commaRanges() +FSharp.Compiler.Syntax.SynExpr+Typar: FSharp.Compiler.Syntax.SynTypar get_typar() +FSharp.Compiler.Syntax.SynExpr+Typar: FSharp.Compiler.Syntax.SynTypar typar +FSharp.Compiler.Syntax.SynExpr+Typar: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExpr+Typar: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExpr+TypeApp: FSharp.Compiler.Syntax.SynExpr expr FSharp.Compiler.Syntax.SynExpr+TypeApp: FSharp.Compiler.Syntax.SynExpr get_expr() FSharp.Compiler.Syntax.SynExpr+TypeApp: FSharp.Compiler.Text.Range get_lessRange() @@ -6869,6 +6874,7 @@ FSharp.Compiler.Syntax.SynExpr: Boolean IsSequential FSharp.Compiler.Syntax.SynExpr: Boolean IsSequentialOrImplicitYield FSharp.Compiler.Syntax.SynExpr: Boolean IsSet FSharp.Compiler.Syntax.SynExpr: Boolean IsTraitCall +FSharp.Compiler.Syntax.SynExpr: Boolean IsTypar FSharp.Compiler.Syntax.SynExpr: Boolean IsTryFinally FSharp.Compiler.Syntax.SynExpr: Boolean IsTryWith FSharp.Compiler.Syntax.SynExpr: Boolean IsTuple @@ -6940,6 +6946,7 @@ FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTraitCall() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTryFinally() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTryWith() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTuple() +FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTypar() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTypeApp() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTypeTest() FSharp.Compiler.Syntax.SynExpr: Boolean get_IsTyped() @@ -7003,7 +7010,8 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewRecord(Microso FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSequential(FSharp.Compiler.Syntax.DebugPointAtSequential, Boolean, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSequentialOrImplicitYield(FSharp.Compiler.Syntax.DebugPointAtSequential, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTraitCall(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypar], FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTraitCall(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTypar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTryFinally(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.DebugPointAtTry, FSharp.Compiler.Syntax.DebugPointAtFinally, FSharp.Compiler.SyntaxTrivia.SynExprTryFinallyTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTryWith(FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMatchClause], FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.DebugPointAtTry, FSharp.Compiler.Syntax.DebugPointAtWith, FSharp.Compiler.SyntaxTrivia.SynExprTryWithTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) @@ -7075,6 +7083,7 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+TraitCall FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+TryFinally FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+TryWith FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Tuple +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Typar FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+TypeApp FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+TypeTest FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr+Typed @@ -7339,6 +7348,10 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr get_synExpr() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynExpr synExpr +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlags() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags get_memberFlagsForSet() +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlags +FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberFlags memberFlagsForSet FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind get_propKind() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Syntax.SynMemberKind propKind FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Text.Range equalsRange @@ -7349,8 +7362,6 @@ FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: FSharp.Compiler.Xml.PreXmlDoc xmlDoc FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Syntax.SynMemberKind,FSharp.Compiler.Syntax.SynMemberFlags] get_memberFlags() -FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Syntax.SynMemberKind,FSharp.Compiler.Syntax.SynMemberFlags] memberFlags FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynMemberDefn+AutoProperty: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] get_typeOpt() @@ -7464,7 +7475,7 @@ FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsNestedType() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsOpen() FSharp.Compiler.Syntax.SynMemberDefn: Boolean get_IsValField() FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAbstractSlot(FSharp.Compiler.Syntax.SynValSig, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Syntax.SynMemberKind,FSharp.Compiler.Syntax.SynMemberFlags], FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynSimplePats, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range) @@ -8600,6 +8611,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsDelegate FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEnum FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsReferenceType +FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsValueType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSubtypeOfType @@ -8659,6 +8671,11 @@ FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType get_selfConstraint() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType selfConstraint +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparDefaultsToType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsComparable FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsDelegate @@ -8709,6 +8726,9 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeConstraint: Int32 Tag FSharp.Compiler.Syntax.SynTypeConstraint: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeConstraint: System.String ToString() +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereSelfConstrained() +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereSelfConstrained(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeDefn FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo typeInfo diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs index 81919c25ef3..ebf57856db3 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs @@ -92,34 +92,34 @@ module Value = module TaskLowProrityExtensions = type TaskBuilderDynamic with - member inline _.ReturnFrom< ^TaskLike, ^Awaiter, ^T - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + member inline _.ReturnFrom<^TaskLike, ^Awaiter, ^T + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> ^T)> - (t: ^TaskLike) : TaskCode< ^T, ^T> = + and ^Awaiter: (member GetResult: unit -> ^T)> + (t: ^TaskLike) : TaskCode<^T, ^T> = task.ReturnFrom(t) - member inline _.Bind< ^TaskLike, ^TResult1, 'TResult2, ^Awaiter , 'TOverall - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + member inline _.Bind<^TaskLike, ^TResult1, 'TResult2, ^Awaiter , 'TOverall + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> ^TResult1)> + and ^Awaiter: (member GetResult: unit -> ^TResult1)> (t: ^TaskLike, continuation: (^TResult1 -> TaskCode<'TOverall, 'TResult2>)) : TaskCode<'TOverall, 'TResult2> = task.Bind(t, continuation) type BackgroundTaskBuilderDynamic with - member inline _.ReturnFrom< ^TaskLike, ^Awaiter, ^T - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + member inline _.ReturnFrom<^TaskLike, ^Awaiter, ^T + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> ^T)> - (t: ^TaskLike) : TaskCode< ^T, ^T> = + and ^Awaiter: (member GetResult: unit -> ^T)> + (t: ^TaskLike) : TaskCode<^T, ^T> = backgroundTask.ReturnFrom(t) - member inline _.Bind< ^TaskLike, ^TResult1, 'TResult2, ^Awaiter , 'TOverall - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + member inline _.Bind<^TaskLike, ^TResult1, 'TResult2, ^Awaiter , 'TOverall + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> ^TResult1)> + and ^Awaiter: (member GetResult: unit -> ^TResult1)> (t: ^TaskLike, continuation: (^TResult1 -> TaskCode<'TOverall, 'TResult2>)) : TaskCode<'TOverall, 'TResult2> = backgroundTask.Bind(t, continuation) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 574d7dae1ee..020ebe9363c 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -85,6 +85,7 @@ module rec Compiler = Source: SourceCodeFileKind LangVersion: CSharpLanguageVersion TargetFramework: TargetFramework + OutputType: CompileOutput OutputDirectory: DirectoryInfo option Name: string option References: CompilationUnit list @@ -137,7 +138,7 @@ module rec Compiler = type Disposable (dispose : unit -> unit) = interface IDisposable with - member this.Dispose() = + member this.Dispose() = dispose() type ErrorInfo = @@ -145,15 +146,13 @@ module rec Compiler = Range: Range Message: string } - type EvalOutput = Result - type ExecutionOutput = { ExitCode: int StdOut: string StdErr: string } type RunOutput = - | EvalOutput of EvalOutput + | EvalOutput of Result | ExecutionOutput of ExecutionOutput type CompilationOutput = @@ -168,6 +167,9 @@ module rec Compiler = type CompilationResult = | Success of CompilationOutput | Failure of CompilationOutput + with + member this.Output = match this with Success o | Failure o -> o + member this.RunOutput = this.Output.Output type ExecutionPlatform = | Anycpu = 0 @@ -209,7 +211,8 @@ module rec Compiler = Source = source LangVersion = CSharpLanguageVersion.CSharp9 TargetFramework = TargetFramework.Current - OutputDirectory= None + OutputType = Library + OutputDirectory = None Name = None References = [] } @@ -464,12 +467,13 @@ module rec Compiler = let asExe (cUnit: CompilationUnit) : CompilationUnit = match cUnit with - | FS fs -> FS { fs with OutputType = CompileOutput.Exe } + | FS x -> FS { x with OutputType = Exe } + | CS x -> CS { x with OutputType = Exe } | _ -> failwith "TODO: Implement where applicable." let withPlatform (platform:ExecutionPlatform) (cUnit: CompilationUnit) : CompilationUnit = match cUnit with - | FS _ -> + | FS _ -> let p = match platform with | ExecutionPlatform.Anycpu -> "anycpu" @@ -569,22 +573,37 @@ module rec Compiler = let compilation = Compilation.CreateFromSources([fs.Source] @ fs.AdditionalSources, output, options, references, name, outputDirectory) compileFSharpCompilation compilation fs.IgnoreWarnings (FS fs) - let private compileCSharpCompilation (compilation: CSharpCompilation) csSource : CompilationResult = - let outputPath = tryCreateTemporaryDirectory() - Directory.CreateDirectory(outputPath) |> ignore - let fileName = compilation.AssemblyName - let output = Path.Combine(outputPath, Path.ChangeExtension(fileName, ".dll")) - let cmplResult = compilation.Emit (output) + let toErrorInfo (d: Diagnostic) = + let span = d.Location.GetMappedLineSpan().Span + let number = d.Id |> Seq.where Char.IsDigit |> String.Concat |> int + + { Error = + match d.Severity with + | DiagnosticSeverity.Error -> Error + | DiagnosticSeverity.Warning -> Warning + | DiagnosticSeverity.Info -> Information + | DiagnosticSeverity.Hidden -> Hidden + | x -> failwith $"Unknown severity {x}" + |> (|>) number + Range = + { StartLine = span.Start.Line + StartColumn = span.Start.Character + EndLine = span.End.Line + EndColumn = span.End.Character } + Message = d.GetMessage() } + + let private compileCSharpCompilation (compilation: CSharpCompilation) csSource (filePath : string) dependencies : CompilationResult = + let cmplResult = compilation.Emit filePath let result = { OutputPath = None - Dependencies = [] + Dependencies = dependencies Adjust = 0 - Diagnostics = [] - Output = None + Diagnostics = cmplResult.Diagnostics |> Seq.map toErrorInfo |> Seq.toList + Output = None Compilation = CS csSource } if cmplResult.Success then - CompilationResult.Success { result with OutputPath = Some output } + CompilationResult.Success { result with OutputPath = Some filePath } else CompilationResult.Failure result @@ -599,9 +618,12 @@ module rec Compiler = | None -> DirectoryInfo(tryCreateTemporaryDirectory()) let additionalReferences = - match processReferences csSource.References outputDirectory with - | [] -> ImmutableArray.Empty - | r -> (List.map (asMetadataReference (CS csSource)) r).ToImmutableArray().As() + processReferences csSource.References outputDirectory + |> List.map (asMetadataReference (CS csSource)) + + let additionalMetadataReferences = additionalReferences.ToImmutableArray().As() + + let additionalReferencePaths = [for r in additionalReferences -> r.FilePath] let references = TargetFrameworkUtil.getReferences csSource.TargetFramework @@ -612,14 +634,22 @@ module rec Compiler = | CSharpLanguageVersion.Preview -> LanguageVersion.Preview | _ -> LanguageVersion.Default + let outputKind, extension = + match csSource.OutputType with + | Exe -> OutputKind.ConsoleApplication, "exe" + | Library -> OutputKind.DynamicallyLinkedLibrary, "dll" + let cmpl = CSharpCompilation.Create( name, [ CSharpSyntaxTree.ParseText (source, CSharpParseOptions lv) ], - references.As().AddRange additionalReferences, - CSharpCompilationOptions (OutputKind.DynamicallyLinkedLibrary)) + references.As().AddRange additionalMetadataReferences, + CSharpCompilationOptions outputKind) + + let filename = Path.ChangeExtension(cmpl.AssemblyName, extension) + let filePath = Path.Combine(outputDirectory.FullName, filename) - compileCSharpCompilation cmpl csSource + compileCSharpCompilation cmpl csSource filePath additionalReferencePaths let compile (cUnit: CompilationUnit) : CompilationResult = match cUnit with @@ -669,7 +699,7 @@ module rec Compiler = Dependencies = [] Adjust = 0 Diagnostics = diagnostics - Output = None + Output = None Compilation = FS fsSource } if failed then @@ -699,7 +729,7 @@ module rec Compiler = Dependencies = [] Adjust = 0 Diagnostics = diagnostics - Output = None + Output = None Compilation = FS fsSource } let (errors, warnings) = partitionErrors diagnostics @@ -752,18 +782,18 @@ module rec Compiler = let options = fs.Options |> Array.ofList use script = new FSharpScript(additionalArgs=options) - let ((evalresult: Result), (err: FSharpDiagnostic[])) = script.Eval(source) + let (evalResult: Result), (err: FSharpDiagnostic[]) = script.Eval(source) let diagnostics = err |> fromFSharpDiagnostic let result = { OutputPath = None Dependencies = [] Adjust = 0 Diagnostics = diagnostics - Output = Some(EvalOutput evalresult) + Output = Some (EvalOutput evalResult) Compilation = FS fs } let (errors, warnings) = partitionErrors diagnostics - let evalError = match evalresult with Ok _ -> false | _ -> true + let evalError = match evalResult with Ok _ -> false | _ -> true if evalError || errors.Length > 0 || (warnings.Length > 0 && not fs.IgnoreWarnings) then CompilationResult.Failure result else @@ -812,7 +842,7 @@ module rec Compiler = Dependencies = [] Adjust = 0 Diagnostics = [] - Output = None + Output = None Compilation = cUnit } if errors.Count > 0 then @@ -971,19 +1001,19 @@ module rec Compiler = let private verifySequencePoints (reader: MetadataReader) expectedSequencePoints = - let sequencePoints = + let sequencePoints = [ for sp in reader.MethodDebugInformation do let mdi = reader.GetMethodDebugInformation sp yield! mdi.GetSequencePoints() ] |> List.sortBy (fun sp -> sp.StartLine) |> List.map (fun sp -> (Line sp.StartLine, Col sp.StartColumn, Line sp.EndLine, Col sp.EndColumn) ) - + if sequencePoints <> expectedSequencePoints then failwith $"Expected sequence points are different from PDB.\nExpected: %A{expectedSequencePoints}\nActual: %A{sequencePoints}" let private verifyDocuments (reader: MetadataReader) expectedDocuments = - let documents = + let documents = [ for doc in reader.Documents do if not doc.IsNil then let di = reader.GetDocument doc @@ -992,7 +1022,7 @@ module rec Compiler = let name = reader.GetString nmh name ] |> List.sort - + let expectedDocuments = expectedDocuments |> List.sort if documents <> expectedDocuments then @@ -1102,7 +1132,7 @@ module rec Compiler = match result with | CompilationResult.Success _ -> result | CompilationResult.Failure r -> - let message = + let message = [ sprintf "Operation failed (expected to succeed).\n All errors:\n%A\n" r.Diagnostics match r.Output with | Some (ExecutionOutput output) -> @@ -1113,12 +1143,12 @@ module rec Compiler = let shouldFail (result: CompilationResult) : CompilationResult = match result with - | CompilationResult.Success _ -> failwith "Operation was succeeded (expected to fail)." + | CompilationResult.Success _ -> failwith "Operation succeeded (expected to fail)." | CompilationResult.Failure _ -> result let private assertResultsCategory (what: string) (selector: CompilationOutput -> ErrorInfo list) (expected: ErrorInfo list) (result: CompilationResult) : CompilationResult = match result with - | CompilationResult.Success r + | CompilationResult.Success r | CompilationResult.Failure r -> assertErrors what r.Adjust (selector r) expected result @@ -1187,6 +1217,12 @@ module rec Compiler = let private diagnosticMatches (pattern: string) (diagnostics: ErrorInfo list) : bool = diagnostics |> List.exists (fun d -> Regex.IsMatch(d.Message, pattern)) + let withDiagnosticMessage (message: string) (result: CompilationResult) : CompilationResult = + let messages = [for d in result.Output.Diagnostics -> d.Message] + if not (messages |> List.exists ((=) message)) then + failwith $"Message:\n{message}\n\nwas not found. All diagnostic messages:\n{messages}" + result + let withDiagnosticMessageMatches (pattern: string) (result: CompilationResult) : CompilationResult = match result with | CompilationResult.Success r @@ -1222,30 +1258,24 @@ module rec Compiler = withWarningMessages [message] result let withExitCode (expectedExitCode: int) (result: CompilationResult) : CompilationResult = - match result with - | CompilationResult.Success r - | CompilationResult.Failure r -> - match r.Output with - | None -> failwith "Execution output is missing, cannot check exit code." - | Some o -> - match o with - | ExecutionOutput e -> Assert.AreEqual(e.ExitCode, expectedExitCode, sprintf "Exit code was expected to be: %A, but got %A." expectedExitCode e.ExitCode) - | _ -> failwith "Cannot check exit code on this run result." + match result.RunOutput with + | None -> failwith "Execution output is missing, cannot check exit code." + | Some o -> + match o with + | ExecutionOutput e -> Assert.AreEqual(e.ExitCode, expectedExitCode, sprintf "Exit code was expected to be: %A, but got %A." expectedExitCode e.ExitCode) + | _ -> failwith "Cannot check exit code on this run result." result let private checkOutput (category: string) (substring: string) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = - match result with - | CompilationResult.Success r - | CompilationResult.Failure r -> - match r.Output with - | None -> failwith (sprintf "Execution output is missing cannot check \"%A\"" category) - | Some o -> - match o with - | ExecutionOutput e -> - let where = selector e - if not (where.Contains(substring)) then - failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category where) - | _ -> failwith "Cannot check output on this run result." + match result.RunOutput with + | None -> failwith (sprintf "Execution output is missing cannot check \"%A\"" category) + | Some o -> + match o with + | ExecutionOutput e -> + let where = selector e + if not (where.Contains(substring)) then + failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category where) + | _ -> failwith "Cannot check output on this run result." result let withOutputContains (substring: string) (result: CompilationResult) : CompilationResult = @@ -1257,23 +1287,13 @@ module rec Compiler = let withStdErrContains (substring: string) (result: CompilationResult) : CompilationResult = checkOutput "STDERR" substring (fun o -> o.StdErr) result - // TODO: probably needs a bit of simplification, + need to remove that pyramid of doom. let private assertEvalOutput (selector: FsiValue -> 'T) (value: 'T) (result: CompilationResult) : CompilationResult = - match result with - | CompilationResult.Success r - | CompilationResult.Failure r -> - match r.Output with - | None -> failwith "Execution output is missing cannot check value." - | Some o -> - match o with - | EvalOutput e -> - match e with - | Ok v -> - match v with - | None -> failwith "Cannot assert value of evaluation, since it is None." - | Some e -> Assert.AreEqual(value, (selector e)) - | Result.Error ex -> raise ex - | _ -> failwith "Only 'eval' output is supported." + match result.RunOutput with + | None -> failwith "Execution output is missing cannot check value." + | Some (EvalOutput (Ok (Some e))) -> Assert.AreEqual(value, (selector e)) + | Some (EvalOutput (Ok None )) -> failwith "Cannot assert value of evaluation, since it is None." + | Some (EvalOutput (Result.Error ex)) -> raise ex + | Some _ -> failwith "Only 'eval' output is supported." result // TODO: Need to support for: @@ -1285,3 +1305,21 @@ module rec Compiler = let withEvalTypeEquals t (result: CompilationResult) : CompilationResult = assertEvalOutput (fun (x: FsiValue) -> x.ReflectionType) t result + + let signatureText (checkResults: FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults) = + checkResults.GenerateSignature() + |> Option.defaultWith (fun _ -> failwith "Unable to generate signature text.") + + let signaturesShouldContain (expected: string) cUnit = + let text = + cUnit + |> typecheckResults + |> signatureText + + let actual = + text.ToString().Split('\n') + |> Array.map (fun s -> s.TrimEnd(' ')) + |> Array.filter (fun s -> s.Length > 0) + + if not (actual |> Array.contains expected) then + failwith ($"The following signature:\n%s{expected}\n\nwas not found in:\n" + (actual |> String.concat "\n")) diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 6378786e97d..daab582a61b 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -471,7 +471,7 @@ module rec CompilerAssertHelpers = compilationRefs, deps - let rec compileCompilationAux outputDirectory (disposals: ResizeArray) ignoreWarnings (cmpl: Compilation) : (FSharpDiagnostic[] * string) * string list = + let compileCompilationAux outputDirectory (disposals: ResizeArray) ignoreWarnings (cmpl: Compilation) : (FSharpDiagnostic[] * string) * string list = let compilationRefs, deps = evaluateReferences outputDirectory disposals ignoreWarnings cmpl let isExe, sources, options, name = @@ -493,7 +493,7 @@ module rec CompilerAssertHelpers = res, (deps @ deps2) - let rec compileCompilation ignoreWarnings (cmpl: Compilation) f = + let compileCompilation ignoreWarnings (cmpl: Compilation) f = let disposals = ResizeArray() try let outputDirectory = DirectoryInfo(tryCreateTemporaryDirectory()) @@ -509,10 +509,10 @@ module rec CompilerAssertHelpers = let rec returnCompilation (cmpl: Compilation) ignoreWarnings = let outputDirectory = match cmpl with - | Compilation(_, _, _, _, _, Some outputDirectory) -> DirectoryInfo(outputDirectory.FullName) - | Compilation(_, _, _, _, _, _) -> DirectoryInfo(tryCreateTemporaryDirectory()) + | Compilation(outputDirectory = Some outputDirectory) -> DirectoryInfo(outputDirectory.FullName) + | Compilation _ -> DirectoryInfo(tryCreateTemporaryDirectory()) - outputDirectory.Create() |> ignore + outputDirectory.Create() compileCompilationAux outputDirectory (ResizeArray()) ignoreWarnings cmpl let executeBuiltAppAndReturnResult (outputFilePath: string) (deps: string list) : (int * string * string) = @@ -623,10 +623,14 @@ Updated automatically, please check diffs in your pull request, changes must be static member DefaultProjectOptions = defaultProjectOptions static member GenerateFsInputPath() = - Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".fs")) + let path = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".fs")) + printfn $"input path = {path}" + path static member GenerateDllOutputPath() = - Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".dll")) + let path = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Path.GetRandomFileName(), ".dll")) + printfn $"output path = {path}" + path static member CompileWithErrors(cmpl: Compilation, expectedErrors, ?ignoreWarnings) = let ignoreWarnings = defaultArg ignoreWarnings false diff --git a/tests/FSharp.Test.Utilities/DirectoryAttribute.fs b/tests/FSharp.Test.Utilities/DirectoryAttribute.fs index 57819a2f036..abb37e0b6c5 100644 --- a/tests/FSharp.Test.Utilities/DirectoryAttribute.fs +++ b/tests/FSharp.Test.Utilities/DirectoryAttribute.fs @@ -28,7 +28,7 @@ type DirectoryAttribute(dir: string) = result let dirInfo = normalizePathSeparator (Path.GetFullPath(dir)) - let outputDirectory name = + let outputDirectory methodName extraDirectory = // If the executing assembly has 'artifacts\bin' in it's path then we are operating normally in the CI or dev tests // Thus the output directory will be in a subdirectory below where we are executing. // The subdirectory will be relative to the source directory containing the test source file, @@ -36,7 +36,7 @@ type DirectoryAttribute(dir: string) = // When the source code is in: // $(repo-root)\tests\FSharp.Compiler.ComponentTests\Conformance\PseudoCustomAttributes // and the test is running in the FSharp.Compiler.ComponentTeststest library - // The output directory will be: + // The output directory will be: // artifacts\bin\FSharp.Compiler.ComponentTests\$(Flavour)\$(TargetFramework)\tests\FSharp.Compiler.ComponentTests\Conformance\PseudoCustomAttributes // // If we can't find anything then we execute in the directory containing the source @@ -51,7 +51,7 @@ type DirectoryAttribute(dir: string) = let testPaths = dirInfo.Replace(testRoot, "").Split('/') testPaths[0] <- "tests" Path.Combine(testPaths) - let n = Path.Combine(testlibraryLocation, testSourceDirectory.Trim('/'), normalizeName name) + let n = Path.Combine(testlibraryLocation, testSourceDirectory.Trim('/'), normalizeName methodName, extraDirectory) let outputDirectory = new DirectoryInfo(n) Some outputDirectory else @@ -69,13 +69,19 @@ type DirectoryAttribute(dir: string) = | true -> Some (File.ReadAllText path) | _ -> None - let createCompilationUnit path fs name = - let outputDirectory = outputDirectory name + let createCompilationUnit path (filename: string) methodName multipleFiles = + // if there are multiple files being processed, add extra directory for each test to avoid reference file conflicts + let extraDirectory = + if multipleFiles then + filename.Substring(0, filename.Length - 3) // remove .fs + |> normalizeName + else "" + let outputDirectory = outputDirectory methodName extraDirectory let outputDirectoryPath = match outputDirectory with | Some path -> path.FullName | None -> failwith "Can't set the output directory" - let sourceFilePath = normalizePathSeparator (path ++ fs) + let sourceFilePath = normalizePathSeparator (path ++ filename) let fsBslFilePath = sourceFilePath + ".err.bsl" let ilBslFilePath = let ilBslPaths = [| @@ -109,8 +115,8 @@ type DirectoryAttribute(dir: string) = | Some s -> s | None -> sourceFilePath + baselineSuffix + ".il.bsl" - let fsOutFilePath = normalizePathSeparator (Path.ChangeExtension(outputDirectoryPath ++ fs, ".err")) - let ilOutFilePath = normalizePathSeparator ( Path.ChangeExtension(outputDirectoryPath ++ fs, ".il")) + let fsOutFilePath = normalizePathSeparator (Path.ChangeExtension(outputDirectoryPath ++ filename, ".err")) + let ilOutFilePath = normalizePathSeparator ( Path.ChangeExtension(outputDirectoryPath ++ filename, ".il")) let fsBslSource = readFileOrDefault fsBslFilePath let ilBslSource = readFileOrDefault ilBslFilePath @@ -126,7 +132,7 @@ type DirectoryAttribute(dir: string) = } Options = [] OutputType = Library - Name = Some fs + Name = Some filename IgnoreWarnings = false References = [] OutputDirectory = outputDirectory } |> FS @@ -154,6 +160,8 @@ type DirectoryAttribute(dir: string) = if not <| FileSystem.FileExistsShim(f) then failwithf "Requested file \"%s\" not found.\nAll files: %A.\nIncludes:%A." f allFiles includes + let multipleFiles = fsFiles |> Array.length > 1 + fsFiles - |> Array.map (fun fs -> createCompilationUnit dirInfo fs method.Name) + |> Array.map (fun fs -> createCompilationUnit dirInfo fs method.Name multipleFiles) |> Seq.map (fun c -> [| c |]) diff --git a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs index 1c89e249e8f..289d171226e 100644 --- a/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs +++ b/tests/fsharp/Compiler/Language/DefaultInterfaceMemberTests.fs @@ -561,8 +561,8 @@ namespace CSharpTest open System open CSharpTest -let inline callStatic< ^T when ^T : (static member StaticMethod : int * int -> int)> x y = - ( ^T : (static member StaticMethod : int * int -> int) (x, y)) +let inline callStatic<^T when ^T : (static member StaticMethod : int * int -> int)> x y = + (^T : (static member StaticMethod : int * int -> int) (x, y)) let f1 () = callStatic 1 2 @@ -4726,8 +4726,8 @@ open CSharpTest type I3 = inherit I2 -let inline callStatic< ^T when ^T : (static member StaticMethod : int * int -> int)> x y = - let value = ( ^T : (static member StaticMethod : int * int -> int) (x, y)) +let inline callStatic<^T when ^T : (static member StaticMethod : int * int -> int)> x y = + let value = (^T : (static member StaticMethod : int * int -> int) (x, y)) Console.Write value let f1 () = @@ -4882,8 +4882,8 @@ namespace CSharpTest open System open CSharpTest -let inline callStatic< ^T when ^T : (static member StaticMethod : int * int -> int)> x y = - ( ^T : (static member StaticMethod : int * int -> int) (x, y)) +let inline callStatic<^T when ^T : (static member StaticMethod : int * int -> int)> x y = + (^T : (static member StaticMethod : int * int -> int) (x, y)) let f () = callStatic 1 2 @@ -4935,8 +4935,8 @@ type FSharpClass() = interface I1 interface I2 -let inline callStatic< ^T when ^T : (static member StaticMethod : int * int -> int)> x y = - ( ^T : (static member StaticMethod : int * int -> int) (x, y)) +let inline callStatic<^T when ^T : (static member StaticMethod : int * int -> int)> x y = + (^T : (static member StaticMethod : int * int -> int) (x, y)) let f () = callStatic 1 2 diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl index fa5c8fbaf67..1bd18780642 100644 --- a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl @@ -1,7 +1,7 @@ E_LessThanDotOpenParen001.fsx(23,12,23,15): typecheck error FS0043: No overloads match for method 'op_PlusPlusPlus'. -Known return type: ^a +Known return type: ^a Known type parameters: < (string -> int) , TestType > diff --git a/tests/fsharp/core/members/ops/test.fsx b/tests/fsharp/core/members/ops/test.fsx index 60d2570355f..4c0581d42ca 100644 --- a/tests/fsharp/core/members/ops/test.fsx +++ b/tests/fsharp/core/members/ops/test.fsx @@ -359,7 +359,7 @@ module MiscOperatorOverloadTests = module OperatorConstraintsWithExplicitRigidTypeParameters = type M() = class end - let inline empty< ^R when ( ^R or M) : (static member ( $ ) : ^R * M -> ^R)> = + let inline empty< ^R when ( ^R or M) : (static member ( $ ) : ^R * M -> ^R)> = let m = M() Unchecked.defaultof< ^R> $ m: ^R diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index 8ca98d0f472..a0bae709394 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1838,7 +1838,7 @@ module SRTPFix = let inline fmap (f : ^a -> ^b) (a : ^c) = fmap_instance (f, a) - let inline replace (a : ^a) (f : ^b) : ^a0 when (CFunctor or ^b) : (static member replace : ^a * ^b -> ^a0) = + let inline replace (a : ^a) (f : ^b) : ^a0 when (CFunctor or ^b) : (static member replace : ^a * ^b -> ^a0) = replace_instance (a, f) (* diff --git a/tests/fsharp/core/syntax/test.fsx b/tests/fsharp/core/syntax/test.fsx index e26783d7f31..8ca6dbc98e1 100644 --- a/tests/fsharp/core/syntax/test.fsx +++ b/tests/fsharp/core/syntax/test.fsx @@ -89,7 +89,7 @@ module MoreDynamicOpTests = static member ($) (x:int , M) = 0 static member ($) (x:float , M) = 0.0 - let inline empty< ^R, ^M when (^R or ^M) : (static member ($) : ^R * M -> ^R) and ^M :> M> = + let inline empty< ^R, ^M when (^R or ^M) : (static member ($) : ^R * M -> ^R) and ^M :> M> = let m = M() ((^R or ^M) : (static member ($): ^R * M -> ^R ) (Unchecked.defaultof<'R>, m)) @@ -102,7 +102,7 @@ module MoreDynamicOpTests = static member ($) (x:int , M) = 0 static member ($) (x:float , M) = 0.0 - let inline empty< ^R when ( ^R or M) : (static member ( $ ) : ^R * M -> ^R)> = + let inline empty< ^R when ( ^R or M) : (static member ( $ ) : ^R * M -> ^R)> = let m = M() Unchecked.defaultof< ^R> $ m: ^R diff --git a/tests/fsharp/regression/5531/test.fs b/tests/fsharp/regression/5531/test.fs index 4059b772bfd..a8dfbdc5429 100644 --- a/tests/fsharp/regression/5531/test.fs +++ b/tests/fsharp/regression/5531/test.fs @@ -6,7 +6,7 @@ type Derived() = inherit Base() member this.Foo() = printfn "Derived" -let inline callFoo< ^T when ^T : (member Foo: unit -> unit) > (t: ^T) = +let inline callFoo<^T when ^T : (member Foo: unit -> unit) > (t: ^T) = (^T : (member Foo: unit -> unit) (t)) let b = Base() diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl index ee9b9d3dde2..fcd4fb9de75 100644 --- a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -1,7 +1,7 @@ neg_generic_known_argument_types.fsx(9,16,9,49): typecheck error FS0041: A unique overload for method 'Foo' could not be determined based on type information prior to this program point. A type annotation may be needed. -Known types of arguments: ^fa * 'fb * 'a * argD: 'c when ^fa: (member X: ^fa * ^b -> ^b) and ^b: (member BBBB: ^b -> unit) +Known types of arguments: ^fa * 'fb * 'a * argD: 'c when ^fa: (member X: ^b -> ^b) and ^b: (member BBBB: unit -> unit) Candidates: - static member A.Foo: argA1: 'a * argB1: ('a -> 'b) * argC1: ('a -> 'b) * argD: ('a -> 'b) * argZ1: 'zzz -> 'b diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl index dfe5a058b04..698171eac59 100644 --- a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl @@ -6,21 +6,21 @@ Known return type: MonoidSample Known type parameters: < MonoidSample , Zero > Available overloads: - - static member Zero.Zero: ^t * Default1 -> ^t when ^t: (static member Zero: ^t) // Argument at index 1 doesn't match - - static member Zero.Zero: ^t * Default1 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match - - static member Zero.Zero: ^t * Default2 -> ^t when (FromInt32 or ^t) : (static member FromInt32: ^t * FromInt32 -> (int32 -> ^t)) // Argument at index 1 doesn't match - - static member Zero.Zero: ^t * Default2 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match - - static member Zero.Zero: ^t * Default3 -> ^t when ^t: (static member get_Empty: ^t) // Argument at index 1 doesn't match - static member Zero.Zero: 'a array * Zero -> 'a array // Argument at index 1 doesn't match - static member Zero.Zero: 'a list * Zero -> 'a list // Argument at index 1 doesn't match - static member Zero.Zero: 'a option * Zero -> 'a option // Argument at index 1 doesn't match - - static member Zero.Zero: ('T -> ^Monoid) * Zero -> ('T -> ^Monoid) when (Zero or ^Monoid) : (static member Zero: ^Monoid * Zero -> ^Monoid) // Argument at index 1 doesn't match - - static member Zero.Zero: Async< ^a> * Zero -> Async< ^a> when (Zero or ^a) : (static member Zero: ^a * Zero -> ^a) // Argument at index 1 doesn't match - - static member Zero.Zero: Lazy< ^a> * Zero -> Lazy< ^a> when (Zero or ^a) : (static member Zero: ^a * Zero -> ^a) // Argument at index 1 doesn't match + - static member Zero.Zero: ('T -> ^Monoid) * Zero -> ('T -> ^Monoid) when (Zero or ^Monoid) : (static member Zero: ^Monoid * Zero -> ^Monoid) // Argument at index 1 doesn't match + - static member Zero.Zero: Async<^a> * Zero -> Async<^a> when (Zero or ^a) : (static member Zero: ^a * Zero -> ^a) // Argument at index 1 doesn't match + - static member Zero.Zero: Lazy<^a> * Zero -> Lazy<^a> when (Zero or ^a) : (static member Zero: ^a * Zero -> ^a) // Argument at index 1 doesn't match - static member Zero.Zero: Map<'a,'b> * Zero -> Map<'a,'b> when 'a: comparison // Argument at index 1 doesn't match - static member Zero.Zero: ResizeArray<'a> * Zero -> ResizeArray<'a> // Argument at index 1 doesn't match - static member Zero.Zero: Set<'a> * Zero -> Set<'a> when 'a: comparison // Argument at index 1 doesn't match - static member Zero.Zero: System.TimeSpan * Zero -> System.TimeSpan // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default1 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default1 -> ^t when ^t: (static member Zero: ^t) // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default2 -> ('a1 -> 'a1) when ^t: null and ^t: struct // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default2 -> ^t when (FromInt32 or ^t) : (static member FromInt32: ^t * FromInt32 -> (int32 -> ^t)) // Argument at index 1 doesn't match + - static member Zero.Zero: ^t * Default3 -> ^t when ^t: (static member Empty: ^t) // Argument at index 1 doesn't match - static member Zero.Zero: seq<'a> * Zero -> seq<'a> // Argument at index 1 doesn't match - static member Zero.Zero: string * Zero -> string // Argument at index 1 doesn't match - static member Zero.Zero: unit * Zero -> unit // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx index db2b2ae297c..947735d0e84 100644 --- a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx @@ -74,7 +74,7 @@ type Zero with static member Zero (_: seq<'a> , _: Zero) = Seq.empty : seq<'a> let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y -let inline zero< ^Monoid when (Zero or ^Monoid) : (static member Zero : ^Monoid * Zero -> ^Monoid) > : ^Monoid = Zero.Invoke () +let inline zero<^Monoid when (Zero or ^Monoid) : (static member Zero : ^Monoid * Zero -> ^Monoid) > : ^Monoid = Zero.Invoke () type MonoidSample = | MonoidSample of int diff --git a/tests/fsharp/typecheck/sigs/neg02.bsl b/tests/fsharp/typecheck/sigs/neg02.bsl index b7119f8e1d4..5e83ca4d14b 100644 --- a/tests/fsharp/typecheck/sigs/neg02.bsl +++ b/tests/fsharp/typecheck/sigs/neg02.bsl @@ -2,5 +2,3 @@ neg02.fs(6,8,6,15): parse error FS0046: The identifier 'virtual' is reserved for future use by F# neg02.fs(6,8,6,15): parse error FS0010: Unexpected identifier in member definition - -neg02.fs(17,7,17,13): parse error FS0010: Unexpected keyword 'static' in member definition. Expected 'member', 'override' or other token. diff --git a/tests/fsharp/typecheck/sigs/neg02.vsbsl b/tests/fsharp/typecheck/sigs/neg02.vsbsl new file mode 100644 index 00000000000..914fb1c02a6 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg02.vsbsl @@ -0,0 +1,10 @@ + +neg02.fs(6,8,6,15): parse error FS0046: The identifier 'virtual' is reserved for future use by F# + +neg02.fs(6,8,6,15): parse error FS0010: Unexpected identifier in member definition + +neg02.fs(17,21,17,26): typecheck error FS3351: Feature 'static abstract interface members' is not supported by target runtime. + +neg02.fs(17,21,17,26): typecheck error FS3350: Feature 'static abstract interface members' is not available in F# 6.0. Please use language version 'PREVIEW' or greater. + +neg02.fs(17,21,17,24): typecheck error FS0855: No abstract or interface member was found that corresponds to this override diff --git a/tests/fsharp/typecheck/sigs/neg112.bsl b/tests/fsharp/typecheck/sigs/neg112.bsl index e6d4ed7bc8e..23711fb3b4d 100644 --- a/tests/fsharp/typecheck/sigs/neg112.bsl +++ b/tests/fsharp/typecheck/sigs/neg112.bsl @@ -1,6 +1,6 @@ -neg112.fs(20,49,20,62): typecheck error FS0001: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' +neg112.fs(20,49,20,62): typecheck error FS0001: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' -neg112.fs(20,31,20,39): typecheck error FS0043: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' +neg112.fs(20,31,20,39): typecheck error FS0043: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' -neg112.fs(20,31,20,39): typecheck error FS0043: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' +neg112.fs(20,31,20,39): typecheck error FS0043: A type parameter is missing a constraint 'when (Tuple or ^options) : (static member TupleMap: ^options * Tuple -> (('item -> ^value) -> ^values))' diff --git a/tests/fsharp/typecheck/sigs/neg112.fs b/tests/fsharp/typecheck/sigs/neg112.fs index b544ee5834b..9fe032348cd 100644 --- a/tests/fsharp/typecheck/sigs/neg112.fs +++ b/tests/fsharp/typecheck/sigs/neg112.fs @@ -13,8 +13,8 @@ type IOption<'T> = let inline tupleMap f x = Tuple.Map f x -let inline addOptionValues< ^value, ^options, ^values, 'item when - 'item :> IOption< ^value>> +let inline addOptionValues<^value, ^options, ^values, 'item when + 'item :> IOption<^value>> (addUp : ^values -> ^value, sourceOptions : ^options) = let getValue (i : 'item) = i.Value let allValues : ^values = tupleMap getValue sourceOptions diff --git a/tests/fsharp/typecheck/sigs/neg116.bsl b/tests/fsharp/typecheck/sigs/neg116.bsl index e5225d4225e..9bd22489ddc 100644 --- a/tests/fsharp/typecheck/sigs/neg116.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.bsl @@ -1,7 +1,7 @@ neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. -Known return type: ^a +Known return type: ^a Known type parameters: < float , Polynomial > diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl index 8dd725f4721..44484072f2a 100644 --- a/tests/fsharp/typecheck/sigs/neg117.bsl +++ b/tests/fsharp/typecheck/sigs/neg117.bsl @@ -6,5 +6,5 @@ Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[]) Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.[] , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > Available overloads: - - static member Neg117.Superpower.Transformer.Transform: ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform: ^f * Neg117.TargetB.TargetB -> (Neg117.TargetB.TransformerKind -> ^f)) // Argument at index 1 doesn't match - - static member Neg117.Superpower.Transformer.Transform: ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform: ^r * Neg117.TargetA.TargetA -> (Neg117.TargetA.TransformerKind -> ^r)) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform: ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform: ^f * Neg117.TargetB.TargetB -> (Neg117.TargetB.TransformerKind -> ^f)) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform: ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform: ^r * Neg117.TargetA.TargetA -> (Neg117.TargetA.TransformerKind -> ^r)) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg119.bsl b/tests/fsharp/typecheck/sigs/neg119.bsl index 9bbdf9ccdaa..ffd7087e301 100644 --- a/tests/fsharp/typecheck/sigs/neg119.bsl +++ b/tests/fsharp/typecheck/sigs/neg119.bsl @@ -8,5 +8,5 @@ Known type parameters: < obj , Applicatives.Ap > Available overloads: - static member Applicatives.Ap.Return: ('r -> 'a) * Ap: Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match - static member Applicatives.Ap.Return: System.Tuple<'a> * Ap: Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match - - static member Applicatives.Ap.Return: r: ^R * obj -> ('a1 -> ^R) when ^R: (static member Return: 'a1 -> ^R) // Argument 'r' doesn't match + - static member Applicatives.Ap.Return: r: ^R * obj -> ('a1 -> ^R) when ^R: (static member Return: 'a1 -> ^R) // Argument 'r' doesn't match - static member Applicatives.Ap.Return: seq<'a> * Ap: Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg129.bsl b/tests/fsharp/typecheck/sigs/neg129.bsl index 82773932a9f..e15fe4a71a4 100644 --- a/tests/fsharp/typecheck/sigs/neg129.bsl +++ b/tests/fsharp/typecheck/sigs/neg129.bsl @@ -1,9 +1,9 @@ neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -Known return type: ^output +Known return type: ^output -Known type parameters: < bigint , ^output > +Known type parameters: < bigint , ^output > Candidates: - static member witnesses.convert_witness: x: bigint * _output: Complex -> Complex diff --git a/tests/fsharp/typecheck/sigs/neg131.bsl b/tests/fsharp/typecheck/sigs/neg131.bsl index 7015901cf41..2319a3914d4 100644 --- a/tests/fsharp/typecheck/sigs/neg131.bsl +++ b/tests/fsharp/typecheck/sigs/neg131.bsl @@ -4,5 +4,5 @@ neg131.fs(15,9,15,55): typecheck error FS0041: A unique overload for method 'Som Known types of arguments: 'a * ('b -> int) Candidates: - - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: ( ^T -> int) -> int when ^T: (member get_Length: ^T -> int) - static member OverloadsWithSrtp.SomeMethod: x: 'T list * f: ('T list -> int) -> int + - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: (^T -> int) -> int when ^T: (member Length: int) diff --git a/tests/fsharp/typecheck/sigs/neg132.bsl b/tests/fsharp/typecheck/sigs/neg132.bsl index ed2b768854a..5bed67dbd41 100644 --- a/tests/fsharp/typecheck/sigs/neg132.bsl +++ b/tests/fsharp/typecheck/sigs/neg132.bsl @@ -6,5 +6,5 @@ neg132.fs(15,9,15,55): typecheck error FS0041: A unique overload for method 'Som Known types of arguments: 'a * ('b -> int) Candidates: - - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: ( ^T -> int) -> int when ^T: (member get_Length: ^T -> int) - static member OverloadsWithSrtp.SomeMethod: x: 'T list * f: ('T list -> int) -> int + - static member OverloadsWithSrtp.SomeMethod: x: ^T * f: (^T -> int) -> int when ^T: (member Length: int) diff --git a/tests/fsharp/typecheck/sigs/neg61.bsl b/tests/fsharp/typecheck/sigs/neg61.bsl index 1493d479a29..b1ba15a77ad 100644 --- a/tests/fsharp/typecheck/sigs/neg61.bsl +++ b/tests/fsharp/typecheck/sigs/neg61.bsl @@ -45,7 +45,7 @@ neg61.fs(56,16,56,19): typecheck error FS0039: The value or constructor 'zip' is neg61.fs(60,13,60,21): typecheck error FS3145: This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. -neg61.fs(60,13,60,21): typecheck error FS0193: This expression is a function value, i.e. is missing arguments. Its type is ^a -> ^a. +neg61.fs(60,13,60,21): typecheck error FS0193: This expression is a function value, i.e. is missing arguments. Its type is ^a -> ^a. neg61.fs(64,13,64,20): typecheck error FS3145: This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. diff --git a/tests/fsharp/typecheck/sigs/pos35.fs b/tests/fsharp/typecheck/sigs/pos35.fs index 8848c965cd5..ed7c76a5617 100644 --- a/tests/fsharp/typecheck/sigs/pos35.fs +++ b/tests/fsharp/typecheck/sigs/pos35.fs @@ -138,7 +138,7 @@ module SelectOverloadedWitnessBasedOnReturnTypeByPassingDummyArgumentAndUsingOut // // The resulting type is like this: // - // val inline inst : num:bigint -> ^output when (witnesses or bigint or ^output) : (static member convert_witness : bigint * ^output -> ^output) + // val inline inst : num:bigint -> ^output when (witnesses or bigint or ^output) : (static member convert_witness : bigint * ^output -> ^output) let inline inst (num: bigint) : ^output = convert num let i1 : int32 = inst 777I let i2 : int64 = inst 777I diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/E_MalformedShortUnicode01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/E_MalformedShortUnicode01.fs index 943ef86b14a..8cfbdf32924 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/E_MalformedShortUnicode01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/E_MalformedShortUnicode01.fs @@ -4,8 +4,8 @@ // Verify error with malformed short unicode character // NOTE: I've jazzed up the error messages since they will be interprited as RegExs... -//Unexpected quote symbol in binding -//Unexpected quote symbol in binding +//Unexpected character '\\' in expression. Expected identifier or other token +//Unexpected character '\\' in expression. Expected identifier or other token //Unexpected character '\\' in binding let tooShort = '\u266' diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/ByRef04.fsx b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/ByRef04.fsx index 99363967af9..f399c1a6144 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/ByRef04.fsx +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/ByRef04.fsx @@ -1,9 +1,9 @@ // #ByRef #Regression #inline // Regression test for DevDiv:122445 ("Internal compiler error when evaluating code with inline/byref") //val inline f: -// x: string -> y: nativeptr< \^a> -> bool -// when \^a: unmanaged and -// \^a: \(static member TryParse: string \* nativeptr< \^a> -> bool\) +// x: string -> y: nativeptr<\^a> -> bool +// when \^a: unmanaged and +// \^a: \(static member TryParse: string \* nativeptr<\^a> -> bool\) // Should compile just fine let inline f x (y:_ nativeptr) = (^a : (static member TryParse : string * ^a nativeptr -> bool)(x,y)) diff --git a/tests/projects/Sample_ConsoleApp_net7/Program.fs b/tests/projects/Sample_ConsoleApp_net7/Program.fs new file mode 100644 index 00000000000..c6b3afc58b6 --- /dev/null +++ b/tests/projects/Sample_ConsoleApp_net7/Program.fs @@ -0,0 +1,117 @@ +// SDK version 7.0.100-preview.6 or newer has to be installed for this to work +open System.Numerics + +type IAdditionOperator<'T when 'T :> IAdditionOperator<'T>> = + static abstract op_Addition: 'T * 'T -> 'T // Produces FS3535, advanced feature warning. + +type ISinOperator<'T when 'T :> ISinOperator<'T>> = + static abstract Sin: 'T -> 'T // Produces FS3535, advanced feature warning. + +let square (x: 'T when 'T :> IMultiplyOperators<'T,'T,'T>) = x * x +// ^--- autocompletion works here + +let zero (x: 'T when 'T :> INumber<'T>) = 'T.Zero + +let add<'T when IAdditionOperators<'T, 'T, 'T>>(x: 'T) (y: 'T) = x + y +let min<'T when INumber<'T>> (x: 'T) (y: 'T) = 'T.Min(x, y) +// ^ ^-------^--- no type params autocompletion +// +-- no completion here + +// Some declaration tests: +let fAdd<'T when 'T :> IAdditionOperator<'T>>(x: 'T, y: 'T) = x + y +let fSin<'T when ISinOperator<'T>>(x: 'T) = sin x +let fAdd'(x: 'T when 'T :> IAdditionOperator<'T>, y: 'T) = x + y +let fSin'(x: 'T when ISinOperator<'T>) = sin x +let fAdd''(x: #IAdditionOperator<'T>, y) = x + y // Produces FS0064 for x (the construct causes code to be less generic...) +let fSin''(x: #ISinOperator<'T>) = sin x // Produces FS0064 for x (the construct causes code to be less generic...) +let fAdd'''(x: #IAdditionOperator<_>, y) = x + y // Does not produce FS0064 +let fSin'''(x: #ISinOperator<_>) = sin x // Does not produce FS0064 + +type AverageOps<'T when 'T: (static member (+): 'T * 'T -> 'T) + and 'T: (static member DivideByInt : 'T*int -> 'T) + and 'T: (static member Zero : 'T)> = 'T + +let inline f_AverageOps<'T when AverageOps<'T>>(xs: 'T[]) = + let mutable sum = 'T.Zero + for x in xs do + sum <- sum + x + 'T.DivideByInt(sum, xs.Length) +// ^--- autocomplete works here just fine + +let testZeroProp () = + let i = 1I + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1m + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1y + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1uy + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1s + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1us + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1l + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1ul + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1u + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1un + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1L + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1UL + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1F + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i = 1.0 + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + + let i : char = 'a' + let z = zero i + let h = System.Convert.ToByte(z).ToString("x2") + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {h} ({i.GetType().ToString()})" + + let i = '1'B + let z = zero i + printfn $"Get zero for {i} ({i.GetType().ToString()}) = {z} ({i.GetType().ToString()})" + +[] +let main _ = + let x = 40 + let y = 20 + printfn $"Square of {x} is {square x}!" + printfn $"{x} + {y} is {add x y}!" + printfn $"Min of {x} and {y} is {min x y}" + + testZeroProp () + + 0 diff --git a/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj new file mode 100644 index 00000000000..622de34bbdb --- /dev/null +++ b/tests/projects/Sample_ConsoleApp_net7/Sample_ConsoleApp_net7.fsproj @@ -0,0 +1,20 @@ + + + + Exe + net7.0 + preview + + + + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll + False + True + + + + + + + diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index abb8dcbe10a..b02aef87d28 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -1909,3 +1909,4 @@ do let x = 1 in () | ToolTipText [ToolTipElement.Group [data]] -> data.MainDescription |> Array.map (fun text -> text.Text) |> String.concat "" |> shouldEqual "val x: int" | elements -> failwith $"Tooltip elements: {elements}" + diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 9a1f6d6bb56..69b4cf1fcb3 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -3334,7 +3334,7 @@ let ``Test ProjectForWitnesses1 GetWitnessPassingInfo`` () = nm |> shouldEqual "callX$W" argTypes.Count |> shouldEqual 1 let argText = argTypes[0].Type.ToString() - argText |> shouldEqual "type ^T -> ^U -> ^V" + argText |> shouldEqual "type ^T -> ^U -> ^V" end @@ -3356,8 +3356,8 @@ let ``Test ProjectForWitnesses1 GetWitnessPassingInfo`` () = let argText1 = argTypes[0].Type.ToString() let argName2 = argTypes[1].Name let argText2 = argTypes[1].Type.ToString() - argText1 |> shouldEqual "type ^T -> ^U -> Microsoft.FSharp.Core.unit" - argText2 |> shouldEqual "type ^T -> ^U -> Microsoft.FSharp.Core.unit" + argText1 |> shouldEqual "type ^T -> ^U -> Microsoft.FSharp.Core.unit" + argText2 |> shouldEqual "type ^T -> ^U -> Microsoft.FSharp.Core.unit" end @@ -3504,9 +3504,9 @@ let ``Test ProjectForWitnesses3 GetWitnessPassingInfo`` () = let argName2 = argTypes[1].Name let argText2 = argTypes[1].Type.ToString() argName1 |> shouldEqual (Some "get_Zero") - argText1 |> shouldEqual "type Microsoft.FSharp.Core.unit -> ^T" + argText1 |> shouldEqual "type Microsoft.FSharp.Core.unit -> ^T" argName2 |> shouldEqual (Some "op_Addition") - argText2 |> shouldEqual "type ^T -> ^T -> ^T" + argText2 |> shouldEqual "type ^T -> ^T -> ^T" end //--------------------------------------------------------------------------------------------------------- diff --git a/tests/service/SyntaxTreeTests/MemberFlagTests.fs b/tests/service/SyntaxTreeTests/MemberFlagTests.fs index 464884ae055..b95d91bae9d 100644 --- a/tests/service/SyntaxTreeTests/MemberFlagTests.fs +++ b/tests/service/SyntaxTreeTests/MemberFlagTests.fs @@ -89,25 +89,25 @@ type Foo = SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ - SynMemberDefn.AutoProperty(memberFlags= mkFlags1) - SynMemberDefn.AutoProperty(memberFlags= mkFlags2) - SynMemberDefn.AutoProperty(memberFlags= mkFlags3) - SynMemberDefn.AutoProperty(memberFlags= mkFlags4) + SynMemberDefn.AutoProperty(memberFlags= flags1) + SynMemberDefn.AutoProperty(memberFlags= flags2) + SynMemberDefn.AutoProperty(memberFlags= flags3) + SynMemberDefn.AutoProperty(memberFlags= flags4) ])) ], _) ]) ])) -> - let ({ Trivia = flagsTrivia1 } : SynMemberFlags) = mkFlags1 SynMemberKind.Member + let ({ Trivia = flagsTrivia1 } : SynMemberFlags) = flags1 assertRange (3, 4) (3, 10) flagsTrivia1.StaticRange.Value assertRange (3, 11) (3, 17) flagsTrivia1.MemberRange.Value - let ({ Trivia = flagsTrivia2 } : SynMemberFlags) = mkFlags2 SynMemberKind.Member + let ({ Trivia = flagsTrivia2 } : SynMemberFlags) = flags2 assertRange (4, 4) (4, 10) flagsTrivia2.MemberRange.Value - let ({ Trivia = flagsTrivia3 } : SynMemberFlags) = mkFlags3 SynMemberKind.Member + let ({ Trivia = flagsTrivia3 } : SynMemberFlags) = flags3 assertRange (5, 4) (5, 12) flagsTrivia3.OverrideRange.Value - let ({ Trivia = flagsTrivia4 } : SynMemberFlags) = mkFlags4 SynMemberKind.Member + let ({ Trivia = flagsTrivia4 } : SynMemberFlags) = flags4 assertRange (6, 4) (6, 11) flagsTrivia4.DefaultRange.Value | _ -> Assert.Fail "Could not get valid AST" diff --git a/vsintegration/tests/Directory.Build.props b/vsintegration/tests/Directory.Build.props deleted file mode 100644 index 5737505f968..00000000000 --- a/vsintegration/tests/Directory.Build.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - true - portable - - - diff --git a/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs b/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs index e94163042e4..f0a158b694b 100644 --- a/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs +++ b/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading diff --git a/vsintegration/tests/UnitTests/BreakpointResolutionService.fs b/vsintegration/tests/UnitTests/BreakpointResolutionService.fs index 09b5e105857..1081471994e 100644 --- a/vsintegration/tests/UnitTests/BreakpointResolutionService.fs +++ b/vsintegration/tests/UnitTests/BreakpointResolutionService.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading @@ -72,7 +72,7 @@ let main argv = let searchPosition = code.IndexOf(searchToken) Assert.IsTrue(searchPosition >= 0, "SearchToken '{0}' is not found in code", searchToken) - let document, sourceText = RoslynTestHelpers.CreateDocument(fileName, code) + let document, sourceText = RoslynTestHelpers.CreateSingleDocumentSolution(fileName, code) let searchSpan = TextSpan.FromBounds(searchPosition, searchPosition + searchToken.Length) let actualResolutionOption = FSharpBreakpointResolutionService.GetBreakpointLocation(document, searchSpan) |> Async.RunSynchronously diff --git a/vsintegration/tests/UnitTests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs index ea808bc81a9..debcc4296a8 100644 --- a/vsintegration/tests/UnitTests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -2,7 +2,7 @@ // To run the tests in this file: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn.CompletionProviderTests +module VisualFSharp.UnitTests.Editor.CompletionProviderTests open System open System.Linq @@ -36,8 +36,9 @@ let formatCompletions(completions : string seq) = "\n\t" + String.Join("\n\t", completions) let VerifyCompletionListWithOptions(fileContents: string, marker: string, expected: string list, unexpected: string list, opts) = + let options = projectOptions opts let caretPosition = fileContents.IndexOf(marker) + marker.Length - let document, _ = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents, options = options) let results = FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [])) |> Async.RunSynchronously @@ -46,23 +47,23 @@ let VerifyCompletionListWithOptions(fileContents: string, marker: string, expect let expectedFound = expected - |> Seq.filter results.Contains + |> List.filter results.Contains let expectedNotFound = expected - |> Seq.filter (expectedFound.Contains >> not) + |> List.filter (expectedFound.Contains >> not) let unexpectedNotFound = unexpected - |> Seq.filter (results.Contains >> not) + |> List.filter (results.Contains >> not) let unexpectedFound = unexpected - |> Seq.filter (unexpectedNotFound.Contains >> not) + |> List.filter (unexpectedNotFound.Contains >> not) // If either of these are true, then the test fails. - let hasExpectedNotFound = not (Seq.isEmpty expectedNotFound) - let hasUnexpectedFound = not (Seq.isEmpty unexpectedFound) + let hasExpectedNotFound = not (List.isEmpty expectedNotFound) + let hasUnexpectedFound = not (List.isEmpty unexpectedFound) if hasExpectedNotFound || hasUnexpectedFound then let expectedNotFoundMsg = @@ -82,13 +83,15 @@ let VerifyCompletionListWithOptions(fileContents: string, marker: string, expect let msg = sprintf "%s%s%s" expectedNotFoundMsg unexpectedFoundMsg completionsMsg Assert.Fail(msg) + let VerifyCompletionList(fileContents, marker, expected, unexpected) = VerifyCompletionListWithOptions(fileContents, marker, expected, unexpected, [| |]) -let VerifyCompletionListExactly(fileContents: string, marker: string, expected: string list) = +let VerifyCompletionListExactlyWithOptions(fileContents: string, marker: string, expected: string list, opts) = + let options = projectOptions opts let caretPosition = fileContents.IndexOf(marker) + marker.Length - let document, _ = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents, options = options) let actual = FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [])) |> Async.RunSynchronously @@ -105,6 +108,9 @@ let VerifyCompletionListExactly(fileContents: string, marker: string, expected: (String.Join("; ", actualNames |> List.map (sprintf "\"%s\""))) (String.Join("\n", actual |> List.map (fun x -> sprintf "%s => %s" x.DisplayText x.SortText)))) +let VerifyCompletionListExactly(fileContents: string, marker: string, expected: string list) = + VerifyCompletionListExactlyWithOptions(fileContents, marker, expected, [| |]) + let VerifyNoCompletionList(fileContents: string, marker: string) = VerifyCompletionListExactly(fileContents, marker, []) @@ -333,7 +339,7 @@ type T1 = member this.M2 = "literal" let x = $"1 not the same as {System.Int32.MaxValue} is it" """ - VerifyCompletionListWithOptions(fileContents, "System.", ["Console"; "Array"; "String"], ["T1"; "M1"; "M2"], [| "/langversion:preview" |]) + VerifyCompletionList(fileContents, "System.", ["Console"; "Array"; "String"], ["T1"; "M1"; "M2"]) [] let ``Class instance members are ordered according to their kind and where they are defined (simple case, by a variable)``() = @@ -860,6 +866,44 @@ let emptyMap<'keyType, 'lValueType> () = """ VerifyCompletionList(fileContents, ", l", ["LanguagePrimitives"; "List"; "lValueType"], ["let"; "log"]) -#if EXE -ShouldDisplaySystemNamespace() -#endif +[] +let ``Completion list for interface with static abstract method type invocation contains static property with residue``() = + let fileContents = """ +type IStaticProperty<'T when 'T :> IStaticProperty<'T>> = + static abstract StaticProperty: 'T + +let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) = + 'T.StaticProperty +""" + VerifyCompletionListWithOptions(fileContents, "'T.Stati", ["StaticProperty"], [], [| "/langversion:preview" |]) + +[] +let ``Completion list for interface with static abstract method type invocation contains static property after dot``() = + let fileContents = """ +type IStaticProperty<'T when 'T :> IStaticProperty<'T>> = + static abstract StaticProperty: 'T + +let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) = + 'T.StaticProperty +""" + VerifyCompletionListWithOptions(fileContents, "'T.", ["StaticProperty"], [], [| "/langversion:preview" |]) + + +[] +let ``Completion list for SRTP invocation contains static property with residue``() = + let fileContents = """ +let inline f_StaticProperty_SRTP<'T when 'T : (static member StaticProperty: 'T) >() = + 'T.StaticProperty + +""" + VerifyCompletionListWithOptions(fileContents, "'T.Stati", ["StaticProperty"], [], [| "/langversion:preview" |]) + +[] +let ``Completion list for SRTP invocation contains static property after dot``() = + let fileContents = """ +let inline f_StaticProperty_SRTP<'T when 'T : (static member StaticProperty: 'T) >() = + 'T.StaticProperty + +""" + VerifyCompletionListWithOptions(fileContents, "'T.", ["StaticProperty"], [], [| "/langversion:preview" |]) + diff --git a/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs b/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs index c9674a89861..b438c0b96ff 100644 --- a/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs +++ b/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading @@ -40,7 +40,7 @@ type DocumentDiagnosticAnalyzerTests() = let getDiagnostics (fileContents: string) = async { - let document, _ = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) let! syntacticDiagnostics = FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(document, DiagnosticsType.Syntax) let! semanticDiagnostics = FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(document, DiagnosticsType.Semantic) return syntacticDiagnostics.AddRange(semanticDiagnostics) diff --git a/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs index 8ca66298300..322d3f37eed 100644 --- a/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs +++ b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs @@ -4,7 +4,7 @@ // To run the tests in this file: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests [] -module Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn.DocumentHighlightsServiceTests +module VisualFSharp.UnitTests.Editor.DocumentHighlightsServiceTests open System open System.Threading @@ -36,7 +36,7 @@ let internal projectOptions = { } let private getSpans (sourceText: SourceText) (caretPosition: int) = - let document = RoslynTestHelpers.CreateDocument(filePath, sourceText) + let document = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, sourceText) FSharpDocumentHighlightsService.GetDocumentHighlights(document, caretPosition) |> Async.RunSynchronously |> Option.defaultValue [||] diff --git a/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs index 915129f0c17..739b2600f6e 100644 --- a/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs +++ b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System diff --git a/vsintegration/tests/UnitTests/FsxCompletionProviderTests.fs b/vsintegration/tests/UnitTests/FsxCompletionProviderTests.fs index 4a0e2f2dcfe..45a415ea187 100644 --- a/vsintegration/tests/UnitTests/FsxCompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/FsxCompletionProviderTests.fs @@ -2,7 +2,7 @@ // // To run the tests in this file: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Collections.Generic @@ -40,7 +40,7 @@ type Worker () = member _.VerifyCompletionListExactly(fileContents: string, marker: string, expected: List) = let caretPosition = fileContents.IndexOf(marker) + marker.Length - let document = RoslynTestHelpers.CreateDocument(filePath, SourceText.From(fileContents), options = projectOptions) + let document = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, SourceText.From(fileContents), options = projectOptions) let expected = expected |> Seq.toList let actual = let x = FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [])) @@ -76,6 +76,3 @@ module FsxCompletionProviderTests = // We execute in a seperate appdomain so that we can set BaseDirectory to a non-existent location getWorker().VerifyCompletionListExactly(fileContents, "fsi.", expected) -#if EXE -ShouldTriggerCompletionInFsxFile() -#endif diff --git a/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs index 811086e051f..fa9e0ca2937 100644 --- a/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs +++ b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs @@ -2,7 +2,7 @@ // // To run the tests in this file: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.IO @@ -17,7 +17,7 @@ open FSharp.Compiler.EditorServices open FSharp.Compiler.Text open UnitTests.TestLib.LanguageService -[][] +[] module GoToDefinitionServiceTests = let userOpName = "GoToDefinitionServiceTests" @@ -58,13 +58,14 @@ module GoToDefinitionServiceTests = Stamp = None } - let GoToDefinitionTest (fileContents: string, caretMarker: string, expected) = + let GoToDefinitionTest (fileContents: string, caretMarker: string, expected, opts) = let filePath = Path.GetTempFileName() + ".fs" File.WriteAllText(filePath, fileContents) + let options = makeOptions filePath opts let caretPosition = fileContents.IndexOf(caretMarker) + caretMarker.Length - 1 // inside the marker - let document, sourceText = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, sourceText = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents, options = options) let actual = findDefinition(document, sourceText, caretPosition, []) |> Option.map (fun range -> (range.StartLine, range.EndLine, range.StartColumn, range.EndColumn)) @@ -73,7 +74,7 @@ module GoToDefinitionServiceTests = Assert.Fail(sprintf "Incorrect information returned for fileContents=<<<%s>>>, caretMarker=<<<%s>>>, expected =<<<%A>>>, actual = <<<%A>>>" fileContents caretMarker expected actual) [] - let VerifyDefinition() = + let ``goto definition smoke test``() = let manyTestCases = [ @@ -110,10 +111,10 @@ let _ = Module1.foo 1 for caretMarker, expected in testCases do printfn "Test case: caretMarker=<<<%s>>>" caretMarker - GoToDefinitionTest (fileContents, caretMarker, expected) + GoToDefinitionTest (fileContents, caretMarker, expected, [| |]) [] - let VerifyDefinitionStringInterpolation() = + let ``goto definition for string interpolation``() = let fileContents = """ let xxxxx = 1 @@ -121,9 +122,19 @@ let yyyy = $"{abc{xxxxx}def}" """ let caretMarker = "xxxxx" let expected = Some(2, 2, 4, 9) - GoToDefinitionTest (fileContents, caretMarker, expected) + GoToDefinitionTest (fileContents, caretMarker, expected, [| |]) -#if EXE - VerifyDefinition() - VerifyDefinitionStringInterpolation() -#endif \ No newline at end of file + [] + let ``goto definition for static abstract method invocation``() = + + let fileContents = """ +type IStaticProperty<'T when 'T :> IStaticProperty<'T>> = + static abstract StaticProperty: 'T + +let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) = + 'T.StaticProperty +""" + let caretMarker = "'T.StaticProperty" + let expected = Some(3, 3, 20, 34) + + GoToDefinitionTest (fileContents, caretMarker, expected, [| "/langversion:preview" |]) diff --git a/vsintegration/tests/UnitTests/HelpContextServiceTests.fs b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs index b1ea19c2ad7..248535527f3 100644 --- a/vsintegration/tests/UnitTests/HelpContextServiceTests.fs +++ b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading @@ -10,7 +10,7 @@ open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis -open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.CodeAnalysis open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.FSharp.LanguageService open UnitTests.TestLib.Utils @@ -19,63 +19,58 @@ open UnitTests.TestLib.LanguageService [][] type HelpContextServiceTests() = - let fileName = "C:\\test.fs" - let options: FSharpProjectOptions = { - ProjectFileName = "C:\\test.fsproj" - ProjectId = None - SourceFiles = [| fileName |] - ReferencedProjects = [| |] - OtherOptions = [| |] - IsIncompleteTypeCheckEnvironment = true - UseScriptResolutionRules = false - LoadTime = DateTime.MaxValue - UnresolvedReferences = None - ExtraProjectInfo = None - OriginalLoadReferences = [] - Stamp = None - } - - let markers (source:string) = + let filePath = "C:\\test.fs" + let makeOptions args = + { + ProjectFileName = "C:\\test.fsproj" + ProjectId = None + SourceFiles = [| filePath |] + ReferencedProjects = [| |] + OtherOptions = args + IsIncompleteTypeCheckEnvironment = true + UseScriptResolutionRules = false + LoadTime = DateTime.MaxValue + OriginalLoadReferences = [] + UnresolvedReferences = None + Stamp = None + } + + let getMarkers (source:string) = let mutable cnt = 0 - [ - for i in 0 .. (source.Length - 1) do - if source.[i] = '$' then - yield (i - cnt) - cnt <- cnt + 1 + [ for i in 0 .. (source.Length - 1) do + if source.[i] = '$' then + yield (i - cnt) + cnt <- cnt + 1 ] - member private this.TestF1Keywords(expectedKeywords: string option list, lines : string list, ?addtlRefAssy : list) = - let newOptions = - let refs = - defaultArg addtlRefAssy [] - |> List.map (fun r -> "-r:" + r) - |> Array.ofList - { options with OtherOptions = Array.append options.OtherOptions refs } - - let fileContents = String.Join("\r\n", lines) - let version = fileContents.GetHashCode() - let sourceText = SourceText.From(fileContents.Replace("$", "")) - - let res = [ - for marker in markers fileContents do - let span = Microsoft.CodeAnalysis.Text.TextSpan(marker, 0) - let textLine = sourceText.Lines.GetLineFromPosition(marker) - let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) - let classifiedSpans = Tokenizer.getClassifiedSpans(documentId, sourceText, textLine.Span, Some "test.fs", [], CancellationToken.None) - - yield FSharpHelpContextService.GetHelpTerm(checker, sourceText, fileName, newOptions, span, classifiedSpans, version) - |> Async.RunSynchronously - ] - let equalLength = List.length expectedKeywords = List.length res + let TestF1KeywordsWithOptions(expectedKeywords: string option list, lines : string list, opts : string[]) = + let options = makeOptions opts + + let fileContentsWithMarkers = String.Join("\r\n", lines) + let fileContents = fileContentsWithMarkers.Replace("$", "") + let document, sourceText = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents, options = options) + + let markers = getMarkers fileContentsWithMarkers + let res = + [ for marker in markers do + let span = Microsoft.CodeAnalysis.Text.TextSpan(marker, 0) + let textLine = sourceText.Lines.GetLineFromPosition(marker) + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let classifiedSpans = Tokenizer.getClassifiedSpans(documentId, sourceText, textLine.Span, Some "test.fs", [], CancellationToken.None) + + FSharpHelpContextService.GetHelpTerm(document, span, classifiedSpans) |> Async.RunSynchronously + ] + let equalLength = (expectedKeywords.Length = res.Length) Assert.True(equalLength) - List.iter2(fun exp res -> + for (exp, res) in List.zip expectedKeywords res do Assert.AreEqual(exp, res) - ) expectedKeywords res + let TestF1Keywords(expectedKeywords, lines) = + TestF1KeywordsWithOptions(expectedKeywords, lines, [| |]) [] - member public this.``NoKeyword.Negative`` () = + member _.``F1 help keyword NoKeyword.Negative`` () = let file = [ "let s = \"System.Con$sole\"" "let n = 999$99" @@ -84,19 +79,19 @@ type HelpContextServiceTests() = "#endif" ] let keywords = [ None; None; None ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Preprocessor`` () = + member _.``F1 help keyword Preprocessor`` () = let file = [ "#i$f foobaz" "#e$ndif" ] let keywords = [ Some "#if_FS"; Some "#endif_FS" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Regression.DotNetMethod.854364``() = + member _.``F1 help keyword Regression.DotNetMethod.854364``() = let file = [ "let i : int = 42" "i.ToStri$ng()" @@ -106,10 +101,10 @@ type HelpContextServiceTests() = [ Some "System.Int32.ToString" Some "System.Int32.ToString" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Namespaces`` () = + member _.``F1 help keyword Namespaces`` () = let file = [ "open Syst$em.N$et" "open System.I$O" @@ -123,10 +118,10 @@ type HelpContextServiceTests() = Some "System.IO" Some "System.Console" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Namespaces.BeforeDot`` () = + member _.``F1 help keyword Namespaces.BeforeDot`` () = let file = [ "open System$.Net$" "open System$.IO" @@ -145,10 +140,10 @@ type HelpContextServiceTests() = Some "System" Some "System.Console" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Namespaces.AfterDot`` () = + member _.``F1 help keyword Namespaces.AfterDot`` () = let file = [ "open $System.$Net" "open $System.IO" @@ -168,10 +163,10 @@ type HelpContextServiceTests() = Some "System.Console" Some "System.Console.WriteLine" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``QuotedIdentifiers``() = + member _.``F1 help keyword QuotedIdentifiers``() = let file = [ "let `$`escaped func`` x y = x + y" @@ -193,10 +188,10 @@ type HelpContextServiceTests() = Some "Test.z" Some "Test.z" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Attributes`` () = + member _.``F1 help keyword Attributes`` () = let file = [ "open System.Runtime.InteropServices" @@ -206,7 +201,7 @@ type HelpContextServiceTests() = " []" " val mutable f : int" " []" - " member this.Run() = ()" + " member _.Run() = ()" "[]" "type Y = class end" ] @@ -217,14 +212,14 @@ type HelpContextServiceTests() = Some "System.Runtime.CompilerServices.MethodImplAttribute.#ctor" Some "System.Runtime.InteropServices.StructLayoutAttribute.Size" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] [] [] //This test case Verify that when F1 is Hit on TypeProvider namespaces it contain the right keyword - member public this.``TypeProvider.Namespaces`` () = + member _.``F1 help keyword TypeProvider.Namespaces`` () = let file = [ "open N$1" @@ -233,14 +228,13 @@ type HelpContextServiceTests() = [ Some "N1" ] - this.TestF1Keywords(keywords, file, - addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) + TestF1KeywordsWithOptions(keywords, file, [| "-r:" + PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") |]) [] [] [] //This test case Verify that when F1 is Hit on TypeProvider Type it contain the right keyword - member public this.``TypeProvider.type`` () = + member _.``F1 help keyword TypeProvider.type`` () = let file = [ @@ -251,11 +245,10 @@ type HelpContextServiceTests() = [ Some "N1.T" ] - this.TestF1Keywords(keywords, file, - addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) + TestF1KeywordsWithOptions(keywords, file, [| "-r:"+PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") |]) [] - member public this.``EndOfLine``() = + member _.``F1 help keyword EndOfLine``() = let file = [ "open System.Net$" "open System.IO$" @@ -264,10 +257,10 @@ type HelpContextServiceTests() = [ Some "System.Net" Some "System.IO" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``EndOfLine2``() = + member _.``F1 help keyword EndOfLine2``() = let file = [ "module M" "open System.Net$" @@ -277,21 +270,21 @@ type HelpContextServiceTests() = [ Some "System.Net" Some "System.IO" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Comments``() = + member _.``F1 help keyword Comments``() = let file = [ "($* co$mment *$)" "/$/ com$ment" ] let keywords = [ Some "comment_FS"; Some "comment_FS"; Some "comment_FS"; Some "comment_FS"; Some "comment_FS"; ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``FSharpEntities`` () = + member _.``F1 help keyword FSharpEntities`` () = let file = [ "let (KeyValu$e(k,v)) = null" "let w : int lis$t = []" @@ -320,10 +313,10 @@ type HelpContextServiceTests() = Some "Microsoft.FSharp.Core.Operators.Ref``1" Some "Microsoft.FSharp.Core.FSharpRef`1.contents" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Keywords`` () = + member _.``F1 help keyword Keywords`` () = let file = [ "l$et r = ref 0" "r :$= 1" @@ -338,66 +331,66 @@ type HelpContextServiceTests() = Some "<-_FS" Some "let_FS" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Regression.NewInstance.854367`` () = + member _.``F1 help keyword Regression.NewInstance.854367`` () = let file = [ "let q : System.Runtime.Remoting.TypeE$ntry = null" ] let keywords = [ Some "System.Runtime.Remoting.TypeEntry" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Regression.NewInstance.854367.2`` () = + member _.``F1 help keyword Regression.NewInstance.854367.2`` () = let file = [ "let q1 = new System.Runtime.Remoting.Type$Entry()" // this consutrctor exists but is not accessible (it is protected), but the help entry still goes to the type ] let keywords = [ Some "System.Runtime.Remoting.TypeEntry" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Classes.WebClient`` () = + member _.``F1 help keyword Classes.WebClient`` () = let file = [ "let w : System.Net.Web$Client = new System.Net.Web$Client()" ] let keywords = [ Some "System.Net.WebClient" Some "System.Net.WebClient.#ctor" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Classes.Object`` () = + member _.``F1 help keyword Classes.Object`` () = let file = [ "let w : System.Ob$ject = new System.Obj$ect()" ] let keywords = [ Some "System.Object" Some "System.Object.#ctor" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Classes.Generic`` () = + member _.``F1 help keyword Classes.Generic`` () = let file = [ "let x : System.Collections.Generic.L$ist = null" ] let keywords = [ Some "System.Collections.Generic.List`1" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Classes.Abbrev`` () = + member _.``F1 help keyword Classes.Abbrev`` () = let file = [ "let z : Resi$zeArray = null" ] let keywords = [ Some "System.Collections.Generic.List`1" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) [] - member public this.``Members`` () = + member _.``F1 help keyword Members`` () = let file = [ "open System.Linq" "open System" @@ -422,4 +415,17 @@ type HelpContextServiceTests() = Some "System.String.Equals" Some "System.Int32.ToString" ] - this.TestF1Keywords(keywords, file) + TestF1Keywords(keywords, file) + + [] + member _.``F1 help keyword static abstract interface method`` () = + let file = + ["type IStaticProperty<'T when 'T :> IStaticProperty<'T>> =" + " static abstract StaticProperty: 'T" + "" + "let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) =" + " 'T.StaticProp$erty" ] + let keywords = + [ Some "Test.IStaticProperty`1.StaticProperty" ] + TestF1Keywords(keywords, file) + diff --git a/vsintegration/tests/UnitTests/IndentationServiceTests.fs b/vsintegration/tests/UnitTests/IndentationServiceTests.fs index 7c535ccdff9..477fa4b2e93 100644 --- a/vsintegration/tests/UnitTests/IndentationServiceTests.fs +++ b/vsintegration/tests/UnitTests/IndentationServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading diff --git a/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs b/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs index 6c2968a16ca..76dc7a54681 100644 --- a/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs +++ b/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index e147e34f840..846b401b227 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -395,9 +395,11 @@ type staticInInterface = end end""" - CheckErrorList fileContent <| function - | [err] -> Assert.IsTrue(err.Message.Contains("Unexpected keyword 'static' in member definition. Expected 'member', 'override' or other token")) - | x -> Assert.Fail(sprintf "Unexpected errors: %A" x) + CheckErrorList fileContent (function + | err1 :: _ -> + Assert.IsTrue(err1.Message.Contains("No abstract or interface member was found that corresponds to this override")) + | x -> + Assert.Fail(sprintf "Unexpected errors: %A" x)) [] [] diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs index 6e2f5b08e7c..f97e58ce654 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs @@ -34,6 +34,17 @@ type References() = l.[0] + /// Create a dummy project named 'Test', build it, and then call k with the full path to the resulting exe + member this.CreateDummyTestProjectBuildItAndDo(k : string -> unit) = + this.MakeProjectAndDo(["foo.fs"], [], "", (fun project -> + // Let's create a run-of-the-mill project just to have a spare assembly around + let fooPath = Path.Combine(project.ProjectFolder, "foo.fs") + File.AppendAllText(fooPath, "namespace Foo\nmodule Bar =\n let x = 42") + let buildResult = project.Build("Build") + Assert.IsTrue buildResult.IsSuccessful + let exe = Path.Combine(project.ProjectFolder, "bin\\Debug\\Test.exe") + k exe)) + [] member this.``BasicAssemblyReferences1``() = this.MakeProjectAndDo([], ["System"], "", (fun proj -> @@ -49,7 +60,7 @@ type References() = )) [] - member public this.``AddReference.StarredAssemblyName`` () = + member this.``AddReference.StarredAssemblyName`` () = DoWithTempFile "Test.fsproj" (fun projFile -> File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [], "")) use project = TheTests.CreateProject(projFile) @@ -69,7 +80,7 @@ type References() = ) [] - member public this.``References.Bug787899.AddDuplicateUnresolved``() = + member this.``References.Bug787899.AddDuplicateUnresolved``() = // Let's create a run-of-the-mill project just to have a spare assembly around this.CreateDummyTestProjectBuildItAndDo(fun exe -> Assert.IsTrue(File.Exists exe, "failed to build exe") @@ -86,7 +97,7 @@ type References() = ) [] - member public this.``References.Bug787899.AddDuplicateResolved``() = + member this.``References.Bug787899.AddDuplicateResolved``() = // Let's create a run-of-the-mill project just to have a spare assembly around this.CreateDummyTestProjectBuildItAndDo(fun exe -> Assert.IsTrue(File.Exists exe, "failed to build exe") @@ -106,7 +117,7 @@ type References() = ) [] - member public this.``ReferenceResolution.Bug4423.LoadedFsProj.Works``() = + member this.``ReferenceResolution.Bug4423.LoadedFsProj.Works``() = this.MakeProjectAndDo(["doesNotMatter.fs"], ["mscorlib"; "System"; "System.Core"; "System.Net"], "", "v4.0", (fun project -> let expectedRefInfo = [ "mscorlib", true "System", true @@ -124,7 +135,7 @@ type References() = [] - member public this.``ReferenceResolution.Bug4423.LoadedFsProj.WithExactDuplicates``() = + member this.``ReferenceResolution.Bug4423.LoadedFsProj.WithExactDuplicates``() = this.MakeProjectAndDo(["doesNotMatter.fs"], ["System"; "System"], "", "v4.0", (fun project -> let expectedRefInfo = [ "System", true // In C#, one will be banged out, whereas "System", true] // one will be ok, but in F# both show up as ok. Bug? Not worth the effort to fix. @@ -139,7 +150,7 @@ type References() = )) [] - member public this.``ReferenceResolution.Bug4423.LoadedFsProj.WithBadDuplicates``() = + member this.``ReferenceResolution.Bug4423.LoadedFsProj.WithBadDuplicates``() = this.MakeProjectAndDo(["doesNotMatter.fs"], ["System"; "System.dll"], "", "v4.0", (fun project -> let expectedRefInfo = [ "System", false // one will be banged out "System.dll", true] // one will be ok @@ -154,7 +165,7 @@ type References() = )) [] - member public this.``ReferenceResolution.Bug4423.LoadedFsProj.WorksWithFilenames``() = + member this.``ReferenceResolution.Bug4423.LoadedFsProj.WorksWithFilenames``() = let netDir = currentFrameworkDirectory let ssmw = Path.Combine(netDir, "System.ServiceModel.Web.dll") this.MakeProjectAndDo(["doesNotMatter.fs"], [ssmw], "", "v4.0", (fun project -> @@ -170,7 +181,7 @@ type References() = )) [] - member public this.``ReferenceResolution.Bug4423.LoadedFsProj.WeirdCases``() = + member this.``ReferenceResolution.Bug4423.LoadedFsProj.WeirdCases``() = this.MakeProjectAndDo(["doesNotMatter.fs"], ["mscorlib, Version=4.0.0.0"; "System, Version=4.0.0.0"; "System.Core, Version=4.0.0.0"; "System.Net, Version=4.0.0.0"], "", "v4.0", (fun project -> let expectedRefInfo = [ "mscorlib", true "System", true @@ -186,10 +197,10 @@ type References() = AssertEqual expectedRefInfo actualRefInfo )) - member public this.ReferenceResolutionHelper(tab : AddReferenceDialogTab, fullPath : string, expectedFsprojRegex : string) = + member this.ReferenceResolutionHelper(tab : AddReferenceDialogTab, fullPath : string, expectedFsprojRegex : string) = this.ReferenceResolutionHelper(tab, fullPath, expectedFsprojRegex, "v4.0", []) - member public this.ReferenceResolutionHelper(tab : AddReferenceDialogTab, fullPath : string, expectedFsprojRegex : string, targetFrameworkVersion : string, originalReferences : string list) = + member this.ReferenceResolutionHelper(tab : AddReferenceDialogTab, fullPath : string, expectedFsprojRegex : string, targetFrameworkVersion : string, originalReferences : string list) = // Trace.Log <- "ProjectSystemReferenceResolution" // can be useful this.MakeProjectAndDo(["doesNotMatter.fs"], originalReferences, "", targetFrameworkVersion, (fun project -> let cType = @@ -207,7 +218,7 @@ type References() = )) [] - member public this.``ReferenceResolution.Bug4423.FxAssembly.NetTab.AddDuplicate1``() = + member this.``ReferenceResolution.Bug4423.FxAssembly.NetTab.AddDuplicate1``() = let netDir = currentFrameworkDirectory try this.ReferenceResolutionHelper(AddReferenceDialogTab.DotNetTab, @@ -219,8 +230,8 @@ type References() = with e -> TheTests.HelpfulAssertMatches ' ' "A reference to '.*' \\(with assembly name '.*'\\) could not be added. A reference to the component '.*' with the same assembly name already exists in the project." e.Message - // see 5491 [] - member public this.``ReferenceResolution.Bug4423.FxAssembly.NetTab.AddDuplicate2``() = +// see 5491 [] + member this.``ReferenceResolution.Bug4423.FxAssembly.NetTab.AddDuplicate2``() = let netDir = currentFrameworkDirectory try this.ReferenceResolutionHelper(AddReferenceDialogTab.DotNetTab, @@ -232,19 +243,8 @@ type References() = with e -> TheTests.HelpfulAssertMatches ' ' "A reference to '.*' could not be added. A reference to the component '.*' already exists in the project." e.Message - /// Create a dummy project named 'Test', build it, and then call k with the full path to the resulting exe - member public this.CreateDummyTestProjectBuildItAndDo(k : string -> unit) = - this.MakeProjectAndDo(["foo.fs"], [], "", (fun project -> - // Let's create a run-of-the-mill project just to have a spare assembly around - let fooPath = Path.Combine(project.ProjectFolder, "foo.fs") - File.AppendAllText(fooPath, "namespace Foo\nmodule Bar =\n let x = 42") - let buildResult = project.Build("Build") - Assert.IsTrue buildResult.IsSuccessful - let exe = Path.Combine(project.ProjectFolder, "bin\\Debug\\Test.exe") - k exe)) - [] - member public this.``ReferenceResolution.Bug4423.NonFxAssembly.BrowseTab.RelativeHintPath.InsideProjectDir``() = + member this.``ReferenceResolution.Bug4423.NonFxAssembly.BrowseTab.RelativeHintPath.InsideProjectDir``() = // Let's create a run-of-the-mill project just to have a spare assembly around this.CreateDummyTestProjectBuildItAndDo(fun exe -> Assert.IsTrue(File.Exists exe, "failed to build exe") @@ -274,9 +274,9 @@ type References() = Assert.IsTrue buildResult.IsSuccessful )) ) - + [] - member public this.``ReferenceResolution.Bug4423.NonFxAssembly.BrowseTab.RelativeHintPath.OutsideProjectDir``() = + member this.``ReferenceResolution.Bug4423.NonFxAssembly.BrowseTab.RelativeHintPath.OutsideProjectDir``() = this.MakeProjectAndDo(["foo.fs"], [], "", (fun project -> // Let's create a run-of-the-mill let fooPath = Path.Combine(project.ProjectFolder, "foo.fs") @@ -310,7 +310,7 @@ type References() = )) [] - member public this.``ReferenceResolution.Bug4423.NotAValidDll.BrowseTab``() = + member this.``ReferenceResolution.Bug4423.NotAValidDll.BrowseTab``() = let dirName = Path.GetTempPath() let dll = Path.Combine(dirName, "Foo.dll") File.AppendAllText(dll, "This is not actually a valid dll") @@ -328,7 +328,7 @@ type References() = File.Delete(dll) [] - member public this.``PathReferences.Existing`` () = + member this.``PathReferences.Existing`` () = DoWithTempFile "Test.fsproj"(fun projFile -> let dirName = Path.GetDirectoryName(projFile) let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName @@ -359,7 +359,7 @@ type References() = ) [] - member public this.``PathReferences.Existing.Captions`` () = + member this.``PathReferences.Existing.Captions`` () = DoWithTempFile "Test.fsproj"(fun projFile -> File.AppendAllText(projFile, TheTests.FsprojTextWithProjectReferences( [], // @@ -377,7 +377,7 @@ type References() = ) [] - member public this.``PathReferences.NonExistent`` () = + member this.``PathReferences.NonExistent`` () = DoWithTempFile "Test.fsproj"(fun projFile -> let refLibPath = @"c:\foo\baz\blahblah.dll" File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [refLibPath], "")) @@ -391,7 +391,7 @@ type References() = [] - member public this.``FsprojPreferencePage.ProjSupportsPrefReadWrite``() = + member this.``FsprojPreferencePage.ProjSupportsPrefReadWrite``() = let testProp = "AssemblyName" let compileItem = [@"foo.fs"] @@ -423,11 +423,12 @@ type References() = AssertContains contents newPropVal ) + // Disabled due to: https://github.com/dotnet/fsharp/issues/1460 // On DEV 15 Preview 4 the VS IDE Test fails with : // System.InvalidOperationException : Operation is not valid due to the current state of the object. // [] // Disabled due to: https://github.com/dotnet/fsharp/issues/1460 - member public this.``AddReference.COM`` () = + member this.``AddReference.COM`` () = DoWithTempFile "Test.fsproj" (fun projFile -> File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [], "")) use project = TheTests.CreateProject(projFile) diff --git a/vsintegration/tests/UnitTests/ProjectOptionsBuilder.fs b/vsintegration/tests/UnitTests/ProjectOptionsBuilder.fs index 847adf617b2..f9a20e674d6 100644 --- a/vsintegration/tests/UnitTests/ProjectOptionsBuilder.fs +++ b/vsintegration/tests/UnitTests/ProjectOptionsBuilder.fs @@ -1,4 +1,4 @@ -namespace VisualFSharp.UnitTests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.IO diff --git a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index d55dc57e2ac..7d5aa2613fd 100644 --- a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -6,7 +6,7 @@ // ------------------------------------------------------------------------------------------------------------------------ -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open NUnit.Framework @@ -82,7 +82,7 @@ let ShouldShowQuickInfoAtCorrectPositions() = System.Console.WriteLine(x + y) """ let caretPosition = fileContents.IndexOf(symbol) - let document, _ = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) let quickInfo = FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) @@ -212,7 +212,7 @@ let res7 = sin 5.0 let res8 = abs 5.0 """ let caretPosition = fileContents.IndexOf(symbol) + symbol.Length - 1 - let document, _ = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) let quickInfo = FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) diff --git a/vsintegration/tests/UnitTests/QuickInfoTests.fs b/vsintegration/tests/UnitTests/QuickInfoTests.fs index 9492088f753..fe45fead284 100644 --- a/vsintegration/tests/UnitTests/QuickInfoTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoTests.fs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System.IO open Microsoft.VisualStudio.FSharp.Editor open NUnit.Framework -open VisualFSharp.UnitTests.Roslyn +open VisualFSharp.UnitTests.Editor [] module QuickInfo = @@ -13,7 +13,7 @@ module QuickInfo = let internal GetQuickInfo (project:FSharpProject) (fileName:string) (caretPosition:int) = async { let code = File.ReadAllText(fileName) - let document, _ = RoslynTestHelpers.CreateDocument(fileName, code) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(fileName, code) return! FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) } |> Async.RunSynchronously @@ -429,7 +429,7 @@ module Test = () [] -let ``Automation.LetBindings.InModule``() = +let ``Automation.LetBindings.Module``() = let code = """ namespace FsTest @@ -444,7 +444,7 @@ module Test = () [] -let ``Automation.LetBindings.InClass``() = +let ``Automation.LetBindings.InsideType.Instance``() = let code = """ namespace FsTest @@ -459,7 +459,7 @@ module Test = StringAssert.StartsWith(expectedSignature, tooltip) [] -let ``Automation.LetBindings.StaticLet``() = +let ``Automation.LetBindings.InsideType.Static``() = let code = """ namespace FsTest @@ -475,7 +475,7 @@ module Test = () [] -let ``Automation.LetBindings.InDoBinding``() = +let ``Automation.LetBindings``() = let code = """ namespace FsTest @@ -485,11 +485,61 @@ module Test = () """ let expectedSignature = "val func: x: 'a -> unit" + let tooltip = GetQuickInfoTextFromCode code + StringAssert.StartsWith(expectedSignature, tooltip) + +[] +let ``quick info for IWSAM property get``() = + let code = """ +type IStaticProperty<'T when 'T :> IStaticProperty<'T>> = + static abstract StaticProperty: 'T +let f_IWSAM_flex_StaticProperty(x: #IStaticProperty<'T>) = + 'T.StaticPr$$operty +""" + + let expectedSignature = "property IStaticProperty.StaticProperty: 'T with get" let tooltip = GetQuickInfoTextFromCode code + StringAssert.StartsWith(expectedSignature, tooltip) +[] +let ``quick info for IWSAM method call``() = + let code = """ +type IStaticMethod<'T when 'T :> IStaticMethod<'T>> = + static abstract StaticMethod: unit -> 'T + +let f (x: #IStaticMethod<'T>) = + 'T.StaticMe$$thod() +""" + + let expectedSignature = "static abstract IStaticMethod.StaticMethod: unit -> 'T" + let tooltip = GetQuickInfoTextFromCode code StringAssert.StartsWith(expectedSignature, tooltip) - () + +[] +let ``quick info for SRTP property get``() = + let code = """ + +let inline f_StaticProperty_SRTP<'T when 'T : (static member StaticProperty: 'T) >() = + 'T.StaticPr$$operty +""" + + let expectedSignature = "'T: (static member StaticProperty: 'T)" + let tooltip = GetQuickInfoTextFromCode code + StringAssert.StartsWith(expectedSignature, tooltip) + +[] +let ``quick info for SRTP method call``() = + let code = """ + +let inline f_StaticProperty_SRTP<'T when 'T : (static member StaticMethod: unit -> 'T) >() = + 'T.StaticMe$$thod() +""" + + let expectedSignature = "'T: (static member StaticMethod: unit -> 'T)" + let tooltip = GetQuickInfoTextFromCode code + StringAssert.StartsWith(expectedSignature, tooltip) + [] let ``Display names for exceptions with backticks preserve backticks``() = @@ -513,7 +563,7 @@ type R = {| ``thing wi$$th space``: string |} StringAssert.Contains(expected, actual) () - + [] let ``Display names identifiers for active patterns with backticks preserve backticks``() = let code = """ diff --git a/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs b/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs index 54a92f3cd0b..12132dc9acd 100644 --- a/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs +++ b/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open NUnit.Framework diff --git a/vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs b/vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs index 78d0732493b..7b8d2825abe 100644 --- a/vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs +++ b/vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open NUnit.Framework @@ -33,7 +33,7 @@ type SemanticClassificationServiceTests() = let getRanges (source: string) : SemanticClassificationItem list = asyncMaybe { - let document, _ = RoslynTestHelpers.CreateDocument(filePath, source) + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, source) let! _, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("SemanticClassificationServiceTests") |> liftAsync return checkFileResults.GetSemanticClassification(None) } diff --git a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs index 7f173d259bc..805cd41c477 100644 --- a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs @@ -1,5 +1,5 @@ [] -module Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn.SignatureHelpProvider +module VisualFSharp.UnitTests.Editor.SignatureHelpProvider open System open System.IO @@ -8,7 +8,7 @@ open NUnit.Framework open Microsoft.VisualStudio.FSharp.Editor -open VisualFSharp.UnitTests.Roslyn +open VisualFSharp.UnitTests.Editor open UnitTests.TestLib.LanguageService @@ -54,7 +54,7 @@ let GetSignatureHelp (project:FSharpProject) (fileName:string) (caretPosition:in let caretLinePos = textLines.GetLinePosition(caretPosition) let caretLineColumn = caretLinePos.Character - let document = RoslynTestHelpers.CreateDocument(fileName, sourceText, options = project.Options) + let document = RoslynTestHelpers.CreateSingleDocumentSolution(fileName, sourceText, options = project.Options) let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("GetSignatureHelp") |> Async.RunSynchronously @@ -101,7 +101,7 @@ let assertSignatureHelpForMethodCalls (fileContents: string) (marker: string) (e let caretLinePos = textLines.GetLinePosition(caretPosition) let caretLineColumn = caretLinePos.Character - let document = RoslynTestHelpers.CreateDocument(filePath, sourceText, options = projectOptions) + let document = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, sourceText, options = projectOptions) let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("assertSignatureHelpForMethodCalls") |> Async.RunSynchronously @@ -132,7 +132,7 @@ let assertSignatureHelpForMethodCalls (fileContents: string) (marker: string) (e let assertSignatureHelpForFunctionApplication (fileContents: string) (marker: string) expectedArgumentCount expectedArgumentIndex expectedArgumentName = let caretPosition = fileContents.LastIndexOf(marker) + marker.Length - let document, sourceText = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, sourceText = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("assertSignatureHelpForFunctionApplication") @@ -416,7 +416,7 @@ M.f let marker = "id " let caretPosition = fileContents.IndexOf(marker) + marker.Length - let document, sourceText = RoslynTestHelpers.CreateDocument(filePath, fileContents) + let document, sourceText = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) let parseResults, checkFileResults = document.GetFSharpParseAndCheckResultsAsync("function application in single pipeline with no additional args") diff --git a/vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs b/vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs index 05b0d39e7aa..3bb4245ee4d 100644 --- a/vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs +++ b/vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace VisualFSharp.UnitTests.Editor open System open System.Threading diff --git a/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs b/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs index 4387329518f..f7de265b87b 100644 --- a/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs +++ b/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs @@ -1,4 +1,4 @@ -namespace rec Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +namespace rec VisualFSharp.UnitTests.Editor open System open System.IO @@ -16,6 +16,7 @@ open Microsoft.VisualStudio.FSharp.Editor open Microsoft.CodeAnalysis.Host.Mef open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.Shell +open FSharp.Compiler.CodeAnalysis [] module MefHelpers = @@ -226,7 +227,7 @@ type RoslynTestHelpers private () = filePath = projFilePath ) - static member CreateDocument (filePath, text: SourceText, ?options: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions) = + static member CreateSingleDocumentSolution (filePath, text: SourceText, ?options: FSharpProjectOptions) = let isScript = String.Equals(Path.GetExtension(filePath), ".fsx", StringComparison.OrdinalIgnoreCase) let workspace = new AdhocWorkspace(TestHostServices()) @@ -272,7 +273,7 @@ type RoslynTestHelpers private () = document - static member CreateDocument (filePath, code: string) = + static member CreateSingleDocumentSolution (filePath, code: string, ?options) = let text = SourceText.From(code) - RoslynTestHelpers.CreateDocument(filePath, text), text + RoslynTestHelpers.CreateSingleDocumentSolution(filePath, text, ?options = options), text diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 4caa4aa00f9..728d55383c2 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -61,57 +61,58 @@ CompilerService\UnusedOpensTests.fs - Roslyn\ProjectOptionsBuilder.fs + Editor\ProjectOptionsBuilder.fs - Roslyn\SyntacticColorizationServiceTests.fs + Editor\SyntacticColorizationServiceTests.fs - Roslyn\SemanticColorizationServiceTests.fs + Editor\SemanticColorizationServiceTests.fs - Roslyn\BraceMatchingServiceTests.fs + Editor\BraceMatchingServiceTests.fs - + Editor\EditorFormattingServiceTests.fs + + + Editor\RoslynSourceTextTests.fs - - Roslyn\IndentationServiceTests.fs + Editor\IndentationServiceTests.fs - Roslyn\BreakpointResolutionService.fs + Editor\BreakpointResolutionService.fs - Roslyn\LanguageDebugInfoServiceTests.fs + Editor\LanguageDebugInfoServiceTests.fs - Roslyn\DocumentDiagnosticAnalyzerTests.fs + Editor\DocumentDiagnosticAnalyzerTests.fs - Roslyn\CompletionProviderTests.fs + Editor\CompletionProviderTests.fs - Roslyn\FsxCompletionProviderTests.fs + Editor\FsxCompletionProviderTests.fs - Roslyn\SignatureHelpProviderTests.fs + Editor\SignatureHelpProviderTests.fs - Roslyn\QuickInfoTests.fs + Editor\QuickInfoTests.fs - Roslyn\GoToDefinitionServiceTests.fs + Editor\GoToDefinitionServiceTests.fs - Roslyn\QuickInfoProviderTests.fs + Editor\QuickInfoProviderTests.fs + + + Editor\HelpContextServiceTests.fs - Roslyn\DocumentHighlightsServiceTests.fs + Editor\DocumentHighlightsServiceTests.fs {{FSCoreVersion}} diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index d13723b9697..3271017c0d9 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -18,7 +18,7 @@ open Microsoft.VisualStudio.FSharp.Editor open Microsoft.CodeAnalysis.Host.Mef open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +open VisualFSharp.UnitTests.Editor open NUnit.Framework [] From e88e85f22160492eabc62e293eaf856e83d3c12d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 10:15:10 -0700 Subject: [PATCH 099/226] Update dependencies from https://github.com/dotnet/arcade build 20220808.3 (#13650) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22405.6 -> To Version 7.0.0-beta.22408.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9cb14371fcb..2d6155659b2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 58aed6cc9fde5155c79cf706eeccf31b03e9a8a7 + 13b342360ba81ca3fdf911fda985dc8420d51627 diff --git a/global.json b/global.json index 070687d73b7..8d3d6530e09 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22405.6", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22408.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 9007c43b9b45b46e093d53db2ce260a1ca909511 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 9 Aug 2022 19:44:12 +0200 Subject: [PATCH 100/226] fix 13607 (#13648) Co-authored-by: Vlad Zarytovskii --- .../Checking/PatternMatchCompilation.fs | 71 +++++++++++-------- .../Conformance/PatternMatching/Simple.fs | 26 ++++++- tests/fsharp/core/subtype/test.fsx | 66 +++++++++++++++++ 3 files changed, 134 insertions(+), 29 deletions(-) diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 168a9bb7f09..0b0a5e0624f 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -418,17 +418,17 @@ type Implication = /// Indicates nothing in particular | Nothing -/// Work out what one successful type test implies about a null test +/// Work out what a successful type test (against tgtTy1) implies about a null test for the same input value. /// /// Example: /// match x with -/// | :? string -> ... +/// | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test /// | null -> ... /// For any inputs where ':? string' succeeds, 'null' will fail /// /// Example: /// match x with -/// | :? (int option) -> ... +/// | :? (int option) when false -> ... // note: "when false" used so type test succeeds but proceed to next type test /// | null -> ... /// Nothing can be learned. If ':? (int option)' succeeds, 'null' may still have to be run. let computeWhatSuccessfulTypeTestImpliesAboutNullTest g tgtTy1 = @@ -437,7 +437,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutNullTest g tgtTy1 = else Implication.Fails -/// Work out what a failing type test implies about a null test. +/// Work out what a failing type test (against tgtTy1) implies about a null test for the same input value. /// /// Example: /// match x with @@ -450,17 +450,17 @@ let computeWhatFailingTypeTestImpliesAboutNullTest g tgtTy1 = else Implication.Nothing -/// Work out what one successful null test implies about a type test. +/// Work out what one successful null test implies about a type test (against tgtTy2) for the same input value. /// /// Example: /// match x with -/// | null -> ... +/// | null when false -> ... // note: "when false" used so null test succeeds but proceed to next type test /// | :? string -> ... /// For any inputs where 'null' succeeds, ':? string' will fail /// /// Example: /// match x with -/// | null -> ... +/// | null when false -> ... // note: "when false" used so null test succeeds but proceed to next type test /// | :? (int option) -> ... /// For any inputs where 'null' succeeds, ':? (int option)' will succeed let computeWhatSuccessfulNullTestImpliesAboutTypeTest g tgtTy2 = @@ -469,67 +469,79 @@ let computeWhatSuccessfulNullTestImpliesAboutTypeTest g tgtTy2 = else Implication.Fails -/// Work out what a failing null test implies about a type test. The answer is "nothing" but it's included for symmetry. +/// Work out what a failing null test implies about a type test (against tgtTy2) for the same +/// input balue. The answer is "nothing" but it's included for symmetry. let computeWhatFailingNullTestImpliesAboutTypeTest _g _tgtTy2 = Implication.Nothing -/// Work out what one successful type test implies about another type test +/// Work out what one successful type test (against tgtTy1) implies about another type test (against tgtTy2) +/// for the same input value. let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = let tgtTy1 = stripTyEqnsWrtErasure EraseAll g tgtTy1 let tgtTy2 = stripTyEqnsWrtErasure EraseAll g tgtTy2 - // A successful type test on any type implies all supertypes always succeed + // A successful type test of an input value against a type (tgtTy1) + // implies all type tests of the same input value on equivalent or + // supertypes (tgtTy2) always succeed. // // Example: // match x with - // | :? string -> ... + // | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? IComparable -> ... // // Example: // match x with - // | :? string -> ... + // | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? string -> ... // if TypeDefinitelySubsumesTypeNoCoercion 0 g amap m tgtTy2 tgtTy1 then Implication.Succeeds - // A successful type test on a sealed type implies all non-related types fail + // A successful type test of an input value against a sealed target type (tgtTy1) implies all + // type tests of the same object against a unrelated target type (tgtTy2) fails. // // Example: // match x with - // | :? int -> ... + // | :? int when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? string -> ... // // For any inputs where ':? int' succeeds, ':? string' will fail // - // This doesn't apply to related types: + // + // This only applies if tgtTy2 is not potetnially related to the sealed type tgtTy1: // match x with - // | :? int -> ... + // | :? int when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? IComparable -> ... // - // Here IComparable neither fails nor is redundant + // Here IComparable is not known to fail (NOTE: indeed it is actually known to succeed, + // give ":? int" succeeded, however this is not utilised in the analysis, because it involves coercion). + // // - // This doesn't apply to unsealed types: + // This rule also doesn't apply to unsealed types: // match x with - // | :? SomeClass -> ... + // | :? SomeUnsealedClass when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? SomeInterface -> ... + // because the input may be some subtype of SomeUnsealedClass and that type could implement SomeInterface even if + // SomeUnsealedClass doesnt. + // // - // This doesn't apply to types with null as true value: + // This rule also doesn't apply to types with null as true value: // match x with - // | :? (int option) -> ... + // | :? (int option) when false -> ... // "when false" means type test succeeds but proceed to next type test // | :? (string option) -> ... // // Here on 'null' input the first pattern succeeds, and the second pattern will also succeed elif isSealedTy g tgtTy1 && not (TypeNullIsTrueValue g tgtTy1) && - not (TypeDefinitelySubsumesTypeNoCoercion 0 g amap m tgtTy2 tgtTy1) then + not (TypeFeasiblySubsumesType 0 g amap m tgtTy2 CanCoerce tgtTy1) then Implication.Fails - // A successful type test on an unsealed class type implies type tests on unrelated non-interface types always fail + // A successful type test of an input value against an unsealed class type (tgtTy1) implies + // a type test of the same input value against an unrelated non-interface type (tgtTy2) always fails // // Example: // match x with - // | :? SomeUnsealedClass -> ... + // | :? SomeUnsealedClass when false -> ... // "when false" used so type test succeeds but proceed to next type test // | :? SomeUnrelatedClass -> ... // // For any inputs where ':? SomeUnsealedClass' succeeds, ':? SomeUnrelatedClass' will fail @@ -543,11 +555,13 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = not (TypeFeasiblySubsumesType 0 g amap m tgtTy2 CanCoerce tgtTy1) then Implication.Fails - // A successful type test on an interface type refutes sealed types that do not support that interface + // A successful type test of an input value against an interface type (tgtTy1) implies + // a type test of the same object against a sealed types (tgtTy2) that does not support that interface + // always fails. // // Example: // match x with - // | :? IComparable -> ... + // | :? IComparable when false -> ... // "when false" used so type test succeeds but proceed to next type test // | :? SomeOtherSealedClass -> ... // // For any inputs where ':? IComparable' succeeds, ':? SomeOtherSealedClass' will fail @@ -561,12 +575,13 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = else Implication.Nothing -/// Work out what one successful type test implies about another type test +/// Work out what one failing type test (tgtTy1) implies about another type test (tgtTy2) let computeWhatFailingTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = let tgtTy1 = stripTyEqnsWrtErasure EraseAll g tgtTy1 let tgtTy2 = stripTyEqnsWrtErasure EraseAll g tgtTy2 - // A failing type test on any type implies all subtypes fail + // If testing an input value against a target type (tgtTy1) fails then + // testing the same input value against an equivalent or subtype type (tgtTy2) always fails. // // Example: // match x with diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs index 14208c8644e..531da5e160c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs @@ -59,4 +59,28 @@ module Simple = |> asExe |> withLangVersionPreview |> compileExeAndRun - |> shouldSucceed \ No newline at end of file + |> shouldSucceed + + + [] + [] + [] + [] + [] + [] + let ``Test type matching for subtypes and interfaces`` typ value = + Fsx $""" +open System +let classify (o: obj) = + match o with + | :? {typ} as d when d = Unchecked.defaultof<_> -> "default" + | :? IFormattable -> "formattable" + | _ -> "not a {typ}" + +let res = classify {value} +if res <> "formattable" then + failwith $"Unexpected result: {{res}}" + """ + |> asExe + |> compileAndRun + |> shouldSucceed \ No newline at end of file diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index a0bae709394..76de2b2d520 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -2458,6 +2458,72 @@ module TestSubtypeMatching13 = check "cnwcki4d3" (toName (C())) "IA" check "cnwcki4d4" (toName (obj())) "other" +module TestStructMatching1 = + + let toName (x: obj) = + match x with + | :? int when false -> "A" // note: "when false" used so type test succeeds but proceed to next type test + | :? IComparable -> "B" + | _ -> "other" + + check "cnwcki4cewweq1" (toName 1) "B" + check "cnwcki4cewweq2" (toName "a") "B" + check "cnwcki4cewweq3" (toName System.DateTime.Now) "B" + check "cnwcki4cewweq4" (toName (obj())) "other" + +module TestStructMatching2 = + + let toName (x: obj) = + match x with + | :? DateTime when false -> "A" // note: "when false" used so type test succeeds but proceed to next type test + | :? IComparable -> "B" + | _ -> "other" + + check "cnwcki4cewweq1" (toName 1) "B" + check "cnwcki4cewweq2" (toName "a") "B" + check "cnwcki4cewweq3" (toName System.DateTime.Now) "B" + check "cnwcki4cewweq4" (toName (obj())) "other" + +module TestStructMatching3 = + + let toName (x: obj) = + match x with + | :? IComparable when false -> "A" // note: "when false" used so type test succeeds but proceed to next type test + | :? DateTime -> "B" + | _ -> "other" + + check "cnwcki4cewweq1" (toName 1) "other" + check "cnwcki4cewweq2" (toName "a") "other" + check "cnwcki4cewweq3" (toName System.DateTime.Now) "B" + check "cnwcki4cewweq4" (toName (obj())) "other" + +module TestStructMatching4 = + + let toName (x: obj) = + match x with + | :? IFormattable when false -> "A" // note: "when false" used so type test succeeds but proceed to next type test + | :? DateTime -> "B" + | _ -> "other" + + check "cnwcki4cewweq1" (toName 1) "other" + check "cnwcki4cewweq2" (toName "a") "other" + check "cnwcki4cewweq3" (toName System.DateTime.Now) "B" + check "cnwcki4cewweq4" (toName (obj())) "other" + +module TestStructMatching5 = + + let toName (x: obj) = + match x with + | :? IFormattable when false -> "A" // note: "when false" used so type test succeeds but proceed to next type test + | :? Guid -> "B" + | _ -> "other" + + check "cnwcki4cewweq11" (toName 1) "other" + check "cnwcki4cewweq22" (toName "a") "other" + check "cnwcki4cewweq33" (toName System.DateTime.Now) "other" + check "cnwcki4cewweq34" (toName (System.Guid())) "B" + check "cnwcki4cewweq45" (toName (obj())) "other" + #if !NETCOREAPP module TestConverter = open System From 3ae2acc2e04401a7a8f366b066bd5c3092c8fece Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 9 Aug 2022 20:40:29 +0200 Subject: [PATCH 101/226] Streamlining some dependencies around Microsoft.CodeAnalysis (#13637) * Streamlining dependencies around Microsoft.CodeAnalysis * Update --- eng/Versions.props | 2 +- .../FSharp.Test.Utilities.fsproj | 1 - tests/fsharp/FSharpSuite.Tests.fsproj | 4 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 2 - .../FSharp.LanguageService.fsproj | 2 - .../FSharp.PatternMatcher/BKTree.Builder.cs | 1 + .../CaseSensitiveComparison.cs | 311 ------------------ .../FSharp.PatternMatcher.csproj | 4 + .../src/FSharp.PatternMatcher/VersionStamp.cs | 253 -------------- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 1 - .../UnitTests/VisualFSharp.UnitTests.fsproj | 2 - 11 files changed, 7 insertions(+), 576 deletions(-) delete mode 100644 vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs delete mode 100644 vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs diff --git a/eng/Versions.props b/eng/Versions.props index 78c638a867e..f2b1e0e9570 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -124,7 +124,7 @@ $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) - $(RoslynVersion) + $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) 2.0.28 diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 278ee438053..0cea852926e 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -59,7 +59,6 @@ - diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 6e1daff174e..548ac9e390a 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -105,8 +105,7 @@ - + false @@ -119,7 +118,6 @@ - diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 6af186bb999..3dedf85d8e8 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -152,11 +152,9 @@ - - diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 49c902d7704..d247d927341 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -58,9 +58,7 @@ - - diff --git a/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs b/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs index 42926a67ac5..b05c1bc3453 100644 --- a/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs +++ b/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Utilities; using System; using System.Collections.Generic; diff --git a/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs b/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs deleted file mode 100644 index cfbfabd718f..00000000000 --- a/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs +++ /dev/null @@ -1,311 +0,0 @@ -using Roslyn.Utilities; -using System; -using System.Diagnostics; -using System.Globalization; -using System.Reflection.Internal; -using System.Text; - -namespace Microsoft.CodeAnalysis.Utilities -{ - internal static class CaseInsensitiveComparison - { - // PERF: Cache a TextInfo for Unicode ToLower since this will be accessed very frequently - private static readonly TextInfo s_unicodeCultureTextInfo = GetUnicodeCulture().TextInfo; - - private static CultureInfo GetUnicodeCulture() - { - try - { - // We use the "en" culture to get the Unicode ToLower mapping, as it implements - // a much more recent Unicode version (6.0+) than the invariant culture (1.0), - // and it matches the Unicode version used for character categorization. - return new CultureInfo("en"); - } - catch (ArgumentException) // System.Globalization.CultureNotFoundException not on all platforms - { - // If "en" is not available, fall back to the invariant culture. Although it has bugs - // specific to the invariant culture (e.g. being version-locked to Unicode 1.0), at least - // we can rely on it being present on all platforms. - return CultureInfo.InvariantCulture; - } - } - - /// - /// ToLower implements the Unicode lowercase mapping - /// as described in ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt. - /// VB uses these mappings for case-insensitive comparison. - /// - /// - /// If is upper case, then this returns its Unicode lower case equivalent. Otherwise, is returned unmodified. - public static char ToLower(char c) - { - // PERF: This is a very hot code path in VB, optimize for ASCII - - // Perform a range check with a single compare by using unsigned arithmetic - if (unchecked((uint)(c - 'A')) <= ('Z' - 'A')) - { - return (char)(c | 0x20); - } - - if (c < 0xC0) // Covers ASCII (U+0000 - U+007F) and up to the next upper-case codepoint (Latin Capital Letter A with Grave) - { - return c; - } - - return ToLowerNonAscii(c); - } - - private static char ToLowerNonAscii(char c) - { - if (c == '\u0130') - { - // Special case Turkish I (LATIN CAPITAL LETTER I WITH DOT ABOVE) - // This corrects for the fact that the invariant culture only supports Unicode 1.0 - // and therefore does not "know about" this character. - return 'i'; - } - - return s_unicodeCultureTextInfo.ToLower(c); - } - - /// - /// This class seeks to perform the lowercase Unicode case mapping. - /// - private sealed class OneToOneUnicodeComparer : StringComparer - { - private static int CompareLowerUnicode(char c1, char c2) - { - return (c1 == c2) ? 0 : ToLower(c1) - ToLower(c2); - } - - public override int Compare(string str1, string str2) - { - if ((object)str1 == str2) - { - return 0; - } - - if ((object)str1 == null) - { - return -1; - } - - if ((object)str2 == null) - { - return 1; - } - - int len = Math.Min(str1.Length, str2.Length); - for (int i = 0; i < len; i++) - { - int ordDiff = CompareLowerUnicode(str1[i], str2[i]); - if (ordDiff != 0) - { - return ordDiff; - } - } - - // return the smaller string, or 0 if they are equal in length - return str1.Length - str2.Length; - } - - private static bool AreEqualLowerUnicode(char c1, char c2) - { - return c1 == c2 || ToLower(c1) == ToLower(c2); - } - - public override bool Equals(string str1, string str2) - { - if ((object)str1 == str2) - { - return true; - } - - if ((object)str1 == null || (object)str2 == null) - { - return false; - } - - if (str1.Length != str2.Length) - { - return false; - } - - for (int i = 0; i < str1.Length; i++) - { - if (!AreEqualLowerUnicode(str1[i], str2[i])) - { - return false; - } - } - - return true; - } - - public static bool EndsWith(string value, string possibleEnd) - { - if ((object)value == possibleEnd) - { - return true; - } - - if ((object)value == null || (object)possibleEnd == null) - { - return false; - } - - int i = value.Length - 1; - int j = possibleEnd.Length - 1; - - if (i < j) - { - return false; - } - - while (j >= 0) - { - if (!AreEqualLowerUnicode(value[i], possibleEnd[j])) - { - return false; - } - - i--; - j--; - } - - return true; - } - - public static bool StartsWith(string value, string possibleStart) - { - if ((object)value == possibleStart) - { - return true; - } - - if ((object)value == null || (object)possibleStart == null) - { - return false; - } - - if (value.Length < possibleStart.Length) - { - return false; - } - - for (int i = 0; i < possibleStart.Length; i++) - { - if (!AreEqualLowerUnicode(value[i], possibleStart[i])) - { - return false; - } - } - - return true; - } - - public override int GetHashCode(string str) - { - int hashCode = Hash.FnvOffsetBias; - - for (int i = 0; i < str.Length; i++) - { - hashCode = Hash.CombineFNVHash(hashCode, ToLower(str[i])); - } - - return hashCode; - } - } - - /// - /// Returns a StringComparer that compares strings according the VB identifier comparison rules. - /// - private static readonly OneToOneUnicodeComparer s_comparer = new OneToOneUnicodeComparer(); - - /// - /// Returns a StringComparer that compares strings according the VB identifier comparison rules. - /// - public static StringComparer Comparer => s_comparer; - - /// - /// Determines if two VB identifiers are equal according to the VB identifier comparison rules. - /// - /// First identifier to compare - /// Second identifier to compare - /// true if the identifiers should be considered the same. - public static bool Equals(string left, string right) => s_comparer.Equals(left, right); - - /// - /// Determines if the string 'value' end with string 'possibleEnd'. - /// - /// - /// - /// - public static bool EndsWith(string value, string possibleEnd) => OneToOneUnicodeComparer.EndsWith(value, possibleEnd); - - /// - /// Determines if the string 'value' starts with string 'possibleStart'. - /// - /// - /// - /// - public static bool StartsWith(string value, string possibleStart) => OneToOneUnicodeComparer.StartsWith(value, possibleStart); - - /// - /// Compares two VB identifiers according to the VB identifier comparison rules. - /// - /// First identifier to compare - /// Second identifier to compare - /// -1 if < , 1 if > , 0 if they are equal. - public static int Compare(string left, string right) => s_comparer.Compare(left, right); - - /// - /// Gets a case-insensitive hash code for VB identifiers. - /// - /// identifier to get the hash code for - /// The hash code for the given identifier - public static int GetHashCode(string value) - { - Debug.Assert(value != null); - - return s_comparer.GetHashCode(value); - } - - /// - /// Convert a string to lower case per Unicode - /// - /// - /// - public static string ToLower(string value) - { - if ((object)value == null) - return null; - - if (value.Length == 0) - return value; - - var pooledStrbuilder = PooledStringBuilder.GetInstance(); - StringBuilder builder = pooledStrbuilder.Builder; - - builder.Append(value); - ToLower(builder); - - return pooledStrbuilder.ToStringAndFree(); - } - - /// - /// In-place convert string in StringBuilder to lower case per Unicode rules - /// - /// - public static void ToLower(StringBuilder builder) - { - if (builder == null) - return; - - for (int i = 0; i < builder.Length; i++) - { - builder[i] = ToLower(builder[i]); - } - } - } -} diff --git a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj index 5005944c7fa..20617fd7527 100644 --- a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj +++ b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj @@ -17,4 +17,8 @@ + + + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs b/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs deleted file mode 100644 index 5f27e306a0d..00000000000 --- a/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs +++ /dev/null @@ -1,253 +0,0 @@ -using Roslyn.Utilities; -using System; -using System.Diagnostics.Contracts; -using System.Threading; - -namespace Microsoft.CodeAnalysis -{ - /// - /// VersionStamp should be only used to compare versions returned by same API. - /// - internal struct VersionStamp : IEquatable, IObjectWritable - { - public static VersionStamp Default => default(VersionStamp); - - private const int GlobalVersionMarker = -1; - private const int InitialGlobalVersion = 10000; - - /// - /// global counter to avoid collision within same session. - /// it starts with a big initial number just for a clarity in debugging - /// - private static int s_globalVersion = InitialGlobalVersion; - - /// - /// time stamp - /// - private readonly DateTime _utcLastModified; - - /// - /// indicate whether there was a collision on same item - /// - private readonly int _localIncrement; - - /// - /// unique version in same session - /// - private readonly int _globalIncrement; - - private VersionStamp(DateTime utcLastModified) - : this(utcLastModified, 0) - { - } - - private VersionStamp(DateTime utcLastModified, int localIncrement) - { - _utcLastModified = utcLastModified; - _localIncrement = localIncrement; - _globalIncrement = GetNextGlobalVersion(); - } - - private VersionStamp(DateTime utcLastModified, int localIncrement, int globalIncrement) - { - _utcLastModified = utcLastModified; - _localIncrement = localIncrement; - _globalIncrement = globalIncrement; - } - - /// - /// Creates a new instance of a VersionStamp. - /// - public static VersionStamp Create() - { - return new VersionStamp(DateTime.UtcNow); - } - - /// - /// Creates a new instance of a version stamp based on the specified DateTime. - /// - public static VersionStamp Create(DateTime utcTimeLastModified) - { - return new VersionStamp(utcTimeLastModified); - } - - /// - /// compare two different versions and return either one of the versions if there is no collision, otherwise, create a new version - /// that can be used later to compare versions between different items - /// - public VersionStamp GetNewerVersion(VersionStamp version) - { - // * NOTE * - // in current design/implementation, there are 4 possible ways for a version to be created. - // - // 1. created from a file stamp (most likely by starting a new session). "increment" will have 0 as value - // 2. created by modifying existing item (text changes, project changes etc). - // "increment" will have either 0 or previous increment + 1 if there was a collision. - // 3. created from deserialization (probably by using persistent service). - // 4. created by accumulating versions of multiple items. - // - // and this method is the one that is responsible for #4 case. - - if (_utcLastModified > version._utcLastModified) - { - return this; - } - - if (_utcLastModified == version._utcLastModified) - { - var thisGlobalVersion = GetGlobalVersion(this); - var thatGlobalVersion = GetGlobalVersion(version); - - if (thisGlobalVersion == thatGlobalVersion) - { - // given versions are same one - return this; - } - - // mark it as global version - // global version can't be moved to newer version. - return new VersionStamp(_utcLastModified, (thisGlobalVersion > thatGlobalVersion) ? thisGlobalVersion : thatGlobalVersion, GlobalVersionMarker); - } - - return version; - } - - /// - /// Gets a new VersionStamp that is guaranteed to be newer than its base one - /// this should only be used for same item to move it to newer version - /// - public VersionStamp GetNewerVersion() - { - // global version can't be moved to newer version - Contract.Requires(_globalIncrement != GlobalVersionMarker); - - var now = DateTime.UtcNow; - var incr = (now == _utcLastModified) ? _localIncrement + 1 : 0; - - return new VersionStamp(now, incr); - } - - /// - /// Returns the serialized text form of the VersionStamp. - /// - public override string ToString() - { - // 'o' is the roundtrip format that captures the most detail. - return _utcLastModified.ToString("o") + "-" + _globalIncrement + "-" + _localIncrement; - } - - public override int GetHashCode() - { - return Hash.Combine(_utcLastModified.GetHashCode(), _localIncrement); - } - - public override bool Equals(object obj) - { - if (obj is VersionStamp) - { - return this.Equals((VersionStamp)obj); - } - - return false; - } - - public bool Equals(VersionStamp version) - { - if (_utcLastModified == version._utcLastModified) - { - return GetGlobalVersion(this) == GetGlobalVersion(version); - } - - return false; - } - - public static bool operator ==(VersionStamp left, VersionStamp right) - { - return left.Equals(right); - } - - public static bool operator !=(VersionStamp left, VersionStamp right) - { - return !left.Equals(right); - } - - /// - /// check whether given persisted version is re-usable - /// - internal static bool CanReusePersistedVersion(VersionStamp baseVersion, VersionStamp persistedVersion) - { - if (baseVersion == persistedVersion) - { - return true; - } - - // there was a collision, we can't use these - if (baseVersion._localIncrement != 0 || persistedVersion._localIncrement != 0) - { - return false; - } - - return baseVersion._utcLastModified == persistedVersion._utcLastModified; - } - - void IObjectWritable.WriteTo(ObjectWriter writer) - { - WriteTo(writer); - } - - internal void WriteTo(ObjectWriter writer) - { - writer.WriteInt64(_utcLastModified.ToBinary()); - writer.WriteInt32(_localIncrement); - writer.WriteInt32(_globalIncrement); - } - - internal static VersionStamp ReadFrom(ObjectReader reader) - { - var raw = reader.ReadInt64(); - var localIncrement = reader.ReadInt32(); - var globalIncrement = reader.ReadInt32(); - - return new VersionStamp(DateTime.FromBinary(raw), localIncrement, globalIncrement); - } - - private static int GetGlobalVersion(VersionStamp version) - { - // global increment < 0 means it is a global version which has its global increment in local increment - return version._globalIncrement >= 0 ? version._globalIncrement : version._localIncrement; - } - - private static int GetNextGlobalVersion() - { - // REVIEW: not sure what is best way to wrap it when it overflows. should I just throw or don't care. - // with 50ms (typing) as an interval for a new version, it gives more than 1 year before int32 to overflow. - // with 5ms as an interval, it gives more than 120 days before it overflows. - // since global version is only for per VS session, I think we don't need to worry about overflow. - // or we could use Int64 which will give more than a million years turn around even on 1ms interval. - - // this will let versions to be compared safely between multiple items - // without worrying about collision within same session - var globalVersion = Interlocked.Increment(ref VersionStamp.s_globalVersion); - - return globalVersion; - } - - /// - /// True if this VersionStamp is newer than the specified one. - /// - internal bool TestOnly_IsNewerThan(VersionStamp version) - { - if (_utcLastModified > version._utcLastModified) - { - return true; - } - - if (_utcLastModified == version._utcLastModified) - { - return GetGlobalVersion(this) > GetGlobalVersion(version); - } - - return false; - } - } -} \ No newline at end of file diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 4b7ef972b0d..58862ce6747 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -48,7 +48,6 @@ - diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index abcae6d9074..542ec626ebd 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -165,9 +165,7 @@ - - From d1e50e1896c3f7e50f9ab9790fa5ba95e05855fa Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 10 Aug 2022 12:26:50 +0200 Subject: [PATCH 102/226] Update INTERNAL.md --- INTERNAL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INTERNAL.md b/INTERNAL.md index d6e9913f71a..9d8ae1ced46 100644 --- a/INTERNAL.md +++ b/INTERNAL.md @@ -75,6 +75,7 @@ Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in 5. Add the new F# branch to the appropriate `darc` channel. In this example, run `darc add-default-channel --channel "VS 17.4" --branch release/dev17.4 --repo https://github.com/dotnet/fsharp` 6. Ensure the subscription was added by repeating step 3 above. 7. Note, the help in the `darc` tool is really good. E.g., you can simply run `darc` to see a list of all commands available, and if you run `darc ` with no arguments, you'll be given a list of arguments you can use. + 8. Ensure that version numbers are bumped for a new branch. ## Less interesting links From 4d0103c89a2b0ce5377aa615e86ff6c00a4ee971 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 10 Aug 2022 17:29:54 +0200 Subject: [PATCH 103/226] Desugar SynMemberDefns of SynExceptionDefn before type checking. (#13664) --- src/Compiler/Checking/CheckDeclarations.fs | 3 ++- .../TypeChecks/CheckDeclarationsTests.fs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 08bffa54a57..23b08bd45ee 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4635,7 +4635,8 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let env = MutRecBindingChecking.TcModuleAbbrevDecl cenv scopem env (id, p, m) return ([], [], []), env, env - | SynModuleDecl.Exception (edef, m) -> + | SynModuleDecl.Exception (SynExceptionDefn(exnRepr, withKeyword, ms, mExDefn), m) -> + let edef = SynExceptionDefn(exnRepr, withKeyword, desugarGetSetMembers ms, mExDefn) let binds, decl, env = TcExceptionDeclarations.TcExnDefn cenv env parent (edef, scopem) let defn = TMDefRec(true, [], [decl], binds |> List.map ModuleOrNamespaceBinding.Binding, m) return ([defn], [], []), env, env diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs index 7aa5d1d56f2..1be9ceb6910 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs @@ -90,6 +90,19 @@ namespace FSharpTest type Tree = | Empty | Children of Tree +""" + |> compile + |> shouldSucceed + |> ignore + + [] + let ``CheckingExceptionDeclarations - SynMemberDefn.GetSetMember`` () = + FSharp """ +namespace FSharpTest + +exception CustomException of details: string + with + member self.Details with get (): string = self.details """ |> compile |> shouldSucceed From 0973fd35f8e5dbe593c5ed9ac6bfa9610288611c Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 10 Aug 2022 17:30:50 +0200 Subject: [PATCH 104/226] Temporarily commenting out VS test discovery blockers (#13619) --- .../UnitTests/Workspace/WorkspaceTests.fs | 524 +++++++++--------- 1 file changed, 262 insertions(+), 262 deletions(-) diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index 3271017c0d9..9b6d7537862 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -183,334 +183,334 @@ module WorkspaceTests = let mutable mainProj = mainProj - interface IFSharpWorkspaceProjectContext with +// interface IFSharpWorkspaceProjectContext with - member _.get_DisplayName() : string = "" +// member _.get_DisplayName() : string = "" - member _.set_DisplayName(value: string) : unit = () +// member _.set_DisplayName(value: string) : unit = () - member _.Dispose(): unit = () +// member _.Dispose(): unit = () - member _.FilePath: string = mainProj.FilePath +// member _.FilePath: string = mainProj.FilePath - member _.HasProjectReference(filePath: string): bool = - mainProj.ProjectReferences - |> Seq.exists (fun x -> - let projRef = mainProj.Solution.GetProject(x.ProjectId) - if projRef <> null then - String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) - else - false - ) +// member _.HasProjectReference(filePath: string): bool = +// mainProj.ProjectReferences +// |> Seq.exists (fun x -> +// let projRef = mainProj.Solution.GetProject(x.ProjectId) +// if projRef <> null then +// String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) +// else +// false +// ) - member _.Id: ProjectId = mainProj.Id +// member _.Id: ProjectId = mainProj.Id - member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() +// member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() - member _.SetProjectReferences(projRefs: seq): unit = - let currentProj = mainProj - let mutable solution = currentProj.Solution +// member _.SetProjectReferences(projRefs: seq): unit = +// let currentProj = mainProj +// let mutable solution = currentProj.Solution - currentProj.ProjectReferences - |> Seq.iter (fun projRef -> - solution <- solution.RemoveProjectReference(currentProj.Id, projRef) - ) +// currentProj.ProjectReferences +// |> Seq.iter (fun projRef -> +// solution <- solution.RemoveProjectReference(currentProj.Id, projRef) +// ) - projRefs - |> Seq.iter (fun projRef -> - solution <- - solution.AddProjectReference( - currentProj.Id, - ProjectReference(projRef.Id) - ) - ) +// projRefs +// |> Seq.iter (fun projRef -> +// solution <- +// solution.AddProjectReference( +// currentProj.Id, +// ProjectReference(projRef.Id) +// ) +// ) - not (solution.Workspace.TryApplyChanges(solution)) |> ignore +// not (solution.Workspace.TryApplyChanges(solution)) |> ignore - mainProj <- solution.GetProject(currentProj.Id) +// mainProj <- solution.GetProject(currentProj.Id) - member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count +// member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count - member _.HasMetadataReference(referencePath: string): bool = - mainProj.MetadataReferences - |> Seq.exists (fun x -> - match x with - | :? PortableExecutableReference as r -> - String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) - | _ -> - false) +// member _.HasMetadataReference(referencePath: string): bool = +// mainProj.MetadataReferences +// |> Seq.exists (fun x -> +// match x with +// | :? PortableExecutableReference as r -> +// String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) +// | _ -> +// false) - member _.SetMetadataReferences(referencePaths: string seq): unit = - let currentProj = mainProj - let mutable solution = currentProj.Solution +// member _.SetMetadataReferences(referencePaths: string seq): unit = +// let currentProj = mainProj +// let mutable solution = currentProj.Solution - currentProj.MetadataReferences - |> Seq.iter (fun r -> - solution <- solution.RemoveMetadataReference(currentProj.Id, r) - ) +// currentProj.MetadataReferences +// |> Seq.iter (fun r -> +// solution <- solution.RemoveMetadataReference(currentProj.Id, r) +// ) - referencePaths - |> Seq.iter (fun referencePath -> - solution <- - solution.AddMetadataReference( - currentProj.Id, - PortableExecutableReference.CreateFromFile( - referencePath, - MetadataReferenceProperties.Assembly - ) - ) - ) +// referencePaths +// |> Seq.iter (fun referencePath -> +// solution <- +// solution.AddMetadataReference( +// currentProj.Id, +// PortableExecutableReference.CreateFromFile( +// referencePath, +// MetadataReferenceProperties.Assembly +// ) +// ) +// ) - not (solution.Workspace.TryApplyChanges(solution)) |> ignore +// not (solution.Workspace.TryApplyChanges(solution)) |> ignore - mainProj <- solution.GetProject(currentProj.Id) +// mainProj <- solution.GetProject(currentProj.Id) - member _.AddMetadataReference(_: string): unit = () - member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () +// member _.AddMetadataReference(_: string): unit = () +// member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () - type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = +// type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = - interface IFSharpWorkspaceProjectContextFactory with - member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = - match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with - | Some docId -> - let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) - removeProject miscFilesWorkspace doc.Project.Id - | _ -> - () - - let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) - addProject workspace projInfo - - let proj = workspace.CurrentSolution.GetProject(projInfo.Id) - new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext - - [] - let ``Script file opened in misc files workspace will get transferred to normal workspace``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath = - createOnDiskScript - """ -module Script1 - -let x = 1 - """ +// interface IFSharpWorkspaceProjectContextFactory with +// member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = +// match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with +// | Some docId -> +// let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) +// removeProject miscFilesWorkspace doc.Project.Id +// | _ -> +// () + +// let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) +// addProject workspace projInfo + +// let proj = workspace.CurrentSolution.GetProject(projInfo.Id) +// new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext + +// [] +// let ``Script file opened in misc files workspace will get transferred to normal workspace``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath = +// createOnDiskScript +// """ +//module Script1 + +//let x = 1 +// """ - try - let projInfo = createProjectInfoWithFileOnDisk filePath - addProject miscFilesWorkspace projInfo +// try +// let projInfo = createProjectInfoWithFileOnDisk filePath +// addProject miscFilesWorkspace projInfo - Assert.IsTrue(hasDocument miscFilesWorkspace filePath) - Assert.IsFalse(hasDocument workspace filePath) +// Assert.IsTrue(hasDocument miscFilesWorkspace filePath) +// Assert.IsFalse(hasDocument workspace filePath) - Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) - openDocument miscFilesWorkspace filePath +// Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) +// openDocument miscFilesWorkspace filePath - // Although we opened the document, it has been transferred to the other workspace. - Assert.IsFalse(hasDocument miscFilesWorkspace filePath) - Assert.IsTrue(hasDocument workspace filePath) +// // Although we opened the document, it has been transferred to the other workspace. +// Assert.IsFalse(hasDocument miscFilesWorkspace filePath) +// Assert.IsTrue(hasDocument workspace filePath) - // Should not be automatically opened when transferred. - Assert.IsFalse(isDocumentOpen workspace filePath) +// // Should not be automatically opened when transferred. +// Assert.IsFalse(isDocumentOpen workspace filePath) - assertEmptyDocumentDiagnostics workspace filePath +// assertEmptyDocumentDiagnostics workspace filePath - finally - try File.Delete(filePath) with | _ -> () +// finally +// try File.Delete(filePath) with | _ -> () - [] - let ``Script file referencing another script should have no diagnostics``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) +// [] +// let ``Script file referencing another script should have no diagnostics``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - let filePath1 = - createOnDiskScript - """ -module Script1 +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" -let x = Script1.x - """ +//let x = Script1.x +// """ - try - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath2 - - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () - - [] - let ``Script file referencing another script will correctly update when the referenced script file changes``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath1 = - createOnDiskScript - """ -module Script1 - """ - - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" - -let x = Script1.x - """ +// try +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// addProject miscFilesWorkspace projInfo2 +// openDocument miscFilesWorkspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 + +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () + +// [] +// let ``Script file referencing another script will correctly update when the referenced script file changes``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 +// """ + +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" + +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo1 - addProject miscFilesWorkspace projInfo2 +// addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath1 - openDocument miscFilesWorkspace filePath2 +// openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath1 - assertHasDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath2 - updateDocumentOnDisk workspace filePath1 - """ -module Script1 +// updateDocumentOnDisk workspace filePath1 +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () - - [] - let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath1 = - createOnDiskScript - """ -module Script1 - """ - - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" - -let x = Script1.x - """ +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () + +// [] +// let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 +// """ + +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" + +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo1 - addProject miscFilesWorkspace projInfo2 +// addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath2 - openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath2 +// openDocument miscFilesWorkspace filePath1 - assertHasDocumentDiagnostics workspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath1 - updateDocumentOnDisk workspace filePath1 - """ -module Script1 +// updateDocumentOnDisk workspace filePath1 +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () - [] - let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) +// [] +// let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - let dllPath1 = - createOnDiskCompiledScriptAsDll workspace - """ -module Script1 +// let dllPath1 = +// createOnDiskCompiledScriptAsDll workspace +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - let filePath1 = - createOnDiskScript - $""" -module Script2 -#r "{ Path.GetFileName(dllPath1) }" +// let filePath1 = +// createOnDiskScript +// $""" +//module Script2 +//#r "{ Path.GetFileName(dllPath1) }" -let x = Script1.x - """ +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo1 - openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath1 - assertEmptyDocumentDiagnostics workspace filePath1 +// assertEmptyDocumentDiagnostics workspace filePath1 - updateDocumentOnDisk workspace filePath1 - $""" -module Script2 -#r "{ Path.GetFileName(dllPath1) }" +// updateDocumentOnDisk workspace filePath1 +// $""" +//module Script2 +//#r "{ Path.GetFileName(dllPath1) }" -let x = Script1.x -let y = Script1.y - """ +//let x = Script1.x +//let y = Script1.y +// """ - assertHasDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath1 - updateCompiledDllOnDisk workspace dllPath1 - """ -module Script1 +// updateCompiledDllOnDisk workspace dllPath1 +// """ +//module Script1 -let x = 1 -let y = 1 - """ +//let x = 1 +//let y = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath1 +// assertEmptyDocumentDiagnostics workspace filePath1 - finally - try File.Delete(dllPath1) with | _ -> () - try File.Delete(filePath1) with | _ -> () +// finally +// try File.Delete(dllPath1) with | _ -> () +// try File.Delete(filePath1) with | _ -> () From a3741b1de7db80c65ae252daa9f6aecaeac2a49e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 11 Aug 2022 13:56:39 +0000 Subject: [PATCH 105/226] [main] Update dependencies from dotnet/arcade (#13672) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 +- eng/common/cross/build-rootfs.sh | 92 ++++++++++++++++++- eng/common/cross/toolchain.cmake | 41 ++++++++- eng/common/templates/job/execute-sdl.yml | 2 +- eng/common/templates/job/onelocbuild.yml | 2 +- .../templates/job/source-index-stage1.yml | 4 +- eng/common/templates/jobs/jobs.yml | 2 +- .../templates/post-build/post-build.yml | 8 +- eng/common/tools.ps1 | 9 +- global.json | 2 +- 10 files changed, 149 insertions(+), 17 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2d6155659b2..60e35d3cb0a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 13b342360ba81ca3fdf911fda985dc8420d51627 + fd9941799bb6983a7d00ed72682378b46a45f396 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index f058c98763a..d3b0ac3ba7b 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -8,11 +8,13 @@ usage() echo "BuildArch can be: arm(default), arm64, armel, armv6, ppc64le, riscv64, s390x, x64, x86" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine, alpine3.13 or alpine3.14. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo " for FreeBSD can be: freebsd12, freebsd13" - echo " for illumos can be: illumos." + echo " for illumos can be: illumos" + echo " for Haiku can be: haiku." echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FreeBSD" echo "llvmx[.y] - optional, LLVM version for LLVM related packages." echo "--skipunmount - optional, will skip the unmount of rootfs folder." echo "--use-mirror - optional, use mirror URL to fetch resources, when available." + echo "--jobs N - optional, restrict to N jobs." exit 1 } @@ -79,6 +81,17 @@ __IllumosPackages+=" mit-krb5-1.16.2nb4" __IllumosPackages+=" openssl-1.1.1e" __IllumosPackages+=" zlib-1.2.11" +__HaikuPackages="gmp" +__HaikuPackages+=" gmp_devel" +__HaikuPackages+=" krb5" +__HaikuPackages+=" krb5_devel" +__HaikuPackages+=" libiconv" +__HaikuPackages+=" libiconv_devel" +__HaikuPackages+=" llvm12_libunwind" +__HaikuPackages+=" llvm12_libunwind_devel" +__HaikuPackages+=" mpfr" +__HaikuPackages+=" mpfr_devel" + # ML.NET dependencies __UbuntuPackages+=" libomp5" __UbuntuPackages+=" libomp-dev" @@ -263,6 +276,11 @@ while :; do __CodeName=illumos __SkipUnmount=1 ;; + haiku) + __CodeName=haiku + __BuildArch=x64 + __SkipUnmount=1 + ;; --skipunmount) __SkipUnmount=1 ;; @@ -273,6 +291,10 @@ while :; do --use-mirror) __UseMirror=1 ;; + --use-jobs) + shift + MAXJOBS=$1 + ;; *) __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" ;; @@ -326,7 +348,7 @@ if [[ "$__CodeName" == "alpine" ]]; then rm -r "$__ApkToolsDir" elif [[ "$__CodeName" == "freebsd" ]]; then mkdir -p "$__RootfsDir"/usr/local/etc - JOBS="$(getconf _NPROCESSORS_ONLN)" + JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"} wget -O - "https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz" | tar -C "$__RootfsDir" -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > "${__RootfsDir}"/usr/local/etc/pkg.conf echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf @@ -344,7 +366,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then elif [[ "$__CodeName" == "illumos" ]]; then mkdir "$__RootfsDir/tmp" pushd "$__RootfsDir/tmp" - JOBS="$(getconf _NPROCESSORS_ONLN)" + JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"} echo "Downloading sysroot." wget -O - https://github.com/illumos/sysroot/releases/download/20181213-de6af22ae73b-v1/illumos-sysroot-i386-20181213-de6af22ae73b-v1.tar.gz | tar -C "$__RootfsDir" -xzf - echo "Building binutils. Please wait.." @@ -386,6 +408,70 @@ elif [[ "$__CodeName" == "illumos" ]]; then wget -P "$__RootfsDir"/usr/include/net https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/io/bpf/net/dlt.h wget -P "$__RootfsDir"/usr/include/netpacket https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/inet/sockmods/netpacket/packet.h wget -P "$__RootfsDir"/usr/include/sys https://raw.githubusercontent.com/illumos/illumos-gate/master/usr/src/uts/common/sys/sdt.h +elif [[ "$__CodeName" == "haiku" ]]; then + JOBS=${MAXJOBS:="$(getconf _NPROCESSORS_ONLN)"} + + echo "Building Haiku sysroot for x86_64" + mkdir -p "$__RootfsDir/tmp" + cd "$__RootfsDir/tmp" + git clone -b hrev56235 https://review.haiku-os.org/haiku + git clone -b btrev43195 https://review.haiku-os.org/buildtools + cd "$__RootfsDir/tmp/buildtools" && git checkout 7487388f5110021d400b9f3b88e1a7f310dc066d + + # Fetch some unmerged patches + cd "$__RootfsDir/tmp/haiku" + ## Add development build profile (slimmer than nightly) + git fetch origin refs/changes/64/4164/1 && git -c commit.gpgsign=false cherry-pick FETCH_HEAD + + # Build jam + cd "$__RootfsDir/tmp/buildtools/jam" + make + + # Configure cross tools + echo "Building cross-compiler" + mkdir -p "$__RootfsDir/generated" + cd "$__RootfsDir/generated" + "$__RootfsDir/tmp/haiku/configure" -j"$JOBS" --sysroot "$__RootfsDir" --cross-tools-source "$__RootfsDir/tmp/buildtools" --build-cross-tools x86_64 + + # Build Haiku packages + echo "Building Haiku" + echo 'HAIKU_BUILD_PROFILE = "development-raw" ;' > UserProfileConfig + "$__RootfsDir/tmp/buildtools/jam/jam0" -j"$JOBS" -q 'package' 'Haiku' + + BaseUrl="https://depot.haiku-os.org/__api/v2/pkg/get-pkg" + + # Download additional packages + echo "Downloading additional required packages" + read -ra array <<<"$__HaikuPackages" + for package in "${array[@]}"; do + echo "Downloading $package..." + # API documented here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L60 + # The schema here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L598 + hpkgDownloadUrl="$(wget -qO- --post-data='{"name":"'"$package"'","repositorySourceCode":"haikuports_x86_64","versionType":"LATEST","naturalLanguageCode":"en"}' \ + --header='Content-Type:application/json' "$BaseUrl" | jq -r '.result.versions[].hpkgDownloadURL')" + wget -P "$__RootfsDir/generated/download" "$hpkgDownloadUrl" + done + + # Setup the sysroot + echo "Setting up sysroot and extracting needed packages" + mkdir -p "$__RootfsDir/boot/system" + for file in "$__RootfsDir/generated/objects/haiku/x86_64/packaging/packages/"*.hpkg; do + "$__RootfsDir/generated/objects/linux/x86_64/release/tools/package/package" extract -C "$__RootfsDir/boot/system" "$file" + done + for file in "$__RootfsDir/generated/download/"*.hpkg; do + "$__RootfsDir/generated/objects/linux/x86_64/release/tools/package/package" extract -C "$__RootfsDir/boot/system" "$file" + done + + # Cleaning up temporary files + echo "Cleaning up temporary files" + rm -rf "$__RootfsDir/tmp" + for name in "$__RootfsDir/generated/"*; do + if [[ "$name" =~ "cross-tools-" ]]; then + : # Keep the cross-compiler + else + rm -rf "$name" + fi + done elif [[ -n "$__CodeName" ]]; then qemu-debootstrap $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list" diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 909117759e6..561576be97c 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -7,6 +7,8 @@ if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version) elseif(EXISTS ${CROSS_ROOTFS}/usr/platform/i86pc) set(CMAKE_SYSTEM_NAME SunOS) set(ILLUMOS 1) +elseif(EXISTS ${CROSS_ROOTFS}/boot/system/develop/headers/config/HaikuConfig.h) + set(CMAKE_SYSTEM_NAME Haiku) else() set(CMAKE_SYSTEM_NAME Linux) set(LINUX 1) @@ -76,6 +78,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") set(triple "x86_64-unknown-freebsd12") elseif(ILLUMOS) set(TOOLCHAIN "x86_64-illumos") + elseif(HAIKU) + set(TOOLCHAIN "x64_64-unknown-haiku") endif() elseif(TARGET_ARCH_NAME STREQUAL "x86") set(CMAKE_SYSTEM_PROCESSOR i686) @@ -170,6 +174,41 @@ elseif(ILLUMOS) set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") +elseif(HAIKU) + set(CMAKE_SYSROOT "${CROSS_ROOTFS}") + + set(TOOLSET_PREFIX ${TOOLCHAIN}-) + function(locate_toolchain_exec exec var) + string(TOUPPER ${exec} EXEC_UPPERCASE) + if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "") + set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE) + return() + endif() + + set(SEARCH_PATH "${CROSS_ROOTFS}/generated/cross-tools-x86_64/bin") + + find_program(EXEC_LOCATION_${exec} + PATHS ${SEARCH_PATH} + NAMES + "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}" + "${TOOLSET_PREFIX}${exec}") + + if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") + message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.") + endif() + set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) + endfunction() + + set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") + + locate_toolchain_exec(gcc CMAKE_C_COMPILER) + locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) + + set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") + + # let CMake set up the correct search paths + include(Platform/Haiku) else() set(CMAKE_SYSROOT "${CROSS_ROOTFS}") @@ -229,7 +268,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index 24cec0424e5..9ff6a10a682 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -54,7 +54,7 @@ jobs: # If it's not devdiv, it's dnceng ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - checkout: self clean: true diff --git a/eng/common/templates/job/onelocbuild.yml b/eng/common/templates/job/onelocbuild.yml index 3bcd243c46b..6c523b714f4 100644 --- a/eng/common/templates/job/onelocbuild.yml +++ b/eng/common/templates/job/onelocbuild.yml @@ -41,7 +41,7 @@ jobs: # If it's not devdiv, it's dnceng ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 variables: - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 4e37210857d..c85044a6849 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -29,10 +29,10 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: NetCore1ESPool-Public - demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open + demands: ImageOverride -equals windows.vs2019.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - ${{ each preStep in parameters.preSteps }}: diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 2cca53c2d1d..64e5929f221 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -96,7 +96,7 @@ jobs: # If it's not devdiv, it's dnceng ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 runAsPublic: ${{ parameters.runAsPublic }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index e0beb25d4e7..87fcae940cf 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -107,7 +107,7 @@ stages: # If it's not devdiv, it's dnceng ${{ else }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml @@ -144,7 +144,7 @@ stages: # If it's not devdiv, it's dnceng ${{ else }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml parameters: @@ -204,7 +204,7 @@ stages: # If it's not devdiv, it's dnceng ${{ else }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml parameters: @@ -263,7 +263,7 @@ stages: # If it's not devdiv, it's dnceng ${{ else }}: name: NetCore1ESPool-Internal - demands: ImageOverride -equals Build.Server.Amd64.VS2019 + demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml parameters: diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 9638c63c725..f83a748c37e 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -368,7 +368,14 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.1.0&view=overview $defaultXCopyMSBuildVersion = '17.1.0' - if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } + if (!$vsRequirements) { + if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { + $vsRequirements = $GlobalJson.tools.vs + } + else { + $vsRequirements = New-Object PSObject -Property @{ version = $vsMinVersionReqdStr } + } + } $vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { $vsMinVersionReqdStr } $vsMinVersion = [Version]::new($vsMinVersionStr) diff --git a/global.json b/global.json index 8d3d6530e09..f7776e92cc1 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22408.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22410.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 4330fa1b60d8c7fd9c1dcb7dd8155fef5f025c61 Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 12 Aug 2022 13:58:17 +0200 Subject: [PATCH 106/226] Refactoring: splitting a chunk from CheckExpressions (#13652) Co-authored-by: Don Syme --- src/Compiler/Checking/CheckBasics.fs | 367 +++++++++ src/Compiler/Checking/CheckBasics.fsi | 328 ++++++++ .../Checking/CheckComputationExpressions.fs | 1 + .../Checking/CheckComputationExpressions.fsi | 2 +- src/Compiler/Checking/CheckDeclarations.fs | 4 +- src/Compiler/Checking/CheckDeclarations.fsi | 2 +- src/Compiler/Checking/CheckExpressions.fs | 711 +++++------------- src/Compiler/Checking/CheckExpressions.fsi | 298 +------- .../Checking/CheckIncrementalClasses.fs | 1 + .../Checking/CheckIncrementalClasses.fsi | 1 + src/Compiler/Checking/CheckPatterns.fs | 1 + src/Compiler/Checking/CheckPatterns.fsi | 2 +- src/Compiler/Driver/CompilerImports.fsi | 2 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 2 +- src/Compiler/Driver/ParseAndCheckInputs.fsi | 2 +- src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Service/IncrementalBuild.fs | 2 +- src/Compiler/Service/IncrementalBuild.fsi | 4 +- 18 files changed, 914 insertions(+), 818 deletions(-) create mode 100644 src/Compiler/Checking/CheckBasics.fs create mode 100644 src/Compiler/Checking/CheckBasics.fsi diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs new file mode 100644 index 00000000000..ee42b425a3d --- /dev/null +++ b/src/Compiler/Checking/CheckBasics.fs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module internal FSharp.Compiler.CheckBasics + +open System.Collections.Generic + +open Internal.Utilities.Library +open Internal.Utilities.Library.Extras +open FSharp.Compiler +open FSharp.Compiler.AccessibilityLogic +open FSharp.Compiler.CompilerGlobalState +open FSharp.Compiler.ConstraintSolver +open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.InfoReader +open FSharp.Compiler.NameResolution +open FSharp.Compiler.PatternMatchCompilation +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTreeOps +open FSharp.Compiler.TcGlobals +open FSharp.Compiler.Text +open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTreeOps + +#if !NO_TYPEPROVIDERS +open FSharp.Compiler.TypeProviders +#endif + +#if DEBUG +let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 40 +#else +let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 80 +#endif + +/// The ValReprInfo for a value, except the number of typars is not yet inferred +type PrelimValReprInfo = + | PrelimValReprInfo of + curriedArgInfos: ArgReprInfo list list * + returnInfo: ArgReprInfo + +//------------------------------------------------------------------------- +// Data structures that track the gradual accumulation of information +// about values and members during inference. +//------------------------------------------------------------------------- + +type PrelimMemberInfo = + | PrelimMemberInfo of + memberInfo: ValMemberInfo * + logicalName: string * + compiledName: string + +/// Indicates whether constraints should be checked when checking syntactic types +type CheckConstraints = + | CheckCxs + | NoCheckCxs + +/// A type to represent information associated with values to indicate what explicit (declared) type parameters +/// are given and what additional type parameters can be inferred, if any. +/// +/// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication +/// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x +type ExplicitTyparInfo = + | ExplicitTyparInfo of + rigidCopyOfDeclaredTypars: Typars * + declaredTypars: Typars * + infer: bool + +type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs + +/// The results of preliminary pass over patterns to extract variables being declared. +// We should make this a record for cleaner code +type PrelimVal1 = + | PrelimVal1 of + id: Ident * + explicitTyparInfo: ExplicitTyparInfo * + prelimType: TType * + prelimValReprInfo: PrelimValReprInfo option * + memberInfoOpt: PrelimMemberInfo option * + isMutable: bool * + inlineFlag: ValInline * + baseOrThisInfo: ValBaseOrThisInfo * + argAttribs: ArgAndRetAttribs * + visibility: SynAccess option * + isCompGen: bool + + member x.Type = let (PrelimVal1(prelimType=ty)) = x in ty + + member x.Ident = let (PrelimVal1(id=id)) = x in id + +type UnscopedTyparEnv = UnscopedTyparEnv of NameMap + +type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set + +/// Translation of patterns is split into three phases. The first collects names. +/// The second is run after val_specs have been created for those names and inference +/// has been resolved. The second phase is run by applying a function returned by the +/// first phase. The input to the second phase is a List.map that gives the Val and type scheme +/// for each value bound by the pattern. +type TcPatPhase2Input = + | TcPatPhase2Input of NameMap * bool + + // Get an input indicating we are no longer on the left-most path through a disjunctive "or" pattern + member x.WithRightPath() = (let (TcPatPhase2Input(a, _)) = x in TcPatPhase2Input(a, false)) + +/// Represents information about the initialization field used to check that object constructors +/// have completed before fields are accessed. +type SafeInitData = + | SafeInitField of RecdFieldRef * RecdField + | NoSafeInitInfo + +type TcPatValFlags = + | TcPatValFlags of + inlineFlag: ValInline * + explicitTyparInfo: ExplicitTyparInfo * + argAndRetAttribs: ArgAndRetAttribs * + isMutable: bool * + visibility: SynAccess option * + isCompilerGenerated: bool + +/// Represents information about object constructors +type CtorInfo = + { /// Object model constructors have a very specific form to satisfy .NET limitations. + /// For "new = \arg. { new C with ... }" + /// ctor = 3 indicates about to type check "\arg. (body)", + /// ctor = 2 indicates about to type check "body" + /// ctor = 1 indicates actually type checking the body expression + /// 0 indicates everywhere else, including auxiliary expressions such expr1 in "let x = expr1 in { new ... }" + /// REVIEW: clean up this rather odd approach ... + ctorShapeCounter: int + + /// A handle to the ref cell to hold results of 'this' for 'type X() as x = ...' and 'new() as x = ...' constructs + /// in case 'x' is used in the arguments to the 'inherits' call. + safeThisValOpt: Val option + + /// A handle to the boolean ref cell to hold success of initialized 'this' for 'type X() as x = ...' constructs + safeInitInfo: SafeInitData + + /// Is the an implicit constructor or an explicit one? + ctorIsImplicit: bool + } + + static member InitialExplicit (safeThisValOpt, safeInitInfo) = + { ctorShapeCounter = 3 + safeThisValOpt = safeThisValOpt + safeInitInfo = safeInitInfo + ctorIsImplicit = false} + + static member InitialImplicit () = + { ctorShapeCounter = 0 + safeThisValOpt = None + safeInitInfo = NoSafeInitInfo + ctorIsImplicit = true } + + +/// Represents an item in the environment that may restrict the automatic generalization of later +/// declarations because it refers to type inference variables. As type inference progresses +/// these type inference variables may get solved. +[] +type UngeneralizableItem(computeFreeTyvars: unit -> FreeTyvars) = + + // Flag is for: have we determined that this item definitely has + // no free type inference variables? This implies that + // (a) it will _never_ have any free type inference variables as further constraints are added to the system. + // (b) its set of FreeTycons will not change as further constraints are added to the system + let mutable willNeverHaveFreeTypars = false + + // If WillNeverHaveFreeTypars then we can cache the computation of FreeTycons, since they are invariant. + let mutable cachedFreeLocalTycons = emptyFreeTycons + + // If WillNeverHaveFreeTypars then we can cache the computation of FreeTraitSolutions, since they are invariant. + let mutable cachedFreeTraitSolutions = emptyFreeLocals + + member _.GetFreeTyvars() = + let fvs = computeFreeTyvars() + if fvs.FreeTypars.IsEmpty then + willNeverHaveFreeTypars <- true + cachedFreeLocalTycons <- fvs.FreeTycons + cachedFreeTraitSolutions <- fvs.FreeTraitSolutions + fvs + + member _.WillNeverHaveFreeTypars = willNeverHaveFreeTypars + + member _.CachedFreeLocalTycons = cachedFreeLocalTycons + + member _.CachedFreeTraitSolutions = cachedFreeTraitSolutions + +/// Represents the type environment at a particular scope. Includes the name +/// resolution environment, the ungeneralizable items from earlier in the scope +/// and other information about the scope. +[] +type TcEnv = + { /// Name resolution information + eNameResEnv: NameResolutionEnv + + /// The list of items in the environment that may contain free inference + /// variables (which may not be generalized). The relevant types may + /// change as a result of inference equations being asserted, hence may need to + /// be recomputed. + eUngeneralizableItems: UngeneralizableItem list + + // Two (!) versions of the current module path + // These are used to: + // - Look up the appropriate point in the corresponding signature + // see if an item is public or not + // - Change fslib canonical module type to allow compiler references to these items + // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary + // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. + // This information is used mainly when building non-local references + // to public items. + // + // Of the two, 'ePath' is the one that's barely used. It's only + // used by UpdateAccModuleOrNamespaceType to modify the CCU while compiling FSharp.Core + ePath: Ident list + + eCompPath: CompilationPath + + eAccessPath: CompilationPath + + /// This field is computed from other fields, but we amortize the cost of computing it. + eAccessRights: AccessorDomain + + /// Internals under these should be accessible + eInternalsVisibleCompPaths: CompilationPath list + + /// Mutable accumulator for the current module type + eModuleOrNamespaceTypeAccumulator: ModuleOrNamespaceType ref + + /// Context information for type checker + eContextInfo: ContextInfo + + /// Here Some tcref indicates we can access protected members in all super types + eFamilyType: TyconRef option + + // Information to enforce special restrictions on valid expressions + // for .NET constructors. + eCtorInfo: CtorInfo option + + eCallerMemberName: string option + + // Active arg infos in iterated lambdas , allowing us to determine the attributes of arguments + eLambdaArgInfos: ArgReprInfo list list + + // Do we lay down an implicit debug point? + eIsControlFlow: bool + } + + member tenv.DisplayEnv = tenv.eNameResEnv.DisplayEnv + + member tenv.NameEnv = tenv.eNameResEnv + + member tenv.AccessRights = tenv.eAccessRights + + override tenv.ToString() = "TcEnv(...)" + +/// Represents the compilation environment for typechecking a single file in an assembly. +[] +type TcFileState = + { g: TcGlobals + + /// Push an entry every time a recursive value binding is used, + /// in order to be able to fix up recursive type applications as + /// we infer type parameters + mutable recUses: ValMultiMap + + /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached + stackGuard: StackGuard + + /// Set to true if this file causes the creation of generated provided types. + mutable createsGeneratedProvidedTypes: bool + + /// Are we in a script? if so relax the reporting of discarded-expression warnings at the top level + isScript: bool + + /// Environment needed to convert IL types to F# types in the importer. + amap: Import.ImportMap + + /// Used to generate new syntactic argument names in post-parse syntactic processing + synArgNameGenerator: SynArgNameGenerator + + tcSink: TcResultsSink + + /// Holds a reference to the component being compiled. + /// This field is very rarely used (mainly when fixing up forward references to fslib. + thisCcu: CcuThunk + + /// Holds the current inference constraints + css: ConstraintSolverState + + /// Are we compiling the signature of a module from fslib? + compilingCanonicalFslibModuleType: bool + + /// Is this a .fsi file? + isSig: bool + + /// Does this .fs file have a .fsi file? + haveSig: bool + + /// Used to generate names + niceNameGen: NiceNameGenerator + + /// Used to read and cache information about types and members + infoReader: InfoReader + + /// Used to resolve names + nameResolver: NameResolver + + /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. + conditionalDefines: string list option + + namedDebugPointsForInlinedCode: Dictionary + + isInternalTestSpanStackReferring: bool + + // forward call + TcPat: WarnOnUpperFlag -> TcFileState -> TcEnv -> PrelimValReprInfo option -> TcPatValFlags -> TcPatLinearEnv -> TType -> SynPat -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv + + // forward call + TcSimplePats: TcFileState -> bool -> CheckConstraints -> TType -> TcEnv -> TcPatLinearEnv -> SynSimplePats -> string list * TcPatLinearEnv + + // forward call + TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + + // forward call + TcArrayOrListComputedExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv + + // forward call + TcComputationExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv + } + + /// Create a new compilation environment + static member Create + (g, isScript, niceNameGen, amap, thisCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring, + tcPat, + tcSimplePats, + tcSequenceExpressionEntry, + tcArrayOrListSequenceExpression, + tcComputationExpression) = + + let infoReader = InfoReader(g, amap) + let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig + let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) + { g = g + amap = amap + recUses = ValMultiMap<_>.Empty + stackGuard = StackGuard(TcStackGuardDepth) + createsGeneratedProvidedTypes = false + thisCcu = thisCcu + isScript = isScript + css = ConstraintSolverState.New(g, amap, infoReader, tcVal) + infoReader = infoReader + tcSink = tcSink + nameResolver = nameResolver + niceNameGen = niceNameGen + synArgNameGenerator = SynArgNameGenerator() + isSig = isSig + haveSig = haveSig + namedDebugPointsForInlinedCode = Dictionary() + compilingCanonicalFslibModuleType = (isSig || not haveSig) && g.compilingFSharpCore + conditionalDefines = conditionalDefines + isInternalTestSpanStackReferring = isInternalTestSpanStackReferring + TcPat = tcPat + TcSimplePats = tcSimplePats + TcSequenceExpressionEntry = tcSequenceExpressionEntry + TcArrayOrListComputedExpression = tcArrayOrListSequenceExpression + TcComputationExpression = tcComputationExpression + } + + override _.ToString() = "" diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi new file mode 100644 index 00000000000..0a156d268d1 --- /dev/null +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module internal FSharp.Compiler.CheckBasics + +open System.Collections.Generic +open Internal.Utilities.Library +open FSharp.Compiler.AccessibilityLogic +open FSharp.Compiler.CompilerGlobalState +open FSharp.Compiler.ConstraintSolver +open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Import +open FSharp.Compiler.InfoReader +open FSharp.Compiler.NameResolution +open FSharp.Compiler.PatternMatchCompilation +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTreeOps +open FSharp.Compiler.TcGlobals +open FSharp.Compiler.Text +open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTreeOps + +/// Represents information about the initialization field used to check that object constructors +/// have completed before fields are accessed. +type SafeInitData = + | SafeInitField of RecdFieldRef * RecdField + | NoSafeInitInfo + +/// Represents information about object constructors +type CtorInfo = + { + /// Object model constructors have a very specific form to satisfy .NET limitations. + /// For "new = \arg. { new C with ... }" + /// ctor = 3 indicates about to type check "\arg. (body)", + /// ctor = 2 indicates about to type check "body" + /// ctor = 1 indicates actually type checking the body expression + /// 0 indicates everywhere else, including auxiliary expressions such expr1 in "let x = expr1 in { new ... }" + /// REVIEW: clean up this rather odd approach ... + ctorShapeCounter: int + + /// A handle to the ref cell to hold results of 'this' for 'type X() as x = ...' and 'new() as x = ...' constructs + /// in case 'x' is used in the arguments to the 'inherits' call. + safeThisValOpt: Val option + + /// A handle to the boolean ref cell to hold success of initialized 'this' for 'type X() as x = ...' constructs + safeInitInfo: SafeInitData + + /// Is the an implicit constructor or an explicit one? + ctorIsImplicit: bool + } + + static member InitialExplicit: safeThisValOpt: Val option * safeInitInfo: SafeInitData -> CtorInfo + + static member InitialImplicit: unit -> CtorInfo + +/// Represents an item in the environment that may restrict the automatic generalization of later +/// declarations because it refers to type inference variables. As type inference progresses +/// these type inference variables may get solved. +[] +type UngeneralizableItem = + + new: (unit -> FreeTyvars) -> UngeneralizableItem + + member internal GetFreeTyvars: unit -> FreeTyvars + + member internal WillNeverHaveFreeTypars: bool + + member internal CachedFreeLocalTycons: FreeTycons + + member internal CachedFreeTraitSolutions: FreeLocals + +/// Represents the type environment at a particular scope. Includes the name +/// resolution environment, the ungeneralizable items from earlier in the scope +/// and other information about the scope. +[] +type TcEnv = + { + /// Name resolution information + eNameResEnv: NameResolutionEnv + + /// The list of items in the environment that may contain free inference + /// variables (which may not be generalized). The relevant types may + /// change as a result of inference equations being asserted, hence may need to + /// be recomputed. + eUngeneralizableItems: UngeneralizableItem list + + // Two (!) versions of the current module path + // These are used to: + // - Look up the appropriate point in the corresponding signature + // see if an item is public or not + // - Change fslib canonical module type to allow compiler references to these items + // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary + // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. + // This information is used mainly when building non-local references + // to public items. + // + // Of the two, 'ePath' is the one that's barely used. It's only + // used by UpdateAccModuleOrNamespaceType to modify the CCU while compiling FSharp.Core + ePath: Ident list + + eCompPath: CompilationPath + + eAccessPath: CompilationPath + + /// This field is computed from other fields, but we amortize the cost of computing it. + eAccessRights: AccessorDomain + + /// Internals under these should be accessible + eInternalsVisibleCompPaths: CompilationPath list + + /// Mutable accumulator for the current module type + eModuleOrNamespaceTypeAccumulator: ModuleOrNamespaceType ref + + /// Context information for type checker + eContextInfo: ContextInfo + + /// Here Some tcref indicates we can access protected members in all super types + eFamilyType: TyconRef option + + // Information to enforce special restrictions on valid expressions + // for .NET constructors. + eCtorInfo: CtorInfo option + + eCallerMemberName: string option + + // Active arg infos in iterated lambdas , allowing us to determine the attributes of arguments + eLambdaArgInfos: ArgReprInfo list list + + eIsControlFlow: bool + } + + member DisplayEnv: DisplayEnv + + member NameEnv: NameResolutionEnv + + member AccessRights: AccessorDomain + +/// Represents the current environment of type variables that have implicit scope +/// (i.e. are without explicit declaration). +type UnscopedTyparEnv = UnscopedTyparEnv of NameMap + +/// A type to represent information associated with values to indicate what explicit (declared) type parameters +/// are given and what additional type parameters can be inferred, if any. +/// +/// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication +/// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x +type ExplicitTyparInfo = ExplicitTyparInfo of rigidCopyOfDeclaredTypars: Typars * declaredTypars: Typars * infer: bool + +type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs + +/// Indicates whether constraints should be checked when checking syntactic types +type CheckConstraints = + | CheckCxs + | NoCheckCxs + +/// Represents the ValReprInfo for a value, before the typars are fully inferred +type PrelimValReprInfo = PrelimValReprInfo of curriedArgInfos: ArgReprInfo list list * returnInfo: ArgReprInfo + +/// Holds the initial ValMemberInfo and other information before it is fully completed +type PrelimMemberInfo = PrelimMemberInfo of memberInfo: ValMemberInfo * logicalName: string * compiledName: string + +/// Represents the results of the first phase of preparing simple values from a pattern +type PrelimVal1 = + | PrelimVal1 of + id: Ident * + explicitTyparInfo: ExplicitTyparInfo * + prelimType: TType * + prelimValReprInfo: PrelimValReprInfo option * + memberInfoOpt: PrelimMemberInfo option * + isMutable: bool * + inlineFlag: ValInline * + baseOrThisInfo: ValBaseOrThisInfo * + argAttribs: ArgAndRetAttribs * + visibility: SynAccess option * + isCompGen: bool + + member Type: TType + + member Ident: Ident + +/// Translation of patterns is split into three phases. The first collects names. +/// The second is run after val_specs have been created for those names and inference +/// has been resolved. The second phase is run by applying a function returned by the +/// first phase. The input to the second phase is a List.map that gives the Val and type scheme +/// for each value bound by the pattern. +type TcPatPhase2Input = + | TcPatPhase2Input of NameMap * bool + + member WithRightPath: unit -> TcPatPhase2Input + +/// Represents the context flowed left-to-right through pattern checking +type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set + +/// Represents the flags passsed to TcPat regarding the binding location +type TcPatValFlags = + | TcPatValFlags of + inlineFlag: ValInline * + explicitTyparInfo: ExplicitTyparInfo * + argAndRetAttribs: ArgAndRetAttribs * + isMutable: bool * + visibility: SynAccess option * + isCompilerGenerated: bool + +/// Represents the compilation environment for typechecking a single file in an assembly. +[] +type TcFileState = + { + g: TcGlobals + + /// Push an entry every time a recursive value binding is used, + /// in order to be able to fix up recursive type applications as + /// we infer type parameters + mutable recUses: ValMultiMap + + /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached + stackGuard: StackGuard + + /// Set to true if this file causes the creation of generated provided types. + mutable createsGeneratedProvidedTypes: bool + + /// Are we in a script? if so relax the reporting of discarded-expression warnings at the top level + isScript: bool + + /// Environment needed to convert IL types to F# types in the importer. + amap: ImportMap + + /// Used to generate new syntactic argument names in post-parse syntactic processing + synArgNameGenerator: SynArgNameGenerator + + tcSink: TcResultsSink + + /// Holds a reference to the component being compiled. + /// This field is very rarely used (mainly when fixing up forward references to fslib. + thisCcu: CcuThunk + + /// Holds the current inference constraints + css: ConstraintSolverState + + /// Are we compiling the signature of a module from fslib? + compilingCanonicalFslibModuleType: bool + + /// Is this a .fsi file? + isSig: bool + + /// Does this .fs file have a .fsi file? + haveSig: bool + + /// Used to generate names + niceNameGen: NiceNameGenerator + + /// Used to read and cache information about types and members + infoReader: InfoReader + + /// Used to resolve names + nameResolver: NameResolver + + /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. + conditionalDefines: string list option + + namedDebugPointsForInlinedCode: Dictionary + + isInternalTestSpanStackReferring: bool + + // forward call + TcPat: WarnOnUpperFlag + -> TcFileState + -> TcEnv + -> PrelimValReprInfo option + -> TcPatValFlags + -> TcPatLinearEnv + -> TType + -> SynPat + -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv + + // forward call + TcSimplePats: TcFileState + -> bool + -> CheckConstraints + -> TType + -> TcEnv + -> TcPatLinearEnv + -> SynSimplePats + -> string list * TcPatLinearEnv + + // forward call + TcSequenceExpressionEntry: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> bool * SynExpr + -> range + -> Expr * UnscopedTyparEnv + + // forward call + TcArrayOrListComputedExpression: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> bool * SynExpr + -> range + -> Expr * UnscopedTyparEnv + + // forward call + TcComputationExpression: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> range * Expr * TType * SynExpr + -> Expr * UnscopedTyparEnv + } + + static member Create: + g: TcGlobals * + isScript: bool * + niceNameGen: NiceNameGenerator * + amap: ImportMap * + thisCcu: CcuThunk * + isSig: bool * + haveSig: bool * + conditionalDefines: string list option * + tcSink: TcResultsSink * + tcVal: TcValF * + isInternalTestSpanStackReferring: bool * + tcPat: (WarnOnUpperFlag -> TcFileState -> TcEnv -> PrelimValReprInfo option -> TcPatValFlags -> TcPatLinearEnv -> TType -> SynPat -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv) * + tcSimplePats: (TcFileState -> bool -> CheckConstraints -> TType -> TcEnv -> TcPatLinearEnv -> SynSimplePats -> string list * TcPatLinearEnv) * + tcSequenceExpressionEntry: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * + tcArrayOrListSequenceExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * + tcComputationExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv) -> + TcFileState diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index 0693609fa64..0f98af01961 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -8,6 +8,7 @@ open Internal.Utilities.Library open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features diff --git a/src/Compiler/Checking/CheckComputationExpressions.fsi b/src/Compiler/Checking/CheckComputationExpressions.fsi index 945307233e4..e9f24dfb15e 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fsi +++ b/src/Compiler/Checking/CheckComputationExpressions.fsi @@ -2,7 +2,7 @@ module internal FSharp.Compiler.CheckComputationExpressions -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.Syntax open FSharp.Compiler.Text diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 23b08bd45ee..b478be9a506 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -15,9 +15,9 @@ open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CheckComputationExpressions open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckIncrementalClasses open FSharp.Compiler.CheckPatterns -open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features @@ -1017,7 +1017,7 @@ module MutRecBindingChecking = let envForTycon = if isExtrinsic then envForTycon else AddLocalTyconRefs true g cenv.amap tcref.Range [tcref] envForTycon // Set up the environment so use-before-definition warnings are given, at least // until we reach a Phase2AIncrClassCtorJustAfterSuperInit. - let envForTycon = { envForTycon with eCtorInfo = Some (InitialImplicitCtorInfo()) } + let envForTycon = { envForTycon with eCtorInfo = Some (CtorInfo.InitialImplicit()) } let reqdThisValTyOpt = Some thisTy diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index 631e9fb5812..8a858bca0c4 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -3,7 +3,7 @@ module internal FSharp.Compiler.CheckDeclarations open Internal.Utilities.Library -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.NameResolution open FSharp.Compiler.Import diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 8f034836dd9..d9dea031fe5 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -17,6 +17,7 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CompilerGlobalState +open FSharp.Compiler.CheckBasics open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features @@ -53,12 +54,6 @@ let mkNilListPat (g: TcGlobals) m ty = TPat_unioncase(g.nil_ucref, [ty], [], m) let mkConsListPat (g: TcGlobals) ty ph pt = TPat_unioncase(g.cons_ucref, [ty], [ph;pt], unionRanges ph.Range pt.Range) -#if DEBUG -let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 40 -#else -let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 80 -#endif - //------------------------------------------------------------------------- // Errors. //------------------------------------------------------------------------- @@ -153,134 +148,6 @@ exception StandardOperatorRedefinitionWarning of string * range exception InvalidInternalsVisibleToAssemblyName of badName: string * fileName: string option -/// Represents information about the initialization field used to check that object constructors -/// have completed before fields are accessed. -type SafeInitData = - | SafeInitField of RecdFieldRef * RecdField - | NoSafeInitInfo - -/// Represents information about object constructors -type CtorInfo = - { /// Object model constructors have a very specific form to satisfy .NET limitations. - /// For "new = \arg. { new C with ... }" - /// ctor = 3 indicates about to type check "\arg. (body)", - /// ctor = 2 indicates about to type check "body" - /// ctor = 1 indicates actually type checking the body expression - /// 0 indicates everywhere else, including auxiliary expressions such expr1 in "let x = expr1 in { new ... }" - /// REVIEW: clean up this rather odd approach ... - ctorShapeCounter: int - - /// A handle to the ref cell to hold results of 'this' for 'type X() as x = ...' and 'new() as x = ...' constructs - /// in case 'x' is used in the arguments to the 'inherits' call. - safeThisValOpt: Val option - - /// A handle to the boolean ref cell to hold success of initialized 'this' for 'type X() as x = ...' constructs - safeInitInfo: SafeInitData - - /// Is the an implicit constructor or an explicit one? - ctorIsImplicit: bool - } - -/// Represents an item in the environment that may restrict the automatic generalization of later -/// declarations because it refers to type inference variables. As type inference progresses -/// these type inference variables may get solved. -[] -type UngeneralizableItem(computeFreeTyvars: unit -> FreeTyvars) = - - // Flag is for: have we determined that this item definitely has - // no free type inference variables? This implies that - // (a) it will _never_ have any free type inference variables as further constraints are added to the system. - // (b) its set of FreeTycons will not change as further constraints are added to the system - let mutable willNeverHaveFreeTypars = false - - // If WillNeverHaveFreeTypars then we can cache the computation of FreeTycons, since they are invariant. - let mutable cachedFreeLocalTycons = emptyFreeTycons - - // If WillNeverHaveFreeTypars then we can cache the computation of FreeTraitSolutions, since they are invariant. - let mutable cachedFreeTraitSolutions = emptyFreeLocals - - member _.GetFreeTyvars() = - let fvs = computeFreeTyvars() - if fvs.FreeTypars.IsEmpty then - willNeverHaveFreeTypars <- true - cachedFreeLocalTycons <- fvs.FreeTycons - cachedFreeTraitSolutions <- fvs.FreeTraitSolutions - fvs - - member _.WillNeverHaveFreeTypars = willNeverHaveFreeTypars - - member _.CachedFreeLocalTycons = cachedFreeLocalTycons - - member _.CachedFreeTraitSolutions = cachedFreeTraitSolutions - -/// Represents the type environment at a particular scope. Includes the name -/// resolution environment, the ungeneralizable items from earlier in the scope -/// and other information about the scope. -[] -type TcEnv = - { /// Name resolution information - eNameResEnv: NameResolutionEnv - - /// The list of items in the environment that may contain free inference - /// variables (which may not be generalized). The relevant types may - /// change as a result of inference equations being asserted, hence may need to - /// be recomputed. - eUngeneralizableItems: UngeneralizableItem list - - // Two (!) versions of the current module path - // These are used to: - // - Look up the appropriate point in the corresponding signature - // see if an item is public or not - // - Change fslib canonical module type to allow compiler references to these items - // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary - // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. - // This information is used mainly when building non-local references - // to public items. - // - // Of the two, 'ePath' is the one that's barely used. It's only - // used by UpdateAccModuleOrNamespaceType to modify the CCU while compiling FSharp.Core - ePath: Ident list - - eCompPath: CompilationPath - - eAccessPath: CompilationPath - - /// This field is computed from other fields, but we amortize the cost of computing it. - eAccessRights: AccessorDomain - - /// Internals under these should be accessible - eInternalsVisibleCompPaths: CompilationPath list - - /// Mutable accumulator for the current module type - eModuleOrNamespaceTypeAccumulator: ModuleOrNamespaceType ref - - /// Context information for type checker - eContextInfo: ContextInfo - - /// Here Some tcref indicates we can access protected members in all super types - eFamilyType: TyconRef option - - // Information to enforce special restrictions on valid expressions - // for .NET constructors. - eCtorInfo: CtorInfo option - - eCallerMemberName: string option - - // Active arg infos in iterated lambdas , allowing us to determine the attributes of arguments - eLambdaArgInfos: ArgReprInfo list list - - // Do we lay down an implicit debug point? - eIsControlFlow: bool - } - - member tenv.DisplayEnv = tenv.eNameResEnv.DisplayEnv - - member tenv.NameEnv = tenv.eNameResEnv - - member tenv.AccessRights = tenv.eAccessRights - - override tenv.ToString() = "TcEnv(...)" - /// Compute the available access rights from a particular location in code let ComputeAccessRights eAccessPath eInternalsVisibleCompPaths eFamilyType = AccessibleFrom (eAccessPath :: eInternalsVisibleCompPaths, eFamilyType) @@ -290,18 +157,6 @@ let ComputeAccessRights eAccessPath eInternalsVisibleCompPaths eFamilyType = // that may be able to access "protected" members. //------------------------------------------------------------------------- -let InitialExplicitCtorInfo (safeThisValOpt, safeInitInfo) = - { ctorShapeCounter = 3 - safeThisValOpt = safeThisValOpt - safeInitInfo = safeInitInfo - ctorIsImplicit = false} - -let InitialImplicitCtorInfo () = - { ctorShapeCounter = 0 - safeThisValOpt = None - safeInitInfo = NoSafeInitInfo - ctorIsImplicit = true } - let EnterFamilyRegion tcref env = let eFamilyType = Some tcref { env with @@ -318,11 +173,15 @@ let ExitFamilyRegion env = eFamilyType = eFamilyType } let AreWithinCtorShape env = match env.eCtorInfo with None -> false | Some ctorInfo -> ctorInfo.ctorShapeCounter > 0 + let AreWithinImplicitCtor env = match env.eCtorInfo with None -> false | Some ctorInfo -> ctorInfo.ctorIsImplicit + let GetCtorShapeCounter env = match env.eCtorInfo with None -> 0 | Some ctorInfo -> ctorInfo.ctorShapeCounter + let GetRecdInfo env = match env.eCtorInfo with None -> RecdExpr | Some ctorInfo -> if ctorInfo.ctorShapeCounter = 1 then RecdExprIsObjInit else RecdExpr let AdjustCtorShapeCounter f env = {env with eCtorInfo = Option.map (fun ctorInfo -> { ctorInfo with ctorShapeCounter = f ctorInfo.ctorShapeCounter }) env.eCtorInfo } + let ExitCtorShapeRegion env = AdjustCtorShapeCounter (fun _ -> 0) env /// Add a type to the TcEnv, i.e. register it as ungeneralizable. @@ -392,8 +251,6 @@ let AddDeclaredTypars check typars env = /// Environment of implicitly scoped type parameters, e.g. 'a in "(x: 'a)" -type UnscopedTyparEnv = UnscopedTyparEnv of NameMap - let emptyUnscopedTyparEnv: UnscopedTyparEnv = UnscopedTyparEnv Map.empty let AddUnscopedTypar name typar (UnscopedTyparEnv tab) = UnscopedTyparEnv (Map.add name typar tab) @@ -403,31 +260,14 @@ let TryFindUnscopedTypar name (UnscopedTyparEnv tab) = Map.tryFind name tab let HideUnscopedTypars typars (UnscopedTyparEnv tab) = UnscopedTyparEnv (List.fold (fun acc (tp: Typar) -> Map.remove tp.Name acc) tab typars) -/// Indicates whether constraints should be checked when checking syntactic types -type CheckConstraints = - | CheckCxs - | NoCheckCxs - type OverridesOK = | OverridesOK | WarnOnOverrides | ErrorOnOverrides -/// A type to represent information associated with values to indicate what explicit (declared) type parameters -/// are given and what additional type parameters can be inferred, if any. -/// -/// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication -/// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x -type ExplicitTyparInfo = - | ExplicitTyparInfo of - rigidCopyOfDeclaredTypars: Typars * - declaredTypars: Typars * - infer: bool - let permitInferTypars = ExplicitTyparInfo ([], [], true) let dontInferTypars = ExplicitTyparInfo ([], [], false) -type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs let noArgOrRetAttribs = ArgAndRetAttribs ([], []) /// A flag to represent the sort of bindings are we processing. @@ -517,43 +357,6 @@ type DeclKind = | ObjectExpressionOverrideBinding -> OverridesOK | ExpressionBinding -> ErrorOnOverrides -//------------------------------------------------------------------------- -// Data structures that track the gradual accumulation of information -// about values and members during inference. -//------------------------------------------------------------------------- - -/// The ValReprInfo for a value, except the number of typars is not yet inferred -type PrelimValReprInfo = - | PrelimValReprInfo of - curriedArgInfos: ArgReprInfo list list * - returnInfo: ArgReprInfo - -type PrelimMemberInfo = - | PrelimMemberInfo of - memberInfo: ValMemberInfo * - logicalName: string * - compiledName: string - -/// The results of preliminary pass over patterns to extract variables being declared. -// We should make this a record for cleaner code -type PrelimVal1 = - | PrelimVal1 of - id: Ident * - explicitTyparInfo: ExplicitTyparInfo * - prelimType: TType * - prelimValReprInfo: PrelimValReprInfo option * - memberInfoOpt: PrelimMemberInfo option * - isMutable: bool * - inlineFlag: ValInline * - baseOrThisInfo: ValBaseOrThisInfo * - argAttribs: ArgAndRetAttribs * - visibility: SynAccess option * - isCompGen: bool - - member x.Type = let (PrelimVal1(prelimType=ty)) = x in ty - - member x.Ident = let (PrelimVal1(id=id)) = x in id - /// The results of applying let-style generalization after type checking. // We should make this a record for cleaner code type PrelimVal2 = @@ -593,17 +396,6 @@ type ValScheme = member x.ValReprInfo = let (ValScheme(valReprInfo=valReprInfo)) = x in valReprInfo -/// Translation of patterns is split into three phases. The first collects names. -/// The second is run after val_specs have been created for those names and inference -/// has been resolved. The second phase is run by applying a function returned by the -/// first phase. The input to the second phase is a List.map that gives the Val and type scheme -/// for each value bound by the pattern. -type TcPatPhase2Input = - | TcPatPhase2Input of NameMap * bool - - // Get an input indicating we are no longer on the left-most path through a disjunctive "or" pattern - member x.WithRightPath() = (let (TcPatPhase2Input(a, _)) = x in TcPatPhase2Input(a, false)) - /// The first phase of checking and elaborating a binding leaves a goop of information. /// This is a bit of a mess: much of this information is also carried on a per-value basis by the /// "NameMap". @@ -628,125 +420,6 @@ type CheckedBindingInfo = member x.DebugPoint = let (CheckedBindingInfo(debugPoint=debugPoint)) = x in debugPoint -type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set - -type TcPatValFlags = TcPatValFlags of inlineFlag: ValInline * explicitTyparInfo: ExplicitTyparInfo * argAndRetAttribs: ArgAndRetAttribs * isMutable: bool * visibility: SynAccess option * isCompilerGenerated: bool - -/// Represents the compilation environment for typechecking a single file in an assembly. -[] -type TcFileState = - { g: TcGlobals - - /// Push an entry every time a recursive value binding is used, - /// in order to be able to fix up recursive type applications as - /// we infer type parameters - mutable recUses: ValMultiMap - - /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached - stackGuard: StackGuard - - /// Set to true if this file causes the creation of generated provided types. - mutable createsGeneratedProvidedTypes: bool - - /// Are we in a script? if so relax the reporting of discarded-expression warnings at the top level - isScript: bool - - /// Environment needed to convert IL types to F# types in the importer. - amap: Import.ImportMap - - /// Used to generate new syntactic argument names in post-parse syntactic processing - synArgNameGenerator: SynArgNameGenerator - - tcSink: TcResultsSink - - /// Holds a reference to the component being compiled. - /// This field is very rarely used (mainly when fixing up forward references to fslib. - thisCcu: CcuThunk - - /// Holds the current inference constraints - css: ConstraintSolverState - - /// Are we compiling the signature of a module from fslib? - compilingCanonicalFslibModuleType: bool - - /// Is this a .fsi file? - isSig: bool - - /// Does this .fs file have a .fsi file? - haveSig: bool - - /// Used to generate names - niceNameGen: NiceNameGenerator - - /// Used to read and cache information about types and members - infoReader: InfoReader - - /// Used to resolve names - nameResolver: NameResolver - - /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. - conditionalDefines: string list option - - namedDebugPointsForInlinedCode: Dictionary - - isInternalTestSpanStackReferring: bool - - // forward call - TcPat: WarnOnUpperFlag -> TcFileState -> TcEnv -> PrelimValReprInfo option -> TcPatValFlags -> TcPatLinearEnv -> TType -> SynPat -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv - - // forward call - TcSimplePats: TcFileState -> bool -> CheckConstraints -> TType -> TcEnv -> TcPatLinearEnv -> SynSimplePats -> string list * TcPatLinearEnv - - // forward call - TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv - - // forward call - TcArrayOrListComputedExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv - - // forward call - TcComputationExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv - } - - /// Create a new compilation environment - static member Create - (g, isScript, niceNameGen, amap, thisCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring, - tcPat, - tcSimplePats, - tcSequenceExpressionEntry, - tcArrayOrListSequenceExpression, - tcComputationExpression) = - - let infoReader = InfoReader(g, amap) - let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig - let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) - { g = g - amap = amap - recUses = ValMultiMap<_>.Empty - stackGuard = StackGuard(TcStackGuardDepth) - createsGeneratedProvidedTypes = false - thisCcu = thisCcu - isScript = isScript - css = ConstraintSolverState.New(g, amap, infoReader, tcVal) - infoReader = infoReader - tcSink = tcSink - nameResolver = nameResolver - niceNameGen = niceNameGen - synArgNameGenerator = SynArgNameGenerator() - isSig = isSig - haveSig = haveSig - namedDebugPointsForInlinedCode = Dictionary() - compilingCanonicalFslibModuleType = (isSig || not haveSig) && g.compilingFSharpCore - conditionalDefines = conditionalDefines - isInternalTestSpanStackReferring = isInternalTestSpanStackReferring - TcPat = tcPat - TcSimplePats = tcSimplePats - TcSequenceExpressionEntry = tcSequenceExpressionEntry - TcArrayOrListComputedExpression = tcArrayOrListSequenceExpression - TcComputationExpression = tcComputationExpression - } - - override _.ToString() = "" - type cenv = TcFileState let CopyAndFixupTypars g m rigid tpsorig = @@ -761,7 +434,7 @@ let UnifyTypes (cenv: cenv) (env: TcEnv) m actualTy expectedTy = // // Any call to UnifyOverallType MUST have a matching call to TcAdjustExprForTypeDirectedConversions // to actually build the expression for any conversion applied. -let UnifyOverallType cenv (env: TcEnv) m overallTy actualTy = +let UnifyOverallType (cenv: cenv) (env: TcEnv) m overallTy actualTy = let g = cenv.g match overallTy with | MustConvertTo(isMethodArg, reqdTy) when g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions -> @@ -792,7 +465,7 @@ let UnifyOverallType cenv (env: TcEnv) m overallTy actualTy = | _ -> UnifyTypes cenv env m overallTy.Commit actualTy -let UnifyOverallTypeAndRecover cenv env m overallTy actualTy = +let UnifyOverallTypeAndRecover (cenv: cenv) env m overallTy actualTy = try UnifyOverallType cenv env m overallTy actualTy with exn -> @@ -800,7 +473,7 @@ let UnifyOverallTypeAndRecover cenv env m overallTy actualTy = // Calls UnifyTypes, but upon error only does the minimal error recovery // so that IntelliSense information can continue to be collected. -let UnifyTypesAndRecover cenv env m expectedTy actualTy = +let UnifyTypesAndRecover (cenv: cenv) env m expectedTy actualTy = try UnifyTypes cenv env m expectedTy actualTy with exn -> @@ -974,7 +647,7 @@ let UnifyFunctionTypeUndoIfFailed (cenv: cenv) denv m ty = /// Optimized unification routine that avoids creating new inference /// variables unnecessarily -let UnifyFunctionType extraInfo cenv denv mFunExpr ty = +let UnifyFunctionType extraInfo (cenv: cenv) denv mFunExpr ty = match UnifyFunctionTypeUndoIfFailed cenv denv mFunExpr ty with | ValueSome res -> res | ValueNone -> @@ -1370,7 +1043,7 @@ let NonGenericTypeScheme ty = GeneralizedType([], ty) // elaborated representation. //------------------------------------------------------------------------- -let UpdateAccModuleOrNamespaceType cenv env f = +let UpdateAccModuleOrNamespaceType (cenv: cenv) env f = // When compiling FSharp.Core, modify the fslib CCU to ensure forward stable references used by // the compiler can be resolved ASAP. Not at all pretty but it's hard to // find good ways to do references from the compiler into a term graph. @@ -1380,18 +1053,18 @@ let UpdateAccModuleOrNamespaceType cenv env f = modul.entity_modul_type <- MaybeLazy.Strict (f true modul.ModuleOrNamespaceType) SetCurrAccumulatedModuleOrNamespaceType env (f false (GetCurrAccumulatedModuleOrNamespaceType env)) -let PublishModuleDefn cenv env mspec = +let PublishModuleDefn (cenv: cenv) env mspec = UpdateAccModuleOrNamespaceType cenv env (fun intoFslibCcu mty -> if intoFslibCcu then mty else mty.AddEntity mspec) let item = Item.ModuleOrNamespaces([mkLocalModuleRef mspec]) CallNameResolutionSink cenv.tcSink (mspec.Range, env.NameEnv, item, emptyTyparInst, ItemOccurence.Binding, env.AccessRights) -let PublishTypeDefn cenv env mspec = +let PublishTypeDefn (cenv: cenv) env mspec = UpdateAccModuleOrNamespaceType cenv env (fun _ mty -> mty.AddEntity mspec) -let PublishValueDefnPrim cenv env (vspec: Val) = +let PublishValueDefnPrim (cenv: cenv) env (vspec: Val) = UpdateAccModuleOrNamespaceType cenv env (fun _ mty -> mty.AddVal vspec) @@ -1678,7 +1351,7 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec vspec -let MakeAndPublishVals cenv env (altActualParent, inSig, declKind, valRecInfo, valSchemes, attrs, xmlDoc, literalValue) = +let MakeAndPublishVals (cenv: cenv) env (altActualParent, inSig, declKind, valRecInfo, valSchemes, attrs, xmlDoc, literalValue) = Map.foldBack (fun name (valscheme: ValScheme) values -> Map.add name (MakeAndPublishVal cenv env (altActualParent, inSig, declKind, valRecInfo, valscheme, attrs, xmlDoc, literalValue, false), valscheme.GeneralizedType) values) @@ -1686,7 +1359,7 @@ let MakeAndPublishVals cenv env (altActualParent, inSig, declKind, valRecInfo, v Map.empty /// Create a Val node for "base" in a class -let MakeAndPublishBaseVal cenv env baseIdOpt ty = +let MakeAndPublishBaseVal (cenv: cenv) env baseIdOpt ty = baseIdOpt |> Option.map (fun (id: Ident) -> let valscheme = ValScheme(id, NonGenericTypeScheme ty, None, None, None, false, ValInline.Never, BaseVal, None, false, false, false, false) @@ -1715,7 +1388,7 @@ let MakeAndPublishSafeThisVal (cenv: cenv) env (thisIdOpt: Ident option) thisTy /// Fixup the type instantiation at recursive references. Used after the bindings have been /// checked. The fixups are applied by using mutation. -let AdjustAndForgetUsesOfRecValue cenv (vrefTgt: ValRef) (valScheme: ValScheme) = +let AdjustAndForgetUsesOfRecValue (cenv: cenv) (vrefTgt: ValRef) (valScheme: ValScheme) = let (GeneralizedType(generalizedTypars, _)) = valScheme.GeneralizedType let valTy = GeneralizedTypeForTypeScheme valScheme.GeneralizedType let lvrefTgt = vrefTgt.Deref @@ -1753,7 +1426,7 @@ let AdjustRecType (v: Val) vscheme = /// Record the generated value expression as a place where we will have to /// adjust using AdjustAndForgetUsesOfRecValue at a letrec point. Every use of a value /// under a letrec gets used at the _same_ type instantiation. -let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vExpr m = +let RecordUseOfRecValue (cenv: cenv) valRecInfo (vrefTgt: ValRef) vExpr m = match valRecInfo with | ValInRecScope isComplete -> let fixupPoint = ref vExpr @@ -1765,7 +1438,7 @@ let RecordUseOfRecValue cenv valRecInfo (vrefTgt: ValRef) vExpr m = type RecursiveUseFixupPoints = RecursiveUseFixupPoints of (Expr ref * range) list /// Get all recursive references, for fixing up delayed recursion using laziness -let GetAllUsesOfRecValue cenv vrefTgt = +let GetAllUsesOfRecValue (cenv: cenv) vrefTgt = RecursiveUseFixupPoints (cenv.recUses.Find vrefTgt |> List.map (fun (fixupPoint, m, _) -> (fixupPoint, m))) @@ -1846,7 +1519,7 @@ let GeneralizeVal (cenv: cenv) denv enclosingDeclaredTypars generalizedTyparsFor PrelimVal2(id, tyScheme, prelimValReprInfo, memberInfoOpt, isMutable, inlineFlag, baseOrThis, argAttribs, vis, isCompGen, hasDeclaredTypars) -let GeneralizeVals cenv denv enclosingDeclaredTypars generalizedTypars types = +let GeneralizeVals (cenv: cenv) denv enclosingDeclaredTypars generalizedTypars types = NameMap.map (GeneralizeVal cenv denv enclosingDeclaredTypars generalizedTypars) types let DontGeneralizeVals types = @@ -1967,7 +1640,7 @@ let UseNoValReprInfo prelimScheme = BuildValScheme ExpressionBinding None prelimScheme /// Make and publish the Val nodes for a collection of simple (non-generic) value specifications -let MakeAndPublishSimpleVals cenv env names = +let MakeAndPublishSimpleVals (cenv: cenv) env names = let tyschemes = DontGeneralizeVals names let valSchemes = NameMap.map UseNoValReprInfo tyschemes let values = MakeAndPublishVals cenv env (ParentNone, false, ExpressionBinding, ValNotInRecScope, valSchemes, [], XmlDoc.Empty, None) @@ -2211,18 +1884,18 @@ let rec ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) e mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] | _ -> invalidArg "item" "not a union case or exception reference" -let ApplyUnionCaseOrExnTypes m cenv env overallTy c = +let ApplyUnionCaseOrExnTypes m (cenv: cenv) env overallTy c = ApplyUnionCaseOrExn ((fun (a, b) mArgs args -> mkUnionCaseExpr(a, b, args, unionRanges m mArgs)), (fun a mArgs args -> mkExnExpr (a, args, unionRanges m mArgs))) m cenv env overallTy c -let ApplyUnionCaseOrExnTypesForPat m cenv env overallTy c = +let ApplyUnionCaseOrExnTypesForPat m (cenv: cenv) env overallTy c = ApplyUnionCaseOrExn ((fun (a, b) mArgs args -> TPat_unioncase(a, b, args, unionRanges m mArgs)), (fun a mArgs args -> TPat_exnconstr(a, args, unionRanges m mArgs))) m cenv env overallTy c let UnionCaseOrExnCheck (env: TcEnv) numArgTys numArgs m = if numArgs <> numArgTys then error (UnionCaseWrongArguments(env.DisplayEnv, numArgTys, numArgs, m)) -let TcUnionCaseOrExnField cenv (env: TcEnv) ty1 m longId fieldNum funcs = +let TcUnionCaseOrExnField (cenv: cenv) (env: TcEnv) ty1 m longId fieldNum funcs = let ad = env.eAccessRights let mkf, argTys, _argNames = @@ -2432,7 +2105,7 @@ module GeneralizationHelpers = generalizedTypars - let ComputeAndGeneralizeGenericTypars (cenv, + let ComputeAndGeneralizeGenericTypars (cenv: cenv, denv: DisplayEnv, m, freeInEnv: FreeTypars, @@ -2624,14 +2297,14 @@ module BindingNormalization = NormalizedBindingRhs(spatsL2@spatsL, rtyOpt, rhsExpr) - let private MakeNormalizedStaticOrValBinding cenv isObjExprBinding id vis typars args rhsExpr valSynData = + let private MakeNormalizedStaticOrValBinding (cenv: cenv) isObjExprBinding id vis typars args rhsExpr valSynData = let (SynValData(memberFlagsOpt, _, _)) = valSynData NormalizedBindingPat(mkSynPatVar vis id, PushMultiplePatternsToRhs cenv ((isObjExprBinding = ObjExprBinding) || Option.isSome memberFlagsOpt) args rhsExpr, valSynData, typars) - let private MakeNormalizedInstanceMemberBinding cenv thisId memberId toolId vis m typars args rhsExpr valSynData = + let private MakeNormalizedInstanceMemberBinding (cenv: cenv) thisId memberId toolId vis m typars args rhsExpr valSynData = NormalizedBindingPat(SynPat.InstanceMember(thisId, memberId, toolId, vis, m), PushMultiplePatternsToRhs cenv true args rhsExpr, valSynData, typars) - let private NormalizeStaticMemberBinding cenv (memberFlags: SynMemberFlags) valSynData id vis typars args m rhsExpr = + let private NormalizeStaticMemberBinding (cenv: cenv) (memberFlags: SynMemberFlags) valSynData id vis typars args m rhsExpr = let (SynValData(_, valSynInfo, thisIdOpt)) = valSynData if memberFlags.IsInstance then // instance method without adhoc "this" argument @@ -2653,7 +2326,7 @@ module BindingNormalization = typars) | _ -> MakeNormalizedStaticOrValBinding cenv ValOrMemberBinding id vis typars args rhsExpr valSynData - let private NormalizeInstanceMemberBinding cenv (memberFlags: SynMemberFlags) valSynData thisId memberId (toolId: Ident option) vis typars args m rhsExpr = + let private NormalizeInstanceMemberBinding (cenv: cenv) (memberFlags: SynMemberFlags) valSynData thisId memberId (toolId: Ident option) vis typars args m rhsExpr = let (SynValData(_, valSynInfo, thisIdOpt)) = valSynData if not memberFlags.IsInstance then @@ -2684,7 +2357,7 @@ module BindingNormalization = | _ -> MakeNormalizedInstanceMemberBinding cenv thisId memberId toolId vis m typars args rhsExpr valSynData - let private NormalizeBindingPattern cenv nameResolver isObjExprBinding (env: TcEnv) valSynData headPat rhsExpr = + let private NormalizeBindingPattern (cenv: cenv) nameResolver isObjExprBinding (env: TcEnv) valSynData headPat rhsExpr = let ad = env.AccessRights let (SynValData(memberFlagsOpt, _, _)) = valSynData let rec normPattern pat = @@ -2748,7 +2421,7 @@ module BindingNormalization = NormalizedBindingPat(pat, rhsExpr, valSynData, inferredTyparDecls) normPattern headPat - let NormalizeBinding isObjExprBinding cenv (env: TcEnv) binding = + let NormalizeBinding isObjExprBinding (cenv: cenv) (env: TcEnv) binding = match binding with | SynBinding (vis, kind, isInline, isMutable, Attributes attrs, xmlDoc, valSynData, headPat, retInfo, rhsExpr, mBinding, debugPoint, _) -> let (NormalizedBindingPat(pat, rhsExpr, valSynData, typars)) = @@ -2801,7 +2474,7 @@ module EventDeclarationNormalization = /// Some F# bindings syntactically imply additional bindings, notably properties /// annotated with [] - let GenerateExtraBindings cenv (bindingAttribs, binding) = + let GenerateExtraBindings (cenv: cenv) (bindingAttribs, binding) = let g = cenv.g let (NormalizedBinding(vis1, bindingKind, isInline, isMutable, _, bindingXmlDoc, _synTyparDecls, valSynData, declPattern, bindingRhs, mBinding, debugPoint)) = binding @@ -2843,7 +2516,7 @@ module EventDeclarationNormalization = /// Make a copy of the "this" type for a generic object type, e.g. List<'T> --> List<'?> for a fresh inference variable. /// Also adjust the "this" type to take into account whether the type is a struct. -let FreshenObjectArgType cenv m rigid tcref isExtrinsic declaredTyconTypars = +let FreshenObjectArgType (cenv: cenv) m rigid tcref isExtrinsic declaredTyconTypars = let g = cenv.g #if EXTENDED_EXTENSION_MEMBERS // indicates if extension members can add additional constraints to type parameters @@ -2890,7 +2563,7 @@ let FreshenObjectArgType cenv m rigid tcref isExtrinsic declaredTyconTypars = // be accepted). As a result, we deal with this unsoundness by an adhoc post-type-checking // consistency check for recursive uses of "A" with explicit instantiations within the recursive // scope of "A". -let TcValEarlyGeneralizationConsistencyCheck cenv (env: TcEnv) (v: Val, valRecInfo, tinst, vTy, tau, m) = +let TcValEarlyGeneralizationConsistencyCheck (cenv: cenv) (env: TcEnv) (v: Val, valRecInfo, tinst, vTy, tau, m) = let g = cenv.g match valRecInfo with @@ -3101,10 +2774,10 @@ type ApplicableExpr = let (ApplicableExpr (_, expr, _, _)) = x expr -let MakeApplicableExprNoFlex cenv expr = +let MakeApplicableExprNoFlex (cenv: cenv) expr = ApplicableExpr (cenv, expr, true, None) -let MakeApplicableExprForTraitCall cenv expr traitCallInfo = +let MakeApplicableExprForTraitCall (cenv: cenv) expr traitCallInfo = ApplicableExpr (cenv, expr, true, Some traitCallInfo) /// This function reverses the effect of condensation for a named function value (indeed it can @@ -3140,7 +2813,7 @@ let MakeApplicableExprForTraitCall cenv expr traitCallInfo = let isNonFlexibleTy g ty = isSealedTy g ty -let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = +let MakeApplicableExprWithFlex (cenv: cenv) (env: TcEnv) expr = let g = cenv.g let exprTy = tyOfExpr g expr let m = expr.Range @@ -3167,7 +2840,7 @@ let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = ApplicableExpr (cenv, expr, true, None) /// Checks, warnings and constraint assertions for downcasts -let TcRuntimeTypeTest isCast isOperator cenv denv m tgtTy srcTy = +let TcRuntimeTypeTest isCast isOperator (cenv: cenv) denv m tgtTy srcTy = let g = cenv.g if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy then warning(TypeTestUnnecessary m) @@ -3197,7 +2870,7 @@ let TcRuntimeTypeTest isCast isOperator cenv denv m tgtTy srcTy = warning(Error(FSComp.SR.tcTypeTestLossy(NicePrint.minimalStringOfType denv ety, NicePrint.minimalStringOfType denv (stripTyEqnsWrtErasure EraseAll g ety)), m)) /// Checks, warnings and constraint assertions for upcasts -let TcStaticUpcast cenv denv m tgtTy srcTy = +let TcStaticUpcast (cenv: cenv) denv m tgtTy srcTy = let g = cenv.g if isTyparTy g tgtTy then if not (destTyparTy g tgtTy).IsCompatFlex then @@ -3300,7 +2973,7 @@ let BuildDisposableCleanup (cenv: cenv) env m (v: Val) = mkIsInstConditional g m g.system_IDisposable_ty inputExpr disposeObjVar disposeExpr (mkUnit g m) /// Build call to get_OffsetToStringData as part of 'fixed' -let BuildOffsetToStringData cenv env m = +let BuildOffsetToStringData (cenv: cenv) env m = let g = cenv.g let ad = env.eAccessRights @@ -3438,13 +3111,13 @@ let GetMethodArgs arg = // Helpers dealing with pattern match compilation //------------------------------------------------------------------------- -let CompilePatternForMatch cenv (env: TcEnv) mExpr mMatch warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy = +let CompilePatternForMatch (cenv: cenv) (env: TcEnv) mExpr mMatch warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy = let g = cenv.g let dtree, targets = CompilePattern g env.DisplayEnv cenv.amap (LightweightTcValForUsingInBuildMethodCall g) cenv.infoReader mExpr mMatch warnOnUnused actionOnFailure (inputVal, generalizedTypars, inputExprOpt) clauses inputTy resultTy mkAndSimplifyMatch DebugPointAtBinding.NoneAtInvisible mExpr mMatch resultTy dtree targets /// Compile a pattern -let CompilePatternForMatchClauses cenv env mExpr mMatch warnOnUnused actionOnFailure inputExprOpt inputTy resultTy tclauses = +let CompilePatternForMatchClauses (cenv: cenv) env mExpr mMatch warnOnUnused actionOnFailure inputExprOpt inputTy resultTy tclauses = // Avoid creating a dummy in the common cases where we are about to bind a name for the expression // CLEANUP: avoid code duplication with code further below, i.e.all callers should call CompilePatternForMatch match tclauses with @@ -3978,7 +3651,7 @@ let CheckAndRewriteObjectCtor g env (ctorLambdaExpr: Expr) = /// Post-typechecking normalizations to enforce semantic constraints /// lazy and, lazy or, rethrow, address-of -let buildApp cenv expr resultTy arg m = +let buildApp (cenv: cenv) expr resultTy arg m = let g = cenv.g match expr, arg with @@ -4096,13 +3769,6 @@ type NewSlotsOK = | NewSlotsOK | NoNewSlots -/// Indicates whether a syntactic type is allowed to include new type variables -/// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` -type ImplicitlyBoundTyparsAllowed = - | NewTyparsOKButWarnIfNotRigid - | NewTyparsOK - | NoNewTypars - /// Indicates whether the position being checked is precisely the r.h.s. of a "'T :> ***" constraint or a similar /// places where IWSAM types do not generate a warning [] @@ -4232,11 +3898,18 @@ let GetInstanceMemberThisVariable (vspec: Val, expr) = else None +/// Indicates whether a syntactic type is allowed to include new type variables +/// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` +type ImplicitlyBoundTyparsAllowed = + | NewTyparsOKButWarnIfNotRigid + | NewTyparsOK + | NoNewTypars + //------------------------------------------------------------------------- // Checking types and type constraints //------------------------------------------------------------------------- /// Check specifications of constraints on type parameters -let rec TcTyparConstraint ridx cenv newOk checkConstraints occ (env: TcEnv) tpenv c = +let rec TcTyparConstraint ridx (cenv: cenv) newOk checkConstraints occ (env: TcEnv) tpenv c = let g = cenv.g match c with @@ -4386,7 +4059,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) /// Check a value specification, e.g. in a signature, interface declaration or a constraint -and TcValSpec cenv env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv synValSig attrs = +and TcValSpec (cenv: cenv) env declKind newOk containerInfo memFlagsOpt thisTyOpt tpenv synValSig attrs = let g = cenv.g let (SynValSig(ident=SynIdent(id,_); explicitTypeParams=ValTyparDecls (synTypars, synTyparConstraints, _); synType=ty; arity=valSynInfo; range=m)) = synValSig let declaredTypars = TcTyparDecls cenv env synTypars @@ -4584,10 +4257,10 @@ and TcTypeOrMeasureParameter kindOpt cenv (env: TcEnv) newOk tpenv (SynTypar(id, tpR, AddUnscopedTypar key tpR tpenv -and TcTypar cenv env newOk tpenv tp : Typar * UnscopedTyparEnv = +and TcTypar (cenv: cenv) env newOk tpenv tp : Typar * UnscopedTyparEnv = TcTypeOrMeasureParameter (Some TyparKind.Type) cenv env newOk tpenv tp -and TcTyparDecl cenv env synTyparDecl = +and TcTyparDecl (cenv: cenv) env synTyparDecl = let g = cenv.g let (SynTyparDecl(Attributes synAttrs, synTypar)) = synTyparDecl let (SynTypar(id, _, _)) = synTypar @@ -4611,7 +4284,7 @@ and TcTyparDecl cenv env synTyparDecl = tp -and TcTyparDecls cenv env synTypars = +and TcTyparDecls (cenv: cenv) env synTypars = List.map (TcTyparDecl cenv env) synTypars /// Check and elaborate a syntactic type or unit-of-measure @@ -4619,7 +4292,7 @@ and TcTyparDecls cenv env synTypars = /// If kindOpt=Some kind, then this is the kind we're expecting (we're doing kind checking) /// If kindOpt=None, we need to determine the kind (we're doing kind inference) /// -and TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ (iwsam: WarnOnIWSAM) env (tpenv: UnscopedTyparEnv) synTy = +and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: WarnOnIWSAM) env (tpenv: UnscopedTyparEnv) synTy = let g = cenv.g match synTy with @@ -4693,7 +4366,7 @@ and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref = if meths |> List.exists (fun meth -> not meth.IsInstance && meth.IsDispatchSlot) then warning(Error(FSComp.SR.tcUsingInterfaceWithStaticAbstractMethodAsType(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) -and TcLongIdentType kindOpt cenv newOk checkConstraints occ iwsam env tpenv synLongId = +and TcLongIdentType kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env tpenv synLongId = let (SynLongIdent(tc, _, _)) = synLongId let m = synLongId.Range let ad = env.eAccessRights @@ -4716,7 +4389,7 @@ and TcLongIdentType kindOpt cenv newOk checkConstraints occ iwsam env tpenv synL /// Some.Long.TypeName /// ty1 SomeLongTypeName -and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ iwsam env tpenv longId postfix args m = +and TcLongIdentAppType kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env tpenv longId postfix args m = let (SynLongIdent(tc, _, _)) = longId let ad = env.eAccessRights @@ -4751,7 +4424,7 @@ and TcLongIdentAppType kindOpt cenv newOk checkConstraints occ iwsam env tpenv l errorR(Error(FSComp.SR.tcUnitsOfMeasureInvalidInTypeConstructor(), m)) NewErrorType (), tpenv -and TcNestedAppType cenv newOk checkConstraints occ iwsam env tpenv synLeftTy synLongId args m = +and TcNestedAppType (cenv: cenv) newOk checkConstraints occ iwsam env tpenv synLeftTy synLongId args m = let g = cenv.g let ad = env.eAccessRights let (SynLongIdent(longId, _, _)) = synLongId @@ -4763,7 +4436,7 @@ and TcNestedAppType cenv newOk checkConstraints occ iwsam env tpenv synLeftTy sy | _ -> error(Error(FSComp.SR.tcTypeHasNoNestedTypes(), m)) -and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct (args: SynTupleTypeSegment list) m = +and TcTupleType kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv isStruct (args: SynTupleTypeSegment list) m = let tupInfo = mkTupInfo isStruct if isStruct then let argsR,tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m @@ -4782,7 +4455,7 @@ and TcTupleType kindOpt cenv newOk checkConstraints occ env tpenv isStruct (args let argsR,tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv args m TType_tuple(tupInfo, argsR), tpenv -and TcAnonRecdType cenv newOk checkConstraints occ env tpenv isStruct args m = +and TcAnonRecdType (cenv: cenv) newOk checkConstraints occ env tpenv isStruct args m = let tupInfo = mkTupInfo isStruct let tup = args |> List.map (fun (_, t) -> SynTupleTypeSegment.Type t) let argsR,tpenv = TcTypesAsTuple cenv newOk checkConstraints occ env tpenv tup m @@ -4804,39 +4477,39 @@ and TcAnonRecdType cenv newOk checkConstraints occ env tpenv isStruct args m = TType_anon(anonInfo, sortedCheckedArgTys),tpenv -and TcFunctionType cenv newOk checkConstraints occ env tpenv domainTy resultTy = +and TcFunctionType (cenv: cenv) newOk checkConstraints occ env tpenv domainTy resultTy = let g = cenv.g let domainTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv domainTy let resultTyR, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv resultTy let tyR = mkFunTy g domainTyR resultTyR tyR, tpenv -and TcElementType cenv newOk checkConstraints occ env tpenv rank elemTy m = +and TcElementType (cenv: cenv) newOk checkConstraints occ env tpenv rank elemTy m = let g = cenv.g let elemTy, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv elemTy let tyR = mkArrayTy g rank elemTy m tyR, tpenv -and TcTypeParameter kindOpt cenv env newOk tpenv tp = +and TcTypeParameter kindOpt (cenv: cenv) env newOk tpenv tp = let tpR, tpenv = TcTypeOrMeasureParameter kindOpt cenv env newOk tpenv tp match tpR.Kind with | TyparKind.Measure -> TType_measure (Measure.Var tpR), tpenv | TyparKind.Type -> mkTyparTy tpR, tpenv // _ types -and TcAnonType kindOpt cenv newOk tpenv m = +and TcAnonType kindOpt (cenv: cenv) newOk tpenv m = let tp: Typar = TcAnonTypeOrMeasure kindOpt cenv TyparRigidity.Anon TyparDynamicReq.No newOk m match tp.Kind with | TyparKind.Measure -> TType_measure (Measure.Var tp), tpenv | TyparKind.Type -> mkTyparTy tp, tpenv -and TcTypeWithConstraints cenv env newOk checkConstraints occ tpenv synTy synConstraints = +and TcTypeWithConstraints (cenv: cenv) env newOk checkConstraints occ tpenv synTy synConstraints = let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv synTy let tpenv = TcTyparConstraints cenv newOk checkConstraints occ env tpenv synConstraints ty, tpenv // #typ -and TcTypeHashConstraint cenv env newOk checkConstraints occ tpenv synTy m = +and TcTypeHashConstraint (cenv: cenv) env newOk checkConstraints occ tpenv synTy m = let tp = TcAnonTypeOrMeasure (Some TyparKind.Type) cenv TyparRigidity.WarnIfNotRigid TyparDynamicReq.Yes newOk m let ty, tpenv = TcTypeAndRecover cenv newOk checkConstraints occ WarnOnIWSAM.No env tpenv synTy AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace ty (mkTyparTy tp) @@ -4853,7 +4526,7 @@ and TcTypeStaticConstant kindOpt tpenv c m = errorR(Error(FSComp.SR.parsInvalidLiteralInType(), m)) NewErrorType (), tpenv -and TcTypeMeasurePower kindOpt cenv newOk checkConstraints occ env tpenv ty exponent m = +and TcTypeMeasurePower kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv ty exponent m = match kindOpt with | Some TyparKind.Type -> errorR(Error(FSComp.SR.tcUnexpectedSymbolInTypeExpression("^"), m)) @@ -4862,7 +4535,7 @@ and TcTypeMeasurePower kindOpt cenv newOk checkConstraints occ env tpenv ty expo let ms, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m TType_measure (Measure.RationalPower (ms, TcSynRationalConst exponent)), tpenv -and TcTypeMeasureDivide kindOpt cenv newOk checkConstraints occ env tpenv typ1 typ2 m = +and TcTypeMeasureDivide kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv typ1 typ2 m = match kindOpt with | Some TyparKind.Type -> errorR(Error(FSComp.SR.tcUnexpectedSymbolInTypeExpression("/"), m)) @@ -4872,7 +4545,7 @@ and TcTypeMeasureDivide kindOpt cenv newOk checkConstraints occ env tpenv typ1 t let ms2, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv typ2 m TType_measure (Measure.Prod(ms1, Measure.Inv ms2)), tpenv -and TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m = +and TcTypeMeasureApp kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv arg1 args postfix m = match arg1 with | StripParenTypes (SynType.Var(_, m1) | SynType.MeasurePower(_, _, m1)) -> match kindOpt, args, postfix with @@ -4888,10 +4561,10 @@ and TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args errorR(Error(FSComp.SR.tcIllegalSyntaxInTypeExpression(), m)) NewErrorType (), tpenv -and TcType cenv newOk checkConstraints occ iwsam env (tpenv: UnscopedTyparEnv) ty = +and TcType (cenv: cenv) newOk checkConstraints occ iwsam env (tpenv: UnscopedTyparEnv) ty = TcTypeOrMeasure (Some TyparKind.Type) cenv newOk checkConstraints occ iwsam env tpenv ty -and TcMeasure cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (StripParenTypes ty) m = +and TcMeasure (cenv: cenv) newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (StripParenTypes ty) m = match ty with | SynType.Anon m -> error(Error(FSComp.SR.tcAnonymousUnitsOfMeasureCannotBeNested(), m)) @@ -4919,10 +4592,10 @@ and TcAnonTypeOrMeasure kindOpt _cenv rigid dyn newOk m = NewAnonTypar (kind, m, rigid, TyparStaticReq.None, dyn) -and TcTypes cenv newOk checkConstraints occ iwsam env tpenv args = +and TcTypes (cenv: cenv) newOk checkConstraints occ iwsam env tpenv args = List.mapFold (TcTypeAndRecover cenv newOk checkConstraints occ iwsam env) tpenv args -and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv (args: SynTupleTypeSegment list) m = +and TcTypesAsTuple (cenv: cenv) newOk checkConstraints occ env tpenv (args: SynTupleTypeSegment list) m = let hasASlash = args |> List.exists(function | SynTupleTypeSegment.Slash _ -> true | _ -> false) @@ -4940,7 +4613,7 @@ and TcTypesAsTuple cenv newOk checkConstraints occ env tpenv (args: SynTupleType ty :: tys, tpenv // Type-check a list of measures separated by juxtaposition, * or / -and TcMeasuresAsTuple cenv newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (args: SynTupleTypeSegment list) m = +and TcMeasuresAsTuple (cenv: cenv) newOk checkConstraints occ env (tpenv: UnscopedTyparEnv) (args: SynTupleTypeSegment list) m = let rec gather (args: SynTupleTypeSegment list) tpenv acc = match args with | [] -> acc, tpenv @@ -4956,7 +4629,7 @@ and TcMeasuresAsTuple cenv newOk checkConstraints occ env (tpenv: UnscopedTyparE | _ -> failwith "inpossible" gather args tpenv Measure.One -and TcTypesOrMeasures optKinds cenv newOk checkConstraints occ env tpenv args m = +and TcTypesOrMeasures optKinds (cenv: cenv) newOk checkConstraints occ env tpenv args m = match optKinds with | None -> List.mapFold (TcTypeOrMeasure None cenv newOk checkConstraints occ WarnOnIWSAM.Yes env) tpenv args @@ -4966,14 +4639,14 @@ and TcTypesOrMeasures optKinds cenv newOk checkConstraints occ env tpenv args m elif isNil kinds then error(Error(FSComp.SR.tcUnexpectedTypeArguments(), m)) else error(Error(FSComp.SR.tcTypeParameterArityMismatch((List.length kinds), (List.length args)), m)) -and TcTyparConstraints cenv newOk checkConstraints occ env tpenv synConstraints = +and TcTyparConstraints (cenv: cenv) newOk checkConstraints occ env tpenv synConstraints = // Mark up default constraints with a priority in reverse order: last gets 0, second // last gets 1 etc. See comment on TyparConstraint.DefaultsTo let _, tpenv = List.fold (fun (ridx, tpenv) tc -> ridx - 1, TcTyparConstraint ridx cenv newOk checkConstraints occ env tpenv tc) (List.length synConstraints - 1, tpenv) synConstraints tpenv #if !NO_TYPEPROVIDERS -and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (StripParenTypes v) idOpt container = +and TcStaticConstantParameter (cenv: cenv) (env: TcEnv) tpenv kind (StripParenTypes v) idOpt container = let g = cenv.g let fail() = error(Error(FSComp.SR.etInvalidStaticArgument(NicePrint.minimalStringOfType env.DisplayEnv kind), v.Range)) let record ttype = @@ -5043,7 +4716,7 @@ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (StripParenTypes v) i | _ -> fail() -and CrackStaticConstantArgs cenv env tpenv (staticParameters: Tainted[], args: SynType list, container, containerName, m) = +and CrackStaticConstantArgs (cenv: cenv) env tpenv (staticParameters: Tainted[], args: SynType list, container, containerName, m) = let args = args |> List.map (function | StripParenTypes (SynType.StaticConstantNamed(StripParenTypes (SynType.LongIdent(SynLongIdent([id], _, _))), v, _)) -> Some id, v @@ -5095,7 +4768,7 @@ and CrackStaticConstantArgs cenv env tpenv (staticParameters: Tainted info.ProvidedType @@ -5115,7 +4788,7 @@ and TcProvidedTypeAppToStaticConstantArgs cenv env generatedTypePathOpt tpenv (t let hasNoArgs = (argsInStaticParameterOrderIncludingDefaults.Length = 0) hasNoArgs, providedTypeAfterStaticArguments, checkTypeName -and TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos: MethInfo list, argsOpt, mExprAndArg, mItem) = +and TryTcMethodAppToStaticConstantArgs (cenv: cenv) env tpenv (minfos: MethInfo list, argsOpt, mExprAndArg, mItem) = match minfos, argsOpt with | [minfo], Some (args, _) -> match minfo.ProvidedStaticParameterInfo with @@ -5126,7 +4799,7 @@ and TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos: MethInfo list, ar | _ -> None | _ -> None -and TcProvidedMethodAppToStaticConstantArgs cenv env tpenv (minfo, methBeforeArguments, staticParams, args, m) = +and TcProvidedMethodAppToStaticConstantArgs (cenv: cenv) env tpenv (minfo, methBeforeArguments, staticParams, args, m) = let argsInStaticParameterOrderIncludingDefaults = CrackStaticConstantArgs cenv env tpenv (staticParams, args, ArgumentContainer.Method minfo, minfo.DisplayName, m) @@ -5137,7 +4810,7 @@ and TcProvidedMethodAppToStaticConstantArgs cenv env tpenv (minfo, methBeforeArg providedMethAfterStaticArguments -and TcProvidedTypeApp cenv env tpenv tcref args m = +and TcProvidedTypeApp (cenv: cenv) env tpenv tcref args m = let hasNoArgs, providedTypeAfterStaticArguments, checkTypeName = TcProvidedTypeAppToStaticConstantArgs cenv env None tpenv tcref args m let isGenerated = providedTypeAfterStaticArguments.PUntaint((fun st -> not st.IsErased), m) @@ -5161,7 +4834,7 @@ and TcProvidedTypeApp cenv env tpenv tcref args m = /// Note that the generic type may be a nested generic type List.ListEnumerator. /// In this case, 'argsR is only the instantiation of the suffix type arguments, and pathTypeArgs gives /// the prefix of type arguments. -and TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref pathTypeArgs (synArgTys: SynType list) = +and TcTypeApp (cenv: cenv) newOk checkConstraints occ env tpenv m tcref pathTypeArgs (synArgTys: SynType list) = let g = cenv.g CheckTyconAccessible cenv.amap m env.AccessRights tcref |> ignore CheckEntityAttributes g tcref m |> CommitOperationResult @@ -5199,7 +4872,7 @@ and TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref pathTypeArgs (sy ty, tpenv -and TcTypeOrMeasureAndRecover kindOpt cenv newOk checkConstraints occ iwsam env tpenv ty = +and TcTypeOrMeasureAndRecover kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env tpenv ty = let g = cenv.g try TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv ty @@ -5215,10 +4888,10 @@ and TcTypeOrMeasureAndRecover kindOpt cenv newOk checkConstraints occ iwsam env recoveryTy, tpenv -and TcTypeAndRecover cenv newOk checkConstraints occ iwsam env tpenv ty = +and TcTypeAndRecover (cenv: cenv) newOk checkConstraints occ iwsam env tpenv ty = TcTypeOrMeasureAndRecover (Some TyparKind.Type) cenv newOk checkConstraints occ iwsam env tpenv ty -and TcNestedTypeApplication cenv newOk checkConstraints occ iwsam env tpenv mWholeTypeApp ty pathTypeArgs tyargs = +and TcNestedTypeApplication (cenv: cenv) newOk checkConstraints occ iwsam env tpenv mWholeTypeApp ty pathTypeArgs tyargs = let g = cenv.g let ty = convertToTypeWithMetadataIfPossible g ty @@ -5280,7 +4953,7 @@ and ConvSynPatToSynExpr synPat = error(Error(FSComp.SR.tcInvalidArgForParameterizedPattern(), synPat.Range)) /// Check a long identifier 'Case' or 'Case argsR' that has been resolved to an active pattern case -and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv ty (mLongId, item, apref, args, m) = +and TcPatLongIdentActivePatternCase warnOnUpper (cenv: cenv) (env: TcEnv) vFlags patEnv ty (mLongId, item, apref, args, m) = let g = cenv.g let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv @@ -5335,7 +5008,7 @@ and TcPatLongIdentActivePatternCase warnOnUpper cenv (env: TcEnv) vFlags patEnv let phase2 values = TPat_query((activePatExpr, activePatResTys, isStructRetTy, activePatIdentity, idx, apinfo), patArgPhase2 values, m) phase2, acc -and RecordNameAndTypeResolutions cenv env tpenv expr = +and RecordNameAndTypeResolutions (cenv: cenv) env tpenv expr = // This function is motivated by cases like // query { for ... join(for x in f(). } // where there is incomplete code in a query, and we are current just dropping a piece of the AST on the floor (above, the bit inside the 'join'). @@ -5347,7 +5020,7 @@ and RecordNameAndTypeResolutions cenv env tpenv expr = try ignore(TcExprOfUnknownType cenv env tpenv expr) with e -> ()) -and RecordNameAndTypeResolutionsDelayed cenv env tpenv delayed = +and RecordNameAndTypeResolutionsDelayed (cenv: cenv) env tpenv delayed = let rec dummyCheckedDelayed delayed = match delayed with @@ -5357,7 +5030,7 @@ and RecordNameAndTypeResolutionsDelayed cenv env tpenv delayed = | _ -> () dummyCheckedDelayed delayed -and TcExprOfUnknownType cenv env tpenv synExpr = +and TcExprOfUnknownType (cenv: cenv) env tpenv synExpr = let g = cenv.g let exprTy = NewInferenceType g let expr, tpenv = TcExpr cenv (MustEqual exprTy) env tpenv synExpr @@ -5365,7 +5038,7 @@ and TcExprOfUnknownType cenv env tpenv synExpr = // This is the old way of introducing flexibility via subtype constraints, still active // for compat reasons. -and TcExprFlex cenv flex compat (desiredTy: TType) (env: TcEnv) tpenv (synExpr: SynExpr) = +and TcExprFlex (cenv: cenv) flex compat (desiredTy: TType) (env: TcEnv) tpenv (synExpr: SynExpr) = let g = cenv.g if flex then @@ -5381,10 +5054,10 @@ and TcExprFlex cenv flex compat (desiredTy: TType) (env: TcEnv) tpenv (synExpr: else TcExprFlex2 cenv desiredTy env false tpenv synExpr -and TcExprFlex2 cenv desiredTy env isMethodArg tpenv synExpr = +and TcExprFlex2 (cenv: cenv) desiredTy env isMethodArg tpenv synExpr = TcExpr cenv (MustConvertTo (isMethodArg, desiredTy)) env tpenv synExpr -and TcExpr cenv ty (env: TcEnv) tpenv (synExpr: SynExpr) = +and TcExpr (cenv: cenv) ty (env: TcEnv) tpenv (synExpr: SynExpr) = let g = cenv.g @@ -5404,7 +5077,7 @@ and TcExpr cenv ty (env: TcEnv) tpenv (synExpr: SynExpr) = SolveTypeAsError env.DisplayEnv cenv.css m ty.Commit mkThrow m ty.Commit (mkOne g m), tpenv -and TcExprNoRecover cenv (ty: OverallTy) (env: TcEnv) tpenv (synExpr: SynExpr) = +and TcExprNoRecover (cenv: cenv) (ty: OverallTy) (env: TcEnv) tpenv (synExpr: SynExpr) = // Count our way through the expression shape that makes up an object constructor // See notes at definition of "ctor" re. object model constructors. @@ -5417,7 +5090,7 @@ and TcExprNoRecover cenv (ty: OverallTy) (env: TcEnv) tpenv (synExpr: SynExpr) = // This recursive entry is only used from one callsite (DiscardAfterMissingQualificationAfterDot) // and has been added relatively late in F# 4.0 to preserve the structure of previous code. It pushes a 'delayed' parameter // through TcExprOfUnknownType, TcExpr and TcExprNoRecover -and TcExprOfUnknownTypeThen cenv env tpenv synExpr delayed = +and TcExprOfUnknownTypeThen (cenv: cenv) env tpenv synExpr delayed = let g = cenv.g let exprTy = NewInferenceType g @@ -5434,30 +5107,30 @@ and TcExprOfUnknownTypeThen cenv env tpenv synExpr delayed = expr, exprTy, tpenv /// This is used to typecheck legitimate 'main body of constructor' expressions -and TcExprThatIsCtorBody safeInitInfo cenv overallTy env tpenv synExpr = +and TcExprThatIsCtorBody safeInitInfo (cenv: cenv) overallTy env tpenv synExpr = let g = cenv.g - let env = {env with eCtorInfo = Some (InitialExplicitCtorInfo safeInitInfo) } + let env = {env with eCtorInfo = Some (CtorInfo.InitialExplicit safeInitInfo) } let expr, tpenv = TcExpr cenv overallTy env tpenv synExpr let expr = CheckAndRewriteObjectCtor g env expr expr, tpenv /// This is used to typecheck all ordinary expressions including constituent /// parts of ctor. -and TcExprThatCanBeCtorBody cenv overallTy env tpenv synExpr = +and TcExprThatCanBeCtorBody (cenv: cenv) overallTy env tpenv synExpr = let env = if AreWithinCtorShape env then AdjustCtorShapeCounter (fun x -> x + 1) env else env TcExpr cenv overallTy env tpenv synExpr /// This is used to typecheck legitimate 'non-main body of object constructor' expressions -and TcExprThatCantBeCtorBody cenv overallTy env tpenv synExpr = +and TcExprThatCantBeCtorBody (cenv: cenv) overallTy env tpenv synExpr = let env = if AreWithinCtorShape env then ExitCtorShapeRegion env else env TcExpr cenv overallTy env tpenv synExpr /// This is used to typecheck legitimate 'non-main body of object constructor' expressions -and TcStmtThatCantBeCtorBody cenv env tpenv synExpr = +and TcStmtThatCantBeCtorBody (cenv: cenv) env tpenv synExpr = let env = if AreWithinCtorShape env then ExitCtorShapeRegion env else env TcStmt cenv env tpenv synExpr -and TcStmt cenv env tpenv synExpr = +and TcStmt (cenv: cenv) env tpenv synExpr = let g = cenv.g let expr, ty, tpenv = TcExprOfUnknownType cenv env tpenv synExpr let m = synExpr.Range @@ -5467,13 +5140,13 @@ and TcStmt cenv env tpenv synExpr = else mkCompGenSequential m expr (mkUnit g m), tpenv -and TryTcStmt cenv env tpenv synExpr = +and TryTcStmt (cenv: cenv) env tpenv synExpr = let expr, ty, tpenv = TcExprOfUnknownType cenv env tpenv synExpr let m = synExpr.Range let hasTypeUnit = TryUnifyUnitTypeWithoutWarning cenv env m ty hasTypeUnit, expr, tpenv -and CheckForAdjacentListExpression cenv synExpr hpa isInfix delayed (arg: SynExpr) = +and CheckForAdjacentListExpression (cenv: cenv) synExpr hpa isInfix delayed (arg: SynExpr) = let g = cenv.g // func (arg)[arg2] gives warning that .[ must be used. match delayed with @@ -5505,7 +5178,7 @@ and CheckForAdjacentListExpression cenv synExpr hpa isInfix delayed (arg: SynExp /// During checking of expressions of the form (x(y)).z(w1, w2) /// keep a stack of things on the right. This lets us recognize /// method applications and other item-based syntax. -and TcExprThen cenv overallTy env tpenv isArg synExpr delayed = +and TcExprThen (cenv: cenv) overallTy env tpenv isArg synExpr delayed = let g = cenv.g match synExpr with @@ -5589,24 +5262,24 @@ and TcExprThen cenv overallTy env tpenv isArg synExpr delayed = let expr, exprTy, tpenv = TcExprUndelayedNoType cenv env tpenv synExpr PropagateThenTcDelayed cenv overallTy env tpenv synExpr.Range (MakeApplicableExprNoFlex cenv expr) exprTy ExprAtomicFlag.NonAtomic delayed -and TcExprThenSetDynamic cenv overallTy env tpenv isArg e1 e2 rhsExpr m delayed = +and TcExprThenSetDynamic (cenv: cenv) overallTy env tpenv isArg e1 e2 rhsExpr m delayed = let e2 = mkDynamicArgExpr e2 let appExpr = mkSynQMarkSet m e1 e2 rhsExpr TcExprThen cenv overallTy env tpenv isArg appExpr delayed -and TcExprThenDynamic cenv overallTy env tpenv isArg e1 mQmark e2 delayed = +and TcExprThenDynamic (cenv: cenv) overallTy env tpenv isArg e1 mQmark e2 delayed = let appExpr = let argExpr = mkDynamicArgExpr e2 mkSynInfix mQmark e1 "?" argExpr TcExprThen cenv overallTy env tpenv isArg appExpr delayed -and TcExprsWithFlexes cenv env m tpenv flexes argTys args = +and TcExprsWithFlexes (cenv: cenv) env m tpenv flexes argTys args = if List.length args <> List.length argTys then error(Error(FSComp.SR.tcExpressionCountMisMatch((List.length argTys), (List.length args)), m)) (tpenv, List.zip3 flexes argTys args) ||> List.mapFold (fun tpenv (flex, ty, e) -> TcExprFlex cenv flex false ty env tpenv e) -and CheckSuperInit cenv objTy m = +and CheckSuperInit (cenv: cenv) objTy m = let g = cenv.g // Check the type is not abstract @@ -5615,7 +5288,7 @@ and CheckSuperInit cenv objTy m = errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(), m)) | _ -> () -and TcExprUndelayedNoType cenv env tpenv synExpr = +and TcExprUndelayedNoType (cenv: cenv) env tpenv synExpr = let g = cenv.g let overallTy = NewInferenceType g let expr, tpenv = TcExprUndelayed cenv (MustEqual overallTy) env tpenv synExpr @@ -5641,7 +5314,7 @@ and TcExprUndelayedNoType cenv env tpenv synExpr = /// /// - string literal expressions (though the propagation is not essential in this case) /// -and TcPropagatingExprLeafThenConvert cenv overallTy actualTy (env: TcEnv) (* canAdhoc *) m (f: unit -> Expr * UnscopedTyparEnv) = +and TcPropagatingExprLeafThenConvert (cenv: cenv) overallTy actualTy (env: TcEnv) (* canAdhoc *) m (f: unit -> Expr * UnscopedTyparEnv) = let g = cenv.g match overallTy with @@ -5673,7 +5346,7 @@ and TcPropagatingExprLeafThenConvert cenv overallTy actualTy (env: TcEnv) (* can /// - tuple (except if overallTy is a tuple type or a variable type that can become one) /// - anon record (except if overallTy is an anon record type or a variable type that can become one) /// - record (except if overallTy is requiresCtor || haveCtor or a record type or a variable type that can become one)) -and TcPossiblyPropogatingExprLeafThenConvert isPropagating cenv (overallTy: OverallTy) (env: TcEnv) m processExpr = +and TcPossiblyPropogatingExprLeafThenConvert isPropagating (cenv: cenv) (overallTy: OverallTy) (env: TcEnv) m processExpr = let g = cenv.g @@ -5697,7 +5370,7 @@ and TcPossiblyPropogatingExprLeafThenConvert isPropagating cenv (overallTy: Over /// - trait call /// - LibraryOnlyUnionCaseFieldGet /// - constants -and TcNonPropagatingExprLeafThenConvert cenv (overallTy: OverallTy) (env: TcEnv) m processExpr = +and TcNonPropagatingExprLeafThenConvert (cenv: cenv) (overallTy: OverallTy) (env: TcEnv) m processExpr = // Process the construct let expr, exprTy, tpenv = processExpr () @@ -5708,7 +5381,7 @@ and TcNonPropagatingExprLeafThenConvert cenv (overallTy: OverallTy) (env: TcEnv) let expr2 = TcAdjustExprForTypeDirectedConversions cenv overallTy exprTy env m expr expr2, tpenv -and TcAdjustExprForTypeDirectedConversions cenv (overallTy: OverallTy) actualTy (env: TcEnv) (* canAdhoc *) m expr = +and TcAdjustExprForTypeDirectedConversions (cenv: cenv) (overallTy: OverallTy) actualTy (env: TcEnv) (* canAdhoc *) m expr = let g = cenv.g match overallTy with @@ -5747,7 +5420,7 @@ and TcNonControlFlowExpr (env: TcEnv) f = else f env -and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = +and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = let g = cenv.g @@ -6022,7 +5695,7 @@ and TcExprUndelayed cenv (overallTy: OverallTy) env tpenv (synExpr: SynExpr) = | SynExpr.IndexRange (range=m) -> error(Error(FSComp.SR.tcInvalidIndexerExpression(), m)) -and TcExprMatch cenv overallTy env tpenv synInputExpr spMatch synClauses = +and TcExprMatch (cenv: cenv) overallTy env tpenv synInputExpr spMatch synClauses = let inputExpr, inputTy, tpenv = let env = { env with eIsControlFlow = false } TcExprOfUnknownType cenv env tpenv synInputExpr @@ -6041,7 +5714,7 @@ and TcExprMatch cenv overallTy env tpenv synInputExpr spMatch synClauses = // <@ function x -> (x: int) @> // is // Lambda (_arg2, Let (x, _arg2, x)) -and TcExprMatchLambda cenv overallTy env tpenv (isExnMatch, mArg, clauses, spMatch, m) = +and TcExprMatchLambda (cenv: cenv) overallTy env tpenv (isExnMatch, mArg, clauses, spMatch, m) = let domainTy, resultTy = UnifyFunctionType None cenv env.DisplayEnv m overallTy.Commit let idv1, idve1 = mkCompGenLocal mArg (cenv.synArgNameGenerator.New()) domainTy let envinner = ExitFamilyRegion env @@ -6050,14 +5723,14 @@ and TcExprMatchLambda cenv overallTy env tpenv (isExnMatch, mArg, clauses, spMat let overallExpr = mkMultiLambda m [idv1] ((mkLet spMatch m idv2 idve1 matchExpr), resultTy) overallExpr, tpenv -and TcExprTypeAnnotated cenv overallTy env tpenv (synBodyExpr, synType, m) = +and TcExprTypeAnnotated (cenv: cenv) overallTy env tpenv (synBodyExpr, synType, m) = let tgtTy, tpenv = TcTypeAndRecover cenv NewTyparsOK CheckCxs ItemOccurence.UseInType WarnOnIWSAM.Yes env tpenv synType UnifyOverallType cenv env m overallTy tgtTy let bodyExpr, tpenv = TcExpr cenv (MustConvertTo (false, tgtTy)) env tpenv synBodyExpr let bodyExpr2 = TcAdjustExprForTypeDirectedConversions cenv overallTy tgtTy env m bodyExpr bodyExpr2, tpenv -and TcExprTypeTest cenv overallTy env tpenv (synInnerExpr, tgtTy, m) = +and TcExprTypeTest (cenv: cenv) overallTy env tpenv (synInnerExpr, tgtTy, m) = let g = cenv.g let innerExpr, srcTy, tpenv = TcExprOfUnknownType cenv env tpenv synInnerExpr UnifyTypes cenv env m overallTy.Commit g.bool_ty @@ -6066,7 +5739,7 @@ and TcExprTypeTest cenv overallTy env tpenv (synInnerExpr, tgtTy, m) = let expr = mkCallTypeTest g m tgtTy innerExpr expr, tpenv -and TcExprUpcast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = +and TcExprUpcast (cenv: cenv) overallTy env tpenv (synExpr, synInnerExpr, m) = let innerExpr, srcTy, tpenv = TcExprOfUnknownType cenv env tpenv synInnerExpr let tgtTy, tpenv = match synExpr with @@ -6081,7 +5754,7 @@ and TcExprUpcast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = let expr = mkCoerceExpr(innerExpr, tgtTy, m, srcTy) expr, tpenv -and TcExprDowncast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = +and TcExprDowncast (cenv: cenv) overallTy env tpenv (synExpr, synInnerExpr, m) = let g = cenv.g let innerExpr, srcTy, tpenv = TcExprOfUnknownType cenv env tpenv synInnerExpr @@ -6102,7 +5775,7 @@ and TcExprDowncast cenv overallTy env tpenv (synExpr, synInnerExpr, m) = let expr = mkCallUnbox g m tgtTy innerExpr expr, tpenv -and TcExprLazy cenv overallTy env tpenv (synInnerExpr, m) = +and TcExprLazy (cenv: cenv) overallTy env tpenv (synInnerExpr, m) = let g = cenv.g let innerTy = NewInferenceType g UnifyTypes cenv env m overallTy.Commit (mkLazyTy g innerTy) @@ -6112,7 +5785,7 @@ and TcExprLazy cenv overallTy env tpenv (synInnerExpr, m) = let expr = mkLazyDelayed g m innerTy (mkUnitDelayLambda g m innerExpr) expr, tpenv -and TcExprTuple cenv overallTy env tpenv (isExplicitStruct, args, m) = +and TcExprTuple (cenv: cenv) overallTy env tpenv (isExplicitStruct, args, m) = let g = cenv.g TcPossiblyPropogatingExprLeafThenConvert (fun ty -> isAnyTupleTy g ty || isTyparTy g ty) cenv overallTy env m (fun overallTy -> let tupInfo, argTys = UnifyTupleTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv m overallTy isExplicitStruct args @@ -6123,7 +5796,7 @@ and TcExprTuple cenv overallTy env tpenv (isExplicitStruct, args, m) = expr, tpenv ) -and TcExprArrayOrList cenv overallTy env tpenv (isArray, args, m) = +and TcExprArrayOrList (cenv: cenv) overallTy env tpenv (isArray, args, m) = let g = cenv.g CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy.Commit, env.AccessRights) @@ -6156,7 +5829,7 @@ and TcExprArrayOrList cenv overallTy env tpenv (isArray, args, m) = ) // Note could be combined with TcObjectExpr -and TcExprObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, mNewExpr, m) = +and TcExprObjectExpr (cenv: cenv) overallTy env tpenv (synObjTy, argopt, binds, extraImpls, mNewExpr, m) = let g = cenv.g CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy.Commit, env.eAccessRights) @@ -6190,7 +5863,7 @@ and TcExprObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImp TcObjectExpr cenv env tpenv (objTy, realObjTy, argopt, binds, extraImpls, mObjTy, mNewExpr, m) ) -and TcExprRecord cenv overallTy env tpenv (inherits, withExprOpt, synRecdFields, mWholeExpr) = +and TcExprRecord (cenv: cenv) overallTy env tpenv (inherits, withExprOpt, synRecdFields, mWholeExpr) = let g = cenv.g CallExprHasTypeSink cenv.tcSink (mWholeExpr, env.NameEnv, overallTy.Commit, env.AccessRights) let requiresCtor = (GetCtorShapeCounter env = 1) // Get special expression forms for constructors @@ -6199,7 +5872,7 @@ and TcExprRecord cenv overallTy env tpenv (inherits, withExprOpt, synRecdFields, TcRecdExpr cenv overallTy env tpenv (inherits, withExprOpt, synRecdFields, mWholeExpr) ) -and TcExprWhileLoop cenv overallTy env tpenv (spWhile, synGuardExpr, synBodyExpr, m) = +and TcExprWhileLoop (cenv: cenv) overallTy env tpenv (spWhile, synGuardExpr, synBodyExpr, m) = let g = cenv.g UnifyTypes cenv env m overallTy.Commit g.unit_ty @@ -6213,7 +5886,7 @@ and TcExprWhileLoop cenv overallTy env tpenv (spWhile, synGuardExpr, synBodyExpr mkWhile g (spWhile, NoSpecialWhileLoopMarker, guardExpr, bodyExpr, m), tpenv -and TcExprIntegerForLoop cenv overallTy env tpenv (spFor, spTo, id, start, dir, finish, body, m) = +and TcExprIntegerForLoop (cenv: cenv) overallTy env tpenv (spFor, spTo, id, start, dir, finish, body, m) = let g = cenv.g UnifyTypes cenv env m overallTy.Commit g.unit_ty @@ -6236,7 +5909,7 @@ and TcExprIntegerForLoop cenv overallTy env tpenv (spFor, spTo, id, start, dir, let bodyExpr, tpenv = TcStmt cenv envinner tpenv body mkFastForLoop g (spFor, spTo, m, idv, startExpr, dir, finishExpr, bodyExpr), tpenv -and TcExprTryWith cenv overallTy env tpenv (synBodyExpr, synWithClauses, mWithToLast, mTryToLast, spTry, spWith) = +and TcExprTryWith (cenv: cenv) overallTy env tpenv (synBodyExpr, synWithClauses, mWithToLast, mTryToLast, spTry, spWith) = let g = cenv.g let env = { env with eIsControlFlow = true } @@ -6255,20 +5928,20 @@ and TcExprTryWith cenv overallTy env tpenv (synBodyExpr, synWithClauses, mWithTo let v2, handlerExpr = CompilePatternForMatchClauses cenv env mWithToLast mWithToLast true Rethrow None g.exn_ty overallTy.Commit checkedHandlerClauses mkTryWith g (bodyExpr, v1, filterExpr, v2, handlerExpr, mTryToLast, overallTy.Commit, spTry, spWith), tpenv -and TcExprTryFinally cenv overallTy env tpenv (synBodyExpr, synFinallyExpr, mTryToLast, spTry, spFinally) = +and TcExprTryFinally (cenv: cenv) overallTy env tpenv (synBodyExpr, synFinallyExpr, mTryToLast, spTry, spFinally) = let g = cenv.g let env = { env with eIsControlFlow = true } let bodyExpr, tpenv = TcExpr cenv overallTy env tpenv synBodyExpr let finallyExpr, tpenv = TcStmt cenv env tpenv synFinallyExpr mkTryFinally g (bodyExpr, finallyExpr, mTryToLast, overallTy.Commit, spTry, spFinally), tpenv -and TcExprJoinIn cenv overallTy env tpenv (synExpr1, mInToken, synExpr2, mAll) = +and TcExprJoinIn (cenv: cenv) overallTy env tpenv (synExpr1, mInToken, synExpr2, mAll) = errorR(Error(FSComp.SR.parsUnfinishedExpression("in"), mInToken)) let _, _, tpenv = suppressErrorReporting (fun () -> TcExprOfUnknownType cenv env tpenv synExpr1) let _, _, tpenv = suppressErrorReporting (fun () -> TcExprOfUnknownType cenv env tpenv synExpr2) mkDefault(mAll, overallTy.Commit), tpenv -and TcExprSequential cenv overallTy env tpenv (synExpr, _sp, dir, synExpr1, synExpr2, m) = +and TcExprSequential (cenv: cenv) overallTy env tpenv (synExpr, _sp, dir, synExpr1, synExpr2, m) = if dir then TcLinearExprs (TcExprThatCanBeCtorBody cenv) cenv env overallTy tpenv false synExpr (fun x -> x) else @@ -6280,7 +5953,7 @@ and TcExprSequential cenv overallTy env tpenv (synExpr, _sp, dir, synExpr1, synE let expr2, tpenv = TcStmtThatCantBeCtorBody cenv env tpenv synExpr2 Expr.Sequential (expr1, expr2, ThenDoSeq, m), tpenv -and TcExprSequentialOrImplicitYield cenv overallTy env tpenv (sp, synExpr1, synExpr2, otherExpr, m) = +and TcExprSequentialOrImplicitYield (cenv: cenv) overallTy env tpenv (sp, synExpr1, synExpr2, otherExpr, m) = let isStmt, expr1, tpenv = let env1 = { env with eIsControlFlow = (match sp with DebugPointAtSequential.SuppressNeither | DebugPointAtSequential.SuppressExpr -> true | _ -> false) } @@ -6297,7 +5970,7 @@ and TcExprSequentialOrImplicitYield cenv overallTy env tpenv (sp, synExpr1, synE // this will type-check the first expression over again. TcExpr cenv overallTy env tpenv otherExpr -and TcExprStaticOptimization cenv overallTy env tpenv (constraints, synExpr2, expr3, m) = +and TcExprStaticOptimization (cenv: cenv) overallTy env tpenv (constraints, synExpr2, expr3, m) = let constraintsR, tpenv = List.mapFold (TcStaticOptimizationConstraint cenv env) tpenv constraints // Do not force the types of the two expressions to be equal // This means uses of this construct have to be very carefully written @@ -6306,7 +5979,7 @@ and TcExprStaticOptimization cenv overallTy env tpenv (constraints, synExpr2, ex Expr.StaticOptimization (constraintsR, expr2, expr3, m), tpenv /// synExpr1.longId <- synExpr2 -and TcExprDotSet cenv overallTy env tpenv (synExpr1, synLongId, synExpr2, mStmt) = +and TcExprDotSet (cenv: cenv) overallTy env tpenv (synExpr1, synLongId, synExpr2, mStmt) = let (SynLongIdent(longId, _, _)) = synLongId if synLongId.ThereIsAnExtraDotAtTheEnd then @@ -6318,7 +5991,7 @@ and TcExprDotSet cenv overallTy env tpenv (synExpr1, synLongId, synExpr2, mStmt) TcExprThen cenv overallTy env tpenv false synExpr1 [DelayedDotLookup(longId, mExprAndDotLookup); MakeDelayedSet(synExpr2, mStmt)] /// synExpr1.longId(synExpr2) <- expr3, very rarely used named property setters -and TcExprDotNamedIndexedPropertySet cenv overallTy env tpenv (synExpr1, synLongId, synExpr2, expr3, mStmt) = +and TcExprDotNamedIndexedPropertySet (cenv: cenv) overallTy env tpenv (synExpr1, synLongId, synExpr2, expr3, mStmt) = let (SynLongIdent(longId, _, _)) = synLongId if synLongId.ThereIsAnExtraDotAtTheEnd then // just drop rhs on the floor @@ -6331,7 +6004,7 @@ and TcExprDotNamedIndexedPropertySet cenv overallTy env tpenv (synExpr1, synLong DelayedApp(ExprAtomicFlag.Atomic, false, None, synExpr2, mStmt) MakeDelayedSet(expr3, mStmt)] -and TcExprLongIdentSet cenv overallTy env tpenv (synLongId, synExpr2, m) = +and TcExprLongIdentSet (cenv: cenv) overallTy env tpenv (synLongId, synExpr2, m) = if synLongId.ThereIsAnExtraDotAtTheEnd then // just drop rhs on the floor TcLongIdentThen cenv overallTy env tpenv synLongId [ ] @@ -6339,7 +6012,7 @@ and TcExprLongIdentSet cenv overallTy env tpenv (synLongId, synExpr2, m) = TcLongIdentThen cenv overallTy env tpenv synLongId [ MakeDelayedSet(synExpr2, m) ] // Type.Items(synExpr1) <- synExpr2 -and TcExprNamedIndexPropertySet cenv overallTy env tpenv (synLongId, synExpr1, synExpr2, mStmt) = +and TcExprNamedIndexPropertySet (cenv: cenv) overallTy env tpenv (synLongId, synExpr1, synExpr2, mStmt) = if synLongId.ThereIsAnExtraDotAtTheEnd then // just drop rhs on the floor TcLongIdentThen cenv overallTy env tpenv synLongId [ ] @@ -6348,7 +6021,7 @@ and TcExprNamedIndexPropertySet cenv overallTy env tpenv (synLongId, synExpr1, s [ DelayedApp(ExprAtomicFlag.Atomic, false, None, synExpr1, mStmt) MakeDelayedSet(synExpr2, mStmt) ] -and TcExprTraitCall cenv overallTy env tpenv (synTypes, synMemberSig, arg, m) = +and TcExprTraitCall (cenv: cenv) overallTy env tpenv (synTypes, synMemberSig, arg, m) = let g = cenv.g TcNonPropagatingExprLeafThenConvert cenv overallTy env m (fun () -> let traitInfo, tpenv = TcPseudoMemberSpec cenv NewTyparsOK env synTypes tpenv synMemberSig m @@ -6366,7 +6039,7 @@ and TcExprTraitCall cenv overallTy env tpenv (synTypes, synMemberSig, arg, m) = Expr.Op (TOp.TraitCall traitInfo, [], argsR, m), returnTy, tpenv ) -and TcExprUnionCaseFieldGet cenv overallTy env tpenv (synExpr1, longId, fieldNum, m) = +and TcExprUnionCaseFieldGet (cenv: cenv) overallTy env tpenv (synExpr1, longId, fieldNum, m) = let g = cenv.g TcNonPropagatingExprLeafThenConvert cenv overallTy env m (fun () -> let expr1, ty1, tpenv = TcExprOfUnknownType cenv env tpenv synExpr1 @@ -6377,7 +6050,7 @@ and TcExprUnionCaseFieldGet cenv overallTy env tpenv (synExpr1, longId, fieldNum mkf fieldNum, ty2, tpenv ) -and TcExprUnionCaseFieldSet cenv overallTy env tpenv (synExpr1, longId, fieldNum, synExpr2, m) = +and TcExprUnionCaseFieldSet (cenv: cenv) overallTy env tpenv (synExpr1, longId, fieldNum, synExpr2, m) = let g = cenv.g UnifyTypes cenv env m overallTy.Commit g.unit_ty let expr1, ty1, tpenv = TcExprOfUnknownType cenv env tpenv synExpr1 @@ -6392,7 +6065,7 @@ and TcExprUnionCaseFieldSet cenv overallTy env tpenv (synExpr1, longId, fieldNum let expr2, tpenv = TcExpr cenv (MustEqual ty2) env tpenv synExpr2 mkf fieldNum expr2, tpenv -and TcExprILAssembly cenv overallTy env tpenv (ilInstrs, synTyArgs, synArgs, synRetTys, m) = +and TcExprILAssembly (cenv: cenv) overallTy env tpenv (ilInstrs, synTyArgs, synArgs, synRetTys, m) = let g = cenv.g let ilInstrs = (ilInstrs :?> ILInstr[]) let argTys = NewInferenceTypes g synArgs @@ -6431,7 +6104,7 @@ and RewriteRangeExpr synExpr = | _ -> None /// Check lambdas as a group, to catch duplicate names in patterns -and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = +and TcIteratedLambdas (cenv: cenv) isFirst (env: TcEnv) overallTy takenNames tpenv e = let g = cenv.g match e with | SynExpr.Lambda (isMember, isSubsequent, synSimplePats, bodyExpr, _, m, _) when isMember || isFirst || isSubsequent -> @@ -6472,7 +6145,7 @@ and TcIteratedLambdas cenv isFirst (env: TcEnv) overallTy takenNames tpenv e = conditionallySuppressErrorReporting (not isFirst && synExprContainsError e) (fun () -> TcExpr cenv overallTy env tpenv e) -and TcTyparExprThen cenv overallTy env tpenv synTypar m delayed = +and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = match delayed with //'T .Ident //^T .Ident (args) .. @@ -6505,7 +6178,7 @@ and (|IndexArgOptionalFromEnd|) (cenv: cenv) indexArg = (a, true, m) | _ -> (indexArg, false, indexArg.Range) -and DecodeIndexArg cenv indexArg = +and DecodeIndexArg (cenv: cenv) indexArg = match indexArg with | SynExpr.IndexRange (info1, _opm, info2, m1, m2, _) -> let info1 = @@ -6520,7 +6193,7 @@ and DecodeIndexArg cenv indexArg = | IndexArgOptionalFromEnd cenv (expr, isFromEnd, m) -> IndexArgItem(expr, isFromEnd, m) -and DecodeIndexArgs cenv indexArgs = +and DecodeIndexArgs (cenv: cenv) indexArgs = indexArgs |> List.map (DecodeIndexArg cenv) and (|IndexerArgs|) expr = @@ -6528,13 +6201,13 @@ and (|IndexerArgs|) expr = | SynExpr.Tuple (false, argExprs, _, _) -> argExprs | _ -> [expr] -and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv (setInfo: _ option) synLeftExpr indexArgs delayed = +and TcIndexerThen (cenv: cenv) env overallTy mWholeExpr mDot tpenv (setInfo: _ option) synLeftExpr indexArgs delayed = let leftExpr, leftExprTy, tpenv = TcExprOfUnknownType cenv env tpenv synLeftExpr let expandedIndexArgs = ExpandIndexArgs cenv (Some synLeftExpr) indexArgs TcIndexingThen cenv env overallTy mWholeExpr mDot tpenv setInfo (Some synLeftExpr) leftExpr leftExprTy expandedIndexArgs indexArgs delayed // Eliminate GetReverseIndex from index args -and ExpandIndexArgs cenv (synLeftExprOpt: SynExpr option) indexArgs = +and ExpandIndexArgs (cenv: cenv) (synLeftExprOpt: SynExpr option) indexArgs = // xs.GetReverseIndex rank offset - 1 let rewriteReverseExpr (rank: int) (offset: SynExpr) (range: range) = @@ -6818,7 +6491,7 @@ and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt ite error(Error(FSComp.SR.tcSyntaxCanOnlyBeUsedToCreateObjectTypes(if superInit then "inherit" else "new"), mWholeCall)) // Check a record construction expression -and TcRecordConstruction cenv (overallTy: TType) env tpenv withExprInfoOpt objTy fldsList m = +and TcRecordConstruction (cenv: cenv) (overallTy: TType) env tpenv withExprInfoOpt objTy fldsList m = let g = cenv.g let tcref, tinst = destAppTy g objTy @@ -6945,7 +6618,7 @@ and GetNameAndSynValInfoOfObjExprBinding _cenv _env b = lookPat pat -and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implTy: TType) virtNameAndArityPairs (bind, bindAttribs, bindName, absSlots:(_ * MethInfo) list) = +and FreshenObjExprAbstractSlot (cenv: cenv) (env: TcEnv) (implTy: TType) virtNameAndArityPairs (bind, bindAttribs, bindName, absSlots:(_ * MethInfo) list) = let g = cenv.g @@ -7004,7 +6677,7 @@ and FreshenObjExprAbstractSlot cenv (env: TcEnv) (implTy: TType) virtNameAndArit | _ -> None -and TcObjectExprBinding cenv (env: TcEnv) implTy tpenv (absSlotInfo, bind) = +and TcObjectExprBinding (cenv: cenv) (env: TcEnv) implTy tpenv (absSlotInfo, bind) = let g = cenv.g @@ -7070,7 +6743,7 @@ and TcObjectExprBinding cenv (env: TcEnv) implTy tpenv (absSlotInfo, bind) = | _ -> error(Error(FSComp.SR.tcSimpleMethodNameRequired(), m)) -and ComputeObjectExprOverrides cenv (env: TcEnv) tpenv impls = +and ComputeObjectExprOverrides (cenv: cenv) (env: TcEnv) tpenv impls = let g = cenv.g @@ -7137,7 +6810,7 @@ and ComputeObjectExprOverrides cenv (env: TcEnv) tpenv impls = overridesAndVirts, tpenv -and CheckSuperType cenv ty m = +and CheckSuperType (cenv: cenv) ty m = let g = cenv.g if typeEquiv g ty g.system_Value_ty || @@ -7150,7 +6823,7 @@ and CheckSuperType cenv ty m = if isErasedType g ty then errorR(Error(FSComp.SR.tcCannotInheritFromErasedType(), m)) -and TcObjectExpr cenv env tpenv (objTy, realObjTy, argopt, binds, extraImpls, mObjTy, mNewExpr, mWholeExpr) = +and TcObjectExpr (cenv: cenv) env tpenv (objTy, realObjTy, argopt, binds, extraImpls, mObjTy, mNewExpr, mWholeExpr) = let g = cenv.g @@ -8027,7 +7700,7 @@ and TcQuotationExpr cenv overallTy env tpenv (_oper, raw, ast, isFromQueryExpres /// /// We propagate information from the expected overall type 'overalltyR. The use /// of function application syntax unambiguously implies that 'overalltyR is a function type. -and Propagate cenv (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableExpr) exprTy delayed = +and Propagate (cenv: cenv) (overallTy: OverallTy) (env: TcEnv) tpenv (expr: ApplicableExpr) exprTy delayed = let g = cenv.g @@ -8192,7 +7865,7 @@ and delayRest rest mPrior delayed = DelayedDotLookup (rest, mPriorAndLongId) :: delayed /// Typecheck "nameof" expressions -and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = +and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = let g = cenv.g @@ -8307,7 +7980,7 @@ and TcNameOfExpr cenv env tpenv (synArg: SynExpr) = let lastIdent = check None None cleanSynArg [] TcNameOfExprResult cenv lastIdent m -and TcNameOfExprResult cenv (lastIdent: Ident) m = +and TcNameOfExprResult (cenv: cenv) (lastIdent: Ident) m = let g = cenv.g let constRange = mkRange m.FileName m.Start (mkPos m.StartLine (m.StartColumn + lastIdent.idText.Length + 2)) // `2` are for quotes Expr.Const(Const.String(lastIdent.idText), constRange, g.string_ty) @@ -8338,7 +8011,7 @@ and isAdjacentListExpr isSugar atomicFlag (synLeftExprOpt: SynExpr option) (synA // Check f[x] // Check seq { expr } // Check async { expr } -and TcApplicationThen cenv (overallTy: OverallTy) env tpenv mExprAndArg synLeftExprOpt leftExpr exprTy (synArg: SynExpr) atomicFlag isSugar delayed = +and TcApplicationThen (cenv: cenv) (overallTy: OverallTy) env tpenv mExprAndArg synLeftExprOpt leftExpr exprTy (synArg: SynExpr) atomicFlag isSugar delayed = let g = cenv.g let denv = env.DisplayEnv let mArg = synArg.Range @@ -8444,7 +8117,7 @@ and GetLongIdentTypeNameInfo delayed = | _ -> TypeNameResolutionInfo.Default -and TcLongIdentThen cenv (overallTy: OverallTy) env tpenv (SynLongIdent(longId, _, _)) delayed = +and TcLongIdentThen (cenv: cenv) (overallTy: OverallTy) env tpenv (SynLongIdent(longId, _, _)) delayed = let ad = env.eAccessRights let typeNameResInfo = GetLongIdentTypeNameInfo delayed @@ -8458,7 +8131,7 @@ and TcLongIdentThen cenv (overallTy: OverallTy) env tpenv (SynLongIdent(longId, //------------------------------------------------------------------------- *) // mItem is the textual range covered by the long identifiers that make up the item -and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = +and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = let delayed = delayRest rest mItem delayed match item with // x where x is a union case or active pattern result tag. @@ -8526,7 +8199,7 @@ and TcItemThen cenv (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mIte /// applications of active pattern result labels. // // NOTE: the code for this is all a bit convoluted and should really be simplified/regularized. -and TcUnionCaseOrExnCaseOrActivePatternResultItemThen cenv overallTy env item tpenv mItem delayed = +and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env item tpenv mItem delayed = let g = cenv.g let ad = env.eAccessRights // ucaseAppTy is the type of the union constructor applied to its (optional) argument @@ -8674,7 +8347,7 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen cenv overallTy env item tp let exprTy = tyOfExpr g expr PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprNoFlex cenv expr) exprTy ExprAtomicFlag.Atomic delayed -and TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed = +and TcTypeItemThen (cenv: cenv) overallTy env nm ty tpenv mItem tinstEnclosing delayed = let g = cenv.g let ad = env.eAccessRights match delayed with @@ -8706,7 +8379,7 @@ and TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed = // call to ResolveLongIdentAsExprAndComputeRange error(Error(FSComp.SR.tcInvalidUseOfTypeName(), mItem)) -and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed = +and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed = let ad = env.eAccessRights // Static method calls Type.Foo(arg1, ..., argn) let meths = List.map (fun minfo -> minfo, None) minfos @@ -8753,7 +8426,7 @@ and TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem after #endif TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed -and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = +and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = #if !NO_TYPEPROVIDERS let g = cenv.g let ad = env.eAccessRights @@ -8804,7 +8477,7 @@ and TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [] mItem delayed (Some afterResolution) -and TcTraitItemThen cenv overallTy env objOpt traitInfo tpenv mItem delayed = +and TcTraitItemThen (cenv: cenv) overallTy env objOpt traitInfo tpenv mItem delayed = let g = cenv.g let argTys = traitInfo.GetLogicalArgumentTypes(g) @@ -8866,7 +8539,7 @@ and TcTraitItemThen cenv overallTy env objOpt traitInfo tpenv mItem delayed = // Aply the wrapper to pre-evaluate the object if any wrapper resExpr, tpenv -and TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed = +and TcImplicitOpItemThen (cenv: cenv) overallTy env id sln tpenv mItem delayed = let g = cenv.g let isPrefix = IsLogicalPrefixOperator id.idText let isTernary = IsLogicalTernaryOperator id.idText @@ -9392,7 +9065,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItem)) // Instance IL event (fake up event-as-value) -and TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem objDetails (einfo: EventInfo) delayed = +and TcEventItemThen (cenv: cenv) overallTy env tpenv mItem mExprAndItem objDetails (einfo: EventInfo) delayed = let g = cenv.g let ad = env.eAccessRights @@ -9494,7 +9167,7 @@ and TcMethodApplicationThen PropagateThenTcDelayed cenv overallTy env tpenv mWholeExpr (MakeApplicableExprNoFlex cenv expr) exprTy atomicFlag delayed /// Infer initial type information at the callsite from the syntax of an argument, prior to overload resolution. -and GetNewInferenceTypeForMethodArg cenv env tpenv x = +and GetNewInferenceTypeForMethodArg (cenv: cenv) env tpenv x = let g = cenv.g @@ -9519,13 +9192,13 @@ and isSimpleFormalArg info = let (ParamAttribs(isParamArrayArg, _isInArg, isOutArg, optArgInfo, callerInfo, _reflArgInfo)) = info not isParamArrayArg && not isOutArg && not optArgInfo.IsOptional && callerInfo = NoCallerInfo -and GenerateMatchingSimpleArgumentTypes cenv (calledMeth: MethInfo) mItem = +and GenerateMatchingSimpleArgumentTypes (cenv: cenv) (calledMeth: MethInfo) mItem = let g = cenv.g let curriedMethodArgAttribs = calledMeth.GetParamAttribs(cenv.amap, mItem) curriedMethodArgAttribs |> List.map (List.filter isSimpleFormalArg >> NewInferenceTypes g) -and UnifyMatchingSimpleArgumentTypes cenv (env: TcEnv) exprTy (calledMeth: MethInfo) mMethExpr mItem = +and UnifyMatchingSimpleArgumentTypes (cenv: cenv) (env: TcEnv) exprTy (calledMeth: MethInfo) mMethExpr mItem = let g = cenv.g let denv = env.DisplayEnv let curriedArgTys = GenerateMatchingSimpleArgumentTypes cenv calledMeth mItem @@ -9541,7 +9214,7 @@ and UnifyMatchingSimpleArgumentTypes cenv (env: TcEnv) exprTy (calledMeth: MethI /// In one case (the second "single named item" rule) we delay the application of a /// argument until we've produced a lambda that detuples an input tuple and TcMethodApplication_SplitSynArguments - cenv + (cenv: cenv) (env: TcEnv) tpenv isProp @@ -9624,7 +9297,7 @@ and TcMethodApplication_SplitSynArguments // Extract what we know about the caller arguments, either type-directed if // no arguments are given or else based on the syntax of the arguments. and TcMethodApplication_UniqueOverloadInference - cenv + (cenv: cenv) (env: TcEnv) (exprTy: OverallTy) tyArgsOpt @@ -9713,7 +9386,7 @@ and TcMethodApplication_UniqueOverloadInference /// MethodApplication - STEP 2a. First extract what we know about the caller arguments, either type-directed if /// no arguments are given or else based on the syntax of the arguments. and TcMethodApplication_CheckArguments - cenv + (cenv: cenv) (env: TcEnv) (exprTy: OverallTy) curriedCallerArgsOpt @@ -9797,7 +9470,7 @@ and TcMethodApplication_CheckArguments // Adhoc constraints on use of .NET methods // - Uses of Object.GetHashCode and Object.Equals imply an equality constraint on the object argument // - Uses of a Dictionary() constructor without an IEqualityComparer argument imply an equality constraint on the first type argument. -and TcAdhocChecksOnLibraryMethods cenv (env: TcEnv) isInstance (finalCalledMeth: CalledMeth<_>) (finalCalledMethInfo: MethInfo) objArgs mMethExpr mItem = +and TcAdhocChecksOnLibraryMethods (cenv: cenv) (env: TcEnv) isInstance (finalCalledMeth: CalledMeth<_>) (finalCalledMethInfo: MethInfo) objArgs mMethExpr mItem = let g = cenv.g if (isInstance && @@ -9821,7 +9494,7 @@ and TcAdhocChecksOnLibraryMethods cenv (env: TcEnv) isInstance (finalCalledMeth: /// Method calls, property lookups, attribute constructions etc. get checked through here and TcMethodApplication isCheckingAttributeCall - cenv + (cenv: cenv) env tpenv tyArgsOpt @@ -10095,7 +9768,7 @@ and TcMethodApplication (callExpr6, finalAttributeAssignedNamedItems, delayed), tpenv /// For Method(X = expr) 'X' can be a property, IL Field or F# record field -and TcSetterArgExpr cenv env denv objExpr ad assignedSetter calledFromConstructor = +and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromConstructor = let g = cenv.g let (AssignedItemSetter(id, setter, callerArg)) = assignedSetter let (CallerArg(callerArgTy, m, isOptCallerArg, argExpr)) = callerArg @@ -10415,7 +10088,7 @@ and TcStaticOptimizationConstraint cenv env tpenv c = and mkConvToNativeInt (g: TcGlobals) e m = Expr.Op (TOp.ILAsm ([ AI_conv ILBasicType.DT_I], [ g.nativeint_ty ]), [], [e], m) /// Fix up the r.h.s. of a 'use x = fixed expr' -and TcAndBuildFixedExpr cenv env (overallPatTy, fixedExpr, overallExprTy, mBinding) = +and TcAndBuildFixedExpr (cenv: cenv) env (overallPatTy, fixedExpr, overallExprTy, mBinding) = let g = cenv.g @@ -10750,7 +10423,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt CheckedBindingInfo(inlineFlag, valAttribs, xmlDoc, tcPatPhase2, explicitTyparInfo, nameToPrelimValSchemeMap, rhsExprChecked, argAndRetAttribs, overallPatTy, mBinding, debugPoint, isCompGen, literalValue, isFixed), tpenv -and TcLiteral cenv overallTy env tpenv (attrs, synLiteralValExpr) = +and TcLiteral (cenv: cenv) overallTy env tpenv (attrs, synLiteralValExpr) = let g = cenv.g @@ -10804,7 +10477,7 @@ and TcNonRecursiveBinding declKind cenv env tpenv ty binding = // *Ex means the function accepts attribute targets that must be explicit //------------------------------------------------------------------------ -and TcAttributeEx canFail cenv (env: TcEnv) attrTgt attrEx (synAttr: SynAttribute) = +and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: SynAttribute) = let g = cenv.g @@ -10970,7 +10643,7 @@ and TcAttributeEx canFail cenv (env: TcEnv) attrTgt attrEx (synAttr: SynAttribut [ (constrainedTgts, attrib) ], false -and TcAttributesWithPossibleTargetsEx canFail cenv env attrTgt attrEx synAttribs = +and TcAttributesWithPossibleTargetsEx canFail (cenv: cenv) env attrTgt attrEx synAttribs = let g = cenv.g @@ -10992,7 +10665,7 @@ and TcAttributesWithPossibleTargetsEx canFail cenv env attrTgt attrEx synAttribs errorRecovery e synAttrib.Range [], false) -and TcAttributesMaybeFailEx canFail cenv env attrTgt attrEx synAttribs = +and TcAttributesMaybeFailEx canFail (cenv: cenv) env attrTgt attrEx synAttribs = let attribsAndTargets, didFail = TcAttributesWithPossibleTargetsEx canFail cenv env attrTgt attrEx synAttribs attribsAndTargets |> List.map snd, didFail @@ -11016,7 +10689,7 @@ and TcAttributes cenv env attrTgt synAttribs = // TcLetBinding //------------------------------------------------------------------------ -and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBindsRange, scopem) = +and TcLetBinding (cenv: cenv) isUse env containerInfo declKind tpenv (synBinds, synBindsRange, scopem) = let g = cenv.g @@ -11160,7 +10833,7 @@ and TcLetBinding cenv isUse env containerInfo declKind tpenv (synBinds, synBinds /// So let bindings could contain a fork at a match construct, with one branch being the match failure. /// If bindings are linearised, then this fork is pushed to the RHS. /// In this case, the let bindings type check to a sequence of bindings. -and TcLetBindings cenv env containerInfo (declKind: DeclKind) tpenv (binds, bindsm, scopem) = +and TcLetBindings (cenv: cenv) env containerInfo (declKind: DeclKind) tpenv (binds, bindsm, scopem) = let g = cenv.g assert declKind.IsConvertToLinearBindings @@ -11192,7 +10865,7 @@ and CheckMemberFlags intfSlotTyOpt newslotsOK overridesOK memberFlags m = /// the _body_ of the binding. For example, in a letrec we may assume this knowledge /// for each binding in the letrec prior to any type inference. This might, for example, /// tell us the type of the arguments to a recursive function. -and ApplyTypesFromArgumentPatterns (cenv, env, optionalArgsOK, ty, m, tpenv, NormalizedBindingRhs (pushedPats, retInfoOpt, e), memberFlagsOpt: SynMemberFlags option) = +and ApplyTypesFromArgumentPatterns (cenv: cenv, env, optionalArgsOK, ty, m, tpenv, NormalizedBindingRhs (pushedPats, retInfoOpt, e), memberFlagsOpt: SynMemberFlags option) = let g = cenv.g @@ -11393,7 +11066,7 @@ and CheckForNonAbstractInterface declKind tcref (memberFlags: SynMemberFlags) m //------------------------------------------------------------------------ and AnalyzeRecursiveStaticMemberOrValDecl - (cenv, + (cenv: cenv, envinner: TcEnv, tpenv, declKind, @@ -11509,7 +11182,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl and AnalyzeRecursiveInstanceMemberDecl - (cenv, + (cenv: cenv, envinner: TcEnv, tpenv, declKind, @@ -11665,7 +11338,7 @@ and AnalyzeRecursiveDecl and AnalyzeAndMakeAndPublishRecursiveValue overridesOK isGeneratedEventVal - cenv + (cenv: cenv) (env: TcEnv) (tpenv, recBindIdx) (NormalizedRecBindingDefn(containerInfo, newslotsOK, declKind, binding)) = @@ -11774,7 +11447,7 @@ and AnalyzeAndMakeAndPublishRecursiveValues overridesOK cenv env tpenv binds = //------------------------------------------------------------------------- and TcLetrecBinding - (cenv, envRec: TcEnv, scopem, extraGeneralizableTypars: Typars, reqdThisValTyOpt: TType option) + (cenv: cenv, envRec: TcEnv, scopem, extraGeneralizableTypars: Typars, reqdThisValTyOpt: TType option) // The state of the left-to-right iteration through the bindings (envNonRec: TcEnv, @@ -12101,7 +11774,7 @@ and TcLetrecGeneralizeBinding cenv denv generalizedTypars (pgrbind: PreGeneraliz CheckedBinding = pgrbind.CheckedBinding RecBindingInfo = pgrbind.RecBindingInfo } -and TcLetrecComputeCtorSafeThisValBind cenv safeThisValOpt = +and TcLetrecComputeCtorSafeThisValBind (cenv: cenv) safeThisValOpt = let g = cenv.g match safeThisValOpt with | None -> None @@ -12143,7 +11816,7 @@ and MakeCheckSafeInit g tinst safeInitInfo reqExpr expr = // The "let ctorSafeThisVal = ref null" is only added for explicit constructors with a self-reference parameter (Note: check later code for exact conditions) // For implicit constructors the binding is added to the bindings of the implicit constructor -and TcLetrecAdjustMemberForSpecialVals cenv (pgrbind: PostGeneralizationRecursiveBinding) : PostSpecialValsRecursiveBinding = +and TcLetrecAdjustMemberForSpecialVals (cenv: cenv) (pgrbind: PostGeneralizationRecursiveBinding) : PostSpecialValsRecursiveBinding = let g = cenv.g let (RecursiveBindingInfo(_, _, _, _, vspec, _, _, _, baseValOpt, safeThisValOpt, safeInitInfo, _, _, _)) = pgrbind.RecBindingInfo @@ -12189,7 +11862,7 @@ and TcLetrecAdjustMemberForSpecialVals cenv (pgrbind: PostGeneralizationRecursiv { ValScheme = pgrbind.ValScheme Binding = TBind(vspec, expr, debugPoint) } -and FixupLetrecBind cenv denv generalizedTyparsForRecursiveBlock (bind: PostSpecialValsRecursiveBinding) = +and FixupLetrecBind (cenv: cenv) denv generalizedTyparsForRecursiveBlock (bind: PostSpecialValsRecursiveBinding) = let g = cenv.g let (TBind(vspec, expr, debugPoint)) = bind.Binding @@ -12225,7 +11898,7 @@ and FixupLetrecBind cenv denv generalizedTyparsForRecursiveBlock (bind: PostSpec and unionGeneralizedTypars typarSets = List.foldBack (ListSet.unionFavourRight typarEq) typarSets [] -and TcLetrecBindings overridesOK cenv env tpenv (binds, bindsm, scopem) = +and TcLetrecBindings overridesOK (cenv: cenv) env tpenv (binds, bindsm, scopem) = let g = cenv.g @@ -12287,7 +11960,7 @@ and TcLetrecBindings overridesOK cenv env tpenv (binds, bindsm, scopem) = // Bind specifications of values //------------------------------------------------------------------------- -let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind : DeclKind, memFlagsOpt, tpenv, synValSig) = +let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind : DeclKind, memFlagsOpt, tpenv, synValSig) = let g = cenv.g diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index f7a7fc217bd..3b70a5caa1e 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -3,117 +3,29 @@ module internal FSharp.Compiler.CheckExpressions open System -open System.Collections.Generic open Internal.Utilities.Collections open Internal.Utilities.Library open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic -open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.ConstraintSolver -open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.Import open FSharp.Compiler.InfoReader open FSharp.Compiler.Infos open FSharp.Compiler.MethodOverrides open FSharp.Compiler.NameResolution open FSharp.Compiler.PatternMatchCompilation open FSharp.Compiler.Syntax -open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps +open FSharp.Compiler.CheckBasics #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders #endif -/// Represents information about the initialization field used to check that object constructors -/// have completed before fields are accessed. -type SafeInitData = - | SafeInitField of RecdFieldRef * RecdField - | NoSafeInitInfo - -/// Represents information about object constructors -[] -type CtorInfo - -val InitialImplicitCtorInfo: unit -> CtorInfo - -/// Represents an item in the environment that may restrict the automatic generalization of later -/// declarations because it refers to type inference variables. As type inference progresses -/// these type inference variables may get solved. -[] -type UngeneralizableItem - -/// Represents the type environment at a particular scope. Includes the name -/// resolution environment, the ungeneralizable items from earlier in the scope -/// and other information about the scope. -[] -type TcEnv = - { - /// Name resolution information - eNameResEnv: NameResolutionEnv - - /// The list of items in the environment that may contain free inference - /// variables (which may not be generalized). The relevant types may - /// change as a result of inference equations being asserted, hence may need to - /// be recomputed. - eUngeneralizableItems: UngeneralizableItem list - - // Two (!) versions of the current module path - // These are used to: - // - Look up the appropriate point in the corresponding signature - // see if an item is public or not - // - Change fslib canonical module type to allow compiler references to these items - // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary - // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. - // This information is used mainly when building non-local references - // to public items. - // - // Of the two, 'ePath' is the one that's barely used. It's only - // used by UpdateAccModuleOrNamespaceType to modify the CCU while compiling FSharp.Core - ePath: Ident list - - eCompPath: CompilationPath - - eAccessPath: CompilationPath - - /// This field is computed from other fields, but we amortize the cost of computing it. - eAccessRights: AccessorDomain - - /// Internals under these should be accessible - eInternalsVisibleCompPaths: CompilationPath list - - /// Mutable accumulator for the current module type - eModuleOrNamespaceTypeAccumulator: ModuleOrNamespaceType ref - - /// Context information for type checker - eContextInfo: ContextInfo - - /// Here Some tcref indicates we can access protected members in all super types - eFamilyType: TyconRef option - - // Information to enforce special restrictions on valid expressions - // for .NET constructors. - eCtorInfo: CtorInfo option - - eCallerMemberName: string option - - // Active arg infos in iterated lambdas , allowing us to determine the attributes of arguments - eLambdaArgInfos: ArgReprInfo list list - - eIsControlFlow: bool - } - - member DisplayEnv: DisplayEnv - - member NameEnv: NameResolutionEnv - - member AccessRights: AccessorDomain - //------------------------------------------------------------------------- // Some of the exceptions arising from type checking. These should be moved to // use DiagnosticsLogger. @@ -214,59 +126,24 @@ val TcFieldInit: range -> ILFieldInit -> Const val LightweightTcValForUsingInBuildMethodCall: g: TcGlobals -> vref: ValRef -> vrefFlags: ValUseFlag -> vrefTypeInst: TTypes -> m: range -> Expr * TType + +/// Indicates whether a syntactic type is allowed to include new type variables +/// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` +type ImplicitlyBoundTyparsAllowed = + | NewTyparsOKButWarnIfNotRigid + | NewTyparsOK + | NoNewTypars + //------------------------------------------------------------------------- // The rest are all helpers needed for declaration checking (CheckDeclarations.fs) //------------------------------------------------------------------------- -/// Represents the current environment of type variables that have implicit scope -/// (i.e. are without explicit declaration). -type UnscopedTyparEnv - -/// A type to represent information associated with values to indicate what explicit (declared) type parameters -/// are given and what additional type parameters can be inferred, if any. -/// -/// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication -/// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x -type ExplicitTyparInfo = ExplicitTyparInfo of rigidCopyOfDeclaredTypars: Typars * declaredTypars: Typars * infer: bool - val permitInferTypars: ExplicitTyparInfo val dontInferTypars: ExplicitTyparInfo -type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs - val noArgOrRetAttribs: ArgAndRetAttribs -/// Indicates whether constraints should be checked when checking syntactic types -type CheckConstraints = - | CheckCxs - | NoCheckCxs - -/// Represents the ValReprInfo for a value, before the typars are fully inferred -type PrelimValReprInfo = PrelimValReprInfo of curriedArgInfos: ArgReprInfo list list * returnInfo: ArgReprInfo - -/// Holds the initial ValMemberInfo and other information before it is fully completed -type PrelimMemberInfo = PrelimMemberInfo of memberInfo: ValMemberInfo * logicalName: string * compiledName: string - -/// Represents the results of the first phase of preparing simple values from a pattern -type PrelimVal1 = - | PrelimVal1 of - id: Ident * - explicitTyparInfo: ExplicitTyparInfo * - prelimType: TType * - prelimValReprInfo: PrelimValReprInfo option * - memberInfoOpt: PrelimMemberInfo option * - isMutable: bool * - inlineFlag: ValInline * - baseOrThisInfo: ValBaseOrThisInfo * - argAttribs: ArgAndRetAttribs * - visibility: SynAccess option * - isCompGen: bool - - member Type: TType - - member Ident: Ident - /// The results of applying let-style generalization after type checking. type PrelimVal2 = | PrelimVal2 of @@ -282,156 +159,6 @@ type PrelimVal2 = isCompGen: bool * hasDeclaredTypars: bool -/// Translation of patterns is split into three phases. The first collects names. -/// The second is run after val_specs have been created for those names and inference -/// has been resolved. The second phase is run by applying a function returned by the -/// first phase. The input to the second phase is a List.map that gives the Val and type scheme -/// for each value bound by the pattern. -type TcPatPhase2Input = - | TcPatPhase2Input of NameMap * bool - - member WithRightPath: unit -> TcPatPhase2Input - -/// Represents the context flowed left-to-right through pattern checking -type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set - -/// Represents the flags passsed to TcPat regarding the binding location -type TcPatValFlags = - | TcPatValFlags of - inlineFlag: ValInline * - explicitTyparInfo: ExplicitTyparInfo * - argAndRetAttribs: ArgAndRetAttribs * - isMutable: bool * - visibility: SynAccess option * - isCompilerGenerated: bool - -/// Represents the compilation environment for typechecking a single file in an assembly. -[] -type TcFileState = - { - g: TcGlobals - - /// Push an entry every time a recursive value binding is used, - /// in order to be able to fix up recursive type applications as - /// we infer type parameters - mutable recUses: ValMultiMap - - /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached - stackGuard: StackGuard - - /// Set to true if this file causes the creation of generated provided types. - mutable createsGeneratedProvidedTypes: bool - - /// Are we in a script? if so relax the reporting of discarded-expression warnings at the top level - isScript: bool - - /// Environment needed to convert IL types to F# types in the importer. - amap: ImportMap - - /// Used to generate new syntactic argument names in post-parse syntactic processing - synArgNameGenerator: SynArgNameGenerator - - tcSink: TcResultsSink - - /// Holds a reference to the component being compiled. - /// This field is very rarely used (mainly when fixing up forward references to fslib. - thisCcu: CcuThunk - - /// Holds the current inference constraints - css: ConstraintSolverState - - /// Are we compiling the signature of a module from fslib? - compilingCanonicalFslibModuleType: bool - - /// Is this a .fsi file? - isSig: bool - - /// Does this .fs file have a .fsi file? - haveSig: bool - - /// Used to generate names - niceNameGen: NiceNameGenerator - - /// Used to read and cache information about types and members - infoReader: InfoReader - - /// Used to resolve names - nameResolver: NameResolver - - /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. - conditionalDefines: string list option - - namedDebugPointsForInlinedCode: Dictionary - - isInternalTestSpanStackReferring: bool - - // forward call - TcPat: WarnOnUpperFlag - -> TcFileState - -> TcEnv - -> PrelimValReprInfo option - -> TcPatValFlags - -> TcPatLinearEnv - -> TType - -> SynPat - -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv - - // forward call - TcSimplePats: TcFileState - -> bool - -> CheckConstraints - -> TType - -> TcEnv - -> TcPatLinearEnv - -> SynSimplePats - -> string list * TcPatLinearEnv - - // forward call - TcSequenceExpressionEntry: TcFileState - -> TcEnv - -> OverallTy - -> UnscopedTyparEnv - -> bool * SynExpr - -> range - -> Expr * UnscopedTyparEnv - - // forward call - TcArrayOrListComputedExpression: TcFileState - -> TcEnv - -> OverallTy - -> UnscopedTyparEnv - -> bool * SynExpr - -> range - -> Expr * UnscopedTyparEnv - - // forward call - TcComputationExpression: TcFileState - -> TcEnv - -> OverallTy - -> UnscopedTyparEnv - -> range * Expr * TType * SynExpr - -> Expr * UnscopedTyparEnv - } - - static member Create: - g: TcGlobals * - isScript: bool * - niceNameGen: NiceNameGenerator * - amap: ImportMap * - thisCcu: CcuThunk * - isSig: bool * - haveSig: bool * - conditionalDefines: string list option * - tcSink: TcResultsSink * - tcVal: TcValF * - isInternalTestSpanStackReferring: bool * - tcPat: (WarnOnUpperFlag -> TcFileState -> TcEnv -> PrelimValReprInfo option -> TcPatValFlags -> TcPatLinearEnv -> TType -> SynPat -> (TcPatPhase2Input -> Pattern) * TcPatLinearEnv) * - tcSimplePats: (TcFileState -> bool -> CheckConstraints -> TType -> TcEnv -> TcPatLinearEnv -> SynSimplePats -> string list * TcPatLinearEnv) * - tcSequenceExpressionEntry: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * - tcArrayOrListSequenceExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * - tcComputationExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv) -> - TcFileState - /// Represents information about the module or type in which a member or value is declared. type MemberOrValContainerInfo = | MemberOrValContainerInfo of @@ -482,13 +209,6 @@ type DeclKind = member CanOverrideOrImplement: OverridesOK -/// Indicates whether a syntactic type is allowed to include new type variables -/// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` -type ImplicitlyBoundTyparsAllowed = - | NewTyparsOKButWarnIfNotRigid - | NewTyparsOK - | NoNewTypars - /// Indicates whether the position being checked is precisely the r.h.s. of a "'T :> ***" constraint or a similar /// places where IWSAM types do not generate a warning [] diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index 6a52133379f..c5418132b8d 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -8,6 +8,7 @@ open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckPatterns open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.DiagnosticsLogger diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fsi b/src/Compiler/Checking/CheckIncrementalClasses.fsi index c3f5b17a325..cef65f2a33f 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fsi +++ b/src/Compiler/Checking/CheckIncrementalClasses.fsi @@ -2,6 +2,7 @@ open Internal.Utilities.Collections open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 90695abf692..dccff65781b 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -12,6 +12,7 @@ open Internal.Utilities.Library.Extras open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features diff --git a/src/Compiler/Checking/CheckPatterns.fsi b/src/Compiler/Checking/CheckPatterns.fsi index 866012bd0a9..46e400b8a92 100644 --- a/src/Compiler/Checking/CheckPatterns.fsi +++ b/src/Compiler/Checking/CheckPatterns.fsi @@ -2,7 +2,7 @@ module internal FSharp.Compiler.CheckPatterns -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.NameResolution open FSharp.Compiler.TypedTree open FSharp.Compiler.PatternMatchCompilation diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index 052835d45bc..9a3e9b517ef 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -8,7 +8,7 @@ open System open Internal.Utilities.Library open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CompilerConfig open FSharp.Compiler.DependencyManager open FSharp.Compiler.DiagnosticsLogger diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index b0c820c6c67..95d10e8bf7c 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -14,7 +14,7 @@ open Internal.Utilities.Text.Lexing open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.CompilerConfig diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index 738d2886552..2f02882bee1 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -5,7 +5,7 @@ module internal FSharp.Compiler.ParseAndCheckInputs open System.IO open Internal.Utilities.Library -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.CompilerConfig diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 36f0a788a6a..5f53b8b610d 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -330,6 +330,8 @@ + + diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 6295a9a99a2..96e0c8ef1cc 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -13,7 +13,7 @@ open Internal.Utilities.Collections open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.CheckExpressions +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerDiagnostics diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index 317bc2b8c96..cca65bcace1 100755 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -5,6 +5,7 @@ namespace FSharp.Compiler.CodeAnalysis open System open FSharp.Compiler open FSharp.Compiler.AbstractIL +open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.CompilerConfig @@ -48,7 +49,8 @@ module internal IncrementalBuilderEventTesting = type internal TcInfo = { tcState: TcState - tcEnvAtEndOfFile: CheckExpressions.TcEnv + + tcEnvAtEndOfFile: TcEnv /// Disambiguation table for module names moduleNamesDict: ModuleNamesDict From df6bba06e0b3cf269b8e4836450c1967e3e8c6c9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:06:41 +0000 Subject: [PATCH 107/226] Update dependencies from https://github.com/dotnet/arcade build 20220811.2 (#13680) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22410.3 -> To Version 7.0.0-beta.22411.2 Co-authored-by: dotnet-maestro[bot] --- .config/dotnet-tools.json | 1 - eng/Version.Details.xml | 4 ++-- global.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3d5db058ab4..0fdcde7e13a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,4 +10,3 @@ } } } - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 60e35d3cb0a..1245a1542d1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - fd9941799bb6983a7d00ed72682378b46a45f396 + 6a638cd0c13962ab2a1943cb1c878be5a41dd82e diff --git a/global.json b/global.json index f7776e92cc1..12ec23e3058 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22410.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 38238fb41d233fbc956c277b38827f62b3efd0ab Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sat, 13 Aug 2022 09:49:37 +1300 Subject: [PATCH 108/226] More tests for Lowercase DU when RequireQualifiedAccess (#13656) --- .../E_LowercaseWhenRequireQualifiedAccess.fsx | 17 ++++++++++++++++- .../LowercaseWhenRequireQualifiedAccess.fsx | 14 ++++++++++++++ .../Conformance/UnionTypes/UnionTypes.fs | 9 +++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx index a7e7a928e36..6c0735e38e7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_LowercaseWhenRequireQualifiedAccess.fsx @@ -19,4 +19,19 @@ type DU6 = a type du1 = du1 of string -type du2 = | du2 of string \ No newline at end of file +type du2 = | du2 of string + +[] +type du3 = + | a + | ``c`` + +[] +type du4 = + | a + | ``a.b`` + +[] +type du5 = + | a + | ``A.C`` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx index e9080c19964..3e029853210 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/LowercaseWhenRequireQualifiedAccess.fsx @@ -14,6 +14,8 @@ type DU2 = | a of int | B of string | C + | ``D`` of bool + | ``d`` of string * int [] type DU3 = | a @@ -21,6 +23,18 @@ type DU3 = | a [] type DU4 = a +[] +type DU5 = ``a`` + +[] +type DU6 = ``A`` + +[] +type DU7 = | ``a`` + +[] +type DU8 = | ``A`` + [] type du1 = du1 of string diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index 39f4fac3804..7c96b3ff713 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -543,6 +543,8 @@ module UnionTypes = (Error 53, Line 18, Col 12, Line 18, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); (Error 53, Line 20, Col 12, Line 20, Col 15, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute"); (Error 53, Line 22, Col 14, Line 22, Col 17, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + (Error 883, Line 32, Col 7, Line 32, Col 14, "Invalid namespace, module, type or union case name"); + (Error 883, Line 37, Col 7, Line 37, Col 14, "Invalid namespace, module, type or union case name") ] //SOURCE=E_LowercaseWhenRequireQualifiedAccess.fsx # E_LowercaseWhenRequireQualifiedAccess.fsx @@ -565,6 +567,13 @@ module UnionTypes = (Error 53, Line 18, Col 12, Line 18, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers"); (Error 53, Line 20, Col 12, Line 20, Col 15, "Discriminated union cases and exception labels must be uppercase identifiers"); (Error 53, Line 22, Col 14, Line 22, Col 17, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 26, Col 7, Line 26, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 27, Col 7, Line 27, Col 12, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 31, Col 7, Line 31, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 32, Col 7, Line 32, Col 14, "Invalid namespace, module, type or union case name"); + (Error 53, Line 32, Col 7, Line 32, Col 14, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 53, Line 36, Col 7, Line 36, Col 8, "Discriminated union cases and exception labels must be uppercase identifiers"); + (Error 883, Line 37, Col 7, Line 37, Col 14, "Invalid namespace, module, type or union case name") ] //SOURCE=W_GenericFunctionValuedStaticProp02.fs SCFLAGS="--test:ErrorRanges --warnaserror-" # W_GenericFunctionValuedStaticProp02.fs From 5420f094882d1e16e970727f7474ce06cbe57b5a Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 14 Aug 2022 22:18:45 +1300 Subject: [PATCH 109/226] More tests for Obsolete attribute to validate existing behaviour (#13685) * More obsolete attributes to validate existing behavior * More unit tests --- .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Language/AttributeCheckingTests.fs | 494 +--------- .../ObsoleteAttributeCheckingTests.fs | 903 ++++++++++++++++++ 3 files changed, 905 insertions(+), 493 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 5935d322ccf..e34bbe845d4 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -153,6 +153,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs index 77214921d16..9a24fdb8663 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs @@ -42,499 +42,7 @@ type C() = |> ignoreWarnings |> compile |> shouldSucceed - - [] - let ``Obsolete attribute is not taken into account when used on on a member and and instantiate the type`` () = - Fsx """ -open System - -type C() = - - [] - member _.Update() = () - -let c = C() - """ - |> ignoreWarnings - |> compile - |> shouldSucceed - - [] - let ``Obsolete attribute is taken into account when used on type and and instantiate the type`` () = - Fsx """ -open System - -[] -type C() = - - member _.Update() = () - -let c = C() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 9, Line 9, Col 10, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on a member and invoking the member`` () = - Fsx """ -open System - -type C() = - [] - member _.Update() = () - -let c = C() -c.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on type and invoking the member`` () = - Fsx """ -open System - -[] -type C() = - member _.Update() = () - -let c = C() -c.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 8, Col 9, Line 8, Col 10, "This construct is deprecated. Use B instead"); - (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on struct type and invoking the member`` () = - Fsx """ -open System - -[] -[] -type C = - member _.Update() = () - -let c = C() -c.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 9, Line 9, Col 10, "This construct is deprecated. Use B instead"); - (Error 101, Line 10, Col 1, Line 10, Col 9, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on struct type and instantiate the type`` () = - Fsx """ -open System - -[] -[] -type C = - member _.Update() = () - -let c = C() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 9, Line 9, Col 10, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on a struct member and invoking the member`` () = - Fsx """ -open System - -[] -type C = - [] - member _.Update() = () - -let c = C() -c.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 10, Col 1, Line 10, Col 9, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on a record property`` () = - Fsx """ -open System - -type C = - { [] X: int } - -let c = { X = 0 } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 7, Col 9, Line 7, Col 18, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on a record and member invocation`` () = - Fsx """ -open System - -[] -type C = - { X : int } - - static member Update() = () - -C.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 10, Col 1, Line 10, Col 2, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on a record member and method invocation`` () = - Fsx """ -open System - -type C = - { X : int } - [] - static member Update() = () - -C.Update() - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an enum and invocation`` () = - Fsx """ -open System - -[] -type Color = - | Red = 0 - | Green = 1 -let c = Color.Red - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 9, Line 9, Col 14, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an enum entry and invocation`` () = - Fsx """ -open System - -type Color = - | [] Red = 0 - | Green = 1 - -let c = Color.Red - """ - |> ignoreWarnings - |> compile - |> shouldSucceed - - [] - let ``Obsolete attribute is taken into account when used on an type and use extension method`` () = - Fsx """ - -open System -open System.Runtime.CompilerServices - -[] -type Button = { Text : string } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - { this with Text = text } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 13, Col 37, Line 13, Col 43, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an type property and use extension method`` () = - Fsx """ - -open System -open System.Runtime.CompilerServices - -type Button = { [] Text : string } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - { this with Text = text } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 13, Col 9, Line 13, Col 34, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an type and property and use extension method`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -[] -type Button = { [] Text : string } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - { this with Text = text } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 12, Col 37, Line 12, Col 43, "This construct is deprecated. Use B instead"); - (Error 101, Line 13, Col 9, Line 13, Col 34, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an type property and set via module`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { [] Text : string } - -module Button = - - let set text = { Text = text } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 20, Line 9, Col 36, "This construct is deprecated. Use B instead") - ] - - - [] - let ``Obsolete attribute is taken into account when used on an type and set property via module`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - - [] -type Button = { [] Text : string } - -module Button = - - let set text = { Text = text } - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 10, Col 20, Line 10, Col 36, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an type property and set property via module using an extension method`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { [] Text : string } - -module Button = - - let set text = { Text = text } -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - Button.set text - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 9, Col 20, Line 9, Col 36, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an module and set property via module using an extension method`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { Text : string } - -[] -module Button = - - let set text = { Text = text } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - Button.set text - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 17, Col 9, Line 17, Col 15, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an moudle and function and set property via module using an extesnion method`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { Text : string } - -[] -module Button = - - [] - let set text = { Text = text } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - Button.set text - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 18, Col 9, Line 18, Col 15, "This construct is deprecated. Use B instead") - ] - - [] - let ``Obsolete attribute is taken into account when used on an moudle function and set property via module using an extesnion method`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { Text : string } - -module Button = - - [] - let set text = { Text = text } - -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - Button.set text - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 17, Col 9, Line 17, Col 19, "This construct is deprecated. Use B instead") - ] - - - [] - let ``Obsolete attribute is taken into account when used on an type extensions and used on an instance`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { Text : string } - -[] -[] -type ButtonExtensions = - - [] - static member inline text(this: Button, text: string) = - { this with Text = text } - -let b = { Text = "Hello" } -b.text("Hello 2") |> ignore - """ - |> ignoreWarnings - |> compile - |> shouldSucceed - - [] - let ``Obsolete attribute is taken into account when used on an type extensions static function and used on an instance`` () = - Fsx """ -open System -open System.Runtime.CompilerServices - -type Button = { Text : string } - -[] -type ButtonExtensions = - - [] - [] - static member inline text(this: Button, text: string) = - { this with Text = text } - -let b = { Text = "Hello" } -b.text("Hello 2") |> ignore - """ - |> ignoreWarnings - |> compile - |> shouldFail - |> withDiagnostics [ - (Error 101, Line 16, Col 1, Line 16, Col 7, "This construct is deprecated. Use B instead") - ] - #if !NETCOREAPP [] #else @@ -572,4 +80,4 @@ b.text("Hello 2") |> ignore |> withLangVersionPreview |> withReferences [csharpBaseClass] |> compile - |> shouldSucceed \ No newline at end of file + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs new file mode 100644 index 00000000000..17d6f02625f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs @@ -0,0 +1,903 @@ +namespace FSharp.Compiler.ComponentTests.Language + +open Xunit +open FSharp.Test.Compiler + +module ObsoleteAttributeCheckingTests = + + [] + let ``Obsolete attribute is not taken into account when used on on a member and and instantiate the type`` () = + Fsx """ +open System + +type C() = + [] + member _.Update() = () + +let c = C() + """ + |> ignoreWarnings + |> compile + |> shouldSucceed + + [] + let ``Obsolete attribute warning taken into account when used instantiating a type`` () = + Fsx """ +open System +[] +type C() = + member _.Update() = () + +let c = C() + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 7, Col 9, Line 7, Col 10, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute error taken into account when used instantiating a type`` () = + Fsx """ +open System +[] +type C() = + member _.Update() = () + +let c = C() + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 7, Col 9, Line 7, Col 10, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on a member and invoking the member`` () = + Fsx """ +open System + +type C() = + [] + member _.Update() = () + +let c = C() +c.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on type and invoking the member`` () = + Fsx """ +open System + +[] +type C() = + member _.Update() = () + +let c = C() +c.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 8, Col 9, Line 8, Col 10, "This construct is deprecated. Use B instead"); + (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on struct type and invoking the member`` () = + Fsx """ +open System + +[] +[] +type C = + member _.Update() = () + +let c = C() +c.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 9, Line 9, Col 10, "This construct is deprecated. Use B instead"); + (Error 101, Line 10, Col 1, Line 10, Col 9, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on struct type and instantiate the type`` () = + Fsx """ +open System + +[] +[] +type C = + member _.Update() = () + +let c = C() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 9, Line 9, Col 10, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on a struct member and invoking the member`` () = + Fsx """ +open System + +[] +type C = + [] + member _.Update() = () + +let c = C() +c.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 10, Col 1, Line 10, Col 9, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on a record property`` () = + Fsx """ +open System + +type C = + { [] X: int } + +let c = { X = 0 } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 7, Col 9, Line 7, Col 18, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on a record and member invocation`` () = + Fsx """ +open System + +[] +type C = + { X : int } + + static member Update() = () + +C.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 10, Col 1, Line 10, Col 2, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on a record member and method invocation`` () = + Fsx """ +open System + +type C = + { X : int } + [] + static member Update() = () + +C.Update() + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 1, Line 9, Col 9, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an enum and invocation`` () = + Fsx """ +open System + +[] +type Color = + | Red = 0 + | Green = 1 + +let c = Color.Red + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 9, Line 9, Col 14, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an enum entry and invocation`` () = + Fsx """ +open System + +type Color = + | [] Red = 0 + | Green = 1 + +let c = Color.Red + """ + |> ignoreWarnings + |> compile + |> shouldSucceed + + [] + let ``Obsolete attribute is taken into account when used on an type and use extension method`` () = + Fsx """ + +open System +open System.Runtime.CompilerServices + +[] +type Button = { Text : string } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + { this with Text = text } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 13, Col 37, Line 13, Col 43, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an type property and use extension method`` () = + Fsx """ + +open System +open System.Runtime.CompilerServices + +type Button = { [] Text : string } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + { this with Text = text } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 13, Col 9, Line 13, Col 34, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an type and property and use extension method`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +[] +type Button = { [] Text : string } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + { this with Text = text } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 12, Col 37, Line 12, Col 43, "This construct is deprecated. Use B instead"); + (Error 101, Line 13, Col 9, Line 13, Col 34, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an type property and set via module`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { [] Text : string } + +module Button = + + let set text = { Text = text } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 20, Line 9, Col 36, "This construct is deprecated. Use B instead") + ] + + + [] + let ``Obsolete attribute is taken into account when used on an type and set property via module`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + + [] +type Button = { [] Text : string } + +module Button = + + let set text = { Text = text } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 10, Col 20, Line 10, Col 36, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an type property and set property via module using an extension method`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { [] Text : string } + +module Button = + + let set text = { Text = text } +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + Button.set text + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 20, Line 9, Col 36, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an module and set property via module using an extension method`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { Text : string } + +[] +module Button = + + let set text = { Text = text } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + Button.set text + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 17, Col 9, Line 17, Col 15, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an module and function and set property via module using an extesnion method`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { Text : string } + +[] +module Button = + + [] + let set text = { Text = text } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + Button.set text + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 18, Col 9, Line 18, Col 15, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an moudle function and set property via module using an extesnion method`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { Text : string } + +module Button = + + [] + let set text = { Text = text } + +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + Button.set text + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 17, Col 9, Line 17, Col 19, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute is taken into account when used on an type extensions and used on an instance`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { Text : string } + +[] +[] +type ButtonExtensions = + + [] + static member inline text(this: Button, text: string) = + { this with Text = text } + +let b = { Text = "Hello" } +b.text("Hello 2") |> ignore + """ + |> ignoreWarnings + |> compile + |> shouldSucceed + + [] + let ``Obsolete attribute is taken into account when used on an type extensions static function and used on an instance`` () = + Fsx """ +open System +open System.Runtime.CompilerServices + +type Button = { Text : string } + +[] +type ButtonExtensions = + + [] + [] + static member inline text(this: Button, text: string) = + { this with Text = text } + +let b = { Text = "Hello" } +b.text("Hello 2") |> ignore + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 16, Col 1, Line 16, Col 7, "This construct is deprecated. Use B instead") + ] + + [] + let ``Obsolete attribute error is taken into account when used in one the record properties`` () = + Fsx """ +open System +type MyType = { [] DeprecatedField: string ; JustField: string } +let a = { DeprecatedField= "23" ; JustField = "" } + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 4, Col 9, Line 4, Col 51, "This construct is deprecated. Deprecated Field") + ] + + [] + let ``Obsolete attribute warning is taken into account when used in one the record properties`` () = + Fsx """ +open System +type MyType = { [] DeprecatedField: string ; JustField: string } +let a = { DeprecatedField= "23" ; JustField = "" } + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 4, Col 9, Line 4, Col 51, "This construct is deprecated. Deprecated Field") + ] + + [] + let ``Obsolete attribute warning is taken into account when used in one the class with a setter`` () = + Fsx """ +type Class1() = + let mutable internalValue = 1 + member _.A with get () = internalValue + [] member _.A with set (v: int) = internalValue <- v + +let class1 = new Class1() +let value1 = class1.A +let value2 = class1.A <- 12 + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 9, Col 14, Line 9, Col 22, "This construct is deprecated. member A is deprecated"); + (Warning 44, Line 9, Col 14, Line 9, Col 28, "This construct is deprecated. member A is deprecated") + ] + + [] + let ``Obsolete attribute error is taken into account when used in one the class with a setter`` () = + Fsx """ +type Class1() = + let mutable internalValue = 1 + member _.A with get () = internalValue + [] member _.A with set (v: int) = internalValue <- v + +let class1 = new Class1() +let value1 = class1.A +let value2 = class1.A <- 12 + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 9, Col 14, Line 9, Col 22, "This construct is deprecated. member A is deprecated") + ] + + [] + let ``Obsolete attribute warning is taken into account when used in one the class with a getter`` () = + Fsx """ +type Class1() = + let mutable internalValue = 1 + [] member _.A with get () = internalValue + member _.A with set (v: int) = internalValue <- v + +let class1 = new Class1() +let value1 = class1.A +let value2 = class1.A <- 12 + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 8, Col 14, Line 8, Col 22, "This construct is deprecated. member A is deprecated"); + (Warning 44, Line 9, Col 14, Line 9, Col 22, "This construct is deprecated. member A is deprecated") + ] + + [] + let ``Obsolete attribute error is taken into account when used in one the class with a getter`` () = + Fsx """ +type Class1() = + let mutable internalValue = 1 + [] member _.A with get () = internalValue + member _.A with set (v: int) = internalValue <- v + +let class1 = new Class1() +let value1 = class1.A +let value2 = class1.A <- 12 + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 8, Col 14, Line 8, Col 22, "This construct is deprecated. member A is deprecated") + (Error 101, Line 9, Col 14, Line 9, Col 22, "This construct is deprecated. member A is deprecated") + ] + + [] + let ``Obsolete attribute warning is taken into account when used on an C# struct`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Struct is obsolete")] +public struct ObsoleteStruct +{ +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteStruct.FS +let s1: ObsoleteStruct = ObsoleteStruct() + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 3, Col 9, Line 3, Col 23, "This construct is deprecated. Struct is obsolete"); + (Warning 44, Line 3, Col 26, Line 3, Col 40, "This construct is deprecated. Struct is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when used on an C# struct`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Struct is obsolete", true)] +public struct ObsoleteStruct +{ +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteStruct.FS +let s1: ObsoleteStruct = ObsoleteStruct() + """ |> withReferences [CSLib] + + app + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 3, Col 9, Line 3, Col 23, "This construct is deprecated. Struct is obsolete"); + (Error 101, Line 3, Col 26, Line 3, Col 40, "This construct is deprecated. Struct is obsolete") + ] + + [] + let ``Obsolete attribute warning is taken into account when used on an C# class`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Class is obsolete")] +public class ObsoleteClass +{ +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteClass.FS +let c1: ObsoleteClass = null +let c2 = ObsoleteClass() + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 3, Col 9, Line 3, Col 22, "This construct is deprecated. Class is obsolete"); + (Warning 44, Line 4, Col 10, Line 4, Col 23, "This construct is deprecated. Class is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when used on an C# class`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Class is obsolete", true)] +public class ObsoleteClass +{ +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteClass.FS +let c1: ObsoleteClass = null +let c2 = ObsoleteClass() + """ |> withReferences [CSLib] + + app + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 3, Col 9, Line 3, Col 22, "This construct is deprecated. Class is obsolete"); + (Error 101, Line 4, Col 10, Line 4, Col 23, "This construct is deprecated. Class is obsolete") + ] + + [] + let ``Obsolete attribute warning is taken into account when used on an C# interface`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Interface is obsolete")] +public interface IObsoleteInterface +{ + int P { get; } +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteInterface.FS +let i1: IObsoleteInterface = null +let i2 = { new IObsoleteInterface with + member this.P = 1 } + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 3, Col 9, Line 3, Col 27, "This construct is deprecated. Interface is obsolete"); + (Warning 44, Line 4, Col 16, Line 4, Col 34, "This construct is deprecated. Interface is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when used on an C# interface`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Interface is obsolete", true)] +public interface IObsoleteInterface +{ + int P { get; } +} + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteInterface.FS +let i1: IObsoleteInterface = null +let i2 = { new IObsoleteInterface with + member this.P = 1 } + """ |> withReferences [CSLib] + + app + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 3, Col 9, Line 3, Col 27, "This construct is deprecated. Interface is obsolete"); + (Error 101, Line 4, Col 16, Line 4, Col 34, "This construct is deprecated. Interface is obsolete") + ] + + [] + let ``Obsolete attribute warning is taken into account when used on an C# delegate`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Delegate is obsolete")] +public delegate void ObsoleteDelegate(); + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteDelegate.FS +let d1: ObsoleteDelegate = null +let d2 = ObsoleteDelegate(fun _ -> ()) +let d3 = new ObsoleteDelegate(fun _ -> ()) + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 3, Col 9, Line 3, Col 25, "This construct is deprecated. Delegate is obsolete"); + (Warning 44, Line 4, Col 10, Line 4, Col 26, "This construct is deprecated. Delegate is obsolete"); + (Warning 44, Line 4, Col 10, Line 4, Col 39, "This construct is deprecated. Delegate is obsolete"); + (Warning 44, Line 5, Col 14, Line 5, Col 30, "This construct is deprecated. Delegate is obsolete"); + (Warning 44, Line 5, Col 10, Line 5, Col 43, "This construct is deprecated. Delegate is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when used on an C# delegate`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Delegate is obsolete", true)] +public delegate void ObsoleteDelegate(); + """ |> withName "CSLib" + + let app = + FSharp """ +module ObsoleteDelegate.FS +let d1: ObsoleteDelegate = null +let d2 = ObsoleteDelegate(fun _ -> ()) +let d3 = new ObsoleteDelegate(fun _ -> ()) + """ |> withReferences [CSLib] + + app + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 3, Col 9, Line 3, Col 25, "This construct is deprecated. Delegate is obsolete"); + (Error 101, Line 4, Col 10, Line 4, Col 26, "This construct is deprecated. Delegate is obsolete"); + (Error 101, Line 5, Col 14, Line 5, Col 30, "This construct is deprecated. Delegate is obsolete") + ] + + [] + let ``Obsolete attribute warning is taken into account when used on an C# static fields and methods`` () = + let CSLib = + CSharp """ +using System; +public class Class +{ + [Obsolete("Field is obsolete")] public static readonly int ObsoleteField = 1; + + [Obsolete("Method is obsolete")] + public static void ObsoleteMethod() + { + } + + [Obsolete("Property is obsolete")] public static int ObsoleteProperty => 1; + + [Obsolete("Event is obsolete")] public static event EventHandler ObsoleteEvent; +} + """ |> withName "CSLib" + + let app = + FSharp """ +module StaticFieldAndMethods.FS +Class.ObsoleteField |> ignore +Class.ObsoleteMethod() +Class.ObsoleteProperty |> ignore +Class.ObsoleteEvent |> ignore + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 3, Col 1, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); + (Warning 44, Line 4, Col 1, Line 4, Col 21, "This construct is deprecated. Method is obsolete"); + (Warning 44, Line 5, Col 1, Line 5, Col 23, "This construct is deprecated. Property is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when used on an C# static fields and methods`` () = + let CSLib = + CSharp """ +using System; +public class Class +{ + [Obsolete("Field is obsolete", true)] public static readonly int ObsoleteField = 1; + + [Obsolete("Method is obsolete", true)] + public static void ObsoleteMethod() + { + } + + [Obsolete("Property is obsolete", true)] public static int ObsoleteProperty => 1; + + [Obsolete("Event is obsolete", true)] public static event EventHandler ObsoleteEvent; +} + """ |> withName "CSLib" + + let app = + FSharp """ +module StaticFieldAndMethods.FS +Class.ObsoleteField |> ignore +Class.ObsoleteMethod() +Class.ObsoleteProperty |> ignore +Class.ObsoleteEvent |> ignore + """ |> withReferences [CSLib] + + app + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 3, Col 1, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); + (Error 101, Line 4, Col 1, Line 4, Col 21, "This construct is deprecated. Method is obsolete"); + (Error 101, Line 5, Col 1, Line 5, Col 23, "This construct is deprecated. Property is obsolete") + ] From 693bf8c0e5cdc53b4cd35d94c0139b9adb925ac6 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Tue, 16 Aug 2022 20:33:16 +1300 Subject: [PATCH 110/226] AutoOpen Obsolete Attribute (#13695) --- .../ObsoleteAttributeCheckingTests.fs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs index 17d6f02625f..c2fa57509fc 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs @@ -609,6 +609,43 @@ let value2 = class1.A <- 12 (Error 101, Line 8, Col 14, Line 8, Col 22, "This construct is deprecated. member A is deprecated") (Error 101, Line 9, Col 14, Line 9, Col 22, "This construct is deprecated. member A is deprecated") ] + + [] + let ``Obsolete attribute warning is taken into account when a module is is marked as [] but not when calling a function`` () = + Fsx """ +[] +[] +module MyModule = + let testFun () = printfn "test" + +open MyModule + +testFun () + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 7, Col 6, Line 7, Col 14, "This construct is deprecated. This is obsolete") + ] + + [] + let ``Obsolete attribute error is taken into account when a module is is marked as [] but not when calling a function`` () = + Fsx """ +[] +[] +module MyModule = + let testFun () = printfn "test" + +open MyModule + +testFun () + """ + |> ignoreWarnings + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 7, Col 6, Line 7, Col 14, "This construct is deprecated. This is obsolete") + ] [] let ``Obsolete attribute warning is taken into account when used on an C# struct`` () = From e15b0537a5996bbe9c67ed9779850fd0f27fe603 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 16 Aug 2022 19:27:28 +0200 Subject: [PATCH 111/226] Fix: open shadowcopy file stream for RW (#13692) --- src/Compiler/Utilities/FileSystem.fs | 6 ++--- .../Program.fs | 1 + .../Sample_ConsoleApp_net7.fsproj | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 tests/projects/Sample_ConsoleApp_FileSystemTests/Program.fs create mode 100644 tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index 791e829a367..722978e8513 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -530,8 +530,6 @@ type DefaultFileSystem() as this = // We want to use mmaped files only when: // - Opening large binary files (no need to use for source or resource files really) - // - Running on mono, since its MemoryMappedFile implementation throws when "mapName" is not provided (is null). - // (See: https://github.com/mono/mono/issues/10245) if not useMemoryMappedFile then fileStream :> Stream @@ -542,12 +540,12 @@ type DefaultFileSystem() as this = MemoryMappedFile.CreateNew( null, length, - MemoryMappedFileAccess.Read, + MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, HandleInheritability.None ) - use stream = mmf.CreateViewStream(0L, length, MemoryMappedFileAccess.Read) + use stream = mmf.CreateViewStream(0L, length, MemoryMappedFileAccess.ReadWrite) fileStream.CopyTo(stream) fileStream.Dispose() mmf diff --git a/tests/projects/Sample_ConsoleApp_FileSystemTests/Program.fs b/tests/projects/Sample_ConsoleApp_FileSystemTests/Program.fs new file mode 100644 index 00000000000..75e0a053f4f --- /dev/null +++ b/tests/projects/Sample_ConsoleApp_FileSystemTests/Program.fs @@ -0,0 +1 @@ +[] let main _ = 0 diff --git a/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj new file mode 100644 index 00000000000..2b06247db9c --- /dev/null +++ b/tests/projects/Sample_ConsoleApp_FileSystemTests/Sample_ConsoleApp_net7.fsproj @@ -0,0 +1,24 @@ + + + + Exe + net6.0 + true + + + + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Debug/net6.0/fsc.dll + False + True + + + + + + + + + + + From 5b0ba265b5fc1b53ca94520ba3e9f8c7dd42b4cd Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Tue, 16 Aug 2022 20:15:58 +0200 Subject: [PATCH 112/226] Custom equality on ModuleOrNamespaceKind (#13693) --- src/Compiler/TypedTree/TypedTree.fs | 17 ++++++++++ src/Compiler/TypedTree/TypedTree.fsi | 1 + .../ModuleDefinitions/ModuleDefinitions.fs | 33 +++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 39d09093916..b3fcdd6c7d5 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -475,6 +475,7 @@ exception UndefinedName of exception InternalUndefinedItemRef of (string * string * string -> int * string) * string * string * string +[] type ModuleOrNamespaceKind = /// Indicates that a module is compiled to a class with the "Module" suffix added. @@ -488,6 +489,22 @@ type ModuleOrNamespaceKind = /// Indicates that the sourcecode had a namespace. /// If false, this namespace was implicitly constructed during type checking. isExplicit: bool + + override this.Equals other = + match other with + | :? ModuleOrNamespaceKind as kind -> + match this, kind with + | FSharpModuleWithSuffix, FSharpModuleWithSuffix + | ModuleOrType, ModuleOrType + | Namespace _, Namespace _ -> true + | _ -> false + | _ -> false + + override this.GetHashCode () = + match this with + | FSharpModuleWithSuffix -> 0 + | ModuleOrType -> 1 + | Namespace _ -> 2 /// A public path records where a construct lives within the global namespace /// of a CCU. diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 2487daf3517..d55e5e40706 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -294,6 +294,7 @@ exception UndefinedName of depth: int * error: (string -> string) * id: Ident * exception InternalUndefinedItemRef of (string * string * string -> int * string) * string * string * string +[] type ModuleOrNamespaceKind = /// Indicates that a module is compiled to a class with the "Module" suffix added. diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs index af33f5c0f1e..65d694c9647 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs @@ -318,3 +318,36 @@ module ModuleDefinitions = |> withReferences [libFoo2; libFoo1] |> verifyCompileAndRun |> shouldSucceed + + [] + let ``Regression: compilation error with private types in namespace used in a different file`` () = + let types = + """ + namespace FsErrorRepro + + type private Blah = { Number: int } + """ + let example = + """ + [] + module FsErrorRepro.Example + + let dummy (blahNum: int) = + let blah : Blah = { Number = blahNum } + printf $"%i{blah.Number}" + """ + let program = + """ + module FsErrorRepro.Main + + [] + let main _ = + Example.dummy 15 + 0 + """ + + FSharp types + |> withAdditionalSourceFiles [SourceCodeFileKind.Create("example.fs", example) + SourceCodeFileKind.Create("program.fs", program)] + |> compile + |> shouldSucceed From aebdd2871e113f47aae537e138ecec97dfecbb7a Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Tue, 16 Aug 2022 22:50:22 +0200 Subject: [PATCH 113/226] Fix #13686 by upgrading the FsCheck version to next alpha version (stable version is not available on dotnet-public) (#13687) * Fix #13686 by downgrading the FsCheck version * Fix dotnet#13686 by upgrading to latest dotnet-public available alpha version, 3.0.0-apha5 * QuickThrowOnFailure is not a record anymore, but fluid * Revert "QuickThrowOnFailure is not a record anymore, but fluid" This reverts commit fd60e897dcd38c5ebf2028e102412624393ff793. * Revert " Fix dotnet#13686 by upgrading to latest dotnet-public available alpha version, 3.0.0-apha5" This reverts commit 8d0df9afbd20e83e8cbf715b3767e9c5b2a4c5ec. --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 213532c3f88..5662763b742 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -201,7 +201,7 @@ 1.0.0 1.1.33 - 3.0.0-alpha4 + 2.16.5 4.3.0.0 1.0.30 8.0.0 From 0055127f9049501bf623e0eaab8c8c476ad0e0da Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 17 Aug 2022 15:25:20 +0200 Subject: [PATCH 114/226] Fix 13509 (#13694) --- src/Compiler/Checking/CheckExpressions.fs | 4 ++- .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Language/InterpolatedStringsTests.fs | 33 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index d9dea031fe5..fbb57c91dcc 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -7129,7 +7129,9 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn let str = mkString g m printfFormatString if isString then - str, tpenv + TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () -> + str, tpenv + ) else mkCallNewFormat g m printerTy printerArgTy printerResidueTy printerResultTy printerTupleTy str, tpenv else diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index e34bbe845d4..9cb7f248c25 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -157,6 +157,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs new file mode 100644 index 00000000000..14dbb4fd0a1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.ComponentTests.Language + +open System +open Xunit +open FSharp.Test.Compiler + +module InterpolatedStringsTests = + + [] + let ``Regression: Empty Interpolated String properly typechecks with explicit type on binding`` () = + Fsx """ let a:byte = $"string" """ + |> compile + |> shouldFail + |> withSingleDiagnostic (Error 1, Line 1, Col 15, Line 1, Col 24, "This expression was expected to have type" + Environment.NewLine + " 'byte' " + Environment.NewLine + "but here has type" + Environment.NewLine + " 'string' ") + + [] + let ``Interpolated String with hole properly typechecks with explicit type on binding`` () = + Fsx """ let a:byte = $"strin{'g'}" """ + |> compile + |> shouldFail + |> withSingleDiagnostic (Error 1, Line 1, Col 15, Line 1, Col 28, "This expression was expected to have type" + Environment.NewLine + " 'byte' " + Environment.NewLine + "but here has type" + Environment.NewLine + " 'string' ") + + [] + let ``Interpolated String without holes properly typeckecks with explicit type on binding`` () = + Fsx """ +let a: obj = $"string" +let b: System.IComparable = $"string" +let c: System.IFormattable = $"string" + """ + |> compile + |> shouldSucceed \ No newline at end of file From c4e44bf1e6ff5308c7e6cad8364e288a055e38b3 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 17 Aug 2022 16:27:20 +0300 Subject: [PATCH 115/226] Anon union case field range (#13703) --- src/Compiler/Checking/CheckDeclarations.fs | 3 ++- src/Compiler/TypedTree/TypedTreePickle.fs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index b478be9a506..0d9b0df134b 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -438,7 +438,8 @@ module TcRecdUnionAndEnumDeclarations = rfspec let TcAnonFieldDecl cenv env parent tpenv nm (SynField(Attributes attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m)) = - let id = (match idOpt with None -> mkSynId m nm | Some id -> id) + let mName = m.MakeSynthetic() + let id = match idOpt with None -> mkSynId mName nm | Some id -> id let xmlDoc = xmldoc.ToXmlDoc(true, Some []) TcFieldDecl cenv env parent false tpenv (isStatic, attribs, id, idOpt.IsNone, ty, isMutable, xmlDoc, vis, m) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index a02afa72605..c367865dbc2 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -2194,7 +2194,7 @@ and u_recdfield_spec st = rfield_xmldoc= defaultArg xmldoc XmlDoc.Empty rfield_xmldocsig=f rfield_access=g - rfield_name_generated = false + rfield_name_generated = d.idRange.IsSynthetic rfield_other_range = None } and u_rfield_table st = Construct.MakeRecdFieldsTable (u_list u_recdfield_spec st) From 1e88cbf0d2bf09646e3ba377279d76c0f8246c76 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:04:02 +0000 Subject: [PATCH 116/226] [main] Update dependencies from dotnet/arcade (#13708) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 +-- eng/common/cross/build-rootfs.sh | 18 +++++++---- eng/common/generate-locproject.ps1 | 31 ++++++++++++++++-- eng/common/sdk-task.ps1 | 2 +- eng/common/sdl/sdl.ps1 | 37 ++++++++++++++++++++++ eng/common/templates/steps/execute-sdl.yml | 37 ++++++++++------------ eng/common/tools.ps1 | 4 +-- global.json | 6 ++-- 8 files changed, 102 insertions(+), 37 deletions(-) create mode 100644 eng/common/sdl/sdl.ps1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1245a1542d1..adbf7114d31 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 6a638cd0c13962ab2a1943cb1c878be5a41dd82e + 5b838a3ed7f8e53c3082724605e5237fa614a43c diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index d3b0ac3ba7b..032f5f19373 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -76,10 +76,10 @@ __FreeBSDPackages+=" openssl" __FreeBSDPackages+=" krb5" __FreeBSDPackages+=" terminfo-db" -__IllumosPackages="icu-64.2nb2" -__IllumosPackages+=" mit-krb5-1.16.2nb4" -__IllumosPackages+=" openssl-1.1.1e" -__IllumosPackages+=" zlib-1.2.11" +__IllumosPackages="icu" +__IllumosPackages+=" mit-krb5" +__IllumosPackages+=" openssl" +__IllumosPackages+=" zlib" __HaikuPackages="gmp" __HaikuPackages+=" gmp_devel" @@ -390,14 +390,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=http://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl/packages/SmartOS/2020Q1/${__illumosArch}/All" + BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All" + echo "Downloading manifest" + wget "$BaseUrl" echo "Downloading dependencies." read -ra array <<<"$__IllumosPackages" for package in "${array[@]}"; do - echo "Installing $package..." + echo "Installing '$package'" + package="$(grep ">$package-[0-9]" All | sed -En 's/.*href="(.*)\.tgz".*/\1/p')" + echo "Resolved name '$package'" wget "$BaseUrl"/"$package".tgz ar -x "$package".tgz - tar --skip-old-files -xzf "$package".tmp.tgz -C "$__RootfsDir" 2>/dev/null + tar --skip-old-files -xzf "$package".tmp.tg* -C "$__RootfsDir" 2>/dev/null done echo "Cleaning up temporary files." popd diff --git a/eng/common/generate-locproject.ps1 b/eng/common/generate-locproject.ps1 index afdd1750290..846e7950ce9 100644 --- a/eng/common/generate-locproject.ps1 +++ b/eng/common/generate-locproject.ps1 @@ -33,6 +33,8 @@ $jsonTemplateFiles | ForEach-Object { $jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern +$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them + $xlfFiles = @() $allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" @@ -77,8 +79,7 @@ $locJson = @{ CopyOption = "LangIDOnPath" OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" } - } - else { + } else { return @{ SourceFile = $sourceFile CopyOption = "LangIDOnName" @@ -88,6 +89,32 @@ $locJson = @{ } } ) + }, + @{ + CloneLanguageSet = "WiX_CloneLanguages" + LssFiles = @( "wxl_loc.lss" ) + LocItems = @( + $wxlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($outputPath.Contains($exclusion)) + { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if ($continue) + { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + Languages = "cs-CZ;de-DE;es-ES;fr-FR;it-IT;ja-JP;ko-KR;pl-PL;pt-BR;ru-RU;tr-TR;zh-CN;zh-TW" + } + } + } + ) } ) } diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index 119a6c660d1..c35087a0601 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -64,7 +64,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.1.0" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.2.1" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/sdl/sdl.ps1 b/eng/common/sdl/sdl.ps1 new file mode 100644 index 00000000000..ac196e164a4 --- /dev/null +++ b/eng/common/sdl/sdl.ps1 @@ -0,0 +1,37 @@ + +function Install-Gdn { + param( + [string]$Path, + + # If omitted, install the latest version of Guardian, otherwise install that specific version. + [string]$Version + ) + + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + $disableConfigureToolsetImport = $true + $global:LASTEXITCODE = 0 + + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") + + if ($Version) { + $argumentList += "-Version $Version" + } + + Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait + + $gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path + + if (!$gdnCliPath) + { + Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian' + } + + return $gdnCliPath.FullName +} \ No newline at end of file diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 73245593cef..86cf578c431 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -8,29 +8,26 @@ parameters: condition: '' steps: -- ${{ if ne(parameters.overrideGuardianVersion, '') }}: - - powershell: | - $content = Get-Content $(GuardianPackagesConfigFile) - - Write-Host "packages.config content was:`n$content" - - $content = $content.Replace('$(DefaultGuardianVersion)', '$(GuardianVersion)') - $content | Set-Content $(GuardianPackagesConfigFile) - - Write-Host "packages.config content updated to:`n$content" - displayName: Use overridden Guardian version ${{ parameters.overrideGuardianVersion }} +- task: NuGetAuthenticate@1 + inputs: + nuGetServiceConnections: GuardianConnect - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' -- task: NuGetCommand@2 - displayName: 'Install Guardian' - inputs: - restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config - feedsToUse: config - nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config - externalFeedCredentials: GuardianConnect - restoreDirectory: $(Build.SourcesDirectory)\.packages +- ${{ if ne(parameters.overrideGuardianVersion, '') }}: + - pwsh: | + . $(Build.SourcesDirectory)\eng\common\sdl\sdl.ps1 + $guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts -Version ${{ parameters.overrideGuardianVersion }} + Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation" + displayName: Install Guardian (Overridden) + +- ${{ if eq(parameters.overrideGuardianVersion, '') }}: + - pwsh: | + . $(Build.SourcesDirectory)\eng\common\sdl\sdl.ps1 + $guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts + Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation" + displayName: Install Guardian - ${{ if ne(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} ${{ parameters.overrideParameters }} @@ -40,7 +37,7 @@ steps: - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} - -GuardianPackageName Microsoft.Guardian.Cli.$(GuardianVersion) + -GuardianCliLocation $(GuardianCliLocation) -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index f83a748c37e..aba6308ad31 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -365,8 +365,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # If the version of msbuild is going to be xcopied, # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.1.0&view=overview - $defaultXCopyMSBuildVersion = '17.1.0' + # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.2.1&view=overview + $defaultXCopyMSBuildVersion = '17.2.1' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { diff --git a/global.json b/global.json index 12ec23e3058..1975051874d 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "7.0.100-preview.5.22307.18", + "version": "7.0.100-preview.7.22377.5", "allowPrerelease": true, "rollForward": "latestMajor" }, "tools": { - "dotnet": "7.0.100-preview.5.22307.18", + "dotnet": "7.0.100-preview.7.22377.5", "vs": { "version": "17.0", "components": [ @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22416.5", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From c8494ed5f6d4e9271d80f8b5025323d2949eefa8 Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Wed, 17 Aug 2022 18:03:14 -0700 Subject: [PATCH 117/226] Switch to new images on dev/17.4 (#13719) --- azure-pipelines.yml | 2 +- eng/release/insert-into-vs.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c25ca214b70..998ad5c9110 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,7 +105,7 @@ stages: - job: Full_Signed pool: name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals Build.Windows.Amd64.VS2022 + demands: ImageOverride -equals windows.vs2022.amd64 timeoutInMinutes: 300 variables: - group: DotNet-Blob-Feed diff --git a/eng/release/insert-into-vs.yml b/eng/release/insert-into-vs.yml index b662b913366..63973516ba8 100644 --- a/eng/release/insert-into-vs.yml +++ b/eng/release/insert-into-vs.yml @@ -14,8 +14,8 @@ stages: jobs: - job: Insert_VS pool: - name: NetCore1ESPool-Internal - demands: ImageOverride -equals build.windows.10.amd64.vs2019 + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals windows.vs2019.amd64 variables: - group: DotNet-VSTS-Infra-Access - name: InsertAccessToken From 18b58351cfb8bb02154213ecbdc238ef21bad2ab Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Wed, 17 Aug 2022 18:03:48 -0700 Subject: [PATCH 118/226] Switch to new images (#13718) --- azure-pipelines.yml | 4 ++-- eng/release/insert-into-vs.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b6a1fcca389..c66ed2f4a94 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -104,8 +104,8 @@ stages: jobs: - job: Full_Signed pool: - name: NetCore1ESPool-Svc-Internal - demands: ImageOverride -equals Build.Windows.Amd64.VS2022 + name: NetCore1ESPool-Internal + demands: ImageOverride -equals windows.vs2022.amd64 timeoutInMinutes: 300 variables: - group: DotNet-Blob-Feed diff --git a/eng/release/insert-into-vs.yml b/eng/release/insert-into-vs.yml index b662b913366..11bd12be6d3 100644 --- a/eng/release/insert-into-vs.yml +++ b/eng/release/insert-into-vs.yml @@ -15,7 +15,7 @@ stages: - job: Insert_VS pool: name: NetCore1ESPool-Internal - demands: ImageOverride -equals build.windows.10.amd64.vs2019 + demands: ImageOverride -equals windows.vs2019.amd64 variables: - group: DotNet-VSTS-Infra-Access - name: InsertAccessToken From 3bd6eb1438955b3268ea2a6e7fc64e6a353cf914 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 18 Aug 2022 02:24:44 -0700 Subject: [PATCH 119/226] Update roslyn (#13723) --- eng/Versions.props | 2 +- .../UnitTests/Workspace/WorkspaceTests.fs | 524 +++++++++--------- 2 files changed, 263 insertions(+), 263 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 5662763b742..d65df95f9f5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -113,7 +113,7 @@ 6.0.0 4.5.0 - 4.4.0-1.22368.2 + 4.4.0-2.22417.4 17.3.133-preview 17.3.0-preview-1-32407-044 17.0.77-pre-g62a6cb5699 diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index 9b6d7537862..3271017c0d9 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -183,334 +183,334 @@ module WorkspaceTests = let mutable mainProj = mainProj -// interface IFSharpWorkspaceProjectContext with + interface IFSharpWorkspaceProjectContext with -// member _.get_DisplayName() : string = "" + member _.get_DisplayName() : string = "" -// member _.set_DisplayName(value: string) : unit = () + member _.set_DisplayName(value: string) : unit = () -// member _.Dispose(): unit = () + member _.Dispose(): unit = () -// member _.FilePath: string = mainProj.FilePath + member _.FilePath: string = mainProj.FilePath -// member _.HasProjectReference(filePath: string): bool = -// mainProj.ProjectReferences -// |> Seq.exists (fun x -> -// let projRef = mainProj.Solution.GetProject(x.ProjectId) -// if projRef <> null then -// String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) -// else -// false -// ) + member _.HasProjectReference(filePath: string): bool = + mainProj.ProjectReferences + |> Seq.exists (fun x -> + let projRef = mainProj.Solution.GetProject(x.ProjectId) + if projRef <> null then + String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) + else + false + ) -// member _.Id: ProjectId = mainProj.Id + member _.Id: ProjectId = mainProj.Id -// member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() + member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() -// member _.SetProjectReferences(projRefs: seq): unit = -// let currentProj = mainProj -// let mutable solution = currentProj.Solution + member _.SetProjectReferences(projRefs: seq): unit = + let currentProj = mainProj + let mutable solution = currentProj.Solution -// currentProj.ProjectReferences -// |> Seq.iter (fun projRef -> -// solution <- solution.RemoveProjectReference(currentProj.Id, projRef) -// ) + currentProj.ProjectReferences + |> Seq.iter (fun projRef -> + solution <- solution.RemoveProjectReference(currentProj.Id, projRef) + ) -// projRefs -// |> Seq.iter (fun projRef -> -// solution <- -// solution.AddProjectReference( -// currentProj.Id, -// ProjectReference(projRef.Id) -// ) -// ) + projRefs + |> Seq.iter (fun projRef -> + solution <- + solution.AddProjectReference( + currentProj.Id, + ProjectReference(projRef.Id) + ) + ) -// not (solution.Workspace.TryApplyChanges(solution)) |> ignore + not (solution.Workspace.TryApplyChanges(solution)) |> ignore -// mainProj <- solution.GetProject(currentProj.Id) + mainProj <- solution.GetProject(currentProj.Id) -// member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count + member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count -// member _.HasMetadataReference(referencePath: string): bool = -// mainProj.MetadataReferences -// |> Seq.exists (fun x -> -// match x with -// | :? PortableExecutableReference as r -> -// String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) -// | _ -> -// false) + member _.HasMetadataReference(referencePath: string): bool = + mainProj.MetadataReferences + |> Seq.exists (fun x -> + match x with + | :? PortableExecutableReference as r -> + String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) + | _ -> + false) -// member _.SetMetadataReferences(referencePaths: string seq): unit = -// let currentProj = mainProj -// let mutable solution = currentProj.Solution + member _.SetMetadataReferences(referencePaths: string seq): unit = + let currentProj = mainProj + let mutable solution = currentProj.Solution -// currentProj.MetadataReferences -// |> Seq.iter (fun r -> -// solution <- solution.RemoveMetadataReference(currentProj.Id, r) -// ) + currentProj.MetadataReferences + |> Seq.iter (fun r -> + solution <- solution.RemoveMetadataReference(currentProj.Id, r) + ) -// referencePaths -// |> Seq.iter (fun referencePath -> -// solution <- -// solution.AddMetadataReference( -// currentProj.Id, -// PortableExecutableReference.CreateFromFile( -// referencePath, -// MetadataReferenceProperties.Assembly -// ) -// ) -// ) + referencePaths + |> Seq.iter (fun referencePath -> + solution <- + solution.AddMetadataReference( + currentProj.Id, + PortableExecutableReference.CreateFromFile( + referencePath, + MetadataReferenceProperties.Assembly + ) + ) + ) -// not (solution.Workspace.TryApplyChanges(solution)) |> ignore + not (solution.Workspace.TryApplyChanges(solution)) |> ignore -// mainProj <- solution.GetProject(currentProj.Id) + mainProj <- solution.GetProject(currentProj.Id) -// member _.AddMetadataReference(_: string): unit = () -// member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () + member _.AddMetadataReference(_: string): unit = () + member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () -// type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = + type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = -// interface IFSharpWorkspaceProjectContextFactory with -// member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = -// match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with -// | Some docId -> -// let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) -// removeProject miscFilesWorkspace doc.Project.Id -// | _ -> -// () - -// let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) -// addProject workspace projInfo - -// let proj = workspace.CurrentSolution.GetProject(projInfo.Id) -// new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext - -// [] -// let ``Script file opened in misc files workspace will get transferred to normal workspace``() = -// use workspace = createWorkspace() -// use miscFilesWorkspace = createMiscFileWorkspace() -// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - -// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - -// let filePath = -// createOnDiskScript -// """ -//module Script1 - -//let x = 1 -// """ + interface IFSharpWorkspaceProjectContextFactory with + member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = + match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with + | Some docId -> + let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) + removeProject miscFilesWorkspace doc.Project.Id + | _ -> + () + + let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) + addProject workspace projInfo + + let proj = workspace.CurrentSolution.GetProject(projInfo.Id) + new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext + + [] + let ``Script file opened in misc files workspace will get transferred to normal workspace``() = + use workspace = createWorkspace() + use miscFilesWorkspace = createMiscFileWorkspace() + let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + + let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + + let filePath = + createOnDiskScript + """ +module Script1 + +let x = 1 + """ -// try -// let projInfo = createProjectInfoWithFileOnDisk filePath -// addProject miscFilesWorkspace projInfo + try + let projInfo = createProjectInfoWithFileOnDisk filePath + addProject miscFilesWorkspace projInfo -// Assert.IsTrue(hasDocument miscFilesWorkspace filePath) -// Assert.IsFalse(hasDocument workspace filePath) + Assert.IsTrue(hasDocument miscFilesWorkspace filePath) + Assert.IsFalse(hasDocument workspace filePath) -// Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) -// openDocument miscFilesWorkspace filePath + Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) + openDocument miscFilesWorkspace filePath -// // Although we opened the document, it has been transferred to the other workspace. -// Assert.IsFalse(hasDocument miscFilesWorkspace filePath) -// Assert.IsTrue(hasDocument workspace filePath) + // Although we opened the document, it has been transferred to the other workspace. + Assert.IsFalse(hasDocument miscFilesWorkspace filePath) + Assert.IsTrue(hasDocument workspace filePath) -// // Should not be automatically opened when transferred. -// Assert.IsFalse(isDocumentOpen workspace filePath) + // Should not be automatically opened when transferred. + Assert.IsFalse(isDocumentOpen workspace filePath) -// assertEmptyDocumentDiagnostics workspace filePath + assertEmptyDocumentDiagnostics workspace filePath -// finally -// try File.Delete(filePath) with | _ -> () + finally + try File.Delete(filePath) with | _ -> () -// [] -// let ``Script file referencing another script should have no diagnostics``() = -// use workspace = createWorkspace() -// use miscFilesWorkspace = createMiscFileWorkspace() -// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + [] + let ``Script file referencing another script should have no diagnostics``() = + use workspace = createWorkspace() + use miscFilesWorkspace = createMiscFileWorkspace() + let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) -// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) -// let filePath1 = -// createOnDiskScript -// """ -//module Script1 + let filePath1 = + createOnDiskScript + """ +module Script1 -//let x = 1 -// """ +let x = 1 + """ -// let filePath2 = -// createOnDiskScript -// $""" -//module Script2 -//#load "{ Path.GetFileName(filePath1) }" + let filePath2 = + createOnDiskScript + $""" +module Script2 +#load "{ Path.GetFileName(filePath1) }" -//let x = Script1.x -// """ +let x = Script1.x + """ -// try -// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 -// addProject miscFilesWorkspace projInfo2 -// openDocument miscFilesWorkspace filePath2 -// assertEmptyDocumentDiagnostics workspace filePath2 - -// finally -// try File.Delete(filePath1) with | _ -> () -// try File.Delete(filePath2) with | _ -> () - -// [] -// let ``Script file referencing another script will correctly update when the referenced script file changes``() = -// use workspace = createWorkspace() -// use miscFilesWorkspace = createMiscFileWorkspace() -// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - -// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - -// let filePath1 = -// createOnDiskScript -// """ -//module Script1 -// """ - -// let filePath2 = -// createOnDiskScript -// $""" -//module Script2 -//#load "{ Path.GetFileName(filePath1) }" - -//let x = Script1.x -// """ + try + let projInfo2 = createProjectInfoWithFileOnDisk filePath2 + addProject miscFilesWorkspace projInfo2 + openDocument miscFilesWorkspace filePath2 + assertEmptyDocumentDiagnostics workspace filePath2 + + finally + try File.Delete(filePath1) with | _ -> () + try File.Delete(filePath2) with | _ -> () + + [] + let ``Script file referencing another script will correctly update when the referenced script file changes``() = + use workspace = createWorkspace() + use miscFilesWorkspace = createMiscFileWorkspace() + let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + + let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + + let filePath1 = + createOnDiskScript + """ +module Script1 + """ + + let filePath2 = + createOnDiskScript + $""" +module Script2 +#load "{ Path.GetFileName(filePath1) }" + +let x = Script1.x + """ -// try -// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 -// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 + try + let projInfo1 = createProjectInfoWithFileOnDisk filePath1 + let projInfo2 = createProjectInfoWithFileOnDisk filePath2 -// addProject miscFilesWorkspace projInfo1 -// addProject miscFilesWorkspace projInfo2 + addProject miscFilesWorkspace projInfo1 + addProject miscFilesWorkspace projInfo2 -// openDocument miscFilesWorkspace filePath1 -// openDocument miscFilesWorkspace filePath2 + openDocument miscFilesWorkspace filePath1 + openDocument miscFilesWorkspace filePath2 -// assertEmptyDocumentDiagnostics workspace filePath1 -// assertHasDocumentDiagnostics workspace filePath2 - -// updateDocumentOnDisk workspace filePath1 -// """ -//module Script1 - -//let x = 1 -// """ - -// assertEmptyDocumentDiagnostics workspace filePath2 - -// finally -// try File.Delete(filePath1) with | _ -> () -// try File.Delete(filePath2) with | _ -> () + assertEmptyDocumentDiagnostics workspace filePath1 + assertHasDocumentDiagnostics workspace filePath2 -// [] -// let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = -// use workspace = createWorkspace() -// use miscFilesWorkspace = createMiscFileWorkspace() -// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + updateDocumentOnDisk workspace filePath1 + """ +module Script1 -// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) +let x = 1 + """ -// let filePath1 = -// createOnDiskScript -// """ -//module Script1 -// """ + assertEmptyDocumentDiagnostics workspace filePath2 -// let filePath2 = -// createOnDiskScript -// $""" -//module Script2 -//#load "{ Path.GetFileName(filePath1) }" - -//let x = Script1.x -// """ + finally + try File.Delete(filePath1) with | _ -> () + try File.Delete(filePath2) with | _ -> () + + [] + let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = + use workspace = createWorkspace() + use miscFilesWorkspace = createMiscFileWorkspace() + let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + + let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + + let filePath1 = + createOnDiskScript + """ +module Script1 + """ + + let filePath2 = + createOnDiskScript + $""" +module Script2 +#load "{ Path.GetFileName(filePath1) }" + +let x = Script1.x + """ -// try -// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 -// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 + try + let projInfo1 = createProjectInfoWithFileOnDisk filePath1 + let projInfo2 = createProjectInfoWithFileOnDisk filePath2 -// addProject miscFilesWorkspace projInfo1 -// addProject miscFilesWorkspace projInfo2 + addProject miscFilesWorkspace projInfo1 + addProject miscFilesWorkspace projInfo2 -// openDocument miscFilesWorkspace filePath2 -// openDocument miscFilesWorkspace filePath1 + openDocument miscFilesWorkspace filePath2 + openDocument miscFilesWorkspace filePath1 -// assertHasDocumentDiagnostics workspace filePath2 -// assertEmptyDocumentDiagnostics workspace filePath1 + assertHasDocumentDiagnostics workspace filePath2 + assertEmptyDocumentDiagnostics workspace filePath1 -// updateDocumentOnDisk workspace filePath1 -// """ -//module Script1 + updateDocumentOnDisk workspace filePath1 + """ +module Script1 -//let x = 1 -// """ +let x = 1 + """ -// assertEmptyDocumentDiagnostics workspace filePath2 + assertEmptyDocumentDiagnostics workspace filePath2 -// finally -// try File.Delete(filePath1) with | _ -> () -// try File.Delete(filePath2) with | _ -> () + finally + try File.Delete(filePath1) with | _ -> () + try File.Delete(filePath2) with | _ -> () -// [] -// let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = -// use workspace = createWorkspace() -// use miscFilesWorkspace = createMiscFileWorkspace() -// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + [] + let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = + use workspace = createWorkspace() + use miscFilesWorkspace = createMiscFileWorkspace() + let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) -// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) -// let dllPath1 = -// createOnDiskCompiledScriptAsDll workspace -// """ -//module Script1 + let dllPath1 = + createOnDiskCompiledScriptAsDll workspace + """ +module Script1 -//let x = 1 -// """ +let x = 1 + """ -// let filePath1 = -// createOnDiskScript -// $""" -//module Script2 -//#r "{ Path.GetFileName(dllPath1) }" + let filePath1 = + createOnDiskScript + $""" +module Script2 +#r "{ Path.GetFileName(dllPath1) }" -//let x = Script1.x -// """ +let x = Script1.x + """ -// try -// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 + try + let projInfo1 = createProjectInfoWithFileOnDisk filePath1 -// addProject miscFilesWorkspace projInfo1 + addProject miscFilesWorkspace projInfo1 -// openDocument miscFilesWorkspace filePath1 + openDocument miscFilesWorkspace filePath1 -// assertEmptyDocumentDiagnostics workspace filePath1 + assertEmptyDocumentDiagnostics workspace filePath1 -// updateDocumentOnDisk workspace filePath1 -// $""" -//module Script2 -//#r "{ Path.GetFileName(dllPath1) }" + updateDocumentOnDisk workspace filePath1 + $""" +module Script2 +#r "{ Path.GetFileName(dllPath1) }" -//let x = Script1.x -//let y = Script1.y -// """ +let x = Script1.x +let y = Script1.y + """ -// assertHasDocumentDiagnostics workspace filePath1 + assertHasDocumentDiagnostics workspace filePath1 -// updateCompiledDllOnDisk workspace dllPath1 -// """ -//module Script1 + updateCompiledDllOnDisk workspace dllPath1 + """ +module Script1 -//let x = 1 -//let y = 1 -// """ +let x = 1 +let y = 1 + """ -// assertEmptyDocumentDiagnostics workspace filePath1 + assertEmptyDocumentDiagnostics workspace filePath1 -// finally -// try File.Delete(dllPath1) with | _ -> () -// try File.Delete(filePath1) with | _ -> () + finally + try File.Delete(dllPath1) with | _ -> () + try File.Delete(filePath1) with | _ -> () From b8184b122ffed1d8c3932b524fa24d1f261de9b9 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 18 Aug 2022 14:10:10 +0200 Subject: [PATCH 120/226] add some missing code examples to src/FSharp.Core/prim-types.fsi (#13720) * add some missing code examples to xml comments * Add comment to |KeyValue| example --- src/FSharp.Core/prim-types.fsi | 112 ++++++++++++++++++++++++--------- 1 file changed, 83 insertions(+), 29 deletions(-) diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index a2c03fa1025..d0e56e1453d 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -4080,7 +4080,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// cos (0.0 * System.Math.PI) // evaluates to 1.0 + /// cos (0.5 * System.Math.PI) // evaluates to 6.123233996e-17 + /// cos (1.0 * System.Math.PI) // evaluates to -1.0 /// /// /// @@ -4095,7 +4097,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// cosh -1.0 // evaluates to 1.543080635 + /// cosh 0.0 // evaluates to 1.0 + /// cosh 1.0 // evaluates to 1.543080635 /// /// /// @@ -4110,7 +4114,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// sin (0.0 * System.Math.PI) // evaluates to 0.0 + /// sin (0.5 * System.Math.PI) // evaluates to 1.0 + /// sin (1.0 * System.Math.PI) // evaluates to 1.224646799e-16 /// /// /// @@ -4125,7 +4131,9 @@ namespace Microsoft.FSharp.Core /// /// /// - + /// sinh -1.0 // evaluates to -1.175201194 + /// sinh 0.0 // evaluates to 0.0 + /// sinh 1.0 // evaluates to 1.175201194 /// /// /// @@ -4140,7 +4148,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// tan (-0.5 * System.Math.PI) // evaluates to -1.633123935e+16 + /// tan (0.0 * System.Math.PI) // evaluates to 0.0 + /// tan (0.5 * System.Math.PI) // evaluates to 1.633123935e+16 /// /// /// @@ -4155,7 +4165,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// tanh -1.0 // evaluates to -0.761594156 + /// tanh 0.0 // evaluates to 0.0 + /// tanh 1.0 // evaluates to 0.761594156 /// /// /// @@ -4170,7 +4182,8 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// truncate 23.92 // evaluates to 23.0 + /// truncate 23.92f // evaluates to 23.0f /// /// /// @@ -4186,7 +4199,7 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// 2.0 ** 3 // evaluates to 8.0 /// /// /// @@ -4201,7 +4214,7 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// pown 2.0 3 // evaluates to 8.0 /// /// /// @@ -4223,7 +4236,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// byte 'A' // evaluates to 65uy + /// byte 0xff // evaluates to 255uy + /// byte -10 // evaluates to 246uy /// /// /// @@ -4241,7 +4256,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// sbyte 'A' // evaluates to 65y + /// sbyte 0xff // evaluates to -1y + /// sbyte -10 // evaluates to -10y /// /// /// @@ -4259,7 +4276,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// int16 'A' // evaluates to 65s + /// int16 0xff // evaluates to 255s + /// int16 -10 // evaluates to -10s /// /// /// @@ -4277,7 +4296,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// uint16 'A' // evaluates to 65us + /// uint16 0xff // evaluates to 255s + /// uint16 -10 // evaluates to 65526us /// /// /// @@ -4295,7 +4316,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// int 'A' // evaluates to 65 + /// int 0xff // evaluates to 255 + /// int -10 // evaluates to -10 /// /// /// @@ -4313,7 +4336,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// uint 'A' // evaluates to 65u + /// uint 0xff // evaluates to 255u + /// uint -10 // evaluates to 4294967286u /// /// /// @@ -4328,7 +4353,11 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// type Color = + /// | Red = 1 + /// | Green = 2 + /// | Blue = 3 + /// let c: Color = enum 3 // c evaluates to Blue /// /// /// @@ -4346,7 +4375,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// int32 'A' // evaluates to 65 + /// int32 0xff // evaluates to 255 + /// int32 -10 // evaluates to -10 /// /// /// @@ -4364,7 +4395,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// uint32 'A' // evaluates to 65u + /// uint32 0xff // evaluates to 255u + /// uint32 -10 // evaluates to 4294967286u /// /// /// @@ -4382,7 +4415,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// int64 'A' // evaluates to 65L + /// int64 0xff // evaluates to 255L + /// int64 -10 // evaluates to -10L /// /// /// @@ -4400,7 +4435,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// uint64 'A' // evaluates to 65UL + /// uint64 0xff // evaluates to 255UL + /// uint64 -10 // evaluates to 18446744073709551606UL /// /// /// @@ -4418,7 +4455,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// float32 'A' // evaluates to 65.0f + /// float32 0xff // evaluates to 255.0f + /// float32 -10 // evaluates to -10.0f /// /// /// @@ -4436,7 +4475,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// float 'A' // evaluates to 65.0 + /// float 0xff // evaluates to 255.0 + /// float -10 // evaluates to -10.0 /// /// /// @@ -4453,7 +4494,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// nativeint 'A' // evaluates to 65n + /// nativeint 0xff // evaluates to 255n + /// nativeint -10 // evaluates to -10n /// /// /// @@ -4470,7 +4513,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// unativeint 'A' // evaluates to 65un + /// unativeint 0xff // evaluates to 255un + /// unativeint -10 // evaluates to 18446744073709551606un /// /// /// @@ -4479,7 +4524,7 @@ namespace Microsoft.FSharp.Core /// Converts the argument to a string using ToString. /// - /// For standard integer and floating point values the and any type that implements IFormattable + /// For standard integer and floating point values and any type that implements IFormattable /// ToString conversion uses CultureInfo.InvariantCulture. /// The input value. /// @@ -4487,7 +4532,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// string 'A' // evaluates to "A" + /// string 0xff // evaluates to "255" + /// string -10 // evaluates to "-10" /// /// /// @@ -4505,7 +4552,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// decimal "42.23" // evaluates to 42.23M + /// decimal 0xff // evaluates to 255M + /// decimal -10 // evaluates to -10M /// /// /// @@ -4522,7 +4571,9 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// char "A" // evaluates to 'A' + /// char 0x41 // evaluates to 'A' + /// char 65 // evaluates to 'A' /// /// /// @@ -4537,7 +4588,10 @@ namespace Microsoft.FSharp.Core /// /// /// - /// + /// let kv = System.Collections.Generic.KeyValuePair(42, "the answer") + /// match kv with // evaluates to "found it" + /// | KeyValue (42, v) -> "found it" + /// | KeyValue (k, v) -> "keep waiting" /// /// /// From bd46f3233e3991eb476d4dc50619be1b476531ea Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:58:33 +0000 Subject: [PATCH 121/226] Update dependencies from https://github.com/dotnet/arcade build 20220817.2 (#13726) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22416.5 -> To Version 7.0.0-beta.22417.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index adbf7114d31..8f6018752d5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 5b838a3ed7f8e53c3082724605e5237fa614a43c + 21a53708b4645c64259b3883dac7709ddfa19fe8 diff --git a/global.json b/global.json index 1975051874d..0ac3616abca 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22416.5", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22417.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 8e339bc4a7f2111823255cbcc1d3639853609440 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 19 Aug 2022 13:16:20 +0200 Subject: [PATCH 122/226] Update xcopy-msbuild to fix signed builds (#13729) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1975051874d..e92180e8903 100644 --- a/global.json +++ b/global.json @@ -12,7 +12,7 @@ "Microsoft.VisualStudio.Component.FSharp" ] }, - "xcopy-msbuild": "17.1.0" + "xcopy-msbuild": "17.2.1" }, "native-tools": { "perl": "5.32.1.1" From 86c038cf9db34422b26e1e4f8ad639a9910b2c21 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 19 Aug 2022 20:29:02 +0200 Subject: [PATCH 123/226] Revert "Update roslyn components used by F#" (#13734) This reverts commit 3bd6eb1438955b3268ea2a6e7fc64e6a353cf914. --- eng/Versions.props | 2 +- .../UnitTests/Workspace/WorkspaceTests.fs | 524 +++++++++--------- 2 files changed, 263 insertions(+), 263 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index d65df95f9f5..5662763b742 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -113,7 +113,7 @@ 6.0.0 4.5.0 - 4.4.0-2.22417.4 + 4.4.0-1.22368.2 17.3.133-preview 17.3.0-preview-1-32407-044 17.0.77-pre-g62a6cb5699 diff --git a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs index 3271017c0d9..9b6d7537862 100644 --- a/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs +++ b/vsintegration/tests/UnitTests/Workspace/WorkspaceTests.fs @@ -183,334 +183,334 @@ module WorkspaceTests = let mutable mainProj = mainProj - interface IFSharpWorkspaceProjectContext with +// interface IFSharpWorkspaceProjectContext with - member _.get_DisplayName() : string = "" +// member _.get_DisplayName() : string = "" - member _.set_DisplayName(value: string) : unit = () +// member _.set_DisplayName(value: string) : unit = () - member _.Dispose(): unit = () +// member _.Dispose(): unit = () - member _.FilePath: string = mainProj.FilePath +// member _.FilePath: string = mainProj.FilePath - member _.HasProjectReference(filePath: string): bool = - mainProj.ProjectReferences - |> Seq.exists (fun x -> - let projRef = mainProj.Solution.GetProject(x.ProjectId) - if projRef <> null then - String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) - else - false - ) +// member _.HasProjectReference(filePath: string): bool = +// mainProj.ProjectReferences +// |> Seq.exists (fun x -> +// let projRef = mainProj.Solution.GetProject(x.ProjectId) +// if projRef <> null then +// String.Equals(filePath, projRef.FilePath, StringComparison.OrdinalIgnoreCase) +// else +// false +// ) - member _.Id: ProjectId = mainProj.Id +// member _.Id: ProjectId = mainProj.Id - member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() +// member _.ProjectReferenceCount: int = mainProj.ProjectReferences.Count() - member _.SetProjectReferences(projRefs: seq): unit = - let currentProj = mainProj - let mutable solution = currentProj.Solution +// member _.SetProjectReferences(projRefs: seq): unit = +// let currentProj = mainProj +// let mutable solution = currentProj.Solution - currentProj.ProjectReferences - |> Seq.iter (fun projRef -> - solution <- solution.RemoveProjectReference(currentProj.Id, projRef) - ) +// currentProj.ProjectReferences +// |> Seq.iter (fun projRef -> +// solution <- solution.RemoveProjectReference(currentProj.Id, projRef) +// ) - projRefs - |> Seq.iter (fun projRef -> - solution <- - solution.AddProjectReference( - currentProj.Id, - ProjectReference(projRef.Id) - ) - ) +// projRefs +// |> Seq.iter (fun projRef -> +// solution <- +// solution.AddProjectReference( +// currentProj.Id, +// ProjectReference(projRef.Id) +// ) +// ) - not (solution.Workspace.TryApplyChanges(solution)) |> ignore +// not (solution.Workspace.TryApplyChanges(solution)) |> ignore - mainProj <- solution.GetProject(currentProj.Id) +// mainProj <- solution.GetProject(currentProj.Id) - member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count +// member _.MetadataReferenceCount: int = mainProj.MetadataReferences.Count - member _.HasMetadataReference(referencePath: string): bool = - mainProj.MetadataReferences - |> Seq.exists (fun x -> - match x with - | :? PortableExecutableReference as r -> - String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) - | _ -> - false) +// member _.HasMetadataReference(referencePath: string): bool = +// mainProj.MetadataReferences +// |> Seq.exists (fun x -> +// match x with +// | :? PortableExecutableReference as r -> +// String.Equals(r.FilePath, referencePath, StringComparison.OrdinalIgnoreCase) +// | _ -> +// false) - member _.SetMetadataReferences(referencePaths: string seq): unit = - let currentProj = mainProj - let mutable solution = currentProj.Solution +// member _.SetMetadataReferences(referencePaths: string seq): unit = +// let currentProj = mainProj +// let mutable solution = currentProj.Solution - currentProj.MetadataReferences - |> Seq.iter (fun r -> - solution <- solution.RemoveMetadataReference(currentProj.Id, r) - ) +// currentProj.MetadataReferences +// |> Seq.iter (fun r -> +// solution <- solution.RemoveMetadataReference(currentProj.Id, r) +// ) - referencePaths - |> Seq.iter (fun referencePath -> - solution <- - solution.AddMetadataReference( - currentProj.Id, - PortableExecutableReference.CreateFromFile( - referencePath, - MetadataReferenceProperties.Assembly - ) - ) - ) +// referencePaths +// |> Seq.iter (fun referencePath -> +// solution <- +// solution.AddMetadataReference( +// currentProj.Id, +// PortableExecutableReference.CreateFromFile( +// referencePath, +// MetadataReferenceProperties.Assembly +// ) +// ) +// ) - not (solution.Workspace.TryApplyChanges(solution)) |> ignore +// not (solution.Workspace.TryApplyChanges(solution)) |> ignore - mainProj <- solution.GetProject(currentProj.Id) +// mainProj <- solution.GetProject(currentProj.Id) - member _.AddMetadataReference(_: string): unit = () - member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () +// member _.AddMetadataReference(_: string): unit = () +// member _.AddSourceFile(_: string, _: SourceCodeKind): unit = () - type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = +// type TestFSharpWorkspaceProjectContextFactory(workspace: Workspace, miscFilesWorkspace: Workspace) = - interface IFSharpWorkspaceProjectContextFactory with - member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = - match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with - | Some docId -> - let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) - removeProject miscFilesWorkspace doc.Project.Id - | _ -> - () - - let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) - addProject workspace projInfo - - let proj = workspace.CurrentSolution.GetProject(projInfo.Id) - new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext - - [] - let ``Script file opened in misc files workspace will get transferred to normal workspace``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath = - createOnDiskScript - """ -module Script1 - -let x = 1 - """ +// interface IFSharpWorkspaceProjectContextFactory with +// member _.CreateProjectContext(filePath: string, uniqueName: string): IFSharpWorkspaceProjectContext = +// match miscFilesWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath) |> Seq.tryExactlyOne with +// | Some docId -> +// let doc = miscFilesWorkspace.CurrentSolution.GetDocument(docId) +// removeProject miscFilesWorkspace doc.Project.Id +// | _ -> +// () + +// let projInfo = RoslynTestHelpers.CreateProjectInfoWithSingleDocument(FSharpConstants.FSharpMiscellaneousFilesName, filePath) +// addProject workspace projInfo + +// let proj = workspace.CurrentSolution.GetProject(projInfo.Id) +// new TestFSharpWorkspaceProjectContext(proj) :> IFSharpWorkspaceProjectContext + +// [] +// let ``Script file opened in misc files workspace will get transferred to normal workspace``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath = +// createOnDiskScript +// """ +//module Script1 + +//let x = 1 +// """ - try - let projInfo = createProjectInfoWithFileOnDisk filePath - addProject miscFilesWorkspace projInfo +// try +// let projInfo = createProjectInfoWithFileOnDisk filePath +// addProject miscFilesWorkspace projInfo - Assert.IsTrue(hasDocument miscFilesWorkspace filePath) - Assert.IsFalse(hasDocument workspace filePath) +// Assert.IsTrue(hasDocument miscFilesWorkspace filePath) +// Assert.IsFalse(hasDocument workspace filePath) - Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) - openDocument miscFilesWorkspace filePath +// Assert.IsFalse(isDocumentOpen miscFilesWorkspace filePath) +// openDocument miscFilesWorkspace filePath - // Although we opened the document, it has been transferred to the other workspace. - Assert.IsFalse(hasDocument miscFilesWorkspace filePath) - Assert.IsTrue(hasDocument workspace filePath) +// // Although we opened the document, it has been transferred to the other workspace. +// Assert.IsFalse(hasDocument miscFilesWorkspace filePath) +// Assert.IsTrue(hasDocument workspace filePath) - // Should not be automatically opened when transferred. - Assert.IsFalse(isDocumentOpen workspace filePath) +// // Should not be automatically opened when transferred. +// Assert.IsFalse(isDocumentOpen workspace filePath) - assertEmptyDocumentDiagnostics workspace filePath +// assertEmptyDocumentDiagnostics workspace filePath - finally - try File.Delete(filePath) with | _ -> () +// finally +// try File.Delete(filePath) with | _ -> () - [] - let ``Script file referencing another script should have no diagnostics``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) +// [] +// let ``Script file referencing another script should have no diagnostics``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - let filePath1 = - createOnDiskScript - """ -module Script1 +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" -let x = Script1.x - """ +//let x = Script1.x +// """ - try - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath2 - - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () - - [] - let ``Script file referencing another script will correctly update when the referenced script file changes``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath1 = - createOnDiskScript - """ -module Script1 - """ - - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" - -let x = Script1.x - """ +// try +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// addProject miscFilesWorkspace projInfo2 +// openDocument miscFilesWorkspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 + +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () + +// [] +// let ``Script file referencing another script will correctly update when the referenced script file changes``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 +// """ + +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" + +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo1 - addProject miscFilesWorkspace projInfo2 +// addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath1 - openDocument miscFilesWorkspace filePath2 +// openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath1 - assertHasDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath2 - updateDocumentOnDisk workspace filePath1 - """ -module Script1 +// updateDocumentOnDisk workspace filePath1 +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () - - [] - let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - - let filePath1 = - createOnDiskScript - """ -module Script1 - """ - - let filePath2 = - createOnDiskScript - $""" -module Script2 -#load "{ Path.GetFileName(filePath1) }" - -let x = Script1.x - """ +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () + +// [] +// let ``Script file referencing another script will correctly update when the referenced script file changes with opening in reverse order``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) + +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) + +// let filePath1 = +// createOnDiskScript +// """ +//module Script1 +// """ + +// let filePath2 = +// createOnDiskScript +// $""" +//module Script2 +//#load "{ Path.GetFileName(filePath1) }" + +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - let projInfo2 = createProjectInfoWithFileOnDisk filePath2 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// let projInfo2 = createProjectInfoWithFileOnDisk filePath2 - addProject miscFilesWorkspace projInfo1 - addProject miscFilesWorkspace projInfo2 +// addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo2 - openDocument miscFilesWorkspace filePath2 - openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath2 +// openDocument miscFilesWorkspace filePath1 - assertHasDocumentDiagnostics workspace filePath2 - assertEmptyDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath1 - updateDocumentOnDisk workspace filePath1 - """ -module Script1 +// updateDocumentOnDisk workspace filePath1 +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath2 +// assertEmptyDocumentDiagnostics workspace filePath2 - finally - try File.Delete(filePath1) with | _ -> () - try File.Delete(filePath2) with | _ -> () +// finally +// try File.Delete(filePath1) with | _ -> () +// try File.Delete(filePath2) with | _ -> () - [] - let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = - use workspace = createWorkspace() - use miscFilesWorkspace = createMiscFileWorkspace() - let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) +// [] +// let ``Script file referencing a DLL will correctly update when the referenced DLL file changes``() = +// use workspace = createWorkspace() +// use miscFilesWorkspace = createMiscFileWorkspace() +// let projectContextFactory = TestFSharpWorkspaceProjectContextFactory(workspace, miscFilesWorkspace) - let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) +// let _miscFileService = FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory) - let dllPath1 = - createOnDiskCompiledScriptAsDll workspace - """ -module Script1 +// let dllPath1 = +// createOnDiskCompiledScriptAsDll workspace +// """ +//module Script1 -let x = 1 - """ +//let x = 1 +// """ - let filePath1 = - createOnDiskScript - $""" -module Script2 -#r "{ Path.GetFileName(dllPath1) }" +// let filePath1 = +// createOnDiskScript +// $""" +//module Script2 +//#r "{ Path.GetFileName(dllPath1) }" -let x = Script1.x - """ +//let x = Script1.x +// """ - try - let projInfo1 = createProjectInfoWithFileOnDisk filePath1 +// try +// let projInfo1 = createProjectInfoWithFileOnDisk filePath1 - addProject miscFilesWorkspace projInfo1 +// addProject miscFilesWorkspace projInfo1 - openDocument miscFilesWorkspace filePath1 +// openDocument miscFilesWorkspace filePath1 - assertEmptyDocumentDiagnostics workspace filePath1 +// assertEmptyDocumentDiagnostics workspace filePath1 - updateDocumentOnDisk workspace filePath1 - $""" -module Script2 -#r "{ Path.GetFileName(dllPath1) }" +// updateDocumentOnDisk workspace filePath1 +// $""" +//module Script2 +//#r "{ Path.GetFileName(dllPath1) }" -let x = Script1.x -let y = Script1.y - """ +//let x = Script1.x +//let y = Script1.y +// """ - assertHasDocumentDiagnostics workspace filePath1 +// assertHasDocumentDiagnostics workspace filePath1 - updateCompiledDllOnDisk workspace dllPath1 - """ -module Script1 +// updateCompiledDllOnDisk workspace dllPath1 +// """ +//module Script1 -let x = 1 -let y = 1 - """ +//let x = 1 +//let y = 1 +// """ - assertEmptyDocumentDiagnostics workspace filePath1 +// assertEmptyDocumentDiagnostics workspace filePath1 - finally - try File.Delete(dllPath1) with | _ -> () - try File.Delete(filePath1) with | _ -> () +// finally +// try File.Delete(dllPath1) with | _ -> () +// try File.Delete(filePath1) with | _ -> () From 75e1f5f1900a351ca036081cf2d1ed453ddf5ef1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:29:23 +0200 Subject: [PATCH 124/226] [main] Update dependencies from dotnet/arcade (#13732) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8f6018752d5..0a1b8197355 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 21a53708b4645c64259b3883dac7709ddfa19fe8 + 0c027eede69ba22bafca9a1955f1e00848655ece diff --git a/global.json b/global.json index 0ac3616abca..718d4015f3f 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22417.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22418.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From c55d53992c773ac9eda2179e2605d8157982391a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 13:57:38 +0000 Subject: [PATCH 125/226] Update dependencies from https://github.com/dotnet/arcade build 20220819.1 (#13738) Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22418.4 -> To Version 7.0.0-beta.22419.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0a1b8197355..b047ecdae7f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,9 +8,9 @@ - + https://github.com/dotnet/arcade - 0c027eede69ba22bafca9a1955f1e00848655ece + 34dff939b4a91e4693f78a856e0e055c1a3f3fba diff --git a/global.json b/global.json index 718d4015f3f..9d3ac79cf22 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22418.4", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22419.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From e0927a28fac77d3a37164a4582ad25f7fa68aadc Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sun, 21 Aug 2022 00:04:00 +0100 Subject: [PATCH 126/226] stop using batch mdoe (#13742) --- src/fsc/fscmain.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 9cd6e63df1c..15f607b7656 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -34,8 +34,6 @@ let main (argv) = else "fsc.exe" - // Set the garbage collector to batch mode, which improves overall performance. - GCSettings.LatencyMode <- GCLatencyMode.Batch Thread.CurrentThread.Name <- "F# Main Thread" // Set the initial phase to garbage collector to batch mode, which improves overall performance. From af0015e5cac978bef2aa10264f63c886a2532bda Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 22 Aug 2022 10:56:12 +0100 Subject: [PATCH 127/226] Reflection free code gen (#12960) Added --reflectionfree compiler flag to avoid %A string formatting --- src/Compiler/Checking/CheckFormatStrings.fs | 3 + src/Compiler/CodeGen/IlxGen.fs | 121 +++++++------- src/Compiler/CodeGen/IlxGen.fsi | 3 + src/Compiler/Driver/CompilerConfig.fs | 5 + src/Compiler/Driver/CompilerConfig.fsi | 3 + src/Compiler/Driver/CompilerImports.fs | 1 + src/Compiler/Driver/CompilerOptions.fs | 7 + src/Compiler/Driver/OptimizeInputs.fs | 1 + src/Compiler/FSComp.txt | 2 + src/Compiler/TypedTree/TcGlobals.fs | 3 + src/Compiler/xlf/FSComp.txt.cs.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.de.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.es.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 10 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 10 ++ src/FSharp.Build/FSharp.Build.fsproj | 2 + src/FSharp.Build/Fsc.fs | 8 + src/FSharp.Build/Fsi.fs | 4 + .../Microsoft.FSharp.NetSdk.props | 1 + src/FSharp.Build/Microsoft.FSharp.Targets | 1 + .../CompilerOptions/fsc/reflectionfree.fs | 53 ++++++ .../InequalityComparison02.fs.il.bsl | 4 +- .../FSharp.Compiler.ComponentTests.fsproj | 1 + tests/FSharp.Test.Utilities/Compiler.fs | 8 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 66 ++++---- tests/FSharp.Test.Utilities/ILChecker.fs | 158 +++++++++--------- .../fsc/help/help40.437.1033.bsl | 2 + .../fsi/exename/help40.437.1033.bsl | 2 + .../fsi/help/help40-nologo.437.1033.bsl | 2 + .../fsi/help/help40.437.1033.bsl | 2 + 38 files changed, 424 insertions(+), 169 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reflectionfree.fs diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index 31471ba32b2..8652e305761 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -444,6 +444,9 @@ let parseFormatStringInternal parseLoop ((posi, NewInferenceType g) :: acc) (i, fragLine, startFragCol) fragments | 'A' -> + if g.useReflectionFreeCodeGen then + failwith (FSComp.SR.forPercentAInReflectionFreeCode()) + match info.numPrefixIfPos with | None // %A has BindingFlags=Public, %+A has BindingFlags=Public | NonPublic | Some '+' -> diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 753e7772676..19f6de28fd1 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -288,6 +288,9 @@ type IlxGenOptions = /// storage, even though 'it' is not logically mutable isInteractiveItExpr: bool + /// Suppress ToString emit + useReflectionFreeCodeGen: bool + /// Whenever possible, use callvirt instead of call alwaysCallVirt: bool } @@ -10449,64 +10452,65 @@ and GenPrintingMethod cenv eenv methName ilThisTy m = let g = cenv.g [ - match (eenv.valsInScope.TryFind g.sprintf_vref.Deref, eenv.valsInScope.TryFind g.new_format_vref.Deref) with - | Some (Lazy (Method (_, _, sprintfMethSpec, _, _, _, _, _, _, _, _, _))), - Some (Lazy (Method (_, _, newFormatMethSpec, _, _, _, _, _, _, _, _, _))) -> - // The type returned by the 'sprintf' call - let funcTy = EraseClosures.mkILFuncTy cenv.ilxPubCloEnv ilThisTy g.ilg.typ_String - - // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat - let newFormatMethSpec = - mkILMethSpec ( - newFormatMethSpec.MethodRef, - AsObject, - [ // 'T -> string' - funcTy - // rest follow from 'StringFormat' - GenUnitTy cenv eenv m - g.ilg.typ_String - g.ilg.typ_String - ilThisTy - ], - [] - ) - - // Instantiate with our own type - let sprintfMethSpec = - mkILMethSpec (sprintfMethSpec.MethodRef, AsObject, [], [ funcTy ]) + if not g.useReflectionFreeCodeGen then + match (eenv.valsInScope.TryFind g.sprintf_vref.Deref, eenv.valsInScope.TryFind g.new_format_vref.Deref) with + | Some (Lazy (Method (_, _, sprintfMethSpec, _, _, _, _, _, _, _, _, _))), + Some (Lazy (Method (_, _, newFormatMethSpec, _, _, _, _, _, _, _, _, _))) -> + // The type returned by the 'sprintf' call + let funcTy = EraseClosures.mkILFuncTy cenv.ilxPubCloEnv ilThisTy g.ilg.typ_String + + // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat + let newFormatMethSpec = + mkILMethSpec ( + newFormatMethSpec.MethodRef, + AsObject, + [ // 'T -> string' + funcTy + // rest follow from 'StringFormat' + GenUnitTy cenv eenv m + g.ilg.typ_String + g.ilg.typ_String + ilThisTy + ], + [] + ) - // Here's the body of the method. Call printf, then invoke the function it returns - let callInstrs = - EraseClosures.mkCallFunc - cenv.ilxPubCloEnv - (fun _ -> 0us) - eenv.tyenv.Count - Normalcall - (Apps_app(ilThisTy, Apps_done g.ilg.typ_String)) - - let ilInstrs = - [ // load the hardwired format string - I_ldstr "%+A" - // make the printf format object - mkNormalNewobj newFormatMethSpec - // call sprintf - mkNormalCall sprintfMethSpec - // call the function returned by sprintf - mkLdarg0 - if ilThisTy.Boxity = ILBoxity.AsValue then - mkNormalLdobj ilThisTy - yield! callInstrs - ] + // Instantiate with our own type + let sprintfMethSpec = + mkILMethSpec (sprintfMethSpec.MethodRef, AsObject, [], [ funcTy ]) + + // Here's the body of the method. Call printf, then invoke the function it returns + let callInstrs = + EraseClosures.mkCallFunc + cenv.ilxPubCloEnv + (fun _ -> 0us) + eenv.tyenv.Count + Normalcall + (Apps_app(ilThisTy, Apps_done g.ilg.typ_String)) + + let ilInstrs = + [ // load the hardwired format string + I_ldstr "%+A" + // make the printf format object + mkNormalNewobj newFormatMethSpec + // call sprintf + mkNormalCall sprintfMethSpec + // call the function returned by sprintf + mkLdarg0 + if ilThisTy.Boxity = ILBoxity.AsValue then + mkNormalLdobj ilThisTy + yield! callInstrs + ] - let ilMethodBody = - mkMethodBody (true, [], 2, nonBranchingInstrsToCode ilInstrs, None, eenv.imports) + let ilMethodBody = + mkMethodBody (true, [], 2, nonBranchingInstrsToCode ilInstrs, None, eenv.imports) - let mdef = - mkILNonGenericVirtualInstanceMethod (methName, ILMemberAccess.Public, [], mkILReturn g.ilg.typ_String, ilMethodBody) + let mdef = + mkILNonGenericVirtualInstanceMethod (methName, ILMemberAccess.Public, [], mkILReturn g.ilg.typ_String, ilMethodBody) - let mdef = mdef.With(customAttrs = mkILCustomAttrs [ g.CompilerGeneratedAttribute ]) - yield mdef - | _ -> () + let mdef = mdef.With(customAttrs = mkILCustomAttrs [ g.CompilerGeneratedAttribute ]) + yield mdef + | _ -> () ] and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = @@ -10646,6 +10650,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let tyconRepr = tycon.TypeReprInfo + let reprAccess = ComputeMemberAccess hiddenRepr + // DebugDisplayAttribute gets copied to the subtypes generated as part of DU compilation let debugDisplayAttrs, normalAttrs = tycon.Attribs @@ -10656,7 +10662,10 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = |> List.partition (fun a -> IsSecurityAttribute g cenv.amap cenv.casApplied a m) let generateDebugDisplayAttribute = - not g.compilingFSharpCore && tycon.IsUnionTycon && isNil debugDisplayAttrs + not g.useReflectionFreeCodeGen + && not g.compilingFSharpCore + && tycon.IsUnionTycon + && isNil debugDisplayAttrs let generateDebugProxies = not (tyconRefEq g tcref g.unit_tcr_canon) @@ -10687,8 +10696,6 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = yield! ilDebugDisplayAttributes ] - let reprAccess = ComputeMemberAccess hiddenRepr - let ilTypeDefKind = match tyconRepr with | TFSharpObjectRepr o -> diff --git a/src/Compiler/CodeGen/IlxGen.fsi b/src/Compiler/CodeGen/IlxGen.fsi index 8d6ea6d8a65..d68463e9ca7 100644 --- a/src/Compiler/CodeGen/IlxGen.fsi +++ b/src/Compiler/CodeGen/IlxGen.fsi @@ -54,6 +54,9 @@ type internal IlxGenOptions = /// storage, even though 'it' is not logically mutable isInteractiveItExpr: bool + /// Suppress ToString emit + useReflectionFreeCodeGen: bool + /// Indicates that, whenever possible, use callvirt instead of call alwaysCallVirt: bool } diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 88db6a031c2..38c67e917f6 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -527,6 +527,9 @@ type TcConfigBuilder = /// If true, strip away data that would not be of use to end users, but is useful to us for debugging mutable noDebugAttributes: bool + /// If true, do not emit ToString implementations for unions, records, structs, exceptions + mutable useReflectionFreeCodeGen: bool + /// If true, indicates all type checking and code generation is in the context of fsi.exe isInteractive: bool @@ -730,6 +733,7 @@ type TcConfigBuilder = pause = false alwaysCallVirt = true noDebugAttributes = false + useReflectionFreeCodeGen = false emitDebugInfoInQuotations = false exename = None shadowCopyReferences = false @@ -1279,6 +1283,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.pause = data.pause member _.alwaysCallVirt = data.alwaysCallVirt member _.noDebugAttributes = data.noDebugAttributes + member _.useReflectionFreeCodeGen = data.useReflectionFreeCodeGen member _.isInteractive = data.isInteractive member _.isInvalidationSupported = data.isInvalidationSupported member _.emitDebugInfoInQuotations = data.emitDebugInfoInQuotations diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 0524261c5c8..0ac2d8a0e86 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -431,6 +431,8 @@ type TcConfigBuilder = mutable noDebugAttributes: bool + mutable useReflectionFreeCodeGen: bool + /// If true, indicates all type checking and code generation is in the context of fsi.exe isInteractive: bool @@ -740,6 +742,7 @@ type TcConfig = member alwaysCallVirt: bool member noDebugAttributes: bool + member useReflectionFreeCodeGen: bool /// If true, indicates all type checking and code generation is in the context of fsi.exe member isInteractive: bool diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 60722df6c9d..7d453dace33 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -2410,6 +2410,7 @@ and [] TcImports tcConfig.implicitIncludeDir, tcConfig.mlCompatibility, tcConfig.isInteractive, + tcConfig.useReflectionFreeCodeGen, tryFindSysTypeCcu, tcConfig.emitDebugInfoInQuotations, tcConfig.noDebugAttributes, diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 90fa3728838..c2e89e7c2c2 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1054,6 +1054,13 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = Some(FSComp.SR.optsCrossoptimize ()) ) + CompilerOption( + "reflectionfree", + tagNone, + OptionUnit(fun () -> tcConfigB.useReflectionFreeCodeGen <- true), + None, + Some(FSComp.SR.optsReflectionFree ()) + ) ] if isFsi then debug @ codegen else debug @ embed @ codegen diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index 299bb1a8886..0696758780b 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -251,6 +251,7 @@ let GenerateIlxCode mainMethodInfo = mainMethodInfo ilxBackend = ilxBackend fsiMultiAssemblyEmit = tcConfig.fsiMultiAssemblyEmit + useReflectionFreeCodeGen = tcConfig.useReflectionFreeCodeGen isInteractive = tcConfig.isInteractive isInteractiveItExpr = isInteractiveItExpr alwaysCallVirt = tcConfig.alwaysCallVirt diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 19f7d040b46..c749444f32c 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -235,6 +235,7 @@ forLIsUnnecessary,"The 'l' or 'L' in this format specifier is unnecessary. In F# forHIsUnnecessary,"The 'h' or 'H' in this format specifier is unnecessary. You can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types." forDoesNotSupportPrefixFlag,"'%s' does not support prefix '%s' flag" forBadFormatSpecifierGeneral,"Bad format specifier: '%s'" +forPercentAInReflectionFreeCode,"The '%%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection." elSysEnvExitDidntExit,"System.Environment.Exit did not exit" elDeprecatedOperator,"The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined" 405,chkProtectedOrBaseCalled,"A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope." @@ -873,6 +874,7 @@ optsRefOnly,"Produce a reference assembly, instead of a full assembly, as the pr optsRefOut,"Produce a reference assembly with the specified file path." optsPathMap,"Maps physical paths to source path names output by the compiler" optsCrossoptimize,"Enable or disable cross-module optimizations" +optsReflectionFree,"Disable implicit generation of constructs using reflection" optsWarnaserrorPM,"Report all warnings as errors" optsWarnaserror,"Report specific warnings as errors" optsWarn,"Set a warning level (0-5)" diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index a38d87199e0..9ab7cf2f723 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -191,6 +191,7 @@ type TcGlobals( directoryToResolveRelativePaths, mlCompatibility: bool, isInteractive: bool, + useReflectionFreeCodeGen: bool, // The helper to find system types amongst referenced DLLs tryFindSysTypeCcu, emitDebugInfoInQuotations: bool, @@ -1004,6 +1005,8 @@ type TcGlobals( member _.compilingFSharpCore = compilingFSharpCore + member _.useReflectionFreeCodeGen = useReflectionFreeCodeGen + member _.mlCompatibility = mlCompatibility member _.emitDebugInfoInQuotations = emitDebugInfoInQuotations diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index d02d7fb9305..8c2f6fe5f54 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -327,6 +327,11 @@ Interpolované řetězce, které se používají jako typ IFormattable nebo FormattableString, nemůžou používat specifikátory %. Použít je možné jen interpolované výrazy ve stylu .NET, třeba {{expr}}, {{expr,3}} nebo {{expr:N5}}. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Vytvoří referenční sestavení se zadanou cestou k souboru. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Podporované jazykové verze: diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index a61342cb5b8..68e2a3f1eb7 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -327,6 +327,11 @@ Interpolierte Zeichenfolgen, die als Typ "IFormattable" oder "FormattableString" verwendet werden, dürfen keine Spezifizierer vom Typ "%" verwenden. Es dürfen nur Interpolanten im .NET-Format wie "{{expr}}", "{{expr,3}}" oder "{{expr:N5}}" verwendet werden. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} – {0} @@ -497,6 +502,11 @@ Erstellen Sie eine Referenzassembly mit dem angegebenen Dateipfad. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Unterstützte Sprachversionen: diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 03d20b0376a..bea08c9779f 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -327,6 +327,11 @@ Las cadenas interpoladas que se usan como tipo IFormattable o FormattableString no pueden usar los especificadores "%"; solo pueden utilizar operandos de interpolación de estilo .NET, como "{{expr}}", "{{expr,3}}" o "{{expr:N5}}". + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Genera un ensamblado de referencia con la ruta de acceso de archivo especificada. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Versiones de lenguaje admitidas: diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 2cf068a9b87..227a9b0bd32 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -327,6 +327,11 @@ Les chaînes interpolées utilisées en tant que type IFormattable ou FormattableString ne peuvent pas utiliser les spécificateurs '%'. Seuls les spécificateurs de style .NET tels que '{{expr}}', '{{expr,3}}' et '{{expr:N5}}' peuvent être utilisés. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Produire un assembly de référence avec le chemin de fichier spécifié + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Versions linguistiques prises en charge : diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 60c7d9e259e..4ebe76e823c 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -327,6 +327,11 @@ Nelle stringhe interpolate usate come tipo IFormattable o FormattableString non è possibile usare gli identificatori '%', ma è possibile usare solo interpolanti di tipo .NET, come '{{expr}}', '{{expr,3}}' o '{{expr:N5}}'. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Genera un assembly di riferimento con il percorso file specificato. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Versioni del linguaggio supportate: diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index fea133758e8..3d330529d59 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -327,6 +327,11 @@ IFormattable 型または FormattableString 型として使用される補間された文字列では、'%' 指定子を使用できません。'{{expr}}'、'{{expr,3}}'、'{{expr:N5}}' などの .NET 形式の補間のみ使用できます。 + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ 指定されたファイル パスを使用して参照アセンブリを生成します。 + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: サポートされる言語バージョン: diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 8d54742fe3f..fb1cc618ecb 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -327,6 +327,11 @@ 형식 IFormattable 또는 형식 FormattableString으로 사용된 보간 문자열은 '%' 지정자를 사용할 수 없으며 '{{expr}}', '{{expr,3}}' 또는 '{{expr:N5}}' 등의 .NET 스타일 인터폴란드를 사용할 수 있습니다. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ 지정된 파일 경로를 사용하여 참조 어셈블리를 생성합니다. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: 지원되는 언어 버전: diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index dd2f285ff2b..d8e30e88c62 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -327,6 +327,11 @@ W interpolowanych ciągach używanych jako typ IFormattable lub FormattableString nie można używać specyfikatorów „%”. Można używać tylko operatorów interpolacji, takich jak „{{expr}}”, „{{expr,3}}” lub „{{expr:N5}}”. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Utwórz zestaw odwołania z określoną ścieżką pliku. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Obsługiwane wersje językowe: diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index b5f0f00f51c..aeeba1d4271 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -327,6 +327,11 @@ As cadeias de caracteres interpoladas usadas como tipo IFormattable ou tipo FormattableString não podem usar especificadores '%'. Apenas interpoladores de estilo .NET, como '{{expr}}', '{{expr,3}}' ou '{{expr:N5}}' podem ser usados. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Produza um assembly de referência com o caminho de arquivo especificado. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Versões de linguagens com suporte: diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 5eb7751b144..5959290379e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -327,6 +327,11 @@ Интерполированные строки, используемые в качестве типа IFormattable или FormattableString, не могут использовать описатели "%". Можно использовать только описатели в стиле .NET, такие как "{{expr}}", "{{expr,3}}" или "{{expr:N5}}". + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Создайте базовую сборку с указанным путем к файлу. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Поддерживаемые языковые версии: diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 7d746dd8637..37583dc87c5 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -327,6 +327,11 @@ IFormattable veya FormattableString türü olarak kullanılan düz metin arasına kod eklenmiş dizeler '%' belirticilerini kullanamaz. Yalnızca '{{expr}}', '{{expr,3}}' veya '{{expr:N5}}' gibi .NET stili düz metin arasına kod ekleme işlemleri kullanılabilir. + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ Belirtilen dosya yoluna sahip bir başvuru bütünleştirilmiş kodu üretin. + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: Desteklenen dil sürümleri: diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index be235905319..a627b09742f 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -327,6 +327,11 @@ 作为类型 IFormattable 或类型 FormattableString 使用的内插字符串不能使用 "%" 说明符,只能使用 .NET 样式的插植,如 "{{expr}}"、"{{expr,3}}" 或 "{{expr:N5}}"。 + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ 生成具有指定文件路径的引用程序集。 + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: 支持的语言版本: diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index c990e70697b..dd69d33f792 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -327,6 +327,11 @@ 用作類型 IFormattable 或類型 FormattableString 的插補字串不能使用 '%' 指定名稱,只能使用 .NET 樣式的插補值,例如 '{{expr}}'、'{{expr,3}}' 或 '{{expr:N5}}'。 + + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + + - {0} - {0} @@ -497,6 +502,11 @@ 使用指定的檔案路徑產生參考組件。 + + Disable implicit generation of constructs using reflection + Disable implicit generation of constructs using reflection + + Supported language versions: 支援的語言版本: diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 9d67b00e5bc..6d4e62518f0 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -12,6 +12,8 @@ $(DefineConstants);LOCALIZATION_FSBUILD NU1701;FS0075 true + 5.0 + 6.0 6.0 Debug;Release;Proto diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 9529eade6bb..909354e83e7 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -90,6 +90,7 @@ type public Fsc() as this = let mutable vserrors: bool = false let mutable vslcid: string MaybeNull = null let mutable utf8output: bool = false + let mutable useReflectionFreeCodeGen: bool = false /// Trim whitespace ... spaces, tabs, newlines,returns, Double quotes and single quotes let wsCharsToTrim = [| ' '; '\t'; '\"'; '\'' |] @@ -294,6 +295,9 @@ type public Fsc() as this = if utf8output then builder.AppendSwitch("--utf8output") + if useReflectionFreeCodeGen then + builder.AppendSwitch("--reflectionfree") + // When building using the fsc task, always emit the "fullpaths" flag to make the output easier // for the user to parse builder.AppendSwitch("--fullpaths") @@ -598,6 +602,10 @@ type public Fsc() as this = with get () = utf8output and set (p) = utf8output <- p + member _.ReflectionFree + with get () = useReflectionFreeCodeGen + and set (p) = useReflectionFreeCodeGen <- p + member _.SubsystemVersion with get () = subsystemVersion and set (p) = subsystemVersion <- p diff --git a/src/FSharp.Build/Fsi.fs b/src/FSharp.Build/Fsi.fs index 76dec9c78e4..dd0ccff9754 100644 --- a/src/FSharp.Build/Fsi.fs +++ b/src/FSharp.Build/Fsi.fs @@ -64,6 +64,7 @@ type public Fsi() as this = let mutable warningLevel: string MaybeNull = null let mutable vslcid: string MaybeNull = null let mutable utf8output: bool = false + let mutable useReflectionFreeCodeGen: bool = false // See bug 6483; this makes parallel build faster, and is fine to set unconditionally do this.YieldDuringToolExecution <- true @@ -133,6 +134,9 @@ type public Fsi() as this = if utf8output then builder.AppendSwitch("--utf8output") + if useReflectionFreeCodeGen then + builder.AppendSwitch("--reflectionfree") + builder.AppendSwitch("--fullpaths") builder.AppendSwitch("--flaterrors") diff --git a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props index f6de7d70481..b2252e9e136 100644 --- a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -42,6 +42,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and 3239;$(WarningsAsErrors) true true + false diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 22d010e10db..26d9a170882 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -344,6 +344,7 @@ this file. LCID="$(LCID)" NoFramework="true" Optimize="$(Optimize)" + ReflectionFree="$(ReflectionFree)" OtherFlags="$(FscOtherFlags)" OutputAssembly="@(IntermediateAssembly)" OutputRefAssembly="@(IntermediateRefAssembly)" diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reflectionfree.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reflectionfree.fs new file mode 100644 index 00000000000..2cffacf65cf --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/reflectionfree.fs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module FSharp.Compiler.ComponentTests.CompilerOptions.ReflectionFree + +open Xunit +open FSharp.Test.Compiler + +[] +let ``Gives error when %A is used`` () = + FSharp """printfn "Hello, %A" "world" """ + |> asExe + |> withOptions [ "--reflectionfree" ] + |> compile + |> shouldFail + |> withDiagnostics [ + Error 741, Line 1, Col 9, Line 1, Col 20, + "Unable to parse format string 'The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection.'" ] + +let someCode = + FSharp """ + module Test + + type MyRecord = { A: int } + type MyUnion = A of int | B of string + type MyClass() = member val A = 42 + + let poke thing = $"Thing says: {thing}" + + [] + let doStuff _ = + poke { A = 3 } |> printfn "%s" + poke <| B "foo" |> printfn "%s" + poke <| MyClass() |> printfn "%s" + 0 + """ + +[] +let ``Records and DUs don't have generated ToString`` () = + someCode + |> withOptions [ "--reflectionfree" ] + |> compileExeAndRun + |> shouldSucceed + |> withStdOutContains "Thing says: Test+MyRecord" + |> withStdOutContains "Thing says: Test+MyUnion+B" + |> withStdOutContains "Thing says: Test+MyClass" + +[] +let ``No debug display attribute`` () = + someCode + |> withOptions [ "--reflectionfree" ] + |> compile + |> shouldSucceed + |> verifyILNotPresent [ "[runtime]System.Diagnostics.DebuggerDisplayAttribute" ] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison02.fs.il.bsl index 84f29017fb8..f25d03e0939 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison02.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/InequalityComparison/InequalityComparison02.fs.il.bsl @@ -51,11 +51,11 @@ .class public abstract auto ansi sealed InequalityComparison02 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 ) + .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 bool f2(int32 x, int32 y) cil managed { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 9cb7f248c25..d17427244c0 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -179,6 +179,7 @@ + diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 020ebe9363c..d227cc1630e 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -893,14 +893,18 @@ module rec Compiler = cUnit - let verifyIL (il: string list) (result: CompilationResult) : unit = + let private doILCheck func (il: string list) result = match result with | CompilationResult.Success s -> match s.OutputPath with | None -> failwith "Operation didn't produce any output!" - | Some p -> ILChecker.checkIL p il + | Some p -> func p il | CompilationResult.Failure _ -> failwith "Result should be \"Success\" in order to get IL." + let verifyIL = doILCheck ILChecker.checkIL + + let verifyILNotPresent = doILCheck ILChecker.checkILNotPresent + let verifyILBinary (il: string list) (dll: string)= ILChecker.checkIL dll il let private verifyFSILBaseline (baseline: Baseline option) (result: CompilationOutput) : unit = diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index daab582a61b..48bd3047cba 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -254,6 +254,11 @@ module rec CompilerAssertHelpers = yield Array.empty |] + let executeAssemblyEntryPoint (asm: Assembly) = + let entryPoint = asm.EntryPoint + let args = mkDefaultArgs entryPoint + captureConsoleOutputs (fun () -> entryPoint.Invoke(Unchecked.defaultof, args) |> ignore) + #if NETCOREAPP let executeBuiltApp assembly deps = let ctxt = AssemblyLoadContext("ContextName", true) @@ -264,10 +269,7 @@ module rec CompilerAssertHelpers = |> Option.map ctxt.LoadFromAssemblyPath |> Option.defaultValue null) - let asm = ctxt.LoadFromAssemblyPath(assembly) - let entryPoint = asm.EntryPoint - let args = mkDefaultArgs entryPoint - (entryPoint.Invoke(Unchecked.defaultof, args)) |> ignore + ctxt.LoadFromAssemblyPath assembly |> executeAssemblyEntryPoint finally ctxt.Unload() #else @@ -281,10 +283,8 @@ module rec CompilerAssertHelpers = |> Option.bind (fun x -> if FileSystem.FileExistsShim x then Some x else None) |> Option.map Assembly.LoadFile |> Option.defaultValue null)) - let asm = Assembly.LoadFrom(assemblyPath) - let entryPoint = asm.EntryPoint - let args = mkDefaultArgs entryPoint - (entryPoint.Invoke(Unchecked.defaultof, args)) |> ignore + + Assembly.LoadFrom assemblyPath |> executeAssemblyEntryPoint let adSetup = let setup = new System.AppDomainSetup () @@ -297,7 +297,7 @@ module rec CompilerAssertHelpers = let worker = use _ = new AlreadyLoadedAppDomainResolver() (ad.CreateInstanceFromAndUnwrap(typeof.Assembly.CodeBase, typeof.FullName)) :?> Worker - worker.ExecuteTestCase assembly (deps |> Array.ofList) |>ignore + worker.ExecuteTestCase assembly (deps |> Array.ofList) #endif let defaultProjectOptions = @@ -515,34 +515,39 @@ module rec CompilerAssertHelpers = outputDirectory.Create() compileCompilationAux outputDirectory (ResizeArray()) ignoreWarnings cmpl - let executeBuiltAppAndReturnResult (outputFilePath: string) (deps: string list) : (int * string * string) = + let captureConsoleOutputs (func: unit -> unit) = let out = Console.Out let err = Console.Error let stdout = StringBuilder () let stderr = StringBuilder () - let outWriter = new StringWriter (stdout) - let errWriter = new StringWriter (stderr) - - let mutable exitCode = 0 + use outWriter = new StringWriter (stdout) + use errWriter = new StringWriter (stderr) - try + let succeeded, exn = try - Console.SetOut(outWriter) - Console.SetError(errWriter) - (executeBuiltApp outputFilePath deps) |> ignore - with e -> - let errorMessage = if e.InnerException <> null then (e.InnerException.ToString()) else (e.ToString()) - stderr.Append (errorMessage) |> ignore - exitCode <- -1 - finally - Console.SetOut(out) - Console.SetError(err) - outWriter.Close() - errWriter.Close() + try + Console.SetOut outWriter + Console.SetError errWriter + func () + true, None + with e -> + let errorMessage = if e.InnerException <> null then e.InnerException.ToString() else e.ToString() + stderr.Append errorMessage |> ignore + false, Some e + finally + Console.SetOut out + Console.SetError err + outWriter.Close() + errWriter.Close() + + succeeded, stdout.ToString(), stderr.ToString(), exn - (exitCode, stdout.ToString(), stderr.ToString()) + let executeBuiltAppAndReturnResult (outputFilePath: string) (deps: string list) : (int * string * string) = + let succeeded, stdout, stderr, _ = executeBuiltApp outputFilePath deps + let exitCode = if succeeded then 0 else -1 + exitCode, stdout, stderr let executeBuiltAppNewProcessAndReturnResult (outputFilePath: string) : (int * string * string) = #if !NETCOREAPP @@ -582,7 +587,7 @@ type CompilerAssert private () = if errors.Length > 0 then Assert.Fail (sprintf "Compile had warnings and/or errors: %A" errors) - executeBuiltApp outputExe [] + executeBuiltApp outputExe [] |> ignore ) static let compileLibraryAndVerifyILWithOptions options (source: SourceCodeFileKind) (f: ILVerifier -> unit) = @@ -672,7 +677,8 @@ Updated automatically, please check diffs in your pull request, changes must be Assert.Fail errors onOutput output else - executeBuiltApp outputFilePath deps) + let _succeeded, _stdout, _stderr, exn = executeBuiltApp outputFilePath deps + exn |> Option.iter raise) static member ExecutionHasOutput(cmpl: Compilation, expectedOutput: string) = CompilerAssert.Execute(cmpl, newProcess = true, onOutput = (fun output -> Assert.AreEqual(expectedOutput, output, sprintf "'%s' = '%s'" expectedOutput output))) diff --git a/tests/FSharp.Test.Utilities/ILChecker.fs b/tests/FSharp.Test.Utilities/ILChecker.fs index a0b1ddefdfe..546deb0a2e6 100644 --- a/tests/FSharp.Test.Utilities/ILChecker.fs +++ b/tests/FSharp.Test.Utilities/ILChecker.fs @@ -4,7 +4,6 @@ namespace FSharp.Test open System open System.IO -open System.Diagnostics open System.Text.RegularExpressions open NUnit.Framework @@ -30,14 +29,48 @@ module ILChecker = (fun me -> String.Empty) ) - let private checkILPrim ildasmArgs dllFilePath expectedIL = + let private normalizeILText assemblyName (ilCode: string) = + let blockComments = @"/\*(.*?)\*/" + let lineComments = @"//(.*?)\r?\n" + let lineCommentsEof = @"//(.*?)$" + let strings = @"""((\\[^\n]|[^""\n])*)""" + let verbatimStrings = @"@(""[^""]*"")+" + let stripComments (text:string) = + Regex.Replace(text, + $"{blockComments}|{lineComments}|{lineCommentsEof}|{strings}|{verbatimStrings}", + (fun me -> + if (me.Value.StartsWith("/*") || me.Value.StartsWith("//")) then + if me.Value.StartsWith("//") then Environment.NewLine else String.Empty + else + me.Value), RegexOptions.Singleline) + |> filterSpecialComment + + let replace input (pattern, replacement: string) = Regex.Replace(input, pattern, replacement, RegexOptions.Singleline) + + let unifyRuntimeAssemblyName ilCode = + List.fold replace ilCode [ + "\[System\.Runtime\]|\[System\.Console\]|\[System\.Runtime\.Extensions\]|\[mscorlib\]|\[System\.Memory\]", "[runtime]" + "(\.assembly extern (System\.Runtime|System\.Console|System\.Runtime\.Extensions|mscorlib|System\.Memory)){1}([^\}]*)\}", ".assembly extern runtime { }" + "(\.assembly extern (FSharp.Core)){1}([^\}]*)\}", ".assembly extern FSharp.Core { }" ] + + let unifyImageBase ilCode = replace ilCode ("\.imagebase\s*0x\d*", ".imagebase {value}") + + let unifyingAssemblyNames (text: string) = + match assemblyName with + | Some name -> text.Replace(name, "assembly") + | None -> text + |> unifyRuntimeAssemblyName + |> unifyImageBase + + ilCode.Trim() |> stripComments |> unifyingAssemblyNames + + + let private generateIlFile dllFilePath ildasmArgs = let ilFilePath = Path.ChangeExtension(dllFilePath, ".il") - let mutable errorMsgOpt = None - let mutable actualIL = String.Empty let ildasmPath = config.ILDASM - let ildasmFullArgs = [ yield dllFilePath; yield sprintf "-out=%s" ilFilePath; yield! ildasmArgs ] + let ildasmFullArgs = [ dllFilePath; $"-out=%s{ilFilePath}"; yield! ildasmArgs ] let stdErr, exitCode = let ildasmCommandPath = Path.ChangeExtension(dllFilePath, ".ildasmCommandPath") @@ -45,100 +78,55 @@ module ILChecker = exec ildasmPath ildasmFullArgs if exitCode <> 0 then - failwith (sprintf "ILASM Expected exit code \"0\", got \"%d\"\nSTDERR: %s" exitCode stdErr) + failwith $"ILASM Expected exit code \"0\", got \"%d{exitCode}\"\nSTDERR: %s{stdErr}" if not (String.IsNullOrWhiteSpace stdErr) then - failwith (sprintf "ILASM Stderr is not empty:\n %s" stdErr) + failwith $"ILASM Stderr is not empty:\n %s{stdErr}" - let blockComments = @"/\*(.*?)\*/" - let lineComments = @"//(.*?)\r?\n" - let lineCommentsEof = @"//(.*?)$" - let strings = @"""((\\[^\n]|[^""\n])*)""" - let verbatimStrings = @"@(""[^""]*"")+" - let stripComments (text:string) = - System.Text.RegularExpressions.Regex.Replace(text, - blockComments + "|" + lineComments + "|" + lineCommentsEof + "|" + strings + "|" + verbatimStrings, - (fun me -> - if (me.Value.StartsWith("/*") || me.Value.StartsWith("//")) then - if me.Value.StartsWith("//") then Environment.NewLine else String.Empty - else - me.Value), System.Text.RegularExpressions.RegexOptions.Singleline) - |> filterSpecialComment + ilFilePath - let unifyRuntimeAssemblyName ilCode = - let pass1 = - Regex.Replace( - ilCode, - "\[System\.Runtime\]|\[System\.Console\]|\[System\.Runtime\.Extensions\]|\[mscorlib\]|\[System\.Memory\]","[runtime]", - RegexOptions.Singleline) - let pass2 = - Regex.Replace( - pass1, - "(\.assembly extern (System\.Runtime|System\.Console|System\.Runtime\.Extensions|mscorlib|System\.Memory)){1}([^\}]*)\}",".assembly extern runtime { }", - RegexOptions.Singleline) - let pass3 = - Regex.Replace( - pass2, - "(\.assembly extern (FSharp.Core)){1}([^\}]*)\}",".assembly extern FSharp.Core { }", - RegexOptions.Singleline) - pass3 - - let unifyImageBase ilCode = - Regex.Replace( - ilCode, - "\.imagebase\s*0x\d*",".imagebase {value}", - RegexOptions.Singleline) - - let unifyIlText (text:string) = - let unifyingAssemblyNames (text:string)= - let asmName = Path.GetFileNameWithoutExtension(dllFilePath) - text.Replace(asmName, "assembly") - |> unifyRuntimeAssemblyName - |> unifyImageBase - - text.Trim() |> stripComments |> unifyingAssemblyNames - - let raw = File.ReadAllText(ilFilePath) - let unifiedInputText = raw |> unifyIlText + let private generateIL (dllFilePath: string) = + let assemblyName = Some (Path.GetFileNameWithoutExtension dllFilePath) + generateIlFile dllFilePath >> File.ReadAllText >> normalizeILText assemblyName - expectedIL - |> List.map (fun (ilCode: string) -> ilCode.Trim()) - |> List.iter (fun (ilCode: string) -> - let expectedLines = - (ilCode |> unifyIlText).Split('\n') + let private compareIL assemblyName (actualIL: string) expectedIL = + + let mutable errorMsgOpt = None + + let prepareLines (s: string) = + s.Split('\n') |> Array.map(fun e -> e.Trim('\r')) - |> Array.skipWhile(fun s -> String.IsNullOrWhiteSpace(s)) + |> Array.skipWhile(String.IsNullOrWhiteSpace) |> Array.rev - |> Array.skipWhile(fun s -> String.IsNullOrWhiteSpace(s)) + |> Array.skipWhile(String.IsNullOrWhiteSpace) |> Array.rev + expectedIL + |> List.map (fun (ilCode: string) -> ilCode.Trim()) + |> List.iter (fun (ilCode: string) -> + let expectedLines = ilCode |> normalizeILText (Some assemblyName) |> prepareLines + if expectedLines.Length = 0 then errorMsgOpt <- Some("ExpectedLines length invalid: 0") else let startIndex = - let index = unifiedInputText.IndexOf(expectedLines[0].Trim()) + let index = actualIL.IndexOf(expectedLines[0].Trim()) if index > 0 then index else 0 - let actualLines = - unifiedInputText.Substring(startIndex).Split('\n') - |> Array.map(fun e -> e.Trim('\r')) - |> Array.skipWhile(fun s -> String.IsNullOrWhiteSpace(s)) - |> Array.rev - |> Array.skipWhile(fun s -> String.IsNullOrWhiteSpace(s)) - |> Array.rev + let actualLines = actualIL.Substring(startIndex) |> prepareLines let errors = ResizeArray() if actualLines.Length < expectedLines.Length then - let msg = sprintf "\nExpected at least %d lines but found only %d\n" expectedLines.Length actualLines.Length + let msg = $"\nExpected at least %d{expectedLines.Length} lines but found only %d{actualLines.Length}\n" errorMsgOpt <- Some(msg + "\nExpected:\n" + ilCode + "\n") else for i = 0 to expectedLines.Length - 1 do let expected = expectedLines[i].Trim() let actual = actualLines[i].Trim() if expected <> actual then - errors.Add(sprintf "\n==\nName: '%s'\n\nExpected:\t %s\nActual:\t\t %s\n==" actualLines[0] expected actual) + errors.Add $"\n==\nName: '%s{actualLines[0]}'\n\nExpected:\t %s{expected}\nActual:\t\t %s{actual}\n==" if errors.Count > 0 then let msg = String.concat "\n" errors + "\n\n\Expected:\n" + ilCode + "\n" @@ -148,21 +136,22 @@ module ILChecker = if expectedIL.Length = 0 then errorMsgOpt <- Some ("No Expected IL") - actualIL <- unifiedInputText - match errorMsgOpt with - | Some(msg) -> errorMsgOpt <- Some(msg + "\n\n\nEntire actual:\n" + unifiedInputText) + | Some(msg) -> errorMsgOpt <- Some(msg + "\n\n\nEntire actual:\n" + actualIL) | _ -> () match errorMsgOpt with | Some(errorMsg) -> (false, errorMsg, actualIL) | _ -> (true, String.Empty, String.Empty) + let private checkILPrim ildasmArgs dllFilePath = + let actualIL = generateIL dllFilePath ildasmArgs + compareIL (Path.GetFileNameWithoutExtension dllFilePath) actualIL + let private checkILAux ildasmArgs dllFilePath expectedIL = let (success, errorMsg, _) = checkILPrim ildasmArgs dllFilePath expectedIL if not success then Assert.Fail(errorMsg) - else () // This doesn't work because the '/linenum' is being ignored by // the version of ILDASM we are using, which we acquire from a nuget package @@ -178,7 +167,20 @@ module ILChecker = let verifyILAndReturnActual (dllFilePath: string) (expectedIL: string) = checkILPrim [] dllFilePath [expectedIL] + let checkILNotPresent dllFilePath unexpectedIL = + let actualIL = generateIL dllFilePath [] + if unexpectedIL = [] then + Assert.Fail $"No unexpected IL given. This is actual IL: \n{actualIL}" + let errors = + unexpectedIL + |> Seq.map (normalizeILText None) + |> Seq.filter actualIL.Contains + |> Seq.map (sprintf "Found in actual IL: '%s'") + |> String.concat "\n" + if errors <> "" then + Assert.Fail $"{errors}\n\n\nEntire actual:\n{actualIL}" + let reassembleIL ilFilePath dllFilePath = let ilasmPath = config.ILASM - let errors, _ = exec ilasmPath ([ sprintf "%s /output=%s /dll" ilFilePath dllFilePath ]) + let errors, _ = exec ilasmPath [ $"%s{ilFilePath} /output=%s{dllFilePath} /dll" ] errors diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 2e41efee8f2..885f49a5c64 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -95,6 +95,8 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. names output by the compiler --crossoptimize[+|-] Enable or disable cross-module optimizations +--reflectionfree Disable implicit generation of + constructs using reflection - ERRORS AND WARNINGS - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl index d7ab69ca858..d916a6c2eba 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl @@ -38,6 +38,8 @@ Usage: fsharpi [script.fsx []] names output by the compiler --crossoptimize[+|-] Enable or disable cross-module optimizations +--reflectionfree Disable implicit generation of + constructs using reflection - ERRORS AND WARNINGS - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index a7f1930e318..906df1bcee4 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -38,6 +38,8 @@ Usage: fsiAnyCpu [script.fsx []] names output by the compiler --crossoptimize[+|-] Enable or disable cross-module optimizations +--reflectionfree Disable implicit generation of + constructs using reflection - ERRORS AND WARNINGS - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index 65a00be5c48..87541384a88 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -40,6 +40,8 @@ Usage: fsiAnyCpu [script.fsx []] names output by the compiler --crossoptimize[+|-] Enable or disable cross-module optimizations +--reflectionfree Disable implicit generation of + constructs using reflection - ERRORS AND WARNINGS - From 0ae8c8305e729752d57c194d534f0f62d31ca07e Mon Sep 17 00:00:00 2001 From: Nino Floris Date: Mon, 22 Aug 2022 15:27:42 +0200 Subject: [PATCH 128/226] Fix issues around type directed conversion (#13673) --- src/Compiler/Checking/CheckExpressions.fs | 14 +- src/Compiler/Checking/ConstraintSolver.fs | 32 +- src/Compiler/Checking/MethodCalls.fs | 89 ++-- src/Compiler/Checking/MethodCalls.fsi | 2 +- .../Compiler/Language/OptionalInteropTests.fs | 14 +- .../Language/TypeDirectedConversionTests.fs | 442 ++++++++++++++++++ tests/fsharp/FSharpSuite.Tests.fsproj | 1 + 7 files changed, 519 insertions(+), 75 deletions(-) create mode 100644 tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index fbb57c91dcc..2261a77d407 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -453,7 +453,7 @@ let UnifyOverallType (cenv: cenv) (env: TcEnv) m overallTy actualTy = | None -> () match usesTDC with - | TypeDirectedConversionUsed.Yes warn -> warning(warn env.DisplayEnv) + | TypeDirectedConversionUsed.Yes(warn, _) -> warning(warn env.DisplayEnv) | TypeDirectedConversionUsed.No -> () if AddCxTypeMustSubsumeTypeUndoIfFailed env.DisplayEnv cenv.css m reqdTy2 actualTy then @@ -5385,7 +5385,7 @@ and TcAdjustExprForTypeDirectedConversions (cenv: cenv) (overallTy: OverallTy) a let g = cenv.g match overallTy with - | MustConvertTo (_, reqdTy) when g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions -> + | MustConvertTo (isMethodArg, reqdTy) when g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions || (g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop && isMethodArg) -> let tcVal = LightweightTcValForUsingInBuildMethodCall g AdjustExprForTypeDirectedConversions tcVal g cenv.amap cenv.infoReader env.AccessRights reqdTy actualTy m expr | _ -> @@ -9704,12 +9704,9 @@ and TcMethodApplication let expr = mkLetsBind mMethExpr outArgTmpBinds expr expr, tyOfExpr g expr - // Subsumption or conversion to return type - let callExpr2b = TcAdjustExprForTypeDirectedConversions cenv returnTy exprTy env mMethExpr callExpr2 - // Handle post-hoc property assignments - let setterExprPrebinders, callExpr3 = - let expr = callExpr2b + let setterExprPrebinders, callExpr2b = + let expr = callExpr2 CheckRequiredProperties g env cenv finalCalledMethInfo finalAssignedItemSetters mMethExpr @@ -9731,6 +9728,9 @@ and TcMethodApplication let expr = mkCompGenLet mMethExpr objv expr (mkCompGenSequential mMethExpr propSetExpr objExpr) setterExprPrebinders, expr + // Subsumption or conversion to return type + let callExpr3 = TcAdjustExprForTypeDirectedConversions cenv returnTy exprTy env mMethExpr callExpr2b + // Build the lambda expression if any, if the method is used as a first-class value let callExpr4 = let expr = callExpr3 diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 77b3cb3486a..8feeb65a6a1 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -2695,21 +2695,21 @@ and AddWrappedContextualSubsumptionReport (csenv: ConstraintSolverEnv) ndeep m c | _ -> ErrorD (wrapper (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, csenv.eContextInfo, m))) /// Assert a subtype constraint -and SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 wrapper = +and SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln origTy1 ty1 ty2 wrapper = // Due to the legacy of the change https://github.com/dotnet/fsharp/pull/1650, // when doing nested, speculative overload resolution, we ignore failed member constraints and continue. The // constraint is not recorded for later solution. if csenv.IsSpeculativeForMethodOverloading then IgnoreFailedMemberConstraintResolution (fun () -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m trace cxsln ty1 ty2) - (fun res -> AddWrappedContextualSubsumptionReport csenv ndeep m cxsln ty1 ty2 res wrapper) + (fun res -> AddWrappedContextualSubsumptionReport csenv ndeep m cxsln (defaultArg origTy1 ty1) ty2 res wrapper) else PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m trace cxsln ty1 ty2) - (fun res -> AddWrappedContextualSubsumptionReport csenv ndeep m cxsln ty1 ty2 res wrapper) + (fun res -> AddWrappedContextualSubsumptionReport csenv ndeep m cxsln (defaultArg origTy1 ty1) ty2 res wrapper) -and SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = - SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln ty1 ty2 id +and SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln origTy1 ty1 ty2 = + SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln origTy1 ty1 ty2 id and SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actualTy expectedTy = TryD @@ -2738,9 +2738,9 @@ and ArgsMustSubsumeOrConvert msg csenv.DisplayEnv | None -> () match usesTDC with - | TypeDirectedConversionUsed.Yes warn -> do! WarnD(warn csenv.DisplayEnv) + | TypeDirectedConversionUsed.Yes(warn, _) -> do! WarnD(warn csenv.DisplayEnv) | TypeDirectedConversionUsed.No -> () - do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln calledArgTy callerArg.CallerArgumentType + do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln (Some calledArg.CalledArgumentType) calledArgTy callerArg.CallerArgumentType if calledArg.IsParamArray && isArray1DTy g calledArgTy && not (isArray1DTy g callerArg.CallerArgumentType) then return! ErrorD(Error(FSComp.SR.csMethodExpectsParams(), m)) else @@ -2769,9 +2769,9 @@ and ArgsMustSubsumeOrConvertWithContextualReport msg csenv.DisplayEnv | None -> () match usesTDC with - | TypeDirectedConversionUsed.Yes warn -> do! WarnD(warn csenv.DisplayEnv) + | TypeDirectedConversionUsed.Yes(warn, _) -> do! WarnD(warn csenv.DisplayEnv) | TypeDirectedConversionUsed.No -> () - do! SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln calledArgTy callerArgTy (fun e -> ArgDoesNotMatchError(e :?> _, calledMeth, calledArg, callerArg)) + do! SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln (Some calledArg.CalledArgumentType) calledArgTy callerArgTy (fun e -> ArgDoesNotMatchError(e :?> _, calledMeth, calledArg, callerArg)) return usesTDC } @@ -2783,7 +2783,7 @@ and TypesEquiv csenv ndeep trace cxsln ty1 ty2 = and TypesMustSubsume (csenv: ConstraintSolverEnv) ndeep trace cxsln m calledArgTy callerArgTy = trackErrors { - do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln calledArgTy callerArgTy + do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln None calledArgTy callerArgTy return TypeDirectedConversionUsed.No } @@ -2796,9 +2796,9 @@ and ReturnTypesMustSubsumeOrConvert (csenv: ConstraintSolverEnv) ad ndeep trace msg csenv.DisplayEnv | None -> () match usesTDC with - | TypeDirectedConversionUsed.Yes warn -> do! WarnD(warn csenv.DisplayEnv) + | TypeDirectedConversionUsed.Yes(warn, _) -> do! WarnD(warn csenv.DisplayEnv) | TypeDirectedConversionUsed.No -> () - do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln reqdTy actualTy + do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln None reqdTy actualTy return usesTDC } @@ -2813,7 +2813,7 @@ and ArgsEquivOrConvert (csenv: ConstraintSolverEnv) ad ndeep trace cxsln isConst msg csenv.DisplayEnv | None -> () match usesTDC with - | TypeDirectedConversionUsed.Yes warn -> do! WarnD(warn csenv.DisplayEnv) + | TypeDirectedConversionUsed.Yes(warn, _) -> do! WarnD(warn csenv.DisplayEnv) | TypeDirectedConversionUsed.No -> () if not (typeEquiv csenv.g calledArgTy callerArgTy) then return! ErrorD(Error(FSComp.SR.csArgumentTypesDoNotMatch(), m)) @@ -3223,6 +3223,10 @@ and GetMostApplicableOverload csenv ndeep candidates applicableMeths calledMethG // Prefer methods that don't use type-directed conversion let c = compare (match usesTDC1 with TypeDirectedConversionUsed.No -> 1 | _ -> 0) (match usesTDC2 with TypeDirectedConversionUsed.No -> 1 | _ -> 0) if c <> 0 then c else + + // Prefer methods that need less type-directed conversion + let c = compare (match usesTDC1 with TypeDirectedConversionUsed.Yes(_, false) -> 1 | _ -> 0) (match usesTDC2 with TypeDirectedConversionUsed.Yes(_, false) -> 1 | _ -> 0) + if c <> 0 then c else // Prefer methods that don't give "this code is less generic" warnings // Note: Relies on 'compare' respecting true > false @@ -3519,7 +3523,7 @@ let AddCxTypeMustSubsumeTypeMatchingOnlyUndoIfFailed denv css m extraRigidTypars let AddCxTypeMustSubsumeType contextInfo denv css m trace ty1 ty2 = let csenv = MakeConstraintSolverEnv contextInfo css m denv - SolveTypeSubsumesTypeWithReport csenv 0 m trace None ty1 ty2 + SolveTypeSubsumesTypeWithReport csenv 0 m trace None None ty1 ty2 |> RaiseOperationResult let AddCxMethodConstraint denv css m trace traitInfo = diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 76d0560349d..c524b1bd03f 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -236,12 +236,15 @@ type TypeDirectedConversion = [] type TypeDirectedConversionUsed = - | Yes of (DisplayEnv -> exn) + | Yes of (DisplayEnv -> exn) * isTwoStepConversion: bool | No static member Combine a b = - match a with - | Yes _ -> a - | No -> b + match a, b with + | Yes(_,true), _ -> a + | _, Yes(_,true) -> b + | Yes _, _ -> a + | _, Yes _ -> b + | No, No -> a let MapCombineTDCD mapper xs = MapReduceD mapper TypeDirectedConversionUsed.No TypeDirectedConversionUsed.Combine xs @@ -279,21 +282,33 @@ let rec AdjustRequiredTypeForTypeDirectedConversions (infoReader: InfoReader) ad // Adhoc int32 --> int64 elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.int64_ty reqdTy && typeEquiv g g.int32_ty actualTy then - g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None + g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn, false), None // Adhoc int32 --> nativeint elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.nativeint_ty reqdTy && typeEquiv g g.int32_ty actualTy then - g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None + g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn, false), None // Adhoc int32 --> float64 elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.float_ty reqdTy && typeEquiv g g.int32_ty actualTy then - g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None + g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn, false), None + elif g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop && isMethodArg && isNullableTy g reqdTy && not (isNullableTy g actualTy) then + let underlyingTy = destNullableTy g reqdTy + // shortcut + if typeEquiv g underlyingTy actualTy then + actualTy, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn, false), None + else + let adjustedTy, _, _ = AdjustRequiredTypeForTypeDirectedConversions infoReader ad isMethodArg isConstraint underlyingTy actualTy m + if typeEquiv g adjustedTy actualTy then + actualTy, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn, true), None + else + reqdTy, TypeDirectedConversionUsed.No, None + // Adhoc based on op_Implicit, perhaps returing a new equational type constraint to // eliminate articifical constrained type variables. elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions then match TryFindRelevantImplicitConversion infoReader ad reqdTy actualTy m with - | Some (minfo, _staticTy, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn (TypeDirectedConversion.Implicit minfo)), Some eqn + | Some (minfo, _staticTy, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn (TypeDirectedConversion.Implicit minfo), false), Some eqn | None -> reqdTy, TypeDirectedConversionUsed.No, None else reqdTy, TypeDirectedConversionUsed.No, None @@ -352,9 +367,8 @@ let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableO // If inference has worked out it's a struct (e.g. an int) then use this elif isStructTy g callerArgTy then - let calledArgTy2 = destNullableTy g calledArgTy - AdjustRequiredTypeForTypeDirectedConversions infoReader ad true false calledArgTy2 callerArgTy m - + AdjustRequiredTypeForTypeDirectedConversions infoReader ad true false calledArgTy callerArgTy m + // If neither and we are at the end of overload resolution then use the Nullable elif enforceNullableOptionalsKnownTypes then calledArgTy, TypeDirectedConversionUsed.No, None @@ -1305,6 +1319,16 @@ let rec AdjustExprForTypeDirectedConversions tcVal (g: TcGlobals) amap infoReade mkCallToDoubleOperator g m actualTy expr + elif g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop && + isNullableTy g reqdTy && not (isNullableTy g actualTy) then + + let underlyingTy = destNullableTy g reqdTy + let adjustedExpr = AdjustExprForTypeDirectedConversions tcVal g amap infoReader ad underlyingTy actualTy m expr + let adjustedActualTy = tyOfExpr g adjustedExpr + + let minfo = GetIntrinsicConstructorInfosOfType infoReader m reqdTy |> List.head + let callerArgExprCoerced = mkCoerceIfNeeded g underlyingTy adjustedActualTy adjustedExpr + MakeMethInfoCall amap m minfo [] [callerArgExprCoerced] None else match TryFindRelevantImplicitConversion infoReader ad reqdTy actualTy m with | Some (minfo, staticTy, _) -> @@ -1313,9 +1337,7 @@ let rec AdjustExprForTypeDirectedConversions tcVal (g: TcGlobals) amap infoReade let callExpr, _ = BuildMethodCall tcVal g amap Mutates.NeverMutates m false minfo ValUseFlag.NormalValUse [] [] [expr] staticTyOpt assert (let resTy = tyOfExpr g callExpr in typeEquiv g reqdTy resTy) callExpr - | None -> mkCoerceIfNeeded g reqdTy actualTy expr - // TODO: consider Nullable - + | None -> mkCoerceIfNeeded g reqdTy actualTy expr // Handle adhoc argument conversions let AdjustCallerArgExpr tcVal (g: TcGlobals) amap infoReader ad isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = @@ -1450,17 +1472,6 @@ let GetDefaultExpressionForOptionalArg tcFieldInit g (calledArg: CalledArg) eCal let callerArg = CallerArg(calledArgTy, mMethExpr, false, expr) preBinder, { NamedArgIdOpt = None; CalledArg = calledArg; CallerArg = callerArg } -let MakeNullableExprIfNeeded (infoReader: InfoReader) calledArgTy callerArgTy callerArgExpr m = - let g = infoReader.g - let amap = infoReader.amap - if isNullableTy g callerArgTy then - callerArgExpr - else - let calledNonOptTy = destNullableTy g calledArgTy - let minfo = GetIntrinsicConstructorInfosOfType infoReader m calledArgTy |> List.head - let callerArgExprCoerced = mkCoerceIfNeeded g calledNonOptTy callerArgTy callerArgExpr - MakeMethInfoCall amap m minfo [] [callerArgExprCoerced] None - // Adjust all the optional arguments, filling in values for defaults, let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: InfoReader) ad (assignedArg: AssignedCalledArg<_>) = let g = infoReader.g @@ -1492,14 +1503,9 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: | NotOptional -> // T --> Nullable widening at callsites if isOptCallerArg then errorR(Error(FSComp.SR.tcFormalArgumentIsNotOptional(), m)) - if isNullableTy g calledArgTy then - if isNullableTy g callerArgTy then - callerArgExpr - else - let calledNonOptTy = destNullableTy g calledArgTy - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr - let callerArgTy2 = tyOfExpr g callerArgExpr2 - MakeNullableExprIfNeeded infoReader calledArgTy callerArgTy2 callerArgExpr2 m + if isNullableTy g calledArgTy then + // AdjustCallerArgExpr later on will deal with the nullable conversion + callerArgExpr else failwith "unreachable" // see case above @@ -1521,21 +1527,8 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: // This should be unreachable but the error will be reported elsewhere callerArgExpr else - if isNullableTy g calledArgTy then - if isNullableTy g callerArgTy then - // CSharpMethod(x=b) when 'x' has nullable type - // CSharpMethod(x=b) when both 'x' and 'b' have nullable type --> CSharpMethod(x=b) - callerArgExpr - else - // CSharpMethod(x=b) when 'x' has nullable type and 'b' does not --> CSharpMethod(x=Nullable(b)) - let calledNonOptTy = destNullableTy g calledArgTy - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr - let callerArgTy2 = tyOfExpr g callerArgExpr2 - MakeNullableExprIfNeeded infoReader calledArgTy callerArgTy2 callerArgExpr2 m - else - // CSharpMethod(x=b) --> CSharpMethod(?x=b) - let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m callerArgExpr - callerArgExpr2 + // AdjustCallerArgExpr later on will deal with any nullable conversion + callerArgExpr | CalleeSide -> if isOptCallerArg then diff --git a/src/Compiler/Checking/MethodCalls.fsi b/src/Compiler/Checking/MethodCalls.fsi index ad5bb10ebaa..a70827d8fec 100644 --- a/src/Compiler/Checking/MethodCalls.fsi +++ b/src/Compiler/Checking/MethodCalls.fsi @@ -119,7 +119,7 @@ type CallerArgs<'T> = /// has been used in F# code [] type TypeDirectedConversionUsed = - | Yes of (DisplayEnv -> exn) + | Yes of (DisplayEnv -> exn) * isTwoStepConversion: bool | No static member Combine: TypeDirectedConversionUsed -> TypeDirectedConversionUsed -> TypeDirectedConversionUsed diff --git a/tests/fsharp/Compiler/Language/OptionalInteropTests.fs b/tests/fsharp/Compiler/Language/OptionalInteropTests.fs index 646692eeb03..2e099bfe5b9 100644 --- a/tests/fsharp/Compiler/Language/OptionalInteropTests.fs +++ b/tests/fsharp/Compiler/Language/OptionalInteropTests.fs @@ -6,15 +6,14 @@ open System.Collections.Immutable open NUnit.Framework open FSharp.Test open FSharp.Test.Utilities -open FSharp.Test.Compiler -open FSharp.Compiler.Diagnostics open Microsoft.CodeAnalysis [] module OptionalInteropTests = - [] - let ``C# method with an optional parameter and called with an option type should compile`` () = + [] + [] + let ``C# method with an optional parameter and called with an option type should compile`` langVersion = let csSrc = """ using Microsoft.FSharp.Core; @@ -145,6 +144,10 @@ Test.MethodTakingNullables(6, y="aaaaaa", d=Nullable 8.0) |> ignore Test.MethodTakingNullables(6, y="aaaaaa", d=Nullable ()) |> ignore Test.MethodTakingNullables(Nullable (), y="aaaaaa", d=8.0) |> ignore Test.MethodTakingNullables(Nullable 6, y="aaaaaa", d=8.0) |> ignore + +Test.OverloadedMethodTakingNullableOptionalsWithDefaults(x = 6) |> ignore +Test.OverloadedMethodTakingNullables(6, "aaaaaa", 8.0) |> ignore +Test.OverloadedMethodTakingNullableOptionals(x = 6) |> ignore """ let fsharpCoreAssembly = @@ -155,5 +158,6 @@ Test.MethodTakingNullables(Nullable 6, y="aaaaaa", d=8.0) |> ignore CompilationUtil.CreateCSharpCompilation(csSrc, CSharpLanguageVersion.CSharp8, TargetFramework.NetCoreApp31, additionalReferences = ImmutableArray.CreateRange [fsharpCoreAssembly]) |> CompilationReference.Create - let fs = Compilation.Create(fsSrc, CompileOutput.Exe, options = [|"--langversion:5.0"|], cmplRefs = [cs]) + let fs = Compilation.Create(fsSrc, CompileOutput.Exe, options = [| $"--langversion:{langVersion}" |], cmplRefs = [cs]) CompilerAssert.Compile fs + diff --git a/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs b/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs new file mode 100644 index 00000000000..be31e72712e --- /dev/null +++ b/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open NUnit.Framework +open FSharp.Test +open FSharp.Compiler.Diagnostics + +[] +module TypeDirectedConversionTests = + [] + let ``int32 converts to float in method call parameter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + static member Do(i: float) = () + +let test() = Thing.Do(100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static void test() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 100 + IL_0002: conv.r8 + IL_0003: call void Test/Thing::Do(float64) + IL_0008: ret + } + """ + ])) + + [] + let ``int32 converts to System.Nullable in method call parameter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + static member Do(i: System.Nullable) = () + +let test() = Thing.Do(100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static void test() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 100 + IL_0002: conv.r8 + IL_0003: newobj instance void valuetype [runtime]System.Nullable`1::.ctor(!0) + IL_0008: call void Test/Thing::Do(valuetype [runtime]System.Nullable`1) + IL_000d: ret + } + """ + ])) + + [] + let ``int32 converts to float in method call property setter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + member val Do: float = 0.0 with get,set + +let test() = Thing(Do = 100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static class Test/Thing + test() cil managed + { + + .maxstack 4 + .locals init (class Test/Thing V_0) + IL_0000: newobj instance void Test/Thing::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.s 100 + IL_0009: conv.r8 + IL_000a: callvirt instance void Test/Thing::set_Do(float64) + IL_000f: ldloc.0 + IL_0010: ret + } + """ + ])) + + + [] + let ``int32 converts to System.Nullable in method call property setter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + member val Do: System.Nullable = System.Nullable() with get,set + +let test() = Thing(Do = 100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static class Test/Thing + test() cil managed + { + + .maxstack 4 + .locals init (class Test/Thing V_0) + IL_0000: newobj instance void Test/Thing::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.s 100 + IL_0009: conv.r8 + IL_000a: newobj instance void valuetype [runtime]System.Nullable`1::.ctor(!0) + IL_000f: callvirt instance void Test/Thing::set_Do(valuetype [runtime]System.Nullable`1) + IL_0014: ldloc.0 + IL_0015: ret + } + """ + ])) + + [] + let ``int converts to System.Nullable in method call property setter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + member val Do: System.Nullable = System.Nullable() with get,set + +let test() = Thing(Do = 100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static class Test/Thing + test() cil managed + { + + .maxstack 4 + .locals init (class Test/Thing V_0) + IL_0000: newobj instance void Test/Thing::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.s 100 + IL_0009: newobj instance void valuetype [runtime]System.Nullable`1::.ctor(!0) + IL_000e: callvirt instance void Test/Thing::set_Do(valuetype [runtime]System.Nullable`1) + IL_0013: ldloc.0 + IL_0014: ret + } + """ + ])) + + [] + let ``int converts to System.Nullable in method call parameter``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Thing() = + static member Do(i: System.Nullable) = () + +let test() = Thing.Do(100) + """, + (fun verifier -> verifier.VerifyIL [ + """ + .method public static void test() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.s 100 + IL_0002: newobj instance void valuetype [runtime]System.Nullable`1::.ctor(!0) + IL_0007: call void Test/Thing::Do(valuetype [runtime]System.Nullable`1) + IL_000c: ret + } + """ + ])) + + [] + let ``Passing an incompatible argument for System.Nullable<'T> method call parameter produces accurate error``() = + CompilerAssert.TypeCheckSingleError + """ +module Test + +type Thing() = + static member Do(i: System.Nullable) = () + +let test() = Thing.Do(true) + """ + FSharpDiagnosticSeverity.Error + 193 + (7, 22, 7, 28) + """Type constraint mismatch. The type + 'bool' +is not compatible with type + 'System.Nullable' +""" + + [] + let ``Assigning a 'T value to a System.Nullable<'T> binding succeeds``() = + CompilerAssert.TypeCheckSingleError + """ +module Test + +let test(): System.Nullable = 1 +""" + FSharpDiagnosticSeverity.Warning + 3391 + (4, 36, 4, 37) + """This expression uses the implicit conversion 'System.Nullable.op_Implicit(value: int) : System.Nullable' to convert type 'int' to type 'System.Nullable'. See https://aka.ms/fsharp-implicit-convs. This warning may be disabled using '#nowarn "3391".""" + + [] + let ``Assigning an int32 to a System.Nullable binding fails``() = + CompilerAssert.TypeCheckSingleError + """ +module Test + +let test(): System.Nullable = 1 +""" + FSharpDiagnosticSeverity.Error + 1 + (4, 38, 4, 39) + """This expression was expected to have type + 'System.Nullable' +but here has type + 'int' """ + + [] + let ``Overloading on System.Nullable and Result both work without error``() = + CompilerAssert.Pass + """ +module Test + +type M() = + static member A(n: System.Nullable<'T>) = () + static member A(r: Result<'T, 'TError>) = () + +let test() = + M.A(System.Nullable 3) + M.A(Result.Ok 3) +""" + + + [] + let ``Overloading on System.Nullable and Result produces a builtin conversion warning when Nullable is picked``() = + CompilerAssert.TypeCheckSingleErrorWithOptions + [| "--warnon:3389" |] + """ +module Test + +type M() = + static member A(n: System.Nullable) = () + static member A(r: Result<'T, 'TError>) = () + +let test() = + M.A(3) +""" + FSharpDiagnosticSeverity.Warning + 3389 + (9, 9, 9, 10) + """This expression uses a built-in implicit conversion to convert type 'int' to type 'System.Nullable'. See https://aka.ms/fsharp-implicit-convs.""" + + [] + let ``Overloading on System.Nullable, System.Nullable<'T> and int all work without error``() = + CompilerAssert.RunScript + """ +let assertTrue x = + (x || failwith "Unexpected overload") |> ignore + +type M() = + static member A(n: System.Nullable<'T>) = 1 + static member A(n: System.Nullable) = 2 + static member A(n: int) = 3 + +let test() = + M.A(System.Nullable 3.) = 1 |> assertTrue + M.A(System.Nullable 3) = 2 |> assertTrue + M.A(3) = 3 |> assertTrue + +test() + """ [] + + [] + let ``Picking overload for typar does not favor any form of System.Nullable nor produce ambiguity warnings``() = + CompilerAssert.TypeCheckSingleError + """ +module Test + +type M() = + static member A(n: System.Nullable<'T>) = () +// static member A(n: System.Nullable) = () + static member A(n: System.Nullable) = () + static member A(n: int) = () + +let test(x: 'T) = + M.A(x) +""" + FSharpDiagnosticSeverity.Warning + 64 + (11, 5, 11, 11) + """This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type 'int'.""" + + [] + let ``Picking overload for typar fails when incompatible types are part of the candidate set``() = + CompilerAssert.TypeCheckWithErrors + """ +module Test + +type M() = + static member A(n: System.Nullable<'T>) = () + static member A(n: System.Nullable) = () + static member A(n: System.Nullable) = () + static member A(n: int) = () + +let test(x: 'T) = + M.A(x) + +type M2() = + static member A(n: System.Nullable) = () + static member A(n: System.Nullable) = () + static member A(n: int) = () + +let test2(x: 'T) = + M2.A(x) +""" + [| + (FSharpDiagnosticSeverity.Error, + 41, + (11, 5, 11, 11), + """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known type of argument: 'T + +Candidates: + - static member M.A: n: System.Nullable<'T> -> unit when 'T: (new: unit -> 'T) and 'T: struct and 'T :> System.ValueType + - static member M.A: n: System.Nullable -> unit + - static member M.A: n: System.Nullable -> unit + - static member M.A: n: int -> unit""") + (FSharpDiagnosticSeverity.Error, + 41, + (19, 5, 19, 12), + """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known type of argument: 'T + +Candidates: + - static member M2.A: n: System.Nullable -> unit + - static member M2.A: n: System.Nullable -> unit + - static member M2.A: n: int -> unit""") + |] + + [] + let ``Ambiguous overload for typar does not pick System.Nullable<'T>``() = + CompilerAssert.TypeCheckSingleError + """ +module Test + +type M() = + static member A(n: System.Nullable<'T>) = () + static member A(n: int) = () + static member A(n: float) = () + +let test(x: 'T) = + M.A(x) +""" + FSharpDiagnosticSeverity.Error + 41 + (10, 5, 10, 11) + """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known type of argument: 'T + +Candidates: + - static member M.A: n: System.Nullable<'T> -> unit when 'T: (new: unit -> 'T) and 'T: struct and 'T :> System.ValueType + - static member M.A: n: float -> unit + - static member M.A: n: int -> unit""" + + [] + let ``Passing an argument in nested method call property setter works``() = + CompilerAssert.CompileLibraryAndVerifyILWithOptions([|"--optimize-"|], + """ +module Test + +type Input<'T>(_v: 'T) = + static member op_Implicit(value: 'T): Input<'T> = Input<'T>(value) + +type OtherArgs() = + member val Name: string = Unchecked.defaultof<_> with get,set +type SomeArgs() = + member val OtherArgs: Input = Unchecked.defaultof<_> with get, set + +let test() = + SomeArgs(OtherArgs = OtherArgs(Name = "test")) +""" + , + (fun verifier -> verifier.VerifyIL [ + """ + .method public static class Test/SomeArgs + test() cil managed + { + + .maxstack 5 + .locals init (class Test/SomeArgs V_0, + class Test/OtherArgs V_1) + IL_0000: newobj instance void Test/SomeArgs::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: newobj instance void Test/OtherArgs::.ctor() + IL_000c: stloc.1 + IL_000d: ldloc.1 + IL_000e: ldstr "test" + IL_0013: callvirt instance void Test/OtherArgs::set_Name(string) + IL_0018: ldloc.1 + IL_0019: call class Test/Input`1 class Test/Input`1::op_Implicit(!0) + IL_001e: callvirt instance void Test/SomeArgs::set_OtherArgs(class Test/Input`1) + IL_0023: ldloc.0 + IL_0024: ret + } + """ + ])) + + [] + let ``Test retrieving an argument provided in a nested method call property setter works``() = + CompilerAssert.RunScript + """ +type Input<'T>(v: 'T) = + member _.Value = v + static member op_Implicit(value: 'T): Input<'T> = Input<'T>(value) + +type OtherArgs() = + member val Name: string = Unchecked.defaultof<_> with get,set +type SomeArgs() = + member val OtherArgs: Input = Unchecked.defaultof<_> with get, set + +let test() = + SomeArgs(OtherArgs = OtherArgs(Name = "test")) + +if not (test().OtherArgs.Value.Name = "test") then failwith "Unexpected value was returned after setting Name" + """ [] diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 6e1daff174e..6e38d801d1f 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -71,6 +71,7 @@ + From 5c0a9c9d69ef8d3c32782d3ffa702d3ca9f77fb1 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 22 Aug 2022 17:25:02 +0200 Subject: [PATCH 129/226] Properly handle console-only fsc options in the VS context (#13702) --- src/Compiler/Driver/CompilerOptions.fs | 28 ++++----- src/Compiler/Driver/CompilerOptions.fsi | 2 +- src/Compiler/Interactive/fsi.fs | 8 +-- .../FSharp.Compiler.Service.Tests.fsproj | 1 + .../VisualStudioVersusConsoleContextTests.fs | 60 +++++++++++++++++++ .../fsc/dumpAllCommandLineOptions/dummy.fs | 10 ++-- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 11 ++-- 7 files changed, 90 insertions(+), 30 deletions(-) create mode 100644 tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index c2e89e7c2c2..7bbecb8916b 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -59,7 +59,7 @@ type OptionSpec = | OptionStringList of (string -> unit) | OptionStringListSwitch of (string -> OptionSwitch -> unit) | OptionUnit of (unit -> unit) - | OptionHelp of (CompilerOptionBlock list -> unit) // like OptionUnit, but given the "options" + | OptionConsoleOnly of (CompilerOptionBlock list -> unit) | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs) and CompilerOption = @@ -95,7 +95,7 @@ let compilerOptionUsage (CompilerOption (s, tag, spec, _, _)) = | OptionUnit _ | OptionSet _ | OptionClear _ - | OptionHelp _ -> sprintf "--%s" s + | OptionConsoleOnly _ -> sprintf "--%s" s | OptionStringList _ -> sprintf "--%s:%s" s tag | OptionIntList _ -> sprintf "--%s:%s" s tag | OptionSwitch _ -> sprintf "--%s[+|-]" s @@ -186,7 +186,7 @@ let dumpCompilerOption prefix (CompilerOption (str, _, spec, _, _)) = | OptionUnit _ -> printf "OptionUnit" | OptionSet _ -> printf "OptionSet" | OptionClear _ -> printf "OptionClear" - | OptionHelp _ -> printf "OptionHelp" + | OptionConsoleOnly _ -> printf "OptionConsoleOnly" | OptionStringList _ -> printf "OptionStringList" | OptionIntList _ -> printf "OptionIntList" | OptionSwitch _ -> printf "OptionSwitch" @@ -347,7 +347,7 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler let rec attempt l = match l with - | CompilerOption (s, _, OptionHelp f, d, _) :: _ when optToken = s && argString = "" -> + | CompilerOption (s, _, OptionConsoleOnly f, d, _) :: _ when optToken = s && argString = "" -> reportDeprecatedOption d f blocks t @@ -1990,13 +1990,13 @@ let displayVersion tcConfigB = let miscFlagsBoth tcConfigB = [ CompilerOption("nologo", tagNone, OptionUnit(fun () -> tcConfigB.showBanner <- false), None, Some(FSComp.SR.optsNologo ())) - CompilerOption("version", tagNone, OptionUnit(fun () -> displayVersion tcConfigB), None, Some(FSComp.SR.optsVersion ())) + CompilerOption("version", tagNone, OptionConsoleOnly(fun _ -> displayVersion tcConfigB), None, Some(FSComp.SR.optsVersion ())) ] let miscFlagsFsc tcConfigB = miscFlagsBoth tcConfigB @ [ - CompilerOption("help", tagNone, OptionHelp(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsHelp ())) + CompilerOption("help", tagNone, OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsHelp ())) CompilerOption("@", tagNone, OptionUnit ignore, None, Some(FSComp.SR.optsResponseFile ())) ] @@ -2052,7 +2052,7 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "?", tagNone, - OptionHelp(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2060,7 +2060,7 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "help", tagNone, - OptionHelp(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2068,7 +2068,7 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "full-help", tagNone, - OptionHelp(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2110,7 +2110,7 @@ let PostProcessCompilerArgs (abbrevArgs: string Set) (args: string[]) = let testingAndQAFlags _tcConfigB = [ - CompilerOption("dumpAllCommandLineOptions", tagNone, OptionHelp(fun blocks -> DumpCompilerOptionBlocks blocks), None, None) // "Command line options") + CompilerOption("dumpAllCommandLineOptions", tagNone, OptionConsoleOnly(fun blocks -> DumpCompilerOptionBlocks blocks), None, None) // "Command line options") ] // Core compiler options, overview @@ -2168,14 +2168,14 @@ let GetCoreFscCompilerOptions (tcConfigB: TcConfigBuilder) = ] /// The core/common options used by the F# VS Language Service. -/// Filter out OptionHelp which does printing then exit. This is not wanted in the context of VS!! +/// Filter out OptionConsoleOnly which do printing then exit (e.g --help or --version). This is not wanted in the context of VS! let GetCoreServiceCompilerOptions (tcConfigB: TcConfigBuilder) = - let isHelpOption = + let isConsoleOnlyOption = function - | CompilerOption (_, _, OptionHelp _, _, _) -> true + | CompilerOption (_, _, OptionConsoleOnly _, _, _) -> true | _ -> false - List.map (FilterCompilerOptionBlock(isHelpOption >> not)) (GetCoreFscCompilerOptions tcConfigB) + List.map (FilterCompilerOptionBlock(isConsoleOnlyOption >> not)) (GetCoreFscCompilerOptions tcConfigB) /// The core/common options used by fsi.exe. [note, some additional options are added in fsi.fs]. let GetCoreFsiCompilerOptions (tcConfigB: TcConfigBuilder) = diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index e5951fa66e8..983a38f5182 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -28,7 +28,7 @@ type OptionSpec = | OptionStringList of (string -> unit) | OptionStringListSwitch of (string -> OptionSwitch -> unit) | OptionUnit of (unit -> unit) - | OptionHelp of (CompilerOptionBlock list -> unit) // like OptionUnit, but given the "options" + | OptionConsoleOnly of (CompilerOptionBlock list -> unit) | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs) and CompilerOption = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 08453ef34bb..32a8ad40592 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -948,12 +948,12 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, ]); PublicOptions(FSComp.SR.optsHelpBannerMisc(), [ CompilerOption("help", tagNone, - OptionHelp (displayHelpFsi tcConfigB), None, Some (FSIstrings.SR.fsiHelp())) + OptionConsoleOnly (displayHelpFsi tcConfigB), None, Some (FSIstrings.SR.fsiHelp())) ]); PrivateOptions( - [ CompilerOption("?", tagNone, OptionHelp (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); - CompilerOption("help", tagNone, OptionHelp (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); - CompilerOption("full-help", tagNone, OptionHelp (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); + [ CompilerOption("?", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); + CompilerOption("help", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); + CompilerOption("full-help", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); ]); PublicOptions(FSComp.SR.optsHelpBannerAdvanced(), [CompilerOption("exec", "", OptionUnit (fun () -> interact <- false), None, Some (FSIstrings.SR.fsiExec())) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 743c0da36fa..491a5e9afa0 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -38,6 +38,7 @@ Symbols.fs + SyntaxTree\TypeTests.fs diff --git a/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs b/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs new file mode 100644 index 00000000000..9d37644e892 --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module FSharp.Compiler.Service.Tests.VisualStudioVersusConsoleContextTests + +open FSharp.Compiler.Text +open NUnit.Framework +open System.IO +open FSharp.Compiler.CompilerConfig +open FSharp.Compiler.CompilerOptions +open Internal.Utilities +open FSharp.Compiler.AbstractIL.ILBinaryReader + +// copypasted from the CompilerOptions code, +// not worth changing that code's accessibility just for this test +let private getOptionsFromOptionBlocks blocks = + let GetOptionsOfBlock block = + match block with + | PublicOptions (_, opts) -> opts + | PrivateOptions opts -> opts + + List.collect GetOptionsOfBlock blocks + +[] // controls https://github.com/dotnet/fsharp/issues/13549 +let ``Console-only options are filtered out for fsc in the VS context`` () = + // just a random thing to make things work + let builder = TcConfigBuilder.CreateNew( + null, + FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value, + ReduceMemoryFlag.Yes, + Directory.GetCurrentDirectory(), + false, + false, + CopyFSharpCoreFlag.No, + (fun _ -> None), + None, + Range.Zero) + + let blocks = GetCoreServiceCompilerOptions builder + let options = getOptionsFromOptionBlocks blocks + + // this is a very whitebox testing but arguably better than nothing + Assert.IsFalse( + options + |> List.exists (function + | CompilerOption (_, _, OptionConsoleOnly _, _, _) -> true + | _ -> false)) + + // and a couple of shots in the dark + Assert.False( + options + |> List.exists (function + // ignore deprecated options + // one of them actually allows specifying the compiler version + | CompilerOption (name, _, _, None, _) -> name = "version" + | _ -> false)) + + Assert.False( + options + |> List.exists (function + | CompilerOption (name, _, _, _, _) -> name = "help")) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs index 23432c4bb50..7b2bcd451e1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs @@ -32,7 +32,7 @@ //section='- LANGUAGE - ' ! option=define kind=OptionString //section='- LANGUAGE - ' ! option=mlcompatibility kind=OptionUnit //section='- MISCELLANEOUS - ' ! option=nologo kind=OptionUnit -//section='- MISCELLANEOUS - ' ! option=help kind=OptionHelp +//section='- MISCELLANEOUS - ' ! option=help kind=OptionConsoleOnly //section='- ADVANCED - ' ! option=codepage kind=OptionInt //section='- ADVANCED - ' ! option=utf8output kind=OptionUnit //section='- ADVANCED - ' ! option=fullpaths kind=OptionUnit @@ -99,9 +99,8 @@ //section='NoSection ' ! option=I kind=OptionStringList //section='NoSection ' ! option=o kind=OptionString //section='NoSection ' ! option=a kind=OptionUnit -//section='NoSection ' ! option=\? kind=OptionHelp -//section='NoSection ' ! option=help kind=OptionHelp -//section='NoSection ' ! option=full-help kind=OptionHelp +//section='NoSection ' ! option=help kind=OptionConsoleOnly +//section='NoSection ' ! option=full-help kind=OptionConsoleOnly //section='NoSection ' ! option=light kind=OptionUnit //section='NoSection ' ! option=indentation-syntax kind=OptionUnit //section='NoSection ' ! option=no-indentation-syntax kind=OptionUnit @@ -114,7 +113,6 @@ //section='NoSection ' ! option=compiling-fslib kind=OptionUnit //section='NoSection ' ! option=compiling-fslib-20 kind=OptionString //section='NoSection ' ! option=compiling-fslib-40 kind=OptionUnit -//section='NoSection ' ! option=version kind=OptionString //section='NoSection ' ! option=local-optimize kind=OptionUnit //section='NoSection ' ! option=no-local-optimize kind=OptionUnit //section='NoSection ' ! option=cross-optimize kind=OptionUnit @@ -130,7 +128,7 @@ //section='NoSection ' ! option=Ooff kind=OptionUnit //section='NoSection ' ! option=ml-keywords kind=OptionUnit //section='NoSection ' ! option=gnu-style-errors kind=OptionUnit -//section='NoSection ' ! option=dumpAllCommandLineOptions kind=OptionHelp +//section='NoSection ' ! option=dumpAllCommandLineOptions kind=OptionConsoleOnly // The following ones are for FSI.EXE only diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index 7d9f0b0f5c0..2f22ee0d2a0 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -85,12 +85,11 @@ //section='NoSection ' ! option=light kind=OptionUnit //section='NoSection ' ! option=indentation-syntax kind=OptionUnit //section='NoSection ' ! option=no-indentation-syntax kind=OptionUnit -//section='NoSection ' ! option=dumpAllCommandLineOptions kind=OptionHelp +//section='NoSection ' ! option=dumpAllCommandLineOptions kind=OptionConsoleOnly //section='- INPUT FILES - ' ! option=-- kind=OptionRest -//section='- MISCELLANEOUS - ' ! option=help kind=OptionHelp -//section='NoSection ' ! option=\? kind=OptionHelp -//section='NoSection ' ! option=help kind=OptionHelp -//section='NoSection ' ! option=full-help kind=OptionHelp +//section='- MISCELLANEOUS - ' ! option=help kind=OptionConsoleOnly +//section='NoSection ' ! option=help kind=OptionConsoleOnly +//section='NoSection ' ! option=full-help kind=OptionConsoleOnly //section='- ADVANCED - ' ! option=exec kind=OptionUnit //section='- ADVANCED - ' ! option=gui kind=OptionSwitch //section='- ADVANCED - ' ! option=quiet kind=OptionUnit @@ -137,6 +136,8 @@ //section='NoSection ' ! option=no-jit-tracking kind=OptionUnit //section='NoSection ' ! option=progress kind=OptionUnit //section='NoSection ' ! option=compiling-fslib kind=OptionUnit +//section='NoSection ' ! option=compiling-fslib-20 kind=OptionString +//section='NoSection ' ! option=version kind=OptionConsoleOnly //section='NoSection ' ! option=compiling-fslib-20 kind=OptionString //section='NoSection ' ! option=version kind=OptionString //section='NoSection ' ! option=local-optimize kind=OptionUnit From f73d7743fbe00b3c37f7296a178e29bca53c5b75 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 22 Aug 2022 19:55:23 +0200 Subject: [PATCH 130/226] Fixed a few typos (#13752) --- .../FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs index ebf57856db3..65ade4f2232 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs @@ -89,7 +89,7 @@ module TaskBuilderDynamicLowPriority = module Value = [] - module TaskLowProrityExtensions = + module TaskLowPriorityExtensions = type TaskBuilderDynamic with member inline _.ReturnFrom<^TaskLike, ^Awaiter, ^T @@ -125,7 +125,7 @@ module Value = [] - module HighLowProrityExtensions = + module HighLowPriorityExtensions = type TaskBuilderDynamic with member inline _.Bind (t: Task<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) : TaskCode<'TOverall, 'TResult2> = From 91e80c7a0aa87387893fcaa8c5b3c7693400dc69 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 22 Aug 2022 11:55:06 -0700 Subject: [PATCH 131/226] To net70 (#13706) * tonet70 * Added test back, removed a attributes mock, since we run on NET7 now; Fixed global.json; Removed arcade change * Update global.json * Update global.json * Bring back /bl Co-authored-by: Vlad Zarytovskii --- .vscode/launch.json | 4 +- FSharpBuild.Directory.Build.targets | 7 +- FSharpTests.Directory.Build.props | 7 +- buildtools/AssemblyCheck/AssemblyCheck.fsproj | 2 +- buildtools/fslex/fslex.fsproj | 2 +- buildtools/fsyacc/fsyacc.fsproj | 2 +- eng/Build.ps1 | 8 +- eng/DumpPackageRoot/DumpPackageRoot.csproj | 2 +- eng/Versions.props | 2 +- eng/build-utils.ps1 | 6 +- eng/build.sh | 10 +- eng/common/tools.sh | 2 +- eng/test-determinism.ps1 | 2 +- .../EditorService/EditorService.fsproj | 2 +- global.json | 8 +- .../Microsoft.FSharp.Compiler.csproj | 2 +- .../Microsoft.FSharp.Compiler.nuspec | 28 +-- src/fsc/fscProject/fsc.fsproj | 6 +- src/fsi/fsi.targets | 2 +- src/fsi/fsiProject/fsi.fsproj | 6 +- .../BasicProvider.DesignTime.fsproj | 2 +- .../BasicProvider.Tests.fsproj | 2 +- .../BasicProvider.Tests/xunit.runner.json | 4 +- .../BasicProvider/BasicProvider.fsproj | 2 +- .../BasicProvider/TestBasicProvider.cmd | 8 +- .../ComboProvider.Tests.fsproj | 2 +- .../ComboProvider.Tests/xunit.runner.json | 4 +- .../ComboProvider/ComboProvider.fsproj | 4 +- .../ComboProvider/TestComboProvider.cmd | 8 +- .../FSharp.Build.UnitTests.fsproj | 4 +- .../AssemblyAlgorithmId_001.fs | 19 -- .../PseudoCustomAttributes.fs | 8 +- .../NoBoxingOnDispose01.fs.il.netcore.bsl | 16 +- ...inq101Aggregates01.fs.il.netcore.debug.bsl | 16 +- ...q101Aggregates01.fs.il.netcore.release.bsl | 16 +- .../Linq101Grouping01.fs.il.netcore.debug.bsl | 12 +- ...inq101Grouping01.fs.il.netcore.release.bsl | 16 +- .../Linq101Joins01.fs.il.netcore.debug.bsl | 12 +- .../Linq101Joins01.fs.il.netcore.release.bsl | 14 +- ...nq101Quantifiers01.fs.il.netcore.debug.bsl | 16 +- ...101Quantifiers01.fs.il.netcore.release.bsl | 16 +- .../Tuples/OptionalArg01.fs.il.netcore.bsl | 14 +- .../Tuples/TupleElimination.fs.il.netcore.bsl | 16 +- .../FSharp.Compiler.ComponentTests.fsproj | 4 +- .../Interop/RequiredAndInitOnlyProperties.fs | 51 +----- .../Interop/StaticsInInterfaces.fs | 171 +++++++++++++++--- .../xunit.runner.json | 2 +- .../DependencyManagerInteractiveTests.fs | 36 ++-- ...ompiler.Private.Scripting.UnitTests.fsproj | 4 +- .../xunit.runner.json | 4 +- .../FSharp.Compiler.Service.Tests.fsproj | 4 +- .../FSharp.Compiler.UnitTests.fsproj | 4 +- .../xunit.runner.json | 1 + .../FSharp.Core.UnitTests.fsproj | 4 +- tests/FSharp.Core.UnitTests/xunit.runner.json | 4 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 2 +- .../FSharp.Test.Utilities.fsproj | 18 +- tests/FSharp.Test.Utilities/TestFramework.fs | 8 +- tests/FSharp.Test.Utilities/Utilities.fs | 2 +- tests/PEVerify/PEVerify.csproj | 18 +- tests/fsharp/FSharpSuite.Tests.fsproj | 4 +- .../Sample_ConsoleApp_net7.fsproj | 4 +- tests/scripts/identifierAnalysisByType.fsx | 2 +- tests/service/EditorTests.fs | 3 + tests/service/ProjectAnalysisTests.fs | 2 + 65 files changed, 387 insertions(+), 306 deletions(-) delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/AssemblyAlgorithmId_001.fs diff --git a/.vscode/launch.json b/.vscode/launch.json index 9d8255dfbee..35d96c984db 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,7 @@ // TODO: Shall we assume that it's already been built, or build it every time we debug? // "preLaunchTask": "Build (Debug)", // If you have changed target frameworks, make sure to update the program p - "program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net6.0/fsi.dll", + "program": "${workspaceFolder}/artifacts/bin/fsi/Debug/net7.0/fsi.dll", "cwd": "${workspaceFolder}/src", "console": "integratedTerminal", // This is the default to be able to run in Codespaces. "internalConsoleOptions": "neverOpen", @@ -42,7 +42,7 @@ // TODO: Shall we assume that it's already been built, or build it every time we debug? // "preLaunchTask": "Build (Debug)", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net6.0/fsc.dll", + "program": "${workspaceFolder}/artifacts/bin/fsc/Debug/net7.0/fsc.dll", "args": [ "${input:argsPrompt}" ], diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index 2cb8142d299..27d4b961e46 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -6,6 +6,11 @@ + + $(DefineConstants);Release + $(DefineConstants);Debug + + Never @@ -137,8 +142,8 @@ diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index d191970e303..2cc7df4372c 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -22,18 +22,18 @@ $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net6.0\fsc.dll + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net7.0\fsc.dll $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net6.0\fsi.dll + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net7.0\fsi.dll <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 - <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">net6.0 + <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">net7.0 <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) $(_FSharpBuildBinPath)\FSharp.Build.dll @@ -42,6 +42,7 @@ $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.props $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.targets $(_FSharpBuildBinPath)/Microsoft.FSharp.Overrides.NetSdk.targets + diff --git a/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/buildtools/AssemblyCheck/AssemblyCheck.fsproj index d396c055fec..d82763ddc2e 100644 --- a/buildtools/AssemblyCheck/AssemblyCheck.fsproj +++ b/buildtools/AssemblyCheck/AssemblyCheck.fsproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 true false diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index fe737d00331..8577bf4e3af 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants) true false diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index 839c919617d..e3a4b88a3a0 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstants) true false diff --git a/eng/Build.ps1 b/eng/Build.ps1 index aaa91bd91f9..010d465d5d4 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -181,11 +181,11 @@ function Process-Arguments() { function Update-Arguments() { if ($script:noVisualStudio) { - $script:bootstrapTfm = "net6.0" + $script:bootstrapTfm = "net7.0" $script:msbuildEngine = "dotnet" } - if ($bootstrapTfm -eq "net6.0") { + if ($bootstrapTfm -eq "net7.0") { if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { $script:bootstrap = $True } @@ -206,7 +206,7 @@ function BuildSolution([string] $solutionName) { $officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" } $toolsetBuildProj = InitializeToolset $quietRestore = !$ci - $testTargetFrameworks = if ($testCoreClr) { "net6.0" } else { "" } + $testTargetFrameworks = if ($testCoreClr) { "net7.0" } else { "" } # Do not set the property to true explicitly, since that would override value projects might set. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } @@ -493,7 +493,7 @@ try { $script:BuildCategory = "Test" $script:BuildMessage = "Failure running tests" $desktopTargetFramework = "net472" - $coreclrTargetFramework = "net6.0" + $coreclrTargetFramework = "net7.0" if ($testDesktop) { TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -noTestFilter $true diff --git a/eng/DumpPackageRoot/DumpPackageRoot.csproj b/eng/DumpPackageRoot/DumpPackageRoot.csproj index fb030a52306..913463393a8 100644 --- a/eng/DumpPackageRoot/DumpPackageRoot.csproj +++ b/eng/DumpPackageRoot/DumpPackageRoot.csproj @@ -3,7 +3,7 @@ - net6.0 + net7.0 diff --git a/eng/Versions.props b/eng/Versions.props index 5662763b742..8ee3c5669cf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -93,7 +93,7 @@ 4.3.0 4.3.0 4.3.0 - 4.5.4 + 4.5.5 4.3.0 4.3.1 4.3.0 diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 2aca2e02a35..2162fc880cf 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -251,9 +251,9 @@ function Make-BootstrapBuild() { } Exec-Console $dotnetExe $args - Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\net6.0" -Destination "$dir\fslex" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\net6.0" -Destination "$dir\fsyacc" -Force -Recurse - Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\net6.0" -Destination "$dir\AssemblyCheck" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\net7.0" -Destination "$dir\fslex" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\net7.0" -Destination "$dir\fsyacc" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\net7.0" -Destination "$dir\AssemblyCheck" -Force -Recurse # prepare compiler $protoProject = "`"$RepoRoot\proto.sln`"" diff --git a/eng/build.sh b/eng/build.sh index 16ecfaf3067..de535261296 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -261,8 +261,8 @@ function BuildSolution { /p:Configuration=$bootstrap_config mkdir -p "$bootstrap_dir" - cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net6.0 $bootstrap_dir/fslex - cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net6.0 $bootstrap_dir/fsyacc + cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net7.0 $bootstrap_dir/fslex + cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net7.0 $bootstrap_dir/fsyacc fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then BuildMessage="Error building bootstrap" @@ -270,7 +270,7 @@ function BuildSolution { /restore \ /p:Configuration=$bootstrap_config - cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net6.0 $bootstrap_dir/fsc + cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net7.0 $bootstrap_dir/fsc fi fi @@ -312,7 +312,7 @@ InitializeDotNetCli $restore BuildSolution if [[ "$test_core_clr" == true ]]; then - coreclrtestframework=net6.0 + coreclrtestframework=net7.0 TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework --notestfilter TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework @@ -322,7 +322,7 @@ if [[ "$test_core_clr" == true ]]; then fi if [[ "$test_compilercomponent_tests" == true ]]; then - coreclrtestframework=net6.0 + coreclrtestframework=net7.0 TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework --notestfilter fi diff --git a/eng/common/tools.sh b/eng/common/tools.sh index c110d0ed410..a5fed41b644 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -490,7 +490,7 @@ function MSBuild-Core { } } - RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" + RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci /bl "$@" } ResolvePath "${BASH_SOURCE[0]}" diff --git a/eng/test-determinism.ps1 b/eng/test-determinism.ps1 index de136c12564..621fe7c6cd4 100644 --- a/eng/test-determinism.ps1 +++ b/eng/test-determinism.ps1 @@ -379,7 +379,7 @@ try { $script:bootstrapTfm = "net472" if ($script:msbuildEngine -eq "dotnet") { - $script.bootstrapTfm = "net6.0" + $script.bootstrapTfm = "net7.0" } $bootstrapDir = Make-BootstrapBuild diff --git a/fcs-samples/EditorService/EditorService.fsproj b/fcs-samples/EditorService/EditorService.fsproj index 56654b8ee52..6e5b8d99e30 100644 --- a/fcs-samples/EditorService/EditorService.fsproj +++ b/fcs-samples/EditorService/EditorService.fsproj @@ -1,7 +1,7 @@  - $(FcsTargetNetFxFramework);net6.0 + $(FcsTargetNetFxFramework);net7.0 true Exe false diff --git a/global.json b/global.json index 9d3ac79cf22..3790ed6b19c 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "7.0.100-preview.7.22377.5", + "version": "7.0.100-preview.6.22352.1", "allowPrerelease": true, "rollForward": "latestMajor" }, "tools": { - "dotnet": "7.0.100-preview.7.22377.5", + "dotnet": "7.0.100-preview.6.22352.1", "vs": { "version": "17.0", "components": [ @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22419.1", - "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22411.2" } } diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj index a16bc1310ee..507a90a4ec8 100644 --- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj +++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj @@ -3,7 +3,7 @@ true Exe - net6.0 + net7.0 Microsoft.FSharp.Compiler.nuspec true .NET Core compatible version of the F# compiler fsc.exe. diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec index ee67b15c5d5..c87a70d9d62 100644 --- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec +++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.nuspec @@ -4,7 +4,7 @@ $CommonMetadataElements$ en-US - + @@ -26,16 +26,16 @@ this approach gives a very small deployment. Which is kind of necessary. --> - - - - - - + + + + + + + target="lib\net7.0" /> + target="lib\net7.0" /> @@ -46,14 +46,14 @@ - + + target="lib\net7.0" /> - + target="lib\net7.0" /> + + target="lib\net7.0" /> - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 x86 Debug;Release;Proto net472 - net6.0 + net7.0 x86 diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index ce90d34c3cc..6b6e89dc6f4 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -50,7 +50,7 @@ - + diff --git a/src/fsi/fsiProject/fsi.fsproj b/src/fsi/fsiProject/fsi.fsproj index 46ca382c3e0..9708c234241 100644 --- a/src/fsi/fsiProject/fsi.fsproj +++ b/src/fsi/fsiProject/fsi.fsproj @@ -3,15 +3,15 @@ - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 x86 Debug;Release;Proto net472 - net6.0 + net7.0 x86 diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj index 40a1d338863..ab0d33bd429 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.DesignTime/BasicProvider.DesignTime.fsproj @@ -2,7 +2,7 @@ Library - net6.0;net472 + net7.0;net472 typeproviders NO_GENERATIVE IS_DESIGNTIME diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 0c0b7bf1599..0217a4c96cc 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net6.0 + net7.0 $(TestTargetFramework) false NO_GENERATIVE diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/xunit.runner.json b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/xunit.runner.json index c6fd41b7143..af18dd40389 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/xunit.runner.json +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/xunit.runner.json @@ -1,3 +1,5 @@ { + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "ifAvailable", "parallelizeTestCollections": false - } \ No newline at end of file +} \ No newline at end of file diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj index 1de65f297f7..6dc26094835 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider/BasicProvider.fsproj @@ -2,7 +2,7 @@ Library - net6.0;net472 + net7.0;net472 typeproviders $(FSharpCoreShippedPackageVersionValue) typeproviders diff --git a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd index f7323c64e3c..b9d1058aff0 100644 --- a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd +++ b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuratio dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuratio dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test BasicProvider.Tests\BasicProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure :success diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index ca6383066e8..080aea65994 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net6.0 + net7.0 $(TestTargetFramework) false $(FSharpCoreShippedPackageVersionValue) diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/xunit.runner.json b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/xunit.runner.json index c6fd41b7143..af18dd40389 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/xunit.runner.json +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/xunit.runner.json @@ -1,3 +1,5 @@ { + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "ifAvailable", "parallelizeTestCollections": false - } \ No newline at end of file +} \ No newline at end of file diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj index 9fd278953c4..7834c472955 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj @@ -2,9 +2,9 @@ Library - net6.0;net472 + net7.0;net472 $(FSharpCoreShippedPackageVersionValue) - net6.0;net472 + net7.0;net472 diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index fc72e514487..29ad4ced449 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index bbd530593de..4ba4fc315c9 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -3,8 +3,8 @@ - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 Library true nunit diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/AssemblyAlgorithmId_001.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/AssemblyAlgorithmId_001.fs deleted file mode 100644 index e9e438683c4..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/AssemblyAlgorithmId_001.fs +++ /dev/null @@ -1,19 +0,0 @@ -// #Regression #Attributes #Assemblies -// AssemblyAttributes -// See FSHARP1.0:832,1674,1675 and 2290 -// Attribute under test: AssemblyAlgorithmId -// - -#light - -open System -open System.Reflection; -open System.Configuration.Assemblies - -let CheckAssemblyAttribute () = - let alg = Assembly.GetExecutingAssembly().GetName().HashAlgorithm - printfn "%A" alg - if not (AssemblyHashAlgorithm.MD5 = alg) then raise (new Exception("Invalid Assembly Hash Algorithm")) - -[] -CheckAssemblyAttribute () diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/PseudoCustomAttributes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/PseudoCustomAttributes.fs index fcfaa5eabb9..e8d7dbe864e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/PseudoCustomAttributes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PseudoCustomAttributes/PseudoCustomAttributes.fs @@ -14,9 +14,11 @@ module ``PseudoCustomAttributes Test Cases`` = |> compileAndRun |> shouldSucceed - [] - let ``PseudoCustomAttributes - AssemblyAlgorithmId_001_fs`` compilation = - ``PseudoCustomAttributes - Compile and Run`` compilation + let ``PseudoCustomAttributes - Fail to compile`` compilation = + compilation + |> asExe + |> compile + |> shouldFail [] let ``PseudoCustomAttributes - AssemblyCompany_001_fs`` compilation = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/NoBoxingOnDispose01.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/NoBoxingOnDispose01.fs.il.netcore.bsl index 5355f7cc6b9..f24777aa47f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/NoBoxingOnDispose01.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/NoBoxingOnDispose01.fs.il.netcore.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -17,7 +17,7 @@ .assembly extern System.Collections { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly NoBoxingOnDispose01 { @@ -26,29 +26,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.NoBoxingOnDispose01 { - // Offset: 0x00000000 Length: 0x00000273 + // Offset: 0x00000000 Length: 0x00000265 // WARNING: managed resource file FSharpSignatureData.NoBoxingOnDispose01 created } .mresource public FSharpOptimizationData.NoBoxingOnDispose01 { - // Offset: 0x00000278 Length: 0x0000007F + // Offset: 0x00000270 Length: 0x0000007F // WARNING: managed resource file FSharpOptimizationData.NoBoxingOnDispose01 created } .module NoBoxingOnDispose01.exe -// MVID: {625064D9-1DEF-36DA-A745-0383D9645062} +// MVID: {63000B04-646B-FCF2-A745-0383040B0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000001CC2A200000 +// Image base: 0x000001ABC6B70000 // =============== CLASS MEMBERS DECLARATION =================== @@ -113,4 +113,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\Misc\NoBoxingOnDispose01_fs\NoBoxingOnDispose01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\Misc\NoBoxingOnDispose01_fs\NoBoxingOnDispose01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.debug.bsl index 6665553f1bb..a9d9028cbf8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.debug.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern netstandard { @@ -35,29 +35,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Aggregates01 { - // Offset: 0x00000000 Length: 0x00000625 + // Offset: 0x00000000 Length: 0x00000617 // WARNING: managed resource file FSharpSignatureData.Linq101Aggregates01 created } .mresource public FSharpOptimizationData.Linq101Aggregates01 { - // Offset: 0x00000630 Length: 0x00000211 + // Offset: 0x00000620 Length: 0x00000211 // WARNING: managed resource file FSharpOptimizationData.Linq101Aggregates01 created } .module Linq101Aggregates01.exe -// MVID: {625D0767-5C27-3B28-A745-038367075D62} +// MVID: {63000AAB-ADDC-5E50-A745-0383AB0A0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000001EEBEAD0000 +// Image base: 0x00000203E8180000 // =============== CLASS MEMBERS DECLARATION =================== @@ -7383,4 +7383,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Aggregates01_fs\Linq101Aggregates01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Aggregates01_fs\Linq101Aggregates01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.release.bsl index 871d93a64a6..2b95344d822 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.fs.il.netcore.release.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern netstandard { @@ -35,29 +35,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Aggregates01 { - // Offset: 0x00000000 Length: 0x00000629 + // Offset: 0x00000000 Length: 0x0000061B // WARNING: managed resource file FSharpSignatureData.Linq101Aggregates01 created } .mresource public FSharpOptimizationData.Linq101Aggregates01 { - // Offset: 0x00000630 Length: 0x00000211 + // Offset: 0x00000620 Length: 0x00000211 // WARNING: managed resource file FSharpOptimizationData.Linq101Aggregates01 created } .module Linq101Aggregates01.exe -// MVID: {625D07A7-A6E4-36D4-A745-0383A7075D62} +// MVID: {630166A9-C2E4-58B4-A745-0383A9660163} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000019484F50000 +// Image base: 0x000001EC1FEC0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -7347,4 +7347,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Aggregates01_fs\Linq101Aggregates01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Aggregates01_fs\Linq101Aggregates01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.debug.bsl index 430076423eb..a4afea5397e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.debug.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -17,7 +17,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern Utils { @@ -35,7 +35,7 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 @@ -51,13 +51,13 @@ // WARNING: managed resource file FSharpOptimizationData.Linq101Grouping01 created } .module Linq101Grouping01.exe -// MVID: {62466677-0219-3271-A745-038377664662} +// MVID: {63000ADE-5D79-11DF-A745-0383DE0A0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00000216B04E0000 +// Image base: 0x00000214C8650000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1633,4 +1633,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Grouping01_fs\Linq101Grouping01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Grouping01_fs\Linq101Grouping01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.release.bsl index 430076423eb..0f3799a5231 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Grouping01.fs.il.netcore.release.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -17,7 +17,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern Utils { @@ -35,29 +35,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Grouping01 { - // Offset: 0x00000000 Length: 0x00000433 + // Offset: 0x00000000 Length: 0x00000437 // WARNING: managed resource file FSharpSignatureData.Linq101Grouping01 created } .mresource public FSharpOptimizationData.Linq101Grouping01 { - // Offset: 0x00000438 Length: 0x00000129 + // Offset: 0x00000440 Length: 0x00000129 // WARNING: managed resource file FSharpOptimizationData.Linq101Grouping01 created } .module Linq101Grouping01.exe -// MVID: {62466677-0219-3271-A745-038377664662} +// MVID: {630166A9-7770-CD7D-A745-0383A9660163} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00000216B04E0000 +// Image base: 0x000002B493560000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1633,4 +1633,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Grouping01_fs\Linq101Grouping01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Grouping01_fs\Linq101Grouping01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.debug.bsl index 1a2093eeda1..75514e378e0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.debug.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly Linq101Joins01 { @@ -30,7 +30,7 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 @@ -46,13 +46,13 @@ // WARNING: managed resource file FSharpOptimizationData.Linq101Joins01 created } .module Linq101Joins01.exe -// MVID: {62466677-6178-290A-A745-038377664662} +// MVID: {63000ADE-0931-10AC-A745-0383DE0A0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000001F462290000 +// Image base: 0x000001FCA7FD0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1383,4 +1383,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Joins01_fs\Linq101Joins01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Joins01_fs\Linq101Joins01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.release.bsl index 1a2093eeda1..3961b9e5543 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Joins01.fs.il.netcore.release.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly Linq101Joins01 { @@ -30,14 +30,14 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Joins01 { - // Offset: 0x00000000 Length: 0x00000337 + // Offset: 0x00000000 Length: 0x0000033B // WARNING: managed resource file FSharpSignatureData.Linq101Joins01 created } .mresource public FSharpOptimizationData.Linq101Joins01 @@ -46,13 +46,13 @@ // WARNING: managed resource file FSharpOptimizationData.Linq101Joins01 created } .module Linq101Joins01.exe -// MVID: {62466677-6178-290A-A745-038377664662} +// MVID: {630166A9-E106-41F6-A745-0383A9660163} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000001F462290000 +// Image base: 0x000001A95D7B0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1383,4 +1383,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Joins01_fs\Linq101Joins01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Joins01_fs\Linq101Joins01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.debug.bsl index 4c484a482ce..bc361cd6f16 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.debug.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly Linq101Quantifiers01 { @@ -30,29 +30,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Quantifiers01 { - // Offset: 0x00000000 Length: 0x000003D4 + // Offset: 0x00000000 Length: 0x000003C6 // WARNING: managed resource file FSharpSignatureData.Linq101Quantifiers01 created } .mresource public FSharpOptimizationData.Linq101Quantifiers01 { - // Offset: 0x000003D8 Length: 0x000000FF + // Offset: 0x000003D0 Length: 0x000000FF // WARNING: managed resource file FSharpOptimizationData.Linq101Quantifiers01 created } .module Linq101Quantifiers01.exe -// MVID: {62501638-A151-2366-A745-038338165062} +// MVID: {63000ADE-997D-5A3D-A745-0383DE0A0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000019211ED0000 +// Image base: 0x0000013E12CE0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1477,4 +1477,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Quantifiers01_fs\Linq101Quantifiers01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Quantifiers01_fs\Linq101Quantifiers01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.release.bsl index ee20176bdff..a264e5e7b9b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.fs.il.netcore.release.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -21,7 +21,7 @@ .assembly extern System.Linq { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly Linq101Quantifiers01 { @@ -30,29 +30,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.Linq101Quantifiers01 { - // Offset: 0x00000000 Length: 0x000003D8 + // Offset: 0x00000000 Length: 0x000003CA // WARNING: managed resource file FSharpSignatureData.Linq101Quantifiers01 created } .mresource public FSharpOptimizationData.Linq101Quantifiers01 { - // Offset: 0x000003E0 Length: 0x000000FF + // Offset: 0x000003D0 Length: 0x000000FF // WARNING: managed resource file FSharpOptimizationData.Linq101Quantifiers01 created } .module Linq101Quantifiers01.exe -// MVID: {624FDC53-732E-3CDE-A745-038353DC4F62} +// MVID: {630166A9-948D-9109-A745-0383A9660163} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000001F8100A0000 +// Image base: 0x000001ABB0BE0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -1477,4 +1477,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\QueryExpressionStepping\Linq101Quantifiers01_fs\Linq101Quantifiers01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net7.0\tests\EmittedIL\QueryExpressionStepping\Linq101Quantifiers01_fs\Linq101Quantifiers01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/OptionalArg01.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/OptionalArg01.fs.il.netcore.bsl index 14424e4be85..a5c4849206a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/OptionalArg01.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/OptionalArg01.fs.il.netcore.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -17,7 +17,7 @@ .assembly extern System.Collections { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly OptionalArg01 { @@ -26,14 +26,14 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.OptionalArg01 { - // Offset: 0x00000000 Length: 0x0000049B + // Offset: 0x00000000 Length: 0x00000497 // WARNING: managed resource file FSharpSignatureData.OptionalArg01 created } .mresource public FSharpOptimizationData.OptionalArg01 @@ -42,13 +42,13 @@ // WARNING: managed resource file FSharpOptimizationData.OptionalArg01 created } .module OptionalArg01.exe -// MVID: {624CEE83-1E6F-95CC-A745-038383EE4C62} +// MVID: {63000B04-F3D9-4E0B-A745-0383040B0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000002154A2E0000 +// Image base: 0x000001AEAA550000 // =============== CLASS MEMBERS DECLARATION =================== @@ -633,4 +633,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\Tuples\OptionalArg01_fs\OptionalArg01.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\Tuples\OptionalArg01_fs\OptionalArg01.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/TupleElimination.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/TupleElimination.fs.il.netcore.bsl index 91e04cf7eca..d2aa400dc0d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/TupleElimination.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Tuples/TupleElimination.fs.il.netcore.bsl @@ -7,7 +7,7 @@ .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly extern FSharp.Core { @@ -17,7 +17,7 @@ .assembly extern System.Collections { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly TupleElimination { @@ -26,29 +26,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.TupleElimination { - // Offset: 0x00000000 Length: 0x0000026E + // Offset: 0x00000000 Length: 0x0000026A // WARNING: managed resource file FSharpSignatureData.TupleElimination created } .mresource public FSharpOptimizationData.TupleElimination { - // Offset: 0x00000278 Length: 0x0000007B + // Offset: 0x00000270 Length: 0x0000007B // WARNING: managed resource file FSharpOptimizationData.TupleElimination created } .module TupleElimination.exe -// MVID: {624CEE83-634F-F584-A745-038383EE4C62} +// MVID: {63000B04-FB1F-9C57-A745-0383040B0063} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000024D054E0000 +// Image base: 0x000001A54EA70000 // =============== CLASS MEMBERS DECLARATION =================== @@ -256,4 +256,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file c:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\Tuples\TupleElimination_fs\TupleElimination.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net7.0\tests\EmittedIL\Tuples\TupleElimination_fs\TupleElimination.res diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index d17427244c0..3015cfd8873 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -3,8 +3,8 @@ - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 Library false true diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs index 90ba1699311..4af0d6d280a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs @@ -23,25 +23,6 @@ module ``Required and init-only properties`` = let csharpRBaseClass = CSharp """ - // Until we move to .NET7 runtime (or use experimental) - namespace System.Runtime.CompilerServices - { - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] - public sealed class RequiredMemberAttribute : Attribute { } - [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] - public sealed class CompilerFeatureRequiredAttribute : Attribute - { - public CompilerFeatureRequiredAttribute(string featureName) - { - FeatureName = featureName; - } - public string FeatureName { get; } - public bool IsOptional { get; init; } - public const string RefStructs = nameof(RefStructs); - public const string RequiredMembers = nameof(RequiredMembers); - } - } - namespace RequiredAndInitOnlyProperties { public sealed class RAIO @@ -382,32 +363,7 @@ let main _ = let ``F# should only be able to explicitly call constructors which set SetsRequiredMembersAttribute`` () = let csharpLib = - CSharp """ - // Until we move to .NET7 runtime (or use experimental) - namespace System.Runtime.CompilerServices - { - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] - public sealed class RequiredMemberAttribute : Attribute { } - [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] - public sealed class CompilerFeatureRequiredAttribute : Attribute - { - public CompilerFeatureRequiredAttribute(string featureName) - { - FeatureName = featureName; - } - public string FeatureName { get; } - public bool IsOptional { get; init; } - public const string RefStructs = nameof(RefStructs); - public const string RequiredMembers = nameof(RequiredMembers); - } - } - - namespace System.Diagnostics.CodeAnalysis - { - [AttributeUsage(AttributeTargets.Constructor, AllowMultiple=false, Inherited=false)] - public sealed class SetsRequiredMembersAttribute : Attribute {} - } - + CSharp """ namespace RequiredAndInitOnlyProperties { using System.Runtime.CompilerServices; @@ -466,14 +422,11 @@ let main _ = [] #endif let ``F# should produce a warning if RequiredMemberAttribute is specified`` () = - // TODO: This test will start failing with different reason when we will move to .NET7, since RequiredMemberArgument will be in System.Runtime.*.dll. - // It will needs to be fixed then. let fsharpSource = """ namespace FooBarBaz open System open System.Runtime.CompilerServices - type RAIOFS() = [] member val GetSet = 0 with get, set @@ -483,4 +436,4 @@ type RAIOFS() = |> withLangVersionPreview |> compile |> shouldFail - |> withErrorCode 39 \ No newline at end of file + |> withSingleDiagnostic (Warning 202, Line 6, Col 7, Line 6, Col 21, "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.") \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs index 2b7f9e8c87a..320804e2c7c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs @@ -380,9 +380,6 @@ let main _ = 0 #nowarn "3535" namespace Tests -[] -do() - module Test = type IAdditionOperator<'T> = @@ -407,32 +404,33 @@ module Test = |> compileAndRun |> shouldSucceed |> verifyIL [ +#if Release """ .class public abstract auto ansi sealed Tests.Test extends [runtime]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 ) + .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 ) .class interface abstract auto ansi serializable nested public IAdditionOperator`1 { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public hidebysig static abstract virtual + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig static abstract virtual !T op_Addition(!T A_0, !T A_1) cil managed { - } + } - } + } .class auto ansi serializable nested public C extends [runtime]System.Object implements class Tests.Test/IAdditionOperator`1 { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly int32 c - .method public specialname rtspecialname + .method public specialname rtspecialname instance void .ctor(int32 c) cil managed { - + .maxstack 8 IL_0000: ldarg.0 IL_0001: callvirt instance void [runtime]System.Object::.ctor() @@ -442,25 +440,25 @@ module Test = IL_0009: ldarg.1 IL_000a: stfld int32 Tests.Test/C::c IL_000f: ret - } + } - .method public hidebysig specialname + .method public hidebysig specialname instance int32 get_Value() cil managed { - + .maxstack 8 IL_0000: ldarg.0 IL_0001: ldfld int32 Tests.Test/C::c IL_0006: ret - } + } - .method public hidebysig static class Tests.Test/C + .method public hidebysig static class Tests.Test/C 'Tests.Test.IAdditionOperator.op_Addition'(class Tests.Test/C x, class Tests.Test/C y) cil managed { .override method !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, !0) - + .maxstack 8 IL_0000: ldarg.0 IL_0001: ldfld int32 Tests.Test/C::c @@ -469,18 +467,18 @@ module Test = IL_000c: add IL_000d: newobj instance void Tests.Test/C::.ctor(int32) IL_0012: ret - } + } .property instance int32 Value() { .get instance int32 Tests.Test/C::get_Value() - } - } + } + } .method public static !!T f<(class Tests.Test/IAdditionOperator`1) T>(!!T x, !!T y) cil managed { - + .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 @@ -488,13 +486,13 @@ module Test = IL_0008: call !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, !0) IL_000d: ret - } + } .method public static int32 main(string[] _arg1) cil managed { .entrypoint - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) - + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 4 .locals init (class Tests.Test/C V_0, class Tests.Test/C V_1) @@ -519,10 +517,129 @@ module Test = IL_002e: ldc.i4.0 IL_002f: ret - } + } + +} + """ +#else + """ +.class public abstract auto ansi sealed Tests.Test + extends [runtime]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 ) + .class interface abstract auto ansi serializable nested public IAdditionOperator`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig static abstract virtual + !T op_Addition(!T A_0, + !T A_1) cil managed + { + } + + } + + .class auto ansi serializable nested public C + extends [runtime]System.Object + implements class Tests.Test/IAdditionOperator`1 + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 c + .method public specialname rtspecialname + instance void .ctor(int32 c) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 Tests.Test/C::c + IL_000f: ret + } + + .method public hidebysig specialname + instance int32 get_Value() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Tests.Test/C::c + IL_0006: ret + } + + .method public hidebysig static class Tests.Test/C + 'Tests.Test.IAdditionOperator.op_Addition'(class Tests.Test/C x, + class Tests.Test/C y) cil managed + { + .override method !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 Tests.Test/C::c + IL_0006: ldarg.1 + IL_0007: ldfld int32 Tests.Test/C::c + IL_000c: add + IL_000d: newobj instance void Tests.Test/C::.ctor(int32) + IL_0012: ret + } + + .property instance int32 Value() + { + .get instance int32 Tests.Test/C::get_Value() + } + } + + .method public static !!T f<(class Tests.Test/IAdditionOperator`1) T>(!!T x, + !!T y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: constrained. !!T + IL_0008: call !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + IL_000d: ret + } + + .method public static int32 main(string[] _arg1) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class Tests.Test/C V_0, + class Tests.Test/C V_1) + IL_0000: ldc.i4.3 + IL_0001: newobj instance void Tests.Test/C::.ctor(int32) + IL_0006: stloc.0 + IL_0007: ldc.i4.4 + IL_0008: newobj instance void Tests.Test/C::.ctor(int32) + IL_000d: stloc.1 + IL_000e: ldloc.0 + IL_000f: ldloc.1 + IL_0010: constrained. Tests.Test/C + IL_0016: call !0 class Tests.Test/IAdditionOperator`1::op_Addition(!0, + !0) + IL_001b: ldfld int32 Tests.Test/C::c + IL_0020: ldc.i4.7 + IL_0021: beq.s IL_002e + + IL_0023: ldstr "incorrect value" + IL_0028: call class [runtime]System.Exception [FSharp.Core]Microsoft.FSharp.Core.Operators::Failure(string) + IL_002d: throw + + IL_002e: ldc.i4.0 + IL_002f: ret + } -} - """ ] +} + """ +#endif + ] #if !NETCOREAPP [] diff --git a/tests/FSharp.Compiler.ComponentTests/xunit.runner.json b/tests/FSharp.Compiler.ComponentTests/xunit.runner.json index e53c283f137..2d07715ae5f 100644 --- a/tests/FSharp.Compiler.ComponentTests/xunit.runner.json +++ b/tests/FSharp.Compiler.ComponentTests/xunit.runner.json @@ -1,6 +1,6 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "appDomain": "denied", + "appDomain": "ifAvailable", "shadowCopy": false, "parallelizeTestCollections": false, "maxParallelThreads": 1 diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 2d54bbbea11..034ce9364a2 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -88,7 +88,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(1, result.SourceFiles |> Seq.length) Assert.Equal(2, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net6.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net7.0") Assert.Equal(true, result.Success) Assert.Equal(1, result.Resolutions |> Seq.length) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -110,7 +110,7 @@ type DependencyManagerInteractiveTests() = let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite, 3.1.8"|], reportError, "net6.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite, 3.1.8"|], reportError, "net7.0") Assert.Equal(true, result.Success) Assert.True((result.Resolutions |> Seq.length) > 1) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -140,7 +140,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(0, result.SourceFiles |> Seq.length) Assert.Equal(0, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "System.Collections.Immutable.DoesNotExist"|], reportError, "net6.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "System.Collections.Immutable.DoesNotExist"|], reportError, "net7.0") Assert.Equal(false, result.Success) Assert.Equal(0, result.Resolutions |> Seq.length) Assert.Equal(0, result.SourceFiles |> Seq.length) @@ -173,7 +173,7 @@ type DependencyManagerInteractiveTests() = Assert.True((result1.Roots |> Seq.head).EndsWith("/fsharp.data/3.3.3/")) Assert.True((result1.Roots |> Seq.last).EndsWith("/microsoft.netframework.referenceassemblies/1.0.0/")) - let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net6.0") + let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net7.0") Assert.Equal(true, result2.Success) Assert.Equal(1, result2.Resolutions |> Seq.length) let expected2 = "/netstandard2.0/" @@ -194,7 +194,7 @@ type DependencyManagerInteractiveTests() = Assert.Equal(1, result3.SourceFiles |> Seq.length) Assert.True((result3.Roots |> Seq.head).EndsWith("/system.json/4.6.0/")) - let result4 = dp2.Resolve(idm2, ".fsx", [|"r", "System.Json, Version=4.6.0"|], reportError, "net6.0") + let result4 = dp2.Resolve(idm2, ".fsx", [|"r", "System.Json, Version=4.6.0"|], reportError, "net7.0") Assert.Equal(true, result4.Success) Assert.Equal(1, result4.Resolutions |> Seq.length) let expected4 = "/netstandard2.0/" @@ -230,7 +230,7 @@ type DependencyManagerInteractiveTests() = // Netstandard gets fewer dependencies than desktop, because desktop framework doesn't contain assemblies like System.Memory // Those assemblies must be delivered by nuget for desktop apps - let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "Microsoft.Extensions.Configuration.Abstractions, 3.1.1"|], reportError, "net6.0") + let result2 = dp1.Resolve(idm1, ".fsx", [|"r", "Microsoft.Extensions.Configuration.Abstractions, 3.1.1"|], reportError, "net7.0") Assert.Equal(true, result2.Success) Assert.Equal(2, result2.Resolutions |> Seq.length) let expected = "/netcoreapp3.1/" @@ -287,7 +287,7 @@ TorchSharp.Tensor.LongTensor.From([| 0L .. 100L |]).Device let result = use dp = new DependencyProvider(AssemblyResolutionProbe(assemblyProbingPaths), NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net6.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net7.0") Assert.True(result.Success, "resolve failed") @@ -383,7 +383,7 @@ printfn ""%A"" result let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net6.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net7.0") Assert.True(result.Success, "resolve failed") @@ -464,7 +464,7 @@ printfn ""%A"" result let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net6.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net7.0") Assert.True(result.Success, "resolve failed") @@ -521,7 +521,7 @@ x |> Seq.iter(fun r -> let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net6.0") + dp.Resolve(idm, ".fsx", packagemanagerlines, reportError, "net7.0") // Expected: error FS3217: PackageManager can not reference the System Package 'FSharp.Core' Assert.False(result.Success, "resolve succeeded but should have failed") @@ -547,7 +547,7 @@ x |> Seq.iter(fun r -> let result = use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - dp.Resolve(idm, ".csx", packagemanagerlines, reportError, "net6.0") + dp.Resolve(idm, ".csx", packagemanagerlines, reportError, "net7.0") Assert.True(result.Success, "resolve failed but should have succeeded") @@ -590,7 +590,7 @@ x |> Seq.iter(fun r -> Assert.Equal(1, result.SourceFiles |> Seq.length) Assert.Equal(2, result.Roots |> Seq.length) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net6.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net7.0") Assert.Equal(true, result.Success) Assert.Equal(1, result.Resolutions |> Seq.length) Assert.Equal(1, result.SourceFiles |> Seq.length) @@ -697,7 +697,7 @@ x |> Seq.iter(fun r -> let mutable currentPath:string = null use dp = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite,3.1.7"|], reportError, "net6.0") + let result = dp.Resolve(idm, ".fsx", [|"r", "Microsoft.Data.Sqlite,3.1.7"|], reportError, "net7.0") Assert.Equal(true, result.Success) currentPath <- appendSemiColon (Environment.GetEnvironmentVariable("PATH")) finalPath <- appendSemiColon (Environment.GetEnvironmentVariable("PATH")) @@ -821,7 +821,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net6.0", timeout=0) // Fail in 0 milliseconds + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"|], reportError, "net7.0", timeout=0) // Fail in 0 milliseconds Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) @@ -844,7 +844,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net6.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net7.0", null, "", "", "", -1) // Wait forever Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) @@ -867,7 +867,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=none"|], reportError, "net6.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=none"|], reportError, "net7.0", null, "", "", "", -1) // Wait forever Assert.Equal(true, result.Success) Assert.Equal(foundCorrectError, false) Assert.Equal(foundWrongError, false) @@ -893,7 +893,7 @@ x |> Seq.iter(fun r -> let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") // Resolve and cache the results won't time out - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net6.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net7.0", null, "", "", "", -1) // Wait forever // Clear the results foundCorrectError <- false @@ -902,7 +902,7 @@ x |> Seq.iter(fun r -> // Now clear the cache --- this will ensure that resolving produces a timeout error. If we read from the cache the test will fail dp.ClearResultsCache(Seq.empty, "", reportError) - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net6.0", null, "", "", "", -1) // Wait forever + let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=0"|], reportError, "net7.0", null, "", "", "", -1) // Wait forever Assert.Equal(false, result.Success) Assert.Equal(foundCorrectError, true) Assert.Equal(foundWrongError, false) diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj index c7d26c4bc07..1722be5e285 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj @@ -2,8 +2,8 @@ - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 Library true xunit diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json b/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json index ff6ac3098c1..2d07715ae5f 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json @@ -1,6 +1,6 @@ { - "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "appDomain": "denied", + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "ifAvailable", "shadowCopy": false, "parallelizeTestCollections": false, "maxParallelThreads": 1 diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 491a5e9afa0..606deeeef94 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -3,8 +3,8 @@ Exe - net472;net6.0 - net6.0 + net472;net7.0 + net7.0 - 6 + 7 0 - 6 + 0 0 @@ -28,18 +28,19 @@ $(FSMajorVersion)-$(FSMinorVersion)-$(FSBuildVersion) $(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion) $(FSMajorVersion).$(FSMinorVersion).0.0 + 6.0.0.0 - 41 - 0 - 6 + 42 + 7 + 100 $(FSRevisionVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion) $(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion) - 6.0.3 + 6.0.5 $(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).* @@ -47,7 +48,7 @@ 12 0 - 4 + 5 $(FSRevisionVersion) $(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion) $(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion) diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 683dddd2e4f..48ca4b9be52 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -63,15 +63,16 @@ type LanguageVersion(versionText) = static let languageVersion47 = 4.7m static let languageVersion50 = 5.0m static let languageVersion60 = 6.0m + static let languageVersion70 = 7.0m static let previewVersion = 9999m // Language version when preview specified - static let defaultVersion = languageVersion60 // Language version when default specified + static let defaultVersion = languageVersion70 // Language version when default specified static let latestVersion = defaultVersion // Language version when latest specified - static let latestMajorVersion = languageVersion60 // Language version when latestmajor specified + static let latestMajorVersion = languageVersion70 // Language version when latestmajor specified static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |] static let languageVersions = - set [| languageVersion46; languageVersion47; languageVersion50; languageVersion60 |] + set [| languageVersion46; languageVersion47; languageVersion50; languageVersion60; languageVersion70 |] static let features = dict @@ -110,17 +111,19 @@ type LanguageVersion(versionText) = LanguageFeature.AttributesToRightOfModuleKeyword, languageVersion60 LanguageFeature.DelegateTypeNameResolutionFix, languageVersion60 + // F# 7.0 + LanguageFeature.MLCompatRevisions, languageVersion70 + LanguageFeature.BetterExceptionPrinting, languageVersion70 + LanguageFeature.ReallyLongLists, languageVersion70 + LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, languageVersion70 + LanguageFeature.RequiredPropertiesSupport, languageVersion70 + LanguageFeature.InitPropertiesSupport, languageVersion70 + LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, languageVersion70 + LanguageFeature.InterfacesWithAbstractStaticMembers, languageVersion70 + LanguageFeature.SelfTypeConstraints, languageVersion70 + // F# preview LanguageFeature.FromEndSlicing, previewVersion - LanguageFeature.MLCompatRevisions, previewVersion - LanguageFeature.BetterExceptionPrinting, previewVersion - LanguageFeature.ReallyLongLists, previewVersion - LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, previewVersion - LanguageFeature.RequiredPropertiesSupport, previewVersion - LanguageFeature.InitPropertiesSupport, previewVersion - LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion - LanguageFeature.InterfacesWithAbstractStaticMembers, previewVersion - LanguageFeature.SelfTypeConstraints, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -138,6 +141,8 @@ type LanguageVersion(versionText) = | "5" -> languageVersion50 | "6.0" | "6" -> languageVersion60 + | "7.0" + | "7" -> languageVersion70 | _ -> 0m let specified = getVersionFromString versionText diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 6d4e62518f0..9bfe2497b45 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -56,15 +56,7 @@ - - - - - - + diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index bed3157a649..3191bf8c649 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -4107,7 +4107,6 @@ namespace Microsoft.FSharp.Collections let start = if i < 0 then 0 else i PrivateListHelpers.sliceTake (j - start) (PrivateListHelpers.sliceSkip start l) - [] member l.GetReverseIndex(_: int, offset: int) = l.Length - offset - 1 @@ -6901,10 +6900,8 @@ namespace Microsoft.FSharp.Core if n >= 0 then PowDecimal x n else 1.0M / PowDecimal x n) [] - [] module ArrayExtensions = type ``[,,,]``<'T> with - [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6917,7 +6914,6 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[,,]``<'T> with - [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6929,7 +6925,6 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[,]``<'T> with - [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6940,11 +6935,9 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[]``<'T> with - [] member arr.GetReverseIndex (_: int, offset: int) = arr.Length - offset - 1 type String with - [] member str.GetReverseIndex (_: int, offset: int) = str.Length - offset - 1 namespace Microsoft.FSharp.Control diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index d0e56e1453d..80b48b92345 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -2555,7 +2555,6 @@ namespace Microsoft.FSharp.Collections /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int /// Returns a list with head as its first element and tail as its subsequent elements @@ -4601,7 +4600,6 @@ namespace Microsoft.FSharp.Core /// Contains extension methods to allow the use of F# indexer notation with arrays. /// This module is automatically opened in all F# code. [] - [] module ArrayExtensions = type ``[,,,]``<'T> with /// Get the index for the element offset elements away from the end of the collection. @@ -4610,7 +4608,6 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int type ``[,,]``<'T> with @@ -4620,7 +4617,6 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int type ``[,]``<'T> with @@ -4630,7 +4626,6 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int type ``[]``<'T> with @@ -4640,7 +4635,6 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int type System.String with @@ -4650,7 +4644,6 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. - [] member GetReverseIndex: rank: int * offset: int -> int /// A module of compiler intrinsic functions for efficient implementations of F# integer ranges diff --git a/src/FSharp.Core/tasks.fsi b/src/FSharp.Core/tasks.fsi index 1374895ed1f..8a13212d514 100644 --- a/src/FSharp.Core/tasks.fsi +++ b/src/FSharp.Core/tasks.fsi @@ -15,7 +15,6 @@ namespace Microsoft.FSharp.Control /// The extra data stored in ResumableStateMachine for tasks /// [] - [] [] type TaskStateMachineData<'T> = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs index 65d694c9647..d1094604953 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleDefinitions.fs @@ -244,6 +244,7 @@ module ModuleDefinitions = let ``Production_OCamlCompat_fsx`` compilation = compilation |> withOcamlCompat + |> withLangVersion50 |> verifyCompileAndRun |> shouldSucceed @@ -271,13 +272,13 @@ module ModuleDefinitions = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Warning 62, Line 14, Col 13, Line 14, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 18, Col 13, Line 18, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 22, Col 13, Line 22, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 26, Col 13, Line 26, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 30, Col 13, Line 30, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 35, Col 13, Line 35, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") - (Warning 62, Line 39, Col 13, Line 39, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.") + (Error 62, Line 14, Col 13, Line 14, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 18, Col 13, Line 18, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 22, Col 13, Line 22, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 26, Col 13, Line 26, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 30, Col 13, Line 30, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 35, Col 13, Line 35, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") + (Error 62, Line 39, Col 13, Line 39, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.") ] // diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/UseBindings/UseBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/UseBindings/UseBindings.fs index 1137add48d7..ab71a657e13 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/UseBindings/UseBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/UseBindings/UseBindings.fs @@ -12,7 +12,7 @@ module UseBindings = let ``UseBindings - UseBindingDiscard01_fs - Current LangVersion`` compilation = compilation |> asFsx - |> withOptions ["--langversion:preview"] + |> withLangVersion60 |> compile |> shouldSucceed |> ignore @@ -57,6 +57,6 @@ if ctorCalls <> 1 then """ |> asExe - |> withLangVersionPreview + |> withLangVersion60 |> compileAndRun |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs index e7e465a76d0..f75ee8440a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs @@ -19,6 +19,7 @@ module RecursiveSafetyAnalysis = let ``E_CyclicReference01_fs`` compilation = compilation |> withOptions ["--mlcompatibility"; "--flaterrors"] + |> withLangVersion50 |> asExe |> compile |> shouldFail diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs index aa8cddcba33..20729626a3b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs @@ -39,7 +39,7 @@ module SymbolicOperators = |> compile |> shouldFail |> withErrorCode 0670 - |> withDiagnosticMessageMatches " \^a\) could not be generalized because it would escape its scope" + |> withDiagnosticMessageMatches " 'a\) could not be generalized because it would escape its scope" |> ignore // This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/SymbolicOperators) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs index 8e9b6ae2cff..f00e227c826 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalFiltering/OffsideExceptions/OffsideExceptions.fs @@ -25,7 +25,7 @@ module OffsideExceptions = let RelaxWhitespace2 compilation = compilation |> asFsx - |> withLangVersionPreview + |> withLangVersion60 |> withOptions ["--nowarn:25"] // Incomplete pattern matches on this expression. |> typecheck |> shouldSucceed @@ -35,7 +35,7 @@ module OffsideExceptions = let RelaxWhitespace2_Warning25 compilation = compilation |> asFsx - |> withLangVersionPreview + |> withLangVersion60 |> verifyBaseline |> ignore @@ -58,7 +58,7 @@ while ( true ) do () """ - |> withLangVersionPreview + |> withLangVersion60 |> typecheck |> shouldFail |> withResults [ @@ -228,7 +228,7 @@ module [< Experimental "c" >] c = 1 """ - |> withLangVersionPreview + |> withLangVersion60 |> typecheck |> shouldSucceed |> ignore @@ -276,7 +276,7 @@ module A y = 1 |} """ - |> withLangVersionPreview + |> withLangVersion60 |> typecheck |> shouldFail |> withResult { @@ -328,7 +328,7 @@ module A 1 |} """ - |> withLangVersionPreview + |> withLangVersion60 |> typecheck |> shouldFail |> withResult { @@ -5178,7 +5178,7 @@ match | "" -> "" | _ -> failwith "" """ - |> withLangVersionPreview + |> withLangVersion60 |> withOptions ["--nowarn:20"] |> typecheck |> shouldSucceed @@ -5194,7 +5194,7 @@ try with | ex -> ex.Message """ - |> withLangVersionPreview + |> withLangVersion60 |> withOptions ["--nowarn:20"] |> typecheck |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs index 531da5e160c..2d7f884d746 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/Simple.fs @@ -57,7 +57,7 @@ module Simple = | _ -> failwith "Match failed" """ |> asExe - |> withLangVersionPreview + |> withLangVersion60 |> compileExeAndRun |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 7ff2a44aaf1..9abba91ca2f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -9,13 +9,13 @@ open FSharp.Test.Compiler let typesModule = FSharp (loadSourceFromFile (Path.Combine(__SOURCE_DIRECTORY__, "Types.fs"))) |> withName "Types" - |> withLangVersionPreview + |> withLangVersion70 |> withOptions ["--nowarn:3535"] let setupCompilation compilation = compilation |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [typesModule] @@ -27,6 +27,7 @@ let setupCompilation compilation = let ``IWSAM test files`` compilation = compilation |> setupCompilation + |> withLangVersionPreview |> compileAndRun |> shouldSucceed @@ -67,7 +68,7 @@ let ``IWSAM test files`` compilation = let ``Check static type parameter inference`` code expectedSignature = FSharp code |> ignoreWarnings - |> withLangVersionPreview + |> withLangVersion70 |> signaturesShouldContain expectedSignature @@ -311,7 +312,7 @@ module Negative = |> ignore Fsx code - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withErrorCode 3532 @@ -540,7 +541,7 @@ module ``Implicit conversion`` = let add1 (x: int) = x + 1 """ - |> withLangVersionPreview + |> withLangVersion70 |> withOptions ["--nowarn:3535"] #if !NETCOREAPP @@ -556,7 +557,7 @@ module ``Implicit conversion`` = add1(a) """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" @@ -574,7 +575,7 @@ module ``Implicit conversion`` = C.TakeInt(a) """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" @@ -592,7 +593,7 @@ module ``Implicit conversion`` = add1(int(a)) """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldSucceed @@ -609,7 +610,7 @@ module ``Implicit conversion`` = C.TakeInt(int(a)) """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldSucceed @@ -631,7 +632,7 @@ module ``Nominal type after or`` = if not (callX "A" (C()) = "A OK") then failwith "Unexpected result" """ - |> withLangVersionPreview + |> withLangVersion70 |> asExe |> compileAndRun |> shouldSucceed @@ -645,7 +646,7 @@ module ``Nominal type after or`` = let inline callX (x: 'T) (y: C) = ((C or ^T): (static member X : 'T * C -> string) (x, y));; """ - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withDiagnosticMessageMatches "Unexpected keyword 'static' in binding" @@ -670,7 +671,7 @@ module ``Nominal type after or`` = if not (callX2 (C()) (D()) = "C") then failwith "Unexpected result" """ - |> withLangVersionPreview + |> withLangVersion70 |> asExe |> compileAndRun |> shouldSucceed @@ -694,7 +695,7 @@ module ``Active patterns`` = static member IsGood c = false static member op_Equality (a, b) = false """ - |> withLangVersionPreview + |> withLangVersion70 |> withName "Potato" |> withOptions ["--nowarn:3535"] @@ -715,7 +716,7 @@ module ``Active patterns`` = match Rock() with GoodPotato -> failwith "Unexpected result" | _ -> () """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> compileExeAndRun |> shouldSucceed |> verifyIL [ @@ -753,7 +754,7 @@ module ``Active patterns`` = | IsNonEqual -> () """ |> withReferences [library] - |> withLangVersionPreview + |> withLangVersion70 |> asExe |> compileAndRun |> shouldSucceed @@ -780,7 +781,7 @@ module ``Suppression of System Numerics interfaces on unitized types`` = open System.Numerics let f (x: 'T when 'T :> IMultiplyOperators<'T,'T,'T>) = x;; f 3.0 |> ignore""" - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldSucceed @@ -825,7 +826,7 @@ module ``Suppression of System Numerics interfaces on unitized types`` = let f (x: 'T when {genericType}) = x;; f 3.0 |> ignore""" - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withErrorMessage $"The type 'float' is not compatible with the type '{potatoType}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index 7c96b3ff713..b4c14f7b201 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -60,8 +60,8 @@ module UnionTypes = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 53, Line 9, Col 12, Line 9, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers") - (Error 53, Line 10, Col 12, Line 10, Col 13, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 9, Col 12, Line 9, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + (Error 53, Line 10, Col 12, Line 10, Col 13, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") ] //SOURCE=E_BeginWithUppercase02.fsx SCFLAGS="--test:ErrorRanges" # E_BeginWithUppercase02.fsx @@ -102,8 +102,8 @@ module UnionTypes = |> shouldFail |> withDiagnostics [ (Error 883, Line 7, Col 8, Line 7, Col 13, "Invalid namespace, module, type or union case name") - (Error 53, Line 11, Col 18, Line 11, Col 19, "Discriminated union cases and exception labels must be uppercase identifiers") - (Error 53, Line 12, Col 18, Line 12, Col 19, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 11, Col 18, Line 11, Col 19, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") + (Error 53, Line 12, Col 18, Line 12, Col 19, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") ] //SOURCE=E_GenericFunctionValuedStaticProp01.fs SCFLAGS="--test:ErrorRanges --warnaserror-" # E_GenericFunctionValuedStaticProp01.fs @@ -205,7 +205,7 @@ module UnionTypes = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 53, Line 7, Col 13, Line 7, Col 17, "Discriminated union cases and exception labels must be uppercase identifiers") + (Error 53, Line 7, Col 13, Line 7, Col 17, "Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute") ] //SOURCE=E_Overload_Equals.fs SCFLAGS="--test:ErrorRanges" # E_Overload_Equals.fs @@ -471,6 +471,7 @@ module UnionTypes = let ``SampleFromSpec01b_fsx`` compilation = compilation |> withOcamlCompat + |> withLangVersion50 |> verifyCompileAndRun |> shouldSucceed @@ -521,7 +522,7 @@ module UnionTypes = [] let ``LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion70 |> verifyCompileAndRun |> shouldSucceed @@ -529,7 +530,7 @@ module UnionTypes = [] let ``E_LowercaseWhenRequireQualifiedAccess_fs in preview`` compilation = compilation - |> withLangVersionPreview + |> withLangVersion70 |> verifyCompile |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs index d644b5c25c8..9f932fb436c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/SerializableAttribute.fs @@ -29,14 +29,14 @@ module SerializableAttribute = compilation |> verifyCompilation - // SOURCE=ToplevelModule.fs SCFLAGS="-a -g --langversion:preview --out:TopLevelModule-preview.dll --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ToplevelModule-preview.dll" # ToplevelModule.fs - Desktop preview + // SOURCE=ToplevelModule.fs SCFLAGS="-a -g --langversion:6.0 --out:TopLevelModule-preview.dll --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ToplevelModule-preview.dll" # ToplevelModule.fs - Desktop preview [] let ``ToplevelModule_LangVersion60_fs`` compilation = compilation |> withLangVersion60 |> verifyCompilation - // SOURCE=ToplevelNamespace.fs SCFLAGS="-a -g --langversion:preview --out:ToplevelNamespace-preview.dll --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ToplevelNamespace-preview.dll" # ToplevelNamespace.fs - Desktop preview + // SOURCE=ToplevelNamespace.fs SCFLAGS="-a -g --langversion:6.0 --out:ToplevelNamespace-preview.dll --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ToplevelNamespace-preview.dll" # ToplevelNamespace.fs - Desktop preview [] let ``ToplevelNamespace_LangVersion60_fs`` compilation = compilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl index 59aa70ed458..fff55d0c477 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.debug.bsl @@ -4,15 +4,15 @@ // Metadata version: v4.0.30319 -.assembly extern System.Runtime +.assembly extern mscorlib { - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .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 6:0:0:0 + .ver 7:0:0:0 } .assembly ToplevelModule { @@ -21,52 +21,52 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .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.ToplevelModule { - // Offset: 0x00000000 Length: 0x00001162 + // Offset: 0x00000000 Length: 0x0000116C // WARNING: managed resource file FSharpSignatureData.ToplevelModule created } .mresource public FSharpOptimizationData.ToplevelModule { - // Offset: 0x00001168 Length: 0x00000403 + // Offset: 0x00001170 Length: 0x000003FD // WARNING: managed resource file FSharpOptimizationData.ToplevelModule created } .module ToplevelModule.exe -// MVID: {628F4C90-B9AE-2DE4-A745-0383904C8F62} +// MVID: {62F987D1-3E21-F1E3-A745-0383D187F962} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00000191AC370000 +// Image base: 0x000001EAC2450000 // =============== CLASS MEMBERS DECLARATION =================== .class public abstract auto ansi sealed ABC - extends [System.Runtime]System.Object + 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 ) .class auto autochar serializable sealed nested public beforefieldinit Expr - extends [System.Runtime]System.Object - implements class [System.Runtime]System.IEquatable`1, - [System.Runtime]System.Collections.IStructuralEquatable, - class [System.Runtime]System.IComparable`1, - [System.Runtime]System.IComparable, - [System.Runtime]System.Collections.IStructuralComparable + extends [mscorlib]System.Object + implements class [mscorlib]System.IEquatable`1, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IComparable`1, + [mscorlib]System.IComparable, + [mscorlib]System.Collections.IStructuralComparable { - .custom instance void [System.Runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl - 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl + 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) .field assembly initonly int32 item - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static class ABC/Expr NewNum(int32 item) cil managed { @@ -82,12 +82,12 @@ .method assembly specialname rtspecialname instance void .ctor(int32 item) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 ABC/Expr::item @@ -97,8 +97,8 @@ .method public hidebysig instance int32 get_Item() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -109,8 +109,8 @@ .method public hidebysig instance int32 get_Tag() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 4 (0x4) .maxstack 8 IL_0000: ldarg.0 @@ -122,8 +122,8 @@ .method assembly hidebysig specialname instance object __DebugDisplay() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+0.8A" @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,16 +151,16 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/Expr V_0, class ABC/Expr V_1, - class [System.Runtime]System.Collections.IComparer V_2, + class [mscorlib]System.Collections.IComparer V_2, int32 V_3, int32 V_4, - class [System.Runtime]System.Collections.IComparer V_5, + class [mscorlib]System.Collections.IComparer V_5, int32 V_6, int32 V_7) IL_0000: ldarg.0 @@ -175,7 +175,7 @@ IL_0009: stloc.0 IL_000a: ldarg.1 IL_000b: stloc.1 - IL_000c: call class [System.Runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000c: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() IL_0011: stloc.2 IL_0012: ldloc.0 IL_0013: ldfld int32 ABC/Expr::item @@ -214,8 +214,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -227,19 +227,19 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj, - class [System.Runtime]System.Collections.IComparer comp) cil managed + class [mscorlib]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/Expr V_0, class ABC/Expr V_1, class ABC/Expr V_2, - class [System.Runtime]System.Collections.IComparer V_3, + class [mscorlib]System.Collections.IComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IComparer V_6, + class [mscorlib]System.Collections.IComparer V_6, int32 V_7, int32 V_8) IL_0000: ldarg.1 @@ -296,17 +296,17 @@ } // end of method Expr::CompareTo .method public hidebysig virtual final - instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, class ABC/Expr V_1, - class [System.Runtime]System.Collections.IEqualityComparer V_2, + class [mscorlib]System.Collections.IEqualityComparer V_2, int32 V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4) + class [mscorlib]System.Collections.IEqualityComparer V_4) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0029 @@ -347,32 +347,32 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 ABC/Expr::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method Expr::GetHashCode .method public hidebysig virtual final instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/Expr V_0, class ABC/Expr V_1, class ABC/Expr V_2, class ABC/Expr V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4, + class [mscorlib]System.Collections.IEqualityComparer V_4, int32 V_5, int32 V_6, - class [System.Runtime]System.Collections.IEqualityComparer V_7) + class [mscorlib]System.Collections.IEqualityComparer V_7) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0035 @@ -419,8 +419,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -458,8 +458,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -480,9 +480,9 @@ .property instance int32 Tag() { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .get instance int32 ABC/Expr::get_Tag() } // end of property Expr::Tag .property instance int32 Item() @@ -490,15 +490,15 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance int32 ABC/Expr::get_Item() } // end of property Expr::Item } // end of class Expr .class auto ansi serializable nested public beforefieldinit MyExn - extends [System.Runtime]System.Exception - implements [System.Runtime]System.Collections.IStructuralEquatable + extends [mscorlib]System.Exception + implements [mscorlib]System.Collections.IStructuralEquatable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 ) .field assembly int32 Data0@ @@ -508,7 +508,7 @@ // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 ABC/MyExn::Data0@ @@ -521,21 +521,21 @@ // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method MyExn::.ctor .method family specialname rtspecialname - instance void .ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo info, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext context) cil managed + instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed { // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 - IL_0003: call instance void [System.Runtime]System.Exception::.ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext) + IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext) IL_0008: ret } // end of method MyExn::.ctor @@ -549,17 +549,31 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() 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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 - GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, - class [System.Runtime]System.Collections.IEqualityComparer V_1, + class [mscorlib]System.Collections.IEqualityComparer V_1, int32 V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3) + class [mscorlib]System.Collections.IEqualityComparer V_3) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0027 @@ -595,36 +609,36 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 ABC/MyExn::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method MyExn::GetHashCode .method public hidebysig virtual instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0, - class [System.Runtime]System.Exception V_1, + .locals init (class [mscorlib]System.Exception V_0, + class [mscorlib]System.Exception V_1, object V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3, + class [mscorlib]System.Collections.IEqualityComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IEqualityComparer V_6) + class [mscorlib]System.Collections.IEqualityComparer V_6) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0046 IL_0003: ldarg.1 - IL_0004: isinst [System.Runtime]System.Exception + IL_0004: isinst [mscorlib]System.Exception IL_0009: stloc.0 IL_000a: ldloc.0 IL_000b: brfalse.s IL_0044 @@ -671,10 +685,10 @@ } // end of method MyExn::Equals .method public hidebysig instance bool - Equals(class [System.Runtime]System.Exception obj) cil managed + Equals(class [mscorlib]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -718,20 +732,20 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0) + .locals init (class [mscorlib]System.Exception V_0) IL_0000: ldarg.1 - IL_0001: isinst [System.Runtime]System.Exception + IL_0001: isinst [mscorlib]System.Exception IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: brfalse.s IL_0012 IL_000a: ldarg.0 IL_000b: ldloc.0 - IL_000c: callvirt instance bool ABC/MyExn::Equals(class [System.Runtime]System.Exception) + IL_000c: callvirt instance bool ABC/MyExn::Equals(class [mscorlib]System.Exception) IL_0011: ret IL_0012: ldc.i4.0 @@ -747,7 +761,7 @@ } // end of class MyExn .class auto ansi serializable nested public A - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x @@ -757,7 +771,7 @@ // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [System.Runtime]System.Object::.ctor() + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -783,24 +797,24 @@ } // end of class A .class abstract auto ansi sealed nested public ABC - extends [System.Runtime]System.Object + 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 ) .class auto autochar serializable sealed nested public beforefieldinit Expr - extends [System.Runtime]System.Object - implements class [System.Runtime]System.IEquatable`1, - [System.Runtime]System.Collections.IStructuralEquatable, - class [System.Runtime]System.IComparable`1, - [System.Runtime]System.IComparable, - [System.Runtime]System.Collections.IStructuralComparable + extends [mscorlib]System.Object + implements class [mscorlib]System.IEquatable`1, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IComparable`1, + [mscorlib]System.IComparable, + [mscorlib]System.Collections.IStructuralComparable { - .custom instance void [System.Runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl - 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl + 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) .field assembly initonly int32 item - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static class ABC/ABC/Expr NewNum(int32 item) cil managed { @@ -816,12 +830,12 @@ .method assembly specialname rtspecialname instance void .ctor(int32 item) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 ABC/ABC/Expr::item @@ -831,8 +845,8 @@ .method public hidebysig instance int32 get_Item() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -843,8 +857,8 @@ .method public hidebysig instance int32 get_Tag() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 4 (0x4) .maxstack 8 IL_0000: ldarg.0 @@ -856,8 +870,8 @@ .method assembly hidebysig specialname instance object __DebugDisplay() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+0.8A" @@ -871,7 +885,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -885,16 +899,16 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, class ABC/ABC/Expr V_1, - class [System.Runtime]System.Collections.IComparer V_2, + class [mscorlib]System.Collections.IComparer V_2, int32 V_3, int32 V_4, - class [System.Runtime]System.Collections.IComparer V_5, + class [mscorlib]System.Collections.IComparer V_5, int32 V_6, int32 V_7) IL_0000: ldarg.0 @@ -909,7 +923,7 @@ IL_0009: stloc.0 IL_000a: ldarg.1 IL_000b: stloc.1 - IL_000c: call class [System.Runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000c: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() IL_0011: stloc.2 IL_0012: ldloc.0 IL_0013: ldfld int32 ABC/ABC/Expr::item @@ -948,8 +962,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -961,19 +975,19 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj, - class [System.Runtime]System.Collections.IComparer comp) cil managed + class [mscorlib]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, class ABC/ABC/Expr V_1, class ABC/ABC/Expr V_2, - class [System.Runtime]System.Collections.IComparer V_3, + class [mscorlib]System.Collections.IComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IComparer V_6, + class [mscorlib]System.Collections.IComparer V_6, int32 V_7, int32 V_8) IL_0000: ldarg.1 @@ -1030,17 +1044,17 @@ } // end of method Expr::CompareTo .method public hidebysig virtual final - instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, class ABC/ABC/Expr V_1, - class [System.Runtime]System.Collections.IEqualityComparer V_2, + class [mscorlib]System.Collections.IEqualityComparer V_2, int32 V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4) + class [mscorlib]System.Collections.IEqualityComparer V_4) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0029 @@ -1081,32 +1095,32 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 ABC/ABC/Expr::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 ABC/ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method Expr::GetHashCode .method public hidebysig virtual final instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, class ABC/ABC/Expr V_1, class ABC/ABC/Expr V_2, class ABC/ABC/Expr V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4, + class [mscorlib]System.Collections.IEqualityComparer V_4, int32 V_5, int32 V_6, - class [System.Runtime]System.Collections.IEqualityComparer V_7) + class [mscorlib]System.Collections.IEqualityComparer V_7) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0035 @@ -1153,8 +1167,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1192,8 +1206,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1214,9 +1228,9 @@ .property instance int32 Tag() { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .get instance int32 ABC/ABC/Expr::get_Tag() } // end of property Expr::Tag .property instance int32 Item() @@ -1224,15 +1238,15 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance int32 ABC/ABC/Expr::get_Item() } // end of property Expr::Item } // end of class Expr .class auto ansi serializable nested public beforefieldinit MyExn - extends [System.Runtime]System.Exception - implements [System.Runtime]System.Collections.IStructuralEquatable + extends [mscorlib]System.Exception + implements [mscorlib]System.Collections.IStructuralEquatable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 ) .field assembly int32 Data0@ @@ -1242,7 +1256,7 @@ // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 ABC/ABC/MyExn::Data0@ @@ -1255,21 +1269,21 @@ // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method MyExn::.ctor .method family specialname rtspecialname - instance void .ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo info, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext context) cil managed + instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed { // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 - IL_0003: call instance void [System.Runtime]System.Exception::.ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext) + IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext) IL_0008: ret } // end of method MyExn::.ctor @@ -1283,17 +1297,31 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() 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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 - GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, - class [System.Runtime]System.Collections.IEqualityComparer V_1, + class [mscorlib]System.Collections.IEqualityComparer V_1, int32 V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3) + class [mscorlib]System.Collections.IEqualityComparer V_3) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0027 @@ -1329,36 +1357,36 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 ABC/ABC/MyExn::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 ABC/ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method MyExn::GetHashCode .method public hidebysig virtual instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0, - class [System.Runtime]System.Exception V_1, + .locals init (class [mscorlib]System.Exception V_0, + class [mscorlib]System.Exception V_1, object V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3, + class [mscorlib]System.Collections.IEqualityComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IEqualityComparer V_6) + class [mscorlib]System.Collections.IEqualityComparer V_6) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0046 IL_0003: ldarg.1 - IL_0004: isinst [System.Runtime]System.Exception + IL_0004: isinst [mscorlib]System.Exception IL_0009: stloc.0 IL_000a: ldloc.0 IL_000b: brfalse.s IL_0044 @@ -1405,10 +1433,10 @@ } // end of method MyExn::Equals .method public hidebysig instance bool - Equals(class [System.Runtime]System.Exception obj) cil managed + Equals(class [mscorlib]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1452,20 +1480,20 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0) + .locals init (class [mscorlib]System.Exception V_0) IL_0000: ldarg.1 - IL_0001: isinst [System.Runtime]System.Exception + IL_0001: isinst [mscorlib]System.Exception IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: brfalse.s IL_0012 IL_000a: ldarg.0 IL_000b: ldloc.0 - IL_000c: callvirt instance bool ABC/ABC/MyExn::Equals(class [System.Runtime]System.Exception) + IL_000c: callvirt instance bool ABC/ABC/MyExn::Equals(class [mscorlib]System.Exception) IL_0011: ret IL_0012: ldc.i4.0 @@ -1481,7 +1509,7 @@ } // end of class MyExn .class auto ansi serializable nested public A - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x @@ -1491,7 +1519,7 @@ // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [System.Runtime]System.Object::.ctor() + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -1531,8 +1559,8 @@ .method public specialname static string get_greeting() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 6 (0x6) .maxstack 8 IL_0000: ldstr "hello" @@ -1560,8 +1588,8 @@ .method public specialname static string get_greeting() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 6 (0x6) .maxstack 8 IL_0000: ldstr "hello" @@ -1575,12 +1603,12 @@ } // end of class ABC .class private abstract auto ansi sealed ''.$ABC - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .field static assembly int32 init@ - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static void main@() cil managed { .entrypoint @@ -1601,4 +1629,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\dev\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelModule_fs\ToplevelModule.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net472\tests\EmittedIL\SerializableAttribute\ToplevelModule_fs\ToplevelModule.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl index 14c1385f00b..39e909e6bd1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.il.release.bsl @@ -12,7 +12,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly ToplevelModule { @@ -21,29 +21,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.ToplevelModule { - // Offset: 0x00000000 Length: 0x00001180 + // Offset: 0x00000000 Length: 0x00001176 // WARNING: managed resource file FSharpSignatureData.ToplevelModule created } .mresource public FSharpOptimizationData.ToplevelModule { - // Offset: 0x00001188 Length: 0x00000403 + // Offset: 0x00001180 Length: 0x00000403 // WARNING: managed resource file FSharpOptimizationData.ToplevelModule created } .module ToplevelModule.exe -// MVID: {628FBBC7-604B-50A5-A745-0383C7BB8F62} +// MVID: {62F9A1C8-0BC0-6650-A745-0383C8A1F962} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00000192020C0000 +// Image base: 0x00000223111B0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -137,7 +137,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -151,8 +151,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -205,8 +205,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -220,8 +220,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/Expr V_0, @@ -280,8 +280,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -323,8 +323,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -337,8 +337,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -386,8 +386,8 @@ .method public hidebysig virtual final instance bool Equals(class ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/Expr V_0, @@ -425,8 +425,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/Expr V_0) @@ -516,11 +516,25 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() cil managed + { + .custom instance void [System.Runtime]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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -556,8 +570,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -570,8 +584,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -625,8 +639,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -670,8 +684,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -823,7 +837,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -838,7 +852,7 @@ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -892,7 +906,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -907,7 +921,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class ABC/ABC/Expr V_0, @@ -967,7 +981,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -1010,7 +1024,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1024,7 +1038,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1073,7 +1087,7 @@ instance bool Equals(class ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class ABC/ABC/Expr V_0, @@ -1112,7 +1126,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class ABC/ABC/Expr V_0) @@ -1202,11 +1216,25 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() cil managed + { + .custom instance void [System.Runtime]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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1243,7 +1271,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1257,7 +1285,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1312,7 +1340,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1357,7 +1385,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1505,4 +1533,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\Users\vzari\code\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelModule_fs\ToplevelModule.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelModule_fs\ToplevelModule.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl index 090e268304a..d58ef674a36 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.debug.bsl @@ -4,15 +4,15 @@ // Metadata version: v4.0.30319 -.assembly extern System.Runtime +.assembly extern mscorlib { - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .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 6:0:0:0 + .ver 7:0:0:0 } .assembly ToplevelNamespace { @@ -21,48 +21,48 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .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.ToplevelNamespace { - // Offset: 0x00000000 Length: 0x00001870 + // Offset: 0x00000000 Length: 0x0000187A // WARNING: managed resource file FSharpSignatureData.ToplevelNamespace created } .mresource public FSharpOptimizationData.ToplevelNamespace { - // Offset: 0x00001878 Length: 0x00000562 + // Offset: 0x00001880 Length: 0x0000055C // WARNING: managed resource file FSharpOptimizationData.ToplevelNamespace created } .module ToplevelNamespace.exe -// MVID: {628F4C90-5D8B-1F9F-A745-0383904C8F62} +// MVID: {62F98081-3EC6-FDC1-A745-03838180F962} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x000002285D250000 +// Image base: 0x000001C2AAA90000 // =============== CLASS MEMBERS DECLARATION =================== .class public auto autochar serializable sealed beforefieldinit XYZ.Expr - extends [System.Runtime]System.Object - implements class [System.Runtime]System.IEquatable`1, - [System.Runtime]System.Collections.IStructuralEquatable, - class [System.Runtime]System.IComparable`1, - [System.Runtime]System.IComparable, - [System.Runtime]System.Collections.IStructuralComparable + extends [mscorlib]System.Object + implements class [mscorlib]System.IEquatable`1, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IComparable`1, + [mscorlib]System.IComparable, + [mscorlib]System.Collections.IStructuralComparable { - .custom instance void [System.Runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl - 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl + 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) .field assembly initonly int32 item - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static class XYZ.Expr NewNum(int32 item) cil managed { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, @@ -77,12 +77,12 @@ .method assembly specialname rtspecialname instance void .ctor(int32 item) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.Expr::item @@ -92,8 +92,8 @@ .method public hidebysig instance int32 get_Item() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -104,8 +104,8 @@ .method public hidebysig instance int32 get_Tag() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 4 (0x4) .maxstack 8 IL_0000: ldarg.0 @@ -117,8 +117,8 @@ .method assembly hidebysig specialname instance object __DebugDisplay() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+0.8A" @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,16 +146,16 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.Expr V_0, class XYZ.Expr V_1, - class [System.Runtime]System.Collections.IComparer V_2, + class [mscorlib]System.Collections.IComparer V_2, int32 V_3, int32 V_4, - class [System.Runtime]System.Collections.IComparer V_5, + class [mscorlib]System.Collections.IComparer V_5, int32 V_6, int32 V_7) IL_0000: ldarg.0 @@ -170,7 +170,7 @@ IL_0009: stloc.0 IL_000a: ldarg.1 IL_000b: stloc.1 - IL_000c: call class [System.Runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000c: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() IL_0011: stloc.2 IL_0012: ldloc.0 IL_0013: ldfld int32 XYZ.Expr::item @@ -209,8 +209,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -222,19 +222,19 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj, - class [System.Runtime]System.Collections.IComparer comp) cil managed + class [mscorlib]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.Expr V_0, class XYZ.Expr V_1, class XYZ.Expr V_2, - class [System.Runtime]System.Collections.IComparer V_3, + class [mscorlib]System.Collections.IComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IComparer V_6, + class [mscorlib]System.Collections.IComparer V_6, int32 V_7, int32 V_8) IL_0000: ldarg.1 @@ -291,17 +291,17 @@ } // end of method Expr::CompareTo .method public hidebysig virtual final - instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, class XYZ.Expr V_1, - class [System.Runtime]System.Collections.IEqualityComparer V_2, + class [mscorlib]System.Collections.IEqualityComparer V_2, int32 V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4) + class [mscorlib]System.Collections.IEqualityComparer V_4) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0029 @@ -342,32 +342,32 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.Expr::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method Expr::GetHashCode .method public hidebysig virtual final instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.Expr V_0, class XYZ.Expr V_1, class XYZ.Expr V_2, class XYZ.Expr V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4, + class [mscorlib]System.Collections.IEqualityComparer V_4, int32 V_5, int32 V_6, - class [System.Runtime]System.Collections.IEqualityComparer V_7) + class [mscorlib]System.Collections.IEqualityComparer V_7) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0035 @@ -414,8 +414,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -453,8 +453,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -475,9 +475,9 @@ .property instance int32 Tag() { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .get instance int32 XYZ.Expr::get_Tag() } // end of property Expr::Tag .property instance int32 Item() @@ -485,15 +485,15 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance int32 XYZ.Expr::get_Item() } // end of property Expr::Item } // end of class XYZ.Expr .class public auto ansi serializable beforefieldinit XYZ.MyExn - extends [System.Runtime]System.Exception - implements [System.Runtime]System.Collections.IStructuralEquatable + extends [mscorlib]System.Exception + implements [mscorlib]System.Collections.IStructuralEquatable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 ) .field assembly int32 Data0@ @@ -503,7 +503,7 @@ // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.MyExn::Data0@ @@ -516,21 +516,21 @@ // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method MyExn::.ctor .method family specialname rtspecialname - instance void .ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo info, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext context) cil managed + instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed { // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 - IL_0003: call instance void [System.Runtime]System.Exception::.ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext) + IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext) IL_0008: ret } // end of method MyExn::.ctor @@ -544,17 +544,31 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() 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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 - GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, - class [System.Runtime]System.Collections.IEqualityComparer V_1, + class [mscorlib]System.Collections.IEqualityComparer V_1, int32 V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3) + class [mscorlib]System.Collections.IEqualityComparer V_3) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0027 @@ -590,36 +604,36 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.MyExn::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method MyExn::GetHashCode .method public hidebysig virtual instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0, - class [System.Runtime]System.Exception V_1, + .locals init (class [mscorlib]System.Exception V_0, + class [mscorlib]System.Exception V_1, object V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3, + class [mscorlib]System.Collections.IEqualityComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IEqualityComparer V_6) + class [mscorlib]System.Collections.IEqualityComparer V_6) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0046 IL_0003: ldarg.1 - IL_0004: isinst [System.Runtime]System.Exception + IL_0004: isinst [mscorlib]System.Exception IL_0009: stloc.0 IL_000a: ldloc.0 IL_000b: brfalse.s IL_0044 @@ -666,10 +680,10 @@ } // end of method MyExn::Equals .method public hidebysig instance bool - Equals(class [System.Runtime]System.Exception obj) cil managed + Equals(class [mscorlib]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -713,20 +727,20 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0) + .locals init (class [mscorlib]System.Exception V_0) IL_0000: ldarg.1 - IL_0001: isinst [System.Runtime]System.Exception + IL_0001: isinst [mscorlib]System.Exception IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: brfalse.s IL_0012 IL_000a: ldarg.0 IL_000b: ldloc.0 - IL_000c: callvirt instance bool XYZ.MyExn::Equals(class [System.Runtime]System.Exception) + IL_000c: callvirt instance bool XYZ.MyExn::Equals(class [mscorlib]System.Exception) IL_0011: ret IL_0012: ldc.i4.0 @@ -742,7 +756,7 @@ } // end of class XYZ.MyExn .class public auto ansi serializable XYZ.A - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x @@ -752,7 +766,7 @@ // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [System.Runtime]System.Object::.ctor() + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -778,24 +792,24 @@ } // end of class XYZ.A .class public abstract auto ansi sealed XYZ.ABC - extends [System.Runtime]System.Object + 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 ) .class auto autochar serializable sealed nested public beforefieldinit Expr - extends [System.Runtime]System.Object - implements class [System.Runtime]System.IEquatable`1, - [System.Runtime]System.Collections.IStructuralEquatable, - class [System.Runtime]System.IComparable`1, - [System.Runtime]System.IComparable, - [System.Runtime]System.Collections.IStructuralComparable + extends [mscorlib]System.Object + implements class [mscorlib]System.IEquatable`1, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IComparable`1, + [mscorlib]System.IComparable, + [mscorlib]System.Collections.IStructuralComparable { - .custom instance void [System.Runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl - 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl + 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) .field assembly initonly int32 item - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static class XYZ.ABC/Expr NewNum(int32 item) cil managed { @@ -811,12 +825,12 @@ .method assembly specialname rtspecialname instance void .ctor(int32 item) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.ABC/Expr::item @@ -826,8 +840,8 @@ .method public hidebysig instance int32 get_Item() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -838,8 +852,8 @@ .method public hidebysig instance int32 get_Tag() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 4 (0x4) .maxstack 8 IL_0000: ldarg.0 @@ -851,8 +865,8 @@ .method assembly hidebysig specialname instance object __DebugDisplay() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+0.8A" @@ -866,7 +880,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -880,16 +894,16 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, class XYZ.ABC/Expr V_1, - class [System.Runtime]System.Collections.IComparer V_2, + class [mscorlib]System.Collections.IComparer V_2, int32 V_3, int32 V_4, - class [System.Runtime]System.Collections.IComparer V_5, + class [mscorlib]System.Collections.IComparer V_5, int32 V_6, int32 V_7) IL_0000: ldarg.0 @@ -904,7 +918,7 @@ IL_0009: stloc.0 IL_000a: ldarg.1 IL_000b: stloc.1 - IL_000c: call class [System.Runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000c: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() IL_0011: stloc.2 IL_0012: ldloc.0 IL_0013: ldfld int32 XYZ.ABC/Expr::item @@ -943,8 +957,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -956,19 +970,19 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj, - class [System.Runtime]System.Collections.IComparer comp) cil managed + class [mscorlib]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, class XYZ.ABC/Expr V_1, class XYZ.ABC/Expr V_2, - class [System.Runtime]System.Collections.IComparer V_3, + class [mscorlib]System.Collections.IComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IComparer V_6, + class [mscorlib]System.Collections.IComparer V_6, int32 V_7, int32 V_8) IL_0000: ldarg.1 @@ -1025,17 +1039,17 @@ } // end of method Expr::CompareTo .method public hidebysig virtual final - instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, class XYZ.ABC/Expr V_1, - class [System.Runtime]System.Collections.IEqualityComparer V_2, + class [mscorlib]System.Collections.IEqualityComparer V_2, int32 V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4) + class [mscorlib]System.Collections.IEqualityComparer V_4) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0029 @@ -1076,32 +1090,32 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.ABC/Expr::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method Expr::GetHashCode .method public hidebysig virtual final instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, class XYZ.ABC/Expr V_1, class XYZ.ABC/Expr V_2, class XYZ.ABC/Expr V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4, + class [mscorlib]System.Collections.IEqualityComparer V_4, int32 V_5, int32 V_6, - class [System.Runtime]System.Collections.IEqualityComparer V_7) + class [mscorlib]System.Collections.IEqualityComparer V_7) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0035 @@ -1148,8 +1162,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1187,8 +1201,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1209,9 +1223,9 @@ .property instance int32 Tag() { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .get instance int32 XYZ.ABC/Expr::get_Tag() } // end of property Expr::Tag .property instance int32 Item() @@ -1219,15 +1233,15 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance int32 XYZ.ABC/Expr::get_Item() } // end of property Expr::Item } // end of class Expr .class auto ansi serializable nested public beforefieldinit MyExn - extends [System.Runtime]System.Exception - implements [System.Runtime]System.Collections.IStructuralEquatable + extends [mscorlib]System.Exception + implements [mscorlib]System.Collections.IStructuralEquatable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 ) .field assembly int32 Data0@ @@ -1237,7 +1251,7 @@ // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.ABC/MyExn::Data0@ @@ -1250,21 +1264,21 @@ // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method MyExn::.ctor .method family specialname rtspecialname - instance void .ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo info, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext context) cil managed + instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed { // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 - IL_0003: call instance void [System.Runtime]System.Exception::.ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext) + IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext) IL_0008: ret } // end of method MyExn::.ctor @@ -1278,17 +1292,31 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() 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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 - GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, - class [System.Runtime]System.Collections.IEqualityComparer V_1, + class [mscorlib]System.Collections.IEqualityComparer V_1, int32 V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3) + class [mscorlib]System.Collections.IEqualityComparer V_3) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0027 @@ -1324,36 +1352,36 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.ABC/MyExn::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method MyExn::GetHashCode .method public hidebysig virtual instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0, - class [System.Runtime]System.Exception V_1, + .locals init (class [mscorlib]System.Exception V_0, + class [mscorlib]System.Exception V_1, object V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3, + class [mscorlib]System.Collections.IEqualityComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IEqualityComparer V_6) + class [mscorlib]System.Collections.IEqualityComparer V_6) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0046 IL_0003: ldarg.1 - IL_0004: isinst [System.Runtime]System.Exception + IL_0004: isinst [mscorlib]System.Exception IL_0009: stloc.0 IL_000a: ldloc.0 IL_000b: brfalse.s IL_0044 @@ -1400,10 +1428,10 @@ } // end of method MyExn::Equals .method public hidebysig instance bool - Equals(class [System.Runtime]System.Exception obj) cil managed + Equals(class [mscorlib]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1447,20 +1475,20 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0) + .locals init (class [mscorlib]System.Exception V_0) IL_0000: ldarg.1 - IL_0001: isinst [System.Runtime]System.Exception + IL_0001: isinst [mscorlib]System.Exception IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: brfalse.s IL_0012 IL_000a: ldarg.0 IL_000b: ldloc.0 - IL_000c: callvirt instance bool XYZ.ABC/MyExn::Equals(class [System.Runtime]System.Exception) + IL_000c: callvirt instance bool XYZ.ABC/MyExn::Equals(class [mscorlib]System.Exception) IL_0011: ret IL_0012: ldc.i4.0 @@ -1476,7 +1504,7 @@ } // end of class MyExn .class auto ansi serializable nested public A - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x @@ -1486,7 +1514,7 @@ // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [System.Runtime]System.Object::.ctor() + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -1512,24 +1540,24 @@ } // end of class A .class abstract auto ansi sealed nested public ABC - extends [System.Runtime]System.Object + 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 ) .class auto autochar serializable sealed nested public beforefieldinit Expr - extends [System.Runtime]System.Object - implements class [System.Runtime]System.IEquatable`1, - [System.Runtime]System.Collections.IStructuralEquatable, - class [System.Runtime]System.IComparable`1, - [System.Runtime]System.IComparable, - [System.Runtime]System.Collections.IStructuralComparable + extends [mscorlib]System.Object + implements class [mscorlib]System.IEquatable`1, + [mscorlib]System.Collections.IStructuralEquatable, + class [mscorlib]System.IComparable`1, + [mscorlib]System.IComparable, + [mscorlib]System.Collections.IStructuralComparable { - .custom instance void [System.Runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl - 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl + 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}.. .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) .field assembly initonly int32 item - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static class XYZ.ABC/ABC/Expr NewNum(int32 item) cil managed { @@ -1545,12 +1573,12 @@ .method assembly specialname rtspecialname instance void .ctor(int32 item) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.ABC/ABC/Expr::item @@ -1560,8 +1588,8 @@ .method public hidebysig instance int32 get_Item() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 @@ -1572,8 +1600,8 @@ .method public hidebysig instance int32 get_Tag() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 4 (0x4) .maxstack 8 IL_0000: ldarg.0 @@ -1585,8 +1613,8 @@ .method assembly hidebysig specialname instance object __DebugDisplay() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+0.8A" @@ -1600,7 +1628,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1614,16 +1642,16 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 66 (0x42) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, class XYZ.ABC/ABC/Expr V_1, - class [System.Runtime]System.Collections.IComparer V_2, + class [mscorlib]System.Collections.IComparer V_2, int32 V_3, int32 V_4, - class [System.Runtime]System.Collections.IComparer V_5, + class [mscorlib]System.Collections.IComparer V_5, int32 V_6, int32 V_7) IL_0000: ldarg.0 @@ -1638,7 +1666,7 @@ IL_0009: stloc.0 IL_000a: ldarg.1 IL_000b: stloc.1 - IL_000c: call class [System.Runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000c: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() IL_0011: stloc.2 IL_0012: ldloc.0 IL_0013: ldfld int32 XYZ.ABC/ABC/Expr::item @@ -1677,8 +1705,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1690,19 +1718,19 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj, - class [System.Runtime]System.Collections.IComparer comp) cil managed + class [mscorlib]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 81 (0x51) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, class XYZ.ABC/ABC/Expr V_1, class XYZ.ABC/ABC/Expr V_2, - class [System.Runtime]System.Collections.IComparer V_3, + class [mscorlib]System.Collections.IComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IComparer V_6, + class [mscorlib]System.Collections.IComparer V_6, int32 V_7, int32 V_8) IL_0000: ldarg.1 @@ -1759,17 +1787,17 @@ } // end of method Expr::CompareTo .method public hidebysig virtual final - instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 7 .locals init (int32 V_0, class XYZ.ABC/ABC/Expr V_1, - class [System.Runtime]System.Collections.IEqualityComparer V_2, + class [mscorlib]System.Collections.IEqualityComparer V_2, int32 V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4) + class [mscorlib]System.Collections.IEqualityComparer V_4) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0029 @@ -1810,32 +1838,32 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.ABC/ABC/Expr::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.ABC/ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method Expr::GetHashCode .method public hidebysig virtual final instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 61 (0x3d) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, class XYZ.ABC/ABC/Expr V_1, class XYZ.ABC/ABC/Expr V_2, class XYZ.ABC/ABC/Expr V_3, - class [System.Runtime]System.Collections.IEqualityComparer V_4, + class [mscorlib]System.Collections.IEqualityComparer V_4, int32 V_5, int32 V_6, - class [System.Runtime]System.Collections.IEqualityComparer V_7) + class [mscorlib]System.Collections.IEqualityComparer V_7) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0035 @@ -1882,8 +1910,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1921,8 +1949,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1943,9 +1971,9 @@ .property instance int32 Tag() { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .get instance int32 XYZ.ABC/ABC/Expr::get_Tag() } // end of property Expr::Tag .property instance int32 Item() @@ -1953,15 +1981,15 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance int32 XYZ.ABC/ABC/Expr::get_Item() } // end of property Expr::Item } // end of class Expr .class auto ansi serializable nested public beforefieldinit MyExn - extends [System.Runtime]System.Exception - implements [System.Runtime]System.Collections.IStructuralEquatable + extends [mscorlib]System.Exception + implements [mscorlib]System.Collections.IStructuralEquatable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 ) .field assembly int32 Data0@ @@ -1971,7 +1999,7 @@ // Code size 14 (0xe) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 IL_0008: stfld int32 XYZ.ABC/ABC/MyExn::Data0@ @@ -1984,21 +2012,21 @@ // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call instance void [System.Runtime]System.Exception::.ctor() + IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method MyExn::.ctor .method family specialname rtspecialname - instance void .ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo info, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext context) cil managed + instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed { // Code size 9 (0x9) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldarg.2 - IL_0003: call instance void [System.Runtime]System.Exception::.ctor(class [System.Runtime]System.Runtime.Serialization.SerializationInfo, - valuetype [System.Runtime]System.Runtime.Serialization.StreamingContext) + IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo, + valuetype [mscorlib]System.Runtime.Serialization.StreamingContext) IL_0008: ret } // end of method MyExn::.ctor @@ -2012,17 +2040,31 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() 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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 - GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 41 (0x29) .maxstack 7 .locals init (int32 V_0, - class [System.Runtime]System.Collections.IEqualityComparer V_1, + class [mscorlib]System.Collections.IEqualityComparer V_1, int32 V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3) + class [mscorlib]System.Collections.IEqualityComparer V_3) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0027 @@ -2058,36 +2100,36 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 - IL_0001: call class [System.Runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 XYZ.ABC/ABC/MyExn::GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer) + IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 XYZ.ABC/ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer) IL_000b: ret } // end of method MyExn::GetHashCode .method public hidebysig virtual instance bool Equals(object obj, - class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed + class [mscorlib]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 78 (0x4e) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0, - class [System.Runtime]System.Exception V_1, + .locals init (class [mscorlib]System.Exception V_0, + class [mscorlib]System.Exception V_1, object V_2, - class [System.Runtime]System.Collections.IEqualityComparer V_3, + class [mscorlib]System.Collections.IEqualityComparer V_3, int32 V_4, int32 V_5, - class [System.Runtime]System.Collections.IEqualityComparer V_6) + class [mscorlib]System.Collections.IEqualityComparer V_6) IL_0000: ldarg.0 IL_0001: brfalse.s IL_0046 IL_0003: ldarg.1 - IL_0004: isinst [System.Runtime]System.Exception + IL_0004: isinst [mscorlib]System.Exception IL_0009: stloc.0 IL_000a: ldloc.0 IL_000b: brfalse.s IL_0044 @@ -2134,10 +2176,10 @@ } // end of method MyExn::Equals .method public hidebysig instance bool - Equals(class [System.Runtime]System.Exception obj) cil managed + Equals(class [mscorlib]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2181,20 +2223,20 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 - .locals init (class [System.Runtime]System.Exception V_0) + .locals init (class [mscorlib]System.Exception V_0) IL_0000: ldarg.1 - IL_0001: isinst [System.Runtime]System.Exception + IL_0001: isinst [mscorlib]System.Exception IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: brfalse.s IL_0012 IL_000a: ldarg.0 IL_000b: ldloc.0 - IL_000c: callvirt instance bool XYZ.ABC/ABC/MyExn::Equals(class [System.Runtime]System.Exception) + IL_000c: callvirt instance bool XYZ.ABC/ABC/MyExn::Equals(class [mscorlib]System.Exception) IL_0011: ret IL_0012: ldc.i4.0 @@ -2210,7 +2252,7 @@ } // end of class MyExn .class auto ansi serializable nested public A - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x @@ -2220,7 +2262,7 @@ // Code size 16 (0x10) .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [System.Runtime]System.Object::.ctor() + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -2260,8 +2302,8 @@ .method public specialname static string get_greeting() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 6 (0x6) .maxstack 8 IL_0000: ldstr "hello" @@ -2289,8 +2331,8 @@ .method public specialname static string get_greeting() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 6 (0x6) .maxstack 8 IL_0000: ldstr "hello" @@ -2304,12 +2346,12 @@ } // end of class XYZ.ABC .class private abstract auto ansi sealed ''.$ToplevelNamespace - extends [System.Runtime]System.Object + extends [mscorlib]System.Object { .field static assembly int32 init@ - .custom instance void [System.Runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method public static void main@() cil managed { .entrypoint @@ -2330,4 +2372,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\dev\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelNamespace_fs\ToplevelNamespace.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Debug\net472\tests\EmittedIL\SerializableAttribute\ToplevelNamespace_fs\ToplevelNamespace.res diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl index 6cd3bc0ed4b..dfaf2444884 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.il.release.bsl @@ -12,7 +12,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 6:0:0:0 + .ver 7:0:0:0 } .assembly ToplevelNamespace { @@ -21,29 +21,29 @@ 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 [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 01 00 00 00 00 ) + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .mresource public FSharpSignatureData.ToplevelNamespace { - // Offset: 0x00000000 Length: 0x0000188E + // Offset: 0x00000000 Length: 0x00001884 // WARNING: managed resource file FSharpSignatureData.ToplevelNamespace created } .mresource public FSharpOptimizationData.ToplevelNamespace { - // Offset: 0x00001898 Length: 0x00000562 + // Offset: 0x00001888 Length: 0x00000562 // WARNING: managed resource file FSharpOptimizationData.ToplevelNamespace created } .module ToplevelNamespace.exe -// MVID: {628FBBC7-2DCF-3629-A745-0383C7BB8F62} +// MVID: {62F9A1B0-77E1-A901-A745-0383B0A1F962} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000028D685A0000 +// Image base: 0x0000023A2DE40000 // =============== CLASS MEMBERS DECLARATION =================== @@ -132,7 +132,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -146,8 +146,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -200,8 +200,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -215,8 +215,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.Expr V_0, @@ -275,8 +275,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -318,8 +318,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -332,8 +332,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -381,8 +381,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.Expr V_0, @@ -420,8 +420,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.Expr V_0) @@ -511,11 +511,25 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() cil managed + { + .custom instance void [System.Runtime]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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -551,8 +565,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -565,8 +579,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -620,8 +634,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -665,8 +679,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -818,7 +832,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -832,8 +846,8 @@ .method public hidebysig virtual final instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -886,8 +900,8 @@ .method public hidebysig virtual final instance int32 CompareTo(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -901,8 +915,8 @@ instance int32 CompareTo(object obj, class [System.Runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/Expr V_0, @@ -961,8 +975,8 @@ .method public hidebysig virtual final instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -1004,8 +1018,8 @@ .method public hidebysig virtual final instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1018,8 +1032,8 @@ instance bool Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1067,8 +1081,8 @@ .method public hidebysig virtual final instance bool Equals(class XYZ.ABC/Expr obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0, @@ -1106,8 +1120,8 @@ .method public hidebysig virtual final instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/Expr V_0) @@ -1197,11 +1211,25 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() cil managed + { + .custom instance void [System.Runtime]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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1237,8 +1265,8 @@ .method public hidebysig virtual instance int32 GetHashCode() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1251,8 +1279,8 @@ Equals(object obj, class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1306,8 +1334,8 @@ .method public hidebysig instance bool Equals(class [System.Runtime]System.Exception obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -1351,8 +1379,8 @@ .method public hidebysig virtual instance bool Equals(object obj) cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -1504,7 +1532,7 @@ .method public strict virtual instance string ToString() cil managed { - .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 22 (0x16) .maxstack 8 IL_0000: ldstr "%+A" @@ -1519,7 +1547,7 @@ instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1573,7 +1601,7 @@ instance int32 CompareTo(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 @@ -1588,7 +1616,7 @@ class [System.Runtime]System.Collections.IComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 70 (0x46) .maxstack 5 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1648,7 +1676,7 @@ instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 38 (0x26) .maxstack 7 .locals init (int32 V_0, @@ -1691,7 +1719,7 @@ instance int32 GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1705,7 +1733,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 49 (0x31) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1754,7 +1782,7 @@ instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0, @@ -1793,7 +1821,7 @@ instance bool Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class XYZ.ABC/ABC/Expr V_0) @@ -1883,11 +1911,25 @@ IL_0006: ret } // end of method MyExn::get_Data0 + .method public strict virtual instance string + get_Message() cil managed + { + .custom instance void [System.Runtime]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`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/ABC/MyExn>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } // end of method MyExn::get_Message + .method public hidebysig virtual instance int32 GetHashCode(class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 37 (0x25) .maxstack 7 .locals init (int32 V_0, @@ -1924,7 +1966,7 @@ GetHashCode() cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 12 (0xc) .maxstack 8 IL_0000: ldarg.0 @@ -1938,7 +1980,7 @@ class [System.Runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 67 (0x43) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0, @@ -1993,7 +2035,7 @@ Equals(class [System.Runtime]System.Exception obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 56 (0x38) .maxstack 4 .locals init (object V_0) @@ -2038,7 +2080,7 @@ Equals(object obj) cil managed { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [System.Runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) // Code size 20 (0x14) .maxstack 4 .locals init (class [System.Runtime]System.Exception V_0) @@ -2186,4 +2228,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file C:\Users\vzari\code\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelNamespace_fs\ToplevelNamespace.res +// WARNING: Created Win32 resource file C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.ComponentTests\Release\net6.0\tests\EmittedIL\SerializableAttribute\ToplevelNamespace_fs\ToplevelNamespace.res diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 3015cfd8873..4a9e7f7c650 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -15,8 +15,13 @@ false $(OtherFlags) --warnon:1182 $(NoWarn);FS0988 - true - + $(DefineConstants);RELEASE + $(DefineConstants);DEBUG + + true + + + diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs index 4af0d6d280a..a3e6b6b6ed7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs @@ -59,7 +59,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -94,7 +94,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -129,7 +129,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -159,7 +159,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -188,7 +188,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -220,7 +220,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -251,7 +251,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -283,7 +283,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -314,7 +314,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -350,7 +350,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -392,7 +392,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -410,7 +410,7 @@ let main _ = """ FSharp fsharpSource2 |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldFail @@ -433,7 +433,7 @@ type RAIOFS() = """ FSharp fsharpSource |> asLibrary - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldFail |> withSingleDiagnostic (Warning 202, Line 6, Col 7, Line 6, Col 21, "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.") \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs index 320804e2c7c..3d6afab3f3b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs @@ -106,7 +106,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpOperators] |> compileAndRun |> shouldSucceed @@ -142,7 +142,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -194,7 +194,7 @@ type MyRepeatSequence2() = static member Next(other: MyRepeatSequence2) : MyRepeatSequence2 = MyRepeatSequence2.Next(other) """ Fsx fsharpSource - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compile |> shouldSucceed @@ -312,7 +312,7 @@ let main _ = """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpLib] |> compileAndRun |> shouldSucceed @@ -339,7 +339,7 @@ let main _ = 0 """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> compileAndRun |> shouldSucceed @@ -365,7 +365,7 @@ let main _ = 0 """ FSharp fsharpSource |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> compileAndRun |> shouldSucceed @@ -400,7 +400,7 @@ module Test = 0 """ |> asExe - |> withLangVersionPreview + |> withLangVersion70 |> compileAndRun |> shouldSucceed |> verifyIL [ @@ -635,8 +635,6 @@ module Test = IL_002e: ldc.i4.0 IL_002f: ret } - -} """ #endif ] @@ -658,7 +656,7 @@ module Test = let F<'T when 'T :> IFoo<'T>>(x: 'T, y: 'T) = 'T.Foo(x, y) """ - |> withLangVersionPreview + |> withLangVersion70 |> withName "FsLibAssembly" |> withOptions ["--nowarn:3535"] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs index 9a24fdb8663..a5db85f88de 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/AttributeCheckingTests.fs @@ -77,7 +77,7 @@ type C() = ignore newChildCopy """ FSharp fsharpSource - |> withLangVersionPreview + |> withLangVersion70 |> withReferences [csharpBaseClass] |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/ListLiterals.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/ListLiterals.fs index a3388896d62..62998d31b55 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/ListLiterals.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/ListLiterals.fs @@ -22,6 +22,6 @@ module ListLiterals = let ``List literals have no limited length in langversion preview`` compilation = compilation |> asFsx - |> withLangVersionPreview + |> withLangVersion70 |> compile |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/OCamlCompat/OCamlCompat.fs b/tests/FSharp.Compiler.ComponentTests/OCamlCompat/OCamlCompat.fs index c94f95e8457..e40797ba218 100644 --- a/tests/FSharp.Compiler.ComponentTests/OCamlCompat/OCamlCompat.fs +++ b/tests/FSharp.Compiler.ComponentTests/OCamlCompat/OCamlCompat.fs @@ -13,18 +13,20 @@ module ``OCamlCompat test cases`` = let ``E_IndentOff01_fs --warnaserror --test:ErrorRanges`` compilation = compilation |> asFsx - |> withOptions ["--warnaserror"; "--test:ErrorRanges"] + |> withOptions ["--test:ErrorRanges"] |> compile |> shouldFail - |> withErrorCode 0062 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. Consider using a file with extension '\.ml' or '\.mli' instead\. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> withDiagnostics [ + (Error 62, Line 4, Col 1, Line 4, Col 14, """This construct is deprecated. The use of '#light "off"' or '#indent "off"' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] [] let ``IndentOff02_fs --warnaserror"; "--mlcompatibility`` compilation = compilation |> asFsx - |> withOptions ["--warnaserror"; "--mlcompatibility"] + |> withOcamlCompat + |> withLangVersion50 |> typecheck |> shouldSucceed @@ -37,8 +39,9 @@ module ``OCamlCompat test cases`` = |> withOptions ["--test:ErrorRanges"] |> compile |> shouldFail - |> withWarningCode 0062 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. Consider using a file with extension '\.ml' or '\.mli' instead\. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> withDiagnostics [ + (Error 62, Line 4, Col 1, Line 4, Col 14, """This construct is deprecated. The use of '#light "off"' or '#indent "off"' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] //NoMT SOURCE=IndentOff04.fsx COMPILE_ONLY=1 SCFLAGS="--warnaserror --mlcompatibility" FSIMODE=PIPE # IndentOff04.fsx @@ -46,11 +49,13 @@ module ``OCamlCompat test cases`` = let ``IndentOff04_fsx --warnaserror --mlcompatibility`` compilation = compilation |> asFsx - |> withOptions ["--warnaserror"; " --mlcompatibility"] + |> withOptions ["--test:ErrorRanges"] + |> withOcamlCompat |> compile |> shouldFail - |> withErrorCode 62 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. Consider using a file with extension '\.ml' or '\.mli' instead\. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> withDiagnostics [ + (Error 62, Line 3, Col 1, Line 3, Col 14, """This construct is deprecated. The use of '#light "off"' or '#indent "off"' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] //NoMT SOURCE=W_IndentOff05.fsx COMPILE_ONLY=1 SCFLAGS="--test:ErrorRanges" FSIMODE=PIPE # W_IndentOff05.fsx @@ -61,8 +66,9 @@ module ``OCamlCompat test cases`` = |> withOptions ["--test:ErrorRanges"] |> compile |> shouldFail - |> withWarningCode 0062 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. Consider using a file with extension '\.ml' or '\.mli' instead\. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> withDiagnostics [ + (Error 62, Line 3, Col 1, Line 3, Col 14, """This construct is deprecated. The use of '#light "off"' or '#indent "off"' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] //NoMT SOURCE=E_IndentOff06.fsx COMPILE_ONLY=1 SCFLAGS="--warnaserror" FSIMODE=PIPE # E_IndentOff06.fsx @@ -70,11 +76,12 @@ module ``OCamlCompat test cases`` = let ``E_IndentOff06_fsx --test:ErrorRanges`` compilation = compilation |> asFsx - |> withOptions ["--warnaserror"; "--test:ErrorRanges"] + |> withOptions ["--test:ErrorRanges"] |> compile |> shouldFail - |> withErrorCode 0062 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. Consider using a file with extension '\.ml' or '\.mli' instead\. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> withDiagnostics [ + (Error 62, Line 3, Col 1, Line 3, Col 14, """This construct is deprecated. The use of '#light "off"' or '#indent "off"' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] // SOURCE=E_mlExtension01.ml COMPILE_ONLY=1 SCFLAGS="--warnaserror --test:ErrorRanges" # E_mlExtension01.ml @@ -92,6 +99,7 @@ module ``OCamlCompat test cases`` = compilation |> asFsx |> withOptions ["--warnaserror"; "--mlcompatibility"] + |> withLangVersion50 |> compile |> shouldSucceed @@ -112,6 +120,7 @@ module ``OCamlCompat test cases`` = compilation |> asFsx |> withOptions ["--warnaserror"; "--mlcompatibility"] + |> withLangVersion50 |> typecheck |> shouldSucceed @@ -122,6 +131,7 @@ module ``OCamlCompat test cases`` = compilation |> asExe |> withOptions ["--test:ErrorRanges"; "--mlcompatibility"] + |> withLangVersion50 |> compile |> shouldSucceed @@ -142,9 +152,10 @@ module ``OCamlCompat test cases`` = |> asExe |> ignoreWarnings |> compile - |> shouldSucceed - |> withWarningCode 62 - |> withDiagnosticMessageMatches "This construct is for ML compatibility\. The syntax '\(typ,\.\.\.,typ\) ident' is not used in F# code. Consider using 'ident' instead. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'\." + |> shouldFail + |> withDiagnostics [ + (Error 62, Line 10, Col 19, Line 10, Col 48, """This construct is deprecated. The use of multiple parenthesized type parameters before a generic type name such as '(int, int) Map' was deprecated in F# 2.0 and is no longer supported. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.""") + ] // SOURCE=OCamlStyleArrayIndexing.fs SCFLAGS="--mlcompatibility" # OCamlStyleArrayIndexing.fs @@ -152,6 +163,7 @@ module ``OCamlCompat test cases`` = let ``OCamlStyleArrayIndexing_fs --mlcompatibility`` compilation = compilation |> asExe - |> withOptions ["--mlcompatibility"] + |> withOcamlCompat + |> withLangVersion50 |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs b/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs index 6a46f5ce74f..cdc2a981071 100644 --- a/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs +++ b/tests/FSharp.Compiler.UnitTests/ByteMemoryTests.fs @@ -10,7 +10,8 @@ module ByteMemoryTests = open FSharp.Compiler.IO [] - let ``ByteMemory.CreateMemoryMappedFile succeeds with byte length of zero``() = + let ``ByteMemory.CreateMemoryMappedFile succeeds with byte length of zero`` () = + let memory = ByteMemory.Empty.AsReadOnly() let newMemory = ByteStorage.FromByteMemoryAndCopy(memory, useBackingMemoryMappedFile = true).GetByteMemory() - Assert.shouldBe(0, newMemory.Length) + Assert.shouldBe 0 newMemory.Length diff --git a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs index 3d6651df05d..24516f3868d 100644 --- a/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.UnitTests/ManglingNameOfProvidedTypes.fs @@ -63,7 +63,9 @@ type ManglingNamesOfProvidedTypesWithMultipleParameter() = [] member this.DemangleMultiParameter() = + let smashtogether arr = arr |> Seq.fold(fun acc (f,s) -> acc + $"-{f}-{s}") "" let name, parameters = PrettyNaming.DemangleProvidedTypeName "TestType,Foo=\"xyz\",Foo2=\"abc\"" Assert.shouldBe "TestType" name - Assert.shouldBe([| "Foo", "xyz" - "Foo2", "abc" |], parameters) + let parameters = smashtogether parameters + let expected = smashtogether [| "Foo", "xyz"; "Foo2", "abc" |] + Assert.shouldBe expected parameters diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index d227cc1630e..d70cffdafd4 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -388,6 +388,9 @@ module rec Compiler = let withLangVersion60 (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:6.0" ] "withLangVersion60 is only supported on F#" cUnit + let withLangVersion70 (cUnit: CompilationUnit) : CompilationUnit = + withOptionsHelper [ "--langversion:7.0" ] "withLangVersion70 is only supported on F#" cUnit + let withLangVersionPreview (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:preview" ] "withLangVersionPreview is only supported on F#" cUnit diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl index 1bd18780642..07d69bc5277 100644 --- a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl @@ -1,7 +1,7 @@ E_LessThanDotOpenParen001.fsx(23,12,23,15): typecheck error FS0043: No overloads match for method 'op_PlusPlusPlus'. -Known return type: ^a +Known return type: 'a Known type parameters: < (string -> int) , TestType > diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 02548f16e56..64857397705 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -105,6 +105,11 @@ let generateProjectArtifacts (pc:ProjectConfiguration) outputType (targetFramewo "FSharp.Core" (Path.GetFullPath(__SOURCE_DIRECTORY__) + "/../../artifacts/bin/" + compiler + "/" + configuration + "/netstandard2.0/FSharp.Core.dll") + let langver, options = + match languageVersion with + | "supports-ml" -> "5.0", "--mlcompatibility" + | v -> v, "" + let computeSourceItems addDirectory addCondition (compileItem:CompileItem) sources = let computeInclude src = let fileName = if addDirectory then Path.Combine(pc.SourceDirectory, src) else src @@ -142,6 +147,7 @@ let generateProjectArtifacts (pc:ProjectConfiguration) outputType (targetFramewo $(DEBUG) portable $(LANGUAGEVERSION) + $(OTHERFLAGS) $(OPTIMIZE) false NETCOREAPP @@ -196,7 +202,8 @@ let generateProjectArtifacts (pc:ProjectConfiguration) outputType (targetFramewo |> replaceTokens "$(OPTIMIZE)" optimize |> replaceTokens "$(DEBUG)" debug |> replaceTokens "$(TARGETFRAMEWORK)" targetFramework - |> replaceTokens "$(LANGUAGEVERSION)" languageVersion + |> replaceTokens "$(LANGUAGEVERSION)" langver + |> replaceTokens "$(OTHERFLAGS)" options |> replaceTokens "$(RestoreFromArtifactsPath)" (Path.GetFullPath(__SOURCE_DIRECTORY__) + "/../../artifacts/packages/" + configuration) generateProjBody @@ -376,10 +383,17 @@ let singleTestBuildAndRunVersion dir p version = let singleVersionedNegTest (cfg: TestConfig) version testname = + let options = + match version with + | "supports-ml" -> "--langversion:5.0 --mlcompatibility" + | "supports-ml*" -> "--mlcompatibility" + | v when not (String.IsNullOrEmpty(v)) -> $"--langversion:{v}" + | _ -> "" + let cfg = { cfg with - fsc_flags = sprintf "%s %s --preferreduilang:en-US --define:NEGATIVE" cfg.fsc_flags (if not (String.IsNullOrEmpty(version)) then "--langversion:" + version else "") - fsi_flags = sprintf "%s --preferreduilang:en-US %s" cfg.fsi_flags (if not (String.IsNullOrEmpty(version)) then "--langversion:" + version else "") + fsc_flags = sprintf "%s %s --preferreduilang:en-US --define:NEGATIVE" cfg.fsc_flags options + fsi_flags = sprintf "%s --preferreduilang:en-US %s" cfg.fsi_flags options } // REM == Set baseline (fsc vs vs, in case the vs baseline exists) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 3422922c449..58dab43e046 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -299,22 +299,22 @@ module CoreTests = let ``members-factors-mutrec-FSI`` () = singleTestBuildAndRun "core/members/factors-mutrec" FSI [] - let ``graph-FSC_DEBUG`` () = singleTestBuildAndRun "perf/graph" FSC_DEBUG + let ``graph-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/graph" FSC_DEBUG "supports-ml" [] - let ``graph-FSC_OPTIMIZED`` () = singleTestBuildAndRun "perf/graph" FSC_OPTIMIZED + let ``graph-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/graph" FSC_OPTIMIZED "supports-ml" [] - let ``graph-FSI`` () = singleTestBuildAndRun "perf/graph" FSI + let ``graph-FSI`` () = singleTestBuildAndRunVersion "perf/graph" FSI "supports-ml" [] - let ``nbody-FSC_DEBUG`` () = singleTestBuildAndRun "perf/nbody" FSC_DEBUG + let ``nbody-FSC_DEBUG`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_DEBUG "supports-ml" [] - let ``nbody-FSC_OPTIMIZED`` () = singleTestBuildAndRun "perf/nbody" FSC_OPTIMIZED + let ``nbody-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "perf/nbody" FSC_OPTIMIZED "supports-ml" [] - let ``nbody-FSI`` () = singleTestBuildAndRun "perf/nbody" FSI + let ``nbody-FSI`` () = singleTestBuildAndRunVersion "perf/nbody" FSI "supports-ml" [] let ``forexpression-FSC_DEBUG`` () = singleTestBuildAndRun "core/forexpression" FSC_DEBUG @@ -939,7 +939,7 @@ module CoreTests = begin use testOkFile = fileguard cfg "test.ok" - fsiStdin cfg "test1.ml" "--maxerrors:1" [] + fsiStdin cfg "test1.ml" " --langversion:5.0 --mlcompatibility --maxerrors:1" [] testOkFile.CheckExists() end @@ -981,15 +981,15 @@ module CoreTests = let hiding () = let cfg = testConfig "core/hiding" - fsc cfg "%s -a --optimize -o:lib.dll" cfg.fsc_flags ["lib.mli";"lib.ml";"libv.ml"] + fsc cfg "%s -a --optimize --langversion:5.0 --mlcompatibility -o:lib.dll" cfg.fsc_flags ["lib.mli";"lib.ml";"libv.ml"] peverify cfg "lib.dll" - fsc cfg "%s -a --optimize -r:lib.dll -o:lib2.dll" cfg.fsc_flags ["lib2.mli";"lib2.ml";"lib3.ml"] + fsc cfg "%s -a --optimize --langversion:5.0 --mlcompatibility -r:lib.dll -o:lib2.dll" cfg.fsc_flags ["lib2.mli";"lib2.ml";"lib3.ml"] peverify cfg "lib2.dll" - fsc cfg "%s --optimize -r:lib.dll -r:lib2.dll -o:client.exe" cfg.fsc_flags ["client.ml"] + fsc cfg "%s --optimize --langversion:5.0 --mlcompatibility -r:lib.dll -r:lib2.dll -o:client.exe" cfg.fsc_flags ["client.ml"] peverify cfg "client.exe" @@ -1262,9 +1262,9 @@ module CoreTests = let parsing () = let cfg = testConfig "core/parsing" - fsc cfg "%s -a -o:crlf.dll -g" cfg.fsc_flags ["crlf.ml"] + fsc cfg "%s -a --langversion:5.0 --mlcompatibility -o:crlf.dll -g" cfg.fsc_flags ["crlf.ml"] - fsc cfg "%s -o:toplet.exe -g" cfg.fsc_flags ["toplet.ml"] + fsc cfg "%s --langversion:5.0 --mlcompatibility -o:toplet.exe -g" cfg.fsc_flags ["toplet.ml"] peverify cfg "toplet.exe" @@ -1298,7 +1298,7 @@ module CoreTests = let cfg = testConfig "core/internalsvisible" // Compiling F# Library - fsc cfg "%s --version:1.2.3 --keyfile:key.snk -a --optimize -o:library.dll" cfg.fsc_flags ["library.fsi"; "library.fs"] + fsc cfg "%s --version:1.2.3 --keyfile:key.snk --langversion:5.0 --mlcompatibility -a --optimize -o:library.dll" cfg.fsc_flags ["library.fsi"; "library.fs"] peverify cfg "library.dll" @@ -1308,7 +1308,7 @@ module CoreTests = peverify cfg "librarycs.dll" // Compiling F# main referencing C# and F# libraries - fsc cfg "%s --version:1.2.3 --keyfile:key.snk --optimize -r:library.dll -r:librarycs.dll -o:main.exe" cfg.fsc_flags ["main.fs"] + fsc cfg "%s --version:1.2.3 --keyfile:key.snk --optimize --langversion:5.0 --mlcompatibility -r:library.dll -r:librarycs.dll -o:main.exe" cfg.fsc_flags ["main.fs"] peverify cfg "main.exe" @@ -1882,19 +1882,19 @@ module CoreTests = let testResources () = let cfg = testConfig "core/resources" - fsc cfg "%s --resource:Resources.resources -o:test-embed.exe -g" cfg.fsc_flags ["test.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility --resource:Resources.resources -o:test-embed.exe -g" cfg.fsc_flags ["test.fs"] peverify cfg "test-embed.exe" - fsc cfg "%s --linkresource:Resources.resources -o:test-link.exe -g" cfg.fsc_flags ["test.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility --linkresource:Resources.resources -o:test-link.exe -g" cfg.fsc_flags ["test.fs"] peverify cfg "test-link.exe" - fsc cfg "%s --resource:Resources.resources,ResourceName.resources -o:test-embed-named.exe -g" cfg.fsc_flags ["test.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility --resource:Resources.resources,ResourceName.resources -o:test-embed-named.exe -g" cfg.fsc_flags ["test.fs"] peverify cfg "test-embed-named.exe" - fsc cfg "%s --linkresource:Resources.resources,ResourceName.resources -o:test-link-named.exe -g" cfg.fsc_flags ["test.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility --linkresource:Resources.resources,ResourceName.resources -o:test-link-named.exe -g" cfg.fsc_flags ["test.fs"] peverify cfg "test-link-named.exe" @@ -1950,13 +1950,13 @@ module CoreTests = peverify cfg "app69514-withsig.exe" - fsc cfg "%s -o:lib.dll -a -g" cfg.fsc_flags ["lib.ml"] + fsc cfg "%s -o:lib.dll -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] peverify cfg "lib.dll" csc cfg """/nologo /r:"%s" /r:lib.dll /out:test.exe """ cfg.FSCOREDLLPATH ["test.cs"] - fsc cfg "%s --optimize -o:lib--optimize.dll -a -g" cfg.fsc_flags ["lib.ml"] + fsc cfg "%s --optimize -o:lib--optimize.dll -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] peverify cfg "lib--optimize.dll" @@ -2111,19 +2111,19 @@ module ToolsTests = let cfg = testConfig "tools/bundle" - fsc cfg "%s --progress --standalone -o:test-one-fsharp-module.exe -g" cfg.fsc_flags ["test-one-fsharp-module.fs"] + fsc cfg "%s --progress --langversion:5.0 --mlcompatibility --standalone -o:test-one-fsharp-module.exe -g" cfg.fsc_flags ["test-one-fsharp-module.fs"] peverify cfg "test-one-fsharp-module.exe" - fsc cfg "%s -a -o:test_two_fsharp_modules_module_1.dll -g" cfg.fsc_flags ["test_two_fsharp_modules_module_1.fs"] + fsc cfg "%s -a --langversion:5.0 --mlcompatibility -o:test_two_fsharp_modules_module_1.dll -g" cfg.fsc_flags ["test_two_fsharp_modules_module_1.fs"] peverify cfg "test_two_fsharp_modules_module_1.dll" - fsc cfg "%s --standalone -r:test_two_fsharp_modules_module_1.dll -o:test_two_fsharp_modules_module_2.exe -g" cfg.fsc_flags ["test_two_fsharp_modules_module_2.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility --standalone -r:test_two_fsharp_modules_module_1.dll -o:test_two_fsharp_modules_module_2.exe -g" cfg.fsc_flags ["test_two_fsharp_modules_module_2.fs"] peverify cfg "test_two_fsharp_modules_module_2.exe" - fsc cfg "%s -a --standalone -r:test_two_fsharp_modules_module_1.dll -o:test_two_fsharp_modules_module_2_as_dll.dll -g" cfg.fsc_flags ["test_two_fsharp_modules_module_2.fs"] + fsc cfg "%s -a --langversion:5.0 --mlcompatibility --standalone -r:test_two_fsharp_modules_module_1.dll -o:test_two_fsharp_modules_module_2_as_dll.dll -g" cfg.fsc_flags ["test_two_fsharp_modules_module_2.fs"] peverify cfg "test_two_fsharp_modules_module_2_as_dll.dll" #endif @@ -2152,7 +2152,7 @@ module RegressionTests = let ``struct-tuple-bug-1-FSC_OPTIMIZED`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_OPTIMIZED [] - let ``tuple-bug-1-FSC_OPTIMIZED`` () = singleTestBuildAndRun "regression/tuple-bug-1" FSC_OPTIMIZED + let ``tuple-bug-1-FSC_OPTIMIZED`` () = singleTestBuildAndRunVersion "regression/tuple-bug-1" FSC_OPTIMIZED "supports-ml" [] let ``12383-FSC_OPTIMIZED`` () = singleTestBuildAndRun "regression/12383" FSC_OPTIMIZED @@ -2262,10 +2262,10 @@ module RegressionTests = #endif [] - let ``26`` () = singleTestBuildAndRun "regression/26" FSC_OPTIMIZED + let ``26`` () = singleTestBuildAndRunVersion "regression/26" FSC_OPTIMIZED "supports-ml" [] - let ``321`` () = singleTestBuildAndRun "regression/321" FSC_OPTIMIZED + let ``321`` () = singleTestBuildAndRunVersion "regression/321" FSC_OPTIMIZED "supports-ml" #if !NETCOREAPP // This test is disabled in coreclr builds dependent on fixing : https://github.com/dotnet/fsharp/issues/2600 @@ -2273,11 +2273,11 @@ module RegressionTests = let ``655`` () = let cfg = testConfig "regression/655" - fsc cfg "%s -a -o:pack.dll" cfg.fsc_flags ["xlibC.ml"] + fsc cfg "%s --langversion:5.0 --mlcompatibility -a -o:pack.dll" cfg.fsc_flags ["xlibC.ml"] peverify cfg "pack.dll" - fsc cfg "%s -o:test.exe -r:pack.dll" cfg.fsc_flags ["main.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility -o:test.exe -r:pack.dll" cfg.fsc_flags ["main.fs"] peverify cfg "test.exe" @@ -2292,7 +2292,7 @@ module RegressionTests = let ``656`` () = let cfg = testConfig "regression/656" - fsc cfg "%s -o:pack.exe" cfg.fsc_flags ["misc.fs mathhelper.fs filehelper.fs formshelper.fs plot.fs traj.fs playerrecord.fs trackedplayers.fs form.fs"] + fsc cfg "%s --langversion:5.0 --mlcompatibility -o:pack.exe" cfg.fsc_flags ["misc.fs mathhelper.fs filehelper.fs formshelper.fs plot.fs traj.fs playerrecord.fs trackedplayers.fs form.fs"] peverify cfg "pack.exe" #endif @@ -2300,22 +2300,22 @@ module RegressionTests = #if !NETCOREAPP // Requires WinForms [] - let ``83`` () = singleTestBuildAndRun "regression/83" FSC_OPTIMIZED + let ``83`` () = singleTestBuildAndRunVersion "regression/83" FSC_OPTIMIZED "supports-ml" [] - let ``84`` () = singleTestBuildAndRun "regression/84" FSC_OPTIMIZED + let ``84`` () = singleTestBuildAndRunVersion "regression/84" FSC_OPTIMIZED "supports-ml" [] let ``85`` () = let cfg = testConfig "regression/85" - fsc cfg "%s -r:Category.dll -a -o:petshop.dll" cfg.fsc_flags ["Category.ml"] + fsc cfg "%s --langversion:5.0 --mlcompatibility -r:Category.dll -a -o:petshop.dll" cfg.fsc_flags ["Category.ml"] peverify cfg "petshop.dll" #endif [] - let ``86`` () = singleTestBuildAndRun "regression/86" FSC_OPTIMIZED + let ``86`` () = singleTestBuildAndRunVersion "regression/86" FSC_OPTIMIZED "supports-ml" [] let ``struct-tuple-bug-1-FSI`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSI @@ -2472,7 +2472,7 @@ module TypecheckTests = SingleTest.singleTestBuildAndRunWithCopyDlls cfg "full-rank-arrays.dll" FSC_OPTIMIZED [] - let misc () = singleTestBuildAndRun "typecheck/misc" FSC_OPTIMIZED + let misc () = singleTestBuildAndRunVersion "typecheck/misc" FSC_OPTIMIZED "supports-ml" #if !NETCOREAPP @@ -2697,7 +2697,7 @@ module TypecheckTests = [] let ``sigs pos01a`` () = let cfg = testConfig "typecheck/sigs" - fsc cfg "%s -a -o:pos01a.dll" cfg.fsc_flags ["pos01a.fsi"; "pos01a.fs"] + fsc cfg "%s -a --langversion:5.0 --mlcompatibility -o:pos01a.dll" cfg.fsc_flags ["pos01a.fsi"; "pos01a.fs"] peverify cfg "pos01a.dll" [] @@ -2715,10 +2715,10 @@ module TypecheckTests = let ``type check neg01`` () = singleNegTest (testConfig "typecheck/sigs") "neg01" [] - let ``type check neg02`` () = singleNegTest (testConfig "typecheck/sigs") "neg02" + let ``type check neg02`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg02" [] - let ``type check neg03`` () = singleNegTest (testConfig "typecheck/sigs") "neg03" + let ``type check neg03`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "supports-ml*" "neg03" [] let ``type check neg04`` () = singleNegTest (testConfig "typecheck/sigs") "neg04" @@ -3103,7 +3103,10 @@ module TypecheckTests = let ``type check neg118`` () = singleNegTest (testConfig "typecheck/sigs") "neg118" [] - let ``type check neg119`` () = singleNegTest (testConfig "typecheck/sigs") "neg119" + let ``type check neg119a`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "6.0" "neg119a" + + [] + let ``type check neg119b`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "7.0" "neg119b" [] let ``type check neg120`` () = singleNegTest (testConfig "typecheck/sigs") "neg120" diff --git a/tests/fsharp/typecheck/sigs/neg02.vsbsl b/tests/fsharp/typecheck/sigs/neg02.vsbsl index 914fb1c02a6..46e4ce5cb46 100644 --- a/tests/fsharp/typecheck/sigs/neg02.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg02.vsbsl @@ -5,6 +5,6 @@ neg02.fs(6,8,6,15): parse error FS0010: Unexpected identifier in member definiti neg02.fs(17,21,17,26): typecheck error FS3351: Feature 'static abstract interface members' is not supported by target runtime. -neg02.fs(17,21,17,26): typecheck error FS3350: Feature 'static abstract interface members' is not available in F# 6.0. Please use language version 'PREVIEW' or greater. +neg02.fs(17,21,17,26): typecheck error FS3350: Feature 'static abstract interface members' is not available in F# 6.0. Please use language version 7.0 or greater. neg02.fs(17,21,17,24): typecheck error FS0855: No abstract or interface member was found that corresponds to this override diff --git a/tests/fsharp/typecheck/sigs/neg116.bsl b/tests/fsharp/typecheck/sigs/neg116.bsl index 9bd22489ddc..5acda959ee3 100644 --- a/tests/fsharp/typecheck/sigs/neg116.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.bsl @@ -1,10 +1,10 @@ -neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. +neg116.fs(10,34,10,47): ilxgen error FS0041: No overloads match for method 'op_Multiply'. -Known return type: ^a +Known return type: 'a -Known type parameters: < float , Polynomial > +Known type parameters: < Microsoft.FSharp.Core.float , Neg116.Polynomial > Available overloads: - - static member Polynomial.( * ) : s: Complex * p: Polynomial -> Polynomial // Argument 's' doesn't match - - static member Polynomial.( * ) : s: decimal * p: Polynomial -> Polynomial // Argument 's' doesn't match + - static member Neg116.Polynomial.( * ) : s: Microsoft.FSharp.Core.decimal * p: Neg116.Polynomial -> Neg116.Polynomial // Argument 's' doesn't match + - static member Neg116.Polynomial.( * ) : s: Neg116.Complex * p: Neg116.Polynomial -> Neg116.Polynomial // Argument 's' doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg119.bsl b/tests/fsharp/typecheck/sigs/neg119a.bsl similarity index 80% rename from tests/fsharp/typecheck/sigs/neg119.bsl rename to tests/fsharp/typecheck/sigs/neg119a.bsl index ffd7087e301..58a84ff82a8 100644 --- a/tests/fsharp/typecheck/sigs/neg119.bsl +++ b/tests/fsharp/typecheck/sigs/neg119a.bsl @@ -1,5 +1,5 @@ -neg119.fs(40,20,40,22): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'Return'. +neg119a.fs(40,20,40,22): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'Return'. Known return type: ((int -> int -> int) -> obj) diff --git a/tests/fsharp/typecheck/sigs/neg119.fs b/tests/fsharp/typecheck/sigs/neg119a.fs similarity index 100% rename from tests/fsharp/typecheck/sigs/neg119.fs rename to tests/fsharp/typecheck/sigs/neg119a.fs diff --git a/tests/fsharp/typecheck/sigs/neg119b.bsl b/tests/fsharp/typecheck/sigs/neg119b.bsl new file mode 100644 index 00000000000..e5edc502670 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg119b.bsl @@ -0,0 +1,4 @@ + +neg119b.fs(40,9,40,17): typecheck error FS0030: Value restriction. The value 'res2n3n4' has been inferred to have generic type + val res2n3n4: ^_a when (^_b or Applicatives.ZipList or ^_a) : (static member (<*>) : ^_b * Applicatives.ZipList -> ^_a) and (^_c or obj or ^_b) : (static member (<*>) : ^_c * obj -> ^_b) and (Applicatives.Ap or ^_c) : (static member Return: ^_c * Applicatives.Ap -> ((int -> int -> int) -> ^_c)) +Either define 'res2n3n4' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. diff --git a/tests/fsharp/typecheck/sigs/neg119b.fs b/tests/fsharp/typecheck/sigs/neg119b.fs new file mode 100644 index 00000000000..46d64d49395 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg119b.fs @@ -0,0 +1,40 @@ +module Neg119 + +// This is an example provided by Gustavo Leon in https://github.com/dotnet/fsharp/pull/4173 +// The code is potentially valid and, if that PR had been accepted, would compile. +// It's being added as a negative test case to capture the fact that it currently +// fails to compile. + +module Applicatives = + open System + + type Ap = Ap with + static member inline Invoke (x:'T) : '``Applicative<'T>`` = + let inline call (mthd : ^M, output : ^R) = ((^M or ^R) : (static member Return: _*_ -> _) output, mthd) + call (Ap, Unchecked.defaultof<'``Applicative<'T>``>) x + static member inline InvokeOnInstance (x:'T) = (^``Applicative<'T>`` : (static member Return: ^T -> ^``Applicative<'T>``) x) + static member inline Return (r:'R , _:obj) = Ap.InvokeOnInstance :_ -> 'R + static member Return (_:seq<'a> , Ap ) = fun x -> Seq.singleton x : seq<'a> + static member Return (_:Tuple<'a>, Ap ) = fun x -> Tuple x : Tuple<'a> + static member Return (_:'r -> 'a , Ap ) = fun k _ -> k : 'a -> 'r -> _ + + let inline result (x:'T) = Ap.Invoke x + + let inline (<*>) (f:'``Applicative<'T->'U>``) (x:'``Applicative<'T>``) : '``Applicative<'U>`` = + (( ^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>): _*_ -> _) f, x) + + let inline (+) (a:'Num) (b:'Num) :'Num = a + b + + type ZipList<'s> = ZipList of 's seq with + static member Return (x:'a) = ZipList (Seq.initInfinite (fun _ -> x)) + static member (<*>) (ZipList (f:seq<'a->'b>), ZipList x) = ZipList (Seq.zip f x |> Seq.map (fun (f, x) -> f x)) :ZipList<'b> + + type Ii = Ii + type Idiomatic = Idiomatic with + static member inline ($) (Idiomatic, si) = fun sfi x -> (Idiomatic $ x) (sfi <*> si) + static member ($) (Idiomatic, Ii) = id + let inline idiomatic a b = (Idiomatic $ b) a + let inline iI x = (idiomatic << result) x + + let res1n2n3 = iI (+) (result 0M ) (ZipList [1M;2M;3M]) Ii + let res2n3n4 = iI (+) (result LanguagePrimitives.GenericOne) (ZipList [1 ;2 ;3 ]) Ii diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/langversion/langversionhelp.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/langversion/langversionhelp.437.1033.bsl index d8234d15843..2e3e65520ac 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/langversion/langversionhelp.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/langversion/langversionhelp.437.1033.bsl @@ -6,4 +6,5 @@ latestmajor 4.6 4.7 5.0 -6.0 (Default) \ No newline at end of file +6.0 +7.0 (Default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl index d8234d15843..2e3e65520ac 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/langversion/langversionhelp.437.1033.bsl @@ -6,4 +6,5 @@ latestmajor 4.6 4.7 5.0 -6.0 (Default) \ No newline at end of file +6.0 +7.0 (Default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/env.lst b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/env.lst index ad4c32d6e78..238632d2bc7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/env.lst +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/env.lst @@ -1,6 +1,6 @@ - SOURCE=CombineResults01.fs SCFLAGS=-a # CombineResults01.fs - SOURCE=ForLoop01.fs # ForLoop01.fs - SOURCE=Regressions01.fs # Regressions01.fs + SOURCE=CombineResults01.fs SCFLAGS=-a --langversion:5.0 --mlcompatibility # CombineResults01.fs + SOURCE=ForLoop01.fs SCFLAGS=--langversion:5.0 --mlcompatibility # ForLoop01.fs + SOURCE=Regressions01.fs SCFLAGS=--langversion:5.0 --mlcompatibility # Regressions01.fs SOURCE=MinMaxValuesInLoop01.fs # MinMaxValuesInLoop01.fs SOURCE=MinMaxValuesInLoop02.fs # MinMaxValuesInLoop02.fs diff --git a/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/NamespacesFragmentsAndImplementationFiles/global/env.lst b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/NamespacesFragmentsAndImplementationFiles/global/env.lst index 7ca75fe1902..1e785f64c22 100644 --- a/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/NamespacesFragmentsAndImplementationFiles/global/env.lst +++ b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/NamespacesFragmentsAndImplementationFiles/global/env.lst @@ -2,7 +2,7 @@ NoMT SOURCE=FSharpImportCSharp.fs PRECMD="\$CSC_PIPE /t:library CSharpDll.cs" SC SOURCE=MiscNegativeTests.fs SCFLAGS="--test:ErrorRanges" # MiscNegativeTests.fs SOURCE=AsPrefix.fsx SCFLAGS="--test:ErrorRanges" # AsPrefix.fsx - SOURCE=E_Abbreviation.fsx SCFLAGS="--test:ErrorRanges" # E_Abbreviation.fsx + SOURCE=E_Abbreviation.fsx SCFLAGS="--langversion:5.0 --test:ErrorRanges" # E_Abbreviation.fsx SOURCE=E_AsATypeInFunctionDecl.fsx SCFLAGS="--test:ErrorRanges" # E_AsATypeInFunctionDecl.fsx SOURCE=E_AsModuleName.fsx SCFLAGS="--test:ErrorRanges" # E_AsModuleName.fsx diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/NameResolution/RequireQualifiedAccess/env.lst b/tests/fsharpqa/Source/Conformance/InferenceProcedures/NameResolution/RequireQualifiedAccess/env.lst index 69673ec37a1..ee88eeb11ef 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/NameResolution/RequireQualifiedAccess/env.lst +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/NameResolution/RequireQualifiedAccess/env.lst @@ -9,4 +9,4 @@ SOURCE=OnRecordVsUnion_NoRQA.fs # OnRecordVsUnion_NoRQA.fs SOURCE=OnRecordVsUnion_NoRQA2.fs # OnRecordVsUnion_NoRQA2.fs SOURCE=OnUnionWithCaseOfSameName.fs # OnUnionWithCaseOfSameName.fs - SOURCE=OnUnionWithCaseOfSameName2.fs # OnUnionWithCaseOfSameName2.fs + SOURCE=OnUnionWithCaseOfSameName2.fs SCFLAGS=--langversion:6.0 # OnUnionWithCaseOfSameName2.fs diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/env.lst b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/env.lst index b8388cdb3f3..defbbf4e3b9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/env.lst +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/env.lst @@ -5,14 +5,14 @@ ##### - SOURCE=indent_off_01.fs SCFLAGS="--warnaserror --mlcompatibility" # indent_off_01.fs - SOURCE=indent_off_01.fsi # indent_off_01.fsi - SOURCE=indent_off_01.fsx # indent_off_01.fsx - SOURCE=indent_off_01.fsscript # indent_off_01.fsscript - SOURCE=indent_off_after_comment01.fs SCFLAGS="-a --warnaserror --mlcompatibility" # indent_off_after_comment01.fs + SOURCE=indent_off_01.fs SCFLAGS=--langversion:5.0 --mlcompatibility # indent_off_01.fs + SOURCE=indent_off_01.fsi SCFLAGS=--langversion:5.0 --mlcompatibility # indent_off_01.fsi + SOURCE=indent_off_01.fsx SCFLAGS=--langversion:5.0 --mlcompatibility # indent_off_01.fsx + SOURCE=indent_off_01.fsscript SCFLAGS=--langversion:5.0 --mlcompatibility # indent_off_01.fsscript + SOURCE=indent_off_after_comment01.fs SCFLAGS="-a --langversion:5.0 --mlcompatibility" # indent_off_after_comment01.fs SOURCE=First_Non_Comment_Text01.fs # First_Non_Comment_Text01.fs - SOURCE=light_off_01.fs SCFLAGS="--warnaserror --mlcompatibility" # light_off_01.fs + SOURCE=light_off_01.fs SCFLAGS="--warnaserror --mlcompatibility --langversion:5.0" # light_off_01.fs NoMT SOURCE=default_in_fsi01.fs COMPILE_ONLY=1 FSIMODE=PIPE # default_in_fsi01.fs NoMT SOURCE=default_in_fsi02.fs COMPILE_ONLY=1 FSIMODE=EXEC # default_in_fsi02.fs diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst b/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst index a6aa35ba77f..676d5fb9969 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/env.lst @@ -17,11 +17,11 @@ NoMT SOURCE=fileModuleImpl03b.fs FSIMODE=PIPE COMPILE_ONLY=1 # fileModuleImpl SOURCE=typ01.fs SCFLAGS="--test:ErrorRanges" # typ01.fs SOURCE=typ01b.fs SCFLAGS="--test:ErrorRanges" # typ01b.fs - SOURCE=quoteExpr01.fs SCFLAGS="--test:ErrorRanges" # quoteExpr01.fs - SOURCE=quoteExpr01b.fs SCFLAGS="--test:ErrorRanges" # quoteExpr01b.fs + SOURCE=quoteExpr01.fs SCFLAGS="--langversion:5.0 --mlcompatibility --test:ErrorRanges" # quoteExpr01.fs + SOURCE=quoteExpr01b.fs SCFLAGS="--langversion:5.0 --mlcompatibility --test:ErrorRanges" # quoteExpr01b.fs - SOURCE=braceExpr01.fs SCFLAGS="--test:ErrorRanges" # braceExpr01.fs - SOURCE=braceExpr01b.fs SCFLAGS="--test:ErrorRanges" # braceExpr01b.fs + SOURCE=braceExpr01.fs SCFLAGS="--langversion:5.0 --mlcompatibility --test:ErrorRanges" # braceExpr01.fs + SOURCE=braceExpr01b.fs SCFLAGS="--langversion:5.0 --mlcompatibility --test:ErrorRanges" # braceExpr01b.fs SOURCE=fileModuleImpl01.fs SCFLAGS="--test:ErrorRanges" # fileModuleImpl01.fs @@ -32,8 +32,6 @@ NoMT SOURCE=fileModuleImpl03b.fs FSIMODE=PIPE COMPILE_ONLY=1 # fileModuleImpl SOURCE=typedSeqExprBlock01.fs SCFLAGS="--test:ErrorRanges" # typedSeqExprBlock01.fs SOURCE=typedSeqExprBlock02.fs SCFLAGS="--test:ErrorRanges" # typedSeqExprBlock02.fs - SOURCE=declExpr01.fs SCFLAGS="--test:ErrorRanges" # declExpr01.fs - SOURCE=interactiveExprOrDefinitionsTerminator01.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator01.fs SOURCE=interactiveExprOrDefinitionsTerminator02.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator02.fs SOURCE=interactiveExprOrDefinitionsTerminator03.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator03.fs @@ -47,15 +45,16 @@ NoMT SOURCE=fileModuleImpl03b.fs FSIMODE=PIPE COMPILE_ONLY=1 # fileModuleImpl # This is an artifact to deal with the current harness: there is not reason we could not do 1 verification at once... SOURCE=fileModuleImpl01b.fs SCFLAGS="--nowarn:62" # fileModuleImpl01b.fs - SOURCE=monadicExprNonEmptyInitial01b.fs # monadicExprNonEmptyInitial01b.fs + SOURCE=monadicExprNonEmptyInitial01b.fs # monadicExprNonEmptyInitial01b.fs SOURCE=monadicPatternClauses01b.fs # monadicPatternClauses01b.fs - SOURCE=typedSeqExprBlock01b.fs # typedSeqExprBlock01b.fs + SOURCE=typedSeqExprBlock01b.fs SCFLAGS="--langversion:5.0 --mlcompatibility" # typedSeqExprBlock01b.fs SOURCE=typedSeqExprBlock02b.fs # typedSeqExprBlock02b.fs - SOURCE=declExpr01b.fs SCFLAGS="--test:ErrorRanges" # declExpr01b.fs + SOURCE=declExpr01.fs SCFLAGS="--test:ErrorRanges" # declExpr01.fs + SOURCE=declExpr01b.fs SCFLAGS="--langversion:5.0 --mlcompatibility --test:ErrorRanges" # declExpr01b.fs - SOURCE=interactiveExprOrDefinitionsTerminator01b.fs # interactiveExprOrDefinitionsTerminator01b.fs + SOURCE=interactiveExprOrDefinitionsTerminator01b.fs # interactiveExprOrDefinitionsTerminator01b.fs SOURCE=interactiveExprOrDefinitionsTerminator02b.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator02b.fs SOURCE=interactiveExprOrDefinitionsTerminator03b.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator03b.fs SOURCE=interactiveExprOrDefinitionsTerminator04b.fs SCFLAGS="--test:ErrorRanges" # interactiveExprOrDefinitionsTerminator04b.fs diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_load_badextension.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/E_load_badextension.fsx index 09e5e6cc62a..1e8cc8b61e3 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_load_badextension.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/E_load_badextension.fsx @@ -2,4 +2,4 @@ () -//The file extension of '.+\\dummy\.txt' is not recognized\. Source files must have extension \.fs, \.fsi, \.fsx, \.fsscript, \.ml or \.mli\.$ \ No newline at end of file +//The file extension of '.+\\dummy\.txt' is not recognized\. Source files must have extension \.fs, \.fsi, \.fsx or \.fsscript$ \ No newline at end of file diff --git a/tests/service/Common.fs b/tests/service/Common.fs index b683dd9dce1..fe50b7b5a8e 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -184,6 +184,7 @@ let parseAndCheckScriptWithOptions (file:string, input, opts) = let parseAndCheckScript (file, input) = parseAndCheckScriptWithOptions (file, input, [| |]) let parseAndCheckScript50 (file, input) = parseAndCheckScriptWithOptions (file, input, [| "--langversion:5.0" |]) +let parseAndCheckScript70 (file, input) = parseAndCheckScriptWithOptions (file, input, [| "--langversion:7.0" |]) let parseAndCheckScriptPreview (file, input) = parseAndCheckScriptWithOptions (file, input, [| "--langversion:preview" |]) let parseSourceCode (name: string, code: string) = @@ -355,6 +356,9 @@ let getParseAndCheckResultsPreview (source: string) = let getParseAndCheckResults50 (source: string) = parseAndCheckScript50("Test.fsx", source) +let getParseAndCheckResults70 (source: string) = + parseAndCheckScript70("Test.fsx", source) + let inline dumpDiagnostics (results: FSharpCheckFileResults) = results.Diagnostics diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 69b4cf1fcb3..428e08d96e1 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -3263,7 +3263,7 @@ let f7() = callXY (C()) (D()) let f8() = callXY (D()) (C()) """ - let createOptions() = createOptionsAux [fileSource1] ["--langversion:preview"] + let createOptions() = createOptionsAux [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses1`` () = @@ -3387,7 +3387,7 @@ type MyNumberWrapper = { MyNumber: MyNumber } """ - let createOptions() = createOptionsAux [fileSource1] ["--langversion:preview"] + let createOptions() = createOptionsAux [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses2`` () = @@ -3442,11 +3442,11 @@ let s2 = sign p1 """ - let createOptions() = createOptionsAux [fileSource1] ["--langversion:preview"] + let createOptions() = createOptionsAux [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses3`` () = - let cleanup, options = createOptionsAux [ ProjectForWitnesses3.fileSource1 ] ["--langversion:preview"] + let cleanup, options = createOptionsAux [ ProjectForWitnesses3.fileSource1 ] ["--langversion:7.0"] use _holder = cleanup let exprChecker = FSharpChecker.Create(keepAssemblyContents=true) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3536,7 +3536,7 @@ let isNullQuoted (ts : 't[]) = """ - let createOptions() = createOptionsAux [fileSource1] ["--langversion:preview"] + let createOptions() = createOptionsAux [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses4 GetWitnessPassingInfo`` () = diff --git a/tests/service/PatternMatchCompilationTests.fs b/tests/service/PatternMatchCompilationTests.fs index 9ca4362ead7..4e56b7672e2 100644 --- a/tests/service/PatternMatchCompilationTests.fs +++ b/tests/service/PatternMatchCompilationTests.fs @@ -370,7 +370,7 @@ match A with [] let ``As 01 - names and wildcards`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ match 1 with | _ as w -> let x = w + 1 in () @@ -389,7 +389,7 @@ match 3 with [] #endif let ``As 02 - type testing`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let (|Id|) = id match box 1 with | :? int as a -> let b = a + 1 in () @@ -414,7 +414,7 @@ match box 1 with [] #endif let ``As 03 - impossible type testing`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ match Unchecked.defaultof with | :? System.Enum as (:? System.ConsoleKey as a) -> let b = a + enum 1 in () | :? System.Enum as (:? System.ConsoleKey as c) -> let d = c + enum 1 in () @@ -432,7 +432,7 @@ match Unchecked.defaultof with [] #endif let ``As 04 - duplicate type testing`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ match Unchecked.defaultof with | :? System.Enum as (a & b) -> let c = a = b in () | :? System.Enum as (:? System.ConsoleKey as (d & e)) -> let f = d + e + enum 1 in () @@ -448,7 +448,7 @@ match Unchecked.defaultof with [] #endif let ``As 05 - inferred type testing`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ match Unchecked.defaultof with | :? _ as a -> let _ = a in () @@ -463,7 +463,7 @@ match Unchecked.defaultof with [] let ``As 06 - completeness`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ match Unchecked.defaultof with | true as a -> if a then () | b as false -> if not b then () @@ -532,7 +532,7 @@ parenPattern: | parenPattern COLON_COLON parenPattern | constrPattern *) - let _, checkResults = getParseAndCheckResultsPreview $""" + let _, checkResults = getParseAndCheckResults70 $""" let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Id0|) = ignore let (|Id1|) = id @@ -563,7 +563,7 @@ Some v |> eq [] #endif let ``As 08 - syntactical precedence matrix testing right - partial patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None let (|Unit2|_|) _ = (|Unit1|_|) @@ -623,7 +623,7 @@ Some w |> eq [] #endif let ``As 09 - syntactical precedence matrix testing right - erroneous patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let (|DefinedPattern|) = id let a as 1 = true let b as true = 2 @@ -667,7 +667,7 @@ let z as [] let ``As 10 - syntactical precedence matrix testing left - total patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview $""" + let _, checkResults = getParseAndCheckResults70 $""" let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Id0|) = ignore let (|Id1|) = id @@ -699,7 +699,7 @@ Some x |> eq [] #endif let ``As 11 - syntactical precedence matrix testing left - partial patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None let (|Unit2|_|) _ = (|Unit1|_|) @@ -759,7 +759,7 @@ Some w |> eq [] #endif let ``As 12 - syntactical precedence matrix testing left - erroneous patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let (|DefinedPattern|) = id let 1 as a = true let true as b = 2 @@ -810,7 +810,7 @@ let z as = [] #endif let ``As 13 - syntactical precedence matrix testing right with type tests - total patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview $""" + let _, checkResults = getParseAndCheckResults70 $""" let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Id0|) = ignore let (|Id1|) = id @@ -874,7 +874,7 @@ Some x |> eq [] #endif let ``As 14 - syntactical precedence matrix testing right with type tests - partial patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None let (|Unit2|_|) _ = (|Unit1|_|) @@ -953,7 +953,7 @@ Some w |> eq [] #endif let ``As 15 - syntactical precedence matrix testing right with type tests - erroneous patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let (|DefinedPattern|) = id let :? a as 1 = true let :? b as true = 2 @@ -1010,7 +1010,7 @@ let :? z as #endif let ``As 16 - syntactical precedence matrix testing left with type tests - total patterns`` () = let validSet = set { 'a'..'x' } - set [ 'p'; 'q' ] |> Set.map string - let _, checkResults = getParseAndCheckResultsPreview $""" + let _, checkResults = getParseAndCheckResults70 $""" let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Id0|) = ignore let (|Id1|) = id @@ -1066,7 +1066,7 @@ Some "" |> eq // No more type checks after the above line? [] #endif let ``As 17 - syntactical precedence matrix testing left with type tests - partial patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let eq<'T> (x:'T option) = () // FS-1093-safe type assert function let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None let (|Unit2|_|) _ = (|Unit1|_|) @@ -1160,7 +1160,7 @@ Some "" |> eq [] #endif let ``As 18 - syntactical precedence matrix testing left with type tests - erroneous patterns`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ let (|DefinedPattern|) = id let 1 as :? a = true let true as :? b = 2 @@ -1219,7 +1219,7 @@ let as :? z = [] #endif let ``As 19 - syntactical precedence matrix testing - valid syntactic patterns that cause type errors later`` () = - let _, checkResults = getParseAndCheckResultsPreview """ + let _, checkResults = getParseAndCheckResults70 """ type I() = inherit System.Attribute() type M() = inherit I() let 'a'..'b' as c = 'd' From 72c6403e4b30a7994d5b32064eabc19269ff136e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 24 Aug 2022 14:00:36 +0100 Subject: [PATCH 133/226] update --times logic (#13751) Co-authored-by: Kevin Ransom (msft) --- FSharpBuild.Directory.Build.props | 1 + src/Compiler/Driver/CompilerOptions.fs | 59 +++++++++++-------- src/Compiler/FSharp.Compiler.Service.fsproj | 2 +- src/Compiler/Utilities/illib.fs | 2 +- src/fsc/App.config | 2 +- .../Source/CompilerOptions/fsc/times/env.lst | 13 ---- .../CompilerOptions/fsc/times/error_01.fs | 4 -- .../CompilerOptions/fsc/times/error_02.fs | 4 -- .../CompilerOptions/fsc/times/error_04.fs | 5 -- .../CompilerOptions/fsc/times/times01.fs | 50 ---------------- .../CompilerOptions/fsi/times/asargument.fsx | 4 -- .../Source/CompilerOptions/fsi/times/env.lst | 13 ---- .../CompilerOptions/fsi/times/error_02.fs | 4 -- .../CompilerOptions/fsi/times/error_03.fs | 4 -- .../CompilerOptions/fsi/times/error_04.fs | 5 -- .../CompilerOptions/fsi/times/times01.fs | 4 -- tests/fsharpqa/Source/test.lst | 2 - 17 files changed, 40 insertions(+), 138 deletions(-) delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/times/env.lst delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/times/error_01.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/times/error_02.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/times/error_04.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/env.lst delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/error_02.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/error_03.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/error_04.fs delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 3d0ccc3d95c..52012f23731 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -25,6 +25,7 @@ 4.4.0 1182;0025;$(WarningsAsErrors) $(OtherFlags) --nowarn:3384 + $(OtherFlags) --times --nowarn:75 diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 7bbecb8916b..7d428fe914c 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -5,6 +5,7 @@ module internal FSharp.Compiler.CompilerOptions open System +open System.Diagnostics open System.IO open Internal.Utilities.Library open Internal.Utilities.Library.Extras @@ -2241,8 +2242,8 @@ let PrintWholeAssemblyImplementation (tcConfig: TcConfig) outfile header expr = // ReportTime //---------------------------------------------------------------------------- -let mutable tPrev = None -let mutable nPrev = None +let mutable tPrev: (DateTime * DateTime * float * int[]) option = None +let mutable nPrev: string option = None let ReportTime (tcConfig: TcConfig) descr = @@ -2278,29 +2279,41 @@ let ReportTime (tcConfig: TcConfig) descr = if (tcConfig.showTimes || verbose) then // Note that timing calls are relatively expensive on the startup path so we don't // make this call unless showTimes has been turned on. - let timeNow = - System.Diagnostics.Process.GetCurrentProcess().UserProcessorTime.TotalSeconds - + let p = Process.GetCurrentProcess() + let utNow = p.UserProcessorTime.TotalSeconds + let tNow = DateTime.Now let maxGen = GC.MaxGeneration let gcNow = [| for i in 0..maxGen -> GC.CollectionCount i |] - let ptime = System.Diagnostics.Process.GetCurrentProcess() - let wsNow = ptime.WorkingSet64 / 1000000L - - match tPrev, nPrev with - | Some (timePrev, gcPrev: int[]), Some prevDescr -> - let spanGC = [| for i in 0..maxGen -> GC.CollectionCount i - gcPrev[i] |] - dprintf "TIME: %4.1f Delta: %4.1f Mem: %3d" timeNow (timeNow - timePrev) wsNow - - dprintf - " G0: %3d G1: %2d G2: %2d [%s]\n" - spanGC[Operators.min 0 maxGen] - spanGC[Operators.min 1 maxGen] - spanGC[Operators.min 2 maxGen] - prevDescr - - | _ -> () - - tPrev <- Some(timeNow, gcNow) + let wsNow = p.WorkingSet64 / 1000000L + + let tStart = + match tPrev, nPrev with + | Some (tStart, tPrev, utPrev, gcPrev), Some prevDescr -> + let spanGC = [| for i in 0..maxGen -> GC.CollectionCount i - gcPrev[i] |] + let t = tNow - tStart + let tDelta = tNow - tPrev + let utDelta = utNow - utPrev + + printf + "Real: %4.1f Realdelta: %4.1f Cpu: %4.1f Cpudelta: %4.1f Mem: %3d" + t.TotalSeconds + tDelta.TotalSeconds + utNow + utDelta + wsNow + + printfn + " G0: %3d G1: %2d G2: %2d [%s]" + spanGC[Operators.min 0 maxGen] + spanGC[Operators.min 1 maxGen] + spanGC[Operators.min 2 maxGen] + prevDescr + + tStart + + | _ -> DateTime.Now + + tPrev <- Some(tStart, tNow, utNow, gcNow) nPrev <- Some descr diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 5f53b8b610d..2efe648a3be 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -14,7 +14,7 @@ true $(DefineConstants);COMPILER $(DefineConstants);USE_SHIPPED_FSCORE - $(OtherFlags) --extraoptimizationloops:1 --times + $(OtherFlags) --extraoptimizationloops:1 $(OtherFlags) --warnon:1182 diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index eb86fce0030..6eab1b08508 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -104,7 +104,7 @@ module internal PervasiveAutoOpens = t) | Some t -> t - printf "ilwrite: TIME %10.3f (total) %10.3f (delta) - %s\n" (t - first) (t - prev) descr + printf " ilwrite: Cpu %4.1f (total) %4.1f (delta) - %s\n" (t - first) (t - prev) descr tPrev <- Some t let foldOn p f z x = f z (p x) diff --git a/src/fsc/App.config b/src/fsc/App.config index eb256128200..c1a8dd9b745 100644 --- a/src/fsc/App.config +++ b/src/fsc/App.config @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/times/env.lst deleted file mode 100644 index a66f99f264f..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/env.lst +++ /dev/null @@ -1,13 +0,0 @@ -# Functional: the option does what it is meant to do - SOURCE=times01.fs COMPILE_ONLY=1 SCFLAGS="--times" - SOURCE=times01.fs COMPILE_ONLY=1 TAILFLAGS="--times" - -# Last one wins... - SOURCE=times01.fs COMPILE_ONLY=1 SCFLAGS="--times --times" - -# Option is case sentitive - -# Mispelled options - -# Missing argument - SOURCE=error_04.fs COMPILE_ONLY=1 TAILFLAGS="--times:0" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_01.fs deleted file mode 100644 index 3df58150e86..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_01.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--Times' -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_02.fs deleted file mode 100644 index 7232ba1d293..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_02.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--times-' -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_04.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_04.fs deleted file mode 100644 index 01735176c60..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/error_04.fs +++ /dev/null @@ -1,5 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--times' -// See FSHARP1.0:2850 (IMO, this is a bug!) -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs deleted file mode 100644 index 63a3663ff4d..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs +++ /dev/null @@ -1,50 +0,0 @@ -// #NoMT #CompilerOptions -#light - -namespace N - module M = - let f x = () - f 10 - -namespace N2 - module M2 = - let f2 x = () - f2 10 - - module M3 = - exit 0 - -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib and FSharp.Core.dll\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import non-system references\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> IL\] -//ilwrite: TIME.+Write Started -//ilwrite: TIME.+Module Generation Preparation -//ilwrite: TIME.+Module Generation Pass 1 -//ilwrite: TIME.+Module Generation Pass 2 -//ilwrite: TIME.+Module Generation Pass 3 -//ilwrite: TIME.+Module Generation Pass 4 -//ilwrite: TIME.+Finalize Module Generation Results -//ilwrite: TIME.+Generated Tables and Code -//ilwrite: TIME.+Layout Header of Tables -//ilwrite: TIME.+Build String/Blob Address Tables -//ilwrite: TIME.+Sort Tables -//ilwrite: TIME.+Write Header of tablebuf -//ilwrite: TIME.+Write Tables to tablebuf -//ilwrite: TIME.+Layout Metadata -//ilwrite: TIME.+Write Metadata Header -//ilwrite: TIME.+Write Metadata Tables -//ilwrite: TIME.+Write Metadata Strings -//ilwrite: TIME.+Write Metadata User Strings -//ilwrite: TIME.+Write Blob Stream -//ilwrite: TIME.+Fixup Metadata -//ilwrite: TIME.+Generated IL and metadata -//ilwrite: TIME.+Layout image -//ilwrite: TIME.+Writing Image -//ilwrite: TIME.+Finalize PDB -//ilwrite: TIME.+Signing Image -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx deleted file mode 100644 index a06a2fa3adb..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx +++ /dev/null @@ -1,4 +0,0 @@ -// #NoMT #CompilerOptions -// -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsi/times/env.lst deleted file mode 100644 index 2f1494e0696..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/env.lst +++ /dev/null @@ -1,13 +0,0 @@ -# As argument, after -- - SOURCE=asargument.fsx COMPILE_ONLY=1 TAILFLAGS="-- --times" FSIMODE=EXEC - -# Last one wins... - SOURCE=times01.fs COMPILE_ONLY=1 SCFLAGS="--times --times" FSIMODE=PIPE - -# Mispelled options - SOURCE=error_02.fs SCFLAGS="--times-" FSIMODE=EXEC - SOURCE=error_03.fs SCFLAGS="--times+" FSIMODE=EXEC - -# Missing argument - SOURCE=error_04.fs TAILFLAGS="--times:0" FSIMODE=EXEC - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_02.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_02.fs deleted file mode 100644 index 7232ba1d293..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_02.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--times-' -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_03.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_03.fs deleted file mode 100644 index 40b5dfee963..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_03.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--times\+' -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_04.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_04.fs deleted file mode 100644 index 01735176c60..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/error_04.fs +++ /dev/null @@ -1,5 +0,0 @@ -// #Regression #NoMT #CompilerOptions -//Unrecognized option: '--times' -// See FSHARP1.0:2850 (IMO, this is a bug!) -#light -exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs deleted file mode 100644 index e30ea7ad563..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs +++ /dev/null @@ -1,4 +0,0 @@ -// #NoMT #CompilerOptions -//TIME.+Optimizations - -exit 0;; diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index 0932c7a1f49..31eac0a00f9 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -29,7 +29,6 @@ CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\staticlink CompilerOptions01,NoMT CompilerOptions\fsc\subsystemversion CompilerOptions01,NoMT CompilerOptions\fsc\tailcalls CompilerOptions01,NoMT CompilerOptions\fsc\target -CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\times CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\tokenize CompilerOptions01,NoMT CompilerOptions\fsc\responsefile CompilerOptions01,NoMT,help CompilerOptions\fsi\help @@ -37,7 +36,6 @@ CompilerOptions01,NoMT CompilerOptions\fsi\highentropyva CompilerOptions01,NoMT CompilerOptions\fsi\langversion CompilerOptions01,NoMT CompilerOptions\fsi\nologo CompilerOptions01,NoMT CompilerOptions\fsi\subsystemversion -CompilerOptions01,NoMT CompilerOptions\fsi\times CompilerOptions02,NoMT CompilerOptions\fsi\exename CompilerOptions01,NoMT,Determinism CompilerOptions\fsc\determinism From 710a5d1e81708b67ef6924234a87b69f920c5af7 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 24 Aug 2022 15:31:59 +0100 Subject: [PATCH 134/226] Only add open path when module exposes types or bindings. (#13764) * Only add open path when module exposes types or bindings. * Re-use isConcreteNamespace helper. --- src/Compiler/Checking/NicePrint.fs | 10 +- .../FSharp.Compiler.ComponentTests.fsproj | 4 + .../Signatures/ModuleOrNamespaceTests.fs | 154 ++++++++++++++++++ tests/FSharp.Test.Utilities/Compiler.fs | 13 +- 4 files changed, 174 insertions(+), 7 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index ed7e92bf0ef..9f80ad640a8 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -2326,12 +2326,10 @@ module InferredSigPrinting = let outerPath = mspec.CompilationPath.AccessPath let denv = - innerPath - |> List.choose (fun (path, kind) -> - match kind with - | ModuleOrNamespaceKind.Namespace false -> None - | _ -> Some path) - |> denv.AddOpenPath + if not (isConcreteNamespace def) then + denv + else + denv.AddOpenPath (List.map fst innerPath) if mspec.IsImplicitNamespace then // The current mspec is a namespace that belongs to the `def` child (nested) module(s). diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 4a9e7f7c650..950923f23d7 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -24,6 +24,9 @@ + + FsUnit.fs + @@ -193,6 +196,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs new file mode 100644 index 00000000000..5051d595827 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs @@ -0,0 +1,154 @@ +module FSharp.Compiler.ComponentTests.Signatures.ModuleOrNamespaceTests + +open System +open Xunit +open FsUnit +open FSharp.Test.Compiler + +let private prependNewline v = String.Concat("\n", v) + +let equal x = + let x = + match box x with + | :? String as s -> s.Replace("\r\n", "\n") |> box + | x -> x + + equal x + +[] +let ``Type from shared namespace`` () = + FSharp + """ +namespace Foo.Types + +type Area = | Area of string * int + +namespace Foo.Other + +type Map<'t,'v> = + member this.Calculate : Foo.Types.Area = failwith "todo" +""" + |> printSignatures + |> prependNewline + |> should + equal + """ +namespace Foo.Types + + type Area = | Area of string * int +namespace Foo.Other + + type Map<'t,'v> = + + member Calculate: Foo.Types.Area""" + +[] +let ``Return type used in own type definition`` () = + FSharp + """ +namespace Hey.There + +type Foo = + static member Zero : Foo = failwith "todo" +""" + |> printSignatures + |> prependNewline + |> should + equal + """ +namespace Hey.There + + type Foo = + + static member Zero: Foo""" + +[] +let ``Function types`` () = + FSharp + """ +namespace Fantomas.Core + +module Context = + type Context = { SourceCode: string } + +namespace FSharp.Compiler + +module Syntax = + + type SynExpr = + | IfThenElse + | While + +module Text = + type Range = + struct + val startLine: int + val startColumn: int + val endLine: int + val endColumn: int + end + +namespace Fantomas.Core + +module internal CodePrinter = + + open FSharp.Compiler + open FSharp.Compiler.Syntax + open FSharp.Compiler.Text + open Fantomas.Core.Context + + type ASTContext = + { Meh: bool } + static member Default = { Meh = false } + + let rec genExpr (e: SynExpr) (ctx: Context) = ctx + + and genLambdaArrowWithTrivia + (bodyExpr: SynExpr -> Context -> Context) + (body: SynExpr) + (arrowRange: Range option) + : Context -> Context = + id""" + |> printSignatures + |> prependNewline + |> should + equal + """ +namespace Fantomas.Core + + module Context = + + type Context = + { SourceCode: string } +namespace FSharp.Compiler + + module Syntax = + + type SynExpr = + | IfThenElse + | While + + module Text = + + [] + type Range = + + val startLine: int + + val startColumn: int + + val endLine: int + + val endColumn: int +namespace Fantomas.Core + + module internal CodePrinter = + + type ASTContext = + { Meh: bool } + + static member Default: ASTContext + + val genExpr: e: FSharp.Compiler.Syntax.SynExpr -> ctx: Context.Context -> Context.Context + + val genLambdaArrowWithTrivia: bodyExpr: (FSharp.Compiler.Syntax.SynExpr -> Context.Context -> Context.Context) -> body: FSharp.Compiler.Syntax.SynExpr -> arrowRange: FSharp.Compiler.Text.Range option -> (Context.Context -> Context.Context)""" diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index d70cffdafd4..f997930bac1 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1325,8 +1325,19 @@ module rec Compiler = let actual = text.ToString().Split('\n') - |> Array.map (fun s -> s.TrimEnd(' ')) + |> Array.map (fun s -> s.TrimEnd(' ', '\r')) |> Array.filter (fun s -> s.Length > 0) if not (actual |> Array.contains expected) then failwith ($"The following signature:\n%s{expected}\n\nwas not found in:\n" + (actual |> String.concat "\n")) + + let printSignatures cUnit = + cUnit + |> typecheckResults + |> signatureText + |> string + |> fun s -> + s.Replace("\r", "").Split('\n') + |> Array.map (fun line -> line.TrimEnd()) + |> String.concat "\n" + |> fun tap -> tap \ No newline at end of file From 83988e26559e51366061af3f314dfc33cd152afd Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 24 Aug 2022 19:03:22 +0200 Subject: [PATCH 135/226] Update oneloc branch (#13773) --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 998ad5c9110..34dcb58e73c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,11 +84,11 @@ stages: # Signed build # #-------------------------------------------------------------------------------------------------------------------# - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.3') }}: + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.4') }}: - template: /eng/common/templates/job/onelocbuild.yml parameters: MirrorRepo: fsharp - MirrorBranch: release/dev17.3 + MirrorBranch: release/dev17.4 LclSource: lclFilesfromPackage LclPackageId: 'LCL-JUNO-PROD-FSHARP' - template: /eng/common/templates/jobs/jobs.yml From b09539b457471a88975ce46ee08ff137c8471c6b Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 24 Aug 2022 10:04:00 -0700 Subject: [PATCH 136/226] Rework to ctrl+C to match updated apis (#13770) --- src/Compiler/Checking/CheckExpressions.fsi | 1 - .../Interactive/ControlledExecution.fs | 61 ++++++++----------- src/Compiler/Interactive/fsi.fs | 10 ++- 3 files changed, 29 insertions(+), 43 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 3b70a5caa1e..0bbaca89177 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -126,7 +126,6 @@ val TcFieldInit: range -> ILFieldInit -> Const val LightweightTcValForUsingInBuildMethodCall: g: TcGlobals -> vref: ValRef -> vrefFlags: ValUseFlag -> vrefTypeInst: TTypes -> m: range -> Expr * TType - /// Indicates whether a syntactic type is allowed to include new type variables /// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` type ImplicitlyBoundTyparsAllowed = diff --git a/src/Compiler/Interactive/ControlledExecution.fs b/src/Compiler/Interactive/ControlledExecution.fs index 5ec0e929c0c..81faf21576a 100644 --- a/src/Compiler/Interactive/ControlledExecution.fs +++ b/src/Compiler/Interactive/ControlledExecution.fs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -// This wraps System.Runtime.CompilerServices.ControlledExecution +// This wraps System.Runtime.ControlledExecution // This class enables scripting engines such as Fsi to abort threads safely in the coreclr // This functionality will be introduced in .net 7.0. -// because we continue to dupport older coreclrs and the windows desktop framework through netstandard2.0 +// because we continue to support older coreclrs and the windows desktop framework through netstandard2.0 // we access the features using reflection namespace FSharp.Compiler.Interactive @@ -14,54 +14,43 @@ open System.Threading open Internal.Utilities.FSharpEnvironment -type internal ControlledExecution (thread:Thread) = +open Unchecked + +type internal ControlledExecution () = + + let mutable cts: CancellationTokenSource voption = ValueNone + let mutable thread: Thread voption = ValueNone static let ceType: Type option = - Option.ofObj (Type.GetType("System.Runtime.CompilerServices.ControlledExecution, System.Private.CoreLib", false)) + Option.ofObj (Type.GetType("System.Runtime.ControlledExecution, System.Private.CoreLib", false)) static let threadType: Type option = Option.ofObj (typeof) - static let ceConstructor: ConstructorInfo option = - match ceType with - | None -> None - | Some t -> Option.ofObj (t.GetConstructor([|typeof|])) - static let ceRun: MethodInfo option = match ceType with | None -> None - | Some t -> Option.ofObj (t.GetMethod("Run", [||]) ) - - static let ceTryAbort: MethodInfo option = - match ceType with - | None -> None - | Some t -> Option.ofObj (t.GetMethod("TryAbort", [|typeof|])) + | Some t -> Option.ofObj (t.GetMethod("Run", BindingFlags.Static ||| BindingFlags.Public, defaultof, [|typeof; typeof|], [||] )) static let threadResetAbort: MethodInfo option = match isRunningOnCoreClr, threadType with | false, Some t -> Option.ofObj (t.GetMethod("ResetAbort", [||])) | _ -> None - let newInstance (action: Action) = - match ceConstructor with - | None -> None - | Some c -> Option.ofObj (c.Invoke([|action|])) - - let mutable instance = Unchecked.defaultof - - member this.Run(action: Action) = - let newinstance = newInstance(action) - match newinstance, ceRun with - | Some inst, Some ceRun -> - instance <- newinstance - ceRun.Invoke(inst, [||]) |> ignore - | _ -> action.Invoke() - - member _.TryAbort(timeout: TimeSpan): bool = - match isRunningOnCoreClr, instance, ceTryAbort with - | _, Some instance, Some tryAbort -> tryAbort.Invoke(instance, [|timeout|]) :?> bool - | false, _, _ -> thread.Abort(); true - | true, _, _ -> true + member _.Run (action: Action) = + match ceRun with + | Some run -> + cts <- ValueSome (new CancellationTokenSource()) + run.Invoke(null, [|action; cts.Value.Token|]) |> ignore + | _ -> + thread <- ValueSome (Thread.CurrentThread) + action.Invoke() + + member _.TryAbort(): unit = + match isRunningOnCoreClr, cts, thread with + | true, ValueSome cts, _ -> cts.Cancel() + | false, _, ValueSome thread -> thread.Abort(); () + | _ -> () member _.ResetAbort() = match thread, threadResetAbort with @@ -72,4 +61,4 @@ type internal ControlledExecution (thread:Thread) = match exn with | :? TargetInvocationException as e when not(isNull e.InnerException) -> ControlledExecution.StripTargetInvocationException(e.InnerException) - | _ -> exn + | _ -> exn \ No newline at end of file diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 32a8ad40592..d2632c3fe69 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2262,10 +2262,7 @@ type internal FsiInterruptController( if killThreadRequest = ThreadAbortRequest then if progress then fsiConsoleOutput.uprintnfn "%s" (FSIstrings.SR.fsiAbortingMainThread()) killThreadRequest <- NoRequest - let rec abortLoop n = - if n > 0 then - if not (controlledExecution.TryAbort(TimeSpan.FromSeconds(30))) then abortLoop (n-1) - abortLoop 3 + controlledExecution.TryAbort() ()), Name="ControlCAbortThread") killerThread.IsBackground <- true killerThread.Start() @@ -2888,7 +2885,8 @@ type FsiInteractionProcessor fsiInterruptController.ControlledExecution().ResetAbort() (istate,CtrlC) - | :? TargetInvocationException as e when (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "ThreadAbortException" -> + | :? TargetInvocationException as e when (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "ThreadAbortException" || + (ControlledExecution.StripTargetInvocationException(e)).GetType().Name = "OperationCanceledException" -> fsiInterruptController.ClearInterruptRequest() fsiInterruptController.InterruptAllowed <- InterruptIgnored fsiInterruptController.ControlledExecution().ResetAbort() @@ -3386,7 +3384,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let fsiDynamicCompiler = FsiDynamicCompiler(fsi, timeReporter, tcConfigB, tcLockObject, outWriter, tcImports, tcGlobals, fsiOptions, fsiConsoleOutput, fsiCollectible, niceNameGen, resolveAssemblyRef) - let controlledExecution = ControlledExecution(Thread.CurrentThread) + let controlledExecution = ControlledExecution() let fsiInterruptController = FsiInterruptController(fsiOptions, controlledExecution, fsiConsoleOutput) From bd9045e1ec8b98ac7da2f5713058a1afc288e1f7 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 24 Aug 2022 10:29:49 -0700 Subject: [PATCH 137/226] Implement compression for sig and optdata (#13671) * Initial * tests+xlf * switches * reformat * compressed + format * comments * fsharpqa --- FSharpBuild.Directory.Build.props | 10 ++ azure-pipelines.yml | 58 +++++++ eng/Build.ps1 | 8 +- src/Compiler/Driver/CompilerConfig.fs | 3 + src/Compiler/Driver/CompilerConfig.fsi | 4 + src/Compiler/Driver/CompilerImports.fs | 151 +++++++++--------- src/Compiler/Driver/CompilerImports.fsi | 3 +- src/Compiler/Driver/CompilerOptions.fs | 8 + src/Compiler/FSComp.txt | 5 + src/Compiler/FSharp.Compiler.Service.fsproj | 5 + src/Compiler/Service/IncrementalBuild.fs | 6 +- src/Compiler/SyntaxTree/PrettyNaming.fs | 11 +- src/Compiler/SyntaxTree/PrettyNaming.fsi | 4 + src/Compiler/xlf/FSComp.txt.cs.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.de.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.es.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.fr.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.it.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.ja.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.ko.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.pl.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.ru.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.tr.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 25 +++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 25 +++ src/FSharp.Build/FSharp.Build.fsproj | 5 + src/FSharp.Build/Fsc.fs | 30 ++++ src/FSharp.Build/Microsoft.FSharp.Targets | 3 + ...Sharp.Compiler.Interactive.Settings.fsproj | 5 + .../FSharp.Compiler.Server.Shared.fsproj | 5 + src/FSharp.Core/FSharp.Core.fsproj | 5 + .../FSharp.DependencyManager.Nuget.fsproj | 5 + src/fsc/fsc.targets | 6 + src/fsi/fsi.targets | 5 + .../FSharp.Test.Utilities.fsproj | 1 + tests/FSharp.Test.Utilities/TestFramework.fs | 16 +- tests/FSharp.Test.Utilities/Utilities.fs | 6 +- .../fsc/dumpAllCommandLineOptions/dummy.fs | 5 +- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 1 + .../fsc/help/help40.437.1033.bsl | 2 + 41 files changed, 615 insertions(+), 86 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 52012f23731..7a349c38471 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -84,6 +84,16 @@ $(DefineConstants);TESTING_ON_LINUX + + + + + false + + + true + + $(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c66ed2f4a94..8d758b5360d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -334,6 +334,64 @@ stages: continueOnError: true condition: failed() + # Windows With Compressed Metadata + - job: WindowsCompressedMetadata + pool: + # The PR build definition sets this variable: + # WindowsMachineQueueName=Windows.vs2022.amd64.open + # and there is an alternate build definition that sets this to a queue that is always scouting the + # next preview of Visual Studio. + name: NetCore1ESPool-Public + demands: ImageOverride -equals $(WindowsMachineQueueName) + timeoutInMinutes: 120 + strategy: + maxParallel: 4 + matrix: + desktop_release: + _configuration: Release + _testKind: testDesktop + coreclr_release: + _configuration: Release + _testKind: testCoreclr + fsharpqa_release: + _configuration: Release + _testKind: testFSharpQA + vs_release: + _configuration: Release + _testKind: testVs + steps: + - checkout: self + clean: true + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' + continueOnError: true + condition: ne(variables['_testKind'], 'testFSharpQA') + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' + ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' + publishLocation: Container + continueOnError: true + condition: failed() + - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj + displayName: Dump NuGet cache contents + condition: failed() + - task: PublishBuildArtifacts@1 + displayName: Publish NuGet cache contents + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' + ArtifactName: 'NuGetPackageContents Windows $(_testKind)' + publishLocation: Container + continueOnError: true + condition: failed() + # Mock official build - job: MockOfficial pool: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 010d465d5d4..af103f7911a 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -62,7 +62,7 @@ param ( [switch]$noVisualStudio, [switch]$sourceBuild, [switch]$skipBuild, - + [switch]$compressAllMetadata, [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -116,6 +116,7 @@ function Print-Usage() { Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." Write-Host " -sourceBuild Simulate building for source-build." Write-Host " -skipbuild Skip building product" + Write-Host " -compressAllMetadata Build product with compressed metadata" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -170,6 +171,10 @@ function Process-Arguments() { $script:binaryLog = $False; } + if ($compressAllMetadata) { + $script:compressAllMetadata = $True; + } + foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" @@ -228,6 +233,7 @@ function BuildSolution([string] $solutionName) { /p:QuietRestoreBinaryLog=$binaryLog ` /p:TestTargetFrameworks=$testTargetFrameworks ` /p:DotNetBuildFromSource=$sourceBuild ` + /p:CompressAllMetadata=$CompressAllMetadata ` /v:$verbosity ` $suppressExtensionDeployment ` @properties diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 38c67e917f6..7a957b722da 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -458,6 +458,7 @@ type TcConfigBuilder = mutable metadataVersion: string option mutable standalone: bool mutable extraStaticLinkRoots: string list + mutable compressMetadata: bool mutable noSignatureData: bool mutable onlyEssentialOptimizationData: bool mutable useOptimizationDataFile: bool @@ -682,6 +683,7 @@ type TcConfigBuilder = metadataVersion = None standalone = false extraStaticLinkRoots = [] + compressMetadata = false noSignatureData = false onlyEssentialOptimizationData = false useOptimizationDataFile = false @@ -1230,6 +1232,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.metadataVersion = data.metadataVersion member _.standalone = data.standalone member _.extraStaticLinkRoots = data.extraStaticLinkRoots + member _.compressMetadata = data.compressMetadata member _.noSignatureData = data.noSignatureData member _.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData member _.useOptimizationDataFile = data.useOptimizationDataFile diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 0ac2d8a0e86..461298b5d60 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -331,6 +331,8 @@ type TcConfigBuilder = mutable extraStaticLinkRoots: string list + mutable compressMetadata: bool + mutable noSignatureData: bool mutable onlyEssentialOptimizationData: bool @@ -647,6 +649,8 @@ type TcConfig = member extraStaticLinkRoots: string list + member compressMetadata: bool + member noSignatureData: bool member onlyEssentialOptimizationData: bool diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 7d453dace33..b7738705788 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics open System.IO +open System.IO.Compression open System.Reflection open Internal.Utilities @@ -54,27 +55,53 @@ let (++) x s = x @ [ s ] let IsSignatureDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpSignatureDataResourceName + || r.Name.StartsWithOrdinal FSharpSignatureCompressedDataResourceName || r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 let IsOptimizationDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName + || r.Name.StartsWithOrdinal FSharpOptimizationCompressedDataResourceName || r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 -let GetSignatureDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then - String.dropPrefix r.Name FSharpSignatureDataResourceName - elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then - String.dropPrefix r.Name FSharpSignatureDataResourceName2 +let decompressResource (r: ILResource) = + use raw = r.GetBytes().AsStream() + use decompressed = new MemoryStream() + use deflator = new DeflateStream(raw, CompressionMode.Decompress) + deflator.CopyTo decompressed + deflator.Close() + ByteStorage.FromByteArray(decompressed.ToArray()).GetByteMemory() + +let GetResourceNameAndSignatureDataFunc (r: ILResource) = + let resourceType, ccuName = + if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then + FSharpSignatureDataResourceName, String.dropPrefix r.Name FSharpSignatureDataResourceName + elif r.Name.StartsWithOrdinal FSharpSignatureCompressedDataResourceName then + FSharpSignatureCompressedDataResourceName, String.dropPrefix r.Name FSharpSignatureCompressedDataResourceName + elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then + FSharpSignatureDataResourceName2, String.dropPrefix r.Name FSharpSignatureDataResourceName2 + else + failwith "GetSignatureDataResourceName" + + if resourceType = FSharpSignatureCompressedDataResourceName then + ccuName, (fun () -> decompressResource (r)) else - failwith "GetSignatureDataResourceName" + ccuName, (fun () -> r.GetBytes()) + +let GetResourceNameAndOptimizationDataFunc (r: ILResource) = + let resourceType, ccuName = + if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then + FSharpOptimizationDataResourceName, String.dropPrefix r.Name FSharpOptimizationDataResourceName + elif r.Name.StartsWithOrdinal FSharpOptimizationCompressedDataResourceName then + FSharpOptimizationCompressedDataResourceName, String.dropPrefix r.Name FSharpOptimizationCompressedDataResourceName + elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then + FSharpOptimizationDataResourceName2, String.dropPrefix r.Name FSharpOptimizationDataResourceName2 + else + failwith "GetOptimizationDataResourceName" -let GetOptimizationDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then - String.dropPrefix r.Name FSharpOptimizationDataResourceName - elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then - String.dropPrefix r.Name FSharpOptimizationDataResourceName2 + if resourceType = FSharpOptimizationCompressedDataResourceName then + ccuName, (fun () -> decompressResource (r)) else - failwith "GetOptimizationDataResourceName" + ccuName, (fun () -> r.GetBytes()) let IsReflectedDefinitionsResource (r: ILResource) = r.Name.StartsWithOrdinal(QuotationPickler.SerializedReflectedDefinitionsResourceNameBase) @@ -88,18 +115,23 @@ let MakeILResource rName bytes = MetadataIndex = NoMetadataIdx } -let PickleToResource inMem file (g: TcGlobals) scope rName p x = +let PickleToResource inMem file (g: TcGlobals) compress scope rName p x = let file = PathMap.apply g.pathMap file - let bytes = pickleObjWithDanglingCcus inMem file g scope p x + let bytes = + use bytes = pickleObjWithDanglingCcus inMem file g scope p x - let byteStorage = - if inMem then - ByteStorage.FromMemoryAndCopy(bytes.AsMemory(), useBackingMemoryMappedFile = true) + if compress then + let raw = new MemoryStream(bytes.AsMemory().ToArray()) + let compressed = new MemoryStream() + use deflator = new DeflateStream(compressed, CompressionLevel.Optimal) + raw.CopyTo deflator + deflator.Close() + compressed.ToArray() else - ByteStorage.FromByteArray(bytes.AsMemory().ToArray()) + bytes.AsMemory().ToArray() - (bytes :> IDisposable).Dispose() + let byteStorage = ByteStorage.FromByteArray(bytes) { Name = rName @@ -113,15 +145,17 @@ let GetSignatureData (file, ilScopeRef, ilModule, byteReader) : PickledDataWithR unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo (byteReader ()) let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: CcuThunk, fileName, inMem) : ILResource = - let mspec = ccu.Contents - let mspec = ApplyExportRemappingToEntity tcGlobals exportRemapping mspec + let mspec = ApplyExportRemappingToEntity tcGlobals exportRemapping ccu.Contents + // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. - let rName = - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpSignatureDataResourceName2 + let rName, compress = + if tcConfig.compressMetadata then + FSharpSignatureCompressedDataResourceName, true + elif ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpSignatureDataResourceName2, false else - FSharpSignatureDataResourceName + FSharpSignatureDataResourceName, false let includeDir = if String.IsNullOrEmpty tcConfig.implicitIncludeDir then @@ -135,6 +169,7 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu inMem fileName tcGlobals + compress ccu (rName + ccu.AssemblyName) pickleCcuInfo @@ -147,34 +182,23 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu let GetOptimizationData (file, ilScopeRef, ilModule, byteReader) = unpickleObjWithDanglingCcus file ilScopeRef ilModule Optimizer.u_CcuOptimizationInfo (byteReader ()) -let WriteOptimizationData (tcGlobals, fileName, inMem, ccu: CcuThunk, modulInfo) = +let WriteOptimizationData (tcConfig: TcConfig, tcGlobals, fileName, inMem, ccu: CcuThunk, modulInfo) = // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. - let rName = - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpOptimizationDataResourceName2 + let rName, compress = + if tcConfig.compressMetadata then + FSharpOptimizationCompressedDataResourceName, true + elif ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpOptimizationDataResourceName2, false else - FSharpOptimizationDataResourceName + FSharpOptimizationDataResourceName, false - PickleToResource inMem fileName tcGlobals ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo + PickleToResource inMem fileName tcGlobals compress ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo let EncodeSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, isIncrementalBuild) = if tcConfig.GenerateSignatureData then let resource = WriteSignatureData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, isIncrementalBuild) - // The resource gets written to a file for FSharp.Core - let useDataFiles = - (tcConfig.useOptimizationDataFile || tcGlobals.compilingFSharpCore) - && not isIncrementalBuild - - if useDataFiles then - let sigDataFileName = (FileSystemUtils.chopExtension outfile) + ".sigdata" - let bytes = resource.GetBytes() - - use fileStream = - FileSystem.OpenFileForWriteShim(sigDataFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None) - - bytes.CopyTo fileStream let resources = [ resource ] @@ -188,23 +212,6 @@ let EncodeSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, generat let EncodeOptimizationData (tcGlobals, tcConfig: TcConfig, outfile, exportRemapping, data, isIncrementalBuild) = if tcConfig.GenerateOptimizationData then let data = map2Of2 (Optimizer.RemapOptimizationInfo tcGlobals exportRemapping) data - // As with the sigdata file, the optdata gets written to a file for FSharp.Core - let useDataFiles = - (tcConfig.useOptimizationDataFile || tcGlobals.compilingFSharpCore) - && not isIncrementalBuild - - if useDataFiles then - let ccu, modulInfo = data - - let bytes = - pickleObjWithDanglingCcus isIncrementalBuild outfile tcGlobals ccu Optimizer.p_CcuOptimizationInfo modulInfo - - let optDataFileName = (FileSystemUtils.chopExtension outfile) + ".optdata" - - use fileStream = - FileSystem.OpenFileForWriteShim(optDataFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None) - - fileStream.Write(bytes) let ccu, optData = if tcConfig.onlyEssentialOptimizationData then @@ -212,7 +219,9 @@ let EncodeOptimizationData (tcGlobals, tcConfig: TcConfig, outfile, exportRemapp else data - [ WriteOptimizationData(tcGlobals, outfile, isIncrementalBuild, ccu, optData) ] + [ + WriteOptimizationData(tcConfig, tcGlobals, outfile, isIncrementalBuild, ccu, optData) + ] else [] @@ -846,10 +855,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe let sigDataReaders = [ - for iresource in resources do - if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - (ccuName, (fun () -> iresource.GetBytes())) + for r in resources do + if IsSignatureDataResource r then + GetResourceNameAndSignatureDataFunc r ] let sigDataReaders = @@ -877,7 +885,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe ilModule.Resources.AsList() |> List.choose (fun r -> if IsOptimizationDataResource r then - Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) + Some(GetResourceNameAndOptimizationDataFunc r) else None) @@ -938,17 +946,16 @@ type RawFSharpAssemblyData(ilModule: ILModuleDef, ilAssemblyRefs) = let resources = ilModule.Resources.AsList() [ - for iresource in resources do - if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - (ccuName, (fun () -> iresource.GetBytes())) + for r in resources do + if IsSignatureDataResource r then + GetResourceNameAndSignatureDataFunc r ] member _.GetRawFSharpOptimizationData(_, _, _) = ilModule.Resources.AsList() |> List.choose (fun r -> if IsOptimizationDataResource r then - Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) + Some(GetResourceNameAndOptimizationDataFunc r) else None) diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index 9a3e9b517ef..d6be5bbd60b 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -17,6 +17,7 @@ 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 @@ -42,7 +43,7 @@ val IsOptimizationDataResource: ILResource -> bool /// Determine if an IL resource attached to an F# assembly is an F# quotation data resource for reflected definitions val IsReflectedDefinitionsResource: ILResource -> bool -val GetSignatureDataResourceName: ILResource -> string +val GetResourceNameAndSignatureDataFunc: ILResource -> string * (unit -> ReadOnlyByteMemory) /// Encode the F# interface data into a set of IL attributes and resources val EncodeSignatureData: diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 7d428fe914c..ba12b72afb3 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -923,6 +923,14 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = Some(FSComp.SR.optsPlatform ()) ) + CompilerOption( + "compressmetadata", + tagNone, + OptionSwitch(fun switch -> tcConfigB.compressMetadata <- switch = OptionSwitch.On), + None, + Some(FSComp.SR.optsCompressMetadata ()) + ) + CompilerOption( "nooptimizationdata", tagNone, diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index c749444f32c..4e6eec610f9 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -847,6 +847,7 @@ optsPublicSign,"Public-sign the assembly using only the public portion of the st optsWriteXml,"Write the xmldoc of the assembly to the given file" optsStrongKeyFile,"Specify a strong name key file" optsStrongKeyContainer,"Specify a strong name key container" +optsCompressMetadata,"Compress interface and optimization data files" optsPlatform,"Limit which platforms this code can run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu." optsNoOpt,"Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility." optsNoInterface,"Don't add a resource to the generated assembly containing F#-specific metadata" @@ -928,6 +929,10 @@ optsTargetProfile,"Specify target framework profile of this assembly. Valid valu optsEmitDebugInfoInQuotations,"Emit debug information in quotations" optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)" optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries" +optsSignatureData,"Include F# interface information, the default is file. Essential for distributing libraries." +1046,optsUnknownSignatureData,"Invalid value '%s' for --interfacedata, valid value are: none, file, compress."" +optsOptimizationData,"Specify included optimization information, the default is file. Important for distributed libraries." +1047,optsUnknownOptimizationData,"Invalid value '%s' for --optimizationdata, valid value are: none, file, compress." 1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater." 1052,optsInvalidTargetProfile,"Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'." typeInfoFullName,"Full name" diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 2efe648a3be..e64ff47680d 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -27,6 +27,11 @@ false + + + true + + $(IntermediateOutputPath)$(TargetFramework)\ $(IntermediateOutputPath)$(TargetFramework)\ diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 96e0c8ef1cc..45e50d441bf 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -7,6 +7,7 @@ open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics open System.IO +open System.IO.Compression open System.Threading open Internal.Utilities.Library open Internal.Utilities.Collections @@ -29,6 +30,7 @@ open FSharp.Compiler.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.NameResolution open FSharp.Compiler.ParseAndCheckInputs +open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.ScriptClosure open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals @@ -701,8 +703,8 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, generate let sigData = let _sigDataAttributes, sigDataResources = EncodeSignatureData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, true) [ for r in sigDataResources do - let ccuName = GetSignatureDataResourceName r - yield (ccuName, (fun () -> r.GetBytes())) ] + GetResourceNameAndSignatureDataFunc r + ] let autoOpenAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_AutoOpenAttribute) diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index b4ba20670f8..4ab6f181358 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -1097,15 +1097,22 @@ let GetLongNameFromString x = SplitNamesForILPath x // Resource format for pickled data //-------------------------------------------------------------------------- +// Uncompressed OptimizationData/SignatureData name for embedded resource let FSharpOptimizationDataResourceName = "FSharpOptimizationData." - let FSharpSignatureDataResourceName = "FSharpSignatureData." +// Compressed OptimizationData/SignatureData name for embedded resource +let FSharpOptimizationCompressedDataResourceName = + "FSharpOptimizationCompressedData." + +let FSharpSignatureCompressedDataResourceName = "FSharpSignatureCompressedData." + // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. The prefix of these names must not be 'FSharpOptimizationData' // or 'FSharpSignatureData' -let FSharpOptimizationDataResourceName2 = "FSharpOptimizationInfo." +// Uncompressed OptimizationData/SignatureData name for FSharp.Core embedded resources +let FSharpOptimizationDataResourceName2 = "FSharpOptimizationInfo." let FSharpSignatureDataResourceName2 = "FSharpSignatureInfo." [] diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index 01f2918712f..61bf5a19ddb 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -271,6 +271,10 @@ val internal FSharpOptimizationDataResourceName: string val internal FSharpSignatureDataResourceName: string +val internal FSharpOptimizationCompressedDataResourceName: string + +val internal FSharpSignatureCompressedDataResourceName: string + val internal FSharpOptimizationDataResourceName2: string val internal FSharpSignatureDataResourceName2: string diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8c2f6fe5f54..ff2bd508550 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -472,6 +472,11 @@ Vymazat mezipaměť výsledků správce balíčků + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Neplatné použití generování referenčního sestavení, nepoužívejte --staticlink ani --refonly a --refout společně. @@ -487,6 +492,11 @@ Zobrazte si povolené hodnoty verze jazyka a pak zadejte požadovanou verzi, například latest nebo preview. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Podporované jazykové verze: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Nerozpoznaná hodnota {0} pro parametr --langversion; seznam možností zobrazíte zadáním --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 68e2a3f1eb7..3067a772651 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -472,6 +472,11 @@ Löschen Sie den Ergebniscache des Paketmanagers + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht "--staticlink" oder "--refonly" und "--refout" zusammen. @@ -487,6 +492,11 @@ Zeigen Sie die zulässigen Werte für die Sprachversion an. Geben Sie die Sprachversion als "latest" oder "preview" an. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Unterstützte Sprachversionen: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Unbekannter Wert "{0}" für "--langversion". Verwenden Sie "--langversion:?", um die vollständige Liste anzuzeigen. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index bea08c9779f..c2456360c25 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -472,6 +472,11 @@ Borrar la caché de resultados del administrador de paquetes + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso no válido de emitir un ensamblado de referencia, no use "--staticlink', or '--refonly' and '--refout" de forma conjunta. @@ -487,6 +492,11 @@ Mostrar los valores permitidos para la versión de idioma, especificar la versión de idioma como "latest" "preview" + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versiones de lenguaje admitidas: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valor no reconocido "{0}" para --langversion, use --langversion:? para una lista completa diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 227a9b0bd32..a238ba0136f 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -472,6 +472,11 @@ Effacer le cache des résultats du Gestionnaire de package + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilisation non valide de l’émission d’un assembly de référence. N’utilisez pas '--staticlink' ni '--refonly' et '--refout' ensemble. @@ -487,6 +492,11 @@ Afficher les valeurs autorisées pour la version du langage, spécifier la version du langage comme 'dernière' ou 'préversion' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versions linguistiques prises en charge : + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valeur non reconnue '{0}' pour --langversion use --langversion:? pour la liste complète diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 4ebe76e823c..a7cc725c625 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -472,6 +472,11 @@ Cancellare la cache dei risultati di Gestione pacchetti + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--staticlink' o '--refonly' e '--refout'. @@ -487,6 +492,11 @@ Visualizza i valori consentiti per la versione del linguaggio. Specificare la versione del linguaggio, ad esempio 'latest' o 'preview' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versioni del linguaggio supportate: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valore '{0}' non riconosciuto per --langversion. Per l'elenco completo usare --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 3d330529d59..5b49c4bd125 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -472,6 +472,11 @@ パッケージ マネージャーの結果キャッシュをクリアする + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 参照アセンブリの生成の使用が無効です。'--staticlink'、または '--refonly' と '--refout' を同時に使用しないでください。 @@ -487,6 +492,11 @@ 言語バージョンで許可された値を表示し、'最新' や 'プレビュー' などの言語バージョンを指定する + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: サポートされる言語バージョン: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion の値 '{0}' が認識されません。完全なリストについては、--langversion:? を使用してください diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index fb1cc618ecb..e3d5a493923 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -472,6 +472,11 @@ 패키지 관리자 결과 캐시 지우기 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 참조 어셈블리 내보내기를 잘못 사용했습니다. '--staticlink' 또는 '--refonly' 및 '--refout'을 함께 사용하지 마세요. @@ -487,6 +492,11 @@ 언어 버전의 허용된 값을 표시하고 '최신' 또는 '미리 보기'와 같은 언어 버전을 지정합니다. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 지원되는 언어 버전: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list 전체 목록에 대한 --langversion use --langversion:?의 인식할 수 없는 값 '{0}'입니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index d8e30e88c62..3b02a48f812 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -472,6 +472,11 @@ Wyczyść pamięć podręczną wyników menedżera pakietów + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Nieprawidłowe użycie emitowania zestawu odwołania, nie używaj razem elementów „--staticlink” ani „--refonly” i „--refout”. @@ -487,6 +492,11 @@ Wyświetl dozwolone wartości dla wersji językowej; określ wersję językową, np. „latest” lub „preview” + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Obsługiwane wersje językowe: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Nierozpoznana wartość „{0}” dla parametru –langversion; podaj parametr –langversion:?, aby uzyskać pełną listę diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index aeeba1d4271..ddc53052a3e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -472,6 +472,11 @@ Limpar o cache de resultados do gerenciador de pacotes + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso inválido de emitir um assembly de referência, não use '--staticlink' ou '--reutilly' e '--refout' juntos. @@ -487,6 +492,11 @@ Exibe os valores permitidos para a versão do idioma, especifica a versão do idioma, como 'mais recente ' ou 'prévia' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versões de linguagens com suporte: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valor não reconhecido '{0}' para --langversion use --langversion:? para a lista completa diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 5959290379e..a87376fa075 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -472,6 +472,11 @@ Очистка кэша результатов диспетчера пакетов + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Недопустимое использование при создании базовой сборки. Не используйте "--staticlink" или "--refonly" и "--refout" вместе. @@ -487,6 +492,11 @@ Отображение допустимых значений для версии языка. Укажите версию языка, например, "latest" или "preview". + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Поддерживаемые языковые версии: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Не удалось распознать значение "{0}" для параметра --langversion. Для получения полного списка допустимых значений выполните команду use --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 37583dc87c5..88856174155 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -472,6 +472,11 @@ Paket yöneticisi sonuçları önbelleğini temizle + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Başvuru bütünleştirilmiş kodunun oluşturulması için geçersiz kullanım: '--staticlink' veya '--refonly' ile '--refout' birlikte kullanılmaz. @@ -487,6 +492,11 @@ Dil sürümü için izin verilen değerleri görüntüleyin, dil sürümünü 'en son' veya 'önizleme' örneklerindeki gibi belirtin + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Desteklenen dil sürümleri: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion için '{0}' değeri tanınmıyor. Tam liste için --langversion:? kullanın diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index a627b09742f..d45f95ac8bc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -472,6 +472,11 @@ 清除包管理器结果缓存 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 发出引用程序集的使用无效,请勿同时使用“--staticlink”或“--refonly”和“--refout”。 @@ -487,6 +492,11 @@ 显示语言版本的允许值,指定语言版本,如“最新”或“预览” + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 支持的语言版本: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion 的值“{0}”无法识别,使用 --langversion:? 获取完整列表。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index dd69d33f792..981d2f170aa 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -472,6 +472,11 @@ 清除封裝管理員結果快取 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 發出參考組件的使用無效,請勿同時使用 '--staticlink' 或 '--refonly' 和 '--refout'。 @@ -487,6 +492,11 @@ 顯示語言版本允許的值,指定 'latest' 或 'preview' 等語言版本 + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +517,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 支援的語言版本: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list 對 --langversion 為無法識別的值 '{0}',對完整清單使用 --langversion:? diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 9bfe2497b45..1d2670fbc84 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -18,6 +18,11 @@ Debug;Release;Proto + + + true + + diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 909354e83e7..af7e16d13cc 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -27,6 +27,7 @@ type public Fsc() as this = let mutable codePage: string MaybeNull = null let mutable commandLineArgs: ITaskItem list = [] let mutable compilerTools: ITaskItem[] = [||] + let mutable compressMetadata = false let mutable debugSymbols = false let mutable debugType: string MaybeNull = null let mutable defineConstants: ITaskItem[] = [||] @@ -42,6 +43,8 @@ type public Fsc() as this = let mutable keyFile: string MaybeNull = null let mutable langVersion: string MaybeNull = null let mutable noFramework = false + let mutable noInterfaceData = false + let mutable noOptimizationData = false let mutable optimize: bool = true let mutable otherFlags: string MaybeNull = null let mutable outputAssembly: string MaybeNull = null @@ -151,9 +154,21 @@ type public Fsc() as this = if noFramework then builder.AppendSwitch("--noframework") + // NoInterfaceData + if noInterfaceData then + builder.AppendSwitch("--nointerfacedata") + + // NoOptimizationData + if noOptimizationData then + builder.AppendSwitch("--nooptimizationdata") + // BaseAddress builder.AppendSwitchIfNotNull("--baseaddress:", baseAddress) + // CompressMetadata + if compressMetadata then + builder.AppendSwitch("--compressmetadata") + // DefineConstants for item in defineConstants do builder.AppendSwitchIfNotNull("--define:", item.ItemSpec) @@ -358,6 +373,11 @@ type public Fsc() as this = with get () = compilerTools and set (a) = compilerTools <- a + // CompressMetadata + member _.CompressMetadata + with get () = compressMetadata + and set (v) = compressMetadata <- v + // -g: Produce debug file. Disables optimizations if a -O flag is not given. member _.DebugSymbols with get () = debugSymbols @@ -438,6 +458,16 @@ type public Fsc() as this = with get () = noFramework and set (b) = noFramework <- b + // --nointerfacedata + member _.NoInterfaceData + with get () = noInterfaceData + and set (b) = noInterfaceData <- b + + // --nooptimizationdata + member _.NoOptimizationData + with get () = noOptimizationData + and set (b) = noOptimizationData <- b + // --optimize member _.Optimize with get () = optimize diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 26d9a170882..31bde3076ff 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -327,6 +327,7 @@ this file. ChecksumAlgorithm="$(PdbChecksumAlgorithm)" CodePage="$(CodePage)" CompilerTools="@(FscCompilerTools)" + CompressMetadata="$(CompressMetadata)" DebugSymbols="$(DebugSymbols)" DebugType="$(DebugType)" DefineConstants="$(DefineConstants)" @@ -343,6 +344,8 @@ this file. LangVersion="$(LangVersion)" LCID="$(LCID)" NoFramework="true" + NoInterfaceData="$(NoInterfaceData)" + NoOptimizationData="$(NoOptimizationData)" Optimize="$(Optimize)" ReflectionFree="$(ReflectionFree)" OtherFlags="$(FscOtherFlags)" diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index e8561e03080..12952536046 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -9,6 +9,11 @@ true + + + true + + diff --git a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index b2c7d204445..d63c3ce02f9 100644 --- a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -8,6 +8,11 @@ true + + + true + + diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 2059fcc6096..2c78bf6cfee 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -39,6 +39,11 @@ Debug;Release;Proto + + + true + + true diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index 8bf96070658..2425866f41b 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -12,6 +12,11 @@ true + + + true + + $(BaseOutputPath)\$(Configuration)\$(TargetFramework) diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets index 9e4e4e48067..ee9688f53fa 100644 --- a/src/fsc/fsc.targets +++ b/src/fsc/fsc.targets @@ -20,6 +20,12 @@ false + + + true + true + + diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index 6b6e89dc6f4..b66ca4b2241 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -24,6 +24,11 @@ $(DefineConstants);FSI_SHADOW_COPY_REFERENCES;FSI_SERVER + + + true + + diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index f9c57fa0386..4f88cb393bb 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -53,6 +53,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 34c5cb5beaf..ffaf1a5f925 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -44,6 +44,7 @@ module Commands = let executeProcess pathToExe arguments workingDir (timeout:int) = match pathToExe with | Some path -> + let commandLine = ResizeArray() let errorsList = ResizeArray() let outputList = ResizeArray() let mutable errorslock = obj @@ -56,6 +57,9 @@ module Commands = if not (isNull message) then lock errorslock (fun () -> errorsList.Add(message)) + commandLine.Add $"cd {workingDir}" + commandLine.Add $"{path} {arguments} /bl" + let psi = ProcessStartInfo() psi.FileName <- path psi.WorkingDirectory <- workingDir @@ -94,6 +98,7 @@ module Commands = workingDir lock gate (fun () -> + File.WriteAllLines(Path.Combine(workingDir', "commandline.txt"), commandLine) File.WriteAllLines(Path.Combine(workingDir', "StandardOutput.txt"), outputList) File.WriteAllLines(Path.Combine(workingDir', "StandardError.txt"), errorsList) ) @@ -225,6 +230,7 @@ type TestConfig = FSIANYCPU : string FSCANYCPU : string #endif + DOTNETFSCCOMPILERPATH : string FSI_FOR_SCRIPTS : string FSharpBuild : string FSharpCompilerInteractiveSettings : string @@ -293,14 +299,15 @@ let config configurationName envVars = let fsharpCoreArchitecture = "netstandard2.0" let fsharpBuildArchitecture = "netstandard2.0" let fsharpCompilerInteractiveSettingsArchitecture = "netstandard2.0" + let dotnetArchitecture = "net7.0" #if NET472 let fscArchitecture = "net472" let fsiArchitecture = "net472" let peverifyArchitecture = "net472" #else - let fscArchitecture = "net7.0" - let fsiArchitecture = "net7.0" - let peverifyArchitecture = "net7.0" + let fscArchitecture = dotnetArchitecture + let fsiArchitecture = dotnetArchitecture + let peverifyArchitecture = dotnetArchitecture #endif let repoRoot = SCRIPT_ROOT ++ ".." ++ ".." let artifactsPath = repoRoot ++ "artifacts" @@ -350,7 +357,7 @@ let config configurationName envVars = let FSC = requireArtifact ("fsc" ++ configurationName ++ fscArchitecture ++ "fsc.dll") #endif let FSCOREDLLPATH = requireArtifact ("FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") - + let DOTNETFSCCOMPILERPATH = requireArtifact ("fsc" ++ configurationName ++ dotnetArchitecture ++ "fsc.dll") let defaultPlatform = match Is64BitOperatingSystem with // | PlatformID.MacOSX, true -> "osx.10.10-x64" @@ -372,6 +379,7 @@ let config configurationName envVars = FSCANYCPU = FSCANYCPU FSIANYCPU = FSIANYCPU #endif + DOTNETFSCCOMPILERPATH = DOTNETFSCCOMPILERPATH FSI_FOR_SCRIPTS = FSI_FOR_SCRIPTS FSharpBuild = FSharpBuild FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index f74faf49fa9..96b8e352e5a 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -120,6 +120,7 @@ module Utilities = $TARGETFRAMEWORK true true + $DOTNETFSCCOMPILERPATH @@ -170,6 +171,7 @@ let main argv = 0""" let pathToTemp = Path.Combine(pathToArtifacts, "Temp") let projectDirectory = Path.Combine(pathToTemp,Guid.NewGuid().ToString() + ".tmp") let pathToFSharpCore = typeof.Assembly.Location + let dotNetFscCompilerPath = config.DOTNETFSCCOMPILERPATH try try Directory.CreateDirectory(projectDirectory) |> ignore @@ -179,9 +181,9 @@ let main argv = 0""" let directoryBuildTargetsFileName = Path.Combine(projectDirectory, "Directory.Build.targets") let frameworkReferencesFileName = Path.Combine(projectDirectory, "FrameworkReferences.txt") #if NETCOREAPP - File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net7.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) + File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net7.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore).Replace("$DOTNETFSCCOMPILERPATH", dotNetFscCompilerPath)) #else - File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) + File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore).Replace("$DOTNETFSCCOMPILERPATH", dotNetFscCompilerPath)) #endif File.WriteAllText(programFsFileName, programFs) File.WriteAllText(directoryBuildPropsFileName, directoryBuildProps) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs index 7b2bcd451e1..104eb8e2166 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs @@ -8,8 +8,9 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString -//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit -//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=compressmetadata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=sig kind=OptionString //section='- INPUT FILES - ' ! option=reference kind=OptionString //section='- RESOURCES - ' ! option=win32res kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index 2f22ee0d2a0..45ec1d3da2a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -109,6 +109,7 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString +//section='- OUTPUT FILES - ' ! option=compressmetadata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=sig kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 885f49a5c64..779ea3c45a3 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -24,6 +24,8 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. +--compressmetadata[+|-] Compress interface and optimization + data files --nooptimizationdata Only include optimization information essential for implementing inlined constructs. From 8385830e1f36e5005f952bd1267b969922d0b20f Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 24 Aug 2022 21:06:08 +0200 Subject: [PATCH 138/226] Added tests for fsc help and version options (#13765) --- src/Compiler/Driver/CompilerOptions.fs | 86 ++++++--- src/Compiler/Driver/CompilerOptions.fsi | 8 +- src/Compiler/Driver/fsc.fs | 2 +- src/Compiler/Interactive/fsi.fs | 4 +- .../ConsoleOnlyOptionsTests.fs | 31 ++++ .../FSharp.Compiler.Service.Tests.fsproj | 5 + .../TestDoubles.fs | 23 +++ .../VisualStudioVersusConsoleContextTests.fs | 18 +- .../expected-help-output.txt | 171 ++++++++++++++++++ 9 files changed, 299 insertions(+), 49 deletions(-) create mode 100644 tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs create mode 100644 tests/FSharp.Compiler.Service.Tests/TestDoubles.fs create mode 100644 tests/FSharp.Compiler.Service.Tests/expected-help-output.txt diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index ba12b72afb3..5a62c787ff4 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -23,6 +23,7 @@ open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.DiagnosticsLogger open Internal.Utilities +open System.Text module Attributes = open System.Runtime.CompilerServices @@ -112,7 +113,11 @@ let compilerOptionUsage (CompilerOption (s, tag, spec, _, _)) = else sprintf "%s:%s" s tag (* still being decided *) -let PrintCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) = +let nl = Environment.NewLine + +let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) = + let sb = StringBuilder() + let flagWidth = 42 // fixed width for printing of flags, e.g. --debug:{full|pdbonly|portable|embedded} let defaultLineWidth = 80 // the fallback width @@ -131,18 +136,18 @@ let PrintCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOp // flagWidth chars - for flags description or padding on continuation lines. // single space - space. // description - words upto but excluding the final character of the line. - printf "%-40s" (compilerOptionUsage compilerOption) + let _ = sb.Append $"{compilerOptionUsage compilerOption, -40}" let printWord column (word: string) = // Have printed upto column. // Now print the next word including any preceding whitespace. // Returns the column printed to (suited to folding). if column + 1 (*space*) + word.Length >= lineWidth then // NOTE: "equality" ensures final character of the line is never printed - printfn "" (* newline *) - printf "%-40s %s" "" (*<--flags*) word + let _ = sb.Append $"{nl}" + let _ = sb.Append $"{String.Empty, -40} {word}" flagWidth + 1 + word.Length else - printf " %s" word + let _ = sb.Append $" {word}" column + 1 + word.Length let words = @@ -151,16 +156,19 @@ let PrintCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOp | Some s -> s.Split [| ' ' |] let _finalColumn = Array.fold printWord flagWidth words - printfn "" (* newline *) + let _ = sb.Append $"{nl}" + sb.ToString() -let PrintPublicOptions (heading, opts) = +let getPublicOptions (heading, opts) = if not (isNil opts) then - printfn "" - printfn "" - printfn "\t\t%s" heading - List.iter PrintCompilerOption opts + $"{nl}{nl}\t\t{heading}{nl}" + + (opts |> List.map getCompilerOption |> String.concat "") + else + "" + +let GetCompilerOptionBlocks blocks = + let sb = new StringBuilder() -let PrintCompilerOptionBlocks blocks = let publicBlocks = blocks |> List.choose (function @@ -174,10 +182,11 @@ let PrintCompilerOptionBlocks blocks = let headingOptions = publicBlocks |> List.filter (fun (h2, _) -> heading = h2) |> List.collect snd - PrintPublicOptions(heading, headingOptions) + let _ = sb.Append(getPublicOptions (heading, headingOptions)) Set.add heading doneHeadings List.fold consider Set.empty publicBlocks |> ignore> + sb.ToString() (* For QA *) let dumpCompilerOption prefix (CompilerOption (str, _, spec, _, _)) = @@ -1981,31 +1990,46 @@ let deprecatedFlagsFsc tcConfigB = // OptionBlock: Miscellaneous options //----------------------------------- -let DisplayBannerText tcConfigB = +let GetBannerText tcConfigB = if tcConfigB.showBanner then - (printfn "%s" tcConfigB.productNameForBannerText - printfn "%s" (FSComp.SR.optsCopyright ())) + $"{tcConfigB.productNameForBannerText}{nl}" + + $"{FSComp.SR.optsCopyright ()}{nl}" + else + "" /// FSC only help. (FSI has it's own help function). -let displayHelpFsc tcConfigB (blocks: CompilerOptionBlock list) = - DisplayBannerText tcConfigB - PrintCompilerOptionBlocks blocks - exit 0 +let GetHelpFsc tcConfigB (blocks: CompilerOptionBlock list) = + GetBannerText tcConfigB + GetCompilerOptionBlocks blocks -let displayVersion tcConfigB = - printfn "%s" tcConfigB.productNameForBannerText - exit 0 +let GetVersion tcConfigB = + $"{tcConfigB.productNameForBannerText}{nl}" let miscFlagsBoth tcConfigB = [ CompilerOption("nologo", tagNone, OptionUnit(fun () -> tcConfigB.showBanner <- false), None, Some(FSComp.SR.optsNologo ())) - CompilerOption("version", tagNone, OptionConsoleOnly(fun _ -> displayVersion tcConfigB), None, Some(FSComp.SR.optsVersion ())) + CompilerOption( + "version", + tagNone, + OptionConsoleOnly(fun _ -> + Console.Write(GetVersion tcConfigB) + exit 0), + None, + Some(FSComp.SR.optsVersion ()) + ) ] let miscFlagsFsc tcConfigB = miscFlagsBoth tcConfigB @ [ - CompilerOption("help", tagNone, OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsHelp ())) + CompilerOption( + "help", + tagNone, + OptionConsoleOnly(fun blocks -> + Console.Write(GetHelpFsc tcConfigB blocks) + exit 0), + None, + Some(FSComp.SR.optsHelp ()) + ) CompilerOption("@", tagNone, OptionUnit ignore, None, Some(FSComp.SR.optsResponseFile ())) ] @@ -2061,7 +2085,9 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "?", tagNone, - OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> + Console.Write(GetHelpFsc tcConfigB blocks) + exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2069,7 +2095,9 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "help", tagNone, - OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> + Console.Write(GetHelpFsc tcConfigB blocks) + exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2077,7 +2105,9 @@ let abbreviatedFlagsFsc tcConfigB = CompilerOption( "full-help", tagNone, - OptionConsoleOnly(fun blocks -> displayHelpFsc tcConfigB blocks), + OptionConsoleOnly(fun blocks -> + Console.Write(GetHelpFsc tcConfigB blocks) + exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index 983a38f5182..048bffb51e9 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -43,7 +43,7 @@ and CompilerOptionBlock = | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list -val PrintCompilerOptionBlocks: CompilerOptionBlock list -> unit // for printing usage +val GetCompilerOptionBlocks: CompilerOptionBlock list -> string val DumpCompilerOptionBlocks: CompilerOptionBlock list -> unit // for QA @@ -52,7 +52,11 @@ val FilterCompilerOptionBlock: (CompilerOption -> bool) -> CompilerOptionBlock - /// Parse and process a set of compiler options val ParseCompilerOptions: (string -> unit) * CompilerOptionBlock list * string list -> unit -val DisplayBannerText: TcConfigBuilder -> unit +val GetBannerText: tcConfigB: TcConfigBuilder -> string + +val GetHelpFsc: tcConfigB: TcConfigBuilder -> blocks: CompilerOptionBlock list -> string + +val GetVersion: tcConfigB: TcConfigBuilder -> string val GetCoreFscCompilerOptions: TcConfigBuilder -> CompilerOptionBlock list diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 654c0a8bda2..28174489a61 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -544,7 +544,7 @@ let main1 // Display the banner text, if necessary if not bannerAlreadyPrinted then - DisplayBannerText tcConfigB + Console.Write(GetBannerText tcConfigB) // Create tcGlobals and frameworkTcImports let outfile, pdbfile, assemblyName = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index d2632c3fe69..00794953c27 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -882,10 +882,10 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, // In the "--help", these options can be printed either before (fsiUsagePrefix) or after (fsiUsageSuffix) the core options. let displayHelpFsi tcConfigB (blocks:CompilerOptionBlock list) = - DisplayBannerText tcConfigB; + Console.Write (GetBannerText tcConfigB) fprintfn fsiConsoleOutput.Out "" fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiUsage(executableFileNameWithoutExtension.Value)) - PrintCompilerOptionBlocks blocks + Console.Write (GetCompilerOptionBlocks blocks) exit 0 // option tags diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs new file mode 100644 index 00000000000..7cab17439c4 --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module FSharp.Compiler.Service.Tests.ConsoleOnlyOptionsTests + +open System +open System.IO +open FSharp.Compiler.CompilerOptions +open NUnit.Framework +open TestDoubles + +[] +let ``Help is displayed correctly`` () = + let builder = getArbitraryTcConfigBuilder() + let blocks = GetCoreFscCompilerOptions builder + let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.txt" + + let help = GetHelpFsc builder blocks + + // contains instead of equals + // as we don't control the 1st line of the output (the version) + // it's tested separately + StringAssert.Contains(expectedHelp, help.Replace("\r\n", Environment.NewLine)) + +[] +let ``Version is displayed correctly`` () = + let builder = getArbitraryTcConfigBuilder() + let expectedVersionPattern = @"Microsoft \(R\) F# Compiler version \d+\.\d+\.\d+\.\d+ for F# \d+\.\d+" + + let version = GetVersion builder + + Assert.That(version, Does.Match expectedVersionPattern) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 606deeeef94..81f470dcbcd 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -20,6 +20,9 @@ + + Never + @@ -38,6 +41,8 @@ Symbols.fs + + SyntaxTree\TypeTests.fs diff --git a/tests/FSharp.Compiler.Service.Tests/TestDoubles.fs b/tests/FSharp.Compiler.Service.Tests/TestDoubles.fs new file mode 100644 index 00000000000..7af70f94c83 --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/TestDoubles.fs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module FSharp.Compiler.Service.Tests.TestDoubles + +open System.IO +open FSharp.Compiler.Text +open FSharp.Compiler.AbstractIL.ILBinaryReader +open FSharp.Compiler.CompilerConfig +open Internal.Utilities + +// just a random thing to make things work +let internal getArbitraryTcConfigBuilder() = + TcConfigBuilder.CreateNew( + null, + FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value, + ReduceMemoryFlag.Yes, + Directory.GetCurrentDirectory(), + false, + false, + CopyFSharpCoreFlag.No, + (fun _ -> None), + None, + Range.Zero) diff --git a/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs b/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs index 9d37644e892..24dea808feb 100644 --- a/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/VisualStudioVersusConsoleContextTests.fs @@ -2,13 +2,9 @@ module FSharp.Compiler.Service.Tests.VisualStudioVersusConsoleContextTests -open FSharp.Compiler.Text open NUnit.Framework -open System.IO -open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerOptions -open Internal.Utilities -open FSharp.Compiler.AbstractIL.ILBinaryReader +open TestDoubles // copypasted from the CompilerOptions code, // not worth changing that code's accessibility just for this test @@ -23,17 +19,7 @@ let private getOptionsFromOptionBlocks blocks = [] // controls https://github.com/dotnet/fsharp/issues/13549 let ``Console-only options are filtered out for fsc in the VS context`` () = // just a random thing to make things work - let builder = TcConfigBuilder.CreateNew( - null, - FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value, - ReduceMemoryFlag.Yes, - Directory.GetCurrentDirectory(), - false, - false, - CopyFSharpCoreFlag.No, - (fun _ -> None), - None, - Range.Zero) + let builder = getArbitraryTcConfigBuilder() let blocks = GetCoreServiceCompilerOptions builder let options = getOptionsFromOptionBlocks blocks diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt b/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt new file mode 100644 index 00000000000..7d787f6ceb4 --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt @@ -0,0 +1,171 @@ +Copyright (c) Microsoft Corporation. All Rights Reserved. + + + - OUTPUT FILES - +--out: Name of the output file (Short form: + -o) +--target:exe Build a console executable +--target:winexe Build a Windows executable +--target:library Build a library (Short form: -a) +--target:module Build a module that can be added to + another assembly +--delaysign[+|-] Delay-sign the assembly using only + the public portion of the strong + name key +--publicsign[+|-] Public-sign the assembly using only + the public portion of the strong + name key, and mark the assembly as + signed +--doc: Write the xmldoc of the assembly to + the given file +--keyfile: Specify a strong name key file +--platform: Limit which platforms this code can + run on: x86, x64, Arm, Arm64, + Itanium, anycpu32bitpreferred, or + anycpu. The default is anycpu. +--nooptimizationdata Only include optimization + information essential for + implementing inlined constructs. + Inhibits cross-module inlining but + improves binary compatibility. +--nointerfacedata Don't add a resource to the + generated assembly containing + F#-specific metadata +--sig: Print the inferred interface of the + assembly to a file +--allsigs Print the inferred interfaces of all + compilation files to associated + signature files +--nocopyfsharpcore Don't copy FSharp.Core.dll along the + produced binaries +--refonly[+|-] Produce a reference assembly, + instead of a full assembly, as the + primary output +--refout: Produce a reference assembly with + the specified file path. + + + - INPUT FILES - +--reference: Reference an assembly (Short form: + -r) +--compilertool: Reference an assembly or directory + containing a design time tool (Short + form: -t) + + + - RESOURCES - +--win32icon: Specify a Win32 icon file (.ico) +--win32res: Specify a Win32 resource file (.res) +--win32manifest: Specify a Win32 manifest file +--nowin32manifest Do not include the default Win32 + manifest +--resource: Embed the specified managed resource +--linkresource: Link the specified resource to this + assembly where the resinfo format is + [,[,public|private]] + + + - CODE GENERATION - +--debug[+|-] Emit debug information (Short form: + -g) +--debug:{full|pdbonly|portable|embedded} Specify debugging type: full, + portable, embedded, pdbonly. ('full' + is the default if no debuggging type + specified and enables attaching a + debugger to a running program, + 'portable' is a cross-platform + format, 'embedded' is a + cross-platform format embedded into + the output file). +--embed[+|-] Embed all source files in the + portable PDB file +--embed: Embed specific source files in the + portable PDB file +--sourcelink: Source link information file to + embed in the portable PDB file +--optimize[+|-] Enable optimizations (Short form: + -O) +--tailcalls[+|-] Enable or disable tailcalls +--deterministic[+|-] Produce a deterministic assembly + (including module version GUID and + timestamp) +--pathmap: Maps physical paths to source path + names output by the compiler +--crossoptimize[+|-] Enable or disable cross-module + optimizations +--reflectionfree Disable implicit generation of + constructs using reflection + + + - ERRORS AND WARNINGS - +--warnaserror[+|-] Report all warnings as errors +--warnaserror[+|-]: Report specific warnings as errors +--warn: Set a warning level (0-5) +--nowarn: Disable specific warning messages +--warnon: Enable specific warnings that may be + off by default +--consolecolors[+|-] Output warning and error messages in + color + + + - LANGUAGE - +--langversion:{?|version|latest|preview} Display the allowed values for + language version, specify language + version such as 'latest' or + 'preview' +--checked[+|-] Generate overflow checks +--define: Define conditional compilation + symbols (Short form: -d) +--mlcompatibility Ignore ML compatibility warnings + + + - MISCELLANEOUS - +--nologo Suppress compiler copyright message +--version Display compiler version banner and + exit +--help Display this usage message (Short + form: -?) +--@ Read response file for more options + + + - ADVANCED - +--codepage: Specify the codepage used to read + source files +--utf8output Output messages in UTF-8 encoding +--preferreduilang: Specify the preferred output + language culture name (e.g. es-ES, + ja-JP) +--fullpaths Output messages with fully qualified + paths +--lib: Specify a directory for the include + path which is used to resolve source + files and assemblies (Short form: + -I) +--simpleresolution Resolve assembly references using + directory-based rules rather than + MSBuild resolution +--targetprofile: Specify target framework profile of + this assembly. Valid values are + mscorlib, netcore or netstandard. + Default - mscorlib +--baseaddress:
Base address for the library to be + built +--checksumalgorithm:{SHA1|SHA256} Specify algorithm for calculating + source file checksum stored in PDB. + Supported values are: SHA1 or SHA256 + (default) +--noframework Do not reference the default CLI + assemblies by default +--standalone Statically link the F# library and + all referenced DLLs that depend on + it into the assembly being generated +--staticlink: Statically link the given assembly + and all referenced DLLs that depend + on this assembly. Use an assembly + name e.g. mylib, not a DLL name. +--pdb: Name the output debug file +--highentropyva[+|-] Enable high-entropy ASLR +--subsystemversion: Specify subsystem version of this + assembly +--quotations-debug[+|-] Emit debug information in quotations From b7d2c75d7a945f10176fd01da7c6ce84259721ca Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 25 Aug 2022 15:15:19 +0200 Subject: [PATCH 139/226] Update ConsoleOnlyOptionsTests.fs --- tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 7cab17439c4..943b4910385 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -9,6 +9,7 @@ open NUnit.Framework open TestDoubles [] +[] let ``Help is displayed correctly`` () = let builder = getArbitraryTcConfigBuilder() let blocks = GetCoreFscCompilerOptions builder From 3d99a9aea8b7d6e9f368539b582570ab4afa194d Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Thu, 25 Aug 2022 06:23:49 -0700 Subject: [PATCH 140/226] Move to -Svc pool provider in release branches (#13779) --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 34dcb58e73c..6a35cc45c69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -210,7 +210,7 @@ stages: - name: _SignType value: Test pool: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 90 steps: @@ -283,7 +283,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: @@ -337,7 +337,7 @@ stages: # Mock official build - job: MockOfficial pool: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -428,7 +428,7 @@ stages: # End to end build - job: EndToEndBuildTests pool: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -453,7 +453,7 @@ stages: # Plain build Windows - job: Plain_Build_Windows pool: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) variables: - name: _BuildConfig From bdcb444f40fa2a08d2c76c78ad8c3c7e13ce14c2 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 25 Aug 2022 08:23:29 -0700 Subject: [PATCH 141/226] Fix test case (#13782) Co-authored-by: Vlad Zarytovskii --- .../ConsoleOnlyOptionsTests.fs | 15 ++++++++++----- .../FSharp.Compiler.Service.Tests.fsproj | 2 +- ...d-help-output.txt => expected-help-output.bsl} | 5 +++-- 3 files changed, 14 insertions(+), 8 deletions(-) rename tests/FSharp.Compiler.Service.Tests/{expected-help-output.txt => expected-help-output.bsl} (98%) diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 943b4910385..332c5cbdee7 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -11,16 +11,21 @@ open TestDoubles [] [] let ``Help is displayed correctly`` () = + try + if System.Console.BufferWidth < 80 then + System.Console.BufferWidth <- 80 + with _ -> () + let builder = getArbitraryTcConfigBuilder() + builder.showBanner <- false // We don't need the banner + let blocks = GetCoreFscCompilerOptions builder - let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.txt" + let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl" let help = GetHelpFsc builder blocks - // contains instead of equals - // as we don't control the 1st line of the output (the version) - // it's tested separately - StringAssert.Contains(expectedHelp, help.Replace("\r\n", Environment.NewLine)) + let actualHelp = help.Replace("\r\n", Environment.NewLine) + Assert.AreEqual(expectedHelp, actualHelp, $"Console width: {System.Console.BufferWidth}\nExpected: {expectedHelp}\n Actual: {actualHelp}") |> ignore [] let ``Version is displayed correctly`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 81f470dcbcd..30e2e9c933c 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -20,7 +20,7 @@ - + Never diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl similarity index 98% rename from tests/FSharp.Compiler.Service.Tests/expected-help-output.txt rename to tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 7d787f6ceb4..6be21d85f3c 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.txt +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -1,5 +1,4 @@ -Copyright (c) Microsoft Corporation. All Rights Reserved. - + - OUTPUT FILES - --out: Name of the output file (Short form: @@ -23,6 +22,8 @@ run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. +--compressmetadata[+|-] Compress interface and optimization + data files --nooptimizationdata Only include optimization information essential for implementing inlined constructs. From 236db9817ee215ce3c086928ace8c891d8c3564d Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 25 Aug 2022 15:28:10 -0700 Subject: [PATCH 142/226] Revert FCS compression (#13781) --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 +- src/FSharp.Build/FSharp.Build.fsproj | 4 +++- .../FSharp.Compiler.Interactive.Settings.fsproj | 2 +- .../FSharp.Compiler.Server.Shared.fsproj | 4 ++-- src/FSharp.Core/FSharp.Core.fsproj | 4 ++-- .../FSharp.DependencyManager.Nuget.fsproj | 3 ++- src/fsc/fsc.targets | 1 + src/fsi/fsi.targets | 4 +++- 8 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index e64ff47680d..b76cfa836a0 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -29,7 +29,7 @@ - true + false diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 1d2670fbc84..c79244ca045 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -20,7 +20,9 @@ - true + false + true + false diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 12952536046..f4b0c73ffd5 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -11,7 +11,7 @@ - true + false diff --git a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index d63c3ce02f9..2b6e504664f 100644 --- a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -8,9 +8,9 @@ true - + - true + false diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 2c78bf6cfee..95ab57a3796 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -40,8 +40,8 @@ - - true + + false diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index 2425866f41b..d114fe9ae33 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -14,7 +14,8 @@ - true + true + false diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets index ee9688f53fa..cd0d98ec64a 100644 --- a/src/fsc/fsc.targets +++ b/src/fsc/fsc.targets @@ -24,6 +24,7 @@ true true + false diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index b66ca4b2241..9280dcc36f4 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -26,7 +26,9 @@ - true + true + true + false From f984804e136e2423383475bda24b1b4ec2384c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BB=D0=B0=D0=B2=D0=B0=20=D0=A3=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=97=D0=BD=D1=96!=20=D0=93=D0=B5=D1=80=D0=BE=D1=8F=D0=BC=20?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=D0=B0!?= <777696+ncave@users.noreply.github.com> Date: Fri, 26 Aug 2022 11:52:35 -0700 Subject: [PATCH 143/226] Fixed FSComp typo (#13787) --- src/Compiler/FSComp.txt | 2 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.de.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.es.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.fr.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.it.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ja.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ko.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.pl.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.ru.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.tr.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 4 ++-- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 4e6eec610f9..fa4610bd00b 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -930,7 +930,7 @@ optsEmitDebugInfoInQuotations,"Emit debug information in quotations" optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)" optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries" optsSignatureData,"Include F# interface information, the default is file. Essential for distributing libraries." -1046,optsUnknownSignatureData,"Invalid value '%s' for --interfacedata, valid value are: none, file, compress."" +1046,optsUnknownSignatureData,"Invalid value '%s' for --interfacedata, valid value are: none, file, compress." optsOptimizationData,"Specify included optimization information, the default is file. Important for distributed libraries." 1047,optsUnknownOptimizationData,"Invalid value '%s' for --optimizationdata, valid value are: none, file, compress." 1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index ff2bd508550..2097d93eac4 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 3067a772651..11a26276634 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index c2456360c25..98681bcd9b1 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index a238ba0136f..5eba08a8603 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index a7cc725c625..b331fef5680 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 5b49c4bd125..dcdf1edc9d2 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index e3d5a493923..a88ab838892 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 3b02a48f812..f71dd1c78a7 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index ddc53052a3e..615985563b5 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index a87376fa075..d48f16b89f2 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 88856174155..5f9763a7403 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index d45f95ac8bc..e821d6299d1 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 981d2f170aa..852c5be20d8 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -533,8 +533,8 @@ - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. From 5a72e586278150b7aea4881829cd37be872b2043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BB=D0=B0=D0=B2=D0=B0=20=D0=A3=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=97=D0=BD=D1=96!=20=D0=93=D0=B5=D1=80=D0=BE=D1=8F=D0=BC=20?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=D0=B0!?= <777696+ncave@users.noreply.github.com> Date: Fri, 26 Aug 2022 14:07:15 -0700 Subject: [PATCH 144/226] Fixed missing import (#13790) --- src/Compiler/Checking/AttributeChecking.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 7731b83c256..d1d50393523 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -10,6 +10,7 @@ open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.Import open FSharp.Compiler.Infos open FSharp.Compiler.TcGlobals @@ -21,8 +22,6 @@ open FSharp.Compiler.TypeHierarchy #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders open FSharp.Core.CompilerServices -open Features - #endif exception ObsoleteWarning of string * range From 0063f20f6cd49d016d5d234b9c1b7df00c2e9a4d Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 26 Aug 2022 18:03:28 -0700 Subject: [PATCH 145/226] Make GetReverseIndex Experimental again (#13788) --- src/FSharp.Core/prim-types.fs | 6 ++++++ src/FSharp.Core/prim-types.fsi | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 3191bf8c649..1178620d63b 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -4107,6 +4107,7 @@ namespace Microsoft.FSharp.Collections let start = if i < 0 then 0 else i PrivateListHelpers.sliceTake (j - start) (PrivateListHelpers.sliceSkip start l) + [] member l.GetReverseIndex(_: int, offset: int) = l.Length - offset - 1 @@ -6902,6 +6903,7 @@ namespace Microsoft.FSharp.Core [] module ArrayExtensions = type ``[,,,]``<'T> with + [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6914,6 +6916,7 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[,,]``<'T> with + [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6925,6 +6928,7 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[,]``<'T> with + [] member arr.GetReverseIndex(dim: int, offset: int) = let len = match dim with @@ -6935,9 +6939,11 @@ namespace Microsoft.FSharp.Core len - offset - 1 type ``[]``<'T> with + [] member arr.GetReverseIndex (_: int, offset: int) = arr.Length - offset - 1 type String with + [] member str.GetReverseIndex (_: int, offset: int) = str.Length - offset - 1 namespace Microsoft.FSharp.Control diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 80b48b92345..ccac892f8fc 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -2555,6 +2555,7 @@ namespace Microsoft.FSharp.Collections /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int /// Returns a list with head as its first element and tail as its subsequent elements @@ -4608,6 +4609,7 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int type ``[,,]``<'T> with @@ -4617,6 +4619,7 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int type ``[,]``<'T> with @@ -4626,6 +4629,7 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int type ``[]``<'T> with @@ -4635,6 +4639,7 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int type System.String with @@ -4644,6 +4649,7 @@ namespace Microsoft.FSharp.Core /// The offset from the end. /// /// The corresponding index from the start. + [] member GetReverseIndex: rank: int * offset: int -> int /// A module of compiler intrinsic functions for efficient implementations of F# integer ranges From 9911902d3fead371d7c236ae6350be43258de1e4 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 29 Aug 2022 05:28:45 -0700 Subject: [PATCH 146/226] Staticize some overly instanced methods (#13794) --- src/Compiler/Checking/CheckExpressions.fs | 4 ++-- src/Compiler/Checking/InfoReader.fs | 2 +- src/Compiler/Driver/CompilerOptions.fs | 10 ++++------ src/Compiler/Facilities/DiagnosticsLogger.fs | 10 +++++----- src/Compiler/Facilities/DiagnosticsLogger.fsi | 3 +-- src/Compiler/Facilities/LanguageFeatures.fs | 12 ++++++------ src/Compiler/Facilities/LanguageFeatures.fsi | 10 +++++----- 7 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 2261a77d407..537887747d6 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -7019,7 +7019,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn let newFormatMethod = match GetIntrinsicConstructorInfosOfType cenv.infoReader m formatTy |> List.filter (fun minfo -> minfo.NumArgs = [3]) with | [ctorInfo] -> ctorInfo - | _ -> languageFeatureNotSupportedInLibraryError g.langVersion LanguageFeature.StringInterpolation m + | _ -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m let stringKind = // If this is an interpolated string then try to force the result to be a string @@ -7054,7 +7054,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn match createMethodOpt with | Some createMethod -> Choice2Of2 createMethod - | None -> languageFeatureNotSupportedInLibraryError g.langVersion LanguageFeature.StringInterpolation m + | None -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m // ... or if that fails then may be a PrintfFormat by a type-directed rule.... elif not (isObjTy g overallTy.Commit) && AddCxTypeMustSubsumeTypeUndoIfFailed env.DisplayEnv cenv.css m overallTy.Commit formatTy then diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 48b3ee82694..27eb5c2547e 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -922,7 +922,7 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) as this = let checkLanguageFeatureRuntimeAndRecover (infoReader: InfoReader) langFeature m = if not (infoReader.IsLanguageFeatureRuntimeSupported langFeature) then - let featureStr = infoReader.g.langVersion.GetFeatureString langFeature + let featureStr = LanguageVersion.GetFeatureString langFeature errorR (Error(FSComp.SR.chkFeatureNotRuntimeSupported featureStr, m)) let GetIntrinsicConstructorInfosOfType (infoReader: InfoReader) m ty = diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 5a62c787ff4..b1408411311 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1103,15 +1103,13 @@ let mlCompatibilityFlag (tcConfigB: TcConfigBuilder) = /// LanguageVersion management let setLanguageVersion specifiedVersion = - let languageVersion = LanguageVersion(specifiedVersion) - let dumpAllowedValues () = printfn "%s" (FSComp.SR.optsSupportedLangVersions ()) - for v in languageVersion.ValidOptions do + for v in LanguageVersion.ValidOptions do printfn "%s" v - for v in languageVersion.ValidVersions do + for v in LanguageVersion.ValidVersions do printfn "%s" v exit 0 @@ -1120,10 +1118,10 @@ let setLanguageVersion specifiedVersion = dumpAllowedValues () elif specifiedVersion.ToUpperInvariant() = "PREVIEW" then () - elif not (languageVersion.ContainsVersion specifiedVersion) then + elif not (LanguageVersion.ContainsVersion specifiedVersion) then error (Error(FSComp.SR.optsUnrecognizedLanguageVersion specifiedVersion, rangeCmdArgs)) - languageVersion + LanguageVersion(specifiedVersion) let languageFlags tcConfigB = [ diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 2e9a9c47d6b..aebfd1cfd6e 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -787,9 +787,9 @@ let NormalizeErrorString (text: string MaybeNull) = let private tryLanguageFeatureErrorAux (langVersion: LanguageVersion) (langFeature: LanguageFeature) (m: range) = if not (langVersion.SupportsFeature langFeature) then - let featureStr = langVersion.GetFeatureString langFeature + let featureStr = LanguageVersion.GetFeatureString langFeature let currentVersionStr = langVersion.SpecifiedVersionString - let suggestedVersionStr = langVersion.GetFeatureVersionString langFeature + let suggestedVersionStr = LanguageVersion.GetFeatureVersionString langFeature Some(Error(FSComp.SR.chkFeatureNotLanguageSupported (featureStr, currentVersionStr, suggestedVersionStr), m)) else None @@ -807,9 +807,9 @@ let internal checkLanguageFeatureAndRecover langVersion langFeature m = let internal tryLanguageFeatureErrorOption langVersion langFeature m = tryLanguageFeatureErrorAux langVersion langFeature m -let internal languageFeatureNotSupportedInLibraryError (langVersion: LanguageVersion) (langFeature: LanguageFeature) (m: range) = - let featureStr = langVersion.GetFeatureString langFeature - let suggestedVersionStr = langVersion.GetFeatureVersionString langFeature +let internal languageFeatureNotSupportedInLibraryError (langFeature: LanguageFeature) (m: range) = + let featureStr = LanguageVersion.GetFeatureString langFeature + let suggestedVersionStr = LanguageVersion.GetFeatureVersionString langFeature error (Error(FSComp.SR.chkFeatureNotSupportedInLibrary (featureStr, suggestedVersionStr), m)) /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index a818ae893c9..c4f0b226e16 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -386,8 +386,7 @@ val checkLanguageFeatureAndRecover: langVersion: LanguageVersion -> langFeature: val tryLanguageFeatureErrorOption: langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> exn option -val languageFeatureNotSupportedInLibraryError: - langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> 'T +val languageFeatureNotSupportedInLibraryError: langFeature: LanguageFeature -> m: range -> 'T type StackGuard = new: maxDepth: int -> StackGuard diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 48ca4b9be52..07bcca57870 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -147,7 +147,7 @@ type LanguageVersion(versionText) = let specified = getVersionFromString versionText - let versionToString v = + static let versionToString v = if v = previewVersion then "'PREVIEW'" else string v let specifiedString = versionToString specified @@ -167,15 +167,15 @@ type LanguageVersion(versionText) = member _.IsPreviewEnabled = specified = previewVersion /// Does the languageVersion support this version string - member _.ContainsVersion version = + static member ContainsVersion version = let langVersion = getVersionFromString version langVersion <> 0m && languageVersions.Contains langVersion /// Get a list of valid strings for help text - member _.ValidOptions = validOptions + static member ValidOptions = validOptions /// Get a list of valid versions for help text - member _.ValidVersions = + static member ValidVersions = [| for v in languageVersions |> Seq.sort -> sprintf "%M%s" v (if v = defaultVersion then " (Default)" else "") |] @@ -190,7 +190,7 @@ type LanguageVersion(versionText) = member _.SpecifiedVersionString = specifiedString /// Get a string name for the given feature. - member _.GetFeatureString feature = + static member GetFeatureString feature = match feature with | LanguageFeature.SingleUnderscorePattern -> FSComp.SR.featureSingleUnderscorePattern () | LanguageFeature.WildCardInForLoop -> FSComp.SR.featureWildCardInForLoop () @@ -232,7 +232,7 @@ type LanguageVersion(versionText) = | LanguageFeature.SelfTypeConstraints -> FSComp.SR.featureSelfTypeConstraints () /// Get a version string associated with the given feature. - member _.GetFeatureVersionString feature = + static member GetFeatureVersionString feature = match features.TryGetValue feature with | true, v -> versionToString v | _ -> invalidArg "feature" "Internal error: Unable to find feature." diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 71673cb05e3..cb7991392c1 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -52,7 +52,7 @@ type LanguageVersion = new: string -> LanguageVersion /// Get the list of valid versions - member ContainsVersion: string -> bool + static member ContainsVersion: string -> bool /// Has preview been explicitly specified member IsPreviewEnabled: bool @@ -64,10 +64,10 @@ type LanguageVersion = member SupportsFeature: LanguageFeature -> bool /// Get the list of valid versions - member ValidVersions: string[] + static member ValidVersions: string[] /// Get the list of valid options - member ValidOptions: string[] + static member ValidOptions: string[] /// Get the specified LanguageVersion member SpecifiedVersion: decimal @@ -79,9 +79,9 @@ type LanguageVersion = member SpecifiedVersionString: string /// Get a string name for the given feature. - member GetFeatureString: feature: LanguageFeature -> string + static member GetFeatureString: feature: LanguageFeature -> string /// Get a version string associated with the given feature. - member GetFeatureVersionString: feature: LanguageFeature -> string + static member GetFeatureVersionString: feature: LanguageFeature -> string static member Default: LanguageVersion From 9d29090169c27c487faf260037a75fc4f86d943e Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 29 Aug 2022 12:27:04 -0700 Subject: [PATCH 147/226] Revert tools.sh edit (#13796) * Revert tools.sh edit * Add binlog to build.sh for proto stuff --- eng/build.sh | 17 ++++++++++------- eng/common/tools.sh | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index de535261296..fff8414b3ef 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -255,21 +255,24 @@ function BuildSolution { rm -fr $bootstrap_dir fi if [ ! -f "$bootstrap_dir/fslex.dll" ]; then + local bltools="" + if [[ "$bl" != "" ]]; then + bltools=$bl+".lex.binlog" + fi BuildMessage="Error building tools" - MSBuild "$repo_root/buildtools/buildtools.proj" \ - /restore \ - /p:Configuration=$bootstrap_config + MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config mkdir -p "$bootstrap_dir" cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net7.0 $bootstrap_dir/fslex cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net7.0 $bootstrap_dir/fsyacc fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then + local bltools="" + if [[ "$bl" != "" ]]; then + bltools=$bl+".bootstrap.binlog" + fi BuildMessage="Error building bootstrap" - MSBuild "$repo_root/Proto.sln" \ - /restore \ - /p:Configuration=$bootstrap_config - + MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net7.0 $bootstrap_dir/fsc fi fi diff --git a/eng/common/tools.sh b/eng/common/tools.sh index a5fed41b644..c110d0ed410 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -490,7 +490,7 @@ function MSBuild-Core { } } - RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci /bl "$@" + RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" } ResolvePath "${BASH_SOURCE[0]}" From 508a0b2d452ff123eaf9a882b7fe54a9d5e8e1ad Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Mon, 29 Aug 2022 13:01:54 -0700 Subject: [PATCH 148/226] Missed a spot when updating to -Svc pool provider (#13807) --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 116511a26c2..f8fc6e98321 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -341,7 +341,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: From d8a546d686a29c9ac1894e6d4f5c3d3a20c21c5c Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 29 Aug 2022 18:28:53 -0700 Subject: [PATCH 149/226] Verify ship status (#13793) * Verify ship status * -verifypackageshipstatus in the right place * more * Update Versions.props * Update azure-pipelines.yml --- .../checkpackages/Directory.Build.props | 9 +++++ .../checkpackages/Directory.Build.targets | 2 + .../FSharp.Compiler.Service_notshipped.fsproj | 23 +++++++++++ .../FSharp.Core_notshipped.fsproj | 17 ++++++++ buildtools/checkpackages/Nuget.Config | 6 +++ eng/Build.ps1 | 40 +++++++++++++++++++ 6 files changed, 97 insertions(+) create mode 100644 buildtools/checkpackages/Directory.Build.props create mode 100644 buildtools/checkpackages/Directory.Build.targets create mode 100644 buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj create mode 100644 buildtools/checkpackages/FSharp.Core_notshipped.fsproj create mode 100644 buildtools/checkpackages/Nuget.Config diff --git a/buildtools/checkpackages/Directory.Build.props b/buildtools/checkpackages/Directory.Build.props new file mode 100644 index 00000000000..8d7a02870f8 --- /dev/null +++ b/buildtools/checkpackages/Directory.Build.props @@ -0,0 +1,9 @@ + + + true + $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) + $(CachePath)\obj\ + $(CachePath)\http_cache + $(CachePath)\nuget_cache + + diff --git a/buildtools/checkpackages/Directory.Build.targets b/buildtools/checkpackages/Directory.Build.targets new file mode 100644 index 00000000000..8c119d5413b --- /dev/null +++ b/buildtools/checkpackages/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj new file mode 100644 index 00000000000..f5204fd5c67 --- /dev/null +++ b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj @@ -0,0 +1,23 @@ + + + + + + net7.0 + true + $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) + $(CachePath)\bin + $(CachePath)\obj + $(CachePath)\http_cache + $(CachePath)\nuget_cache + + + + https://api.nuget.org/v3/index.json + + + + + + + diff --git a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj new file mode 100644 index 00000000000..5942f999fd8 --- /dev/null +++ b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj @@ -0,0 +1,17 @@ + + + + + + net7.0 + + + + https://api.nuget.org/v3/index.json + + + + + + + diff --git a/buildtools/checkpackages/Nuget.Config b/buildtools/checkpackages/Nuget.Config new file mode 100644 index 00000000000..1094c738a28 --- /dev/null +++ b/buildtools/checkpackages/Nuget.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/eng/Build.ps1 b/eng/Build.ps1 index af103f7911a..347dce1afe8 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -63,6 +63,7 @@ param ( [switch]$sourceBuild, [switch]$skipBuild, [switch]$compressAllMetadata, + [switch]$verifypackageshipstatus = $false, [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -117,6 +118,7 @@ function Print-Usage() { Write-Host " -sourceBuild Simulate building for source-build." Write-Host " -skipbuild Skip building product" Write-Host " -compressAllMetadata Build product with compressed metadata" + Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -149,6 +151,7 @@ function Process-Arguments() { $script:testFSharpQA = $False $script:testVs = $False $script:testpack = $False + $script:verifypackageshipstatus = $True } if ($noRestore) { @@ -175,6 +178,10 @@ function Process-Arguments() { $script:compressAllMetadata = $True; } + if ($verifypackageshipstatus) { + $script:verifypackageshipstatus = $True; + } + foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" @@ -605,6 +612,39 @@ try { throw "Error Verifying nupkgs have access to the source code" } + $verifypackageshipstatusFailed = $false + if ($verifypackageshipstatus) { + $dotnetPath = InitializeDotNetCli + $dotnetExe = Join-Path $dotnetPath "dotnet.exe" + + Write-Host "================================================================================================================================" + Write-Host "The error messages below are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published " + Write-Host "================================================================================================================================" + $exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Compiler.Service_notshipped.fsproj" + if ($exitCode -eq 0) { + Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.compiler.service nuget package is already published" + Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published" + $verifypackageshipstatusFailed = $True + } + + $exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Core_notshipped.fsproj" + if ($exitCode -eq 0) { + Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.core nuget package is already published" + Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published" + $verifypackageshipstatusFailed = $True + } + if (-not $verifypackageshipstatusFailed) + { + Write-Host "================================================================================================================================" + Write-Host "The error messages above are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published " + Write-Host "================================================================================================================================" + } + else + { + throw "Error Verifying shipping status of shipping nupkgs" + } + } + ExitWithExitCode 0 } catch { From 9a29bed37d0e8f28b85417b531ffc4b1ab7e851e Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 29 Aug 2022 18:29:12 -0700 Subject: [PATCH 150/226] reactivate test - Help is displayed correctly (#13792) * tcconfig/tcconfigbuilder * add --bufferwidth * fantomas * oops Co-authored-by: Vlad Zarytovskii --- src/Compiler/Driver/CompilerConfig.fs | 4 ++ src/Compiler/Driver/CompilerConfig.fsi | 5 +++ src/Compiler/Driver/CompilerOptions.fs | 43 ++++++++++++------- src/Compiler/Driver/CompilerOptions.fsi | 2 +- src/Compiler/Interactive/fsi.fs | 2 +- .../ConsoleOnlyOptionsTests.fs | 26 ++++++----- .../expected-help-output.bsl | 16 +++---- .../fsc/help/help40.437.1033.bsl | 16 +++---- .../fsi/exename/help40.437.1033.bsl | 12 +++--- .../fsi/help/help40-nologo.437.1033.bsl | 12 +++--- .../fsi/help/help40.437.1033.bsl | 12 +++--- 11 files changed, 85 insertions(+), 65 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 7a957b722da..cb0dc5478ee 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -551,6 +551,8 @@ type TcConfigBuilder = mutable fxResolver: FxResolver option + mutable bufferWidth: int option + // Is F# Interactive using multi-assembly emit? mutable fsiMultiAssemblyEmit: bool @@ -741,6 +743,7 @@ type TcConfigBuilder = shadowCopyReferences = false useSdkRefs = true fxResolver = None + bufferWidth = None fsiMultiAssemblyEmit = true internalTestSpanStackReferring = false noConditionalErasure = false @@ -1163,6 +1166,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = errorRecovery e range0 [] + member _.bufferWidth = data.bufferWidth member _.fsiMultiAssemblyEmit = data.fsiMultiAssemblyEmit member _.FxResolver = data.FxResolver member _.primaryAssembly = data.primaryAssembly diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 461298b5d60..034e514d3c2 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -452,6 +452,8 @@ type TcConfigBuilder = mutable fxResolver: FxResolver option + mutable bufferWidth: int option + mutable fsiMultiAssemblyEmit: bool rangeForErrors: range @@ -746,6 +748,7 @@ type TcConfig = member alwaysCallVirt: bool member noDebugAttributes: bool + member useReflectionFreeCodeGen: bool /// If true, indicates all type checking and code generation is in the context of fsi.exe @@ -753,6 +756,8 @@ type TcConfig = member isInvalidationSupported: bool + member bufferWidth: int option + /// Indicates if F# Interactive is using single-assembly emit via Reflection.Emit, where internals are available. member fsiMultiAssemblyEmit: bool diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index b1408411311..e75a449c9e2 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -115,23 +115,27 @@ let compilerOptionUsage (CompilerOption (s, tag, spec, _, _)) = let nl = Environment.NewLine -let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) = +let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) width = let sb = StringBuilder() let flagWidth = 42 // fixed width for printing of flags, e.g. --debug:{full|pdbonly|portable|embedded} let defaultLineWidth = 80 // the fallback width let lineWidth = - try - Console.BufferWidth - with e -> - defaultLineWidth + match width with + | None -> + try + Console.BufferWidth + with _ -> + defaultLineWidth + | Some w -> w let lineWidth = if lineWidth = 0 then defaultLineWidth else - lineWidth (* Have seen BufferWidth=0 on Linux/Mono *) + lineWidth (* Have seen BufferWidth=0 on Linux/Mono Coreclr for sure *) + // Lines have this form: // flagWidth chars - for flags description or padding on continuation lines. // single space - space. @@ -159,14 +163,14 @@ let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOpti let _ = sb.Append $"{nl}" sb.ToString() -let getPublicOptions (heading, opts) = - if not (isNil opts) then - $"{nl}{nl}\t\t{heading}{nl}" - + (opts |> List.map getCompilerOption |> String.concat "") - else - "" +let getPublicOptions heading opts width = + match opts with + | [] -> "" + | _ -> + $"{nl}{nl} {heading}{nl}" + + (opts |> List.map (fun t -> getCompilerOption t width) |> String.concat "") -let GetCompilerOptionBlocks blocks = +let GetCompilerOptionBlocks blocks width = let sb = new StringBuilder() let publicBlocks = @@ -182,7 +186,7 @@ let GetCompilerOptionBlocks blocks = let headingOptions = publicBlocks |> List.filter (fun (h2, _) -> heading = h2) |> List.collect snd - let _ = sb.Append(getPublicOptions (heading, headingOptions)) + let _ = sb.Append(getPublicOptions heading headingOptions width) Set.add heading doneHeadings List.fold consider Set.empty publicBlocks |> ignore> @@ -1462,6 +1466,14 @@ let internalFlags (tcConfigB: TcConfigBuilder) = None ) + CompilerOption( + "bufferwidth", + tagNone, + OptionInt((fun v -> tcConfigB.bufferWidth <- Some v)), + Some(InternalCommandLineOption("--bufferWidth", rangeCmdArgs)), + None + ) + CompilerOption( "detuple", tagNone, @@ -1997,7 +2009,8 @@ let GetBannerText tcConfigB = /// FSC only help. (FSI has it's own help function). let GetHelpFsc tcConfigB (blocks: CompilerOptionBlock list) = - GetBannerText tcConfigB + GetCompilerOptionBlocks blocks + + GetBannerText tcConfigB + GetCompilerOptionBlocks blocks tcConfigB.bufferWidth let GetVersion tcConfigB = $"{tcConfigB.productNameForBannerText}{nl}" diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index 048bffb51e9..8164393eac4 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -43,7 +43,7 @@ and CompilerOptionBlock = | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list -val GetCompilerOptionBlocks: CompilerOptionBlock list -> string +val GetCompilerOptionBlocks: CompilerOptionBlock list -> width: int option -> string val DumpCompilerOptionBlocks: CompilerOptionBlock list -> unit // for QA diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 00794953c27..316dfd429bb 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -885,7 +885,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, Console.Write (GetBannerText tcConfigB) fprintfn fsiConsoleOutput.Out "" fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiUsage(executableFileNameWithoutExtension.Value)) - Console.Write (GetCompilerOptionBlocks blocks) + Console.Write (GetCompilerOptionBlocks blocks tcConfigB.bufferWidth) exit 0 // option tags diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 332c5cbdee7..b91c0cff0a5 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -5,27 +5,25 @@ module FSharp.Compiler.Service.Tests.ConsoleOnlyOptionsTests open System open System.IO open FSharp.Compiler.CompilerOptions +open FSharp.Compiler.Text.Range open NUnit.Framework open TestDoubles [] -[] -let ``Help is displayed correctly`` () = - try - if System.Console.BufferWidth < 80 then - System.Console.BufferWidth <- 80 - with _ -> () +let ``fsc help text is displayed correctly`` () = - let builder = getArbitraryTcConfigBuilder() - builder.showBanner <- false // We don't need the banner - - let blocks = GetCoreFscCompilerOptions builder + let builder = getArbitraryTcConfigBuilder() + builder.showBanner <- false // We don't need the banner + builder.TurnWarningOff(rangeCmdArgs, "75") // We are going to use a test only flag + builder.bufferWidth <- Some 80 // Fixed width 80 + + let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl" - let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl" - let help = GetHelpFsc builder blocks + let blocks = GetCoreFscCompilerOptions builder + let help = GetHelpFsc builder blocks + let actualHelp = help.Replace("\r\n", Environment.NewLine) - let actualHelp = help.Replace("\r\n", Environment.NewLine) - Assert.AreEqual(expectedHelp, actualHelp, $"Console width: {System.Console.BufferWidth}\nExpected: {expectedHelp}\n Actual: {actualHelp}") |> ignore + Assert.AreEqual(expectedHelp, actualHelp, $"Expected: '{expectedHelp}'\n Actual: '{actualHelp}'") |> ignore [] let ``Version is displayed correctly`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 6be21d85f3c..877a8bf6b4b 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -1,6 +1,6 @@  - - OUTPUT FILES - + - OUTPUT FILES - --out: Name of the output file (Short form: -o) --target:exe Build a console executable @@ -46,7 +46,7 @@ the specified file path. - - INPUT FILES - + - INPUT FILES - --reference: Reference an assembly (Short form: -r) --compilertool: Reference an assembly or directory @@ -54,7 +54,7 @@ form: -t) - - RESOURCES - + - RESOURCES - --win32icon: Specify a Win32 icon file (.ico) --win32res: Specify a Win32 resource file (.res) --win32manifest: Specify a Win32 manifest file @@ -67,7 +67,7 @@ name>[,public|private]] - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -99,7 +99,7 @@ constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -110,7 +110,7 @@ color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -121,7 +121,7 @@ --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -130,7 +130,7 @@ --@ Read response file for more options - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 779ea3c45a3..29c0350665c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -2,7 +2,7 @@ Microsoft (R) F# Compiler version 12.0.0.0 for F# 6.0 Copyright (c) Microsoft Corporation. All Rights Reserved. - - OUTPUT FILES - + - OUTPUT FILES - --out: Name of the output file (Short form: -o) --target:exe Build a console executable @@ -48,7 +48,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. the specified file path. - - INPUT FILES - + - INPUT FILES - --reference: Reference an assembly (Short form: -r) --compilertool: Reference an assembly or directory @@ -56,7 +56,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. form: -t) - - RESOURCES - + - RESOURCES - --win32icon: Specify a Win32 icon file (.ico) --win32res: Specify a Win32 resource file (.res) --win32manifest: Specify a Win32 manifest file @@ -69,7 +69,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. name>[,public|private]] - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -101,7 +101,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -112,7 +112,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -123,7 +123,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -132,7 +132,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --@ Read response file for more options - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl index d916a6c2eba..0eddbd7e4c9 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl @@ -2,7 +2,7 @@ Usage: fsharpi [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -16,7 +16,7 @@ Usage: fsharpi [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -42,7 +42,7 @@ Usage: fsharpi [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -53,7 +53,7 @@ Usage: fsharpi [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -64,7 +64,7 @@ Usage: fsharpi [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -72,7 +72,7 @@ Usage: fsharpi [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index 906df1bcee4..4bd87bb194d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -2,7 +2,7 @@ Usage: fsiAnyCpu [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -16,7 +16,7 @@ Usage: fsiAnyCpu [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -42,7 +42,7 @@ Usage: fsiAnyCpu [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -53,7 +53,7 @@ Usage: fsiAnyCpu [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -64,7 +64,7 @@ Usage: fsiAnyCpu [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -72,7 +72,7 @@ Usage: fsiAnyCpu [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index 87541384a88..b56c812cd0e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -4,7 +4,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Usage: fsiAnyCpu [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -18,7 +18,7 @@ Usage: fsiAnyCpu [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -44,7 +44,7 @@ Usage: fsiAnyCpu [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -55,7 +55,7 @@ Usage: fsiAnyCpu [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -66,7 +66,7 @@ Usage: fsiAnyCpu [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -74,7 +74,7 @@ Usage: fsiAnyCpu [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding From b3219ddebad195f0939e1ea90e7b68c0a30bd9c9 Mon Sep 17 00:00:00 2001 From: Marcin Krystianc Date: Tue, 30 Aug 2022 13:06:45 +0200 Subject: [PATCH 151/226] Remove `-` from the beginning of the xml comment (#13797) --- src/FSharp.Build/Microsoft.FSharp.NetSdk.props | 2 +- src/FSharp.Build/Microsoft.FSharp.Targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props index b2252e9e136..ecd7efb5975 100644 --- a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -30,7 +30,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - false + false false diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 31bde3076ff..4817e6a9f9b 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -88,7 +88,7 @@ this file. - + false true From 7c81ac092c257f83102d3d23ac888960c50075b9 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Tue, 30 Aug 2022 17:31:19 +0200 Subject: [PATCH 152/226] Indent internal records type definitions. (#13798) --- src/Compiler/Checking/NicePrint.fs | 18 ++++++---- src/Compiler/Service/FSharpCheckerResults.fs | 8 +++-- src/Compiler/Service/FSharpCheckerResults.fsi | 2 +- .../FSharp.Compiler.ComponentTests.fsproj | 2 ++ .../Signatures/ModuleOrNamespaceTests.fs | 12 +------ .../Signatures/RecordTests.fs | 33 +++++++++++++++++++ .../Signatures/TestHelpers.fs | 14 ++++++++ ...erService.SurfaceArea.netstandard.expected | 26 +++++++-------- tests/FSharp.Test.Utilities/Compiler.fs | 14 ++++---- 9 files changed, 90 insertions(+), 39 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 9f80ad640a8..3913253a0e4 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -480,7 +480,7 @@ module PrintTypes = | Const.Zero -> tagKeyword(if isRefTy g ty then "null" else "default") wordL str - let layoutAccessibility (denv: DisplayEnv) accessibility itemL = + let layoutAccessibilityCore (denv: DisplayEnv) accessibility = let isInternalCompPath x = match x with | CompPath(ILScopeRef.Local, []) -> true @@ -491,10 +491,13 @@ module PrintTypes = | _ when List.forall isInternalCompPath p -> Internal | _ -> Private match denv.contextAccessibility, accessibility with - | Public, Internal -> WordL.keywordInternal ++ itemL // print modifier, since more specific than context - | Public, Private -> WordL.keywordPrivate ++ itemL // print modifier, since more specific than context - | Internal, Private -> WordL.keywordPrivate ++ itemL // print modifier, since more specific than context - | _ -> itemL + | Public, Internal -> WordL.keywordInternal + | Public, Private -> WordL.keywordPrivate + | Internal, Private -> WordL.keywordPrivate + | _ -> emptyL + + let layoutAccessibility (denv: DisplayEnv) accessibility itemL = + layoutAccessibilityCore denv accessibility ++ itemL /// Layout a reference to a type let layoutTyconRef denv tcref = layoutTyconRefImpl false denv tcref @@ -1977,6 +1980,9 @@ module TastDefinitionPrinting = let addReprAccessL l = layoutAccessibility denv tycon.TypeReprAccessibility l + let addReprAccessRecord l = + layoutAccessibilityCore denv tycon.TypeReprAccessibility --- l + let addLhs rhsL = let brk = not (isNil allDecls) || breakTypeDefnEqn repr if brk then @@ -2019,7 +2025,7 @@ module TastDefinitionPrinting = |> applyMaxMembers denv.maxMembers |> aboveListL |> (if useMultiLine then braceMultiLineL else braceL) - |> addReprAccessL + |> addReprAccessRecord |> addMaxMembers |> addLhs diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index fafdbf0e58c..b01819fc2b7 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -2798,7 +2798,7 @@ type FSharpCheckFileResults let (nenv, _), _ = scope.GetBestDisplayEnvForPos cursorPos Some(FSharpDisplayContext(fun _ -> nenv.DisplayEnv)) - member _.GenerateSignature() = + member _.GenerateSignature(?pageWidth: int) = match details with | None -> None | Some (scope, _builderOpt) -> @@ -2816,7 +2816,11 @@ type FSharpCheckFileResults let layout = NicePrint.layoutImpliedSignatureOfModuleOrNamespace true denv infoReader ad range0 mexpr - layout |> LayoutRender.showL |> SourceText.ofString) + match pageWidth with + | None -> layout + | Some pageWidth -> Display.squashTo pageWidth layout + |> LayoutRender.showL + |> SourceText.ofString) member _.ImplementationFile = if not keepAssemblyContents then diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index dff418f5438..fc39764ff8c 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -410,7 +410,7 @@ type public FSharpCheckFileResults = member OpenDeclarations: FSharpOpenDeclaration[] /// Lays out and returns the formatted signature for the typechecked file as source text. - member GenerateSignature: unit -> ISourceText option + member GenerateSignature: ?pageWidth: int -> ISourceText option /// Internal constructor static member internal MakeEmpty: diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 950923f23d7..d8bd7df90cf 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -196,7 +196,9 @@ + + diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs index 5051d595827..abfb28b42e0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs @@ -1,19 +1,9 @@ module FSharp.Compiler.ComponentTests.Signatures.ModuleOrNamespaceTests -open System open Xunit open FsUnit open FSharp.Test.Compiler - -let private prependNewline v = String.Concat("\n", v) - -let equal x = - let x = - match box x with - | :? String as s -> s.Replace("\r\n", "\n") |> box - | x -> x - - equal x +open FSharp.Compiler.ComponentTests.Signatures.TestHelpers [] let ``Type from shared namespace`` () = diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs new file mode 100644 index 00000000000..e51da662155 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs @@ -0,0 +1,33 @@ +module FSharp.Compiler.ComponentTests.Signatures.RecordTests + +open Xunit +open FsUnit +open FSharp.Test.Compiler +open FSharp.Compiler.ComponentTests.Signatures.TestHelpers + +[] +let ``Internal record with xml comment`` () = + FSharp + """ +module SignatureFileGeneration.MyModule + +type PullActions = + internal + { + /// Any repo which doesn't have a master branch will have one created for it. + Log : int + } +""" + |> printSignaturesWith 80 + |> should + equal + """ +module SignatureFileGeneration.MyModule + +type PullActions = + internal + { + + /// Any repo which doesn't have a master branch will have one created for it. + Log: int + }""" diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs new file mode 100644 index 00000000000..23ad4176c8b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs @@ -0,0 +1,14 @@ +module FSharp.Compiler.ComponentTests.Signatures.TestHelpers + +open System +open FsUnit + +let prependNewline v = String.Concat("\n", v) + +let equal x = + let x = + match box x with + | :? String as s -> s.Replace("\r\n", "\n") |> box + | x -> x + + equal x \ No newline at end of file diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index c9f58e3ca78..b808314ad58 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -1982,7 +1982,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FShar FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] get_ImplementationFile() -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.ISourceText] GenerateSignature() +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.ISourceText] GenerateSignature(Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetMethodsAsSymbols(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[System.String] GetF1Keyword(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: System.Collections.Generic.IEnumerable`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetAllUsesOfAllSymbolsInFile(Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) @@ -6709,10 +6709,10 @@ FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Sequential FSharp.Compiler.Syntax.SynExpr+Tags: Int32 SequentialOrImplicitYield FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Set FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TraitCall -FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Typar FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TryFinally FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TryWith FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Tuple +FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Typar FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TypeApp FSharp.Compiler.Syntax.SynExpr+Tags: Int32 TypeTest FSharp.Compiler.Syntax.SynExpr+Tags: Int32 Typed @@ -6874,10 +6874,10 @@ FSharp.Compiler.Syntax.SynExpr: Boolean IsSequential FSharp.Compiler.Syntax.SynExpr: Boolean IsSequentialOrImplicitYield FSharp.Compiler.Syntax.SynExpr: Boolean IsSet FSharp.Compiler.Syntax.SynExpr: Boolean IsTraitCall -FSharp.Compiler.Syntax.SynExpr: Boolean IsTypar FSharp.Compiler.Syntax.SynExpr: Boolean IsTryFinally FSharp.Compiler.Syntax.SynExpr: Boolean IsTryWith FSharp.Compiler.Syntax.SynExpr: Boolean IsTuple +FSharp.Compiler.Syntax.SynExpr: Boolean IsTypar FSharp.Compiler.Syntax.SynExpr: Boolean IsTypeApp FSharp.Compiler.Syntax.SynExpr: Boolean IsTypeTest FSharp.Compiler.Syntax.SynExpr: Boolean IsTyped @@ -7011,10 +7011,10 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSequential(FSh FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSequentialOrImplicitYield(FSharp.Compiler.Syntax.DebugPointAtSequential, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewSet(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTraitCall(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTypar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTryFinally(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.DebugPointAtTry, FSharp.Compiler.Syntax.DebugPointAtFinally, FSharp.Compiler.SyntaxTrivia.SynExprTryFinallyTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTryWith(FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMatchClause], FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.DebugPointAtTry, FSharp.Compiler.Syntax.DebugPointAtWith, FSharp.Compiler.SyntaxTrivia.SynExprTryWithTrivia) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTypar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTypeApp(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTypeTest(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Syntax.SynExpr NewTyped(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) @@ -8605,18 +8605,22 @@ FSharp.Compiler.Syntax.SynType: Int32 Tag FSharp.Compiler.Syntax.SynType: Int32 get_Tag() FSharp.Compiler.Syntax.SynType: System.String ToString() FSharp.Compiler.Syntax.SynTypeConstraint +FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparDefaultsToType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsComparable FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsDelegate FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEnum FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsReferenceType -FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsValueType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsNull +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType get_selfConstraint() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType selfConstraint +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparDefaultsToType: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparDefaultsToType: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparDefaultsToType: FSharp.Compiler.Syntax.SynType get_typeName() @@ -8671,10 +8675,6 @@ FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType get_selfConstraint() -FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Syntax.SynType selfConstraint -FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparDefaultsToType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsComparable @@ -8687,6 +8687,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsValueType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsNull +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereSelfConstrained() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparDefaultsToType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsComparable() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsDelegate() @@ -8698,6 +8699,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsValueType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSubtypeOfType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsMember() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsNull() +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereSelfConstrained(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparDefaultsToType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsComparable(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsDelegate(FSharp.Compiler.Syntax.SynTypar, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Text.Range) @@ -8710,6 +8712,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstrai FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsMember(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+Tags +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparDefaultsToType FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsComparable FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsDelegate @@ -8726,9 +8729,6 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeConstraint: Int32 Tag FSharp.Compiler.Syntax.SynTypeConstraint: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeConstraint: System.String ToString() -FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereSelfConstrained() -FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereSelfConstrained(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereSelfConstrained FSharp.Compiler.Syntax.SynTypeDefn FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo typeInfo @@ -11099,4 +11099,4 @@ FSharp.Compiler.Xml.XmlDoc: System.String GetXmlText() FSharp.Compiler.Xml.XmlDoc: System.String[] GetElaboratedXmlLines() FSharp.Compiler.Xml.XmlDoc: System.String[] UnprocessedLines FSharp.Compiler.Xml.XmlDoc: System.String[] get_UnprocessedLines() -FSharp.Compiler.Xml.XmlDoc: Void .ctor(System.String[], FSharp.Compiler.Text.Range) +FSharp.Compiler.Xml.XmlDoc: Void .ctor(System.String[], FSharp.Compiler.Text.Range) \ No newline at end of file diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index f997930bac1..2d24d2f678a 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1313,15 +1313,15 @@ module rec Compiler = let withEvalTypeEquals t (result: CompilationResult) : CompilationResult = assertEvalOutput (fun (x: FsiValue) -> x.ReflectionType) t result - let signatureText (checkResults: FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults) = - checkResults.GenerateSignature() + let signatureText (pageWidth: int option) (checkResults: FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults) = + checkResults.GenerateSignature(?pageWidth = pageWidth) |> Option.defaultWith (fun _ -> failwith "Unable to generate signature text.") let signaturesShouldContain (expected: string) cUnit = let text = cUnit |> typecheckResults - |> signatureText + |> signatureText None let actual = text.ToString().Split('\n') @@ -1331,13 +1331,15 @@ module rec Compiler = if not (actual |> Array.contains expected) then failwith ($"The following signature:\n%s{expected}\n\nwas not found in:\n" + (actual |> String.concat "\n")) - let printSignatures cUnit = + let private printSignaturesImpl pageWidth cUnit = cUnit |> typecheckResults - |> signatureText + |> signatureText pageWidth |> string |> fun s -> s.Replace("\r", "").Split('\n') |> Array.map (fun line -> line.TrimEnd()) |> String.concat "\n" - |> fun tap -> tap \ No newline at end of file + + let printSignatures cUnit = printSignaturesImpl None cUnit + let printSignaturesWith pageWidth cUnit = printSignaturesImpl (Some pageWidth) cUnit From ea0d0b20ebf338b2eef75e82ac9888f9f5df9b4e Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 30 Aug 2022 13:03:14 -0700 Subject: [PATCH 153/226] Merge main to release/dev17.4 (#13808) * Revert tools.sh edit (#13796) * Revert tools.sh edit * Add binlog to build.sh for proto stuff * Verify ship status (#13793) * Verify ship status * -verifypackageshipstatus in the right place * more * Update Versions.props * Update azure-pipelines.yml * reactivate test - Help is displayed correctly (#13792) * tcconfig/tcconfigbuilder * add --bufferwidth * fantomas * oops Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) Co-authored-by: Vlad Zarytovskii --- .../checkpackages/Directory.Build.props | 9 ++++ .../checkpackages/Directory.Build.targets | 2 + .../FSharp.Compiler.Service_notshipped.fsproj | 23 ++++++++++ .../FSharp.Core_notshipped.fsproj | 17 ++++++++ buildtools/checkpackages/Nuget.Config | 6 +++ eng/Build.ps1 | 40 +++++++++++++++++ eng/build.sh | 17 +++++--- eng/common/tools.sh | 2 +- src/Compiler/Driver/CompilerConfig.fs | 4 ++ src/Compiler/Driver/CompilerConfig.fsi | 5 +++ src/Compiler/Driver/CompilerOptions.fs | 43 ++++++++++++------- src/Compiler/Driver/CompilerOptions.fsi | 2 +- src/Compiler/Interactive/fsi.fs | 2 +- .../ConsoleOnlyOptionsTests.fs | 26 ++++++----- .../expected-help-output.bsl | 16 +++---- .../fsc/help/help40.437.1033.bsl | 16 +++---- .../fsi/exename/help40.437.1033.bsl | 12 +++--- .../fsi/help/help40-nologo.437.1033.bsl | 12 +++--- .../fsi/help/help40.437.1033.bsl | 12 +++--- 19 files changed, 193 insertions(+), 73 deletions(-) create mode 100644 buildtools/checkpackages/Directory.Build.props create mode 100644 buildtools/checkpackages/Directory.Build.targets create mode 100644 buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj create mode 100644 buildtools/checkpackages/FSharp.Core_notshipped.fsproj create mode 100644 buildtools/checkpackages/Nuget.Config diff --git a/buildtools/checkpackages/Directory.Build.props b/buildtools/checkpackages/Directory.Build.props new file mode 100644 index 00000000000..8d7a02870f8 --- /dev/null +++ b/buildtools/checkpackages/Directory.Build.props @@ -0,0 +1,9 @@ + + + true + $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) + $(CachePath)\obj\ + $(CachePath)\http_cache + $(CachePath)\nuget_cache + + diff --git a/buildtools/checkpackages/Directory.Build.targets b/buildtools/checkpackages/Directory.Build.targets new file mode 100644 index 00000000000..8c119d5413b --- /dev/null +++ b/buildtools/checkpackages/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj new file mode 100644 index 00000000000..f5204fd5c67 --- /dev/null +++ b/buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj @@ -0,0 +1,23 @@ + + + + + + net7.0 + true + $(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid()) + $(CachePath)\bin + $(CachePath)\obj + $(CachePath)\http_cache + $(CachePath)\nuget_cache + + + + https://api.nuget.org/v3/index.json + + + + + + + diff --git a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj new file mode 100644 index 00000000000..5942f999fd8 --- /dev/null +++ b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj @@ -0,0 +1,17 @@ + + + + + + net7.0 + + + + https://api.nuget.org/v3/index.json + + + + + + + diff --git a/buildtools/checkpackages/Nuget.Config b/buildtools/checkpackages/Nuget.Config new file mode 100644 index 00000000000..1094c738a28 --- /dev/null +++ b/buildtools/checkpackages/Nuget.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/eng/Build.ps1 b/eng/Build.ps1 index af103f7911a..347dce1afe8 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -63,6 +63,7 @@ param ( [switch]$sourceBuild, [switch]$skipBuild, [switch]$compressAllMetadata, + [switch]$verifypackageshipstatus = $false, [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -117,6 +118,7 @@ function Print-Usage() { Write-Host " -sourceBuild Simulate building for source-build." Write-Host " -skipbuild Skip building product" Write-Host " -compressAllMetadata Build product with compressed metadata" + Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -149,6 +151,7 @@ function Process-Arguments() { $script:testFSharpQA = $False $script:testVs = $False $script:testpack = $False + $script:verifypackageshipstatus = $True } if ($noRestore) { @@ -175,6 +178,10 @@ function Process-Arguments() { $script:compressAllMetadata = $True; } + if ($verifypackageshipstatus) { + $script:verifypackageshipstatus = $True; + } + foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" @@ -605,6 +612,39 @@ try { throw "Error Verifying nupkgs have access to the source code" } + $verifypackageshipstatusFailed = $false + if ($verifypackageshipstatus) { + $dotnetPath = InitializeDotNetCli + $dotnetExe = Join-Path $dotnetPath "dotnet.exe" + + Write-Host "================================================================================================================================" + Write-Host "The error messages below are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published " + Write-Host "================================================================================================================================" + $exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Compiler.Service_notshipped.fsproj" + if ($exitCode -eq 0) { + Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.compiler.service nuget package is already published" + Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published" + $verifypackageshipstatusFailed = $True + } + + $exitCode = Exec-Process "$dotnetExe" "restore $RepoRoot\buildtools\checkpackages\FSharp.Core_notshipped.fsproj" + if ($exitCode -eq 0) { + Write-Host -ForegroundColor Red "Command succeeded but was expected to fail: this means that the fsharp.core nuget package is already published" + Write-Host -ForegroundColor Red "Modify the version number of FSharp.Compiler.Servoce to be published" + $verifypackageshipstatusFailed = $True + } + if (-not $verifypackageshipstatusFailed) + { + Write-Host "================================================================================================================================" + Write-Host "The error messages above are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published " + Write-Host "================================================================================================================================" + } + else + { + throw "Error Verifying shipping status of shipping nupkgs" + } + } + ExitWithExitCode 0 } catch { diff --git a/eng/build.sh b/eng/build.sh index de535261296..fff8414b3ef 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -255,21 +255,24 @@ function BuildSolution { rm -fr $bootstrap_dir fi if [ ! -f "$bootstrap_dir/fslex.dll" ]; then + local bltools="" + if [[ "$bl" != "" ]]; then + bltools=$bl+".lex.binlog" + fi BuildMessage="Error building tools" - MSBuild "$repo_root/buildtools/buildtools.proj" \ - /restore \ - /p:Configuration=$bootstrap_config + MSBuild "$repo_root/buildtools/buildtools.proj" /restore "$bltools" /p:Configuration=$bootstrap_config mkdir -p "$bootstrap_dir" cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/net7.0 $bootstrap_dir/fslex cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/net7.0 $bootstrap_dir/fsyacc fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then + local bltools="" + if [[ "$bl" != "" ]]; then + bltools=$bl+".bootstrap.binlog" + fi BuildMessage="Error building bootstrap" - MSBuild "$repo_root/Proto.sln" \ - /restore \ - /p:Configuration=$bootstrap_config - + MSBuild "$repo_root/Proto.sln" /restore "$bltools" /p:Configuration=$bootstrap_config cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/net7.0 $bootstrap_dir/fsc fi fi diff --git a/eng/common/tools.sh b/eng/common/tools.sh index a5fed41b644..c110d0ed410 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -490,7 +490,7 @@ function MSBuild-Core { } } - RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci /bl "$@" + RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" } ResolvePath "${BASH_SOURCE[0]}" diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 7a957b722da..cb0dc5478ee 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -551,6 +551,8 @@ type TcConfigBuilder = mutable fxResolver: FxResolver option + mutable bufferWidth: int option + // Is F# Interactive using multi-assembly emit? mutable fsiMultiAssemblyEmit: bool @@ -741,6 +743,7 @@ type TcConfigBuilder = shadowCopyReferences = false useSdkRefs = true fxResolver = None + bufferWidth = None fsiMultiAssemblyEmit = true internalTestSpanStackReferring = false noConditionalErasure = false @@ -1163,6 +1166,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = errorRecovery e range0 [] + member _.bufferWidth = data.bufferWidth member _.fsiMultiAssemblyEmit = data.fsiMultiAssemblyEmit member _.FxResolver = data.FxResolver member _.primaryAssembly = data.primaryAssembly diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 461298b5d60..034e514d3c2 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -452,6 +452,8 @@ type TcConfigBuilder = mutable fxResolver: FxResolver option + mutable bufferWidth: int option + mutable fsiMultiAssemblyEmit: bool rangeForErrors: range @@ -746,6 +748,7 @@ type TcConfig = member alwaysCallVirt: bool member noDebugAttributes: bool + member useReflectionFreeCodeGen: bool /// If true, indicates all type checking and code generation is in the context of fsi.exe @@ -753,6 +756,8 @@ type TcConfig = member isInvalidationSupported: bool + member bufferWidth: int option + /// Indicates if F# Interactive is using single-assembly emit via Reflection.Emit, where internals are available. member fsiMultiAssemblyEmit: bool diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index b1408411311..e75a449c9e2 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -115,23 +115,27 @@ let compilerOptionUsage (CompilerOption (s, tag, spec, _, _)) = let nl = Environment.NewLine -let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) = +let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOption) width = let sb = StringBuilder() let flagWidth = 42 // fixed width for printing of flags, e.g. --debug:{full|pdbonly|portable|embedded} let defaultLineWidth = 80 // the fallback width let lineWidth = - try - Console.BufferWidth - with e -> - defaultLineWidth + match width with + | None -> + try + Console.BufferWidth + with _ -> + defaultLineWidth + | Some w -> w let lineWidth = if lineWidth = 0 then defaultLineWidth else - lineWidth (* Have seen BufferWidth=0 on Linux/Mono *) + lineWidth (* Have seen BufferWidth=0 on Linux/Mono Coreclr for sure *) + // Lines have this form: // flagWidth chars - for flags description or padding on continuation lines. // single space - space. @@ -159,14 +163,14 @@ let getCompilerOption (CompilerOption (_s, _tag, _spec, _, help) as compilerOpti let _ = sb.Append $"{nl}" sb.ToString() -let getPublicOptions (heading, opts) = - if not (isNil opts) then - $"{nl}{nl}\t\t{heading}{nl}" - + (opts |> List.map getCompilerOption |> String.concat "") - else - "" +let getPublicOptions heading opts width = + match opts with + | [] -> "" + | _ -> + $"{nl}{nl} {heading}{nl}" + + (opts |> List.map (fun t -> getCompilerOption t width) |> String.concat "") -let GetCompilerOptionBlocks blocks = +let GetCompilerOptionBlocks blocks width = let sb = new StringBuilder() let publicBlocks = @@ -182,7 +186,7 @@ let GetCompilerOptionBlocks blocks = let headingOptions = publicBlocks |> List.filter (fun (h2, _) -> heading = h2) |> List.collect snd - let _ = sb.Append(getPublicOptions (heading, headingOptions)) + let _ = sb.Append(getPublicOptions heading headingOptions width) Set.add heading doneHeadings List.fold consider Set.empty publicBlocks |> ignore> @@ -1462,6 +1466,14 @@ let internalFlags (tcConfigB: TcConfigBuilder) = None ) + CompilerOption( + "bufferwidth", + tagNone, + OptionInt((fun v -> tcConfigB.bufferWidth <- Some v)), + Some(InternalCommandLineOption("--bufferWidth", rangeCmdArgs)), + None + ) + CompilerOption( "detuple", tagNone, @@ -1997,7 +2009,8 @@ let GetBannerText tcConfigB = /// FSC only help. (FSI has it's own help function). let GetHelpFsc tcConfigB (blocks: CompilerOptionBlock list) = - GetBannerText tcConfigB + GetCompilerOptionBlocks blocks + + GetBannerText tcConfigB + GetCompilerOptionBlocks blocks tcConfigB.bufferWidth let GetVersion tcConfigB = $"{tcConfigB.productNameForBannerText}{nl}" diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index 048bffb51e9..8164393eac4 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -43,7 +43,7 @@ and CompilerOptionBlock = | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list -val GetCompilerOptionBlocks: CompilerOptionBlock list -> string +val GetCompilerOptionBlocks: CompilerOptionBlock list -> width: int option -> string val DumpCompilerOptionBlocks: CompilerOptionBlock list -> unit // for QA diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 00794953c27..316dfd429bb 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -885,7 +885,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, Console.Write (GetBannerText tcConfigB) fprintfn fsiConsoleOutput.Out "" fprintfn fsiConsoleOutput.Out "%s" (FSIstrings.SR.fsiUsage(executableFileNameWithoutExtension.Value)) - Console.Write (GetCompilerOptionBlocks blocks) + Console.Write (GetCompilerOptionBlocks blocks tcConfigB.bufferWidth) exit 0 // option tags diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 332c5cbdee7..b91c0cff0a5 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -5,27 +5,25 @@ module FSharp.Compiler.Service.Tests.ConsoleOnlyOptionsTests open System open System.IO open FSharp.Compiler.CompilerOptions +open FSharp.Compiler.Text.Range open NUnit.Framework open TestDoubles [] -[] -let ``Help is displayed correctly`` () = - try - if System.Console.BufferWidth < 80 then - System.Console.BufferWidth <- 80 - with _ -> () +let ``fsc help text is displayed correctly`` () = - let builder = getArbitraryTcConfigBuilder() - builder.showBanner <- false // We don't need the banner - - let blocks = GetCoreFscCompilerOptions builder + let builder = getArbitraryTcConfigBuilder() + builder.showBanner <- false // We don't need the banner + builder.TurnWarningOff(rangeCmdArgs, "75") // We are going to use a test only flag + builder.bufferWidth <- Some 80 // Fixed width 80 + + let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl" - let expectedHelp = File.ReadAllText $"{__SOURCE_DIRECTORY__}/expected-help-output.bsl" - let help = GetHelpFsc builder blocks + let blocks = GetCoreFscCompilerOptions builder + let help = GetHelpFsc builder blocks + let actualHelp = help.Replace("\r\n", Environment.NewLine) - let actualHelp = help.Replace("\r\n", Environment.NewLine) - Assert.AreEqual(expectedHelp, actualHelp, $"Console width: {System.Console.BufferWidth}\nExpected: {expectedHelp}\n Actual: {actualHelp}") |> ignore + Assert.AreEqual(expectedHelp, actualHelp, $"Expected: '{expectedHelp}'\n Actual: '{actualHelp}'") |> ignore [] let ``Version is displayed correctly`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 6be21d85f3c..877a8bf6b4b 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -1,6 +1,6 @@  - - OUTPUT FILES - + - OUTPUT FILES - --out: Name of the output file (Short form: -o) --target:exe Build a console executable @@ -46,7 +46,7 @@ the specified file path. - - INPUT FILES - + - INPUT FILES - --reference: Reference an assembly (Short form: -r) --compilertool: Reference an assembly or directory @@ -54,7 +54,7 @@ form: -t) - - RESOURCES - + - RESOURCES - --win32icon: Specify a Win32 icon file (.ico) --win32res: Specify a Win32 resource file (.res) --win32manifest: Specify a Win32 manifest file @@ -67,7 +67,7 @@ name>[,public|private]] - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -99,7 +99,7 @@ constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -110,7 +110,7 @@ color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -121,7 +121,7 @@ --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -130,7 +130,7 @@ --@ Read response file for more options - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 779ea3c45a3..29c0350665c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -2,7 +2,7 @@ Microsoft (R) F# Compiler version 12.0.0.0 for F# 6.0 Copyright (c) Microsoft Corporation. All Rights Reserved. - - OUTPUT FILES - + - OUTPUT FILES - --out: Name of the output file (Short form: -o) --target:exe Build a console executable @@ -48,7 +48,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. the specified file path. - - INPUT FILES - + - INPUT FILES - --reference: Reference an assembly (Short form: -r) --compilertool: Reference an assembly or directory @@ -56,7 +56,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. form: -t) - - RESOURCES - + - RESOURCES - --win32icon: Specify a Win32 icon file (.ico) --win32res: Specify a Win32 resource file (.res) --win32manifest: Specify a Win32 manifest file @@ -69,7 +69,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. name>[,public|private]] - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -101,7 +101,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -112,7 +112,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -123,7 +123,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -132,7 +132,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --@ Read response file for more options - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl index d916a6c2eba..0eddbd7e4c9 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl @@ -2,7 +2,7 @@ Usage: fsharpi [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -16,7 +16,7 @@ Usage: fsharpi [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -42,7 +42,7 @@ Usage: fsharpi [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -53,7 +53,7 @@ Usage: fsharpi [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -64,7 +64,7 @@ Usage: fsharpi [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -72,7 +72,7 @@ Usage: fsharpi [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index 906df1bcee4..4bd87bb194d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -2,7 +2,7 @@ Usage: fsiAnyCpu [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -16,7 +16,7 @@ Usage: fsiAnyCpu [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -42,7 +42,7 @@ Usage: fsiAnyCpu [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -53,7 +53,7 @@ Usage: fsiAnyCpu [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -64,7 +64,7 @@ Usage: fsiAnyCpu [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -72,7 +72,7 @@ Usage: fsiAnyCpu [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index 87541384a88..b56c812cd0e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -4,7 +4,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Usage: fsiAnyCpu [script.fsx []] - - INPUT FILES - + - INPUT FILES - --use: Use the given file on startup as initial input --load: #load the given file on startup @@ -18,7 +18,7 @@ Usage: fsiAnyCpu [script.fsx []] fsi.CommandLineArgs - - CODE GENERATION - + - CODE GENERATION - --debug[+|-] Emit debug information (Short form: -g) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, @@ -44,7 +44,7 @@ Usage: fsiAnyCpu [script.fsx []] constructs using reflection - - ERRORS AND WARNINGS - + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) @@ -55,7 +55,7 @@ Usage: fsiAnyCpu [script.fsx []] color - - LANGUAGE - + - LANGUAGE - --langversion:{?|version|latest|preview} Display the allowed values for language version, specify language version such as 'latest' or @@ -66,7 +66,7 @@ Usage: fsiAnyCpu [script.fsx []] --mlcompatibility Ignore ML compatibility warnings - - MISCELLANEOUS - + - MISCELLANEOUS - --nologo Suppress compiler copyright message --version Display compiler version banner and exit @@ -74,7 +74,7 @@ Usage: fsiAnyCpu [script.fsx []] form: -?) - - ADVANCED - + - ADVANCED - --codepage: Specify the codepage used to read source files --utf8output Output messages in UTF-8 encoding From 224cac0296a1f081c986c4f5905b77daac689346 Mon Sep 17 00:00:00 2001 From: Alex Perovich Date: Thu, 1 Sep 2022 11:04:12 -0700 Subject: [PATCH 154/226] Update public pool names (#13818) * Update public pool names * Update azure-pipelines.yml * Disable macOS legs until fixed. Co-authored-by: Vlad Zarytovskii --- azure-pipelines.yml | 14 ++++++++------ eng/common/templates/job/source-build.yml | 2 +- eng/common/templates/job/source-index-stage1.yml | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8d758b5360d..44b334b82d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -210,7 +210,7 @@ stages: - name: _SignType value: Test pool: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 90 steps: @@ -283,7 +283,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: @@ -341,7 +341,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: @@ -395,7 +395,7 @@ stages: # Mock official build - job: MockOfficial pool: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -445,6 +445,7 @@ stages: # MacOS - job: MacOS + condition: eq(1,2) pool: vmImage: $(MacOSMachineQueueName) variables: @@ -486,7 +487,7 @@ stages: # End to end build - job: EndToEndBuildTests pool: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -511,7 +512,7 @@ stages: # Plain build Windows - job: Plain_Build_Windows pool: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals $(WindowsMachineQueueName) variables: - name: _BuildConfig @@ -575,6 +576,7 @@ stages: # Plain build Mac - job: Plain_Build_MacOS + condition: eq(1,2) pool: vmImage: $(MacOSMachineQueueName) variables: diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 5cd5325d7b4..88f6f75a622 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -46,7 +46,7 @@ jobs: # source-build builds run in Docker, including the default managed platform. pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: NetCore1ESPool-Internal diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index c85044a6849..21fd12276b6 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -28,7 +28,7 @@ jobs: ${{ if eq(parameters.pool, '') }}: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore-Public demands: ImageOverride -equals windows.vs2019.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: NetCore1ESPool-Internal From 919d0e7ef768a5522a771851955c0895e8d1aacf Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 1 Sep 2022 17:02:30 -0700 Subject: [PATCH 155/226] Fix 13805 (#13815) * Fix 13805 * Update src/Compiler/AbstractIL/ilwrite.fs Co-authored-by: Vlad Zarytovskii --- src/Compiler/AbstractIL/ilwrite.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 702fbd5eedb..983159604c2 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -4122,7 +4122,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe | Some AMD64 -> writeInt32AsUInt16 os 0x8664 // Machine - IMAGE_FILE_MACHINE_AMD64 | Some IA64 -> writeInt32AsUInt16 os 0x200 // Machine - IMAGE_FILE_MACHINE_IA64 | Some ARM64 -> writeInt32AsUInt16 os 0xaa64 // Machine - IMAGE_FILE_MACHINE_ARM64 - | Some ARM -> writeInt32AsUInt16 os 0x1c0 // Machine - IMAGE_FILE_MACHINE_ARM + | Some ARM -> writeInt32AsUInt16 os 0x1c4 // Machine - IMAGE_FILE_MACHINE_ARMNT | _ -> writeInt32AsUInt16 os 0x014c // Machine - IMAGE_FILE_MACHINE_I386 writeInt32AsUInt16 os numSections From e06e079ebfecc48db530351a1cbf48b93dfb2979 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Fri, 2 Sep 2022 15:37:37 +0200 Subject: [PATCH 156/226] Print empty namespace or module. (#13813) --- src/Compiler/Checking/NicePrint.fs | 18 +++++- src/Compiler/TypedTree/TypedTreeOps.fs | 32 +++++++++++ src/Compiler/TypedTree/TypedTreeOps.fsi | 6 ++ .../Signatures/ModuleOrNamespaceTests.fs | 55 +++++++++++++++++++ tests/fsharp/core/load-script/out.stdout.bsl | 4 +- .../core/printing/output.1000.stdout.bsl | 6 +- .../core/printing/output.200.stdout.bsl | 6 +- .../fsharp/core/printing/output.47.stdout.bsl | 8 ++- .../core/printing/output.multiemit.stdout.bsl | 8 ++- .../core/printing/output.off.stdout.bsl | 6 +- tests/fsharp/core/printing/output.stdout.bsl | 8 ++- 11 files changed, 146 insertions(+), 11 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 3913253a0e4..dab7a9efdfc 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -2420,7 +2420,23 @@ module InferredSigPrinting = modNameEqualsL @@* basic layoutXmlDoc denv true mspec.XmlDoc basicL - imdefL denv expr + let emptyModuleOrNamespace mspec = + let innerPath = (fullCompPathOfModuleOrNamespace mspec).AccessPath + let pathL = innerPath |> List.map (fst >> ConvertLogicalNameToDisplayLayout (tagNamespace >> wordL)) + + let keyword = + if not mspec.IsImplicitNamespace && mspec.IsNamespace then + "namespace" + else + "module" + + wordL (tagKeyword keyword) ^^ sepListL SepL.dot pathL + + match expr with + | EmptyModuleOrNamespaces mspecs -> + List.map emptyModuleOrNamespace mspecs + |> aboveListL + | expr -> imdefL denv expr //-------------------------------------------------------------------------- diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 608ca6e86e5..8228d5782b4 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10360,3 +10360,35 @@ let isFSharpExceptionTy g ty = | ValueSome tcref -> tcref.IsFSharpException | _ -> false +let (|EmptyModuleOrNamespaces|_|) (moduleOrNamespaceContents: ModuleOrNamespaceContents) = + match moduleOrNamespaceContents with + | TMDefs(defs = defs) -> + let mdDefsLength = + defs + |> List.count (function + | ModuleOrNamespaceContents.TMDefRec _ + | ModuleOrNamespaceContents.TMDefs _ -> true + | _ -> false) + + let emptyModuleOrNamespaces = + defs + |> List.choose (function + | ModuleOrNamespaceContents.TMDefRec _ as defRec + | ModuleOrNamespaceContents.TMDefs(defs = [ ModuleOrNamespaceContents.TMDefRec _ as defRec ]) -> + match defRec with + | TMDefRec(bindings = [ ModuleOrNamespaceBinding.Module(mspec, ModuleOrNamespaceContents.TMDefs(defs = defs)) ]) -> + defs + |> List.forall (function + | ModuleOrNamespaceContents.TMDefOpens _ + | ModuleOrNamespaceContents.TMDefDo _ + | ModuleOrNamespaceContents.TMDefRec (isRec = true; tycons = []; bindings = []) -> true + | _ -> false) + |> fun isEmpty -> if isEmpty then Some mspec else None + | _ -> None + | _ -> None) + + if mdDefsLength = emptyModuleOrNamespaces.Length then + Some emptyModuleOrNamespaces + else + None + | _ -> None diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 62f76df7e64..b674cd765f0 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2676,3 +2676,9 @@ type TraitConstraintInfo with /// Get the key associated with the member constraint. member GetWitnessInfo: unit -> TraitWitnessInfo + +/// Matches a ModuleOrNamespaceContents that is empty from a signature printing point of view. +/// Signatures printed via the typed tree in NicePrint don't print TMDefOpens or TMDefDo. +/// This will match anything that does not have any types or bindings. +val (|EmptyModuleOrNamespaces|_|): + moduleOrNamespaceContents: ModuleOrNamespaceContents -> (ModuleOrNamespace list) option diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs index abfb28b42e0..b01f99c4bf4 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs @@ -142,3 +142,58 @@ namespace Fantomas.Core val genExpr: e: FSharp.Compiler.Syntax.SynExpr -> ctx: Context.Context -> Context.Context val genLambdaArrowWithTrivia: bodyExpr: (FSharp.Compiler.Syntax.SynExpr -> Context.Context -> Context.Context) -> body: FSharp.Compiler.Syntax.SynExpr -> arrowRange: FSharp.Compiler.Text.Range option -> (Context.Context -> Context.Context)""" + +[] +let ``Empty namespace`` () = + FSharp + """ +namespace System + +open System.Runtime.CompilerServices + +[] + +do () +""" + |> printSignatures + |> should equal "namespace System" + +[] +let ``Empty module`` () = + FSharp + """ +module Foobar + +do () +""" + |> printSignatures + |> should equal "module Foobar" + +[] +let ``Two empty namespaces`` () = + FSharp + """ +namespace Foo + +do () + +namespace Bar + +do () +""" + |> printSignatures + |> prependNewline + |> should equal """ +namespace Foo +namespace Bar""" + +[] +let ``Empty namespace module`` () = + FSharp + """ +namespace rec Foobar + +do () +""" + |> printSignatures + |> should equal "namespace Foobar" diff --git a/tests/fsharp/core/load-script/out.stdout.bsl b/tests/fsharp/core/load-script/out.stdout.bsl index 0cbbd767c36..3651c81d195 100644 --- a/tests/fsharp/core/load-script/out.stdout.bsl +++ b/tests/fsharp/core/load-script/out.stdout.bsl @@ -16,7 +16,9 @@ World -the end Test 3================================================= -> [Loading D:\staging\staging\src\tests\fsharp\core\load-script\1.fsx +> module FSI_0001 + +[Loading D:\staging\staging\src\tests\fsharp\core\load-script\1.fsx Loading D:\staging\staging\src\tests\fsharp\core\load-script\2.fsx Loading D:\staging\staging\src\tests\fsharp\core\load-script\3.fsx] Hello diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index cdf91519c8d..b7d685cd23b 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1,4 +1,6 @@ +module FSI_0001 + > val it: unit = () > val repeatId: string = "A" @@ -234,7 +236,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0020 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index cb22322c94a..98b5d8efe31 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -1,4 +1,6 @@ +module FSI_0001 + > val it: unit = () > val repeatId: string = "A" @@ -129,7 +131,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0020 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index b6f38074b36..97426680947 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -1,5 +1,7 @@ -> val repeatId: string = "A" +> module FSI_0001 + +val repeatId: string = "A" > val repeatId: string = "B" @@ -249,7 +251,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0019 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 9183285f872..8c645cb52d1 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -1,5 +1,7 @@ -> val repeatId: string = "A" +> module FSI_0001 + +val repeatId: string = "A" > val repeatId: string = "B" @@ -249,7 +251,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0019 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 586d7a58860..b2d1f1f8e6a 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1,4 +1,6 @@ +module FSI_0001 + > val it: unit = () > val repeatId: string @@ -94,7 +96,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0020 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 9183285f872..8c645cb52d1 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -1,5 +1,7 @@ -> val repeatId: string = "A" +> module FSI_0001 + +val repeatId: string = "A" > val repeatId: string = "B" @@ -249,7 +251,9 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> > module D2 = +> module FSI_0019 + +> module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option From 5ede675191a92bebf141c014fff0d945074a7a42 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Sat, 3 Sep 2022 00:33:32 +0200 Subject: [PATCH 157/226] Fix net481 templates missing TFM (#13826) Co-authored-by: Kevin Ransom (msft) --- .../ConsoleProject/Template/ConsoleApplication.fsproj | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.fsproj | 2 +- .../ProjectTemplates/TutorialProject/Template/Tutorial.fsproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index ee7baed3960..3ae67f491ec 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -1,7 +1,7 @@ Exe -$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$ +$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$$if$ ($targetframeworkversion$ == 4.8.1) net481 $endif$ $if$ ($safeprojectname$ != $projectname$) $safeprojectname$ $endif$ 3390;$(WarnOn) diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index 736dff548d6..719360dbea3 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -1,6 +1,6 @@ -$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$ +$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$$if$ ($targetframeworkversion$ == 4.8.1) net481 $endif$ $if$ ($safeprojectname$ != $projectname$) $safeprojectname$ $endif$ true 3390;$(WarnOn) diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index 83103261b80..85ca52724a5 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -1,7 +1,7 @@ Exe -$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$ +$if$ ($targetframeworkversion$ == 4.5) net45$endif$$if$ ($targetframeworkversion$ == 4.6) net46 $endif$$if$ ($targetframeworkversion$ == 4.6.1) net461 $endif$$if$ ($targetframeworkversion$ == 4.6.2) net462 $endif$$if$ ($targetframeworkversion$ == 4.7) net47 $endif$$if$ ($targetframeworkversion$ == 4.7.1) net471 $endif$$if$ ($targetframeworkversion$ == 4.7.2) net472 $endif$$if$ ($targetframeworkversion$ == 4.8) net48 $endif$$if$ ($targetframeworkversion$ == 4.8.1) net481 $endif$ $if$ ($safeprojectname$ != $projectname$) $safeprojectname$ $endif$ 3390;$(WarnOn) From 753fc58b631d7a5f7f0b085d4a3adb3b4d47c7e6 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 5 Sep 2022 11:47:48 -0700 Subject: [PATCH 158/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1964393 (#13776) Co-authored-by: Vlad Zarytovskii --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 2 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 2097d93eac4..cc763d55072 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 11a26276634..c20b2d13891 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 98681bcd9b1..d6ca1d1e23c 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 5eba08a8603..2ebb357fcf4 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index b331fef5680..3dfb1f0f556 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index dcdf1edc9d2..8c5ded418ae 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index a88ab838892..a9e535db00c 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index f71dd1c78a7..56e0f52d752 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 615985563b5..0b5520e63da 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index d48f16b89f2..c99e2a7362d 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 5f9763a7403..a5b6a101582 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index e821d6299d1..5e186209732 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 852c5be20d8..33b9fde69ba 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. From 9b9c0fdcda18f689e0c8e93a4db915f51077b0cb Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Fri, 9 Sep 2022 00:17:59 +0200 Subject: [PATCH 159/226] Correct range for struct tuples. (#13840) Co-authored-by: Don Syme --- src/Compiler/SyntaxTree/ParseHelpers.fs | 4 +-- src/Compiler/SyntaxTree/ParseHelpers.fsi | 2 +- src/Compiler/pars.fsy | 14 ++++---- tests/service/SyntaxTreeTests/TypeTests.fs | 40 ++++++++++++++++++++++ 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 0440d019fa2..f3e3fcdfdaf 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -847,7 +847,7 @@ let adjustHatPrefixToTyparLookup mFull rightExpr = take rightExpr // The last element of elementTypes does not have a star or slash -let mkSynTypeTuple (isStruct: bool) (elementTypes: SynTupleTypeSegment list) : SynType = +let mkSynTypeTuple (elementTypes: SynTupleTypeSegment list) : SynType = let range = match elementTypes with | [] -> Range.Zero @@ -856,4 +856,4 @@ let mkSynTypeTuple (isStruct: bool) (elementTypes: SynTupleTypeSegment list) : S (head.Range, tail) ||> List.fold (fun acc segment -> unionRanges acc segment.Range) - SynType.Tuple(isStruct, elementTypes, range) + SynType.Tuple(false, elementTypes, range) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 1b321cd9302..e345dc68a3a 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -179,4 +179,4 @@ val mkSynMemberDefnGetSet: /// Incorporate a '^' for an qualified access to a generic type parameter val adjustHatPrefixToTyparLookup: mFull: range -> rightExpr: SynExpr -> SynExpr -val mkSynTypeTuple: isStruct: bool -> elementTypes: SynTupleTypeSegment list -> SynType +val mkSynTypeTuple: elementTypes: SynTupleTypeSegment list -> SynType diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 065172f640c..c0453c0c80c 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5064,7 +5064,7 @@ topTupleType: let mStar = rhs parseState 2 let path = SynTupleTypeSegment.Type t :: SynTupleTypeSegment.Star mStar :: (List.map fst $3) let mdata = argInfo :: (List.choose snd $3) - mkSynTypeTuple false path, mdata } + mkSynTypeTuple path, mdata } | topAppType { let ty, mdata = $1 in ty, [mdata] } @@ -5120,19 +5120,19 @@ tupleType: | appType STAR tupleOrQuotTypeElements { let mStar = rhs parseState 2 let path = SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Star mStar :: $3 - mkSynTypeTuple false path } + mkSynTypeTuple path } | INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $1 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); let mSlash = rhs parseState 1 let path = SynTupleTypeSegment.Slash mSlash :: $2 - mkSynTypeTuple false path } + mkSynTypeTuple path } | appType INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $2 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); let mSlash = rhs parseState 2 let path = SynTupleTypeSegment.Type $1 :: SynTupleTypeSegment.Slash mSlash :: $3 - mkSynTypeTuple false path } + mkSynTypeTuple path } | appType %prec prec_tuptyp_prefix { $1 } @@ -5284,13 +5284,15 @@ atomType: | STRUCT LPAREN appType STAR tupleOrQuotTypeElements rparen { let mStar = rhs parseState 4 let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5 - mkSynTypeTuple true path } + let m = rhs2 parseState 1 6 + SynType.Tuple(true, path, m) } | STRUCT LPAREN appType STAR tupleOrQuotTypeElements recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) let mStar = rhs parseState 4 let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5 - mkSynTypeTuple true path } + let m = rhs2 parseState 1 5 + SynType.Tuple(true, path, m) } | STRUCT LPAREN appType STAR recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) diff --git a/tests/service/SyntaxTreeTests/TypeTests.fs b/tests/service/SyntaxTreeTests/TypeTests.fs index b965d7e929e..c38e684ada3 100644 --- a/tests/service/SyntaxTreeTests/TypeTests.fs +++ b/tests/service/SyntaxTreeTests/TypeTests.fs @@ -484,3 +484,43 @@ let ``SynType.Fun has range of arrow`` () = ])) -> assertRange (2, 21) (2, 23) mArrow | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynType.Tuple with struct`` () = + let parseResults = + getParseResults + """ +let _: struct (int * int) = () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = + SynType.Tuple(true, [ SynTupleTypeSegment.Type _ ; SynTupleTypeSegment.Star _ ; SynTupleTypeSegment.Type _ ], mTuple)))) ]) + ]) + ]) + ) -> + assertRange (2, 7) (2, 25) mTuple + + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynType.Tuple with struct, recovery`` () = + let parseResults = + getParseResults + """ +let _: struct (int * int = () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = + SynType.Tuple(true, [ SynTupleTypeSegment.Type _ ; SynTupleTypeSegment.Star _ ; SynTupleTypeSegment.Type _ ], mTuple)))) ]) + ]) + ]) + ) -> + assertRange (2, 7) (2, 24) mTuple + + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" From 2b391ff2825397c0da925cfe7ad619054f245001 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 9 Sep 2022 02:17:39 +0200 Subject: [PATCH 160/226] Add name and depth fo the stackguard threads (#13859) Co-authored-by: Don Syme --- src/Compiler/AbstractIL/ilwritepdb.fs | 2 +- src/Compiler/Checking/CheckBasics.fs | 2 +- .../Checking/CheckIncrementalClasses.fs | 2 +- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 2 +- src/Compiler/Facilities/DiagnosticsLogger.fs | 4 ++-- src/Compiler/Facilities/DiagnosticsLogger.fsi | 2 +- src/Compiler/Optimize/DetupleArgs.fs | 2 +- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 2 +- src/Compiler/Optimize/LowerCalls.fs | 2 +- src/Compiler/Optimize/LowerLocalMutables.fs | 2 +- src/Compiler/Optimize/LowerStateMachines.fs | 2 +- src/Compiler/Optimize/Optimizer.fs | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 20 +++++++++---------- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 52fc97a9776..715987a2ad1 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -1037,6 +1037,6 @@ let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[] // adding the text " (shadowed)" to the names of those with name conflicts. let unshadowScopes rootScope = // Avoid stack overflow when writing linearly nested scopes - let stackGuard = StackGuard(100) + let stackGuard = StackGuard(100, "ILPdbWriter.unshadowScopes") let result, _ = pushShadowedLocals stackGuard [||] rootScope result diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index ee42b425a3d..e6fb4014376 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -341,7 +341,7 @@ type TcFileState = { g = g amap = amap recUses = ValMultiMap<_>.Empty - stackGuard = StackGuard(TcStackGuardDepth) + stackGuard = StackGuard(TcStackGuardDepth, "TcFileState") createsGeneratedProvidedTypes = false thisCcu = thisCcu isScript = isScript diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index c5418132b8d..c58414dfb00 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -527,7 +527,7 @@ type IncrClassReprInfo = PostTransform = (fun _ -> None) PreInterceptBinding = None RewriteQuotations = true - StackGuard = StackGuard(TcClassRewriteStackGuardDepth) } expr + StackGuard = StackGuard(TcClassRewriteStackGuardDepth, "FixupIncrClassExprPhase2C") } expr type IncrClassConstructionBindingsPhase2C = | Phase2CBindings of IncrClassBindingGroup list diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index 754a6215206..3a3b8c9de89 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -285,7 +285,7 @@ let UnsolvedTyparsOfModuleDef g amap denv mdef extraAttribs = amap=amap denv=denv unsolved = [] - stackGuard = StackGuard(FindUnsolvedStackGuardDepth) } + stackGuard = StackGuard(FindUnsolvedStackGuardDepth, "UnsolvedTyparsOfModuleDef") } accModuleOrNamespaceDef cenv NoEnv mdef accAttribs cenv NoEnv extraAttribs List.rev cenv.unsolved diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 031c5ae7991..41b4922a7d0 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2615,7 +2615,7 @@ let CheckImplFile (g, amap, reportErrors, infoReader, internalsVisibleToPaths, v reportErrors = reportErrors boundVals = Dictionary<_, _>(100, HashIdentity.Structural) limitVals = Dictionary<_, _>(100, HashIdentity.Structural) - stackGuard = StackGuard(PostInferenceChecksStackGuardDepth) + stackGuard = StackGuard(PostInferenceChecksStackGuardDepth, "CheckImplFile") potentialUnboundUsesOfVals = Map.empty anonRecdTypes = StampMap.Empty usesQuotations = false diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 19f6de28fd1..e83d70fd7f0 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -11863,7 +11863,7 @@ type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal: Constrai intraAssemblyInfo = intraAssemblyInfo optionsOpt = None optimizeDuringCodeGen = (fun _flag expr -> expr) - stackGuard = StackGuard(IlxGenStackGuardDepth) + stackGuard = StackGuard(IlxGenStackGuardDepth, "IlxAssemblyGenerator") } /// Register a set of referenced assemblies with the ILX code generator diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index aebfd1cfd6e..4c82c5f445a 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -813,7 +813,7 @@ let internal languageFeatureNotSupportedInLibraryError (langFeature: LanguageFea error (Error(FSComp.SR.chkFeatureNotSupportedInLibrary (featureStr, suggestedVersionStr), m)) /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached -type StackGuard(maxDepth: int) = +type StackGuard(maxDepth: int, name: string) = let mutable depth = 1 @@ -828,7 +828,7 @@ type StackGuard(maxDepth: int) = async { do! Async.SwitchToNewThread() - Thread.CurrentThread.Name <- "F# Extra Compilation Thread" + Thread.CurrentThread.Name <- $"F# Extra Compilation Thread for {name} (depth {depth})" use _scope = new CompilationGlobalsScope(diagnosticsLogger, buildPhase) return f () } diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index c4f0b226e16..c3af3a7da9d 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -389,7 +389,7 @@ val tryLanguageFeatureErrorOption: val languageFeatureNotSupportedInLibraryError: langFeature: LanguageFeature -> m: range -> 'T type StackGuard = - new: maxDepth: int -> StackGuard + new: maxDepth: int * name: string -> StackGuard /// Execute the new function, on a new thread if necessary member Guard: f: (unit -> 'T) -> 'T diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 4bdb5262a0f..dc2ea60f6e7 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -864,7 +864,7 @@ let passImplFile penv assembly = PreInterceptBinding = None PostTransform = postTransformExpr penv RewriteQuotations = false - StackGuard = StackGuard(DetupleRewriteStackGuardDepth) } + StackGuard = StackGuard(DetupleRewriteStackGuardDepth, "RewriteImplFile") } assembly |> RewriteImplFile rwenv //------------------------------------------------------------------------- diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index a4b3620b780..ed2097236fb 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -1366,7 +1366,7 @@ let MakeTopLevelRepresentationDecisions ccu g expr = recShortCallS = recShortCallS envPackM = envPackM fHatM = fHatM - stackGuard = StackGuard(InnerLambdasToTopLevelFunctionsStackGuardDepth) } + stackGuard = StackGuard(InnerLambdasToTopLevelFunctionsStackGuardDepth, "InnerLambdasToTopLevelFunctionsStackGuardDepth") } let z = Pass4_RewriteAssembly.rewriteState0 Pass4_RewriteAssembly.TransImplFile penv z expr diff --git a/src/Compiler/Optimize/LowerCalls.fs b/src/Compiler/Optimize/LowerCalls.fs index 5cf047f7e47..4fcbf9f36f1 100644 --- a/src/Compiler/Optimize/LowerCalls.fs +++ b/src/Compiler/Optimize/LowerCalls.fs @@ -49,5 +49,5 @@ let LowerImplFile g assembly = PreInterceptBinding=None PostTransform= (fun _ -> None) RewriteQuotations=false - StackGuard = StackGuard(LowerCallsRewriteStackGuardDepth) } + StackGuard = StackGuard(LowerCallsRewriteStackGuardDepth, "LowerCallsRewriteStackGuardDepth") } assembly |> RewriteImplFile rwenv diff --git a/src/Compiler/Optimize/LowerLocalMutables.fs b/src/Compiler/Optimize/LowerLocalMutables.fs index 320df36ce37..0899875242d 100644 --- a/src/Compiler/Optimize/LowerLocalMutables.fs +++ b/src/Compiler/Optimize/LowerLocalMutables.fs @@ -196,6 +196,6 @@ let TransformImplFile g amap implFile = PreInterceptBinding = Some(TransformBinding g heapValMap) PostTransform = (fun _ -> None) RewriteQuotations = true - StackGuard = StackGuard(AutoboxRewriteStackGuardDepth) } + StackGuard = StackGuard(AutoboxRewriteStackGuardDepth, "AutoboxRewriteStackGuardDepth") } diff --git a/src/Compiler/Optimize/LowerStateMachines.fs b/src/Compiler/Optimize/LowerStateMachines.fs index 31972252340..0f36b0db0e0 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fs +++ b/src/Compiler/Optimize/LowerStateMachines.fs @@ -358,7 +358,7 @@ type LowerStateMachine(g: TcGlobals) = PostTransform = (fun _ -> None) PreInterceptBinding = None RewriteQuotations=true - StackGuard = StackGuard(LowerStateMachineStackGuardDepth) } + StackGuard = StackGuard(LowerStateMachineStackGuardDepth, "LowerStateMachineStackGuardDepth") } let ConvertStateMachineLeafExpression (env: env) expr = if sm_verbose then printfn "ConvertStateMachineLeafExpression for %A..." expr diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 62e8078e8cb..fa965069205 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -4325,7 +4325,7 @@ let OptimizeImplFile (settings, ccu, tcGlobals, tcVal, importMap, optEnv, isIncr localInternalVals=Dictionary(10000) emitTailcalls=emitTailcalls casApplied=Dictionary() - stackGuard = StackGuard(OptimizerStackGuardDepth) + stackGuard = StackGuard(OptimizerStackGuardDepth, "OptimizerStackGuardDepth") } let env, _, _, _ as results = OptimizeImplFileInternal cenv optEnv isIncrementalFragment fsiMultiAssemblyEmit hidden mimpls diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 8228d5782b4..b27b273160f 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -2209,7 +2209,7 @@ let CollectTypars = CollectTyparsAndLocals let CollectLocals = CollectTyparsAndLocals let CollectTyparsAndLocalsWithStackGuard() = - let stackGuard = StackGuard(AccFreeVarsStackGuardDepth) + let stackGuard = StackGuard(AccFreeVarsStackGuardDepth, "AccFreeVarsStackGuardDepth") CollectTyparsAndLocalsImpl (Some stackGuard) let CollectLocalsWithStackGuard() = CollectTyparsAndLocalsWithStackGuard() @@ -6248,31 +6248,31 @@ and remapImplFile ctxt compgen tmenv implFile = // Entry points let remapAttrib g tmenv attrib = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapAttribImpl ctxt tmenv attrib let remapExpr g (compgen: ValCopyFlag) (tmenv: Remap) expr = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt compgen tmenv expr let remapPossibleForallTy g tmenv ty = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapPossibleForallTyImpl ctxt tmenv ty let copyModuleOrNamespaceType g compgen mtyp = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } copyAndRemapAndBindModTy ctxt compgen Remap.Empty mtyp |> fst let copyExpr g compgen e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt compgen Remap.Empty e let copyImplFile g compgen e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapImplFile ctxt compgen Remap.Empty e |> fst let instExpr g tpinst e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt CloneAll (mkInstRemap tpinst) e //-------------------------------------------------------------------------- @@ -7162,7 +7162,7 @@ let ExprFolder0 = type ExprFolders<'State> (folders: ExprFolder<'State>) = let mutable exprFClosure = Unchecked.defaultof<'State -> Expr -> 'State> // prevent reallocation of closure let mutable exprNoInterceptFClosure = Unchecked.defaultof<'State -> Expr -> 'State> // prevent reallocation of closure - let stackGuard = StackGuard(FoldExprStackGuardDepth) + let stackGuard = StackGuard(FoldExprStackGuardDepth, "FoldExprStackGuardDepth") let rec exprsF z xs = List.fold exprFClosure z xs @@ -9493,7 +9493,7 @@ and remapValToNonLocal ctxt tmenv inp = inp |> Construct.NewModifiedVal (remapValData ctxt tmenv) let ApplyExportRemappingToEntity g tmenv x = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapTyconToNonLocal ctxt tmenv x (* Which constraints actually get compiled to .NET constraints? *) From 2c3ff6d126964477c7dfdd8b6f86992b96294bc1 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 9 Sep 2022 19:50:13 +0100 Subject: [PATCH 161/226] fix 12761 (#13865) --- src/Compiler/CodeGen/IlxGen.fs | 8 ++- src/Compiler/TypedTree/TypedTreeOps.fs | 19 ++++- src/Compiler/TypedTree/TypedTreeOps.fsi | 7 +- .../Microsoft.FSharp.Control/Tasks.fs | 69 +++++++++++++++++++ 4 files changed, 99 insertions(+), 4 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index e83d70fd7f0..b886bab1a0d 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -6804,7 +6804,13 @@ and GetIlxClosureFreeVars cenv m (thisVars: ValRef list) boxity eenvouter takenN NestedTypeRefForCompLoc eenvouter.cloc cloName // Collect the free variables of the closure - let cloFreeVarResults = freeInExpr (CollectTyparsAndLocalsWithStackGuard()) expr + let cloFreeVarResults = + let opts = CollectTyparsAndLocalsWithStackGuard() + let opts = + match eenvouter.tyenv.TemplateReplacement with + | None -> opts + | Some (tcref, _, typars, _) -> opts.WithTemplateReplacement(tyconRefEq g tcref, typars) + freeInExpr opts expr // Partition the free variables when some can be accessed from places besides the immediate environment // Also filter out the current value being bound, if any, as it is available from the "this" diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index b27b273160f..7842afdc105 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -2133,7 +2133,10 @@ type FreeVarOptions = includeRecdFields: bool includeUnionCases: bool includeLocals: bool + templateReplacement: ((TyconRef -> bool) * Typars) option stackGuard: StackGuard option } + + member this.WithTemplateReplacement(f, typars) = { this with templateReplacement = Some (f, typars) } let CollectAllNoCaching = { canCache = false @@ -2144,6 +2147,7 @@ let CollectAllNoCaching = includeUnionCases = true includeTypars = true includeLocals = true + templateReplacement = None stackGuard = None} let CollectTyparsNoCaching = @@ -2155,6 +2159,7 @@ let CollectTyparsNoCaching = includeRecdFields = false includeUnionCases = false includeLocals = false + templateReplacement = None stackGuard = None } let CollectLocalsNoCaching = @@ -2166,6 +2171,7 @@ let CollectLocalsNoCaching = includeRecdFields = false includeUnionCases = false includeLocals = true + templateReplacement = None stackGuard = None } let CollectTyparsAndLocalsNoCaching = @@ -2177,6 +2183,7 @@ let CollectTyparsAndLocalsNoCaching = includeUnionCases = false includeTypars = true includeLocals = true + templateReplacement = None stackGuard = None } let CollectAll = @@ -2188,6 +2195,7 @@ let CollectAll = includeUnionCases = true includeTypars = true includeLocals = true + templateReplacement = None stackGuard = None } let CollectTyparsAndLocalsImpl stackGuardOpt = // CollectAll @@ -2199,6 +2207,7 @@ let CollectTyparsAndLocalsImpl stackGuardOpt = // CollectAll includeLocalTyconReprs = false includeRecdFields = false includeUnionCases = false + templateReplacement = None stackGuard = stackGuardOpt } @@ -2219,12 +2228,18 @@ let accFreeLocalTycon opts x acc = if Zset.contains x acc.FreeTycons then acc else { acc with FreeTycons = Zset.add x acc.FreeTycons } -let accFreeTycon opts (tcref: TyconRef) acc = +let rec accFreeTycon opts (tcref: TyconRef) acc = + let acc = + match opts.templateReplacement with + | Some (isTemplateTyconRef, cloFreeTyvars) when isTemplateTyconRef tcref -> + let cloInst = List.map mkTyparTy cloFreeTyvars + accFreeInTypes opts cloInst acc + | _ -> acc if not opts.includeLocalTycons then acc elif tcref.IsLocalRef then accFreeLocalTycon opts tcref.ResolvedTarget acc else acc -let rec boundTypars opts tps acc = +and boundTypars opts tps acc = // Bound type vars form a recursively-referential set due to constraints, e.g. A: I, B: I // So collect up free vars in all constraints first, then bind all variables let acc = List.foldBack (fun (tp: Typar) acc -> accFreeInTyparConstraints opts tp.Constraints acc) tps acc diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index b674cd765f0..2c6ce527458 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -796,7 +796,12 @@ val emptyFreeLocals: FreeLocals val unionFreeLocals: FreeLocals -> FreeLocals -> FreeLocals -type FreeVarOptions +/// Represents the options to activate when collecting free variables +[] +type FreeVarOptions = + /// During backend code generation of state machines, register a template replacement for struct types. + /// This may introduce new free variables related to the instantiation of the struct type. + member WithTemplateReplacement: (TyconRef -> bool) * Typars -> FreeVarOptions val CollectLocalsNoCaching: FreeVarOptions diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs index bf6c8cc1e14..4af1df56d39 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs @@ -1259,6 +1259,75 @@ type BasicsNotInParallel() = require ran "never ran") taskOuter.Wait() + [] + member _.testGenericBackgroundTasks() = + printfn "Running testBackgroundTask..." + for i in 1 .. 5 do + let mutable ran = false + let mutable posted = false + let oldSyncContext = SynchronizationContext.Current + let syncContext = { new SynchronizationContext() with member _.Post(d,state) = posted <- true; d.Invoke(state) } + try + SynchronizationContext.SetSynchronizationContext syncContext + let f (result: 'T ref) (x: 'T) = + backgroundTask { + require (System.Threading.Thread.CurrentThread.IsThreadPoolThread) "expect to be on background thread" + ran <- true + result.Value <- x + } + let t = f (ref "") "hello" + t.Wait() + let t2 = f (ref 1) 1 + t2.Wait() + require ran "never ran" + require (not posted) "did not expect post to sync context" + finally + SynchronizationContext.SetSynchronizationContext oldSyncContext + + +/// https://github.com/dotnet/fsharp/issues/12761 +module Test12761A = + + type Dto = { + DtoValue : string + Key : string + } + + type MyGenericType<'Key,'Value> = { + Value : 'Value + Key : 'Key + } + + type ProblematicType<'Key, 'Value, 'Dto, 'E>( fromDto : 'Dto -> Result,'E> ) = + let myTask = + backgroundTask { + let dto = """{"DtoValue":"1","Key":"key1"}""" |> box |> unbox<'Dto> + return fromDto dto |> printfn "%A" + } + member __.ContainsKey = fun (key: 'Key) -> true + + + type MyType = MyGenericType + + module MyType = + let fromDto (dto: Dto) = + try + { + Value = int dto.DtoValue + Key = dto.Key + } + |> Ok + with | e -> Error e + + +/// https://github.com/dotnet/fsharp/issues/12761 +module Test12761B = + let TestFunction<'Dto>() = + backgroundTask { + let dto = Unchecked.defaultof<'Dto> + System.Console.WriteLine(dto) + } + type Issue12184() = member this.TaskMethod() = task { From 5a5c0753246c5d45a3cb3cc4d637189cb9c4d60d Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Sat, 10 Sep 2022 21:25:01 -0700 Subject: [PATCH 162/226] Add name and depth fo the stackguard threads (#13859) (#13868) Co-authored-by: Don Syme Co-authored-by: Vlad Zarytovskii Co-authored-by: Don Syme Co-authored-by: Kevin Ransom (msft) --- src/Compiler/AbstractIL/ilwritepdb.fs | 2 +- src/Compiler/Checking/CheckBasics.fs | 2 +- .../Checking/CheckIncrementalClasses.fs | 2 +- src/Compiler/Checking/FindUnsolved.fs | 2 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 2 +- src/Compiler/Facilities/DiagnosticsLogger.fs | 4 ++-- src/Compiler/Facilities/DiagnosticsLogger.fsi | 2 +- src/Compiler/Optimize/DetupleArgs.fs | 2 +- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 2 +- src/Compiler/Optimize/LowerCalls.fs | 2 +- src/Compiler/Optimize/LowerLocalMutables.fs | 2 +- src/Compiler/Optimize/LowerStateMachines.fs | 2 +- src/Compiler/Optimize/Optimizer.fs | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 20 +++++++++---------- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 52fc97a9776..715987a2ad1 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -1037,6 +1037,6 @@ let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[] // adding the text " (shadowed)" to the names of those with name conflicts. let unshadowScopes rootScope = // Avoid stack overflow when writing linearly nested scopes - let stackGuard = StackGuard(100) + let stackGuard = StackGuard(100, "ILPdbWriter.unshadowScopes") let result, _ = pushShadowedLocals stackGuard [||] rootScope result diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index ee42b425a3d..e6fb4014376 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -341,7 +341,7 @@ type TcFileState = { g = g amap = amap recUses = ValMultiMap<_>.Empty - stackGuard = StackGuard(TcStackGuardDepth) + stackGuard = StackGuard(TcStackGuardDepth, "TcFileState") createsGeneratedProvidedTypes = false thisCcu = thisCcu isScript = isScript diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index c5418132b8d..c58414dfb00 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -527,7 +527,7 @@ type IncrClassReprInfo = PostTransform = (fun _ -> None) PreInterceptBinding = None RewriteQuotations = true - StackGuard = StackGuard(TcClassRewriteStackGuardDepth) } expr + StackGuard = StackGuard(TcClassRewriteStackGuardDepth, "FixupIncrClassExprPhase2C") } expr type IncrClassConstructionBindingsPhase2C = | Phase2CBindings of IncrClassBindingGroup list diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index 754a6215206..3a3b8c9de89 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -285,7 +285,7 @@ let UnsolvedTyparsOfModuleDef g amap denv mdef extraAttribs = amap=amap denv=denv unsolved = [] - stackGuard = StackGuard(FindUnsolvedStackGuardDepth) } + stackGuard = StackGuard(FindUnsolvedStackGuardDepth, "UnsolvedTyparsOfModuleDef") } accModuleOrNamespaceDef cenv NoEnv mdef accAttribs cenv NoEnv extraAttribs List.rev cenv.unsolved diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 031c5ae7991..41b4922a7d0 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2615,7 +2615,7 @@ let CheckImplFile (g, amap, reportErrors, infoReader, internalsVisibleToPaths, v reportErrors = reportErrors boundVals = Dictionary<_, _>(100, HashIdentity.Structural) limitVals = Dictionary<_, _>(100, HashIdentity.Structural) - stackGuard = StackGuard(PostInferenceChecksStackGuardDepth) + stackGuard = StackGuard(PostInferenceChecksStackGuardDepth, "CheckImplFile") potentialUnboundUsesOfVals = Map.empty anonRecdTypes = StampMap.Empty usesQuotations = false diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 19f6de28fd1..e83d70fd7f0 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -11863,7 +11863,7 @@ type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal: Constrai intraAssemblyInfo = intraAssemblyInfo optionsOpt = None optimizeDuringCodeGen = (fun _flag expr -> expr) - stackGuard = StackGuard(IlxGenStackGuardDepth) + stackGuard = StackGuard(IlxGenStackGuardDepth, "IlxAssemblyGenerator") } /// Register a set of referenced assemblies with the ILX code generator diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index aebfd1cfd6e..4c82c5f445a 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -813,7 +813,7 @@ let internal languageFeatureNotSupportedInLibraryError (langFeature: LanguageFea error (Error(FSComp.SR.chkFeatureNotSupportedInLibrary (featureStr, suggestedVersionStr), m)) /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached -type StackGuard(maxDepth: int) = +type StackGuard(maxDepth: int, name: string) = let mutable depth = 1 @@ -828,7 +828,7 @@ type StackGuard(maxDepth: int) = async { do! Async.SwitchToNewThread() - Thread.CurrentThread.Name <- "F# Extra Compilation Thread" + Thread.CurrentThread.Name <- $"F# Extra Compilation Thread for {name} (depth {depth})" use _scope = new CompilationGlobalsScope(diagnosticsLogger, buildPhase) return f () } diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index c4f0b226e16..c3af3a7da9d 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -389,7 +389,7 @@ val tryLanguageFeatureErrorOption: val languageFeatureNotSupportedInLibraryError: langFeature: LanguageFeature -> m: range -> 'T type StackGuard = - new: maxDepth: int -> StackGuard + new: maxDepth: int * name: string -> StackGuard /// Execute the new function, on a new thread if necessary member Guard: f: (unit -> 'T) -> 'T diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 4bdb5262a0f..dc2ea60f6e7 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -864,7 +864,7 @@ let passImplFile penv assembly = PreInterceptBinding = None PostTransform = postTransformExpr penv RewriteQuotations = false - StackGuard = StackGuard(DetupleRewriteStackGuardDepth) } + StackGuard = StackGuard(DetupleRewriteStackGuardDepth, "RewriteImplFile") } assembly |> RewriteImplFile rwenv //------------------------------------------------------------------------- diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index a4b3620b780..ed2097236fb 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -1366,7 +1366,7 @@ let MakeTopLevelRepresentationDecisions ccu g expr = recShortCallS = recShortCallS envPackM = envPackM fHatM = fHatM - stackGuard = StackGuard(InnerLambdasToTopLevelFunctionsStackGuardDepth) } + stackGuard = StackGuard(InnerLambdasToTopLevelFunctionsStackGuardDepth, "InnerLambdasToTopLevelFunctionsStackGuardDepth") } let z = Pass4_RewriteAssembly.rewriteState0 Pass4_RewriteAssembly.TransImplFile penv z expr diff --git a/src/Compiler/Optimize/LowerCalls.fs b/src/Compiler/Optimize/LowerCalls.fs index 5cf047f7e47..4fcbf9f36f1 100644 --- a/src/Compiler/Optimize/LowerCalls.fs +++ b/src/Compiler/Optimize/LowerCalls.fs @@ -49,5 +49,5 @@ let LowerImplFile g assembly = PreInterceptBinding=None PostTransform= (fun _ -> None) RewriteQuotations=false - StackGuard = StackGuard(LowerCallsRewriteStackGuardDepth) } + StackGuard = StackGuard(LowerCallsRewriteStackGuardDepth, "LowerCallsRewriteStackGuardDepth") } assembly |> RewriteImplFile rwenv diff --git a/src/Compiler/Optimize/LowerLocalMutables.fs b/src/Compiler/Optimize/LowerLocalMutables.fs index 320df36ce37..0899875242d 100644 --- a/src/Compiler/Optimize/LowerLocalMutables.fs +++ b/src/Compiler/Optimize/LowerLocalMutables.fs @@ -196,6 +196,6 @@ let TransformImplFile g amap implFile = PreInterceptBinding = Some(TransformBinding g heapValMap) PostTransform = (fun _ -> None) RewriteQuotations = true - StackGuard = StackGuard(AutoboxRewriteStackGuardDepth) } + StackGuard = StackGuard(AutoboxRewriteStackGuardDepth, "AutoboxRewriteStackGuardDepth") } diff --git a/src/Compiler/Optimize/LowerStateMachines.fs b/src/Compiler/Optimize/LowerStateMachines.fs index 31972252340..0f36b0db0e0 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fs +++ b/src/Compiler/Optimize/LowerStateMachines.fs @@ -358,7 +358,7 @@ type LowerStateMachine(g: TcGlobals) = PostTransform = (fun _ -> None) PreInterceptBinding = None RewriteQuotations=true - StackGuard = StackGuard(LowerStateMachineStackGuardDepth) } + StackGuard = StackGuard(LowerStateMachineStackGuardDepth, "LowerStateMachineStackGuardDepth") } let ConvertStateMachineLeafExpression (env: env) expr = if sm_verbose then printfn "ConvertStateMachineLeafExpression for %A..." expr diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 62e8078e8cb..fa965069205 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -4325,7 +4325,7 @@ let OptimizeImplFile (settings, ccu, tcGlobals, tcVal, importMap, optEnv, isIncr localInternalVals=Dictionary(10000) emitTailcalls=emitTailcalls casApplied=Dictionary() - stackGuard = StackGuard(OptimizerStackGuardDepth) + stackGuard = StackGuard(OptimizerStackGuardDepth, "OptimizerStackGuardDepth") } let env, _, _, _ as results = OptimizeImplFileInternal cenv optEnv isIncrementalFragment fsiMultiAssemblyEmit hidden mimpls diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 8228d5782b4..b27b273160f 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -2209,7 +2209,7 @@ let CollectTypars = CollectTyparsAndLocals let CollectLocals = CollectTyparsAndLocals let CollectTyparsAndLocalsWithStackGuard() = - let stackGuard = StackGuard(AccFreeVarsStackGuardDepth) + let stackGuard = StackGuard(AccFreeVarsStackGuardDepth, "AccFreeVarsStackGuardDepth") CollectTyparsAndLocalsImpl (Some stackGuard) let CollectLocalsWithStackGuard() = CollectTyparsAndLocalsWithStackGuard() @@ -6248,31 +6248,31 @@ and remapImplFile ctxt compgen tmenv implFile = // Entry points let remapAttrib g tmenv attrib = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapAttribImpl ctxt tmenv attrib let remapExpr g (compgen: ValCopyFlag) (tmenv: Remap) expr = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt compgen tmenv expr let remapPossibleForallTy g tmenv ty = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapPossibleForallTyImpl ctxt tmenv ty let copyModuleOrNamespaceType g compgen mtyp = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } copyAndRemapAndBindModTy ctxt compgen Remap.Empty mtyp |> fst let copyExpr g compgen e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt compgen Remap.Empty e let copyImplFile g compgen e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapImplFile ctxt compgen Remap.Empty e |> fst let instExpr g tpinst e = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapExprImpl ctxt CloneAll (mkInstRemap tpinst) e //-------------------------------------------------------------------------- @@ -7162,7 +7162,7 @@ let ExprFolder0 = type ExprFolders<'State> (folders: ExprFolder<'State>) = let mutable exprFClosure = Unchecked.defaultof<'State -> Expr -> 'State> // prevent reallocation of closure let mutable exprNoInterceptFClosure = Unchecked.defaultof<'State -> Expr -> 'State> // prevent reallocation of closure - let stackGuard = StackGuard(FoldExprStackGuardDepth) + let stackGuard = StackGuard(FoldExprStackGuardDepth, "FoldExprStackGuardDepth") let rec exprsF z xs = List.fold exprFClosure z xs @@ -9493,7 +9493,7 @@ and remapValToNonLocal ctxt tmenv inp = inp |> Construct.NewModifiedVal (remapValData ctxt tmenv) let ApplyExportRemappingToEntity g tmenv x = - let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth) } + let ctxt = { g = g; stackGuard = StackGuard(RemapExprStackGuardDepth, "RemapExprStackGuardDepth") } remapTyconToNonLocal ctxt tmenv x (* Which constraints actually get compiled to .NET constraints? *) From e2782fdbdb42a8c690c975c4767aa1fc9c0765c1 Mon Sep 17 00:00:00 2001 From: Thomas Boby Date: Sun, 11 Sep 2022 17:33:33 +0100 Subject: [PATCH 163/226] Mention the `DotnetFscCompilerPath` property (#13874) The very useful `DotnetFscCompilerPath` property doesn't seem to be documented anywhere. I'm not sure if there's an authoritative location for .fsproj properties, but it might be useful to mention this property in the DEVGUIDE. --- DEVGUIDE.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 65b7ea50728..2f7d899e329 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -121,6 +121,18 @@ You can find all test options as separate flags. For example `build -testAll`: Running any of the above will build the latest changes and run tests against them. +## Using your custom compiler to build other projects + +Building the compiler using `build.cmd` or `build.sh` will output artifacts in `artifacts\bin`. + +To use your custom build of `Fsc`, add the `DotnetFscCompilerPath` property to your project's `.fsproj` file, adjusted to point at your local build directory, build configuration, and target framework as appropriate: + +```xml + + D:\Git\fsharp\artifacts\bin\fsc\Debug\net7.0\fsc.dll + +``` + ## Updating FSComp.fs, FSComp.resx and XLF If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running From 1ddc9b2f1e97a69cc63ddff12a186c32858916e8 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 12 Sep 2022 05:31:47 -0700 Subject: [PATCH 164/226] More parser tweaks, to restore compatibility (#13873) Co-authored-by: Petr --- src/Compiler/CodeGen/IlxGen.fs | 2 + src/Compiler/Driver/CompilerOptions.fs | 98 +++++++++++-------- src/Compiler/Driver/CompilerOptions.fsi | 2 + src/Compiler/FSComp.txt | 3 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.de.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.es.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.fr.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.it.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.ja.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.ko.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.pl.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.ru.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.tr.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 15 ++- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 15 ++- .../ConsoleOnlyOptionsTests.fs | 13 ++- .../expected-help-output.bsl | 8 +- .../fsc/help/help40.437.1033.bsl | 8 +- .../fsi/exename/help40.437.1033.bsl | 8 +- .../fsi/help/help40-nologo.437.1033.bsl | 8 +- .../fsi/help/help40.437.1033.bsl | 8 +- 23 files changed, 223 insertions(+), 130 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index b886bab1a0d..4064cdd1896 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -6806,10 +6806,12 @@ and GetIlxClosureFreeVars cenv m (thisVars: ValRef list) boxity eenvouter takenN // Collect the free variables of the closure let cloFreeVarResults = let opts = CollectTyparsAndLocalsWithStackGuard() + let opts = match eenvouter.tyenv.TemplateReplacement with | None -> opts | Some (tcref, _, typars, _) -> opts.WithTemplateReplacement(tyconRefEq g tcref, typars) + freeInExpr opts expr // Partition the free variables when some can be accessed from places besides the immediate environment diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index e75a449c9e2..e5265efe849 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -261,31 +261,40 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler let specs = List.collect GetOptionsOfBlock blocks - // returns a tuple - the option token, the option argument string - let parseOption (s: string) = - // grab the option token - let opts = s.Split([| ':' |]) - let mutable opt = opts[0] - - if opt = "" then - () - // if it doesn't start with a '-' or '/', reject outright - elif opt[0] <> '-' && opt[0] <> '/' then - opt <- "" - elif opt <> "--" then - // is it an abbreviated or MSFT-style option? - // if so, strip the first character and move on with your life - if opt.Length = 2 || isSlashOpt opt then - opt <- opt[1..] - // else, it should be a non-abbreviated option starting with "--" - elif opt.Length > 3 && opt.StartsWithOrdinal("--") then - opt <- opt[2..] + // returns a tuple - the option minus switchchars, the option tokenand the option argument string + let parseOption (option: string) = + + // Get option arguments, I.e everything following first: + let opts = option.Split([| ':' |]) + let optArgs = String.Join(":", opts[1..]) + + let opt = + if option = "" then + "" + // if it doesn't start with a '-' or '/', reject outright + elif option[0] <> '-' && option[0] <> '/' then + "" + elif option <> "--" then + // is it an abbreviated or MSFT-style option? + // if so, strip the first character and move on with your life + // Wierdly a -- option can't have only a 1 character name + if option.Length = 2 || isSlashOpt option then + option[1..] + elif option.Length >= 3 && option[2] = ':' then + option[1..] + elif option.StartsWithOrdinal("--") then + match option.Length with + | l when l >= 4 && option[3] = ':' -> "" + | l when l > 3 -> option[2..] + | _ -> "" + else + "" else - opt <- "" + option - // get the argument string - let optArgs = if opts.Length > 1 then String.Join(":", opts[1..]) else "" - opt, optArgs + // grab the option token + let token = opt.Split([| ':' |])[0] + opt, token, optArgs let getOptionArg compilerOption (argString: string) = if argString = "" then @@ -352,7 +361,7 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler processArg (responseFileOptions @ t) | opt :: t -> - let optToken, argString = parseOption opt + let option, optToken, argString = parseOption opt let reportDeprecatedOption errOpt = match errOpt with @@ -361,7 +370,7 @@ let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: Compiler let rec attempt l = match l with - | CompilerOption (s, _, OptionConsoleOnly f, d, _) :: _ when optToken = s && argString = "" -> + | CompilerOption (s, _, OptionConsoleOnly f, d, _) :: _ when option = s -> reportDeprecatedOption d f blocks t @@ -710,7 +719,7 @@ let tagAlgorithm = "{SHA1|SHA256}" let tagInt = "" let tagPathMap = "" let tagNone = "" -let tagLangVersionValues = "{?|version|latest|preview}" +let tagLangVersionValues = "{version|latest|preview}" // PrintOptionInfo //---------------- @@ -1104,23 +1113,16 @@ let mlCompatibilityFlag (tcConfigB: TcConfigBuilder) = Some(FSComp.SR.optsMlcompatibility ()) ) -/// LanguageVersion management -let setLanguageVersion specifiedVersion = - - let dumpAllowedValues () = - printfn "%s" (FSComp.SR.optsSupportedLangVersions ()) - - for v in LanguageVersion.ValidOptions do - printfn "%s" v - - for v in LanguageVersion.ValidVersions do - printfn "%s" v - - exit 0 +let GetLanguageVersions () = + seq { + FSComp.SR.optsSupportedLangVersions () + yield! LanguageVersion.ValidOptions + yield! LanguageVersion.ValidVersions + } + |> String.concat Environment.NewLine - if specifiedVersion = "?" then - dumpAllowedValues () - elif specifiedVersion.ToUpperInvariant() = "PREVIEW" then +let setLanguageVersion (specifiedVersion: string) = + if specifiedVersion.ToUpperInvariant() = "PREVIEW" then () elif not (LanguageVersion.ContainsVersion specifiedVersion) then error (Error(FSComp.SR.optsUnrecognizedLanguageVersion specifiedVersion, rangeCmdArgs)) @@ -1130,6 +1132,16 @@ let setLanguageVersion specifiedVersion = let languageFlags tcConfigB = [ // -langversion:? Display the allowed values for language version + CompilerOption( + "langversion:?", + tagNone, + OptionConsoleOnly(fun _ -> + Console.Write(GetLanguageVersions()) + exit 0), + None, + Some(FSComp.SR.optsGetLangVersions ()) + ) + // -langversion: Specify language version such as // 'default' (latest major version), or // 'latest' (latest version, including minor versions), @@ -1140,7 +1152,7 @@ let languageFlags tcConfigB = tagLangVersionValues, OptionString(fun switch -> tcConfigB.langVersion <- setLanguageVersion (switch)), None, - Some(FSComp.SR.optsLangVersion ()) + Some(FSComp.SR.optsSetLangVersion ()) ) CompilerOption( diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index 8164393eac4..0915d999032 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -58,6 +58,8 @@ val GetHelpFsc: tcConfigB: TcConfigBuilder -> blocks: CompilerOptionBlock list - val GetVersion: tcConfigB: TcConfigBuilder -> string +val GetLanguageVersions: unit -> string + val GetCoreFscCompilerOptions: TcConfigBuilder -> CompilerOptionBlock list val GetCoreFsiCompilerOptions: TcConfigBuilder -> CompilerOptionBlock list diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index fa4610bd00b..64f0876b61d 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1523,7 +1523,8 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3353,chkFeatureNotSupportedInLibrary,"Feature '%s' requires the F# library for language version %s or greater." 3360,parsEqualsMissingInTypeDefinition,"Unexpected token in type definition. Expected '=' after the type '%s'." useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)." -optsLangVersion,"Display the allowed values for language version, specify language version such as 'latest' or 'preview'" +optsGetLangVersions,"Display the allowed values for language version." +optsSetLangVersion,"Specify language version such as 'latest' or 'preview'." optsSupportedLangVersions,"Supported language versions:" nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format." nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 2097d93eac4..8a1853a380f 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Neplatné použití generování referenčního sestavení, nepoužívejte --staticlink ani --refonly a --refout společně. @@ -487,11 +492,6 @@ Neplatná cesta k referenčnímu sestavení - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Zobrazte si povolené hodnoty verze jazyka a pak zadejte požadovanou verzi, například latest nebo preview. - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 11a26276634..e96c8e1d3b2 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht "--staticlink" oder "--refonly" und "--refout" zusammen. @@ -487,11 +492,6 @@ Ungültiger Referenzassemblypfad" - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Zeigen Sie die zulässigen Werte für die Sprachversion an. Geben Sie die Sprachversion als "latest" oder "preview" an. - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 98681bcd9b1..8c034062331 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso no válido de emitir un ensamblado de referencia, no use "--staticlink', or '--refonly' and '--refout" de forma conjunta. @@ -487,11 +492,6 @@ Ruta de acceso de ensamblado de referencia no válida - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Mostrar los valores permitidos para la versión de idioma, especificar la versión de idioma como "latest" "preview" - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 5eba08a8603..ab6345e8e0c 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilisation non valide de l’émission d’un assembly de référence. N’utilisez pas '--staticlink' ni '--refonly' et '--refout' ensemble. @@ -487,11 +492,6 @@ Chemin d'assemblage de référence non valide' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Afficher les valeurs autorisées pour la version du langage, spécifier la version du langage comme 'dernière' ou 'préversion' - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index b331fef5680..85a4a4cd333 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--staticlink' o '--refonly' e '--refout'. @@ -487,11 +492,6 @@ Percorso assembly di riferimento non valido' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Visualizza i valori consentiti per la versione del linguaggio. Specificare la versione del linguaggio, ad esempio 'latest' o 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index dcdf1edc9d2..1a49a44350e 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 参照アセンブリの生成の使用が無効です。'--staticlink'、または '--refonly' と '--refout' を同時に使用しないでください。 @@ -487,11 +492,6 @@ 参照アセンブリ パスが無効です' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - 言語バージョンで許可された値を表示し、'最新' や 'プレビュー' などの言語バージョンを指定する - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index a88ab838892..1a4cb6964d8 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 참조 어셈블리 내보내기를 잘못 사용했습니다. '--staticlink' 또는 '--refonly' 및 '--refout'을 함께 사용하지 마세요. @@ -487,11 +492,6 @@ 잘못된 참조 어셈블리 경로' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - 언어 버전의 허용된 값을 표시하고 '최신' 또는 '미리 보기'와 같은 언어 버전을 지정합니다. - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index f71dd1c78a7..1cc8dfb88f1 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Nieprawidłowe użycie emitowania zestawu odwołania, nie używaj razem elementów „--staticlink” ani „--refonly” i „--refout”. @@ -487,11 +492,6 @@ Nieprawidłowa ścieżka zestawu odwołania“ - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Wyświetl dozwolone wartości dla wersji językowej; określ wersję językową, np. „latest” lub „preview” - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 615985563b5..1c898a6234e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso inválido de emitir um assembly de referência, não use '--staticlink' ou '--reutilly' e '--refout' juntos. @@ -487,11 +492,6 @@ Caminho de assembly de referência inválido' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Exibe os valores permitidos para a versão do idioma, especifica a versão do idioma, como 'mais recente ' ou 'prévia' - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index d48f16b89f2..b9094d89e3f 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Недопустимое использование при создании базовой сборки. Не используйте "--staticlink" или "--refonly" и "--refout" вместе. @@ -487,11 +492,6 @@ Неверный путь к базовой сборке' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Отображение допустимых значений для версии языка. Укажите версию языка, например, "latest" или "preview". - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 5f9763a7403..7ee5a8cb3bc 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Başvuru bütünleştirilmiş kodunun oluşturulması için geçersiz kullanım: '--staticlink' veya '--refonly' ile '--refout' birlikte kullanılmaz. @@ -487,11 +492,6 @@ Geçersiz başvuru bütünleştirilmiş kodu yolu' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Dil sürümü için izin verilen değerleri görüntüleyin, dil sürümünü 'en son' veya 'önizleme' örneklerindeki gibi belirtin - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index e821d6299d1..2659f03165a 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 发出引用程序集的使用无效,请勿同时使用“--staticlink”或“--refonly”和“--refout”。 @@ -487,11 +492,6 @@ 引用程序集路径无效 - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - 显示语言版本的允许值,指定语言版本,如“最新”或“预览” - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 852c5be20d8..f7f06f543fc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -477,6 +477,11 @@ Compress interface and optimization data files + + Display the allowed values for language version. + Display the allowed values for language version. + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 發出參考組件的使用無效,請勿同時使用 '--staticlink' 或 '--refonly' 和 '--refout'。 @@ -487,11 +492,6 @@ 無效的參考組件路徑' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - 顯示語言版本允許的值,指定 'latest' 或 'preview' 等語言版本 - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -517,6 +517,11 @@ Disable implicit generation of constructs using reflection + + Specify language version such as 'latest' or 'preview'. + Specify language version such as 'latest' or 'preview'. + + Include F# interface information, the default is file. Essential for distributing libraries. Include F# interface information, the default is file. Essential for distributing libraries. diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index b91c0cff0a5..18925d1ff1e 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -26,10 +26,21 @@ let ``fsc help text is displayed correctly`` () = Assert.AreEqual(expectedHelp, actualHelp, $"Expected: '{expectedHelp}'\n Actual: '{actualHelp}'") |> ignore [] -let ``Version is displayed correctly`` () = +let ``FSC version is displayed correctly`` () = let builder = getArbitraryTcConfigBuilder() let expectedVersionPattern = @"Microsoft \(R\) F# Compiler version \d+\.\d+\.\d+\.\d+ for F# \d+\.\d+" let version = GetVersion builder Assert.That(version, Does.Match expectedVersionPattern) + +[] +let ``Language versions are displayed correctly`` () = + let versions = GetLanguageVersions() + + StringAssert.Contains("Supported language versions", versions) + StringAssert.Contains("preview", versions) + StringAssert.Contains("default", versions) + StringAssert.Contains("latest", versions) + StringAssert.Contains("latestmajor", versions) + StringAssert.Contains("(Default)", versions) \ No newline at end of file diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 877a8bf6b4b..6bb20c71312 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -111,10 +111,10 @@ - LANGUAGE - ---langversion:{?|version|latest|preview} Display the allowed values for - language version, specify language - version such as 'latest' or - 'preview' +--langversion:? Display the allowed values for + language version. +--langversion:{version|latest|preview} Specify language version such as + 'latest' or 'preview'. --checked[+|-] Generate overflow checks --define: Define conditional compilation symbols (Short form: -d) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 29c0350665c..193f7d70cb6 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -113,10 +113,10 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - LANGUAGE - ---langversion:{?|version|latest|preview} Display the allowed values for - language version, specify language - version such as 'latest' or - 'preview' +--langversion:? Display the allowed values for + language version. +--langversion:{version|latest|preview} Specify language version such as + 'latest' or 'preview'. --checked[+|-] Generate overflow checks --define: Define conditional compilation symbols (Short form: -d) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl index 0eddbd7e4c9..623a47f3f1a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl @@ -54,10 +54,10 @@ Usage: fsharpi [script.fsx []] - LANGUAGE - ---langversion:{?|version|latest|preview} Display the allowed values for - language version, specify language - version such as 'latest' or - 'preview' +--langversion:? Display the allowed values for + language version. +--langversion:{version|latest|preview} Specify language version such as + 'latest' or 'preview'. --checked[+|-] Generate overflow checks --define: Define conditional compilation symbols (Short form: -d) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index 4bd87bb194d..c52df3651b3 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -54,10 +54,10 @@ Usage: fsiAnyCpu [script.fsx []] - LANGUAGE - ---langversion:{?|version|latest|preview} Display the allowed values for - language version, specify language - version such as 'latest' or - 'preview' +--langversion:? Display the allowed values for + language version. +--langversion:{version|latest|preview} Specify language version such as + 'latest' or 'preview'. --checked[+|-] Generate overflow checks --define: Define conditional compilation symbols (Short form: -d) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index b56c812cd0e..0da770a2436 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -56,10 +56,10 @@ Usage: fsiAnyCpu [script.fsx []] - LANGUAGE - ---langversion:{?|version|latest|preview} Display the allowed values for - language version, specify language - version such as 'latest' or - 'preview' +--langversion:? Display the allowed values for + language version. +--langversion:{version|latest|preview} Specify language version such as + 'latest' or 'preview'. --checked[+|-] Generate overflow checks --define: Define conditional compilation symbols (Short form: -d) From 46981c52c8f0874b775daf5fbf97b05639146751 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Sep 2022 19:56:03 +0200 Subject: [PATCH 165/226] Re-enable macOS CI legs on macos-11 (#13881) --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dc38c8e68ce..2973f54b3d9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -445,7 +445,6 @@ stages: # MacOS - job: MacOS - condition: eq(1,2) pool: vmImage: macos-11 variables: @@ -576,7 +575,6 @@ stages: # Plain build Mac - job: Plain_Build_MacOS - condition: eq(1,2) pool: vmImage: macos-11 variables: From 38e7e5754ed6dbc3f212ad6cce29b1d4b0a0fec6 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 13 Sep 2022 00:06:36 +0300 Subject: [PATCH 166/226] Don't ship the FSharp.Core XmlDocs as Content in the nuget package. (#13838) Fixes #12706. Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- src/FSharp.Core/FSharp.Core.nuspec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/FSharp.Core/FSharp.Core.nuspec b/src/FSharp.Core/FSharp.Core.nuspec index 4efa4c5c661..cc7e5316ac6 100644 --- a/src/FSharp.Core/FSharp.Core.nuspec +++ b/src/FSharp.Core/FSharp.Core.nuspec @@ -7,23 +7,18 @@ - - - $CommonFileElements$ - - From 9d9c6c114efc3ceda8b33edb2ecf7c66e51100bb Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 13 Sep 2022 13:04:13 +0100 Subject: [PATCH 167/226] Fix #13197 (#13870) * Fix https://github.com/dotnet/fsharp/issues/13197 * format code --- src/Compiler/AbstractIL/il.fs | 33 ++++++++------ src/Compiler/AbstractIL/il.fsi | 21 ++++++--- src/Compiler/Driver/CompilerImports.fs | 50 ++++++++++----------- tests/FSharp.Compiler.UnitTests/FsiTests.fs | 42 +++++++++++++++++ 4 files changed, 100 insertions(+), 46 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index c0104807dcc..bbd5183842a 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -54,6 +54,14 @@ type PrimaryAssembly = | System_Runtime -> "System.Runtime" | NetStandard -> "netstandard" + static member IsPossiblePrimaryAssembly(fileName: string) = + let name = System.IO.Path.GetFileNameWithoutExtension(fileName) + + String.Compare(name, "mscorlib", true) <> 0 + || String.Compare(name, "System.Runtime", true) <> 0 + || String.Compare(name, "netstandard", true) <> 0 + || String.Compare(name, "System.Private.CoreLib", true) <> 0 + // -------------------------------------------------------------------- // Utilities: type names // -------------------------------------------------------------------- @@ -2803,12 +2811,16 @@ and [] ILTypeDefs(f: unit -> ILPreTypeDef[]) = member x.GetEnumerator() = (seq { for pre in array.Value -> pre.GetTypeDef() }).GetEnumerator() - member x.AsArrayOfPreTypeDefs() = array.Value + member _.AsArrayOfPreTypeDefs() = array.Value - member x.FindByName nm = + member _.FindByName nm = let ns, n = splitILTypeName nm dict.Value[ (ns, n) ].GetTypeDef() + member _.ExistsByName nm = + let ns, n = splitILTypeName nm + dict.Value.ContainsKey((ns, n)) + and [] ILPreTypeDef = abstract Namespace: string list abstract Name: string @@ -3331,15 +3343,9 @@ let tname_UIntPtr = "System.UIntPtr" let tname_TypedReference = "System.TypedReference" [] -type ILGlobals - ( - primaryScopeRef: ILScopeRef, - assembliesThatForwardToPrimaryAssembly: ILAssemblyRef list, - fsharpCoreAssemblyScopeRef: ILScopeRef - ) = +type ILGlobals(primaryScopeRef: ILScopeRef, equivPrimaryAssemblyRefs: ILAssemblyRef list, fsharpCoreAssemblyScopeRef: ILScopeRef) = - let assembliesThatForwardToPrimaryAssembly = - Array.ofList assembliesThatForwardToPrimaryAssembly + let equivPrimaryAssemblyRefs = Array.ofList equivPrimaryAssemblyRefs let mkSysILTypeRef nm = mkILTyRef (primaryScopeRef, nm) @@ -3394,8 +3400,7 @@ type ILGlobals member x.IsPossiblePrimaryAssemblyRef(aref: ILAssemblyRef) = aref.EqualsIgnoringVersion x.primaryAssemblyRef - || assembliesThatForwardToPrimaryAssembly - |> Array.exists aref.EqualsIgnoringVersion + || equivPrimaryAssemblyRefs |> Array.exists aref.EqualsIgnoringVersion /// For debugging [] @@ -3403,8 +3408,8 @@ type ILGlobals override x.ToString() = "" -let mkILGlobals (primaryScopeRef, assembliesThatForwardToPrimaryAssembly, fsharpCoreAssemblyScopeRef) = - ILGlobals(primaryScopeRef, assembliesThatForwardToPrimaryAssembly, fsharpCoreAssemblyScopeRef) +let mkILGlobals (primaryScopeRef, equivPrimaryAssemblyRefs, fsharpCoreAssemblyScopeRef) = + ILGlobals(primaryScopeRef, equivPrimaryAssemblyRefs, fsharpCoreAssemblyScopeRef) let mkNormalCall mspec = I_call(Normalcall, mspec, None) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 32528348907..3ea66ef5bf2 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -8,6 +8,7 @@ open FSharp.Compiler.IO open System.Collections.Generic open System.Reflection +/// Represents the target primary assembly [] type internal PrimaryAssembly = | Mscorlib @@ -16,6 +17,11 @@ type internal PrimaryAssembly = member Name: string + /// Checks if an assembly resolution may represent a primary assembly that actually contains the + /// definition of Sytem.Object. Note that the chosen target primary assembly may not actually be the one + /// that contains the definition of System.Object - it is just the one we are choosing to emit for. + static member IsPossiblePrimaryAssembly: fileName: string -> bool + /// Represents guids type ILGuid = byte[] @@ -1407,12 +1413,12 @@ type ILTypeDefs = /// Get some information about the type defs, but do not force the read of the type defs themselves. member internal AsArrayOfPreTypeDefs: unit -> ILPreTypeDef[] - /// Calls to FindByName will result in any laziness in the overall - /// set of ILTypeDefs being read in in addition - /// to the details for the type found, but the remaining individual - /// type definitions will not be read. + /// Calls to FindByName will result in all the ILPreTypeDefs being read. member internal FindByName: string -> ILTypeDef + /// Calls to ExistsByName will result in all the ILPreTypeDefs being read. + member internal ExistsByName: string -> bool + /// Represents IL Type Definitions. [] type ILTypeDef = @@ -1841,10 +1847,11 @@ type internal ILGlobals = member IsPossiblePrimaryAssemblyRef: ILAssemblyRef -> bool /// Build the table of commonly used references given functions to find types in system assemblies +/// +/// primaryScopeRef is the primary assembly we are emitting +/// equivPrimaryAssemblyRefs are ones regarded as equivalent val internal mkILGlobals: - primaryScopeRef: ILScopeRef * - assembliesThatForwardToPrimaryAssembly: ILAssemblyRef list * - fsharpCoreAssemblyScopeRef: ILScopeRef -> + primaryScopeRef: ILScopeRef * equivPrimaryAssemblyRefs: ILAssemblyRef list * fsharpCoreAssemblyScopeRef: ILScopeRef -> ILGlobals val internal PrimaryAssemblyILGlobals: ILGlobals diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index b7738705788..0958224400d 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -2321,13 +2321,13 @@ and [] TcImports | _, [ ResolvedImportedAssembly ccu ] -> ccu.FSharpViewOfMetadata.ILScopeRef | _ -> failwith "primaryScopeRef - unexpected" + let resolvedAssemblies = tcResolutions.GetAssemblyResolutions() + let primaryAssemblyResolvedPath = match primaryAssemblyResolution with | [ primaryAssemblyResolution ] -> primaryAssemblyResolution.resolvedPath | _ -> failwith "primaryAssemblyResolvedPath - unexpected" - let resolvedAssemblies = tcResolutions.GetAssemblyResolutions() - let readerSettings: ILReaderOptions = { pdbDirPath = None @@ -2336,28 +2336,28 @@ and [] TcImports tryGetMetadataSnapshot = tcConfig.tryGetMetadataSnapshot } - let tryFindAssemblyByExportedType manifest (exportedType: ILExportedTypeOrForwarder) = - match exportedType.ScopeRef, primaryScopeRef with - | ILScopeRef.Assembly aref1, ILScopeRef.Assembly aref2 when aref1.EqualsIgnoringVersion aref2 -> - mkRefToILAssembly manifest |> Some - | _ -> None - - let tryFindAssemblyThatForwardsToPrimaryAssembly manifest = - manifest.ExportedTypes.TryFindByName "System.Object" - |> Option.bind (tryFindAssemblyByExportedType manifest) - - // Determine what other assemblies could have been the primary assembly - // by checking to see if "System.Object" is an exported type. - let assembliesThatForwardToPrimaryAssembly = - resolvedAssemblies - |> List.choose (fun resolvedAssembly -> - if primaryAssemblyResolvedPath <> resolvedAssembly.resolvedPath then - let reader = OpenILModuleReader resolvedAssembly.resolvedPath readerSettings - - reader.ILModuleDef.Manifest - |> Option.bind tryFindAssemblyThatForwardsToPrimaryAssembly - else - None) + let tryFindEquivPrimaryAssembly (resolvedAssembly: AssemblyResolution) = + if primaryAssemblyResolvedPath = resolvedAssembly.resolvedPath then + None + else + let reader = OpenILModuleReader resolvedAssembly.resolvedPath readerSettings + let mdef = reader.ILModuleDef + + // We check the exported types of all assemblies, since many may forward System.Object, + // but only check the actual type definitions for specific assemblies that we know + // might actually declare System.Object. + match mdef.Manifest with + | Some manifest when + manifest.ExportedTypes.TryFindByName "System.Object" |> Option.isSome + || PrimaryAssembly.IsPossiblePrimaryAssembly resolvedAssembly.resolvedPath + && mdef.TypeDefs.ExistsByName "System.Object" + -> + mkRefToILAssembly manifest |> Some + | _ -> None + + // Find assemblies which also declare System.Object + let equivPrimaryAssemblyRefs = + resolvedAssemblies |> List.choose tryFindEquivPrimaryAssembly let! fslibCcu, fsharpCoreAssemblyScopeRef = node { @@ -2406,7 +2406,7 @@ and [] TcImports sysCcus |> Array.tryFind (fun ccu -> ccuHasType ccu path typeName) let ilGlobals = - mkILGlobals (primaryScopeRef, assembliesThatForwardToPrimaryAssembly, fsharpCoreAssemblyScopeRef) + mkILGlobals (primaryScopeRef, equivPrimaryAssemblyRefs, fsharpCoreAssemblyScopeRef) // OK, now we have both mscorlib.dll and FSharp.Core.dll we can create TcGlobals let tcGlobals = diff --git a/tests/FSharp.Compiler.UnitTests/FsiTests.fs b/tests/FSharp.Compiler.UnitTests/FsiTests.fs index 0419ee4c159..36b36a1c49f 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiTests.fs @@ -6,6 +6,13 @@ open FluentAssertions open FSharp.Compiler.Interactive.Shell open FSharp.Test open Xunit +open System.Threading + +type Sentinel () = + let x = () + +module MyModule = + let test(x: int) = () [] module FsiTests = @@ -636,3 +643,38 @@ module FsiTests = let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType boundValue.Value.ReflectionValue.Should().Be(mdArr, "") |> ignore + +#if NETCOREAPP + [] + let ``Evaluating simple reference and code succeeds under permutations``() = + + for useSdkRefsFlag in ["/usesdkrefs"; "/usesdkrefs-"] do + for multiemitFlag in ["/multiemit"; "/multiemit-"] do + let config = FsiEvaluationSession.GetDefaultConfiguration() + let argv = [| + typeof.Assembly.Location + "--noninteractive" + "--targetprofile:netcore" + "--langversion:preview" + multiemitFlag + useSdkRefsFlag + |] + let fsi = FsiEvaluationSession.Create(config, argv, TextReader.Null, TextWriter.Null, TextWriter.Null) + let assemblyPath = typeof.Assembly.Location.Replace("\\", "/") + let code = $@" + #r ""{assemblyPath}"" + FSharp.Compiler.UnitTests.MyModule.test(3)" + let ch, errors = fsi.EvalInteractionNonThrowing(code, CancellationToken.None) + errors + |> Array.iter (fun e -> printfn "error: %A" e) + match ch with + | Choice1Of2 v -> + let v = + match v with + | Some v -> sprintf "%A" v.ReflectionValue + | None -> "(none)" + printfn "value: %A" v + | Choice2Of2 e -> + printfn "exception: %A" e + raise e +#endif From cdc596316c61e7b18775ceff81269826a415a050 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 13 Sep 2022 18:09:06 +0200 Subject: [PATCH 168/226] Check expressions: safer init properties check (#13892) --- src/Compiler/Checking/CheckExpressions.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 537887747d6..50efadc072e 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -8921,8 +8921,11 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed // To get better warnings we special case some of the few known mutate-a-struct method names let mutates = (if methodName = "MoveNext" || methodName = "GetNextArg" then DefinitelyMutates else PossiblyMutates) - // Check if we have properties with "init-only" setters, which we try to call after init is done. - CheckInitProperties g (List.head minfos) methodName mItem + match minfos with + | minfo :: _ -> + // Check if we have properties with "init-only" setters, which we try to call after init is done. + CheckInitProperties g minfo methodName mItem + | _ -> () #if !NO_TYPEPROVIDERS match TryTcMethodAppToStaticConstantArgs cenv env tpenv (minfos, tyArgsOpt, mExprAndItem, mItem) with From 8f59d364a0abccb04d4ec2f1cd09665dee298777 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 14 Sep 2022 16:28:44 +0200 Subject: [PATCH 169/226] Introduce SynType.SignatureParameter. (#13879) * Introduce SynType.SignatureParameter. * Add missing SynType cases in walkers. --- src/Compiler/Checking/CheckExpressions.fs | 3 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 9 ++- src/Compiler/Service/ServiceParsedInputOps.fs | 23 ++++-- src/Compiler/SyntaxTree/SyntaxTree.fs | 5 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 8 +++ src/Compiler/pars.fsy | 17 +++-- ...erService.SurfaceArea.netstandard.expected | 15 ++++ .../SyntaxTreeTests/SignatureTypeTests.fs | 41 +++++++++++ tests/service/SyntaxTreeTests/TypeTests.fs | 70 +++++++++++++++++++ .../service/SyntaxTreeTests/UnionCaseTests.fs | 29 +++++++- 10 files changed, 206 insertions(+), 14 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 50efadc072e..8b4b99a745e 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4353,7 +4353,8 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn | SynType.App(arg1, _, args, _, _, postfix, m) -> TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m - | SynType.Paren(innerType, _) -> + | SynType.Paren(innerType, _) + | SynType.SignatureParameter(usedType = innerType) -> TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv innerType and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 9a1a53ac658..9a4263d4975 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -823,8 +823,13 @@ module SyntaxTraversal = | SynType.MeasureDivide (ty1, ty2, _) -> [ ty1; ty2 ] |> List.tryPick (traverseSynType path) | SynType.Tuple (path = segments) -> getTypeFromTuplePath segments |> List.tryPick (traverseSynType path) | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr - | SynType.Anon _ -> None - | _ -> None + | SynType.Paren (innerType = t) + | SynType.SignatureParameter (usedType = t) -> traverseSynType path t + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.LongIdent _ + | SynType.Var _ + | SynType.StaticConstant _ -> None visitor.VisitType(origPath, defaultTraverse, ty) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index d41cef4a04b..7b1fc766c1d 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -669,8 +669,15 @@ module ParsedInput = | SynType.HashConstraint (t, _) -> walkType t | SynType.MeasureDivide (t1, t2, _) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.MeasurePower (t, _, _) -> walkType t - | SynType.Paren (t, _) -> walkType t - | _ -> None + | SynType.Paren (t, _) + | SynType.SignatureParameter (usedType = t) -> walkType t + | SynType.StaticConstantExpr (e, _) -> walkExpr e + | SynType.StaticConstantNamed (ident, value, _) -> List.tryPick walkType [ ident; value ] + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.LongIdent _ + | SynType.Var _ + | SynType.StaticConstant _ -> None and walkClause clause = let (SynMatchClause (pat = pat; whenExpr = e1; resultExpr = e2)) = clause @@ -1661,7 +1668,8 @@ module ParsedInput = | SynType.Array (_, t, _) | SynType.HashConstraint (t, _) | SynType.MeasurePower (t, _, _) - | SynType.Paren (t, _) -> walkType t + | SynType.Paren (t, _) + | SynType.SignatureParameter (usedType = t) -> walkType t | SynType.Fun (argType = t1; returnType = t2) | SynType.MeasureDivide (t1, t2, _) -> walkType t1 @@ -1675,7 +1683,14 @@ module ParsedInput = | SynType.WithGlobalConstraints (t, typeConstraints, _) -> walkType t List.iter walkTypeConstraint typeConstraints - | _ -> () + | SynType.StaticConstantExpr (e, _) -> walkExpr e + | SynType.StaticConstantNamed (ident, value, _) -> + walkType ident + walkType value + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.Var _ + | SynType.StaticConstant _ -> () and walkClause (SynMatchClause (pat = pat; whenExpr = e1; resultExpr = e2)) = walkPat pat diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8a0b853f63e..ce5571ab4d9 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -435,6 +435,8 @@ type SynType = | Paren of innerType: SynType * range: range + | SignatureParameter of attributes: SynAttributes * optional: bool * id: Ident option * usedType: SynType * range: range + member x.Range = match x with | SynType.App (range = m) @@ -452,7 +454,8 @@ type SynType = | SynType.HashConstraint (range = m) | SynType.MeasureDivide (range = m) | SynType.MeasurePower (range = m) - | SynType.Paren (range = m) -> m + | SynType.Paren (range = m) + | SynType.SignatureParameter (range = m) -> m | SynType.LongIdent lidwd -> lidwd.Range [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 503a7b2faa7..2af399af0e4 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -510,6 +510,14 @@ type SynType = | Paren of innerType: SynType * range: range + /// F# syntax: a: b, used in signatures and type annotations + | SignatureParameter of + attributes: SynAttributes * + optional: bool * + id: Ident option * + usedType: SynType * + range: range + /// Gets the syntax range of this construct member Range: range diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index c0453c0c80c..d7bbdaaf68e 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5082,22 +5082,29 @@ topTupleTypeElements: topAppType: | attributes appType COLON appType { match $2 with - | SynType.LongIdent(SynLongIdent([id], _, _)) -> $4, SynArgInfo($1, false, Some id) + | SynType.LongIdent(SynLongIdent([id], _, _)) -> + let m = rhs2 parseState 1 4 + SynType.SignatureParameter($1, false, Some id, $4, m), SynArgInfo($1, false, Some id) | _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) } | attributes QMARK ident COLON appType - { $5, SynArgInfo($1, true, Some $3) } + { let m = rhs2 parseState 1 5 + SynType.SignatureParameter($1, true, Some $3, $5, m), SynArgInfo($1, true, Some $3) } | attributes appType - { ($2, SynArgInfo($1, false, None)) } + { let m = rhs2 parseState 1 2 + SynType.SignatureParameter($1, false, None, $2, m), SynArgInfo($1, false, None) } | appType COLON appType { match $1 with - | SynType.LongIdent(SynLongIdent([id], _, _)) -> $3, SynArgInfo([], false, Some id) + | SynType.LongIdent(SynLongIdent([id], _, _)) -> + let m = rhs2 parseState 1 3 + SynType.SignatureParameter([], false, Some id, $3, m), SynArgInfo([], false, Some id) | _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) } | QMARK ident COLON appType - { $4, SynArgInfo([], true, Some $2) } + { let m = rhs2 parseState 1 4 + SynType.SignatureParameter([], true, Some $2, $4, m), SynArgInfo([], true, Some $2) } | appType { $1, SynArgInfo([], false, None) } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index b808314ad58..083c2ea9310 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -8483,6 +8483,16 @@ FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType get_innerTy FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType innerType FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean get_optional() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean optional +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType get_usedType() +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType usedType +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] get_id() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] id FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst constant FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst get_constant() FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Text.Range get_range() @@ -8508,6 +8518,7 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 LongIdentApp FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasureDivide FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasurePower FSharp.Compiler.Syntax.SynType+Tags: Int32 Paren +FSharp.Compiler.Syntax.SynType+Tags: Int32 SignatureParameter FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstant FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantExpr FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNamed @@ -8541,6 +8552,7 @@ FSharp.Compiler.Syntax.SynType: Boolean IsLongIdentApp FSharp.Compiler.Syntax.SynType: Boolean IsMeasureDivide FSharp.Compiler.Syntax.SynType: Boolean IsMeasurePower FSharp.Compiler.Syntax.SynType: Boolean IsParen +FSharp.Compiler.Syntax.SynType: Boolean IsSignatureParameter FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstant FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantExpr FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNamed @@ -8558,6 +8570,7 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsLongIdentApp() FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasureDivide() FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasurePower() FSharp.Compiler.Syntax.SynType: Boolean get_IsParen() +FSharp.Compiler.Syntax.SynType: Boolean get_IsSignatureParameter() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstant() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantExpr() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNamed() @@ -8575,6 +8588,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewLongIdentApp(F FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasureDivide(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasurePower(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynRationalConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewParen(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewSignatureParameter(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) @@ -8592,6 +8606,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+LongIdentApp FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasureDivide FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasurePower FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Paren +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+SignatureParameter FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstant FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantExpr FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNamed diff --git a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs index 943fa5ba5e3..e7f8055fee9 100644 --- a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs +++ b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs @@ -471,3 +471,44 @@ type Z with assertRange (14, 0) (14, 4) mType3 assertRange (14, 7) (14, 11) mWith3 | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynValSig contains parameter names`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh +val InferSynValData: + memberFlagsOpt: SynMemberFlags option * pat: SynPat option * SynReturnInfo option * origRhsExpr: SynExpr -> + x: string -> + SynValData2 +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Val(valSig = SynValSig(synType = + SynType.Fun( + argType = + SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some memberFlagsOpt)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some pat)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.App _) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some origRhsExpr)) + ]) + returnType = + SynType.Fun( + argType = SynType.SignatureParameter(id = Some x) + returnType = SynType.LongIdent _ + ) + ) + )) + ] ) ])) -> + Assert.AreEqual("memberFlagsOpt", memberFlagsOpt.idText) + Assert.AreEqual("pat", pat.idText) + Assert.AreEqual("origRhsExpr", origRhsExpr.idText) + Assert.AreEqual("x", x.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/TypeTests.fs b/tests/service/SyntaxTreeTests/TypeTests.fs index c38e684ada3..0c822ea94dc 100644 --- a/tests/service/SyntaxTreeTests/TypeTests.fs +++ b/tests/service/SyntaxTreeTests/TypeTests.fs @@ -524,3 +524,73 @@ let _: struct (int * int = () assertRange (2, 7) (2, 24) mTuple | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Named parameters in delegate type`` () = + let parseResults = + getParseResults + """ +type Foo = delegate of a: A * b: B -> c:C -> D + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = + SynTypeDefnKind.Delegate(signature = SynType.Fun( + argType = + SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some a)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some b)) + ]) + returnType = + SynType.Fun( + argType = SynType.SignatureParameter(id = Some c) + returnType = SynType.LongIdent _ + ) + )))) + ]) + ]) + ])) -> + Assert.AreEqual("a", a.idText) + Assert.AreEqual("b", b.idText) + Assert.AreEqual("c", c.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Attributes in optional named member parameter`` () = + let parseResults = + getParseResults + """ +type X = + abstract member Y: [] ?a: A -> B + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel( + members = [ + SynMemberDefn.AbstractSlot(slotSig = SynValSig(synType = + SynType.Fun( + argType = SynType.SignatureParameter( + [ { Attributes = [ _ ; _ ] } ], + true, + Some a, + SynType.LongIdent _, + m + ) + returnType = SynType.LongIdent _ + ) + )) + ] + )) + ]) + ]) + ])) -> + Assert.AreEqual("a", a.idText) + assertRange (3, 23) (3, 41) m + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/UnionCaseTests.fs b/tests/service/SyntaxTreeTests/UnionCaseTests.fs index 2cb1f80b730..c9c480cc16e 100644 --- a/tests/service/SyntaxTreeTests/UnionCaseTests.fs +++ b/tests/service/SyntaxTreeTests/UnionCaseTests.fs @@ -135,4 +135,31 @@ type Currency = ])) -> assertRange (7, 4) (7, 11) mPrivate | _ -> - Assert.Fail "Could not get valid AST" \ No newline at end of file + Assert.Fail "Could not get valid AST" + +[] +let ``SynUnionCaseKind.FullType`` () = + let parseResults = + getParseResults + """ +type X = + | a: int * z:int + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase(caseType = SynUnionCaseKind.FullType(fullType = SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.LongIdent _) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some z)) + ]))) + ]))) + ]) + ]) + ])) -> + Assert.AreEqual("z", z.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file From 68e16008e74c2c92879c1268a56743c880420c04 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 14 Sep 2022 18:38:07 +0200 Subject: [PATCH 170/226] Only process EmptyModuleOrNamespaces when showHeader is true. (#13883) * Only process EmptyModuleOrNamespaces when showHeader is true. * Update failing Cambridge tests. Co-authored-by: Don Syme --- src/Compiler/Checking/NicePrint.fs | 2 +- tests/fsharp/core/load-script/out.stdout.bsl | 4 +--- tests/fsharp/core/printing/output.1000.stdout.bsl | 6 +----- tests/fsharp/core/printing/output.200.stdout.bsl | 6 +----- tests/fsharp/core/printing/output.47.stdout.bsl | 8 ++------ tests/fsharp/core/printing/output.multiemit.stdout.bsl | 8 ++------ tests/fsharp/core/printing/output.off.stdout.bsl | 6 +----- tests/fsharp/core/printing/output.stdout.bsl | 8 ++------ 8 files changed, 11 insertions(+), 37 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index dab7a9efdfc..e32789c9fe2 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -2433,7 +2433,7 @@ module InferredSigPrinting = wordL (tagKeyword keyword) ^^ sepListL SepL.dot pathL match expr with - | EmptyModuleOrNamespaces mspecs -> + | EmptyModuleOrNamespaces mspecs when showHeader -> List.map emptyModuleOrNamespace mspecs |> aboveListL | expr -> imdefL denv expr diff --git a/tests/fsharp/core/load-script/out.stdout.bsl b/tests/fsharp/core/load-script/out.stdout.bsl index 3651c81d195..0cbbd767c36 100644 --- a/tests/fsharp/core/load-script/out.stdout.bsl +++ b/tests/fsharp/core/load-script/out.stdout.bsl @@ -16,9 +16,7 @@ World -the end Test 3================================================= -> module FSI_0001 - -[Loading D:\staging\staging\src\tests\fsharp\core\load-script\1.fsx +> [Loading D:\staging\staging\src\tests\fsharp\core\load-script\1.fsx Loading D:\staging\staging\src\tests\fsharp\core\load-script\2.fsx Loading D:\staging\staging\src\tests\fsharp\core\load-script\3.fsx] Hello diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index b7d685cd23b..cdf91519c8d 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1,6 +1,4 @@ -module FSI_0001 - > val it: unit = () > val repeatId: string = "A" @@ -236,9 +234,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0020 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 98b5d8efe31..cb22322c94a 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -1,6 +1,4 @@ -module FSI_0001 - > val it: unit = () > val repeatId: string = "A" @@ -131,9 +129,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0020 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index 97426680947..b6f38074b36 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -1,7 +1,5 @@ -> module FSI_0001 - -val repeatId: string = "A" +> val repeatId: string = "A" > val repeatId: string = "B" @@ -251,9 +249,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0019 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 8c645cb52d1..9183285f872 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -1,7 +1,5 @@ -> module FSI_0001 - -val repeatId: string = "A" +> val repeatId: string = "A" > val repeatId: string = "B" @@ -251,9 +249,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0019 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index b2d1f1f8e6a..586d7a58860 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1,6 +1,4 @@ -module FSI_0001 - > val it: unit = () > val repeatId: string @@ -96,9 +94,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0020 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 8c645cb52d1..9183285f872 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -1,7 +1,5 @@ -> module FSI_0001 - -val repeatId: string = "A" +> val repeatId: string = "A" > val repeatId: string = "B" @@ -251,9 +249,7 @@ module D1 = val words: System.Collections.Generic.IDictionary val words2000: System.Collections.Generic.IDictionary -> module FSI_0019 - -> module D2 = +> > module D2 = val words: IDictionary val words2000: IDictionary val opt1: 'a option From e05bdc2dba27d0450363d8335ccc195c77c23914 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 14 Sep 2022 23:17:46 +0300 Subject: [PATCH 171/226] Add trimming XML files to FSharp.Core. (#13853) * Add ILLink xml files to FSharp.Core. * Trim away the compressed blobs if they exist. * Added a very basic test project to test trimming * Added a very basic test project to test trimming(2) * Added a very basic test project to test trimming(3) * Added a very basic test project to test trimming(4) * Added a very basic test project to test trimming(5) * Added a very basic test project to test trimming(6) * Added a very basic test project to test trimming(7) * Added a very basic test project to test trimming(8) * Added a very basic test project to test trimming(9) * Added a very basic test project to test trimming(10) * Added a very basic test project to test trimming(11) * Added a very basic test project to test trimming(12) * Fix trimming tests Co-authored-by: Don Syme Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- azure-pipelines.yml | 44 + src/FSharp.Core/FSharp.Core.fsproj | 2 + src/FSharp.Core/ILLink.LinkAttributes.xml | 167 + src/FSharp.Core/ILLink.Substitutions.xml | 8 + .../SelfContained_Trimming_Test/NuGet.Config | 16 + .../SelfContained_Trimming_Test/Program.fs | 9079 +++++++++++++++++ .../SelfContained_Trimming_Test.fsproj | 40 + .../SelfContained_Trimming_Test/check.cmd | 2 + .../SelfContained_Trimming_Test/check.ps1 | 23 + 9 files changed, 9381 insertions(+) create mode 100644 src/FSharp.Core/ILLink.LinkAttributes.xml create mode 100644 src/FSharp.Core/ILLink.Substitutions.xml create mode 100644 tests/projects/SelfContained_Trimming_Test/NuGet.Config create mode 100644 tests/projects/SelfContained_Trimming_Test/Program.fs create mode 100644 tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj create mode 100644 tests/projects/SelfContained_Trimming_Test/check.cmd create mode 100644 tests/projects/SelfContained_Trimming_Test/check.ps1 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2973f54b3d9..65e3e0fa007 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -605,6 +605,50 @@ stages: DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 displayName: Regular rebuild of FSharp.Compiler.Service.sln + # Test trimming on Windows + - job: Build_And_Test_Trimming_Windows + pool: + name: NetCore-Public + demands: ImageOverride -equals $(WindowsMachineQueueName) + strategy: + maxParallel: 2 + matrix: + compressed_metadata: + _kind: "-compressAllMetadata" + classic_metadata: + _kind: "" + variables: + - name: _BuildConfig + value: Release + steps: + - checkout: self + clean: true + - task: UseDotNet@2 + displayName: install SDK + inputs: + packageType: sdk + useGlobalJson: true + includePreviewVersions: true + workingDirectory: $(Build.SourcesDirectory) + installationPath: $(Agent.ToolsDirectory)/dotnet + - script: dotnet --list-sdks + displayName: Report dotnet SDK versions + - script: .\Build.cmd $(_kind) -pack -c $(_BuildConfig) + displayName: Initial build and prepare packages. + - script: dotnet publish -c $(_BuildConfig) -bl:\"./bin/$(_BuildConfig)/net7.0/win-x64/publish/Trimming.binlog\" + displayName: Build and publish a trim test package. + workingDirectory: $(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test + - script: .\check.cmd + displayName: Check the state of the trimmed app. + workingDirectory: $(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test + - task: PublishPipelineArtifact@1 + displayName: Publish Trim Tests Logs + inputs: + targetPath: '$(Build.SourcesDirectory)/tests/projects/SelfContained_Trimming_Test/bin/$(_BuildConfig)/net7.0/win-x64/publish' + artifactName: 'Trim Test Logs Attempt $(System.JobAttempt) Logs $(_kind)' + continueOnError: true + condition: always() + # Arcade-powered source build # turned off until https://github.com/dotnet/source-build/issues/1795 is fixed # - template: /eng/common/templates/jobs/jobs.yml diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 95ab57a3796..f490c9cccfb 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -52,6 +52,8 @@ Microsoft.FSharp.Core.SR FSCore.resx + + Primitives/prim-types-prelude.fsi diff --git a/src/FSharp.Core/ILLink.LinkAttributes.xml b/src/FSharp.Core/ILLink.LinkAttributes.xml new file mode 100644 index 00000000000..3e70f972b8a --- /dev/null +++ b/src/FSharp.Core/ILLink.LinkAttributes.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/FSharp.Core/ILLink.Substitutions.xml b/src/FSharp.Core/ILLink.Substitutions.xml new file mode 100644 index 00000000000..42d44a0b4c4 --- /dev/null +++ b/src/FSharp.Core/ILLink.Substitutions.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/projects/SelfContained_Trimming_Test/NuGet.Config b/tests/projects/SelfContained_Trimming_Test/NuGet.Config new file mode 100644 index 00000000000..277ccdc4067 --- /dev/null +++ b/tests/projects/SelfContained_Trimming_Test/NuGet.Config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/projects/SelfContained_Trimming_Test/Program.fs b/tests/projects/SelfContained_Trimming_Test/Program.fs new file mode 100644 index 00000000000..3c919d129dd --- /dev/null +++ b/tests/projects/SelfContained_Trimming_Test/Program.fs @@ -0,0 +1,9079 @@ +module Core_printf + +open Printf + +let failures = ref [] + +let report_failure (s : string) = + stderr.Write" NO: " + stderr.WriteLine s + failures := !failures @ [s] + () + +let test t (s1:Lazy) s2 = + let s1 = s1.Force() + if s1 <> s2 then + report_failure ("test "+t+": expected \n\t'"+s2+"' but produced \n\t'"+s1+"'") + stdout.WriteLine ("test "+t+": expected \n\t'"+s2+"' but produced \n\t'"+s1+"'") + + () + +let verify actual expected = test expected actual expected + +let adjust1 obj n1 = unbox ((unbox obj) n1) + +let testing1 () = + let _ = test "cewoui2a" (lazy(sprintf "%o" 0)) "0" + let _ = test "cewoui2b" (lazy(sprintf "%o" 0)) "0" + let _ = test "cewoui2c" (lazy(sprintf "%o" 5)) "5" + let _ = test "cewoui2q" (lazy(sprintf "%o" 8)) "10" + let _ = test "cewoui2w" (lazy(sprintf "%o" 15)) "17" + let _ = test "cewoui2e" (lazy(sprintf "%o" System.Int32.MinValue)) "20000000000" + let _ = test "cewoui2r" (lazy(sprintf "%o" 0xffffffff)) "37777777777" + let _ = test "cewoui2t" (lazy(sprintf "%o" (System.Int32.MinValue+1))) "20000000001" + let _ = test "cewoui2y" (lazy(sprintf "%o" System.Int32.MaxValue)) "17777777777" + let _ = test "cewoui2u" (lazy(sprintf "%o" (-1))) "37777777777" + let _ = test "cewoui2i" (lazy(sprintf "%o" System.UInt64.MaxValue)) "1777777777777777777777" + let _ = test "cewoui2i" (lazy(sprintf "%o" System.Int64.MinValue)) "1000000000000000000000" + + let _ = test "cewoui2aB" (lazy(sprintf "%B" 0)) "0" + let _ = test "cewoui2bB" (lazy(sprintf "%B" 0)) "0" + let _ = test "cewoui2cB" (lazy(sprintf "%B" 5)) "101" + let _ = test "cewoui2qB" (lazy(sprintf "%B" 8)) "1000" + let _ = test "cewoui2wB" (lazy(sprintf "%B" 15)) "1111" + let _ = test "cewoui2eB" (lazy(sprintf "%B" System.Int32.MinValue)) "10000000000000000000000000000000" + let _ = test "cewoui2rB" (lazy(sprintf "%B" 0xffffffff)) "11111111111111111111111111111111" + let _ = test "cewoui2tB" (lazy(sprintf "%B" (System.Int32.MinValue+1))) "10000000000000000000000000000001" + let _ = test "cewoui2yB" (lazy(sprintf "%B" System.Int32.MaxValue)) "1111111111111111111111111111111" + let _ = test "cewoui2uB" (lazy(sprintf "%B" (-1))) "11111111111111111111111111111111" + let _ = test "cewoui2iB" (lazy(sprintf "%B" System.UInt64.MaxValue)) "1111111111111111111111111111111111111111111111111111111111111111" + let _ = test "cewoui2iB" (lazy(sprintf "%B" System.Int64.MinValue)) "1000000000000000000000000000000000000000000000000000000000000000" + + let f = sprintf "%o" + + let _ = test "cewoui2a" (lazy(f 0)) "0" + let _ = test "cewoui2s" (lazy(f 0)) "0" + let _ = test "cewoui2d" (lazy(f 5)) "5" + let _ = test "cewoui2f" (lazy(f 8)) "10" + let _ = test "cewoui2g" (lazy(f 15)) "17" + let _ = test "cewoui2h" (lazy(f System.Int32.MinValue)) "20000000000" + let _ = test "cewoui2j" (lazy(f 0xffffffff)) "37777777777" + let _ = test "cewoui2lk" (lazy(f (System.Int32.MinValue+1))) "20000000001" + let _ = test "cewoui2l" (lazy(f System.Int32.MaxValue)) "17777777777" + let _ = test "cewoui212" (lazy(f (-1))) "37777777777" + + let fB = sprintf "%B" + + let _ = test "cewoui2a" (lazy(fB 0)) "0" + let _ = test "cewoui2s" (lazy(fB 0)) "0" + let _ = test "cewoui2d" (lazy(fB 5)) "101" + let _ = test "cewoui2f" (lazy(fB 8)) "1000" + let _ = test "cewoui2g" (lazy(fB 15)) "1111" + let _ = test "cewoui2h" (lazy(fB System.Int32.MinValue)) "10000000000000000000000000000000" + let _ = test "cewoui2j" (lazy(fB 0xffffffff)) "11111111111111111111111111111111" + let _ = test "cewoui2lk" (lazy(fB (System.Int32.MinValue+1))) "10000000000000000000000000000001" + let _ = test "cewoui2l" (lazy(fB System.Int32.MaxValue)) "1111111111111111111111111111111" + let _ = test "cewoui212" (lazy(fB (-1))) "11111111111111111111111111111111" + + // Test nothing comes out until all arguments have been applied + let _ = test "csd3oui2!" (lazy(let buf = new System.Text.StringBuilder() in ignore (bprintf buf "%x%x" 0); buf.ToString())) "" + let _ = test "csd3oui2!" (lazy(let buf = new System.Text.StringBuilder() in ignore (bprintf buf "%x%x" 0 1); buf.ToString())) "01" + let _ = test "csd3oui2!" (lazy(let buf = new System.Text.StringBuilder() in ignore (bprintf buf "%s"); buf.ToString())) "" + let _ = test "csd3oui2!" (lazy(let buf = new System.Text.StringBuilder() in ignore (bprintf buf "%s" "abc"); buf.ToString())) "abc" + + let _ = test "cewoui2!" (lazy(sprintf "%x" 0)) "0" + let _ = test "cewoui26" (lazy(sprintf "%x" 5)) "5" + let _ = test "cewoui2f" (lazy(sprintf "%x" 8)) "8" + let _ = test "cewoui29" (lazy(sprintf "%x" 15)) "f" + let _ = test "cewoui2Z" (lazy(sprintf "%x" System.Int32.MinValue)) "80000000" + let _ = test "cewoui2X" (lazy(sprintf "%x" 0xffffffff)) "ffffffff" + let _ = test "cewoui2A" (lazy(sprintf "%x" (System.Int32.MinValue+1))) "80000001" + let _ = test "cewoui2Q" (lazy(sprintf "%x" System.Int32.MaxValue)) "7fffffff" + let _ = test "cewoui2`" (lazy(sprintf "%x" System.UInt64.MaxValue)) "ffffffffffffffff" + let _ = test "cewoui2~" (lazy(sprintf "%x" System.Int64.MinValue)) "8000000000000000" + + let fx = sprintf "%x" + let _ = test "cewoui2W" (lazy(fx 0)) "0" + let _ = test "cewoui2E" (lazy(fx 5)) "5" + let _ = test "cewoui2R" (lazy(fx 8)) "8" + let _ = test "cewoui2T" (lazy(fx 15)) "f" + let _ = test "cewoui2Y" (lazy(fx System.Int32.MinValue)) "80000000" + let _ = test "cewoui2U" (lazy(fx 0xffffffff)) "ffffffff" + let _ = test "cewoui2I" (lazy(fx (System.Int32.MinValue+1))) "80000001" + let _ = test "cewoui2O" (lazy(fx System.Int32.MaxValue)) "7fffffff" + + let _ = test "cewoui2Z" (lazy(sprintf "%X" 0)) "0" + let _ = test "cewoui2X" (lazy(sprintf "%X" 5)) "5" + let _ = test "cewoui2C" (lazy(sprintf "%X" 8)) "8" + let _ = test "cewoui2V" (lazy(sprintf "%X" 15)) "F" + let _ = test "cewoui2v" (lazy(sprintf "%X" System.Int32.MinValue)) "80000000" + let _ = test "cewoui2B" (lazy(sprintf "%X" 0xffffffff)) "FFFFFFFF" + let _ = test "cewoui2N" (lazy(sprintf "%X" (System.Int32.MinValue+1))) "80000001" + let _ = test "cewoui2M" (lazy(sprintf "%X" System.Int32.MaxValue)) "7FFFFFFF" + let _ = test "cewoui2," (lazy(sprintf "%X" System.UInt64.MaxValue)) "FFFFFFFFFFFFFFFF" + let _ = test "cewoui2." (lazy(sprintf "%X" System.Int64.MinValue)) "8000000000000000" + + let _ = test "cewou44a" (lazy(sprintf "%u" 0)) "0" + let _ = test "cewou44b" (lazy(sprintf "%u" 5)) "5" + let _ = test "cewou44c" (lazy(sprintf "%u" 8)) "8" + let _ = test "cewou44d" (lazy(sprintf "%u" 15)) "15" + let _ = test "cewou44e" (lazy(sprintf "%u" System.Int32.MinValue)) "2147483648" + let _ = test "cewou44f" (lazy(sprintf "%u" 0xffffffff)) "4294967295" + let _ = test "cewou44g" (lazy(sprintf "%u" (System.Int32.MinValue+1))) "2147483649" + let _ = test "cewou44h" (lazy(sprintf "%u" System.Int32.MaxValue)) "2147483647" + let _ = test "cewou44i" (lazy(sprintf "%u" System.UInt64.MaxValue)) "18446744073709551615" + + let _ = test "cewou45a" (lazy(sprintf "%d" 0ul)) "0" + let _ = test "cewou45b" (lazy(sprintf "%d" 5ul)) "5" + let _ = test "cewou45c" (lazy(sprintf "%d" 8ul)) "8" + let _ = test "cewou45d" (lazy(sprintf "%d" 15ul)) "15" + let _ = test "cewou45e" (lazy(sprintf "%d" 2147483648ul)) "2147483648" + let _ = test "cewou45f" (lazy(sprintf "%d" 4294967295ul)) "4294967295" + let _ = test "cewou45g" (lazy(sprintf "%d" 2147483649ul)) "2147483649" + let _ = test "cewou45h" (lazy(sprintf "%d" 2147483647ul)) "2147483647" + let _ = test "cewou45i" (lazy(sprintf "%d" System.UInt64.MaxValue)) "18446744073709551615" + + let _ = test "cewou46a" (lazy(sprintf "%d" 0ul)) "0" + let _ = test "cewou46b" (lazy(sprintf "%d" 5ul)) "5" + let _ = test "cewou46c" (lazy(sprintf "%d" 8ul)) "8" + let _ = test "cewou46d" (lazy(sprintf "%d" 15ul)) "15" + let _ = test "cewou46e" (lazy(sprintf "%d" 2147483648ul)) "2147483648" + let _ = test "cewou46f" (lazy(sprintf "%d" 4294967295ul)) "4294967295" + let _ = test "cewou46g" (lazy(sprintf "%d" 2147483649ul)) "2147483649" + let _ = test "cewou46h" (lazy(sprintf "%d" 2147483647ul)) "2147483647" + let _ = test "cewou46i" (lazy(sprintf "%d" System.UInt64.MaxValue)) "18446744073709551615" + + let _ = test "ceew903" (lazy(sprintf "%u" System.Int64.MaxValue)) "9223372036854775807" + let _ = test "ceew903" (lazy(sprintf "%u" System.Int64.MinValue)) "9223372036854775808" + let _ = test "ceew903" (lazy(sprintf "%d" System.Int64.MaxValue)) "9223372036854775807" + let _ = test "ceew903" (lazy(sprintf "%d" System.Int64.MinValue)) "-9223372036854775808" + + let _ = test "ceew903" (lazy(sprintf "%u" System.Int64.MaxValue)) "9223372036854775807" + let _ = test "ceew903" (lazy(sprintf "%u" System.Int64.MinValue)) "9223372036854775808" + let _ = test "ceew903" (lazy(sprintf "%d" System.Int64.MaxValue)) "9223372036854775807" + let _ = test "ceew903" (lazy(sprintf "%d" System.Int64.MinValue)) "-9223372036854775808" + + let _ = test "cewou47a" (lazy(sprintf "%d" 0n)) "0" + let _ = test "cewou47b" (lazy(sprintf "%d" 5n)) "5" + let _ = test "cewou47c" (lazy(sprintf "%d" 8n)) "8" + let _ = test "cewou47d" (lazy(sprintf "%d" 15n)) "15" + let _ = test "cewou47e" (lazy(sprintf "%u" 2147483648n)) "2147483648" + let _ = test "cewou47f" (lazy(sprintf "%u" 4294967295n)) "4294967295" + let _ = test "cewou47g" (lazy(sprintf "%u" 2147483649n)) "2147483649" + let _ = test "cewou47h" (lazy(sprintf "%u" 2147483647n)) "2147483647" + + let _ = test "cewou47a" (lazy(sprintf "%d" 0n)) "0" + let _ = test "cewou47b" (lazy(sprintf "%d" 5n)) "5" + let _ = test "cewou47c" (lazy(sprintf "%d" 8n)) "8" + let _ = test "cewou47d" (lazy(sprintf "%d" 15n)) "15" + let _ = test "cewou47e" (lazy(sprintf "%u" 2147483648n)) "2147483648" + let _ = test "cewou47f" (lazy(sprintf "%u" 4294967295n)) "4294967295" + let _ = test "cewou47g" (lazy(sprintf "%u" 2147483649n)) "2147483649" + let _ = test "cewou47h" (lazy(sprintf "%u" 2147483647n)) "2147483647" + + let _ = test "cewou48a" (lazy(sprintf "%d" 0un)) "0" + let _ = test "cewou48b" (lazy(sprintf "%d" 5un)) "5" + let _ = test "cewou48c" (lazy(sprintf "%d" 8un)) "8" + let _ = test "cewou48d" (lazy(sprintf "%d" 15un)) "15" + let _ = test "cewou48e" (lazy(sprintf "%u" 2147483648un)) "2147483648" + let _ = test "cewou48f" (lazy(sprintf "%u" 4294967295un)) "4294967295" + let _ = test "cewou48g" (lazy(sprintf "%u" 2147483649un)) "2147483649" + let _ = test "cewou48h" (lazy(sprintf "%u" 2147483647un)) "2147483647" + + let _ = test "cewou59a" (lazy(sprintf "%d" 0un)) "0" + let _ = test "cewou59b" (lazy(sprintf "%d" 5un)) "5" + let _ = test "cewou59c" (lazy(sprintf "%d" 8un)) "8" + let _ = test "cewou59d" (lazy(sprintf "%d" 15un)) "15" + let _ = test "cewou59e" (lazy(sprintf "%u" 2147483648un)) "2147483648" + let _ = test "cewou59f" (lazy(sprintf "%u" 4294967295un)) "4294967295" + let _ = test "cewou59g" (lazy(sprintf "%u" 2147483649un)) "2147483649" + let _ = test "cewou59h" (lazy(sprintf "%u" 2147483647un)) "2147483647" + + let _ = test "cewou49a" (lazy(sprintf "%d" 0)) "0" + let _ = test "cewou49b" (lazy(sprintf "%d" 5)) "5" + let _ = test "cewou49c" (lazy(sprintf "%+d" 5)) "+5" + let _ = test "cewou49d" (lazy(sprintf "% d" 5)) " 5" + let _ = test "cewou49e" (lazy(sprintf "%+4d" 5)) " +5" + let _ = test "cewou49f" (lazy(sprintf "%-+4d" 5)) "+5 " + let _ = test "cewou49g" (lazy(sprintf "%-4d" 5)) "5 " + let _ = test "cewou49h" (lazy(sprintf "%- 4d" 5)) " 5 " + let _ = test "cewou49i" (lazy(sprintf "%- d" 5)) " 5" + let _ = test "cewou49j" (lazy(sprintf "% d" 5)) " 5" + let _ = test "weioj31" (lazy(sprintf "%*d" 3 5)) " 5" + let _ = test "weioj31" (lazy(sprintf "%3d" 5)) " 5" + let _ = test "weioj32" (lazy(sprintf "%1d" 5)) "5" + let _ = test "weioj32" (lazy(sprintf "%*d" 1 5)) "5" + let _ = test "weioj33" (lazy(sprintf "%2d" 500)) "500" + let _ = test "weioj33" (lazy(sprintf "%*d" 2 500)) "500" + let _ = test "weioj34" (lazy(sprintf "%3d" 500)) "500" + let _ = test "weioj34" (lazy(sprintf "%*d" 3 500)) "500" + let _ = test "weioj35" (lazy(sprintf "%d" 501)) "501" + let _ = test "weioj36" (lazy(sprintf "%2d" (-4))) "-4" + let _ = test "weioj36" (lazy(sprintf "%*d" 2 (-4))) "-4" + let _ = test "weioj37" (lazy(sprintf "%1d" (-4))) "-4" + let _ = test "weioj37" (lazy(sprintf "%*d" 1 (-4))) "-4" + let _ = test "weioj38" (lazy(sprintf "%d" (-401))) "-401" + let _ = test "weioj39" (lazy(sprintf "%d" 2147483647)) "2147483647" + let _ = test "weioj3a" (lazy(sprintf "%d" (-2147483647))) "-2147483647" + let _ = test "weioj3s" (lazy(sprintf "%d" (-2147483648))) "-2147483648" + + + let _ = test "weioj3d" (lazy(sprintf "print test %O with suffix" 1)) "print test 1 with suffix" + let _ = test "weioj3f" (lazy(sprintf "print test %O %O with suffix" 1 "xyz")) "print test 1 xyz with suffix" + let _ = test "weioj3g" (lazy(sprintf "print test %M with suffix" (System.Convert.ToDecimal(3)))) "print test 3 with suffix" + let _ = test "weioj3h" (lazy(sprintf "print test %M with suffix" (System.Convert.ToDecimal(3.02)))) "print test 3.02 with suffix" + + let _ = test "weioj3j" (lazy(sprintf "%O" 3I)) "3" + + + let _ = test "weiodasj3" (lazy(sprintf "%f" 0.0)) "0.000000" + let _ = test "weiogwej3" (lazy(sprintf "%10f" 0.0)) " 0.000000" + let _ = test "weiogwej3" (lazy(sprintf "%*f" 10 0.0)) " 0.000000" + let _ = test "weiobtj3" (lazy(sprintf "%7f" 0.0)) "0.000000" + let _ = test "weiobtj3" (lazy(sprintf "%*f" 7 0.0)) "0.000000" + let _ = test "weiorwej3" (lazy(sprintf "%7.1f" 0.0)) " 0.0" + let _ = test "weiorwej3" (lazy(sprintf "%*.1f" 7 0.0)) " 0.0" + let _ = test "weiorwej3" (lazy(sprintf "%7.*f" 1 0.0)) " 0.0" + let _ = test "weiorwej3" (lazy(sprintf "%*.*f" 7 1 0.0)) " 0.0" + let _ = test "weivewoj3" (lazy(sprintf "%7.2f" 0.0)) " 0.00" + let _ = test "weivewoj3" (lazy(sprintf "%*.2f" 7 0.0)) " 0.00" + let _ = test "weivewoj3" (lazy(sprintf "%*.*f" 7 2 0.0)) " 0.00" + let _ = test "weivewoj3" (lazy(sprintf "%7.*f" 2 0.0)) " 0.00" + let _ = test "weiqfoj3" (lazy(sprintf "%7.0f" 0.0)) " 0" + let _ = test "weiqfoj3" (lazy(sprintf "%*.0f" 7 0.0)) " 0" + let _ = test "weiqfoj3" (lazy(sprintf "%7.*f" 0 0.0)) " 0" + let _ = test "weiqfoj3" (lazy(sprintf "%*.*f" 7 0 0.0)) " 0" + let _ = test "weieroj3" (lazy(sprintf "%10.2e" 1.0)) " 1.00e+000" + let _ = test "weieroj3" (lazy(sprintf "%*.2e" 10 1.0)) " 1.00e+000" + let _ = test "weio34j3" (lazy(sprintf "%10.2E" 1.0)) " 1.00E+000" + let _ = test "weio34j3" (lazy(sprintf "%10.*E" 2 1.0)) " 1.00E+000" + let _ = test "weiberoj3" (lazy(sprintf "%10.3E" 1.0)) "1.000E+000" + let _ = test "weiberoj3" (lazy(sprintf "%10.*E" 3 1.0)) "1.000E+000" + let _ = test "weiqfwoj3" (lazy(sprintf "%10g" 1.0)) " 1" + let _ = test "weiqfwoj3" (lazy(sprintf "%*g" 10 1.0)) " 1" + let _ = test "weiof33j3" (lazy(sprintf "%10g" 1.01)) " 1.01" + let _ = test "weiof33j3" (lazy(sprintf "%*g" 10 1.01)) " 1.01" + let _ = test "wei54goj3" (lazy(sprintf "%-10g" 1.01)) "1.01 " + let _ = test "wei54goj3" (lazy(sprintf "%-*g" 10 1.01)) "1.01 " + let _ = test "weioqf3j3" (lazy(sprintf "%g" 1.01)) "1.01" + (* NEG: let _ = test "weioqf3j3" (lazy(sprintf "%g" 1)) "1.01" *) + + + let _ = test "wekodasj3" (lazy(sprintf "%f" 0.0f)) "0.000000" + let _ = test "wekogwej3" (lazy(sprintf "%10f" 0.0f)) " 0.000000" + let _ = test "wekobtj3" (lazy(sprintf "%7f" 0.0f)) "0.000000" + let _ = test "wekorwej3" (lazy(sprintf "%7.1f" 0.0f)) " 0.0" + let _ = test "wekvewoj3" (lazy(sprintf "%7.2f" 0.0f)) " 0.00" + let _ = test "wekqfoj3" (lazy(sprintf "%7.0f" 0.0f)) " 0" + let _ = test "wekeroj3" (lazy(sprintf "%10.2e" 1.0f)) " 1.00e+000" + let _ = test "weko34j3" (lazy(sprintf "%10.2E" 1.0f)) " 1.00E+000" + let _ = test "wekberoj3" (lazy(sprintf "%10.3E" 1.0f)) "1.000E+000" + let _ = test "wekqfwoj3" (lazy(sprintf "%10g" 1.0f)) " 1" + let _ = test "wekof33j3" (lazy(sprintf "%10g" 1.01f)) " 1.01" + let _ = test "wek54goj3" (lazy(sprintf "%-10g" 1.01f)) "1.01 " + let _ = test "wekoqf3j3" (lazy(sprintf "%g" 1.01f)) "1.01" + + + let _ = test "weioj3Q" (lazy(sprintf "%a" (fun () -> string) 10)) "10" + let _ = test "weioj3W" (lazy(sprintf "%a%a" (fun () s -> s+s) "a" (fun () s -> s+s) "b")) "aabb" + (* NEG: let _ = test "weioj3" (lazy(sprintf "%a" (fun () -> string_of_int) "a")) "10" *) + + let _ = test "weioj3ff" (lazy(try failwithf "%a%a" (fun () s -> s+s) "a" (fun () s -> s+s) "b" with Failure s -> s)) "aabb" + let _ = test "weioj3ffdd" (lazy(string (try if true then failwithf "%s" "abc" else 1 with Failure "abc" -> 2))) "2" + let _ = test "weioj3ffd2" (lazy(try if true then failwithf "%s" "abc" else "d"with Failure "abc" -> "e")) "e" + + let _ = test "weioj3" (lazy(sprintf "%t" (fun () -> "10"))) "10" + + let bug600 = sprintf "%d" + let _ = test "bug600a1" (lazy(bug600 2)) "2" + let _ = test "bug600b1" (lazy(bug600 2)) "2" (* not 22! *) + + let bug600b = sprintf "%s" + let _ = test "bug600a2" (lazy(bug600b "2")) "2" + let _ = test "bug600b2" (lazy(bug600b "2")) "2" (* not 22! *) + + let bug600c = sprintf "%x" + let _ = test "bug600a3" (lazy(bug600c 2)) "2" + let _ = test "bug600b3" (lazy(bug600c 2)) "2" (* not 22! *) + + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFy)) ("ff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFs)) ("ffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFF)) ("ffffffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFFFFFFFFFFL)) ("ffffffffffffffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFFn)) ("ffffffff") + + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFuy)) ("ff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFus)) ("ffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFFu)) ("ffffffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFFFFFFFFFFUL)) ("ffffffffffffffff") + let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFFun)) ("ffffffff") + () + +let func0()= + test "test1" (lazy(sprintf "%b" true)) "true" + test "test2" (lazy(sprintf "%5b" true)) " true" + test "test3" (lazy(sprintf "%1b" true)) "true" + test "test4" (lazy(sprintf "%*b" 7 true)) " true" + test "test5" (lazy(sprintf "%-b" true)) "true" + test "test6" (lazy(sprintf "%-5b" true)) "true " + test "test7" (lazy(sprintf "%-1b" true)) "true" + test "test8" (lazy(sprintf "%-*b" 7 true)) "true " + test "test9" (lazy(sprintf "%b" false)) "false" + test "test10" (lazy(sprintf "%5b" false)) "false" + test "test11" (lazy(sprintf "%1b" false)) "false" + test "test12" (lazy(sprintf "%*b" 7 false)) " false" + test "test13" (lazy(sprintf "%-b" false)) "false" + test "test14" (lazy(sprintf "%-5b" false)) "false" + test "test15" (lazy(sprintf "%-1b" false)) "false" + test "test16" (lazy(sprintf "%-*b" 7 false)) "false " + test "test17" (lazy(sprintf "%c" 'a')) "a" + test "test18" (lazy(sprintf "%5c" 'a')) " a" + test "test19" (lazy(sprintf "%1c" 'a')) "a" + test "test20" (lazy(sprintf "%*c" 7 'a')) " a" + test "test21" (lazy(sprintf "%-c" 'a')) "a" + test "test22" (lazy(sprintf "%-5c" 'a')) "a " + test "test23" (lazy(sprintf "%-1c" 'a')) "a" + test "test24" (lazy(sprintf "%-*c" 7 'a')) "a " + test "test25" (lazy(sprintf "%c" 'X')) "X" + test "test26" (lazy(sprintf "%5c" 'X')) " X" + test "test27" (lazy(sprintf "%1c" 'X')) "X" + test "test28" (lazy(sprintf "%*c" 7 'X')) " X" + test "test29" (lazy(sprintf "%-c" 'X')) "X" + test "test30" (lazy(sprintf "%-5c" 'X')) "X " + test "test31" (lazy(sprintf "%-1c" 'X')) "X" + test "test32" (lazy(sprintf "%-*c" 7 'X')) "X " + test "test33" (lazy(sprintf "%c" '\n')) "\n" + test "test34" (lazy(sprintf "%5c" '\n')) " \n" + test "test35" (lazy(sprintf "%1c" '\n')) "\n" + test "test36" (lazy(sprintf "%*c" 7 '\n')) " \n" + test "test37" (lazy(sprintf "%-c" '\n')) "\n" + test "test38" (lazy(sprintf "%-5c" '\n')) "\n " + test "test39" (lazy(sprintf "%-1c" '\n')) "\n" + test "test40" (lazy(sprintf "%-*c" 7 '\n')) "\n " + test "test41" (lazy(sprintf "%s" "test")) "test" + test "test42" (lazy(sprintf "%5s" "test")) " test" + test "test43" (lazy(sprintf "%1s" "test")) "test" + test "test44" (lazy(sprintf "%*s" 7 "test")) " test" + test "test45" (lazy(sprintf "%-s" "test")) "test" + test "test46" (lazy(sprintf "%-5s" "test")) "test " + test "test47" (lazy(sprintf "%-1s" "test")) "test" + test "test48" (lazy(sprintf "%-*s" 7 "test")) "test " + test "test49" (lazy(sprintf "%s" "value")) "value" + test "test50" (lazy(sprintf "%5s" "value")) "value" + test "test51" (lazy(sprintf "%1s" "value")) "value" + test "test52" (lazy(sprintf "%*s" 7 "value")) " value" + test "test53" (lazy(sprintf "%-s" "value")) "value" + test "test54" (lazy(sprintf "%-5s" "value")) "value" + test "test55" (lazy(sprintf "%-1s" "value")) "value" + test "test56" (lazy(sprintf "%-*s" 7 "value")) "value " + test "test57" (lazy(sprintf "%d" 14)) "14" + test "test58" (lazy(sprintf "%5d" 14)) " 14" + test "test59" (lazy(sprintf "%1d" 14)) "14" + test "test60" (lazy(sprintf "%*d" 7 14)) " 14" + test "test61" (lazy(sprintf "%-d" 14)) "14" + test "test62" (lazy(sprintf "%-5d" 14)) "14 " + test "test63" (lazy(sprintf "%-1d" 14)) "14" + test "test64" (lazy(sprintf "%-*d" 7 14)) "14 " + test "test65" (lazy(sprintf "%0d" 14)) "14" + test "test66" (lazy(sprintf "%05d" 14)) "00014" + test "test67" (lazy(sprintf "%01d" 14)) "14" + test "test68" (lazy(sprintf "%0*d" 7 14)) "0000014" + test "test69" (lazy(sprintf "%-0d" 14)) "14" + test "test70" (lazy(sprintf "%-05d" 14)) "14 " + test "test71" (lazy(sprintf "%-01d" 14)) "14" + test "test72" (lazy(sprintf "%-0*d" 7 14)) "14 " + test "test73" (lazy(sprintf "%+d" 14)) "+14" + test "test74" (lazy(sprintf "%+5d" 14)) " +14" + test "test75" (lazy(sprintf "%+1d" 14)) "+14" + test "test76" (lazy(sprintf "%+*d" 7 14)) " +14" + test "test77" (lazy(sprintf "%-+d" 14)) "+14" + test "test78" (lazy(sprintf "%-+5d" 14)) "+14 " + test "test79" (lazy(sprintf "%-+1d" 14)) "+14" + test "test80" (lazy(sprintf "%-+*d" 7 14)) "+14 " + test "test81" (lazy(sprintf "%+0d" 14)) "+14" + test "test82" (lazy(sprintf "%+05d" 14)) "+0014" + test "test83" (lazy(sprintf "%+01d" 14)) "+14" + test "test84" (lazy(sprintf "%+0*d" 7 14)) "+000014" + test "test85" (lazy(sprintf "%-+0d" 14)) "+14" + test "test86" (lazy(sprintf "%-+05d" 14)) "+14 " + test "test87" (lazy(sprintf "%-+01d" 14)) "+14" + test "test88" (lazy(sprintf "%-+0*d" 7 14)) "+14 " + test "test89" (lazy(sprintf "% d" 14)) " 14" + test "test90" (lazy(sprintf "% 5d" 14)) " 14" + test "test91" (lazy(sprintf "% 1d" 14)) " 14" + test "test92" (lazy(sprintf "% *d" 7 14)) " 14" + test "test93" (lazy(sprintf "%- d" 14)) " 14" + test "test94" (lazy(sprintf "%- 5d" 14)) " 14 " + test "test95" (lazy(sprintf "%- 1d" 14)) " 14" + test "test96" (lazy(sprintf "%- *d" 7 14)) " 14 " + test "test97" (lazy(sprintf "% 0d" 14)) " 14" + test "test98" (lazy(sprintf "% 05d" 14)) " 0014" + test "test99" (lazy(sprintf "% 01d" 14)) " 14" + test "test100" (lazy(sprintf "% 0*d" 7 14)) " 000014" + test "test101" (lazy(sprintf "%- 0d" 14)) " 14" + test "test102" (lazy(sprintf "%- 05d" 14)) " 14 " + test "test103" (lazy(sprintf "%- 01d" 14)) " 14" + test "test104" (lazy(sprintf "%- 0*d" 7 14)) " 14 " + test "test105" (lazy(sprintf "%d" -10)) "-10" + test "test106" (lazy(sprintf "%5d" -10)) " -10" + test "test107" (lazy(sprintf "%1d" -10)) "-10" + test "test108" (lazy(sprintf "%*d" 7 -10)) " -10" + test "test109" (lazy(sprintf "%-d" -10)) "-10" + test "test110" (lazy(sprintf "%-5d" -10)) "-10 " + test "test111" (lazy(sprintf "%-1d" -10)) "-10" + test "test112" (lazy(sprintf "%-*d" 7 -10)) "-10 " + test "test113" (lazy(sprintf "%0d" -10)) "-10" + test "test114" (lazy(sprintf "%05d" -10)) "-0010" + test "test115" (lazy(sprintf "%01d" -10)) "-10" + test "test116" (lazy(sprintf "%0*d" 7 -10)) "-000010" + test "test117" (lazy(sprintf "%-0d" -10)) "-10" + test "test118" (lazy(sprintf "%-05d" -10)) "-10 " + test "test119" (lazy(sprintf "%-01d" -10)) "-10" + test "test120" (lazy(sprintf "%-0*d" 7 -10)) "-10 " + test "test121" (lazy(sprintf "%+d" -10)) "-10" + test "test122" (lazy(sprintf "%+5d" -10)) " -10" + test "test123" (lazy(sprintf "%+1d" -10)) "-10" + test "test124" (lazy(sprintf "%+*d" 7 -10)) " -10" + test "test125" (lazy(sprintf "%-+d" -10)) "-10" + test "test126" (lazy(sprintf "%-+5d" -10)) "-10 " + test "test127" (lazy(sprintf "%-+1d" -10)) "-10" + test "test128" (lazy(sprintf "%-+*d" 7 -10)) "-10 " + test "test129" (lazy(sprintf "%+0d" -10)) "-10" + test "test130" (lazy(sprintf "%+05d" -10)) "-0010" + test "test131" (lazy(sprintf "%+01d" -10)) "-10" + test "test132" (lazy(sprintf "%+0*d" 7 -10)) "-000010" + test "test133" (lazy(sprintf "%-+0d" -10)) "-10" + test "test134" (lazy(sprintf "%-+05d" -10)) "-10 " + test "test135" (lazy(sprintf "%-+01d" -10)) "-10" + test "test136" (lazy(sprintf "%-+0*d" 7 -10)) "-10 " + test "test137" (lazy(sprintf "% d" -10)) "-10" + test "test138" (lazy(sprintf "% 5d" -10)) " -10" + test "test139" (lazy(sprintf "% 1d" -10)) "-10" + test "test140" (lazy(sprintf "% *d" 7 -10)) " -10" + test "test141" (lazy(sprintf "%- d" -10)) "-10" + test "test142" (lazy(sprintf "%- 5d" -10)) "-10 " + test "test143" (lazy(sprintf "%- 1d" -10)) "-10" + test "test144" (lazy(sprintf "%- *d" 7 -10)) "-10 " + test "test145" (lazy(sprintf "% 0d" -10)) "-10" + test "test146" (lazy(sprintf "% 05d" -10)) "-0010" + test "test147" (lazy(sprintf "% 01d" -10)) "-10" + test "test148" (lazy(sprintf "% 0*d" 7 -10)) "-000010" + test "test149" (lazy(sprintf "%- 0d" -10)) "-10" + test "test150" (lazy(sprintf "%- 05d" -10)) "-10 " + test "test151" (lazy(sprintf "%- 01d" -10)) "-10" + test "test152" (lazy(sprintf "%- 0*d" 7 -10)) "-10 " + test "test153" (lazy(sprintf "%d" 55s)) "55" + test "test154" (lazy(sprintf "%5d" 55s)) " 55" + test "test155" (lazy(sprintf "%1d" 55s)) "55" + test "test156" (lazy(sprintf "%*d" 7 55s)) " 55" + test "test157" (lazy(sprintf "%-d" 55s)) "55" + test "test158" (lazy(sprintf "%-5d" 55s)) "55 " + test "test159" (lazy(sprintf "%-1d" 55s)) "55" + test "test160" (lazy(sprintf "%-*d" 7 55s)) "55 " + test "test161" (lazy(sprintf "%0d" 55s)) "55" + test "test162" (lazy(sprintf "%05d" 55s)) "00055" + test "test163" (lazy(sprintf "%01d" 55s)) "55" + test "test164" (lazy(sprintf "%0*d" 7 55s)) "0000055" + test "test165" (lazy(sprintf "%-0d" 55s)) "55" + test "test166" (lazy(sprintf "%-05d" 55s)) "55 " + test "test167" (lazy(sprintf "%-01d" 55s)) "55" + test "test168" (lazy(sprintf "%-0*d" 7 55s)) "55 " + test "test169" (lazy(sprintf "%+d" 55s)) "+55" + test "test170" (lazy(sprintf "%+5d" 55s)) " +55" + test "test171" (lazy(sprintf "%+1d" 55s)) "+55" + test "test172" (lazy(sprintf "%+*d" 7 55s)) " +55" + test "test173" (lazy(sprintf "%-+d" 55s)) "+55" + test "test174" (lazy(sprintf "%-+5d" 55s)) "+55 " + test "test175" (lazy(sprintf "%-+1d" 55s)) "+55" + test "test176" (lazy(sprintf "%-+*d" 7 55s)) "+55 " + test "test177" (lazy(sprintf "%+0d" 55s)) "+55" + test "test178" (lazy(sprintf "%+05d" 55s)) "+0055" + test "test179" (lazy(sprintf "%+01d" 55s)) "+55" + test "test180" (lazy(sprintf "%+0*d" 7 55s)) "+000055" + test "test181" (lazy(sprintf "%-+0d" 55s)) "+55" + test "test182" (lazy(sprintf "%-+05d" 55s)) "+55 " + test "test183" (lazy(sprintf "%-+01d" 55s)) "+55" + test "test184" (lazy(sprintf "%-+0*d" 7 55s)) "+55 " + test "test185" (lazy(sprintf "% d" 55s)) " 55" + test "test186" (lazy(sprintf "% 5d" 55s)) " 55" + test "test187" (lazy(sprintf "% 1d" 55s)) " 55" + test "test188" (lazy(sprintf "% *d" 7 55s)) " 55" + test "test189" (lazy(sprintf "%- d" 55s)) " 55" + test "test190" (lazy(sprintf "%- 5d" 55s)) " 55 " + test "test191" (lazy(sprintf "%- 1d" 55s)) " 55" + test "test192" (lazy(sprintf "%- *d" 7 55s)) " 55 " + test "test193" (lazy(sprintf "% 0d" 55s)) " 55" + test "test194" (lazy(sprintf "% 05d" 55s)) " 0055" + test "test195" (lazy(sprintf "% 01d" 55s)) " 55" + test "test196" (lazy(sprintf "% 0*d" 7 55s)) " 000055" + test "test197" (lazy(sprintf "%- 0d" 55s)) " 55" + test "test198" (lazy(sprintf "%- 05d" 55s)) " 55 " + test "test199" (lazy(sprintf "%- 01d" 55s)) " 55" + test "test200" (lazy(sprintf "%- 0*d" 7 55s)) " 55 " + test "test201" (lazy(sprintf "%d" -88s)) "-88" + test "test202" (lazy(sprintf "%5d" -88s)) " -88" + test "test203" (lazy(sprintf "%1d" -88s)) "-88" + test "test204" (lazy(sprintf "%*d" 7 -88s)) " -88" + test "test205" (lazy(sprintf "%-d" -88s)) "-88" + test "test206" (lazy(sprintf "%-5d" -88s)) "-88 " + test "test207" (lazy(sprintf "%-1d" -88s)) "-88" + test "test208" (lazy(sprintf "%-*d" 7 -88s)) "-88 " + test "test209" (lazy(sprintf "%0d" -88s)) "-88" + test "test210" (lazy(sprintf "%05d" -88s)) "-0088" + test "test211" (lazy(sprintf "%01d" -88s)) "-88" + test "test212" (lazy(sprintf "%0*d" 7 -88s)) "-000088" + test "test213" (lazy(sprintf "%-0d" -88s)) "-88" + test "test214" (lazy(sprintf "%-05d" -88s)) "-88 " + test "test215" (lazy(sprintf "%-01d" -88s)) "-88" + test "test216" (lazy(sprintf "%-0*d" 7 -88s)) "-88 " + test "test217" (lazy(sprintf "%+d" -88s)) "-88" + test "test218" (lazy(sprintf "%+5d" -88s)) " -88" + test "test219" (lazy(sprintf "%+1d" -88s)) "-88" + test "test220" (lazy(sprintf "%+*d" 7 -88s)) " -88" + test "test221" (lazy(sprintf "%-+d" -88s)) "-88" + test "test222" (lazy(sprintf "%-+5d" -88s)) "-88 " + test "test223" (lazy(sprintf "%-+1d" -88s)) "-88" + test "test224" (lazy(sprintf "%-+*d" 7 -88s)) "-88 " + test "test225" (lazy(sprintf "%+0d" -88s)) "-88" + test "test226" (lazy(sprintf "%+05d" -88s)) "-0088" + test "test227" (lazy(sprintf "%+01d" -88s)) "-88" + test "test228" (lazy(sprintf "%+0*d" 7 -88s)) "-000088" + test "test229" (lazy(sprintf "%-+0d" -88s)) "-88" + test "test230" (lazy(sprintf "%-+05d" -88s)) "-88 " + test "test231" (lazy(sprintf "%-+01d" -88s)) "-88" + test "test232" (lazy(sprintf "%-+0*d" 7 -88s)) "-88 " + test "test233" (lazy(sprintf "% d" -88s)) "-88" + test "test234" (lazy(sprintf "% 5d" -88s)) " -88" + test "test235" (lazy(sprintf "% 1d" -88s)) "-88" + test "test236" (lazy(sprintf "% *d" 7 -88s)) " -88" + test "test237" (lazy(sprintf "%- d" -88s)) "-88" + test "test238" (lazy(sprintf "%- 5d" -88s)) "-88 " + test "test239" (lazy(sprintf "%- 1d" -88s)) "-88" + test "test240" (lazy(sprintf "%- *d" 7 -88s)) "-88 " + test "test241" (lazy(sprintf "% 0d" -88s)) "-88" + test "test242" (lazy(sprintf "% 05d" -88s)) "-0088" + test "test243" (lazy(sprintf "% 01d" -88s)) "-88" + test "test244" (lazy(sprintf "% 0*d" 7 -88s)) "-000088" + test "test245" (lazy(sprintf "%- 0d" -88s)) "-88" + test "test246" (lazy(sprintf "%- 05d" -88s)) "-88 " + test "test247" (lazy(sprintf "%- 01d" -88s)) "-88" + test "test248" (lazy(sprintf "%- 0*d" 7 -88s)) "-88 " + test "test249" (lazy(sprintf "%d" 104us)) "104" + test "test250" (lazy(sprintf "%5d" 104us)) " 104" + test "test251" (lazy(sprintf "%1d" 104us)) "104" + test "test252" (lazy(sprintf "%*d" 7 104us)) " 104" + test "test253" (lazy(sprintf "%-d" 104us)) "104" + test "test254" (lazy(sprintf "%-5d" 104us)) "104 " + test "test255" (lazy(sprintf "%-1d" 104us)) "104" + test "test256" (lazy(sprintf "%-*d" 7 104us)) "104 " + test "test257" (lazy(sprintf "%0d" 104us)) "104" + test "test258" (lazy(sprintf "%05d" 104us)) "00104" + test "test259" (lazy(sprintf "%01d" 104us)) "104" + test "test260" (lazy(sprintf "%0*d" 7 104us)) "0000104" + test "test261" (lazy(sprintf "%-0d" 104us)) "104" + test "test262" (lazy(sprintf "%-05d" 104us)) "104 " + test "test263" (lazy(sprintf "%-01d" 104us)) "104" + test "test264" (lazy(sprintf "%-0*d" 7 104us)) "104 " + test "test265" (lazy(sprintf "%+d" 104us)) "+104" + test "test266" (lazy(sprintf "%+5d" 104us)) " +104" + test "test267" (lazy(sprintf "%+1d" 104us)) "+104" + test "test268" (lazy(sprintf "%+*d" 7 104us)) " +104" + test "test269" (lazy(sprintf "%-+d" 104us)) "+104" + test "test270" (lazy(sprintf "%-+5d" 104us)) "+104 " + test "test271" (lazy(sprintf "%-+1d" 104us)) "+104" + test "test272" (lazy(sprintf "%-+*d" 7 104us)) "+104 " + test "test273" (lazy(sprintf "%+0d" 104us)) "+104" + test "test274" (lazy(sprintf "%+05d" 104us)) "+0104" + test "test275" (lazy(sprintf "%+01d" 104us)) "+104" + test "test276" (lazy(sprintf "%+0*d" 7 104us)) "+000104" + test "test277" (lazy(sprintf "%-+0d" 104us)) "+104" + test "test278" (lazy(sprintf "%-+05d" 104us)) "+104 " + test "test279" (lazy(sprintf "%-+01d" 104us)) "+104" + test "test280" (lazy(sprintf "%-+0*d" 7 104us)) "+104 " + test "test281" (lazy(sprintf "% d" 104us)) " 104" + test "test282" (lazy(sprintf "% 5d" 104us)) " 104" + test "test283" (lazy(sprintf "% 1d" 104us)) " 104" + test "test284" (lazy(sprintf "% *d" 7 104us)) " 104" + test "test285" (lazy(sprintf "%- d" 104us)) " 104" + test "test286" (lazy(sprintf "%- 5d" 104us)) " 104 " + test "test287" (lazy(sprintf "%- 1d" 104us)) " 104" + test "test288" (lazy(sprintf "%- *d" 7 104us)) " 104 " + test "test289" (lazy(sprintf "% 0d" 104us)) " 104" + test "test290" (lazy(sprintf "% 05d" 104us)) " 0104" + test "test291" (lazy(sprintf "% 01d" 104us)) " 104" + test "test292" (lazy(sprintf "% 0*d" 7 104us)) " 000104" + test "test293" (lazy(sprintf "%- 0d" 104us)) " 104" + test "test294" (lazy(sprintf "%- 05d" 104us)) " 104 " + test "test295" (lazy(sprintf "%- 01d" 104us)) " 104" + test "test296" (lazy(sprintf "%- 0*d" 7 104us)) " 104 " + test "test297" (lazy(sprintf "%d" 12y)) "12" + test "test298" (lazy(sprintf "%5d" 12y)) " 12" + test "test299" (lazy(sprintf "%1d" 12y)) "12" + test "test300" (lazy(sprintf "%*d" 7 12y)) " 12" + test "test301" (lazy(sprintf "%-d" 12y)) "12" + test "test302" (lazy(sprintf "%-5d" 12y)) "12 " + test "test303" (lazy(sprintf "%-1d" 12y)) "12" + test "test304" (lazy(sprintf "%-*d" 7 12y)) "12 " + test "test305" (lazy(sprintf "%0d" 12y)) "12" + test "test306" (lazy(sprintf "%05d" 12y)) "00012" + test "test307" (lazy(sprintf "%01d" 12y)) "12" + test "test308" (lazy(sprintf "%0*d" 7 12y)) "0000012" + test "test309" (lazy(sprintf "%-0d" 12y)) "12" + test "test310" (lazy(sprintf "%-05d" 12y)) "12 " + test "test311" (lazy(sprintf "%-01d" 12y)) "12" + test "test312" (lazy(sprintf "%-0*d" 7 12y)) "12 " + test "test313" (lazy(sprintf "%+d" 12y)) "+12" + test "test314" (lazy(sprintf "%+5d" 12y)) " +12" + test "test315" (lazy(sprintf "%+1d" 12y)) "+12" + test "test316" (lazy(sprintf "%+*d" 7 12y)) " +12" + test "test317" (lazy(sprintf "%-+d" 12y)) "+12" + test "test318" (lazy(sprintf "%-+5d" 12y)) "+12 " + test "test319" (lazy(sprintf "%-+1d" 12y)) "+12" + test "test320" (lazy(sprintf "%-+*d" 7 12y)) "+12 " + test "test321" (lazy(sprintf "%+0d" 12y)) "+12" + test "test322" (lazy(sprintf "%+05d" 12y)) "+0012" + test "test323" (lazy(sprintf "%+01d" 12y)) "+12" + test "test324" (lazy(sprintf "%+0*d" 7 12y)) "+000012" + test "test325" (lazy(sprintf "%-+0d" 12y)) "+12" + test "test326" (lazy(sprintf "%-+05d" 12y)) "+12 " + test "test327" (lazy(sprintf "%-+01d" 12y)) "+12" + test "test328" (lazy(sprintf "%-+0*d" 7 12y)) "+12 " + test "test329" (lazy(sprintf "% d" 12y)) " 12" + test "test330" (lazy(sprintf "% 5d" 12y)) " 12" + test "test331" (lazy(sprintf "% 1d" 12y)) " 12" + test "test332" (lazy(sprintf "% *d" 7 12y)) " 12" + test "test333" (lazy(sprintf "%- d" 12y)) " 12" + test "test334" (lazy(sprintf "%- 5d" 12y)) " 12 " + test "test335" (lazy(sprintf "%- 1d" 12y)) " 12" + test "test336" (lazy(sprintf "%- *d" 7 12y)) " 12 " + test "test337" (lazy(sprintf "% 0d" 12y)) " 12" + test "test338" (lazy(sprintf "% 05d" 12y)) " 0012" + test "test339" (lazy(sprintf "% 01d" 12y)) " 12" + test "test340" (lazy(sprintf "% 0*d" 7 12y)) " 000012" + test "test341" (lazy(sprintf "%- 0d" 12y)) " 12" + test "test342" (lazy(sprintf "%- 05d" 12y)) " 12 " + test "test343" (lazy(sprintf "%- 01d" 12y)) " 12" + test "test344" (lazy(sprintf "%- 0*d" 7 12y)) " 12 " + test "test345" (lazy(sprintf "%d" -94y)) "-94" + test "test346" (lazy(sprintf "%5d" -94y)) " -94" + test "test347" (lazy(sprintf "%1d" -94y)) "-94" + test "test348" (lazy(sprintf "%*d" 7 -94y)) " -94" + test "test349" (lazy(sprintf "%-d" -94y)) "-94" + test "test350" (lazy(sprintf "%-5d" -94y)) "-94 " + test "test351" (lazy(sprintf "%-1d" -94y)) "-94" + test "test352" (lazy(sprintf "%-*d" 7 -94y)) "-94 " + test "test353" (lazy(sprintf "%0d" -94y)) "-94" + test "test354" (lazy(sprintf "%05d" -94y)) "-0094" + test "test355" (lazy(sprintf "%01d" -94y)) "-94" + test "test356" (lazy(sprintf "%0*d" 7 -94y)) "-000094" + test "test357" (lazy(sprintf "%-0d" -94y)) "-94" + test "test358" (lazy(sprintf "%-05d" -94y)) "-94 " + test "test359" (lazy(sprintf "%-01d" -94y)) "-94" + test "test360" (lazy(sprintf "%-0*d" 7 -94y)) "-94 " + test "test361" (lazy(sprintf "%+d" -94y)) "-94" + test "test362" (lazy(sprintf "%+5d" -94y)) " -94" + test "test363" (lazy(sprintf "%+1d" -94y)) "-94" + test "test364" (lazy(sprintf "%+*d" 7 -94y)) " -94" + test "test365" (lazy(sprintf "%-+d" -94y)) "-94" + test "test366" (lazy(sprintf "%-+5d" -94y)) "-94 " + test "test367" (lazy(sprintf "%-+1d" -94y)) "-94" + test "test368" (lazy(sprintf "%-+*d" 7 -94y)) "-94 " + test "test369" (lazy(sprintf "%+0d" -94y)) "-94" + test "test370" (lazy(sprintf "%+05d" -94y)) "-0094" + test "test371" (lazy(sprintf "%+01d" -94y)) "-94" + test "test372" (lazy(sprintf "%+0*d" 7 -94y)) "-000094" + test "test373" (lazy(sprintf "%-+0d" -94y)) "-94" + test "test374" (lazy(sprintf "%-+05d" -94y)) "-94 " + test "test375" (lazy(sprintf "%-+01d" -94y)) "-94" + test "test376" (lazy(sprintf "%-+0*d" 7 -94y)) "-94 " + test "test377" (lazy(sprintf "% d" -94y)) "-94" + test "test378" (lazy(sprintf "% 5d" -94y)) " -94" + test "test379" (lazy(sprintf "% 1d" -94y)) "-94" + test "test380" (lazy(sprintf "% *d" 7 -94y)) " -94" + test "test381" (lazy(sprintf "%- d" -94y)) "-94" + test "test382" (lazy(sprintf "%- 5d" -94y)) "-94 " + test "test383" (lazy(sprintf "%- 1d" -94y)) "-94" + test "test384" (lazy(sprintf "%- *d" 7 -94y)) "-94 " + test "test385" (lazy(sprintf "% 0d" -94y)) "-94" + test "test386" (lazy(sprintf "% 05d" -94y)) "-0094" + test "test387" (lazy(sprintf "% 01d" -94y)) "-94" + test "test388" (lazy(sprintf "% 0*d" 7 -94y)) "-000094" + test "test389" (lazy(sprintf "%- 0d" -94y)) "-94" + test "test390" (lazy(sprintf "%- 05d" -94y)) "-94 " + test "test391" (lazy(sprintf "%- 01d" -94y)) "-94" + test "test392" (lazy(sprintf "%- 0*d" 7 -94y)) "-94 " + test "test393" (lazy(sprintf "%d" 88uy)) "88" + test "test394" (lazy(sprintf "%5d" 88uy)) " 88" + test "test395" (lazy(sprintf "%1d" 88uy)) "88" + test "test396" (lazy(sprintf "%*d" 7 88uy)) " 88" + test "test397" (lazy(sprintf "%-d" 88uy)) "88" + test "test398" (lazy(sprintf "%-5d" 88uy)) "88 " + test "test399" (lazy(sprintf "%-1d" 88uy)) "88" + test "test400" (lazy(sprintf "%-*d" 7 88uy)) "88 " + test "test401" (lazy(sprintf "%0d" 88uy)) "88" + test "test402" (lazy(sprintf "%05d" 88uy)) "00088" + test "test403" (lazy(sprintf "%01d" 88uy)) "88" + test "test404" (lazy(sprintf "%0*d" 7 88uy)) "0000088" + test "test405" (lazy(sprintf "%-0d" 88uy)) "88" + test "test406" (lazy(sprintf "%-05d" 88uy)) "88 " + test "test407" (lazy(sprintf "%-01d" 88uy)) "88" + test "test408" (lazy(sprintf "%-0*d" 7 88uy)) "88 " + test "test409" (lazy(sprintf "%+d" 88uy)) "+88" + test "test410" (lazy(sprintf "%+5d" 88uy)) " +88" + test "test411" (lazy(sprintf "%+1d" 88uy)) "+88" + test "test412" (lazy(sprintf "%+*d" 7 88uy)) " +88" + test "test413" (lazy(sprintf "%-+d" 88uy)) "+88" + test "test414" (lazy(sprintf "%-+5d" 88uy)) "+88 " + test "test415" (lazy(sprintf "%-+1d" 88uy)) "+88" + test "test416" (lazy(sprintf "%-+*d" 7 88uy)) "+88 " + test "test417" (lazy(sprintf "%+0d" 88uy)) "+88" + test "test418" (lazy(sprintf "%+05d" 88uy)) "+0088" + test "test419" (lazy(sprintf "%+01d" 88uy)) "+88" + test "test420" (lazy(sprintf "%+0*d" 7 88uy)) "+000088" + test "test421" (lazy(sprintf "%-+0d" 88uy)) "+88" + test "test422" (lazy(sprintf "%-+05d" 88uy)) "+88 " + test "test423" (lazy(sprintf "%-+01d" 88uy)) "+88" + test "test424" (lazy(sprintf "%-+0*d" 7 88uy)) "+88 " + test "test425" (lazy(sprintf "% d" 88uy)) " 88" + test "test426" (lazy(sprintf "% 5d" 88uy)) " 88" + test "test427" (lazy(sprintf "% 1d" 88uy)) " 88" + test "test428" (lazy(sprintf "% *d" 7 88uy)) " 88" + test "test429" (lazy(sprintf "%- d" 88uy)) " 88" + test "test430" (lazy(sprintf "%- 5d" 88uy)) " 88 " + test "test431" (lazy(sprintf "%- 1d" 88uy)) " 88" + test "test432" (lazy(sprintf "%- *d" 7 88uy)) " 88 " + test "test433" (lazy(sprintf "% 0d" 88uy)) " 88" + test "test434" (lazy(sprintf "% 05d" 88uy)) " 0088" + test "test435" (lazy(sprintf "% 01d" 88uy)) " 88" + test "test436" (lazy(sprintf "% 0*d" 7 88uy)) " 000088" + test "test437" (lazy(sprintf "%- 0d" 88uy)) " 88" + test "test438" (lazy(sprintf "%- 05d" 88uy)) " 88 " + test "test439" (lazy(sprintf "%- 01d" 88uy)) " 88" + test "test440" (lazy(sprintf "%- 0*d" 7 88uy)) " 88 " + test "test441" (lazy(sprintf "%d" 999L)) "999" + test "test442" (lazy(sprintf "%5d" 999L)) " 999" + test "test443" (lazy(sprintf "%1d" 999L)) "999" + test "test444" (lazy(sprintf "%*d" 7 999L)) " 999" + test "test445" (lazy(sprintf "%-d" 999L)) "999" + test "test446" (lazy(sprintf "%-5d" 999L)) "999 " + test "test447" (lazy(sprintf "%-1d" 999L)) "999" + test "test448" (lazy(sprintf "%-*d" 7 999L)) "999 " + test "test449" (lazy(sprintf "%0d" 999L)) "999" + test "test450" (lazy(sprintf "%05d" 999L)) "00999" + test "test451" (lazy(sprintf "%01d" 999L)) "999" + test "test452" (lazy(sprintf "%0*d" 7 999L)) "0000999" + test "test453" (lazy(sprintf "%-0d" 999L)) "999" + test "test454" (lazy(sprintf "%-05d" 999L)) "999 " + test "test455" (lazy(sprintf "%-01d" 999L)) "999" + test "test456" (lazy(sprintf "%-0*d" 7 999L)) "999 " + test "test457" (lazy(sprintf "%+d" 999L)) "+999" + test "test458" (lazy(sprintf "%+5d" 999L)) " +999" + test "test459" (lazy(sprintf "%+1d" 999L)) "+999" + test "test460" (lazy(sprintf "%+*d" 7 999L)) " +999" + test "test461" (lazy(sprintf "%-+d" 999L)) "+999" + test "test462" (lazy(sprintf "%-+5d" 999L)) "+999 " + test "test463" (lazy(sprintf "%-+1d" 999L)) "+999" + test "test464" (lazy(sprintf "%-+*d" 7 999L)) "+999 " + test "test465" (lazy(sprintf "%+0d" 999L)) "+999" + test "test466" (lazy(sprintf "%+05d" 999L)) "+0999" + test "test467" (lazy(sprintf "%+01d" 999L)) "+999" + test "test468" (lazy(sprintf "%+0*d" 7 999L)) "+000999" + test "test469" (lazy(sprintf "%-+0d" 999L)) "+999" + test "test470" (lazy(sprintf "%-+05d" 999L)) "+999 " + test "test471" (lazy(sprintf "%-+01d" 999L)) "+999" + test "test472" (lazy(sprintf "%-+0*d" 7 999L)) "+999 " + test "test473" (lazy(sprintf "% d" 999L)) " 999" + test "test474" (lazy(sprintf "% 5d" 999L)) " 999" + test "test475" (lazy(sprintf "% 1d" 999L)) " 999" + test "test476" (lazy(sprintf "% *d" 7 999L)) " 999" + test "test477" (lazy(sprintf "%- d" 999L)) " 999" + test "test478" (lazy(sprintf "%- 5d" 999L)) " 999 " + test "test479" (lazy(sprintf "%- 1d" 999L)) " 999" + test "test480" (lazy(sprintf "%- *d" 7 999L)) " 999 " + test "test481" (lazy(sprintf "% 0d" 999L)) " 999" + test "test482" (lazy(sprintf "% 05d" 999L)) " 0999" + test "test483" (lazy(sprintf "% 01d" 999L)) " 999" + test "test484" (lazy(sprintf "% 0*d" 7 999L)) " 000999" + test "test485" (lazy(sprintf "%- 0d" 999L)) " 999" + test "test486" (lazy(sprintf "%- 05d" 999L)) " 999 " + test "test487" (lazy(sprintf "%- 01d" 999L)) " 999" + test "test488" (lazy(sprintf "%- 0*d" 7 999L)) " 999 " + test "test489" (lazy(sprintf "%d" -321L)) "-321" + test "test490" (lazy(sprintf "%5d" -321L)) " -321" + test "test491" (lazy(sprintf "%1d" -321L)) "-321" + test "test492" (lazy(sprintf "%*d" 7 -321L)) " -321" + test "test493" (lazy(sprintf "%-d" -321L)) "-321" + test "test494" (lazy(sprintf "%-5d" -321L)) "-321 " + test "test495" (lazy(sprintf "%-1d" -321L)) "-321" + test "test496" (lazy(sprintf "%-*d" 7 -321L)) "-321 " + test "test497" (lazy(sprintf "%0d" -321L)) "-321" + test "test498" (lazy(sprintf "%05d" -321L)) "-0321" + test "test499" (lazy(sprintf "%01d" -321L)) "-321" + test "test500" (lazy(sprintf "%0*d" 7 -321L)) "-000321" + test "test501" (lazy(sprintf "%-0d" -321L)) "-321" + test "test502" (lazy(sprintf "%-05d" -321L)) "-321 " + test "test503" (lazy(sprintf "%-01d" -321L)) "-321" + test "test504" (lazy(sprintf "%-0*d" 7 -321L)) "-321 " + test "test505" (lazy(sprintf "%+d" -321L)) "-321" + test "test506" (lazy(sprintf "%+5d" -321L)) " -321" + test "test507" (lazy(sprintf "%+1d" -321L)) "-321" + test "test508" (lazy(sprintf "%+*d" 7 -321L)) " -321" + test "test509" (lazy(sprintf "%-+d" -321L)) "-321" + test "test510" (lazy(sprintf "%-+5d" -321L)) "-321 " + test "test511" (lazy(sprintf "%-+1d" -321L)) "-321" + test "test512" (lazy(sprintf "%-+*d" 7 -321L)) "-321 " + test "test513" (lazy(sprintf "%+0d" -321L)) "-321" + test "test514" (lazy(sprintf "%+05d" -321L)) "-0321" + test "test515" (lazy(sprintf "%+01d" -321L)) "-321" + test "test516" (lazy(sprintf "%+0*d" 7 -321L)) "-000321" + test "test517" (lazy(sprintf "%-+0d" -321L)) "-321" + test "test518" (lazy(sprintf "%-+05d" -321L)) "-321 " + test "test519" (lazy(sprintf "%-+01d" -321L)) "-321" + test "test520" (lazy(sprintf "%-+0*d" 7 -321L)) "-321 " + test "test521" (lazy(sprintf "% d" -321L)) "-321" + test "test522" (lazy(sprintf "% 5d" -321L)) " -321" + test "test523" (lazy(sprintf "% 1d" -321L)) "-321" + test "test524" (lazy(sprintf "% *d" 7 -321L)) " -321" + test "test525" (lazy(sprintf "%- d" -321L)) "-321" + test "test526" (lazy(sprintf "%- 5d" -321L)) "-321 " + test "test527" (lazy(sprintf "%- 1d" -321L)) "-321" + test "test528" (lazy(sprintf "%- *d" 7 -321L)) "-321 " + test "test529" (lazy(sprintf "% 0d" -321L)) "-321" + test "test530" (lazy(sprintf "% 05d" -321L)) "-0321" + test "test531" (lazy(sprintf "% 01d" -321L)) "-321" + test "test532" (lazy(sprintf "% 0*d" 7 -321L)) "-000321" + test "test533" (lazy(sprintf "%- 0d" -321L)) "-321" + test "test534" (lazy(sprintf "%- 05d" -321L)) "-321 " + test "test535" (lazy(sprintf "%- 01d" -321L)) "-321" + test "test536" (lazy(sprintf "%- 0*d" 7 -321L)) "-321 " + test "test537" (lazy(sprintf "%d" 50000UL)) "50000" + test "test538" (lazy(sprintf "%5d" 50000UL)) "50000" + test "test539" (lazy(sprintf "%1d" 50000UL)) "50000" + test "test540" (lazy(sprintf "%*d" 7 50000UL)) " 50000" + test "test541" (lazy(sprintf "%-d" 50000UL)) "50000" + test "test542" (lazy(sprintf "%-5d" 50000UL)) "50000" + test "test543" (lazy(sprintf "%-1d" 50000UL)) "50000" + test "test544" (lazy(sprintf "%-*d" 7 50000UL)) "50000 " + test "test545" (lazy(sprintf "%0d" 50000UL)) "50000" + test "test546" (lazy(sprintf "%05d" 50000UL)) "50000" + test "test547" (lazy(sprintf "%01d" 50000UL)) "50000" + test "test548" (lazy(sprintf "%0*d" 7 50000UL)) "0050000" + test "test549" (lazy(sprintf "%-0d" 50000UL)) "50000" + test "test550" (lazy(sprintf "%-05d" 50000UL)) "50000" + test "test551" (lazy(sprintf "%-01d" 50000UL)) "50000" + test "test552" (lazy(sprintf "%-0*d" 7 50000UL)) "50000 " + test "test553" (lazy(sprintf "%+d" 50000UL)) "+50000" + test "test554" (lazy(sprintf "%+5d" 50000UL)) "+50000" + test "test555" (lazy(sprintf "%+1d" 50000UL)) "+50000" + test "test556" (lazy(sprintf "%+*d" 7 50000UL)) " +50000" + test "test557" (lazy(sprintf "%-+d" 50000UL)) "+50000" + test "test558" (lazy(sprintf "%-+5d" 50000UL)) "+50000" + test "test559" (lazy(sprintf "%-+1d" 50000UL)) "+50000" + test "test560" (lazy(sprintf "%-+*d" 7 50000UL)) "+50000 " + test "test561" (lazy(sprintf "%+0d" 50000UL)) "+50000" + test "test562" (lazy(sprintf "%+05d" 50000UL)) "+50000" + test "test563" (lazy(sprintf "%+01d" 50000UL)) "+50000" + test "test564" (lazy(sprintf "%+0*d" 7 50000UL)) "+050000" + test "test565" (lazy(sprintf "%-+0d" 50000UL)) "+50000" + test "test566" (lazy(sprintf "%-+05d" 50000UL)) "+50000" + test "test567" (lazy(sprintf "%-+01d" 50000UL)) "+50000" + test "test568" (lazy(sprintf "%-+0*d" 7 50000UL)) "+50000 " + test "test569" (lazy(sprintf "% d" 50000UL)) " 50000" + test "test570" (lazy(sprintf "% 5d" 50000UL)) " 50000" + test "test571" (lazy(sprintf "% 1d" 50000UL)) " 50000" + test "test572" (lazy(sprintf "% *d" 7 50000UL)) " 50000" + test "test573" (lazy(sprintf "%- d" 50000UL)) " 50000" + test "test574" (lazy(sprintf "%- 5d" 50000UL)) " 50000" + test "test575" (lazy(sprintf "%- 1d" 50000UL)) " 50000" + test "test576" (lazy(sprintf "%- *d" 7 50000UL)) " 50000 " + test "test577" (lazy(sprintf "% 0d" 50000UL)) " 50000" + test "test578" (lazy(sprintf "% 05d" 50000UL)) " 50000" + test "test579" (lazy(sprintf "% 01d" 50000UL)) " 50000" + test "test580" (lazy(sprintf "% 0*d" 7 50000UL)) " 050000" + test "test581" (lazy(sprintf "%- 0d" 50000UL)) " 50000" + test "test582" (lazy(sprintf "%- 05d" 50000UL)) " 50000" + test "test583" (lazy(sprintf "%- 01d" 50000UL)) " 50000" + test "test584" (lazy(sprintf "%- 0*d" 7 50000UL)) " 50000 " + test "test585" (lazy(sprintf "%d" System.Int32.MaxValue)) "2147483647" + test "test586" (lazy(sprintf "%5d" System.Int32.MaxValue)) "2147483647" + test "test587" (lazy(sprintf "%1d" System.Int32.MaxValue)) "2147483647" + test "test588" (lazy(sprintf "%*d" 7 System.Int32.MaxValue)) "2147483647" + test "test589" (lazy(sprintf "%-d" System.Int32.MaxValue)) "2147483647" + test "test590" (lazy(sprintf "%-5d" System.Int32.MaxValue)) "2147483647" + test "test591" (lazy(sprintf "%-1d" System.Int32.MaxValue)) "2147483647" + test "test592" (lazy(sprintf "%-*d" 7 System.Int32.MaxValue)) "2147483647" + test "test593" (lazy(sprintf "%0d" System.Int32.MaxValue)) "2147483647" + test "test594" (lazy(sprintf "%05d" System.Int32.MaxValue)) "2147483647" + test "test595" (lazy(sprintf "%01d" System.Int32.MaxValue)) "2147483647" + test "test596" (lazy(sprintf "%0*d" 7 System.Int32.MaxValue)) "2147483647" + test "test597" (lazy(sprintf "%-0d" System.Int32.MaxValue)) "2147483647" + test "test598" (lazy(sprintf "%-05d" System.Int32.MaxValue)) "2147483647" + test "test599" (lazy(sprintf "%-01d" System.Int32.MaxValue)) "2147483647" + test "test600" (lazy(sprintf "%-0*d" 7 System.Int32.MaxValue)) "2147483647" + test "test601" (lazy(sprintf "%+d" System.Int32.MaxValue)) "+2147483647" + test "test602" (lazy(sprintf "%+5d" System.Int32.MaxValue)) "+2147483647" + test "test603" (lazy(sprintf "%+1d" System.Int32.MaxValue)) "+2147483647" + test "test604" (lazy(sprintf "%+*d" 7 System.Int32.MaxValue)) "+2147483647" + test "test605" (lazy(sprintf "%-+d" System.Int32.MaxValue)) "+2147483647" + test "test606" (lazy(sprintf "%-+5d" System.Int32.MaxValue)) "+2147483647" + test "test607" (lazy(sprintf "%-+1d" System.Int32.MaxValue)) "+2147483647" + test "test608" (lazy(sprintf "%-+*d" 7 System.Int32.MaxValue)) "+2147483647" + test "test609" (lazy(sprintf "%+0d" System.Int32.MaxValue)) "+2147483647" + test "test610" (lazy(sprintf "%+05d" System.Int32.MaxValue)) "+2147483647" + test "test611" (lazy(sprintf "%+01d" System.Int32.MaxValue)) "+2147483647" + test "test612" (lazy(sprintf "%+0*d" 7 System.Int32.MaxValue)) "+2147483647" + test "test613" (lazy(sprintf "%-+0d" System.Int32.MaxValue)) "+2147483647" + test "test614" (lazy(sprintf "%-+05d" System.Int32.MaxValue)) "+2147483647" + test "test615" (lazy(sprintf "%-+01d" System.Int32.MaxValue)) "+2147483647" + test "test616" (lazy(sprintf "%-+0*d" 7 System.Int32.MaxValue)) "+2147483647" + test "test617" (lazy(sprintf "% d" System.Int32.MaxValue)) " 2147483647" + test "test618" (lazy(sprintf "% 5d" System.Int32.MaxValue)) " 2147483647" + test "test619" (lazy(sprintf "% 1d" System.Int32.MaxValue)) " 2147483647" + test "test620" (lazy(sprintf "% *d" 7 System.Int32.MaxValue)) " 2147483647" + test "test621" (lazy(sprintf "%- d" System.Int32.MaxValue)) " 2147483647" + test "test622" (lazy(sprintf "%- 5d" System.Int32.MaxValue)) " 2147483647" + test "test623" (lazy(sprintf "%- 1d" System.Int32.MaxValue)) " 2147483647" + test "test624" (lazy(sprintf "%- *d" 7 System.Int32.MaxValue)) " 2147483647" + test "test625" (lazy(sprintf "% 0d" System.Int32.MaxValue)) " 2147483647" + test "test626" (lazy(sprintf "% 05d" System.Int32.MaxValue)) " 2147483647" + test "test627" (lazy(sprintf "% 01d" System.Int32.MaxValue)) " 2147483647" + test "test628" (lazy(sprintf "% 0*d" 7 System.Int32.MaxValue)) " 2147483647" + test "test629" (lazy(sprintf "%- 0d" System.Int32.MaxValue)) " 2147483647" + test "test630" (lazy(sprintf "%- 05d" System.Int32.MaxValue)) " 2147483647" + test "test631" (lazy(sprintf "%- 01d" System.Int32.MaxValue)) " 2147483647" + test "test632" (lazy(sprintf "%- 0*d" 7 System.Int32.MaxValue)) " 2147483647" + test "test633" (lazy(sprintf "%d" System.Int64.MaxValue)) "9223372036854775807" + test "test634" (lazy(sprintf "%5d" System.Int64.MaxValue)) "9223372036854775807" + test "test635" (lazy(sprintf "%1d" System.Int64.MaxValue)) "9223372036854775807" + test "test636" (lazy(sprintf "%*d" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test637" (lazy(sprintf "%-d" System.Int64.MaxValue)) "9223372036854775807" + test "test638" (lazy(sprintf "%-5d" System.Int64.MaxValue)) "9223372036854775807" + test "test639" (lazy(sprintf "%-1d" System.Int64.MaxValue)) "9223372036854775807" + test "test640" (lazy(sprintf "%-*d" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test641" (lazy(sprintf "%0d" System.Int64.MaxValue)) "9223372036854775807" + test "test642" (lazy(sprintf "%05d" System.Int64.MaxValue)) "9223372036854775807" + test "test643" (lazy(sprintf "%01d" System.Int64.MaxValue)) "9223372036854775807" + test "test644" (lazy(sprintf "%0*d" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test645" (lazy(sprintf "%-0d" System.Int64.MaxValue)) "9223372036854775807" + test "test646" (lazy(sprintf "%-05d" System.Int64.MaxValue)) "9223372036854775807" + test "test647" (lazy(sprintf "%-01d" System.Int64.MaxValue)) "9223372036854775807" + test "test648" (lazy(sprintf "%-0*d" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test649" (lazy(sprintf "%+d" System.Int64.MaxValue)) "+9223372036854775807" + test "test650" (lazy(sprintf "%+5d" System.Int64.MaxValue)) "+9223372036854775807" + test "test651" (lazy(sprintf "%+1d" System.Int64.MaxValue)) "+9223372036854775807" + test "test652" (lazy(sprintf "%+*d" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test653" (lazy(sprintf "%-+d" System.Int64.MaxValue)) "+9223372036854775807" + test "test654" (lazy(sprintf "%-+5d" System.Int64.MaxValue)) "+9223372036854775807" + test "test655" (lazy(sprintf "%-+1d" System.Int64.MaxValue)) "+9223372036854775807" + test "test656" (lazy(sprintf "%-+*d" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test657" (lazy(sprintf "%+0d" System.Int64.MaxValue)) "+9223372036854775807" + test "test658" (lazy(sprintf "%+05d" System.Int64.MaxValue)) "+9223372036854775807" + test "test659" (lazy(sprintf "%+01d" System.Int64.MaxValue)) "+9223372036854775807" + test "test660" (lazy(sprintf "%+0*d" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test661" (lazy(sprintf "%-+0d" System.Int64.MaxValue)) "+9223372036854775807" + test "test662" (lazy(sprintf "%-+05d" System.Int64.MaxValue)) "+9223372036854775807" + test "test663" (lazy(sprintf "%-+01d" System.Int64.MaxValue)) "+9223372036854775807" + test "test664" (lazy(sprintf "%-+0*d" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test665" (lazy(sprintf "% d" System.Int64.MaxValue)) " 9223372036854775807" + test "test666" (lazy(sprintf "% 5d" System.Int64.MaxValue)) " 9223372036854775807" + test "test667" (lazy(sprintf "% 1d" System.Int64.MaxValue)) " 9223372036854775807" + test "test668" (lazy(sprintf "% *d" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test669" (lazy(sprintf "%- d" System.Int64.MaxValue)) " 9223372036854775807" + test "test670" (lazy(sprintf "%- 5d" System.Int64.MaxValue)) " 9223372036854775807" + test "test671" (lazy(sprintf "%- 1d" System.Int64.MaxValue)) " 9223372036854775807" + test "test672" (lazy(sprintf "%- *d" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test673" (lazy(sprintf "% 0d" System.Int64.MaxValue)) " 9223372036854775807" + test "test674" (lazy(sprintf "% 05d" System.Int64.MaxValue)) " 9223372036854775807" + test "test675" (lazy(sprintf "% 01d" System.Int64.MaxValue)) " 9223372036854775807" + test "test676" (lazy(sprintf "% 0*d" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test677" (lazy(sprintf "%- 0d" System.Int64.MaxValue)) " 9223372036854775807" + test "test678" (lazy(sprintf "%- 05d" System.Int64.MaxValue)) " 9223372036854775807" + test "test679" (lazy(sprintf "%- 01d" System.Int64.MaxValue)) " 9223372036854775807" + test "test680" (lazy(sprintf "%- 0*d" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test681" (lazy(sprintf "%d" System.Int32.MinValue)) "-2147483648" + test "test682" (lazy(sprintf "%5d" System.Int32.MinValue)) "-2147483648" + test "test683" (lazy(sprintf "%1d" System.Int32.MinValue)) "-2147483648" + test "test684" (lazy(sprintf "%*d" 7 System.Int32.MinValue)) "-2147483648" + test "test685" (lazy(sprintf "%-d" System.Int32.MinValue)) "-2147483648" + test "test686" (lazy(sprintf "%-5d" System.Int32.MinValue)) "-2147483648" + test "test687" (lazy(sprintf "%-1d" System.Int32.MinValue)) "-2147483648" + test "test688" (lazy(sprintf "%-*d" 7 System.Int32.MinValue)) "-2147483648" + test "test689" (lazy(sprintf "%0d" System.Int32.MinValue)) "-2147483648" + test "test690" (lazy(sprintf "%05d" System.Int32.MinValue)) "-2147483648" + test "test691" (lazy(sprintf "%01d" System.Int32.MinValue)) "-2147483648" + test "test692" (lazy(sprintf "%0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test693" (lazy(sprintf "%-0d" System.Int32.MinValue)) "-2147483648" + test "test694" (lazy(sprintf "%-05d" System.Int32.MinValue)) "-2147483648" + test "test695" (lazy(sprintf "%-01d" System.Int32.MinValue)) "-2147483648" + test "test696" (lazy(sprintf "%-0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test697" (lazy(sprintf "%+d" System.Int32.MinValue)) "-2147483648" + test "test698" (lazy(sprintf "%+5d" System.Int32.MinValue)) "-2147483648" + test "test699" (lazy(sprintf "%+1d" System.Int32.MinValue)) "-2147483648" + test "test700" (lazy(sprintf "%+*d" 7 System.Int32.MinValue)) "-2147483648" + test "test701" (lazy(sprintf "%-+d" System.Int32.MinValue)) "-2147483648" + test "test702" (lazy(sprintf "%-+5d" System.Int32.MinValue)) "-2147483648" + test "test703" (lazy(sprintf "%-+1d" System.Int32.MinValue)) "-2147483648" + test "test704" (lazy(sprintf "%-+*d" 7 System.Int32.MinValue)) "-2147483648" + test "test705" (lazy(sprintf "%+0d" System.Int32.MinValue)) "-2147483648" + test "test706" (lazy(sprintf "%+05d" System.Int32.MinValue)) "-2147483648" + test "test707" (lazy(sprintf "%+01d" System.Int32.MinValue)) "-2147483648" + test "test708" (lazy(sprintf "%+0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test709" (lazy(sprintf "%-+0d" System.Int32.MinValue)) "-2147483648" + test "test710" (lazy(sprintf "%-+05d" System.Int32.MinValue)) "-2147483648" + test "test711" (lazy(sprintf "%-+01d" System.Int32.MinValue)) "-2147483648" + test "test712" (lazy(sprintf "%-+0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test713" (lazy(sprintf "% d" System.Int32.MinValue)) "-2147483648" + test "test714" (lazy(sprintf "% 5d" System.Int32.MinValue)) "-2147483648" + test "test715" (lazy(sprintf "% 1d" System.Int32.MinValue)) "-2147483648" + test "test716" (lazy(sprintf "% *d" 7 System.Int32.MinValue)) "-2147483648" + test "test717" (lazy(sprintf "%- d" System.Int32.MinValue)) "-2147483648" + test "test718" (lazy(sprintf "%- 5d" System.Int32.MinValue)) "-2147483648" + test "test719" (lazy(sprintf "%- 1d" System.Int32.MinValue)) "-2147483648" + test "test720" (lazy(sprintf "%- *d" 7 System.Int32.MinValue)) "-2147483648" + test "test721" (lazy(sprintf "% 0d" System.Int32.MinValue)) "-2147483648" + test "test722" (lazy(sprintf "% 05d" System.Int32.MinValue)) "-2147483648" + test "test723" (lazy(sprintf "% 01d" System.Int32.MinValue)) "-2147483648" + test "test724" (lazy(sprintf "% 0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test725" (lazy(sprintf "%- 0d" System.Int32.MinValue)) "-2147483648" + test "test726" (lazy(sprintf "%- 05d" System.Int32.MinValue)) "-2147483648" + test "test727" (lazy(sprintf "%- 01d" System.Int32.MinValue)) "-2147483648" + test "test728" (lazy(sprintf "%- 0*d" 7 System.Int32.MinValue)) "-2147483648" + test "test729" (lazy(sprintf "%d" System.Int64.MinValue)) "-9223372036854775808" + test "test730" (lazy(sprintf "%5d" System.Int64.MinValue)) "-9223372036854775808" + test "test731" (lazy(sprintf "%1d" System.Int64.MinValue)) "-9223372036854775808" + test "test732" (lazy(sprintf "%*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test733" (lazy(sprintf "%-d" System.Int64.MinValue)) "-9223372036854775808" + test "test734" (lazy(sprintf "%-5d" System.Int64.MinValue)) "-9223372036854775808" + test "test735" (lazy(sprintf "%-1d" System.Int64.MinValue)) "-9223372036854775808" + test "test736" (lazy(sprintf "%-*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test737" (lazy(sprintf "%0d" System.Int64.MinValue)) "-9223372036854775808" + test "test738" (lazy(sprintf "%05d" System.Int64.MinValue)) "-9223372036854775808" + test "test739" (lazy(sprintf "%01d" System.Int64.MinValue)) "-9223372036854775808" + test "test740" (lazy(sprintf "%0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test741" (lazy(sprintf "%-0d" System.Int64.MinValue)) "-9223372036854775808" + test "test742" (lazy(sprintf "%-05d" System.Int64.MinValue)) "-9223372036854775808" + test "test743" (lazy(sprintf "%-01d" System.Int64.MinValue)) "-9223372036854775808" + test "test744" (lazy(sprintf "%-0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test745" (lazy(sprintf "%+d" System.Int64.MinValue)) "-9223372036854775808" + test "test746" (lazy(sprintf "%+5d" System.Int64.MinValue)) "-9223372036854775808" + test "test747" (lazy(sprintf "%+1d" System.Int64.MinValue)) "-9223372036854775808" + test "test748" (lazy(sprintf "%+*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test749" (lazy(sprintf "%-+d" System.Int64.MinValue)) "-9223372036854775808" + test "test750" (lazy(sprintf "%-+5d" System.Int64.MinValue)) "-9223372036854775808" + test "test751" (lazy(sprintf "%-+1d" System.Int64.MinValue)) "-9223372036854775808" + test "test752" (lazy(sprintf "%-+*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test753" (lazy(sprintf "%+0d" System.Int64.MinValue)) "-9223372036854775808" + test "test754" (lazy(sprintf "%+05d" System.Int64.MinValue)) "-9223372036854775808" + test "test755" (lazy(sprintf "%+01d" System.Int64.MinValue)) "-9223372036854775808" + test "test756" (lazy(sprintf "%+0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test757" (lazy(sprintf "%-+0d" System.Int64.MinValue)) "-9223372036854775808" + test "test758" (lazy(sprintf "%-+05d" System.Int64.MinValue)) "-9223372036854775808" + test "test759" (lazy(sprintf "%-+01d" System.Int64.MinValue)) "-9223372036854775808" + test "test760" (lazy(sprintf "%-+0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test761" (lazy(sprintf "% d" System.Int64.MinValue)) "-9223372036854775808" + test "test762" (lazy(sprintf "% 5d" System.Int64.MinValue)) "-9223372036854775808" + test "test763" (lazy(sprintf "% 1d" System.Int64.MinValue)) "-9223372036854775808" + test "test764" (lazy(sprintf "% *d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test765" (lazy(sprintf "%- d" System.Int64.MinValue)) "-9223372036854775808" + test "test766" (lazy(sprintf "%- 5d" System.Int64.MinValue)) "-9223372036854775808" + test "test767" (lazy(sprintf "%- 1d" System.Int64.MinValue)) "-9223372036854775808" + test "test768" (lazy(sprintf "%- *d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test769" (lazy(sprintf "% 0d" System.Int64.MinValue)) "-9223372036854775808" + test "test770" (lazy(sprintf "% 05d" System.Int64.MinValue)) "-9223372036854775808" + test "test771" (lazy(sprintf "% 01d" System.Int64.MinValue)) "-9223372036854775808" + test "test772" (lazy(sprintf "% 0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test773" (lazy(sprintf "%- 0d" System.Int64.MinValue)) "-9223372036854775808" + test "test774" (lazy(sprintf "%- 05d" System.Int64.MinValue)) "-9223372036854775808" + test "test775" (lazy(sprintf "%- 01d" System.Int64.MinValue)) "-9223372036854775808" + test "test776" (lazy(sprintf "%- 0*d" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test777" (lazy(sprintf "%d" 55n)) "55" + test "test778" (lazy(sprintf "%5d" 55n)) " 55" + test "test779" (lazy(sprintf "%1d" 55n)) "55" + test "test780" (lazy(sprintf "%*d" 7 55n)) " 55" + test "test781" (lazy(sprintf "%-d" 55n)) "55" + test "test782" (lazy(sprintf "%-5d" 55n)) "55 " + test "test783" (lazy(sprintf "%-1d" 55n)) "55" + test "test784" (lazy(sprintf "%-*d" 7 55n)) "55 " + test "test785" (lazy(sprintf "%0d" 55n)) "55" + test "test786" (lazy(sprintf "%05d" 55n)) "00055" + test "test787" (lazy(sprintf "%01d" 55n)) "55" + test "test788" (lazy(sprintf "%0*d" 7 55n)) "0000055" + test "test789" (lazy(sprintf "%-0d" 55n)) "55" + test "test790" (lazy(sprintf "%-05d" 55n)) "55 " + test "test791" (lazy(sprintf "%-01d" 55n)) "55" + test "test792" (lazy(sprintf "%-0*d" 7 55n)) "55 " + test "test793" (lazy(sprintf "%+d" 55n)) "+55" + test "test794" (lazy(sprintf "%+5d" 55n)) " +55" + test "test795" (lazy(sprintf "%+1d" 55n)) "+55" + test "test796" (lazy(sprintf "%+*d" 7 55n)) " +55" + test "test797" (lazy(sprintf "%-+d" 55n)) "+55" + test "test798" (lazy(sprintf "%-+5d" 55n)) "+55 " + test "test799" (lazy(sprintf "%-+1d" 55n)) "+55" + test "test800" (lazy(sprintf "%-+*d" 7 55n)) "+55 " + test "test801" (lazy(sprintf "%+0d" 55n)) "+55" + test "test802" (lazy(sprintf "%+05d" 55n)) "+0055" + test "test803" (lazy(sprintf "%+01d" 55n)) "+55" + test "test804" (lazy(sprintf "%+0*d" 7 55n)) "+000055" + test "test805" (lazy(sprintf "%-+0d" 55n)) "+55" + test "test806" (lazy(sprintf "%-+05d" 55n)) "+55 " + test "test807" (lazy(sprintf "%-+01d" 55n)) "+55" + test "test808" (lazy(sprintf "%-+0*d" 7 55n)) "+55 " + test "test809" (lazy(sprintf "% d" 55n)) " 55" + test "test810" (lazy(sprintf "% 5d" 55n)) " 55" + test "test811" (lazy(sprintf "% 1d" 55n)) " 55" + test "test812" (lazy(sprintf "% *d" 7 55n)) " 55" + test "test813" (lazy(sprintf "%- d" 55n)) " 55" + test "test814" (lazy(sprintf "%- 5d" 55n)) " 55 " + test "test815" (lazy(sprintf "%- 1d" 55n)) " 55" + test "test816" (lazy(sprintf "%- *d" 7 55n)) " 55 " + test "test817" (lazy(sprintf "% 0d" 55n)) " 55" + test "test818" (lazy(sprintf "% 05d" 55n)) " 0055" + test "test819" (lazy(sprintf "% 01d" 55n)) " 55" + test "test820" (lazy(sprintf "% 0*d" 7 55n)) " 000055" + test "test821" (lazy(sprintf "%- 0d" 55n)) " 55" + test "test822" (lazy(sprintf "%- 05d" 55n)) " 55 " + test "test823" (lazy(sprintf "%- 01d" 55n)) " 55" + test "test824" (lazy(sprintf "%- 0*d" 7 55n)) " 55 " + test "test825" (lazy(sprintf "%d" 999un)) "999" + test "test826" (lazy(sprintf "%5d" 999un)) " 999" + test "test827" (lazy(sprintf "%1d" 999un)) "999" + test "test828" (lazy(sprintf "%*d" 7 999un)) " 999" + test "test829" (lazy(sprintf "%-d" 999un)) "999" + test "test830" (lazy(sprintf "%-5d" 999un)) "999 " + test "test831" (lazy(sprintf "%-1d" 999un)) "999" + test "test832" (lazy(sprintf "%-*d" 7 999un)) "999 " + test "test833" (lazy(sprintf "%0d" 999un)) "999" + test "test834" (lazy(sprintf "%05d" 999un)) "00999" + test "test835" (lazy(sprintf "%01d" 999un)) "999" + test "test836" (lazy(sprintf "%0*d" 7 999un)) "0000999" + test "test837" (lazy(sprintf "%-0d" 999un)) "999" + test "test838" (lazy(sprintf "%-05d" 999un)) "999 " + test "test839" (lazy(sprintf "%-01d" 999un)) "999" + test "test840" (lazy(sprintf "%-0*d" 7 999un)) "999 " + test "test841" (lazy(sprintf "%+d" 999un)) "+999" + test "test842" (lazy(sprintf "%+5d" 999un)) " +999" + test "test843" (lazy(sprintf "%+1d" 999un)) "+999" + test "test844" (lazy(sprintf "%+*d" 7 999un)) " +999" + test "test845" (lazy(sprintf "%-+d" 999un)) "+999" + test "test846" (lazy(sprintf "%-+5d" 999un)) "+999 " + test "test847" (lazy(sprintf "%-+1d" 999un)) "+999" + test "test848" (lazy(sprintf "%-+*d" 7 999un)) "+999 " + test "test849" (lazy(sprintf "%+0d" 999un)) "+999" + test "test850" (lazy(sprintf "%+05d" 999un)) "+0999" + test "test851" (lazy(sprintf "%+01d" 999un)) "+999" + test "test852" (lazy(sprintf "%+0*d" 7 999un)) "+000999" + test "test853" (lazy(sprintf "%-+0d" 999un)) "+999" + test "test854" (lazy(sprintf "%-+05d" 999un)) "+999 " + test "test855" (lazy(sprintf "%-+01d" 999un)) "+999" + test "test856" (lazy(sprintf "%-+0*d" 7 999un)) "+999 " + test "test857" (lazy(sprintf "% d" 999un)) " 999" + test "test858" (lazy(sprintf "% 5d" 999un)) " 999" + test "test859" (lazy(sprintf "% 1d" 999un)) " 999" + test "test860" (lazy(sprintf "% *d" 7 999un)) " 999" + test "test861" (lazy(sprintf "%- d" 999un)) " 999" + test "test862" (lazy(sprintf "%- 5d" 999un)) " 999 " + test "test863" (lazy(sprintf "%- 1d" 999un)) " 999" + test "test864" (lazy(sprintf "%- *d" 7 999un)) " 999 " + test "test865" (lazy(sprintf "% 0d" 999un)) " 999" + test "test866" (lazy(sprintf "% 05d" 999un)) " 0999" + test "test867" (lazy(sprintf "% 01d" 999un)) " 999" + test "test868" (lazy(sprintf "% 0*d" 7 999un)) " 000999" + test "test869" (lazy(sprintf "%- 0d" 999un)) " 999" + test "test870" (lazy(sprintf "%- 05d" 999un)) " 999 " + test "test871" (lazy(sprintf "%- 01d" 999un)) " 999" + test "test872" (lazy(sprintf "%- 0*d" 7 999un)) " 999 " + test "test873" (lazy(sprintf "%i" 14)) "14" + test "test874" (lazy(sprintf "%5i" 14)) " 14" + test "test875" (lazy(sprintf "%1i" 14)) "14" + test "test876" (lazy(sprintf "%*i" 7 14)) " 14" + test "test877" (lazy(sprintf "%-i" 14)) "14" + test "test878" (lazy(sprintf "%-5i" 14)) "14 " + test "test879" (lazy(sprintf "%-1i" 14)) "14" + test "test880" (lazy(sprintf "%-*i" 7 14)) "14 " + test "test881" (lazy(sprintf "%0i" 14)) "14" + test "test882" (lazy(sprintf "%05i" 14)) "00014" + test "test883" (lazy(sprintf "%01i" 14)) "14" + test "test884" (lazy(sprintf "%0*i" 7 14)) "0000014" + test "test885" (lazy(sprintf "%-0i" 14)) "14" + test "test886" (lazy(sprintf "%-05i" 14)) "14 " + test "test887" (lazy(sprintf "%-01i" 14)) "14" + test "test888" (lazy(sprintf "%-0*i" 7 14)) "14 " + test "test889" (lazy(sprintf "%+i" 14)) "+14" + test "test890" (lazy(sprintf "%+5i" 14)) " +14" + test "test891" (lazy(sprintf "%+1i" 14)) "+14" + test "test892" (lazy(sprintf "%+*i" 7 14)) " +14" + test "test893" (lazy(sprintf "%-+i" 14)) "+14" + test "test894" (lazy(sprintf "%-+5i" 14)) "+14 " + test "test895" (lazy(sprintf "%-+1i" 14)) "+14" + test "test896" (lazy(sprintf "%-+*i" 7 14)) "+14 " + test "test897" (lazy(sprintf "%+0i" 14)) "+14" + test "test898" (lazy(sprintf "%+05i" 14)) "+0014" + test "test899" (lazy(sprintf "%+01i" 14)) "+14" + test "test900" (lazy(sprintf "%+0*i" 7 14)) "+000014" + test "test901" (lazy(sprintf "%-+0i" 14)) "+14" + test "test902" (lazy(sprintf "%-+05i" 14)) "+14 " + test "test903" (lazy(sprintf "%-+01i" 14)) "+14" + test "test904" (lazy(sprintf "%-+0*i" 7 14)) "+14 " + test "test905" (lazy(sprintf "% i" 14)) " 14" + test "test906" (lazy(sprintf "% 5i" 14)) " 14" + test "test907" (lazy(sprintf "% 1i" 14)) " 14" + test "test908" (lazy(sprintf "% *i" 7 14)) " 14" + test "test909" (lazy(sprintf "%- i" 14)) " 14" + test "test910" (lazy(sprintf "%- 5i" 14)) " 14 " + test "test911" (lazy(sprintf "%- 1i" 14)) " 14" + test "test912" (lazy(sprintf "%- *i" 7 14)) " 14 " + test "test913" (lazy(sprintf "% 0i" 14)) " 14" + test "test914" (lazy(sprintf "% 05i" 14)) " 0014" + test "test915" (lazy(sprintf "% 01i" 14)) " 14" + test "test916" (lazy(sprintf "% 0*i" 7 14)) " 000014" + test "test917" (lazy(sprintf "%- 0i" 14)) " 14" + test "test918" (lazy(sprintf "%- 05i" 14)) " 14 " + test "test919" (lazy(sprintf "%- 01i" 14)) " 14" + test "test920" (lazy(sprintf "%- 0*i" 7 14)) " 14 " + test "test921" (lazy(sprintf "%i" -10)) "-10" + test "test922" (lazy(sprintf "%5i" -10)) " -10" + test "test923" (lazy(sprintf "%1i" -10)) "-10" + test "test924" (lazy(sprintf "%*i" 7 -10)) " -10" + test "test925" (lazy(sprintf "%-i" -10)) "-10" + test "test926" (lazy(sprintf "%-5i" -10)) "-10 " + test "test927" (lazy(sprintf "%-1i" -10)) "-10" + test "test928" (lazy(sprintf "%-*i" 7 -10)) "-10 " + test "test929" (lazy(sprintf "%0i" -10)) "-10" + test "test930" (lazy(sprintf "%05i" -10)) "-0010" + test "test931" (lazy(sprintf "%01i" -10)) "-10" + test "test932" (lazy(sprintf "%0*i" 7 -10)) "-000010" + test "test933" (lazy(sprintf "%-0i" -10)) "-10" + test "test934" (lazy(sprintf "%-05i" -10)) "-10 " + test "test935" (lazy(sprintf "%-01i" -10)) "-10" + test "test936" (lazy(sprintf "%-0*i" 7 -10)) "-10 " + test "test937" (lazy(sprintf "%+i" -10)) "-10" + test "test938" (lazy(sprintf "%+5i" -10)) " -10" + test "test939" (lazy(sprintf "%+1i" -10)) "-10" + test "test940" (lazy(sprintf "%+*i" 7 -10)) " -10" + test "test941" (lazy(sprintf "%-+i" -10)) "-10" + test "test942" (lazy(sprintf "%-+5i" -10)) "-10 " + test "test943" (lazy(sprintf "%-+1i" -10)) "-10" + test "test944" (lazy(sprintf "%-+*i" 7 -10)) "-10 " + test "test945" (lazy(sprintf "%+0i" -10)) "-10" + test "test946" (lazy(sprintf "%+05i" -10)) "-0010" + test "test947" (lazy(sprintf "%+01i" -10)) "-10" + test "test948" (lazy(sprintf "%+0*i" 7 -10)) "-000010" + test "test949" (lazy(sprintf "%-+0i" -10)) "-10" + test "test950" (lazy(sprintf "%-+05i" -10)) "-10 " + test "test951" (lazy(sprintf "%-+01i" -10)) "-10" + test "test952" (lazy(sprintf "%-+0*i" 7 -10)) "-10 " + test "test953" (lazy(sprintf "% i" -10)) "-10" + test "test954" (lazy(sprintf "% 5i" -10)) " -10" + test "test955" (lazy(sprintf "% 1i" -10)) "-10" + test "test956" (lazy(sprintf "% *i" 7 -10)) " -10" + test "test957" (lazy(sprintf "%- i" -10)) "-10" + test "test958" (lazy(sprintf "%- 5i" -10)) "-10 " + test "test959" (lazy(sprintf "%- 1i" -10)) "-10" + test "test960" (lazy(sprintf "%- *i" 7 -10)) "-10 " + test "test961" (lazy(sprintf "% 0i" -10)) "-10" + test "test962" (lazy(sprintf "% 05i" -10)) "-0010" + test "test963" (lazy(sprintf "% 01i" -10)) "-10" + test "test964" (lazy(sprintf "% 0*i" 7 -10)) "-000010" + test "test965" (lazy(sprintf "%- 0i" -10)) "-10" + test "test966" (lazy(sprintf "%- 05i" -10)) "-10 " + test "test967" (lazy(sprintf "%- 01i" -10)) "-10" + test "test968" (lazy(sprintf "%- 0*i" 7 -10)) "-10 " + test "test969" (lazy(sprintf "%i" 55s)) "55" + test "test970" (lazy(sprintf "%5i" 55s)) " 55" + test "test971" (lazy(sprintf "%1i" 55s)) "55" + test "test972" (lazy(sprintf "%*i" 7 55s)) " 55" + test "test973" (lazy(sprintf "%-i" 55s)) "55" + test "test974" (lazy(sprintf "%-5i" 55s)) "55 " + test "test975" (lazy(sprintf "%-1i" 55s)) "55" + test "test976" (lazy(sprintf "%-*i" 7 55s)) "55 " + test "test977" (lazy(sprintf "%0i" 55s)) "55" + test "test978" (lazy(sprintf "%05i" 55s)) "00055" + test "test979" (lazy(sprintf "%01i" 55s)) "55" + test "test980" (lazy(sprintf "%0*i" 7 55s)) "0000055" + test "test981" (lazy(sprintf "%-0i" 55s)) "55" + test "test982" (lazy(sprintf "%-05i" 55s)) "55 " + test "test983" (lazy(sprintf "%-01i" 55s)) "55" + test "test984" (lazy(sprintf "%-0*i" 7 55s)) "55 " + test "test985" (lazy(sprintf "%+i" 55s)) "+55" + test "test986" (lazy(sprintf "%+5i" 55s)) " +55" + test "test987" (lazy(sprintf "%+1i" 55s)) "+55" + test "test988" (lazy(sprintf "%+*i" 7 55s)) " +55" + test "test989" (lazy(sprintf "%-+i" 55s)) "+55" + test "test990" (lazy(sprintf "%-+5i" 55s)) "+55 " + test "test991" (lazy(sprintf "%-+1i" 55s)) "+55" + test "test992" (lazy(sprintf "%-+*i" 7 55s)) "+55 " + test "test993" (lazy(sprintf "%+0i" 55s)) "+55" + test "test994" (lazy(sprintf "%+05i" 55s)) "+0055" + test "test995" (lazy(sprintf "%+01i" 55s)) "+55" + test "test996" (lazy(sprintf "%+0*i" 7 55s)) "+000055" + test "test997" (lazy(sprintf "%-+0i" 55s)) "+55" + test "test998" (lazy(sprintf "%-+05i" 55s)) "+55 " + test "test999" (lazy(sprintf "%-+01i" 55s)) "+55" + test "test1000" (lazy(sprintf "%-+0*i" 7 55s)) "+55 " +let func1000()= + test "test1001" (lazy(sprintf "% i" 55s)) " 55" + test "test1002" (lazy(sprintf "% 5i" 55s)) " 55" + test "test1003" (lazy(sprintf "% 1i" 55s)) " 55" + test "test1004" (lazy(sprintf "% *i" 7 55s)) " 55" + test "test1005" (lazy(sprintf "%- i" 55s)) " 55" + test "test1006" (lazy(sprintf "%- 5i" 55s)) " 55 " + test "test1007" (lazy(sprintf "%- 1i" 55s)) " 55" + test "test1008" (lazy(sprintf "%- *i" 7 55s)) " 55 " + test "test1009" (lazy(sprintf "% 0i" 55s)) " 55" + test "test1010" (lazy(sprintf "% 05i" 55s)) " 0055" + test "test1011" (lazy(sprintf "% 01i" 55s)) " 55" + test "test1012" (lazy(sprintf "% 0*i" 7 55s)) " 000055" + test "test1013" (lazy(sprintf "%- 0i" 55s)) " 55" + test "test1014" (lazy(sprintf "%- 05i" 55s)) " 55 " + test "test1015" (lazy(sprintf "%- 01i" 55s)) " 55" + test "test1016" (lazy(sprintf "%- 0*i" 7 55s)) " 55 " + test "test1017" (lazy(sprintf "%i" -88s)) "-88" + test "test1018" (lazy(sprintf "%5i" -88s)) " -88" + test "test1019" (lazy(sprintf "%1i" -88s)) "-88" + test "test1020" (lazy(sprintf "%*i" 7 -88s)) " -88" + test "test1021" (lazy(sprintf "%-i" -88s)) "-88" + test "test1022" (lazy(sprintf "%-5i" -88s)) "-88 " + test "test1023" (lazy(sprintf "%-1i" -88s)) "-88" + test "test1024" (lazy(sprintf "%-*i" 7 -88s)) "-88 " + test "test1025" (lazy(sprintf "%0i" -88s)) "-88" + test "test1026" (lazy(sprintf "%05i" -88s)) "-0088" + test "test1027" (lazy(sprintf "%01i" -88s)) "-88" + test "test1028" (lazy(sprintf "%0*i" 7 -88s)) "-000088" + test "test1029" (lazy(sprintf "%-0i" -88s)) "-88" + test "test1030" (lazy(sprintf "%-05i" -88s)) "-88 " + test "test1031" (lazy(sprintf "%-01i" -88s)) "-88" + test "test1032" (lazy(sprintf "%-0*i" 7 -88s)) "-88 " + test "test1033" (lazy(sprintf "%+i" -88s)) "-88" + test "test1034" (lazy(sprintf "%+5i" -88s)) " -88" + test "test1035" (lazy(sprintf "%+1i" -88s)) "-88" + test "test1036" (lazy(sprintf "%+*i" 7 -88s)) " -88" + test "test1037" (lazy(sprintf "%-+i" -88s)) "-88" + test "test1038" (lazy(sprintf "%-+5i" -88s)) "-88 " + test "test1039" (lazy(sprintf "%-+1i" -88s)) "-88" + test "test1040" (lazy(sprintf "%-+*i" 7 -88s)) "-88 " + test "test1041" (lazy(sprintf "%+0i" -88s)) "-88" + test "test1042" (lazy(sprintf "%+05i" -88s)) "-0088" + test "test1043" (lazy(sprintf "%+01i" -88s)) "-88" + test "test1044" (lazy(sprintf "%+0*i" 7 -88s)) "-000088" + test "test1045" (lazy(sprintf "%-+0i" -88s)) "-88" + test "test1046" (lazy(sprintf "%-+05i" -88s)) "-88 " + test "test1047" (lazy(sprintf "%-+01i" -88s)) "-88" + test "test1048" (lazy(sprintf "%-+0*i" 7 -88s)) "-88 " + test "test1049" (lazy(sprintf "% i" -88s)) "-88" + test "test1050" (lazy(sprintf "% 5i" -88s)) " -88" + test "test1051" (lazy(sprintf "% 1i" -88s)) "-88" + test "test1052" (lazy(sprintf "% *i" 7 -88s)) " -88" + test "test1053" (lazy(sprintf "%- i" -88s)) "-88" + test "test1054" (lazy(sprintf "%- 5i" -88s)) "-88 " + test "test1055" (lazy(sprintf "%- 1i" -88s)) "-88" + test "test1056" (lazy(sprintf "%- *i" 7 -88s)) "-88 " + test "test1057" (lazy(sprintf "% 0i" -88s)) "-88" + test "test1058" (lazy(sprintf "% 05i" -88s)) "-0088" + test "test1059" (lazy(sprintf "% 01i" -88s)) "-88" + test "test1060" (lazy(sprintf "% 0*i" 7 -88s)) "-000088" + test "test1061" (lazy(sprintf "%- 0i" -88s)) "-88" + test "test1062" (lazy(sprintf "%- 05i" -88s)) "-88 " + test "test1063" (lazy(sprintf "%- 01i" -88s)) "-88" + test "test1064" (lazy(sprintf "%- 0*i" 7 -88s)) "-88 " + test "test1065" (lazy(sprintf "%i" 104us)) "104" + test "test1066" (lazy(sprintf "%5i" 104us)) " 104" + test "test1067" (lazy(sprintf "%1i" 104us)) "104" + test "test1068" (lazy(sprintf "%*i" 7 104us)) " 104" + test "test1069" (lazy(sprintf "%-i" 104us)) "104" + test "test1070" (lazy(sprintf "%-5i" 104us)) "104 " + test "test1071" (lazy(sprintf "%-1i" 104us)) "104" + test "test1072" (lazy(sprintf "%-*i" 7 104us)) "104 " + test "test1073" (lazy(sprintf "%0i" 104us)) "104" + test "test1074" (lazy(sprintf "%05i" 104us)) "00104" + test "test1075" (lazy(sprintf "%01i" 104us)) "104" + test "test1076" (lazy(sprintf "%0*i" 7 104us)) "0000104" + test "test1077" (lazy(sprintf "%-0i" 104us)) "104" + test "test1078" (lazy(sprintf "%-05i" 104us)) "104 " + test "test1079" (lazy(sprintf "%-01i" 104us)) "104" + test "test1080" (lazy(sprintf "%-0*i" 7 104us)) "104 " + test "test1081" (lazy(sprintf "%+i" 104us)) "+104" + test "test1082" (lazy(sprintf "%+5i" 104us)) " +104" + test "test1083" (lazy(sprintf "%+1i" 104us)) "+104" + test "test1084" (lazy(sprintf "%+*i" 7 104us)) " +104" + test "test1085" (lazy(sprintf "%-+i" 104us)) "+104" + test "test1086" (lazy(sprintf "%-+5i" 104us)) "+104 " + test "test1087" (lazy(sprintf "%-+1i" 104us)) "+104" + test "test1088" (lazy(sprintf "%-+*i" 7 104us)) "+104 " + test "test1089" (lazy(sprintf "%+0i" 104us)) "+104" + test "test1090" (lazy(sprintf "%+05i" 104us)) "+0104" + test "test1091" (lazy(sprintf "%+01i" 104us)) "+104" + test "test1092" (lazy(sprintf "%+0*i" 7 104us)) "+000104" + test "test1093" (lazy(sprintf "%-+0i" 104us)) "+104" + test "test1094" (lazy(sprintf "%-+05i" 104us)) "+104 " + test "test1095" (lazy(sprintf "%-+01i" 104us)) "+104" + test "test1096" (lazy(sprintf "%-+0*i" 7 104us)) "+104 " + test "test1097" (lazy(sprintf "% i" 104us)) " 104" + test "test1098" (lazy(sprintf "% 5i" 104us)) " 104" + test "test1099" (lazy(sprintf "% 1i" 104us)) " 104" + test "test1100" (lazy(sprintf "% *i" 7 104us)) " 104" + test "test1101" (lazy(sprintf "%- i" 104us)) " 104" + test "test1102" (lazy(sprintf "%- 5i" 104us)) " 104 " + test "test1103" (lazy(sprintf "%- 1i" 104us)) " 104" + test "test1104" (lazy(sprintf "%- *i" 7 104us)) " 104 " + test "test1105" (lazy(sprintf "% 0i" 104us)) " 104" + test "test1106" (lazy(sprintf "% 05i" 104us)) " 0104" + test "test1107" (lazy(sprintf "% 01i" 104us)) " 104" + test "test1108" (lazy(sprintf "% 0*i" 7 104us)) " 000104" + test "test1109" (lazy(sprintf "%- 0i" 104us)) " 104" + test "test1110" (lazy(sprintf "%- 05i" 104us)) " 104 " + test "test1111" (lazy(sprintf "%- 01i" 104us)) " 104" + test "test1112" (lazy(sprintf "%- 0*i" 7 104us)) " 104 " + test "test1113" (lazy(sprintf "%i" 12y)) "12" + test "test1114" (lazy(sprintf "%5i" 12y)) " 12" + test "test1115" (lazy(sprintf "%1i" 12y)) "12" + test "test1116" (lazy(sprintf "%*i" 7 12y)) " 12" + test "test1117" (lazy(sprintf "%-i" 12y)) "12" + test "test1118" (lazy(sprintf "%-5i" 12y)) "12 " + test "test1119" (lazy(sprintf "%-1i" 12y)) "12" + test "test1120" (lazy(sprintf "%-*i" 7 12y)) "12 " + test "test1121" (lazy(sprintf "%0i" 12y)) "12" + test "test1122" (lazy(sprintf "%05i" 12y)) "00012" + test "test1123" (lazy(sprintf "%01i" 12y)) "12" + test "test1124" (lazy(sprintf "%0*i" 7 12y)) "0000012" + test "test1125" (lazy(sprintf "%-0i" 12y)) "12" + test "test1126" (lazy(sprintf "%-05i" 12y)) "12 " + test "test1127" (lazy(sprintf "%-01i" 12y)) "12" + test "test1128" (lazy(sprintf "%-0*i" 7 12y)) "12 " + test "test1129" (lazy(sprintf "%+i" 12y)) "+12" + test "test1130" (lazy(sprintf "%+5i" 12y)) " +12" + test "test1131" (lazy(sprintf "%+1i" 12y)) "+12" + test "test1132" (lazy(sprintf "%+*i" 7 12y)) " +12" + test "test1133" (lazy(sprintf "%-+i" 12y)) "+12" + test "test1134" (lazy(sprintf "%-+5i" 12y)) "+12 " + test "test1135" (lazy(sprintf "%-+1i" 12y)) "+12" + test "test1136" (lazy(sprintf "%-+*i" 7 12y)) "+12 " + test "test1137" (lazy(sprintf "%+0i" 12y)) "+12" + test "test1138" (lazy(sprintf "%+05i" 12y)) "+0012" + test "test1139" (lazy(sprintf "%+01i" 12y)) "+12" + test "test1140" (lazy(sprintf "%+0*i" 7 12y)) "+000012" + test "test1141" (lazy(sprintf "%-+0i" 12y)) "+12" + test "test1142" (lazy(sprintf "%-+05i" 12y)) "+12 " + test "test1143" (lazy(sprintf "%-+01i" 12y)) "+12" + test "test1144" (lazy(sprintf "%-+0*i" 7 12y)) "+12 " + test "test1145" (lazy(sprintf "% i" 12y)) " 12" + test "test1146" (lazy(sprintf "% 5i" 12y)) " 12" + test "test1147" (lazy(sprintf "% 1i" 12y)) " 12" + test "test1148" (lazy(sprintf "% *i" 7 12y)) " 12" + test "test1149" (lazy(sprintf "%- i" 12y)) " 12" + test "test1150" (lazy(sprintf "%- 5i" 12y)) " 12 " + test "test1151" (lazy(sprintf "%- 1i" 12y)) " 12" + test "test1152" (lazy(sprintf "%- *i" 7 12y)) " 12 " + test "test1153" (lazy(sprintf "% 0i" 12y)) " 12" + test "test1154" (lazy(sprintf "% 05i" 12y)) " 0012" + test "test1155" (lazy(sprintf "% 01i" 12y)) " 12" + test "test1156" (lazy(sprintf "% 0*i" 7 12y)) " 000012" + test "test1157" (lazy(sprintf "%- 0i" 12y)) " 12" + test "test1158" (lazy(sprintf "%- 05i" 12y)) " 12 " + test "test1159" (lazy(sprintf "%- 01i" 12y)) " 12" + test "test1160" (lazy(sprintf "%- 0*i" 7 12y)) " 12 " + test "test1161" (lazy(sprintf "%i" -94y)) "-94" + test "test1162" (lazy(sprintf "%5i" -94y)) " -94" + test "test1163" (lazy(sprintf "%1i" -94y)) "-94" + test "test1164" (lazy(sprintf "%*i" 7 -94y)) " -94" + test "test1165" (lazy(sprintf "%-i" -94y)) "-94" + test "test1166" (lazy(sprintf "%-5i" -94y)) "-94 " + test "test1167" (lazy(sprintf "%-1i" -94y)) "-94" + test "test1168" (lazy(sprintf "%-*i" 7 -94y)) "-94 " + test "test1169" (lazy(sprintf "%0i" -94y)) "-94" + test "test1170" (lazy(sprintf "%05i" -94y)) "-0094" + test "test1171" (lazy(sprintf "%01i" -94y)) "-94" + test "test1172" (lazy(sprintf "%0*i" 7 -94y)) "-000094" + test "test1173" (lazy(sprintf "%-0i" -94y)) "-94" + test "test1174" (lazy(sprintf "%-05i" -94y)) "-94 " + test "test1175" (lazy(sprintf "%-01i" -94y)) "-94" + test "test1176" (lazy(sprintf "%-0*i" 7 -94y)) "-94 " + test "test1177" (lazy(sprintf "%+i" -94y)) "-94" + test "test1178" (lazy(sprintf "%+5i" -94y)) " -94" + test "test1179" (lazy(sprintf "%+1i" -94y)) "-94" + test "test1180" (lazy(sprintf "%+*i" 7 -94y)) " -94" + test "test1181" (lazy(sprintf "%-+i" -94y)) "-94" + test "test1182" (lazy(sprintf "%-+5i" -94y)) "-94 " + test "test1183" (lazy(sprintf "%-+1i" -94y)) "-94" + test "test1184" (lazy(sprintf "%-+*i" 7 -94y)) "-94 " + test "test1185" (lazy(sprintf "%+0i" -94y)) "-94" + test "test1186" (lazy(sprintf "%+05i" -94y)) "-0094" + test "test1187" (lazy(sprintf "%+01i" -94y)) "-94" + test "test1188" (lazy(sprintf "%+0*i" 7 -94y)) "-000094" + test "test1189" (lazy(sprintf "%-+0i" -94y)) "-94" + test "test1190" (lazy(sprintf "%-+05i" -94y)) "-94 " + test "test1191" (lazy(sprintf "%-+01i" -94y)) "-94" + test "test1192" (lazy(sprintf "%-+0*i" 7 -94y)) "-94 " + test "test1193" (lazy(sprintf "% i" -94y)) "-94" + test "test1194" (lazy(sprintf "% 5i" -94y)) " -94" + test "test1195" (lazy(sprintf "% 1i" -94y)) "-94" + test "test1196" (lazy(sprintf "% *i" 7 -94y)) " -94" + test "test1197" (lazy(sprintf "%- i" -94y)) "-94" + test "test1198" (lazy(sprintf "%- 5i" -94y)) "-94 " + test "test1199" (lazy(sprintf "%- 1i" -94y)) "-94" + test "test1200" (lazy(sprintf "%- *i" 7 -94y)) "-94 " + test "test1201" (lazy(sprintf "% 0i" -94y)) "-94" + test "test1202" (lazy(sprintf "% 05i" -94y)) "-0094" + test "test1203" (lazy(sprintf "% 01i" -94y)) "-94" + test "test1204" (lazy(sprintf "% 0*i" 7 -94y)) "-000094" + test "test1205" (lazy(sprintf "%- 0i" -94y)) "-94" + test "test1206" (lazy(sprintf "%- 05i" -94y)) "-94 " + test "test1207" (lazy(sprintf "%- 01i" -94y)) "-94" + test "test1208" (lazy(sprintf "%- 0*i" 7 -94y)) "-94 " + test "test1209" (lazy(sprintf "%i" 88uy)) "88" + test "test1210" (lazy(sprintf "%5i" 88uy)) " 88" + test "test1211" (lazy(sprintf "%1i" 88uy)) "88" + test "test1212" (lazy(sprintf "%*i" 7 88uy)) " 88" + test "test1213" (lazy(sprintf "%-i" 88uy)) "88" + test "test1214" (lazy(sprintf "%-5i" 88uy)) "88 " + test "test1215" (lazy(sprintf "%-1i" 88uy)) "88" + test "test1216" (lazy(sprintf "%-*i" 7 88uy)) "88 " + test "test1217" (lazy(sprintf "%0i" 88uy)) "88" + test "test1218" (lazy(sprintf "%05i" 88uy)) "00088" + test "test1219" (lazy(sprintf "%01i" 88uy)) "88" + test "test1220" (lazy(sprintf "%0*i" 7 88uy)) "0000088" + test "test1221" (lazy(sprintf "%-0i" 88uy)) "88" + test "test1222" (lazy(sprintf "%-05i" 88uy)) "88 " + test "test1223" (lazy(sprintf "%-01i" 88uy)) "88" + test "test1224" (lazy(sprintf "%-0*i" 7 88uy)) "88 " + test "test1225" (lazy(sprintf "%+i" 88uy)) "+88" + test "test1226" (lazy(sprintf "%+5i" 88uy)) " +88" + test "test1227" (lazy(sprintf "%+1i" 88uy)) "+88" + test "test1228" (lazy(sprintf "%+*i" 7 88uy)) " +88" + test "test1229" (lazy(sprintf "%-+i" 88uy)) "+88" + test "test1230" (lazy(sprintf "%-+5i" 88uy)) "+88 " + test "test1231" (lazy(sprintf "%-+1i" 88uy)) "+88" + test "test1232" (lazy(sprintf "%-+*i" 7 88uy)) "+88 " + test "test1233" (lazy(sprintf "%+0i" 88uy)) "+88" + test "test1234" (lazy(sprintf "%+05i" 88uy)) "+0088" + test "test1235" (lazy(sprintf "%+01i" 88uy)) "+88" + test "test1236" (lazy(sprintf "%+0*i" 7 88uy)) "+000088" + test "test1237" (lazy(sprintf "%-+0i" 88uy)) "+88" + test "test1238" (lazy(sprintf "%-+05i" 88uy)) "+88 " + test "test1239" (lazy(sprintf "%-+01i" 88uy)) "+88" + test "test1240" (lazy(sprintf "%-+0*i" 7 88uy)) "+88 " + test "test1241" (lazy(sprintf "% i" 88uy)) " 88" + test "test1242" (lazy(sprintf "% 5i" 88uy)) " 88" + test "test1243" (lazy(sprintf "% 1i" 88uy)) " 88" + test "test1244" (lazy(sprintf "% *i" 7 88uy)) " 88" + test "test1245" (lazy(sprintf "%- i" 88uy)) " 88" + test "test1246" (lazy(sprintf "%- 5i" 88uy)) " 88 " + test "test1247" (lazy(sprintf "%- 1i" 88uy)) " 88" + test "test1248" (lazy(sprintf "%- *i" 7 88uy)) " 88 " + test "test1249" (lazy(sprintf "% 0i" 88uy)) " 88" + test "test1250" (lazy(sprintf "% 05i" 88uy)) " 0088" + test "test1251" (lazy(sprintf "% 01i" 88uy)) " 88" + test "test1252" (lazy(sprintf "% 0*i" 7 88uy)) " 000088" + test "test1253" (lazy(sprintf "%- 0i" 88uy)) " 88" + test "test1254" (lazy(sprintf "%- 05i" 88uy)) " 88 " + test "test1255" (lazy(sprintf "%- 01i" 88uy)) " 88" + test "test1256" (lazy(sprintf "%- 0*i" 7 88uy)) " 88 " + test "test1257" (lazy(sprintf "%i" 999L)) "999" + test "test1258" (lazy(sprintf "%5i" 999L)) " 999" + test "test1259" (lazy(sprintf "%1i" 999L)) "999" + test "test1260" (lazy(sprintf "%*i" 7 999L)) " 999" + test "test1261" (lazy(sprintf "%-i" 999L)) "999" + test "test1262" (lazy(sprintf "%-5i" 999L)) "999 " + test "test1263" (lazy(sprintf "%-1i" 999L)) "999" + test "test1264" (lazy(sprintf "%-*i" 7 999L)) "999 " + test "test1265" (lazy(sprintf "%0i" 999L)) "999" + test "test1266" (lazy(sprintf "%05i" 999L)) "00999" + test "test1267" (lazy(sprintf "%01i" 999L)) "999" + test "test1268" (lazy(sprintf "%0*i" 7 999L)) "0000999" + test "test1269" (lazy(sprintf "%-0i" 999L)) "999" + test "test1270" (lazy(sprintf "%-05i" 999L)) "999 " + test "test1271" (lazy(sprintf "%-01i" 999L)) "999" + test "test1272" (lazy(sprintf "%-0*i" 7 999L)) "999 " + test "test1273" (lazy(sprintf "%+i" 999L)) "+999" + test "test1274" (lazy(sprintf "%+5i" 999L)) " +999" + test "test1275" (lazy(sprintf "%+1i" 999L)) "+999" + test "test1276" (lazy(sprintf "%+*i" 7 999L)) " +999" + test "test1277" (lazy(sprintf "%-+i" 999L)) "+999" + test "test1278" (lazy(sprintf "%-+5i" 999L)) "+999 " + test "test1279" (lazy(sprintf "%-+1i" 999L)) "+999" + test "test1280" (lazy(sprintf "%-+*i" 7 999L)) "+999 " + test "test1281" (lazy(sprintf "%+0i" 999L)) "+999" + test "test1282" (lazy(sprintf "%+05i" 999L)) "+0999" + test "test1283" (lazy(sprintf "%+01i" 999L)) "+999" + test "test1284" (lazy(sprintf "%+0*i" 7 999L)) "+000999" + test "test1285" (lazy(sprintf "%-+0i" 999L)) "+999" + test "test1286" (lazy(sprintf "%-+05i" 999L)) "+999 " + test "test1287" (lazy(sprintf "%-+01i" 999L)) "+999" + test "test1288" (lazy(sprintf "%-+0*i" 7 999L)) "+999 " + test "test1289" (lazy(sprintf "% i" 999L)) " 999" + test "test1290" (lazy(sprintf "% 5i" 999L)) " 999" + test "test1291" (lazy(sprintf "% 1i" 999L)) " 999" + test "test1292" (lazy(sprintf "% *i" 7 999L)) " 999" + test "test1293" (lazy(sprintf "%- i" 999L)) " 999" + test "test1294" (lazy(sprintf "%- 5i" 999L)) " 999 " + test "test1295" (lazy(sprintf "%- 1i" 999L)) " 999" + test "test1296" (lazy(sprintf "%- *i" 7 999L)) " 999 " + test "test1297" (lazy(sprintf "% 0i" 999L)) " 999" + test "test1298" (lazy(sprintf "% 05i" 999L)) " 0999" + test "test1299" (lazy(sprintf "% 01i" 999L)) " 999" + test "test1300" (lazy(sprintf "% 0*i" 7 999L)) " 000999" + test "test1301" (lazy(sprintf "%- 0i" 999L)) " 999" + test "test1302" (lazy(sprintf "%- 05i" 999L)) " 999 " + test "test1303" (lazy(sprintf "%- 01i" 999L)) " 999" + test "test1304" (lazy(sprintf "%- 0*i" 7 999L)) " 999 " + test "test1305" (lazy(sprintf "%i" -321L)) "-321" + test "test1306" (lazy(sprintf "%5i" -321L)) " -321" + test "test1307" (lazy(sprintf "%1i" -321L)) "-321" + test "test1308" (lazy(sprintf "%*i" 7 -321L)) " -321" + test "test1309" (lazy(sprintf "%-i" -321L)) "-321" + test "test1310" (lazy(sprintf "%-5i" -321L)) "-321 " + test "test1311" (lazy(sprintf "%-1i" -321L)) "-321" + test "test1312" (lazy(sprintf "%-*i" 7 -321L)) "-321 " + test "test1313" (lazy(sprintf "%0i" -321L)) "-321" + test "test1314" (lazy(sprintf "%05i" -321L)) "-0321" + test "test1315" (lazy(sprintf "%01i" -321L)) "-321" + test "test1316" (lazy(sprintf "%0*i" 7 -321L)) "-000321" + test "test1317" (lazy(sprintf "%-0i" -321L)) "-321" + test "test1318" (lazy(sprintf "%-05i" -321L)) "-321 " + test "test1319" (lazy(sprintf "%-01i" -321L)) "-321" + test "test1320" (lazy(sprintf "%-0*i" 7 -321L)) "-321 " + test "test1321" (lazy(sprintf "%+i" -321L)) "-321" + test "test1322" (lazy(sprintf "%+5i" -321L)) " -321" + test "test1323" (lazy(sprintf "%+1i" -321L)) "-321" + test "test1324" (lazy(sprintf "%+*i" 7 -321L)) " -321" + test "test1325" (lazy(sprintf "%-+i" -321L)) "-321" + test "test1326" (lazy(sprintf "%-+5i" -321L)) "-321 " + test "test1327" (lazy(sprintf "%-+1i" -321L)) "-321" + test "test1328" (lazy(sprintf "%-+*i" 7 -321L)) "-321 " + test "test1329" (lazy(sprintf "%+0i" -321L)) "-321" + test "test1330" (lazy(sprintf "%+05i" -321L)) "-0321" + test "test1331" (lazy(sprintf "%+01i" -321L)) "-321" + test "test1332" (lazy(sprintf "%+0*i" 7 -321L)) "-000321" + test "test1333" (lazy(sprintf "%-+0i" -321L)) "-321" + test "test1334" (lazy(sprintf "%-+05i" -321L)) "-321 " + test "test1335" (lazy(sprintf "%-+01i" -321L)) "-321" + test "test1336" (lazy(sprintf "%-+0*i" 7 -321L)) "-321 " + test "test1337" (lazy(sprintf "% i" -321L)) "-321" + test "test1338" (lazy(sprintf "% 5i" -321L)) " -321" + test "test1339" (lazy(sprintf "% 1i" -321L)) "-321" + test "test1340" (lazy(sprintf "% *i" 7 -321L)) " -321" + test "test1341" (lazy(sprintf "%- i" -321L)) "-321" + test "test1342" (lazy(sprintf "%- 5i" -321L)) "-321 " + test "test1343" (lazy(sprintf "%- 1i" -321L)) "-321" + test "test1344" (lazy(sprintf "%- *i" 7 -321L)) "-321 " + test "test1345" (lazy(sprintf "% 0i" -321L)) "-321" + test "test1346" (lazy(sprintf "% 05i" -321L)) "-0321" + test "test1347" (lazy(sprintf "% 01i" -321L)) "-321" + test "test1348" (lazy(sprintf "% 0*i" 7 -321L)) "-000321" + test "test1349" (lazy(sprintf "%- 0i" -321L)) "-321" + test "test1350" (lazy(sprintf "%- 05i" -321L)) "-321 " + test "test1351" (lazy(sprintf "%- 01i" -321L)) "-321" + test "test1352" (lazy(sprintf "%- 0*i" 7 -321L)) "-321 " + test "test1353" (lazy(sprintf "%i" 50000UL)) "50000" + test "test1354" (lazy(sprintf "%5i" 50000UL)) "50000" + test "test1355" (lazy(sprintf "%1i" 50000UL)) "50000" + test "test1356" (lazy(sprintf "%*i" 7 50000UL)) " 50000" + test "test1357" (lazy(sprintf "%-i" 50000UL)) "50000" + test "test1358" (lazy(sprintf "%-5i" 50000UL)) "50000" + test "test1359" (lazy(sprintf "%-1i" 50000UL)) "50000" + test "test1360" (lazy(sprintf "%-*i" 7 50000UL)) "50000 " + test "test1361" (lazy(sprintf "%0i" 50000UL)) "50000" + test "test1362" (lazy(sprintf "%05i" 50000UL)) "50000" + test "test1363" (lazy(sprintf "%01i" 50000UL)) "50000" + test "test1364" (lazy(sprintf "%0*i" 7 50000UL)) "0050000" + test "test1365" (lazy(sprintf "%-0i" 50000UL)) "50000" + test "test1366" (lazy(sprintf "%-05i" 50000UL)) "50000" + test "test1367" (lazy(sprintf "%-01i" 50000UL)) "50000" + test "test1368" (lazy(sprintf "%-0*i" 7 50000UL)) "50000 " + test "test1369" (lazy(sprintf "%+i" 50000UL)) "+50000" + test "test1370" (lazy(sprintf "%+5i" 50000UL)) "+50000" + test "test1371" (lazy(sprintf "%+1i" 50000UL)) "+50000" + test "test1372" (lazy(sprintf "%+*i" 7 50000UL)) " +50000" + test "test1373" (lazy(sprintf "%-+i" 50000UL)) "+50000" + test "test1374" (lazy(sprintf "%-+5i" 50000UL)) "+50000" + test "test1375" (lazy(sprintf "%-+1i" 50000UL)) "+50000" + test "test1376" (lazy(sprintf "%-+*i" 7 50000UL)) "+50000 " + test "test1377" (lazy(sprintf "%+0i" 50000UL)) "+50000" + test "test1378" (lazy(sprintf "%+05i" 50000UL)) "+50000" + test "test1379" (lazy(sprintf "%+01i" 50000UL)) "+50000" + test "test1380" (lazy(sprintf "%+0*i" 7 50000UL)) "+050000" + test "test1381" (lazy(sprintf "%-+0i" 50000UL)) "+50000" + test "test1382" (lazy(sprintf "%-+05i" 50000UL)) "+50000" + test "test1383" (lazy(sprintf "%-+01i" 50000UL)) "+50000" + test "test1384" (lazy(sprintf "%-+0*i" 7 50000UL)) "+50000 " + test "test1385" (lazy(sprintf "% i" 50000UL)) " 50000" + test "test1386" (lazy(sprintf "% 5i" 50000UL)) " 50000" + test "test1387" (lazy(sprintf "% 1i" 50000UL)) " 50000" + test "test1388" (lazy(sprintf "% *i" 7 50000UL)) " 50000" + test "test1389" (lazy(sprintf "%- i" 50000UL)) " 50000" + test "test1390" (lazy(sprintf "%- 5i" 50000UL)) " 50000" + test "test1391" (lazy(sprintf "%- 1i" 50000UL)) " 50000" + test "test1392" (lazy(sprintf "%- *i" 7 50000UL)) " 50000 " + test "test1393" (lazy(sprintf "% 0i" 50000UL)) " 50000" + test "test1394" (lazy(sprintf "% 05i" 50000UL)) " 50000" + test "test1395" (lazy(sprintf "% 01i" 50000UL)) " 50000" + test "test1396" (lazy(sprintf "% 0*i" 7 50000UL)) " 050000" + test "test1397" (lazy(sprintf "%- 0i" 50000UL)) " 50000" + test "test1398" (lazy(sprintf "%- 05i" 50000UL)) " 50000" + test "test1399" (lazy(sprintf "%- 01i" 50000UL)) " 50000" + test "test1400" (lazy(sprintf "%- 0*i" 7 50000UL)) " 50000 " + test "test1401" (lazy(sprintf "%i" System.Int32.MaxValue)) "2147483647" + test "test1402" (lazy(sprintf "%5i" System.Int32.MaxValue)) "2147483647" + test "test1403" (lazy(sprintf "%1i" System.Int32.MaxValue)) "2147483647" + test "test1404" (lazy(sprintf "%*i" 7 System.Int32.MaxValue)) "2147483647" + test "test1405" (lazy(sprintf "%-i" System.Int32.MaxValue)) "2147483647" + test "test1406" (lazy(sprintf "%-5i" System.Int32.MaxValue)) "2147483647" + test "test1407" (lazy(sprintf "%-1i" System.Int32.MaxValue)) "2147483647" + test "test1408" (lazy(sprintf "%-*i" 7 System.Int32.MaxValue)) "2147483647" + test "test1409" (lazy(sprintf "%0i" System.Int32.MaxValue)) "2147483647" + test "test1410" (lazy(sprintf "%05i" System.Int32.MaxValue)) "2147483647" + test "test1411" (lazy(sprintf "%01i" System.Int32.MaxValue)) "2147483647" + test "test1412" (lazy(sprintf "%0*i" 7 System.Int32.MaxValue)) "2147483647" + test "test1413" (lazy(sprintf "%-0i" System.Int32.MaxValue)) "2147483647" + test "test1414" (lazy(sprintf "%-05i" System.Int32.MaxValue)) "2147483647" + test "test1415" (lazy(sprintf "%-01i" System.Int32.MaxValue)) "2147483647" + test "test1416" (lazy(sprintf "%-0*i" 7 System.Int32.MaxValue)) "2147483647" + test "test1417" (lazy(sprintf "%+i" System.Int32.MaxValue)) "+2147483647" + test "test1418" (lazy(sprintf "%+5i" System.Int32.MaxValue)) "+2147483647" + test "test1419" (lazy(sprintf "%+1i" System.Int32.MaxValue)) "+2147483647" + test "test1420" (lazy(sprintf "%+*i" 7 System.Int32.MaxValue)) "+2147483647" + test "test1421" (lazy(sprintf "%-+i" System.Int32.MaxValue)) "+2147483647" + test "test1422" (lazy(sprintf "%-+5i" System.Int32.MaxValue)) "+2147483647" + test "test1423" (lazy(sprintf "%-+1i" System.Int32.MaxValue)) "+2147483647" + test "test1424" (lazy(sprintf "%-+*i" 7 System.Int32.MaxValue)) "+2147483647" + test "test1425" (lazy(sprintf "%+0i" System.Int32.MaxValue)) "+2147483647" + test "test1426" (lazy(sprintf "%+05i" System.Int32.MaxValue)) "+2147483647" + test "test1427" (lazy(sprintf "%+01i" System.Int32.MaxValue)) "+2147483647" + test "test1428" (lazy(sprintf "%+0*i" 7 System.Int32.MaxValue)) "+2147483647" + test "test1429" (lazy(sprintf "%-+0i" System.Int32.MaxValue)) "+2147483647" + test "test1430" (lazy(sprintf "%-+05i" System.Int32.MaxValue)) "+2147483647" + test "test1431" (lazy(sprintf "%-+01i" System.Int32.MaxValue)) "+2147483647" + test "test1432" (lazy(sprintf "%-+0*i" 7 System.Int32.MaxValue)) "+2147483647" + test "test1433" (lazy(sprintf "% i" System.Int32.MaxValue)) " 2147483647" + test "test1434" (lazy(sprintf "% 5i" System.Int32.MaxValue)) " 2147483647" + test "test1435" (lazy(sprintf "% 1i" System.Int32.MaxValue)) " 2147483647" + test "test1436" (lazy(sprintf "% *i" 7 System.Int32.MaxValue)) " 2147483647" + test "test1437" (lazy(sprintf "%- i" System.Int32.MaxValue)) " 2147483647" + test "test1438" (lazy(sprintf "%- 5i" System.Int32.MaxValue)) " 2147483647" + test "test1439" (lazy(sprintf "%- 1i" System.Int32.MaxValue)) " 2147483647" + test "test1440" (lazy(sprintf "%- *i" 7 System.Int32.MaxValue)) " 2147483647" + test "test1441" (lazy(sprintf "% 0i" System.Int32.MaxValue)) " 2147483647" + test "test1442" (lazy(sprintf "% 05i" System.Int32.MaxValue)) " 2147483647" + test "test1443" (lazy(sprintf "% 01i" System.Int32.MaxValue)) " 2147483647" + test "test1444" (lazy(sprintf "% 0*i" 7 System.Int32.MaxValue)) " 2147483647" + test "test1445" (lazy(sprintf "%- 0i" System.Int32.MaxValue)) " 2147483647" + test "test1446" (lazy(sprintf "%- 05i" System.Int32.MaxValue)) " 2147483647" + test "test1447" (lazy(sprintf "%- 01i" System.Int32.MaxValue)) " 2147483647" + test "test1448" (lazy(sprintf "%- 0*i" 7 System.Int32.MaxValue)) " 2147483647" + test "test1449" (lazy(sprintf "%i" System.Int64.MaxValue)) "9223372036854775807" + test "test1450" (lazy(sprintf "%5i" System.Int64.MaxValue)) "9223372036854775807" + test "test1451" (lazy(sprintf "%1i" System.Int64.MaxValue)) "9223372036854775807" + test "test1452" (lazy(sprintf "%*i" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test1453" (lazy(sprintf "%-i" System.Int64.MaxValue)) "9223372036854775807" + test "test1454" (lazy(sprintf "%-5i" System.Int64.MaxValue)) "9223372036854775807" + test "test1455" (lazy(sprintf "%-1i" System.Int64.MaxValue)) "9223372036854775807" + test "test1456" (lazy(sprintf "%-*i" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test1457" (lazy(sprintf "%0i" System.Int64.MaxValue)) "9223372036854775807" + test "test1458" (lazy(sprintf "%05i" System.Int64.MaxValue)) "9223372036854775807" + test "test1459" (lazy(sprintf "%01i" System.Int64.MaxValue)) "9223372036854775807" + test "test1460" (lazy(sprintf "%0*i" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test1461" (lazy(sprintf "%-0i" System.Int64.MaxValue)) "9223372036854775807" + test "test1462" (lazy(sprintf "%-05i" System.Int64.MaxValue)) "9223372036854775807" + test "test1463" (lazy(sprintf "%-01i" System.Int64.MaxValue)) "9223372036854775807" + test "test1464" (lazy(sprintf "%-0*i" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test1465" (lazy(sprintf "%+i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1466" (lazy(sprintf "%+5i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1467" (lazy(sprintf "%+1i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1468" (lazy(sprintf "%+*i" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test1469" (lazy(sprintf "%-+i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1470" (lazy(sprintf "%-+5i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1471" (lazy(sprintf "%-+1i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1472" (lazy(sprintf "%-+*i" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test1473" (lazy(sprintf "%+0i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1474" (lazy(sprintf "%+05i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1475" (lazy(sprintf "%+01i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1476" (lazy(sprintf "%+0*i" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test1477" (lazy(sprintf "%-+0i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1478" (lazy(sprintf "%-+05i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1479" (lazy(sprintf "%-+01i" System.Int64.MaxValue)) "+9223372036854775807" + test "test1480" (lazy(sprintf "%-+0*i" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test1481" (lazy(sprintf "% i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1482" (lazy(sprintf "% 5i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1483" (lazy(sprintf "% 1i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1484" (lazy(sprintf "% *i" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test1485" (lazy(sprintf "%- i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1486" (lazy(sprintf "%- 5i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1487" (lazy(sprintf "%- 1i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1488" (lazy(sprintf "%- *i" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test1489" (lazy(sprintf "% 0i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1490" (lazy(sprintf "% 05i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1491" (lazy(sprintf "% 01i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1492" (lazy(sprintf "% 0*i" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test1493" (lazy(sprintf "%- 0i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1494" (lazy(sprintf "%- 05i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1495" (lazy(sprintf "%- 01i" System.Int64.MaxValue)) " 9223372036854775807" + test "test1496" (lazy(sprintf "%- 0*i" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test1497" (lazy(sprintf "%i" System.Int32.MinValue)) "-2147483648" + test "test1498" (lazy(sprintf "%5i" System.Int32.MinValue)) "-2147483648" + test "test1499" (lazy(sprintf "%1i" System.Int32.MinValue)) "-2147483648" + test "test1500" (lazy(sprintf "%*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1501" (lazy(sprintf "%-i" System.Int32.MinValue)) "-2147483648" + test "test1502" (lazy(sprintf "%-5i" System.Int32.MinValue)) "-2147483648" + test "test1503" (lazy(sprintf "%-1i" System.Int32.MinValue)) "-2147483648" + test "test1504" (lazy(sprintf "%-*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1505" (lazy(sprintf "%0i" System.Int32.MinValue)) "-2147483648" + test "test1506" (lazy(sprintf "%05i" System.Int32.MinValue)) "-2147483648" + test "test1507" (lazy(sprintf "%01i" System.Int32.MinValue)) "-2147483648" + test "test1508" (lazy(sprintf "%0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1509" (lazy(sprintf "%-0i" System.Int32.MinValue)) "-2147483648" + test "test1510" (lazy(sprintf "%-05i" System.Int32.MinValue)) "-2147483648" + test "test1511" (lazy(sprintf "%-01i" System.Int32.MinValue)) "-2147483648" + test "test1512" (lazy(sprintf "%-0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1513" (lazy(sprintf "%+i" System.Int32.MinValue)) "-2147483648" + test "test1514" (lazy(sprintf "%+5i" System.Int32.MinValue)) "-2147483648" + test "test1515" (lazy(sprintf "%+1i" System.Int32.MinValue)) "-2147483648" + test "test1516" (lazy(sprintf "%+*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1517" (lazy(sprintf "%-+i" System.Int32.MinValue)) "-2147483648" + test "test1518" (lazy(sprintf "%-+5i" System.Int32.MinValue)) "-2147483648" + test "test1519" (lazy(sprintf "%-+1i" System.Int32.MinValue)) "-2147483648" + test "test1520" (lazy(sprintf "%-+*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1521" (lazy(sprintf "%+0i" System.Int32.MinValue)) "-2147483648" + test "test1522" (lazy(sprintf "%+05i" System.Int32.MinValue)) "-2147483648" + test "test1523" (lazy(sprintf "%+01i" System.Int32.MinValue)) "-2147483648" + test "test1524" (lazy(sprintf "%+0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1525" (lazy(sprintf "%-+0i" System.Int32.MinValue)) "-2147483648" + test "test1526" (lazy(sprintf "%-+05i" System.Int32.MinValue)) "-2147483648" + test "test1527" (lazy(sprintf "%-+01i" System.Int32.MinValue)) "-2147483648" + test "test1528" (lazy(sprintf "%-+0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1529" (lazy(sprintf "% i" System.Int32.MinValue)) "-2147483648" + test "test1530" (lazy(sprintf "% 5i" System.Int32.MinValue)) "-2147483648" + test "test1531" (lazy(sprintf "% 1i" System.Int32.MinValue)) "-2147483648" + test "test1532" (lazy(sprintf "% *i" 7 System.Int32.MinValue)) "-2147483648" + test "test1533" (lazy(sprintf "%- i" System.Int32.MinValue)) "-2147483648" + test "test1534" (lazy(sprintf "%- 5i" System.Int32.MinValue)) "-2147483648" + test "test1535" (lazy(sprintf "%- 1i" System.Int32.MinValue)) "-2147483648" + test "test1536" (lazy(sprintf "%- *i" 7 System.Int32.MinValue)) "-2147483648" + test "test1537" (lazy(sprintf "% 0i" System.Int32.MinValue)) "-2147483648" + test "test1538" (lazy(sprintf "% 05i" System.Int32.MinValue)) "-2147483648" + test "test1539" (lazy(sprintf "% 01i" System.Int32.MinValue)) "-2147483648" + test "test1540" (lazy(sprintf "% 0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1541" (lazy(sprintf "%- 0i" System.Int32.MinValue)) "-2147483648" + test "test1542" (lazy(sprintf "%- 05i" System.Int32.MinValue)) "-2147483648" + test "test1543" (lazy(sprintf "%- 01i" System.Int32.MinValue)) "-2147483648" + test "test1544" (lazy(sprintf "%- 0*i" 7 System.Int32.MinValue)) "-2147483648" + test "test1545" (lazy(sprintf "%i" System.Int64.MinValue)) "-9223372036854775808" + test "test1546" (lazy(sprintf "%5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1547" (lazy(sprintf "%1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1548" (lazy(sprintf "%*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1549" (lazy(sprintf "%-i" System.Int64.MinValue)) "-9223372036854775808" + test "test1550" (lazy(sprintf "%-5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1551" (lazy(sprintf "%-1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1552" (lazy(sprintf "%-*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1553" (lazy(sprintf "%0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1554" (lazy(sprintf "%05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1555" (lazy(sprintf "%01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1556" (lazy(sprintf "%0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1557" (lazy(sprintf "%-0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1558" (lazy(sprintf "%-05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1559" (lazy(sprintf "%-01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1560" (lazy(sprintf "%-0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1561" (lazy(sprintf "%+i" System.Int64.MinValue)) "-9223372036854775808" + test "test1562" (lazy(sprintf "%+5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1563" (lazy(sprintf "%+1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1564" (lazy(sprintf "%+*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1565" (lazy(sprintf "%-+i" System.Int64.MinValue)) "-9223372036854775808" + test "test1566" (lazy(sprintf "%-+5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1567" (lazy(sprintf "%-+1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1568" (lazy(sprintf "%-+*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1569" (lazy(sprintf "%+0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1570" (lazy(sprintf "%+05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1571" (lazy(sprintf "%+01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1572" (lazy(sprintf "%+0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1573" (lazy(sprintf "%-+0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1574" (lazy(sprintf "%-+05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1575" (lazy(sprintf "%-+01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1576" (lazy(sprintf "%-+0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1577" (lazy(sprintf "% i" System.Int64.MinValue)) "-9223372036854775808" + test "test1578" (lazy(sprintf "% 5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1579" (lazy(sprintf "% 1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1580" (lazy(sprintf "% *i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1581" (lazy(sprintf "%- i" System.Int64.MinValue)) "-9223372036854775808" + test "test1582" (lazy(sprintf "%- 5i" System.Int64.MinValue)) "-9223372036854775808" + test "test1583" (lazy(sprintf "%- 1i" System.Int64.MinValue)) "-9223372036854775808" + test "test1584" (lazy(sprintf "%- *i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1585" (lazy(sprintf "% 0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1586" (lazy(sprintf "% 05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1587" (lazy(sprintf "% 01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1588" (lazy(sprintf "% 0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1589" (lazy(sprintf "%- 0i" System.Int64.MinValue)) "-9223372036854775808" + test "test1590" (lazy(sprintf "%- 05i" System.Int64.MinValue)) "-9223372036854775808" + test "test1591" (lazy(sprintf "%- 01i" System.Int64.MinValue)) "-9223372036854775808" + test "test1592" (lazy(sprintf "%- 0*i" 7 System.Int64.MinValue)) "-9223372036854775808" + test "test1593" (lazy(sprintf "%i" 55n)) "55" + test "test1594" (lazy(sprintf "%5i" 55n)) " 55" + test "test1595" (lazy(sprintf "%1i" 55n)) "55" + test "test1596" (lazy(sprintf "%*i" 7 55n)) " 55" + test "test1597" (lazy(sprintf "%-i" 55n)) "55" + test "test1598" (lazy(sprintf "%-5i" 55n)) "55 " + test "test1599" (lazy(sprintf "%-1i" 55n)) "55" + test "test1600" (lazy(sprintf "%-*i" 7 55n)) "55 " + test "test1601" (lazy(sprintf "%0i" 55n)) "55" + test "test1602" (lazy(sprintf "%05i" 55n)) "00055" + test "test1603" (lazy(sprintf "%01i" 55n)) "55" + test "test1604" (lazy(sprintf "%0*i" 7 55n)) "0000055" + test "test1605" (lazy(sprintf "%-0i" 55n)) "55" + test "test1606" (lazy(sprintf "%-05i" 55n)) "55 " + test "test1607" (lazy(sprintf "%-01i" 55n)) "55" + test "test1608" (lazy(sprintf "%-0*i" 7 55n)) "55 " + test "test1609" (lazy(sprintf "%+i" 55n)) "+55" + test "test1610" (lazy(sprintf "%+5i" 55n)) " +55" + test "test1611" (lazy(sprintf "%+1i" 55n)) "+55" + test "test1612" (lazy(sprintf "%+*i" 7 55n)) " +55" + test "test1613" (lazy(sprintf "%-+i" 55n)) "+55" + test "test1614" (lazy(sprintf "%-+5i" 55n)) "+55 " + test "test1615" (lazy(sprintf "%-+1i" 55n)) "+55" + test "test1616" (lazy(sprintf "%-+*i" 7 55n)) "+55 " + test "test1617" (lazy(sprintf "%+0i" 55n)) "+55" + test "test1618" (lazy(sprintf "%+05i" 55n)) "+0055" + test "test1619" (lazy(sprintf "%+01i" 55n)) "+55" + test "test1620" (lazy(sprintf "%+0*i" 7 55n)) "+000055" + test "test1621" (lazy(sprintf "%-+0i" 55n)) "+55" + test "test1622" (lazy(sprintf "%-+05i" 55n)) "+55 " + test "test1623" (lazy(sprintf "%-+01i" 55n)) "+55" + test "test1624" (lazy(sprintf "%-+0*i" 7 55n)) "+55 " + test "test1625" (lazy(sprintf "% i" 55n)) " 55" + test "test1626" (lazy(sprintf "% 5i" 55n)) " 55" + test "test1627" (lazy(sprintf "% 1i" 55n)) " 55" + test "test1628" (lazy(sprintf "% *i" 7 55n)) " 55" + test "test1629" (lazy(sprintf "%- i" 55n)) " 55" + test "test1630" (lazy(sprintf "%- 5i" 55n)) " 55 " + test "test1631" (lazy(sprintf "%- 1i" 55n)) " 55" + test "test1632" (lazy(sprintf "%- *i" 7 55n)) " 55 " + test "test1633" (lazy(sprintf "% 0i" 55n)) " 55" + test "test1634" (lazy(sprintf "% 05i" 55n)) " 0055" + test "test1635" (lazy(sprintf "% 01i" 55n)) " 55" + test "test1636" (lazy(sprintf "% 0*i" 7 55n)) " 000055" + test "test1637" (lazy(sprintf "%- 0i" 55n)) " 55" + test "test1638" (lazy(sprintf "%- 05i" 55n)) " 55 " + test "test1639" (lazy(sprintf "%- 01i" 55n)) " 55" + test "test1640" (lazy(sprintf "%- 0*i" 7 55n)) " 55 " + test "test1641" (lazy(sprintf "%i" 999un)) "999" + test "test1642" (lazy(sprintf "%5i" 999un)) " 999" + test "test1643" (lazy(sprintf "%1i" 999un)) "999" + test "test1644" (lazy(sprintf "%*i" 7 999un)) " 999" + test "test1645" (lazy(sprintf "%-i" 999un)) "999" + test "test1646" (lazy(sprintf "%-5i" 999un)) "999 " + test "test1647" (lazy(sprintf "%-1i" 999un)) "999" + test "test1648" (lazy(sprintf "%-*i" 7 999un)) "999 " + test "test1649" (lazy(sprintf "%0i" 999un)) "999" + test "test1650" (lazy(sprintf "%05i" 999un)) "00999" + test "test1651" (lazy(sprintf "%01i" 999un)) "999" + test "test1652" (lazy(sprintf "%0*i" 7 999un)) "0000999" + test "test1653" (lazy(sprintf "%-0i" 999un)) "999" + test "test1654" (lazy(sprintf "%-05i" 999un)) "999 " + test "test1655" (lazy(sprintf "%-01i" 999un)) "999" + test "test1656" (lazy(sprintf "%-0*i" 7 999un)) "999 " + test "test1657" (lazy(sprintf "%+i" 999un)) "+999" + test "test1658" (lazy(sprintf "%+5i" 999un)) " +999" + test "test1659" (lazy(sprintf "%+1i" 999un)) "+999" + test "test1660" (lazy(sprintf "%+*i" 7 999un)) " +999" + test "test1661" (lazy(sprintf "%-+i" 999un)) "+999" + test "test1662" (lazy(sprintf "%-+5i" 999un)) "+999 " + test "test1663" (lazy(sprintf "%-+1i" 999un)) "+999" + test "test1664" (lazy(sprintf "%-+*i" 7 999un)) "+999 " + test "test1665" (lazy(sprintf "%+0i" 999un)) "+999" + test "test1666" (lazy(sprintf "%+05i" 999un)) "+0999" + test "test1667" (lazy(sprintf "%+01i" 999un)) "+999" + test "test1668" (lazy(sprintf "%+0*i" 7 999un)) "+000999" + test "test1669" (lazy(sprintf "%-+0i" 999un)) "+999" + test "test1670" (lazy(sprintf "%-+05i" 999un)) "+999 " + test "test1671" (lazy(sprintf "%-+01i" 999un)) "+999" + test "test1672" (lazy(sprintf "%-+0*i" 7 999un)) "+999 " + test "test1673" (lazy(sprintf "% i" 999un)) " 999" + test "test1674" (lazy(sprintf "% 5i" 999un)) " 999" + test "test1675" (lazy(sprintf "% 1i" 999un)) " 999" + test "test1676" (lazy(sprintf "% *i" 7 999un)) " 999" + test "test1677" (lazy(sprintf "%- i" 999un)) " 999" + test "test1678" (lazy(sprintf "%- 5i" 999un)) " 999 " + test "test1679" (lazy(sprintf "%- 1i" 999un)) " 999" + test "test1680" (lazy(sprintf "%- *i" 7 999un)) " 999 " + test "test1681" (lazy(sprintf "% 0i" 999un)) " 999" + test "test1682" (lazy(sprintf "% 05i" 999un)) " 0999" + test "test1683" (lazy(sprintf "% 01i" 999un)) " 999" + test "test1684" (lazy(sprintf "% 0*i" 7 999un)) " 000999" + test "test1685" (lazy(sprintf "%- 0i" 999un)) " 999" + test "test1686" (lazy(sprintf "%- 05i" 999un)) " 999 " + test "test1687" (lazy(sprintf "%- 01i" 999un)) " 999" + test "test1688" (lazy(sprintf "%- 0*i" 7 999un)) " 999 " + test "test1689" (lazy(sprintf "%u" 14)) "14" + test "test1690" (lazy(sprintf "%5u" 14)) " 14" + test "test1691" (lazy(sprintf "%1u" 14)) "14" + test "test1692" (lazy(sprintf "%*u" 7 14)) " 14" + test "test1693" (lazy(sprintf "%-u" 14)) "14" + test "test1694" (lazy(sprintf "%-5u" 14)) "14 " + test "test1695" (lazy(sprintf "%-1u" 14)) "14" + test "test1696" (lazy(sprintf "%-*u" 7 14)) "14 " + test "test1697" (lazy(sprintf "%0u" 14)) "14" + test "test1698" (lazy(sprintf "%05u" 14)) "00014" + test "test1699" (lazy(sprintf "%01u" 14)) "14" + test "test1700" (lazy(sprintf "%0*u" 7 14)) "0000014" + test "test1701" (lazy(sprintf "%-0u" 14)) "14" + test "test1702" (lazy(sprintf "%-05u" 14)) "14 " + test "test1703" (lazy(sprintf "%-01u" 14)) "14" + test "test1704" (lazy(sprintf "%-0*u" 7 14)) "14 " + test "test1705" (lazy(sprintf "%+u" 14)) "+14" + test "test1706" (lazy(sprintf "%+5u" 14)) " +14" + test "test1707" (lazy(sprintf "%+1u" 14)) "+14" + test "test1708" (lazy(sprintf "%+*u" 7 14)) " +14" + test "test1709" (lazy(sprintf "%-+u" 14)) "+14" + test "test1710" (lazy(sprintf "%-+5u" 14)) "+14 " + test "test1711" (lazy(sprintf "%-+1u" 14)) "+14" + test "test1712" (lazy(sprintf "%-+*u" 7 14)) "+14 " + test "test1713" (lazy(sprintf "%+0u" 14)) "+14" + test "test1714" (lazy(sprintf "%+05u" 14)) "+0014" + test "test1715" (lazy(sprintf "%+01u" 14)) "+14" + test "test1716" (lazy(sprintf "%+0*u" 7 14)) "+000014" + test "test1717" (lazy(sprintf "%-+0u" 14)) "+14" + test "test1718" (lazy(sprintf "%-+05u" 14)) "+14 " + test "test1719" (lazy(sprintf "%-+01u" 14)) "+14" + test "test1720" (lazy(sprintf "%-+0*u" 7 14)) "+14 " + test "test1721" (lazy(sprintf "% u" 14)) " 14" + test "test1722" (lazy(sprintf "% 5u" 14)) " 14" + test "test1723" (lazy(sprintf "% 1u" 14)) " 14" + test "test1724" (lazy(sprintf "% *u" 7 14)) " 14" + test "test1725" (lazy(sprintf "%- u" 14)) " 14" + test "test1726" (lazy(sprintf "%- 5u" 14)) " 14 " + test "test1727" (lazy(sprintf "%- 1u" 14)) " 14" + test "test1728" (lazy(sprintf "%- *u" 7 14)) " 14 " + test "test1729" (lazy(sprintf "% 0u" 14)) " 14" + test "test1730" (lazy(sprintf "% 05u" 14)) " 0014" + test "test1731" (lazy(sprintf "% 01u" 14)) " 14" + test "test1732" (lazy(sprintf "% 0*u" 7 14)) " 000014" + test "test1733" (lazy(sprintf "%- 0u" 14)) " 14" + test "test1734" (lazy(sprintf "%- 05u" 14)) " 14 " + test "test1735" (lazy(sprintf "%- 01u" 14)) " 14" + test "test1736" (lazy(sprintf "%- 0*u" 7 14)) " 14 " + test "test1737" (lazy(sprintf "%u" -10)) "4294967286" + test "test1738" (lazy(sprintf "%5u" -10)) "4294967286" + test "test1739" (lazy(sprintf "%1u" -10)) "4294967286" + test "test1740" (lazy(sprintf "%*u" 7 -10)) "4294967286" + test "test1741" (lazy(sprintf "%-u" -10)) "4294967286" + test "test1742" (lazy(sprintf "%-5u" -10)) "4294967286" + test "test1743" (lazy(sprintf "%-1u" -10)) "4294967286" + test "test1744" (lazy(sprintf "%-*u" 7 -10)) "4294967286" + test "test1745" (lazy(sprintf "%0u" -10)) "4294967286" + test "test1746" (lazy(sprintf "%05u" -10)) "4294967286" + test "test1747" (lazy(sprintf "%01u" -10)) "4294967286" + test "test1748" (lazy(sprintf "%0*u" 7 -10)) "4294967286" + test "test1749" (lazy(sprintf "%-0u" -10)) "4294967286" + test "test1750" (lazy(sprintf "%-05u" -10)) "4294967286" + test "test1751" (lazy(sprintf "%-01u" -10)) "4294967286" + test "test1752" (lazy(sprintf "%-0*u" 7 -10)) "4294967286" + test "test1753" (lazy(sprintf "%+u" -10)) "+4294967286" + test "test1754" (lazy(sprintf "%+5u" -10)) "+4294967286" + test "test1755" (lazy(sprintf "%+1u" -10)) "+4294967286" + test "test1756" (lazy(sprintf "%+*u" 7 -10)) "+4294967286" + test "test1757" (lazy(sprintf "%-+u" -10)) "+4294967286" + test "test1758" (lazy(sprintf "%-+5u" -10)) "+4294967286" + test "test1759" (lazy(sprintf "%-+1u" -10)) "+4294967286" + test "test1760" (lazy(sprintf "%-+*u" 7 -10)) "+4294967286" + test "test1761" (lazy(sprintf "%+0u" -10)) "+4294967286" + test "test1762" (lazy(sprintf "%+05u" -10)) "+4294967286" + test "test1763" (lazy(sprintf "%+01u" -10)) "+4294967286" + test "test1764" (lazy(sprintf "%+0*u" 7 -10)) "+4294967286" + test "test1765" (lazy(sprintf "%-+0u" -10)) "+4294967286" + test "test1766" (lazy(sprintf "%-+05u" -10)) "+4294967286" + test "test1767" (lazy(sprintf "%-+01u" -10)) "+4294967286" + test "test1768" (lazy(sprintf "%-+0*u" 7 -10)) "+4294967286" + test "test1769" (lazy(sprintf "% u" -10)) " 4294967286" + test "test1770" (lazy(sprintf "% 5u" -10)) " 4294967286" + test "test1771" (lazy(sprintf "% 1u" -10)) " 4294967286" + test "test1772" (lazy(sprintf "% *u" 7 -10)) " 4294967286" + test "test1773" (lazy(sprintf "%- u" -10)) " 4294967286" + test "test1774" (lazy(sprintf "%- 5u" -10)) " 4294967286" + test "test1775" (lazy(sprintf "%- 1u" -10)) " 4294967286" + test "test1776" (lazy(sprintf "%- *u" 7 -10)) " 4294967286" + test "test1777" (lazy(sprintf "% 0u" -10)) " 4294967286" + test "test1778" (lazy(sprintf "% 05u" -10)) " 4294967286" + test "test1779" (lazy(sprintf "% 01u" -10)) " 4294967286" + test "test1780" (lazy(sprintf "% 0*u" 7 -10)) " 4294967286" + test "test1781" (lazy(sprintf "%- 0u" -10)) " 4294967286" + test "test1782" (lazy(sprintf "%- 05u" -10)) " 4294967286" + test "test1783" (lazy(sprintf "%- 01u" -10)) " 4294967286" + test "test1784" (lazy(sprintf "%- 0*u" 7 -10)) " 4294967286" + test "test1785" (lazy(sprintf "%u" 55s)) "55" + test "test1786" (lazy(sprintf "%5u" 55s)) " 55" + test "test1787" (lazy(sprintf "%1u" 55s)) "55" + test "test1788" (lazy(sprintf "%*u" 7 55s)) " 55" + test "test1789" (lazy(sprintf "%-u" 55s)) "55" + test "test1790" (lazy(sprintf "%-5u" 55s)) "55 " + test "test1791" (lazy(sprintf "%-1u" 55s)) "55" + test "test1792" (lazy(sprintf "%-*u" 7 55s)) "55 " + test "test1793" (lazy(sprintf "%0u" 55s)) "55" + test "test1794" (lazy(sprintf "%05u" 55s)) "00055" + test "test1795" (lazy(sprintf "%01u" 55s)) "55" + test "test1796" (lazy(sprintf "%0*u" 7 55s)) "0000055" + test "test1797" (lazy(sprintf "%-0u" 55s)) "55" + test "test1798" (lazy(sprintf "%-05u" 55s)) "55 " + test "test1799" (lazy(sprintf "%-01u" 55s)) "55" + test "test1800" (lazy(sprintf "%-0*u" 7 55s)) "55 " + test "test1801" (lazy(sprintf "%+u" 55s)) "+55" + test "test1802" (lazy(sprintf "%+5u" 55s)) " +55" + test "test1803" (lazy(sprintf "%+1u" 55s)) "+55" + test "test1804" (lazy(sprintf "%+*u" 7 55s)) " +55" + test "test1805" (lazy(sprintf "%-+u" 55s)) "+55" + test "test1806" (lazy(sprintf "%-+5u" 55s)) "+55 " + test "test1807" (lazy(sprintf "%-+1u" 55s)) "+55" + test "test1808" (lazy(sprintf "%-+*u" 7 55s)) "+55 " + test "test1809" (lazy(sprintf "%+0u" 55s)) "+55" + test "test1810" (lazy(sprintf "%+05u" 55s)) "+0055" + test "test1811" (lazy(sprintf "%+01u" 55s)) "+55" + test "test1812" (lazy(sprintf "%+0*u" 7 55s)) "+000055" + test "test1813" (lazy(sprintf "%-+0u" 55s)) "+55" + test "test1814" (lazy(sprintf "%-+05u" 55s)) "+55 " + test "test1815" (lazy(sprintf "%-+01u" 55s)) "+55" + test "test1816" (lazy(sprintf "%-+0*u" 7 55s)) "+55 " + test "test1817" (lazy(sprintf "% u" 55s)) " 55" + test "test1818" (lazy(sprintf "% 5u" 55s)) " 55" + test "test1819" (lazy(sprintf "% 1u" 55s)) " 55" + test "test1820" (lazy(sprintf "% *u" 7 55s)) " 55" + test "test1821" (lazy(sprintf "%- u" 55s)) " 55" + test "test1822" (lazy(sprintf "%- 5u" 55s)) " 55 " + test "test1823" (lazy(sprintf "%- 1u" 55s)) " 55" + test "test1824" (lazy(sprintf "%- *u" 7 55s)) " 55 " + test "test1825" (lazy(sprintf "% 0u" 55s)) " 55" + test "test1826" (lazy(sprintf "% 05u" 55s)) " 0055" + test "test1827" (lazy(sprintf "% 01u" 55s)) " 55" + test "test1828" (lazy(sprintf "% 0*u" 7 55s)) " 000055" + test "test1829" (lazy(sprintf "%- 0u" 55s)) " 55" + test "test1830" (lazy(sprintf "%- 05u" 55s)) " 55 " + test "test1831" (lazy(sprintf "%- 01u" 55s)) " 55" + test "test1832" (lazy(sprintf "%- 0*u" 7 55s)) " 55 " + test "test1833" (lazy(sprintf "%u" -88s)) "65448" + test "test1834" (lazy(sprintf "%5u" -88s)) "65448" + test "test1835" (lazy(sprintf "%1u" -88s)) "65448" + test "test1836" (lazy(sprintf "%*u" 7 -88s)) " 65448" + test "test1837" (lazy(sprintf "%-u" -88s)) "65448" + test "test1838" (lazy(sprintf "%-5u" -88s)) "65448" + test "test1839" (lazy(sprintf "%-1u" -88s)) "65448" + test "test1840" (lazy(sprintf "%-*u" 7 -88s)) "65448 " + test "test1841" (lazy(sprintf "%0u" -88s)) "65448" + test "test1842" (lazy(sprintf "%05u" -88s)) "65448" + test "test1843" (lazy(sprintf "%01u" -88s)) "65448" + test "test1844" (lazy(sprintf "%0*u" 7 -88s)) "0065448" + test "test1845" (lazy(sprintf "%-0u" -88s)) "65448" + test "test1846" (lazy(sprintf "%-05u" -88s)) "65448" + test "test1847" (lazy(sprintf "%-01u" -88s)) "65448" + test "test1848" (lazy(sprintf "%-0*u" 7 -88s)) "65448 " + test "test1849" (lazy(sprintf "%+u" -88s)) "+65448" + test "test1850" (lazy(sprintf "%+5u" -88s)) "+65448" + test "test1851" (lazy(sprintf "%+1u" -88s)) "+65448" + test "test1852" (lazy(sprintf "%+*u" 7 -88s)) " +65448" + test "test1853" (lazy(sprintf "%-+u" -88s)) "+65448" + test "test1854" (lazy(sprintf "%-+5u" -88s)) "+65448" + test "test1855" (lazy(sprintf "%-+1u" -88s)) "+65448" + test "test1856" (lazy(sprintf "%-+*u" 7 -88s)) "+65448 " + test "test1857" (lazy(sprintf "%+0u" -88s)) "+65448" + test "test1858" (lazy(sprintf "%+05u" -88s)) "+65448" + test "test1859" (lazy(sprintf "%+01u" -88s)) "+65448" + test "test1860" (lazy(sprintf "%+0*u" 7 -88s)) "+065448" + test "test1861" (lazy(sprintf "%-+0u" -88s)) "+65448" + test "test1862" (lazy(sprintf "%-+05u" -88s)) "+65448" + test "test1863" (lazy(sprintf "%-+01u" -88s)) "+65448" + test "test1864" (lazy(sprintf "%-+0*u" 7 -88s)) "+65448 " + test "test1865" (lazy(sprintf "% u" -88s)) " 65448" + test "test1866" (lazy(sprintf "% 5u" -88s)) " 65448" + test "test1867" (lazy(sprintf "% 1u" -88s)) " 65448" + test "test1868" (lazy(sprintf "% *u" 7 -88s)) " 65448" + test "test1869" (lazy(sprintf "%- u" -88s)) " 65448" + test "test1870" (lazy(sprintf "%- 5u" -88s)) " 65448" + test "test1871" (lazy(sprintf "%- 1u" -88s)) " 65448" + test "test1872" (lazy(sprintf "%- *u" 7 -88s)) " 65448 " + test "test1873" (lazy(sprintf "% 0u" -88s)) " 65448" + test "test1874" (lazy(sprintf "% 05u" -88s)) " 65448" + test "test1875" (lazy(sprintf "% 01u" -88s)) " 65448" + test "test1876" (lazy(sprintf "% 0*u" 7 -88s)) " 065448" + test "test1877" (lazy(sprintf "%- 0u" -88s)) " 65448" + test "test1878" (lazy(sprintf "%- 05u" -88s)) " 65448" + test "test1879" (lazy(sprintf "%- 01u" -88s)) " 65448" + test "test1880" (lazy(sprintf "%- 0*u" 7 -88s)) " 65448 " + test "test1881" (lazy(sprintf "%u" 104us)) "104" + test "test1882" (lazy(sprintf "%5u" 104us)) " 104" + test "test1883" (lazy(sprintf "%1u" 104us)) "104" + test "test1884" (lazy(sprintf "%*u" 7 104us)) " 104" + test "test1885" (lazy(sprintf "%-u" 104us)) "104" + test "test1886" (lazy(sprintf "%-5u" 104us)) "104 " + test "test1887" (lazy(sprintf "%-1u" 104us)) "104" + test "test1888" (lazy(sprintf "%-*u" 7 104us)) "104 " + test "test1889" (lazy(sprintf "%0u" 104us)) "104" + test "test1890" (lazy(sprintf "%05u" 104us)) "00104" + test "test1891" (lazy(sprintf "%01u" 104us)) "104" + test "test1892" (lazy(sprintf "%0*u" 7 104us)) "0000104" + test "test1893" (lazy(sprintf "%-0u" 104us)) "104" + test "test1894" (lazy(sprintf "%-05u" 104us)) "104 " + test "test1895" (lazy(sprintf "%-01u" 104us)) "104" + test "test1896" (lazy(sprintf "%-0*u" 7 104us)) "104 " + test "test1897" (lazy(sprintf "%+u" 104us)) "+104" + test "test1898" (lazy(sprintf "%+5u" 104us)) " +104" + test "test1899" (lazy(sprintf "%+1u" 104us)) "+104" + test "test1900" (lazy(sprintf "%+*u" 7 104us)) " +104" + test "test1901" (lazy(sprintf "%-+u" 104us)) "+104" + test "test1902" (lazy(sprintf "%-+5u" 104us)) "+104 " + test "test1903" (lazy(sprintf "%-+1u" 104us)) "+104" + test "test1904" (lazy(sprintf "%-+*u" 7 104us)) "+104 " + test "test1905" (lazy(sprintf "%+0u" 104us)) "+104" + test "test1906" (lazy(sprintf "%+05u" 104us)) "+0104" + test "test1907" (lazy(sprintf "%+01u" 104us)) "+104" + test "test1908" (lazy(sprintf "%+0*u" 7 104us)) "+000104" + test "test1909" (lazy(sprintf "%-+0u" 104us)) "+104" + test "test1910" (lazy(sprintf "%-+05u" 104us)) "+104 " + test "test1911" (lazy(sprintf "%-+01u" 104us)) "+104" + test "test1912" (lazy(sprintf "%-+0*u" 7 104us)) "+104 " + test "test1913" (lazy(sprintf "% u" 104us)) " 104" + test "test1914" (lazy(sprintf "% 5u" 104us)) " 104" + test "test1915" (lazy(sprintf "% 1u" 104us)) " 104" + test "test1916" (lazy(sprintf "% *u" 7 104us)) " 104" + test "test1917" (lazy(sprintf "%- u" 104us)) " 104" + test "test1918" (lazy(sprintf "%- 5u" 104us)) " 104 " + test "test1919" (lazy(sprintf "%- 1u" 104us)) " 104" + test "test1920" (lazy(sprintf "%- *u" 7 104us)) " 104 " + test "test1921" (lazy(sprintf "% 0u" 104us)) " 104" + test "test1922" (lazy(sprintf "% 05u" 104us)) " 0104" + test "test1923" (lazy(sprintf "% 01u" 104us)) " 104" + test "test1924" (lazy(sprintf "% 0*u" 7 104us)) " 000104" + test "test1925" (lazy(sprintf "%- 0u" 104us)) " 104" + test "test1926" (lazy(sprintf "%- 05u" 104us)) " 104 " + test "test1927" (lazy(sprintf "%- 01u" 104us)) " 104" + test "test1928" (lazy(sprintf "%- 0*u" 7 104us)) " 104 " + test "test1929" (lazy(sprintf "%u" 12y)) "12" + test "test1930" (lazy(sprintf "%5u" 12y)) " 12" + test "test1931" (lazy(sprintf "%1u" 12y)) "12" + test "test1932" (lazy(sprintf "%*u" 7 12y)) " 12" + test "test1933" (lazy(sprintf "%-u" 12y)) "12" + test "test1934" (lazy(sprintf "%-5u" 12y)) "12 " + test "test1935" (lazy(sprintf "%-1u" 12y)) "12" + test "test1936" (lazy(sprintf "%-*u" 7 12y)) "12 " + test "test1937" (lazy(sprintf "%0u" 12y)) "12" + test "test1938" (lazy(sprintf "%05u" 12y)) "00012" + test "test1939" (lazy(sprintf "%01u" 12y)) "12" + test "test1940" (lazy(sprintf "%0*u" 7 12y)) "0000012" + test "test1941" (lazy(sprintf "%-0u" 12y)) "12" + test "test1942" (lazy(sprintf "%-05u" 12y)) "12 " + test "test1943" (lazy(sprintf "%-01u" 12y)) "12" + test "test1944" (lazy(sprintf "%-0*u" 7 12y)) "12 " + test "test1945" (lazy(sprintf "%+u" 12y)) "+12" + test "test1946" (lazy(sprintf "%+5u" 12y)) " +12" + test "test1947" (lazy(sprintf "%+1u" 12y)) "+12" + test "test1948" (lazy(sprintf "%+*u" 7 12y)) " +12" + test "test1949" (lazy(sprintf "%-+u" 12y)) "+12" + test "test1950" (lazy(sprintf "%-+5u" 12y)) "+12 " + test "test1951" (lazy(sprintf "%-+1u" 12y)) "+12" + test "test1952" (lazy(sprintf "%-+*u" 7 12y)) "+12 " + test "test1953" (lazy(sprintf "%+0u" 12y)) "+12" + test "test1954" (lazy(sprintf "%+05u" 12y)) "+0012" + test "test1955" (lazy(sprintf "%+01u" 12y)) "+12" + test "test1956" (lazy(sprintf "%+0*u" 7 12y)) "+000012" + test "test1957" (lazy(sprintf "%-+0u" 12y)) "+12" + test "test1958" (lazy(sprintf "%-+05u" 12y)) "+12 " + test "test1959" (lazy(sprintf "%-+01u" 12y)) "+12" + test "test1960" (lazy(sprintf "%-+0*u" 7 12y)) "+12 " + test "test1961" (lazy(sprintf "% u" 12y)) " 12" + test "test1962" (lazy(sprintf "% 5u" 12y)) " 12" + test "test1963" (lazy(sprintf "% 1u" 12y)) " 12" + test "test1964" (lazy(sprintf "% *u" 7 12y)) " 12" + test "test1965" (lazy(sprintf "%- u" 12y)) " 12" + test "test1966" (lazy(sprintf "%- 5u" 12y)) " 12 " + test "test1967" (lazy(sprintf "%- 1u" 12y)) " 12" + test "test1968" (lazy(sprintf "%- *u" 7 12y)) " 12 " + test "test1969" (lazy(sprintf "% 0u" 12y)) " 12" + test "test1970" (lazy(sprintf "% 05u" 12y)) " 0012" + test "test1971" (lazy(sprintf "% 01u" 12y)) " 12" + test "test1972" (lazy(sprintf "% 0*u" 7 12y)) " 000012" + test "test1973" (lazy(sprintf "%- 0u" 12y)) " 12" + test "test1974" (lazy(sprintf "%- 05u" 12y)) " 12 " + test "test1975" (lazy(sprintf "%- 01u" 12y)) " 12" + test "test1976" (lazy(sprintf "%- 0*u" 7 12y)) " 12 " + test "test1977" (lazy(sprintf "%u" -94y)) "162" + test "test1978" (lazy(sprintf "%5u" -94y)) " 162" + test "test1979" (lazy(sprintf "%1u" -94y)) "162" + test "test1980" (lazy(sprintf "%*u" 7 -94y)) " 162" + test "test1981" (lazy(sprintf "%-u" -94y)) "162" + test "test1982" (lazy(sprintf "%-5u" -94y)) "162 " + test "test1983" (lazy(sprintf "%-1u" -94y)) "162" + test "test1984" (lazy(sprintf "%-*u" 7 -94y)) "162 " + test "test1985" (lazy(sprintf "%0u" -94y)) "162" + test "test1986" (lazy(sprintf "%05u" -94y)) "00162" + test "test1987" (lazy(sprintf "%01u" -94y)) "162" + test "test1988" (lazy(sprintf "%0*u" 7 -94y)) "0000162" + test "test1989" (lazy(sprintf "%-0u" -94y)) "162" + test "test1990" (lazy(sprintf "%-05u" -94y)) "162 " + test "test1991" (lazy(sprintf "%-01u" -94y)) "162" + test "test1992" (lazy(sprintf "%-0*u" 7 -94y)) "162 " + test "test1993" (lazy(sprintf "%+u" -94y)) "+162" + test "test1994" (lazy(sprintf "%+5u" -94y)) " +162" + test "test1995" (lazy(sprintf "%+1u" -94y)) "+162" + test "test1996" (lazy(sprintf "%+*u" 7 -94y)) " +162" + test "test1997" (lazy(sprintf "%-+u" -94y)) "+162" + test "test1998" (lazy(sprintf "%-+5u" -94y)) "+162 " + test "test1999" (lazy(sprintf "%-+1u" -94y)) "+162" + test "test2000" (lazy(sprintf "%-+*u" 7 -94y)) "+162 " +let func2000()= + test "test2001" (lazy(sprintf "%+0u" -94y)) "+162" + test "test2002" (lazy(sprintf "%+05u" -94y)) "+0162" + test "test2003" (lazy(sprintf "%+01u" -94y)) "+162" + test "test2004" (lazy(sprintf "%+0*u" 7 -94y)) "+000162" + test "test2005" (lazy(sprintf "%-+0u" -94y)) "+162" + test "test2006" (lazy(sprintf "%-+05u" -94y)) "+162 " + test "test2007" (lazy(sprintf "%-+01u" -94y)) "+162" + test "test2008" (lazy(sprintf "%-+0*u" 7 -94y)) "+162 " + test "test2009" (lazy(sprintf "% u" -94y)) " 162" + test "test2010" (lazy(sprintf "% 5u" -94y)) " 162" + test "test2011" (lazy(sprintf "% 1u" -94y)) " 162" + test "test2012" (lazy(sprintf "% *u" 7 -94y)) " 162" + test "test2013" (lazy(sprintf "%- u" -94y)) " 162" + test "test2014" (lazy(sprintf "%- 5u" -94y)) " 162 " + test "test2015" (lazy(sprintf "%- 1u" -94y)) " 162" + test "test2016" (lazy(sprintf "%- *u" 7 -94y)) " 162 " + test "test2017" (lazy(sprintf "% 0u" -94y)) " 162" + test "test2018" (lazy(sprintf "% 05u" -94y)) " 0162" + test "test2019" (lazy(sprintf "% 01u" -94y)) " 162" + test "test2020" (lazy(sprintf "% 0*u" 7 -94y)) " 000162" + test "test2021" (lazy(sprintf "%- 0u" -94y)) " 162" + test "test2022" (lazy(sprintf "%- 05u" -94y)) " 162 " + test "test2023" (lazy(sprintf "%- 01u" -94y)) " 162" + test "test2024" (lazy(sprintf "%- 0*u" 7 -94y)) " 162 " + test "test2025" (lazy(sprintf "%u" 88uy)) "88" + test "test2026" (lazy(sprintf "%5u" 88uy)) " 88" + test "test2027" (lazy(sprintf "%1u" 88uy)) "88" + test "test2028" (lazy(sprintf "%*u" 7 88uy)) " 88" + test "test2029" (lazy(sprintf "%-u" 88uy)) "88" + test "test2030" (lazy(sprintf "%-5u" 88uy)) "88 " + test "test2031" (lazy(sprintf "%-1u" 88uy)) "88" + test "test2032" (lazy(sprintf "%-*u" 7 88uy)) "88 " + test "test2033" (lazy(sprintf "%0u" 88uy)) "88" + test "test2034" (lazy(sprintf "%05u" 88uy)) "00088" + test "test2035" (lazy(sprintf "%01u" 88uy)) "88" + test "test2036" (lazy(sprintf "%0*u" 7 88uy)) "0000088" + test "test2037" (lazy(sprintf "%-0u" 88uy)) "88" + test "test2038" (lazy(sprintf "%-05u" 88uy)) "88 " + test "test2039" (lazy(sprintf "%-01u" 88uy)) "88" + test "test2040" (lazy(sprintf "%-0*u" 7 88uy)) "88 " + test "test2041" (lazy(sprintf "%+u" 88uy)) "+88" + test "test2042" (lazy(sprintf "%+5u" 88uy)) " +88" + test "test2043" (lazy(sprintf "%+1u" 88uy)) "+88" + test "test2044" (lazy(sprintf "%+*u" 7 88uy)) " +88" + test "test2045" (lazy(sprintf "%-+u" 88uy)) "+88" + test "test2046" (lazy(sprintf "%-+5u" 88uy)) "+88 " + test "test2047" (lazy(sprintf "%-+1u" 88uy)) "+88" + test "test2048" (lazy(sprintf "%-+*u" 7 88uy)) "+88 " + test "test2049" (lazy(sprintf "%+0u" 88uy)) "+88" + test "test2050" (lazy(sprintf "%+05u" 88uy)) "+0088" + test "test2051" (lazy(sprintf "%+01u" 88uy)) "+88" + test "test2052" (lazy(sprintf "%+0*u" 7 88uy)) "+000088" + test "test2053" (lazy(sprintf "%-+0u" 88uy)) "+88" + test "test2054" (lazy(sprintf "%-+05u" 88uy)) "+88 " + test "test2055" (lazy(sprintf "%-+01u" 88uy)) "+88" + test "test2056" (lazy(sprintf "%-+0*u" 7 88uy)) "+88 " + test "test2057" (lazy(sprintf "% u" 88uy)) " 88" + test "test2058" (lazy(sprintf "% 5u" 88uy)) " 88" + test "test2059" (lazy(sprintf "% 1u" 88uy)) " 88" + test "test2060" (lazy(sprintf "% *u" 7 88uy)) " 88" + test "test2061" (lazy(sprintf "%- u" 88uy)) " 88" + test "test2062" (lazy(sprintf "%- 5u" 88uy)) " 88 " + test "test2063" (lazy(sprintf "%- 1u" 88uy)) " 88" + test "test2064" (lazy(sprintf "%- *u" 7 88uy)) " 88 " + test "test2065" (lazy(sprintf "% 0u" 88uy)) " 88" + test "test2066" (lazy(sprintf "% 05u" 88uy)) " 0088" + test "test2067" (lazy(sprintf "% 01u" 88uy)) " 88" + test "test2068" (lazy(sprintf "% 0*u" 7 88uy)) " 000088" + test "test2069" (lazy(sprintf "%- 0u" 88uy)) " 88" + test "test2070" (lazy(sprintf "%- 05u" 88uy)) " 88 " + test "test2071" (lazy(sprintf "%- 01u" 88uy)) " 88" + test "test2072" (lazy(sprintf "%- 0*u" 7 88uy)) " 88 " + test "test2073" (lazy(sprintf "%u" 999L)) "999" + test "test2074" (lazy(sprintf "%5u" 999L)) " 999" + test "test2075" (lazy(sprintf "%1u" 999L)) "999" + test "test2076" (lazy(sprintf "%*u" 7 999L)) " 999" + test "test2077" (lazy(sprintf "%-u" 999L)) "999" + test "test2078" (lazy(sprintf "%-5u" 999L)) "999 " + test "test2079" (lazy(sprintf "%-1u" 999L)) "999" + test "test2080" (lazy(sprintf "%-*u" 7 999L)) "999 " + test "test2081" (lazy(sprintf "%0u" 999L)) "999" + test "test2082" (lazy(sprintf "%05u" 999L)) "00999" + test "test2083" (lazy(sprintf "%01u" 999L)) "999" + test "test2084" (lazy(sprintf "%0*u" 7 999L)) "0000999" + test "test2085" (lazy(sprintf "%-0u" 999L)) "999" + test "test2086" (lazy(sprintf "%-05u" 999L)) "999 " + test "test2087" (lazy(sprintf "%-01u" 999L)) "999" + test "test2088" (lazy(sprintf "%-0*u" 7 999L)) "999 " + test "test2089" (lazy(sprintf "%+u" 999L)) "+999" + test "test2090" (lazy(sprintf "%+5u" 999L)) " +999" + test "test2091" (lazy(sprintf "%+1u" 999L)) "+999" + test "test2092" (lazy(sprintf "%+*u" 7 999L)) " +999" + test "test2093" (lazy(sprintf "%-+u" 999L)) "+999" + test "test2094" (lazy(sprintf "%-+5u" 999L)) "+999 " + test "test2095" (lazy(sprintf "%-+1u" 999L)) "+999" + test "test2096" (lazy(sprintf "%-+*u" 7 999L)) "+999 " + test "test2097" (lazy(sprintf "%+0u" 999L)) "+999" + test "test2098" (lazy(sprintf "%+05u" 999L)) "+0999" + test "test2099" (lazy(sprintf "%+01u" 999L)) "+999" + test "test2100" (lazy(sprintf "%+0*u" 7 999L)) "+000999" + test "test2101" (lazy(sprintf "%-+0u" 999L)) "+999" + test "test2102" (lazy(sprintf "%-+05u" 999L)) "+999 " + test "test2103" (lazy(sprintf "%-+01u" 999L)) "+999" + test "test2104" (lazy(sprintf "%-+0*u" 7 999L)) "+999 " + test "test2105" (lazy(sprintf "% u" 999L)) " 999" + test "test2106" (lazy(sprintf "% 5u" 999L)) " 999" + test "test2107" (lazy(sprintf "% 1u" 999L)) " 999" + test "test2108" (lazy(sprintf "% *u" 7 999L)) " 999" + test "test2109" (lazy(sprintf "%- u" 999L)) " 999" + test "test2110" (lazy(sprintf "%- 5u" 999L)) " 999 " + test "test2111" (lazy(sprintf "%- 1u" 999L)) " 999" + test "test2112" (lazy(sprintf "%- *u" 7 999L)) " 999 " + test "test2113" (lazy(sprintf "% 0u" 999L)) " 999" + test "test2114" (lazy(sprintf "% 05u" 999L)) " 0999" + test "test2115" (lazy(sprintf "% 01u" 999L)) " 999" + test "test2116" (lazy(sprintf "% 0*u" 7 999L)) " 000999" + test "test2117" (lazy(sprintf "%- 0u" 999L)) " 999" + test "test2118" (lazy(sprintf "%- 05u" 999L)) " 999 " + test "test2119" (lazy(sprintf "%- 01u" 999L)) " 999" + test "test2120" (lazy(sprintf "%- 0*u" 7 999L)) " 999 " + test "test2121" (lazy(sprintf "%u" -321L)) "18446744073709551295" + test "test2122" (lazy(sprintf "%5u" -321L)) "18446744073709551295" + test "test2123" (lazy(sprintf "%1u" -321L)) "18446744073709551295" + test "test2124" (lazy(sprintf "%*u" 7 -321L)) "18446744073709551295" + test "test2125" (lazy(sprintf "%-u" -321L)) "18446744073709551295" + test "test2126" (lazy(sprintf "%-5u" -321L)) "18446744073709551295" + test "test2127" (lazy(sprintf "%-1u" -321L)) "18446744073709551295" + test "test2128" (lazy(sprintf "%-*u" 7 -321L)) "18446744073709551295" + test "test2129" (lazy(sprintf "%0u" -321L)) "18446744073709551295" + test "test2130" (lazy(sprintf "%05u" -321L)) "18446744073709551295" + test "test2131" (lazy(sprintf "%01u" -321L)) "18446744073709551295" + test "test2132" (lazy(sprintf "%0*u" 7 -321L)) "18446744073709551295" + test "test2133" (lazy(sprintf "%-0u" -321L)) "18446744073709551295" + test "test2134" (lazy(sprintf "%-05u" -321L)) "18446744073709551295" + test "test2135" (lazy(sprintf "%-01u" -321L)) "18446744073709551295" + test "test2136" (lazy(sprintf "%-0*u" 7 -321L)) "18446744073709551295" + test "test2137" (lazy(sprintf "%+u" -321L)) "+18446744073709551295" + test "test2138" (lazy(sprintf "%+5u" -321L)) "+18446744073709551295" + test "test2139" (lazy(sprintf "%+1u" -321L)) "+18446744073709551295" + test "test2140" (lazy(sprintf "%+*u" 7 -321L)) "+18446744073709551295" + test "test2141" (lazy(sprintf "%-+u" -321L)) "+18446744073709551295" + test "test2142" (lazy(sprintf "%-+5u" -321L)) "+18446744073709551295" + test "test2143" (lazy(sprintf "%-+1u" -321L)) "+18446744073709551295" + test "test2144" (lazy(sprintf "%-+*u" 7 -321L)) "+18446744073709551295" + test "test2145" (lazy(sprintf "%+0u" -321L)) "+18446744073709551295" + test "test2146" (lazy(sprintf "%+05u" -321L)) "+18446744073709551295" + test "test2147" (lazy(sprintf "%+01u" -321L)) "+18446744073709551295" + test "test2148" (lazy(sprintf "%+0*u" 7 -321L)) "+18446744073709551295" + test "test2149" (lazy(sprintf "%-+0u" -321L)) "+18446744073709551295" + test "test2150" (lazy(sprintf "%-+05u" -321L)) "+18446744073709551295" + test "test2151" (lazy(sprintf "%-+01u" -321L)) "+18446744073709551295" + test "test2152" (lazy(sprintf "%-+0*u" 7 -321L)) "+18446744073709551295" + test "test2153" (lazy(sprintf "% u" -321L)) " 18446744073709551295" + test "test2154" (lazy(sprintf "% 5u" -321L)) " 18446744073709551295" + test "test2155" (lazy(sprintf "% 1u" -321L)) " 18446744073709551295" + test "test2156" (lazy(sprintf "% *u" 7 -321L)) " 18446744073709551295" + test "test2157" (lazy(sprintf "%- u" -321L)) " 18446744073709551295" + test "test2158" (lazy(sprintf "%- 5u" -321L)) " 18446744073709551295" + test "test2159" (lazy(sprintf "%- 1u" -321L)) " 18446744073709551295" + test "test2160" (lazy(sprintf "%- *u" 7 -321L)) " 18446744073709551295" + test "test2161" (lazy(sprintf "% 0u" -321L)) " 18446744073709551295" + test "test2162" (lazy(sprintf "% 05u" -321L)) " 18446744073709551295" + test "test2163" (lazy(sprintf "% 01u" -321L)) " 18446744073709551295" + test "test2164" (lazy(sprintf "% 0*u" 7 -321L)) " 18446744073709551295" + test "test2165" (lazy(sprintf "%- 0u" -321L)) " 18446744073709551295" + test "test2166" (lazy(sprintf "%- 05u" -321L)) " 18446744073709551295" + test "test2167" (lazy(sprintf "%- 01u" -321L)) " 18446744073709551295" + test "test2168" (lazy(sprintf "%- 0*u" 7 -321L)) " 18446744073709551295" + test "test2169" (lazy(sprintf "%u" 50000UL)) "50000" + test "test2170" (lazy(sprintf "%5u" 50000UL)) "50000" + test "test2171" (lazy(sprintf "%1u" 50000UL)) "50000" + test "test2172" (lazy(sprintf "%*u" 7 50000UL)) " 50000" + test "test2173" (lazy(sprintf "%-u" 50000UL)) "50000" + test "test2174" (lazy(sprintf "%-5u" 50000UL)) "50000" + test "test2175" (lazy(sprintf "%-1u" 50000UL)) "50000" + test "test2176" (lazy(sprintf "%-*u" 7 50000UL)) "50000 " + test "test2177" (lazy(sprintf "%0u" 50000UL)) "50000" + test "test2178" (lazy(sprintf "%05u" 50000UL)) "50000" + test "test2179" (lazy(sprintf "%01u" 50000UL)) "50000" + test "test2180" (lazy(sprintf "%0*u" 7 50000UL)) "0050000" + test "test2181" (lazy(sprintf "%-0u" 50000UL)) "50000" + test "test2182" (lazy(sprintf "%-05u" 50000UL)) "50000" + test "test2183" (lazy(sprintf "%-01u" 50000UL)) "50000" + test "test2184" (lazy(sprintf "%-0*u" 7 50000UL)) "50000 " + test "test2185" (lazy(sprintf "%+u" 50000UL)) "+50000" + test "test2186" (lazy(sprintf "%+5u" 50000UL)) "+50000" + test "test2187" (lazy(sprintf "%+1u" 50000UL)) "+50000" + test "test2188" (lazy(sprintf "%+*u" 7 50000UL)) " +50000" + test "test2189" (lazy(sprintf "%-+u" 50000UL)) "+50000" + test "test2190" (lazy(sprintf "%-+5u" 50000UL)) "+50000" + test "test2191" (lazy(sprintf "%-+1u" 50000UL)) "+50000" + test "test2192" (lazy(sprintf "%-+*u" 7 50000UL)) "+50000 " + test "test2193" (lazy(sprintf "%+0u" 50000UL)) "+50000" + test "test2194" (lazy(sprintf "%+05u" 50000UL)) "+50000" + test "test2195" (lazy(sprintf "%+01u" 50000UL)) "+50000" + test "test2196" (lazy(sprintf "%+0*u" 7 50000UL)) "+050000" + test "test2197" (lazy(sprintf "%-+0u" 50000UL)) "+50000" + test "test2198" (lazy(sprintf "%-+05u" 50000UL)) "+50000" + test "test2199" (lazy(sprintf "%-+01u" 50000UL)) "+50000" + test "test2200" (lazy(sprintf "%-+0*u" 7 50000UL)) "+50000 " + test "test2201" (lazy(sprintf "% u" 50000UL)) " 50000" + test "test2202" (lazy(sprintf "% 5u" 50000UL)) " 50000" + test "test2203" (lazy(sprintf "% 1u" 50000UL)) " 50000" + test "test2204" (lazy(sprintf "% *u" 7 50000UL)) " 50000" + test "test2205" (lazy(sprintf "%- u" 50000UL)) " 50000" + test "test2206" (lazy(sprintf "%- 5u" 50000UL)) " 50000" + test "test2207" (lazy(sprintf "%- 1u" 50000UL)) " 50000" + test "test2208" (lazy(sprintf "%- *u" 7 50000UL)) " 50000 " + test "test2209" (lazy(sprintf "% 0u" 50000UL)) " 50000" + test "test2210" (lazy(sprintf "% 05u" 50000UL)) " 50000" + test "test2211" (lazy(sprintf "% 01u" 50000UL)) " 50000" + test "test2212" (lazy(sprintf "% 0*u" 7 50000UL)) " 050000" + test "test2213" (lazy(sprintf "%- 0u" 50000UL)) " 50000" + test "test2214" (lazy(sprintf "%- 05u" 50000UL)) " 50000" + test "test2215" (lazy(sprintf "%- 01u" 50000UL)) " 50000" + test "test2216" (lazy(sprintf "%- 0*u" 7 50000UL)) " 50000 " + test "test2217" (lazy(sprintf "%u" System.Int32.MaxValue)) "2147483647" + test "test2218" (lazy(sprintf "%5u" System.Int32.MaxValue)) "2147483647" + test "test2219" (lazy(sprintf "%1u" System.Int32.MaxValue)) "2147483647" + test "test2220" (lazy(sprintf "%*u" 7 System.Int32.MaxValue)) "2147483647" + test "test2221" (lazy(sprintf "%-u" System.Int32.MaxValue)) "2147483647" + test "test2222" (lazy(sprintf "%-5u" System.Int32.MaxValue)) "2147483647" + test "test2223" (lazy(sprintf "%-1u" System.Int32.MaxValue)) "2147483647" + test "test2224" (lazy(sprintf "%-*u" 7 System.Int32.MaxValue)) "2147483647" + test "test2225" (lazy(sprintf "%0u" System.Int32.MaxValue)) "2147483647" + test "test2226" (lazy(sprintf "%05u" System.Int32.MaxValue)) "2147483647" + test "test2227" (lazy(sprintf "%01u" System.Int32.MaxValue)) "2147483647" + test "test2228" (lazy(sprintf "%0*u" 7 System.Int32.MaxValue)) "2147483647" + test "test2229" (lazy(sprintf "%-0u" System.Int32.MaxValue)) "2147483647" + test "test2230" (lazy(sprintf "%-05u" System.Int32.MaxValue)) "2147483647" + test "test2231" (lazy(sprintf "%-01u" System.Int32.MaxValue)) "2147483647" + test "test2232" (lazy(sprintf "%-0*u" 7 System.Int32.MaxValue)) "2147483647" + test "test2233" (lazy(sprintf "%+u" System.Int32.MaxValue)) "+2147483647" + test "test2234" (lazy(sprintf "%+5u" System.Int32.MaxValue)) "+2147483647" + test "test2235" (lazy(sprintf "%+1u" System.Int32.MaxValue)) "+2147483647" + test "test2236" (lazy(sprintf "%+*u" 7 System.Int32.MaxValue)) "+2147483647" + test "test2237" (lazy(sprintf "%-+u" System.Int32.MaxValue)) "+2147483647" + test "test2238" (lazy(sprintf "%-+5u" System.Int32.MaxValue)) "+2147483647" + test "test2239" (lazy(sprintf "%-+1u" System.Int32.MaxValue)) "+2147483647" + test "test2240" (lazy(sprintf "%-+*u" 7 System.Int32.MaxValue)) "+2147483647" + test "test2241" (lazy(sprintf "%+0u" System.Int32.MaxValue)) "+2147483647" + test "test2242" (lazy(sprintf "%+05u" System.Int32.MaxValue)) "+2147483647" + test "test2243" (lazy(sprintf "%+01u" System.Int32.MaxValue)) "+2147483647" + test "test2244" (lazy(sprintf "%+0*u" 7 System.Int32.MaxValue)) "+2147483647" + test "test2245" (lazy(sprintf "%-+0u" System.Int32.MaxValue)) "+2147483647" + test "test2246" (lazy(sprintf "%-+05u" System.Int32.MaxValue)) "+2147483647" + test "test2247" (lazy(sprintf "%-+01u" System.Int32.MaxValue)) "+2147483647" + test "test2248" (lazy(sprintf "%-+0*u" 7 System.Int32.MaxValue)) "+2147483647" + test "test2249" (lazy(sprintf "% u" System.Int32.MaxValue)) " 2147483647" + test "test2250" (lazy(sprintf "% 5u" System.Int32.MaxValue)) " 2147483647" + test "test2251" (lazy(sprintf "% 1u" System.Int32.MaxValue)) " 2147483647" + test "test2252" (lazy(sprintf "% *u" 7 System.Int32.MaxValue)) " 2147483647" + test "test2253" (lazy(sprintf "%- u" System.Int32.MaxValue)) " 2147483647" + test "test2254" (lazy(sprintf "%- 5u" System.Int32.MaxValue)) " 2147483647" + test "test2255" (lazy(sprintf "%- 1u" System.Int32.MaxValue)) " 2147483647" + test "test2256" (lazy(sprintf "%- *u" 7 System.Int32.MaxValue)) " 2147483647" + test "test2257" (lazy(sprintf "% 0u" System.Int32.MaxValue)) " 2147483647" + test "test2258" (lazy(sprintf "% 05u" System.Int32.MaxValue)) " 2147483647" + test "test2259" (lazy(sprintf "% 01u" System.Int32.MaxValue)) " 2147483647" + test "test2260" (lazy(sprintf "% 0*u" 7 System.Int32.MaxValue)) " 2147483647" + test "test2261" (lazy(sprintf "%- 0u" System.Int32.MaxValue)) " 2147483647" + test "test2262" (lazy(sprintf "%- 05u" System.Int32.MaxValue)) " 2147483647" + test "test2263" (lazy(sprintf "%- 01u" System.Int32.MaxValue)) " 2147483647" + test "test2264" (lazy(sprintf "%- 0*u" 7 System.Int32.MaxValue)) " 2147483647" + test "test2265" (lazy(sprintf "%u" System.Int64.MaxValue)) "9223372036854775807" + test "test2266" (lazy(sprintf "%5u" System.Int64.MaxValue)) "9223372036854775807" + test "test2267" (lazy(sprintf "%1u" System.Int64.MaxValue)) "9223372036854775807" + test "test2268" (lazy(sprintf "%*u" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test2269" (lazy(sprintf "%-u" System.Int64.MaxValue)) "9223372036854775807" + test "test2270" (lazy(sprintf "%-5u" System.Int64.MaxValue)) "9223372036854775807" + test "test2271" (lazy(sprintf "%-1u" System.Int64.MaxValue)) "9223372036854775807" + test "test2272" (lazy(sprintf "%-*u" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test2273" (lazy(sprintf "%0u" System.Int64.MaxValue)) "9223372036854775807" + test "test2274" (lazy(sprintf "%05u" System.Int64.MaxValue)) "9223372036854775807" + test "test2275" (lazy(sprintf "%01u" System.Int64.MaxValue)) "9223372036854775807" + test "test2276" (lazy(sprintf "%0*u" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test2277" (lazy(sprintf "%-0u" System.Int64.MaxValue)) "9223372036854775807" + test "test2278" (lazy(sprintf "%-05u" System.Int64.MaxValue)) "9223372036854775807" + test "test2279" (lazy(sprintf "%-01u" System.Int64.MaxValue)) "9223372036854775807" + test "test2280" (lazy(sprintf "%-0*u" 7 System.Int64.MaxValue)) "9223372036854775807" + test "test2281" (lazy(sprintf "%+u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2282" (lazy(sprintf "%+5u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2283" (lazy(sprintf "%+1u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2284" (lazy(sprintf "%+*u" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test2285" (lazy(sprintf "%-+u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2286" (lazy(sprintf "%-+5u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2287" (lazy(sprintf "%-+1u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2288" (lazy(sprintf "%-+*u" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test2289" (lazy(sprintf "%+0u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2290" (lazy(sprintf "%+05u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2291" (lazy(sprintf "%+01u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2292" (lazy(sprintf "%+0*u" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test2293" (lazy(sprintf "%-+0u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2294" (lazy(sprintf "%-+05u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2295" (lazy(sprintf "%-+01u" System.Int64.MaxValue)) "+9223372036854775807" + test "test2296" (lazy(sprintf "%-+0*u" 7 System.Int64.MaxValue)) "+9223372036854775807" + test "test2297" (lazy(sprintf "% u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2298" (lazy(sprintf "% 5u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2299" (lazy(sprintf "% 1u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2300" (lazy(sprintf "% *u" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test2301" (lazy(sprintf "%- u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2302" (lazy(sprintf "%- 5u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2303" (lazy(sprintf "%- 1u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2304" (lazy(sprintf "%- *u" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test2305" (lazy(sprintf "% 0u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2306" (lazy(sprintf "% 05u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2307" (lazy(sprintf "% 01u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2308" (lazy(sprintf "% 0*u" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test2309" (lazy(sprintf "%- 0u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2310" (lazy(sprintf "%- 05u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2311" (lazy(sprintf "%- 01u" System.Int64.MaxValue)) " 9223372036854775807" + test "test2312" (lazy(sprintf "%- 0*u" 7 System.Int64.MaxValue)) " 9223372036854775807" + test "test2313" (lazy(sprintf "%u" System.Int32.MinValue)) "2147483648" + test "test2314" (lazy(sprintf "%5u" System.Int32.MinValue)) "2147483648" + test "test2315" (lazy(sprintf "%1u" System.Int32.MinValue)) "2147483648" + test "test2316" (lazy(sprintf "%*u" 7 System.Int32.MinValue)) "2147483648" + test "test2317" (lazy(sprintf "%-u" System.Int32.MinValue)) "2147483648" + test "test2318" (lazy(sprintf "%-5u" System.Int32.MinValue)) "2147483648" + test "test2319" (lazy(sprintf "%-1u" System.Int32.MinValue)) "2147483648" + test "test2320" (lazy(sprintf "%-*u" 7 System.Int32.MinValue)) "2147483648" + test "test2321" (lazy(sprintf "%0u" System.Int32.MinValue)) "2147483648" + test "test2322" (lazy(sprintf "%05u" System.Int32.MinValue)) "2147483648" + test "test2323" (lazy(sprintf "%01u" System.Int32.MinValue)) "2147483648" + test "test2324" (lazy(sprintf "%0*u" 7 System.Int32.MinValue)) "2147483648" + test "test2325" (lazy(sprintf "%-0u" System.Int32.MinValue)) "2147483648" + test "test2326" (lazy(sprintf "%-05u" System.Int32.MinValue)) "2147483648" + test "test2327" (lazy(sprintf "%-01u" System.Int32.MinValue)) "2147483648" + test "test2328" (lazy(sprintf "%-0*u" 7 System.Int32.MinValue)) "2147483648" + test "test2329" (lazy(sprintf "%+u" System.Int32.MinValue)) "+2147483648" + test "test2330" (lazy(sprintf "%+5u" System.Int32.MinValue)) "+2147483648" + test "test2331" (lazy(sprintf "%+1u" System.Int32.MinValue)) "+2147483648" + test "test2332" (lazy(sprintf "%+*u" 7 System.Int32.MinValue)) "+2147483648" + test "test2333" (lazy(sprintf "%-+u" System.Int32.MinValue)) "+2147483648" + test "test2334" (lazy(sprintf "%-+5u" System.Int32.MinValue)) "+2147483648" + test "test2335" (lazy(sprintf "%-+1u" System.Int32.MinValue)) "+2147483648" + test "test2336" (lazy(sprintf "%-+*u" 7 System.Int32.MinValue)) "+2147483648" + test "test2337" (lazy(sprintf "%+0u" System.Int32.MinValue)) "+2147483648" + test "test2338" (lazy(sprintf "%+05u" System.Int32.MinValue)) "+2147483648" + test "test2339" (lazy(sprintf "%+01u" System.Int32.MinValue)) "+2147483648" + test "test2340" (lazy(sprintf "%+0*u" 7 System.Int32.MinValue)) "+2147483648" + test "test2341" (lazy(sprintf "%-+0u" System.Int32.MinValue)) "+2147483648" + test "test2342" (lazy(sprintf "%-+05u" System.Int32.MinValue)) "+2147483648" + test "test2343" (lazy(sprintf "%-+01u" System.Int32.MinValue)) "+2147483648" + test "test2344" (lazy(sprintf "%-+0*u" 7 System.Int32.MinValue)) "+2147483648" + test "test2345" (lazy(sprintf "% u" System.Int32.MinValue)) " 2147483648" + test "test2346" (lazy(sprintf "% 5u" System.Int32.MinValue)) " 2147483648" + test "test2347" (lazy(sprintf "% 1u" System.Int32.MinValue)) " 2147483648" + test "test2348" (lazy(sprintf "% *u" 7 System.Int32.MinValue)) " 2147483648" + test "test2349" (lazy(sprintf "%- u" System.Int32.MinValue)) " 2147483648" + test "test2350" (lazy(sprintf "%- 5u" System.Int32.MinValue)) " 2147483648" + test "test2351" (lazy(sprintf "%- 1u" System.Int32.MinValue)) " 2147483648" + test "test2352" (lazy(sprintf "%- *u" 7 System.Int32.MinValue)) " 2147483648" + test "test2353" (lazy(sprintf "% 0u" System.Int32.MinValue)) " 2147483648" + test "test2354" (lazy(sprintf "% 05u" System.Int32.MinValue)) " 2147483648" + test "test2355" (lazy(sprintf "% 01u" System.Int32.MinValue)) " 2147483648" + test "test2356" (lazy(sprintf "% 0*u" 7 System.Int32.MinValue)) " 2147483648" + test "test2357" (lazy(sprintf "%- 0u" System.Int32.MinValue)) " 2147483648" + test "test2358" (lazy(sprintf "%- 05u" System.Int32.MinValue)) " 2147483648" + test "test2359" (lazy(sprintf "%- 01u" System.Int32.MinValue)) " 2147483648" + test "test2360" (lazy(sprintf "%- 0*u" 7 System.Int32.MinValue)) " 2147483648" + test "test2361" (lazy(sprintf "%u" System.Int64.MinValue)) "9223372036854775808" + test "test2362" (lazy(sprintf "%5u" System.Int64.MinValue)) "9223372036854775808" + test "test2363" (lazy(sprintf "%1u" System.Int64.MinValue)) "9223372036854775808" + test "test2364" (lazy(sprintf "%*u" 7 System.Int64.MinValue)) "9223372036854775808" + test "test2365" (lazy(sprintf "%-u" System.Int64.MinValue)) "9223372036854775808" + test "test2366" (lazy(sprintf "%-5u" System.Int64.MinValue)) "9223372036854775808" + test "test2367" (lazy(sprintf "%-1u" System.Int64.MinValue)) "9223372036854775808" + test "test2368" (lazy(sprintf "%-*u" 7 System.Int64.MinValue)) "9223372036854775808" + test "test2369" (lazy(sprintf "%0u" System.Int64.MinValue)) "9223372036854775808" + test "test2370" (lazy(sprintf "%05u" System.Int64.MinValue)) "9223372036854775808" + test "test2371" (lazy(sprintf "%01u" System.Int64.MinValue)) "9223372036854775808" + test "test2372" (lazy(sprintf "%0*u" 7 System.Int64.MinValue)) "9223372036854775808" + test "test2373" (lazy(sprintf "%-0u" System.Int64.MinValue)) "9223372036854775808" + test "test2374" (lazy(sprintf "%-05u" System.Int64.MinValue)) "9223372036854775808" + test "test2375" (lazy(sprintf "%-01u" System.Int64.MinValue)) "9223372036854775808" + test "test2376" (lazy(sprintf "%-0*u" 7 System.Int64.MinValue)) "9223372036854775808" + test "test2377" (lazy(sprintf "%+u" System.Int64.MinValue)) "+9223372036854775808" + test "test2378" (lazy(sprintf "%+5u" System.Int64.MinValue)) "+9223372036854775808" + test "test2379" (lazy(sprintf "%+1u" System.Int64.MinValue)) "+9223372036854775808" + test "test2380" (lazy(sprintf "%+*u" 7 System.Int64.MinValue)) "+9223372036854775808" + test "test2381" (lazy(sprintf "%-+u" System.Int64.MinValue)) "+9223372036854775808" + test "test2382" (lazy(sprintf "%-+5u" System.Int64.MinValue)) "+9223372036854775808" + test "test2383" (lazy(sprintf "%-+1u" System.Int64.MinValue)) "+9223372036854775808" + test "test2384" (lazy(sprintf "%-+*u" 7 System.Int64.MinValue)) "+9223372036854775808" + test "test2385" (lazy(sprintf "%+0u" System.Int64.MinValue)) "+9223372036854775808" + test "test2386" (lazy(sprintf "%+05u" System.Int64.MinValue)) "+9223372036854775808" + test "test2387" (lazy(sprintf "%+01u" System.Int64.MinValue)) "+9223372036854775808" + test "test2388" (lazy(sprintf "%+0*u" 7 System.Int64.MinValue)) "+9223372036854775808" + test "test2389" (lazy(sprintf "%-+0u" System.Int64.MinValue)) "+9223372036854775808" + test "test2390" (lazy(sprintf "%-+05u" System.Int64.MinValue)) "+9223372036854775808" + test "test2391" (lazy(sprintf "%-+01u" System.Int64.MinValue)) "+9223372036854775808" + test "test2392" (lazy(sprintf "%-+0*u" 7 System.Int64.MinValue)) "+9223372036854775808" + test "test2393" (lazy(sprintf "% u" System.Int64.MinValue)) " 9223372036854775808" + test "test2394" (lazy(sprintf "% 5u" System.Int64.MinValue)) " 9223372036854775808" + test "test2395" (lazy(sprintf "% 1u" System.Int64.MinValue)) " 9223372036854775808" + test "test2396" (lazy(sprintf "% *u" 7 System.Int64.MinValue)) " 9223372036854775808" + test "test2397" (lazy(sprintf "%- u" System.Int64.MinValue)) " 9223372036854775808" + test "test2398" (lazy(sprintf "%- 5u" System.Int64.MinValue)) " 9223372036854775808" + test "test2399" (lazy(sprintf "%- 1u" System.Int64.MinValue)) " 9223372036854775808" + test "test2400" (lazy(sprintf "%- *u" 7 System.Int64.MinValue)) " 9223372036854775808" + test "test2401" (lazy(sprintf "% 0u" System.Int64.MinValue)) " 9223372036854775808" + test "test2402" (lazy(sprintf "% 05u" System.Int64.MinValue)) " 9223372036854775808" + test "test2403" (lazy(sprintf "% 01u" System.Int64.MinValue)) " 9223372036854775808" + test "test2404" (lazy(sprintf "% 0*u" 7 System.Int64.MinValue)) " 9223372036854775808" + test "test2405" (lazy(sprintf "%- 0u" System.Int64.MinValue)) " 9223372036854775808" + test "test2406" (lazy(sprintf "%- 05u" System.Int64.MinValue)) " 9223372036854775808" + test "test2407" (lazy(sprintf "%- 01u" System.Int64.MinValue)) " 9223372036854775808" + test "test2408" (lazy(sprintf "%- 0*u" 7 System.Int64.MinValue)) " 9223372036854775808" + test "test2409" (lazy(sprintf "%u" 55n)) "55" + test "test2410" (lazy(sprintf "%5u" 55n)) " 55" + test "test2411" (lazy(sprintf "%1u" 55n)) "55" + test "test2412" (lazy(sprintf "%*u" 7 55n)) " 55" + test "test2413" (lazy(sprintf "%-u" 55n)) "55" + test "test2414" (lazy(sprintf "%-5u" 55n)) "55 " + test "test2415" (lazy(sprintf "%-1u" 55n)) "55" + test "test2416" (lazy(sprintf "%-*u" 7 55n)) "55 " + test "test2417" (lazy(sprintf "%0u" 55n)) "55" + test "test2418" (lazy(sprintf "%05u" 55n)) "00055" + test "test2419" (lazy(sprintf "%01u" 55n)) "55" + test "test2420" (lazy(sprintf "%0*u" 7 55n)) "0000055" + test "test2421" (lazy(sprintf "%-0u" 55n)) "55" + test "test2422" (lazy(sprintf "%-05u" 55n)) "55 " + test "test2423" (lazy(sprintf "%-01u" 55n)) "55" + test "test2424" (lazy(sprintf "%-0*u" 7 55n)) "55 " + test "test2425" (lazy(sprintf "%+u" 55n)) "+55" + test "test2426" (lazy(sprintf "%+5u" 55n)) " +55" + test "test2427" (lazy(sprintf "%+1u" 55n)) "+55" + test "test2428" (lazy(sprintf "%+*u" 7 55n)) " +55" + test "test2429" (lazy(sprintf "%-+u" 55n)) "+55" + test "test2430" (lazy(sprintf "%-+5u" 55n)) "+55 " + test "test2431" (lazy(sprintf "%-+1u" 55n)) "+55" + test "test2432" (lazy(sprintf "%-+*u" 7 55n)) "+55 " + test "test2433" (lazy(sprintf "%+0u" 55n)) "+55" + test "test2434" (lazy(sprintf "%+05u" 55n)) "+0055" + test "test2435" (lazy(sprintf "%+01u" 55n)) "+55" + test "test2436" (lazy(sprintf "%+0*u" 7 55n)) "+000055" + test "test2437" (lazy(sprintf "%-+0u" 55n)) "+55" + test "test2438" (lazy(sprintf "%-+05u" 55n)) "+55 " + test "test2439" (lazy(sprintf "%-+01u" 55n)) "+55" + test "test2440" (lazy(sprintf "%-+0*u" 7 55n)) "+55 " + test "test2441" (lazy(sprintf "% u" 55n)) " 55" + test "test2442" (lazy(sprintf "% 5u" 55n)) " 55" + test "test2443" (lazy(sprintf "% 1u" 55n)) " 55" + test "test2444" (lazy(sprintf "% *u" 7 55n)) " 55" + test "test2445" (lazy(sprintf "%- u" 55n)) " 55" + test "test2446" (lazy(sprintf "%- 5u" 55n)) " 55 " + test "test2447" (lazy(sprintf "%- 1u" 55n)) " 55" + test "test2448" (lazy(sprintf "%- *u" 7 55n)) " 55 " + test "test2449" (lazy(sprintf "% 0u" 55n)) " 55" + test "test2450" (lazy(sprintf "% 05u" 55n)) " 0055" + test "test2451" (lazy(sprintf "% 01u" 55n)) " 55" + test "test2452" (lazy(sprintf "% 0*u" 7 55n)) " 000055" + test "test2453" (lazy(sprintf "%- 0u" 55n)) " 55" + test "test2454" (lazy(sprintf "%- 05u" 55n)) " 55 " + test "test2455" (lazy(sprintf "%- 01u" 55n)) " 55" + test "test2456" (lazy(sprintf "%- 0*u" 7 55n)) " 55 " + test "test2457" (lazy(sprintf "%u" 999un)) "999" + test "test2458" (lazy(sprintf "%5u" 999un)) " 999" + test "test2459" (lazy(sprintf "%1u" 999un)) "999" + test "test2460" (lazy(sprintf "%*u" 7 999un)) " 999" + test "test2461" (lazy(sprintf "%-u" 999un)) "999" + test "test2462" (lazy(sprintf "%-5u" 999un)) "999 " + test "test2463" (lazy(sprintf "%-1u" 999un)) "999" + test "test2464" (lazy(sprintf "%-*u" 7 999un)) "999 " + test "test2465" (lazy(sprintf "%0u" 999un)) "999" + test "test2466" (lazy(sprintf "%05u" 999un)) "00999" + test "test2467" (lazy(sprintf "%01u" 999un)) "999" + test "test2468" (lazy(sprintf "%0*u" 7 999un)) "0000999" + test "test2469" (lazy(sprintf "%-0u" 999un)) "999" + test "test2470" (lazy(sprintf "%-05u" 999un)) "999 " + test "test2471" (lazy(sprintf "%-01u" 999un)) "999" + test "test2472" (lazy(sprintf "%-0*u" 7 999un)) "999 " + test "test2473" (lazy(sprintf "%+u" 999un)) "+999" + test "test2474" (lazy(sprintf "%+5u" 999un)) " +999" + test "test2475" (lazy(sprintf "%+1u" 999un)) "+999" + test "test2476" (lazy(sprintf "%+*u" 7 999un)) " +999" + test "test2477" (lazy(sprintf "%-+u" 999un)) "+999" + test "test2478" (lazy(sprintf "%-+5u" 999un)) "+999 " + test "test2479" (lazy(sprintf "%-+1u" 999un)) "+999" + test "test2480" (lazy(sprintf "%-+*u" 7 999un)) "+999 " + test "test2481" (lazy(sprintf "%+0u" 999un)) "+999" + test "test2482" (lazy(sprintf "%+05u" 999un)) "+0999" + test "test2483" (lazy(sprintf "%+01u" 999un)) "+999" + test "test2484" (lazy(sprintf "%+0*u" 7 999un)) "+000999" + test "test2485" (lazy(sprintf "%-+0u" 999un)) "+999" + test "test2486" (lazy(sprintf "%-+05u" 999un)) "+999 " + test "test2487" (lazy(sprintf "%-+01u" 999un)) "+999" + test "test2488" (lazy(sprintf "%-+0*u" 7 999un)) "+999 " + test "test2489" (lazy(sprintf "% u" 999un)) " 999" + test "test2490" (lazy(sprintf "% 5u" 999un)) " 999" + test "test2491" (lazy(sprintf "% 1u" 999un)) " 999" + test "test2492" (lazy(sprintf "% *u" 7 999un)) " 999" + test "test2493" (lazy(sprintf "%- u" 999un)) " 999" + test "test2494" (lazy(sprintf "%- 5u" 999un)) " 999 " + test "test2495" (lazy(sprintf "%- 1u" 999un)) " 999" + test "test2496" (lazy(sprintf "%- *u" 7 999un)) " 999 " + test "test2497" (lazy(sprintf "% 0u" 999un)) " 999" + test "test2498" (lazy(sprintf "% 05u" 999un)) " 0999" + test "test2499" (lazy(sprintf "% 01u" 999un)) " 999" + test "test2500" (lazy(sprintf "% 0*u" 7 999un)) " 000999" + test "test2501" (lazy(sprintf "%- 0u" 999un)) " 999" + test "test2502" (lazy(sprintf "%- 05u" 999un)) " 999 " + test "test2503" (lazy(sprintf "%- 01u" 999un)) " 999" + test "test2504" (lazy(sprintf "%- 0*u" 7 999un)) " 999 " + test "test2505" (lazy(sprintf "%x" 14)) "e" + test "test2506" (lazy(sprintf "%5x" 14)) " e" + test "test2507" (lazy(sprintf "%1x" 14)) "e" + test "test2508" (lazy(sprintf "%*x" 7 14)) " e" + test "test2509" (lazy(sprintf "%-x" 14)) "e" + test "test2510" (lazy(sprintf "%-5x" 14)) "e " + test "test2511" (lazy(sprintf "%-1x" 14)) "e" + test "test2512" (lazy(sprintf "%-*x" 7 14)) "e " + test "test2513" (lazy(sprintf "%0x" 14)) "e" + test "test2514" (lazy(sprintf "%05x" 14)) "0000e" + test "test2515" (lazy(sprintf "%01x" 14)) "e" + test "test2516" (lazy(sprintf "%0*x" 7 14)) "000000e" + test "test2517" (lazy(sprintf "%-0x" 14)) "e" + test "test2518" (lazy(sprintf "%-05x" 14)) "e " + test "test2519" (lazy(sprintf "%-01x" 14)) "e" + test "test2520" (lazy(sprintf "%-0*x" 7 14)) "e " + test "test2521" (lazy(sprintf "%+x" 14)) "+e" + test "test2522" (lazy(sprintf "%+5x" 14)) " +e" + test "test2523" (lazy(sprintf "%+1x" 14)) "+e" + test "test2524" (lazy(sprintf "%+*x" 7 14)) " +e" + test "test2525" (lazy(sprintf "%-+x" 14)) "+e" + test "test2526" (lazy(sprintf "%-+5x" 14)) "+e " + test "test2527" (lazy(sprintf "%-+1x" 14)) "+e" + test "test2528" (lazy(sprintf "%-+*x" 7 14)) "+e " + test "test2529" (lazy(sprintf "%+0x" 14)) "+e" + test "test2530" (lazy(sprintf "%+05x" 14)) "+000e" + test "test2531" (lazy(sprintf "%+01x" 14)) "+e" + test "test2532" (lazy(sprintf "%+0*x" 7 14)) "+00000e" + test "test2533" (lazy(sprintf "%-+0x" 14)) "+e" + test "test2534" (lazy(sprintf "%-+05x" 14)) "+e " + test "test2535" (lazy(sprintf "%-+01x" 14)) "+e" + test "test2536" (lazy(sprintf "%-+0*x" 7 14)) "+e " + test "test2537" (lazy(sprintf "% x" 14)) " e" + test "test2538" (lazy(sprintf "% 5x" 14)) " e" + test "test2539" (lazy(sprintf "% 1x" 14)) " e" + test "test2540" (lazy(sprintf "% *x" 7 14)) " e" + test "test2541" (lazy(sprintf "%- x" 14)) " e" + test "test2542" (lazy(sprintf "%- 5x" 14)) " e " + test "test2543" (lazy(sprintf "%- 1x" 14)) " e" + test "test2544" (lazy(sprintf "%- *x" 7 14)) " e " + test "test2545" (lazy(sprintf "% 0x" 14)) " e" + test "test2546" (lazy(sprintf "% 05x" 14)) " 000e" + test "test2547" (lazy(sprintf "% 01x" 14)) " e" + test "test2548" (lazy(sprintf "% 0*x" 7 14)) " 00000e" + test "test2549" (lazy(sprintf "%- 0x" 14)) " e" + test "test2550" (lazy(sprintf "%- 05x" 14)) " e " + test "test2551" (lazy(sprintf "%- 01x" 14)) " e" + test "test2552" (lazy(sprintf "%- 0*x" 7 14)) " e " + test "test2553" (lazy(sprintf "%x" -10)) "fffffff6" + test "test2554" (lazy(sprintf "%5x" -10)) "fffffff6" + test "test2555" (lazy(sprintf "%1x" -10)) "fffffff6" + test "test2556" (lazy(sprintf "%*x" 7 -10)) "fffffff6" + test "test2557" (lazy(sprintf "%-x" -10)) "fffffff6" + test "test2558" (lazy(sprintf "%-5x" -10)) "fffffff6" + test "test2559" (lazy(sprintf "%-1x" -10)) "fffffff6" + test "test2560" (lazy(sprintf "%-*x" 7 -10)) "fffffff6" + test "test2561" (lazy(sprintf "%0x" -10)) "fffffff6" + test "test2562" (lazy(sprintf "%05x" -10)) "fffffff6" + test "test2563" (lazy(sprintf "%01x" -10)) "fffffff6" + test "test2564" (lazy(sprintf "%0*x" 7 -10)) "fffffff6" + test "test2565" (lazy(sprintf "%-0x" -10)) "fffffff6" + test "test2566" (lazy(sprintf "%-05x" -10)) "fffffff6" + test "test2567" (lazy(sprintf "%-01x" -10)) "fffffff6" + test "test2568" (lazy(sprintf "%-0*x" 7 -10)) "fffffff6" + test "test2569" (lazy(sprintf "%+x" -10)) "+fffffff6" + test "test2570" (lazy(sprintf "%+5x" -10)) "+fffffff6" + test "test2571" (lazy(sprintf "%+1x" -10)) "+fffffff6" + test "test2572" (lazy(sprintf "%+*x" 7 -10)) "+fffffff6" + test "test2573" (lazy(sprintf "%-+x" -10)) "+fffffff6" + test "test2574" (lazy(sprintf "%-+5x" -10)) "+fffffff6" + test "test2575" (lazy(sprintf "%-+1x" -10)) "+fffffff6" + test "test2576" (lazy(sprintf "%-+*x" 7 -10)) "+fffffff6" + test "test2577" (lazy(sprintf "%+0x" -10)) "+fffffff6" + test "test2578" (lazy(sprintf "%+05x" -10)) "+fffffff6" + test "test2579" (lazy(sprintf "%+01x" -10)) "+fffffff6" + test "test2580" (lazy(sprintf "%+0*x" 7 -10)) "+fffffff6" + test "test2581" (lazy(sprintf "%-+0x" -10)) "+fffffff6" + test "test2582" (lazy(sprintf "%-+05x" -10)) "+fffffff6" + test "test2583" (lazy(sprintf "%-+01x" -10)) "+fffffff6" + test "test2584" (lazy(sprintf "%-+0*x" 7 -10)) "+fffffff6" + test "test2585" (lazy(sprintf "% x" -10)) " fffffff6" + test "test2586" (lazy(sprintf "% 5x" -10)) " fffffff6" + test "test2587" (lazy(sprintf "% 1x" -10)) " fffffff6" + test "test2588" (lazy(sprintf "% *x" 7 -10)) " fffffff6" + test "test2589" (lazy(sprintf "%- x" -10)) " fffffff6" + test "test2590" (lazy(sprintf "%- 5x" -10)) " fffffff6" + test "test2591" (lazy(sprintf "%- 1x" -10)) " fffffff6" + test "test2592" (lazy(sprintf "%- *x" 7 -10)) " fffffff6" + test "test2593" (lazy(sprintf "% 0x" -10)) " fffffff6" + test "test2594" (lazy(sprintf "% 05x" -10)) " fffffff6" + test "test2595" (lazy(sprintf "% 01x" -10)) " fffffff6" + test "test2596" (lazy(sprintf "% 0*x" 7 -10)) " fffffff6" + test "test2597" (lazy(sprintf "%- 0x" -10)) " fffffff6" + test "test2598" (lazy(sprintf "%- 05x" -10)) " fffffff6" + test "test2599" (lazy(sprintf "%- 01x" -10)) " fffffff6" + test "test2600" (lazy(sprintf "%- 0*x" 7 -10)) " fffffff6" + test "test2601" (lazy(sprintf "%x" 55s)) "37" + test "test2602" (lazy(sprintf "%5x" 55s)) " 37" + test "test2603" (lazy(sprintf "%1x" 55s)) "37" + test "test2604" (lazy(sprintf "%*x" 7 55s)) " 37" + test "test2605" (lazy(sprintf "%-x" 55s)) "37" + test "test2606" (lazy(sprintf "%-5x" 55s)) "37 " + test "test2607" (lazy(sprintf "%-1x" 55s)) "37" + test "test2608" (lazy(sprintf "%-*x" 7 55s)) "37 " + test "test2609" (lazy(sprintf "%0x" 55s)) "37" + test "test2610" (lazy(sprintf "%05x" 55s)) "00037" + test "test2611" (lazy(sprintf "%01x" 55s)) "37" + test "test2612" (lazy(sprintf "%0*x" 7 55s)) "0000037" + test "test2613" (lazy(sprintf "%-0x" 55s)) "37" + test "test2614" (lazy(sprintf "%-05x" 55s)) "37 " + test "test2615" (lazy(sprintf "%-01x" 55s)) "37" + test "test2616" (lazy(sprintf "%-0*x" 7 55s)) "37 " + test "test2617" (lazy(sprintf "%+x" 55s)) "+37" + test "test2618" (lazy(sprintf "%+5x" 55s)) " +37" + test "test2619" (lazy(sprintf "%+1x" 55s)) "+37" + test "test2620" (lazy(sprintf "%+*x" 7 55s)) " +37" + test "test2621" (lazy(sprintf "%-+x" 55s)) "+37" + test "test2622" (lazy(sprintf "%-+5x" 55s)) "+37 " + test "test2623" (lazy(sprintf "%-+1x" 55s)) "+37" + test "test2624" (lazy(sprintf "%-+*x" 7 55s)) "+37 " + test "test2625" (lazy(sprintf "%+0x" 55s)) "+37" + test "test2626" (lazy(sprintf "%+05x" 55s)) "+0037" + test "test2627" (lazy(sprintf "%+01x" 55s)) "+37" + test "test2628" (lazy(sprintf "%+0*x" 7 55s)) "+000037" + test "test2629" (lazy(sprintf "%-+0x" 55s)) "+37" + test "test2630" (lazy(sprintf "%-+05x" 55s)) "+37 " + test "test2631" (lazy(sprintf "%-+01x" 55s)) "+37" + test "test2632" (lazy(sprintf "%-+0*x" 7 55s)) "+37 " + test "test2633" (lazy(sprintf "% x" 55s)) " 37" + test "test2634" (lazy(sprintf "% 5x" 55s)) " 37" + test "test2635" (lazy(sprintf "% 1x" 55s)) " 37" + test "test2636" (lazy(sprintf "% *x" 7 55s)) " 37" + test "test2637" (lazy(sprintf "%- x" 55s)) " 37" + test "test2638" (lazy(sprintf "%- 5x" 55s)) " 37 " + test "test2639" (lazy(sprintf "%- 1x" 55s)) " 37" + test "test2640" (lazy(sprintf "%- *x" 7 55s)) " 37 " + test "test2641" (lazy(sprintf "% 0x" 55s)) " 37" + test "test2642" (lazy(sprintf "% 05x" 55s)) " 0037" + test "test2643" (lazy(sprintf "% 01x" 55s)) " 37" + test "test2644" (lazy(sprintf "% 0*x" 7 55s)) " 000037" + test "test2645" (lazy(sprintf "%- 0x" 55s)) " 37" + test "test2646" (lazy(sprintf "%- 05x" 55s)) " 37 " + test "test2647" (lazy(sprintf "%- 01x" 55s)) " 37" + test "test2648" (lazy(sprintf "%- 0*x" 7 55s)) " 37 " + test "test2649" (lazy(sprintf "%x" -88s)) "ffa8" + test "test2650" (lazy(sprintf "%5x" -88s)) " ffa8" + test "test2651" (lazy(sprintf "%1x" -88s)) "ffa8" + test "test2652" (lazy(sprintf "%*x" 7 -88s)) " ffa8" + test "test2653" (lazy(sprintf "%-x" -88s)) "ffa8" + test "test2654" (lazy(sprintf "%-5x" -88s)) "ffa8 " + test "test2655" (lazy(sprintf "%-1x" -88s)) "ffa8" + test "test2656" (lazy(sprintf "%-*x" 7 -88s)) "ffa8 " + test "test2657" (lazy(sprintf "%0x" -88s)) "ffa8" + test "test2658" (lazy(sprintf "%05x" -88s)) "0ffa8" + test "test2659" (lazy(sprintf "%01x" -88s)) "ffa8" + test "test2660" (lazy(sprintf "%0*x" 7 -88s)) "000ffa8" + test "test2661" (lazy(sprintf "%-0x" -88s)) "ffa8" + test "test2662" (lazy(sprintf "%-05x" -88s)) "ffa8 " + test "test2663" (lazy(sprintf "%-01x" -88s)) "ffa8" + test "test2664" (lazy(sprintf "%-0*x" 7 -88s)) "ffa8 " + test "test2665" (lazy(sprintf "%+x" -88s)) "+ffa8" + test "test2666" (lazy(sprintf "%+5x" -88s)) "+ffa8" + test "test2667" (lazy(sprintf "%+1x" -88s)) "+ffa8" + test "test2668" (lazy(sprintf "%+*x" 7 -88s)) " +ffa8" + test "test2669" (lazy(sprintf "%-+x" -88s)) "+ffa8" + test "test2670" (lazy(sprintf "%-+5x" -88s)) "+ffa8" + test "test2671" (lazy(sprintf "%-+1x" -88s)) "+ffa8" + test "test2672" (lazy(sprintf "%-+*x" 7 -88s)) "+ffa8 " + test "test2673" (lazy(sprintf "%+0x" -88s)) "+ffa8" + test "test2674" (lazy(sprintf "%+05x" -88s)) "+ffa8" + test "test2675" (lazy(sprintf "%+01x" -88s)) "+ffa8" + test "test2676" (lazy(sprintf "%+0*x" 7 -88s)) "+00ffa8" + test "test2677" (lazy(sprintf "%-+0x" -88s)) "+ffa8" + test "test2678" (lazy(sprintf "%-+05x" -88s)) "+ffa8" + test "test2679" (lazy(sprintf "%-+01x" -88s)) "+ffa8" + test "test2680" (lazy(sprintf "%-+0*x" 7 -88s)) "+ffa8 " + test "test2681" (lazy(sprintf "% x" -88s)) " ffa8" + test "test2682" (lazy(sprintf "% 5x" -88s)) " ffa8" + test "test2683" (lazy(sprintf "% 1x" -88s)) " ffa8" + test "test2684" (lazy(sprintf "% *x" 7 -88s)) " ffa8" + test "test2685" (lazy(sprintf "%- x" -88s)) " ffa8" + test "test2686" (lazy(sprintf "%- 5x" -88s)) " ffa8" + test "test2687" (lazy(sprintf "%- 1x" -88s)) " ffa8" + test "test2688" (lazy(sprintf "%- *x" 7 -88s)) " ffa8 " + test "test2689" (lazy(sprintf "% 0x" -88s)) " ffa8" + test "test2690" (lazy(sprintf "% 05x" -88s)) " ffa8" + test "test2691" (lazy(sprintf "% 01x" -88s)) " ffa8" + test "test2692" (lazy(sprintf "% 0*x" 7 -88s)) " 00ffa8" + test "test2693" (lazy(sprintf "%- 0x" -88s)) " ffa8" + test "test2694" (lazy(sprintf "%- 05x" -88s)) " ffa8" + test "test2695" (lazy(sprintf "%- 01x" -88s)) " ffa8" + test "test2696" (lazy(sprintf "%- 0*x" 7 -88s)) " ffa8 " + test "test2697" (lazy(sprintf "%x" 104us)) "68" + test "test2698" (lazy(sprintf "%5x" 104us)) " 68" + test "test2699" (lazy(sprintf "%1x" 104us)) "68" + test "test2700" (lazy(sprintf "%*x" 7 104us)) " 68" + test "test2701" (lazy(sprintf "%-x" 104us)) "68" + test "test2702" (lazy(sprintf "%-5x" 104us)) "68 " + test "test2703" (lazy(sprintf "%-1x" 104us)) "68" + test "test2704" (lazy(sprintf "%-*x" 7 104us)) "68 " + test "test2705" (lazy(sprintf "%0x" 104us)) "68" + test "test2706" (lazy(sprintf "%05x" 104us)) "00068" + test "test2707" (lazy(sprintf "%01x" 104us)) "68" + test "test2708" (lazy(sprintf "%0*x" 7 104us)) "0000068" + test "test2709" (lazy(sprintf "%-0x" 104us)) "68" + test "test2710" (lazy(sprintf "%-05x" 104us)) "68 " + test "test2711" (lazy(sprintf "%-01x" 104us)) "68" + test "test2712" (lazy(sprintf "%-0*x" 7 104us)) "68 " + test "test2713" (lazy(sprintf "%+x" 104us)) "+68" + test "test2714" (lazy(sprintf "%+5x" 104us)) " +68" + test "test2715" (lazy(sprintf "%+1x" 104us)) "+68" + test "test2716" (lazy(sprintf "%+*x" 7 104us)) " +68" + test "test2717" (lazy(sprintf "%-+x" 104us)) "+68" + test "test2718" (lazy(sprintf "%-+5x" 104us)) "+68 " + test "test2719" (lazy(sprintf "%-+1x" 104us)) "+68" + test "test2720" (lazy(sprintf "%-+*x" 7 104us)) "+68 " + test "test2721" (lazy(sprintf "%+0x" 104us)) "+68" + test "test2722" (lazy(sprintf "%+05x" 104us)) "+0068" + test "test2723" (lazy(sprintf "%+01x" 104us)) "+68" + test "test2724" (lazy(sprintf "%+0*x" 7 104us)) "+000068" + test "test2725" (lazy(sprintf "%-+0x" 104us)) "+68" + test "test2726" (lazy(sprintf "%-+05x" 104us)) "+68 " + test "test2727" (lazy(sprintf "%-+01x" 104us)) "+68" + test "test2728" (lazy(sprintf "%-+0*x" 7 104us)) "+68 " + test "test2729" (lazy(sprintf "% x" 104us)) " 68" + test "test2730" (lazy(sprintf "% 5x" 104us)) " 68" + test "test2731" (lazy(sprintf "% 1x" 104us)) " 68" + test "test2732" (lazy(sprintf "% *x" 7 104us)) " 68" + test "test2733" (lazy(sprintf "%- x" 104us)) " 68" + test "test2734" (lazy(sprintf "%- 5x" 104us)) " 68 " + test "test2735" (lazy(sprintf "%- 1x" 104us)) " 68" + test "test2736" (lazy(sprintf "%- *x" 7 104us)) " 68 " + test "test2737" (lazy(sprintf "% 0x" 104us)) " 68" + test "test2738" (lazy(sprintf "% 05x" 104us)) " 0068" + test "test2739" (lazy(sprintf "% 01x" 104us)) " 68" + test "test2740" (lazy(sprintf "% 0*x" 7 104us)) " 000068" + test "test2741" (lazy(sprintf "%- 0x" 104us)) " 68" + test "test2742" (lazy(sprintf "%- 05x" 104us)) " 68 " + test "test2743" (lazy(sprintf "%- 01x" 104us)) " 68" + test "test2744" (lazy(sprintf "%- 0*x" 7 104us)) " 68 " + test "test2745" (lazy(sprintf "%x" 12y)) "c" + test "test2746" (lazy(sprintf "%5x" 12y)) " c" + test "test2747" (lazy(sprintf "%1x" 12y)) "c" + test "test2748" (lazy(sprintf "%*x" 7 12y)) " c" + test "test2749" (lazy(sprintf "%-x" 12y)) "c" + test "test2750" (lazy(sprintf "%-5x" 12y)) "c " + test "test2751" (lazy(sprintf "%-1x" 12y)) "c" + test "test2752" (lazy(sprintf "%-*x" 7 12y)) "c " + test "test2753" (lazy(sprintf "%0x" 12y)) "c" + test "test2754" (lazy(sprintf "%05x" 12y)) "0000c" + test "test2755" (lazy(sprintf "%01x" 12y)) "c" + test "test2756" (lazy(sprintf "%0*x" 7 12y)) "000000c" + test "test2757" (lazy(sprintf "%-0x" 12y)) "c" + test "test2758" (lazy(sprintf "%-05x" 12y)) "c " + test "test2759" (lazy(sprintf "%-01x" 12y)) "c" + test "test2760" (lazy(sprintf "%-0*x" 7 12y)) "c " + test "test2761" (lazy(sprintf "%+x" 12y)) "+c" + test "test2762" (lazy(sprintf "%+5x" 12y)) " +c" + test "test2763" (lazy(sprintf "%+1x" 12y)) "+c" + test "test2764" (lazy(sprintf "%+*x" 7 12y)) " +c" + test "test2765" (lazy(sprintf "%-+x" 12y)) "+c" + test "test2766" (lazy(sprintf "%-+5x" 12y)) "+c " + test "test2767" (lazy(sprintf "%-+1x" 12y)) "+c" + test "test2768" (lazy(sprintf "%-+*x" 7 12y)) "+c " + test "test2769" (lazy(sprintf "%+0x" 12y)) "+c" + test "test2770" (lazy(sprintf "%+05x" 12y)) "+000c" + test "test2771" (lazy(sprintf "%+01x" 12y)) "+c" + test "test2772" (lazy(sprintf "%+0*x" 7 12y)) "+00000c" + test "test2773" (lazy(sprintf "%-+0x" 12y)) "+c" + test "test2774" (lazy(sprintf "%-+05x" 12y)) "+c " + test "test2775" (lazy(sprintf "%-+01x" 12y)) "+c" + test "test2776" (lazy(sprintf "%-+0*x" 7 12y)) "+c " + test "test2777" (lazy(sprintf "% x" 12y)) " c" + test "test2778" (lazy(sprintf "% 5x" 12y)) " c" + test "test2779" (lazy(sprintf "% 1x" 12y)) " c" + test "test2780" (lazy(sprintf "% *x" 7 12y)) " c" + test "test2781" (lazy(sprintf "%- x" 12y)) " c" + test "test2782" (lazy(sprintf "%- 5x" 12y)) " c " + test "test2783" (lazy(sprintf "%- 1x" 12y)) " c" + test "test2784" (lazy(sprintf "%- *x" 7 12y)) " c " + test "test2785" (lazy(sprintf "% 0x" 12y)) " c" + test "test2786" (lazy(sprintf "% 05x" 12y)) " 000c" + test "test2787" (lazy(sprintf "% 01x" 12y)) " c" + test "test2788" (lazy(sprintf "% 0*x" 7 12y)) " 00000c" + test "test2789" (lazy(sprintf "%- 0x" 12y)) " c" + test "test2790" (lazy(sprintf "%- 05x" 12y)) " c " + test "test2791" (lazy(sprintf "%- 01x" 12y)) " c" + test "test2792" (lazy(sprintf "%- 0*x" 7 12y)) " c " + test "test2793" (lazy(sprintf "%x" -94y)) "a2" + test "test2794" (lazy(sprintf "%5x" -94y)) " a2" + test "test2795" (lazy(sprintf "%1x" -94y)) "a2" + test "test2796" (lazy(sprintf "%*x" 7 -94y)) " a2" + test "test2797" (lazy(sprintf "%-x" -94y)) "a2" + test "test2798" (lazy(sprintf "%-5x" -94y)) "a2 " + test "test2799" (lazy(sprintf "%-1x" -94y)) "a2" + test "test2800" (lazy(sprintf "%-*x" 7 -94y)) "a2 " + test "test2801" (lazy(sprintf "%0x" -94y)) "a2" + test "test2802" (lazy(sprintf "%05x" -94y)) "000a2" + test "test2803" (lazy(sprintf "%01x" -94y)) "a2" + test "test2804" (lazy(sprintf "%0*x" 7 -94y)) "00000a2" + test "test2805" (lazy(sprintf "%-0x" -94y)) "a2" + test "test2806" (lazy(sprintf "%-05x" -94y)) "a2 " + test "test2807" (lazy(sprintf "%-01x" -94y)) "a2" + test "test2808" (lazy(sprintf "%-0*x" 7 -94y)) "a2 " + test "test2809" (lazy(sprintf "%+x" -94y)) "+a2" + test "test2810" (lazy(sprintf "%+5x" -94y)) " +a2" + test "test2811" (lazy(sprintf "%+1x" -94y)) "+a2" + test "test2812" (lazy(sprintf "%+*x" 7 -94y)) " +a2" + test "test2813" (lazy(sprintf "%-+x" -94y)) "+a2" + test "test2814" (lazy(sprintf "%-+5x" -94y)) "+a2 " + test "test2815" (lazy(sprintf "%-+1x" -94y)) "+a2" + test "test2816" (lazy(sprintf "%-+*x" 7 -94y)) "+a2 " + test "test2817" (lazy(sprintf "%+0x" -94y)) "+a2" + test "test2818" (lazy(sprintf "%+05x" -94y)) "+00a2" + test "test2819" (lazy(sprintf "%+01x" -94y)) "+a2" + test "test2820" (lazy(sprintf "%+0*x" 7 -94y)) "+0000a2" + test "test2821" (lazy(sprintf "%-+0x" -94y)) "+a2" + test "test2822" (lazy(sprintf "%-+05x" -94y)) "+a2 " + test "test2823" (lazy(sprintf "%-+01x" -94y)) "+a2" + test "test2824" (lazy(sprintf "%-+0*x" 7 -94y)) "+a2 " + test "test2825" (lazy(sprintf "% x" -94y)) " a2" + test "test2826" (lazy(sprintf "% 5x" -94y)) " a2" + test "test2827" (lazy(sprintf "% 1x" -94y)) " a2" + test "test2828" (lazy(sprintf "% *x" 7 -94y)) " a2" + test "test2829" (lazy(sprintf "%- x" -94y)) " a2" + test "test2830" (lazy(sprintf "%- 5x" -94y)) " a2 " + test "test2831" (lazy(sprintf "%- 1x" -94y)) " a2" + test "test2832" (lazy(sprintf "%- *x" 7 -94y)) " a2 " + test "test2833" (lazy(sprintf "% 0x" -94y)) " a2" + test "test2834" (lazy(sprintf "% 05x" -94y)) " 00a2" + test "test2835" (lazy(sprintf "% 01x" -94y)) " a2" + test "test2836" (lazy(sprintf "% 0*x" 7 -94y)) " 0000a2" + test "test2837" (lazy(sprintf "%- 0x" -94y)) " a2" + test "test2838" (lazy(sprintf "%- 05x" -94y)) " a2 " + test "test2839" (lazy(sprintf "%- 01x" -94y)) " a2" + test "test2840" (lazy(sprintf "%- 0*x" 7 -94y)) " a2 " + test "test2841" (lazy(sprintf "%x" 88uy)) "58" + test "test2842" (lazy(sprintf "%5x" 88uy)) " 58" + test "test2843" (lazy(sprintf "%1x" 88uy)) "58" + test "test2844" (lazy(sprintf "%*x" 7 88uy)) " 58" + test "test2845" (lazy(sprintf "%-x" 88uy)) "58" + test "test2846" (lazy(sprintf "%-5x" 88uy)) "58 " + test "test2847" (lazy(sprintf "%-1x" 88uy)) "58" + test "test2848" (lazy(sprintf "%-*x" 7 88uy)) "58 " + test "test2849" (lazy(sprintf "%0x" 88uy)) "58" + test "test2850" (lazy(sprintf "%05x" 88uy)) "00058" + test "test2851" (lazy(sprintf "%01x" 88uy)) "58" + test "test2852" (lazy(sprintf "%0*x" 7 88uy)) "0000058" + test "test2853" (lazy(sprintf "%-0x" 88uy)) "58" + test "test2854" (lazy(sprintf "%-05x" 88uy)) "58 " + test "test2855" (lazy(sprintf "%-01x" 88uy)) "58" + test "test2856" (lazy(sprintf "%-0*x" 7 88uy)) "58 " + test "test2857" (lazy(sprintf "%+x" 88uy)) "+58" + test "test2858" (lazy(sprintf "%+5x" 88uy)) " +58" + test "test2859" (lazy(sprintf "%+1x" 88uy)) "+58" + test "test2860" (lazy(sprintf "%+*x" 7 88uy)) " +58" + test "test2861" (lazy(sprintf "%-+x" 88uy)) "+58" + test "test2862" (lazy(sprintf "%-+5x" 88uy)) "+58 " + test "test2863" (lazy(sprintf "%-+1x" 88uy)) "+58" + test "test2864" (lazy(sprintf "%-+*x" 7 88uy)) "+58 " + test "test2865" (lazy(sprintf "%+0x" 88uy)) "+58" + test "test2866" (lazy(sprintf "%+05x" 88uy)) "+0058" + test "test2867" (lazy(sprintf "%+01x" 88uy)) "+58" + test "test2868" (lazy(sprintf "%+0*x" 7 88uy)) "+000058" + test "test2869" (lazy(sprintf "%-+0x" 88uy)) "+58" + test "test2870" (lazy(sprintf "%-+05x" 88uy)) "+58 " + test "test2871" (lazy(sprintf "%-+01x" 88uy)) "+58" + test "test2872" (lazy(sprintf "%-+0*x" 7 88uy)) "+58 " + test "test2873" (lazy(sprintf "% x" 88uy)) " 58" + test "test2874" (lazy(sprintf "% 5x" 88uy)) " 58" + test "test2875" (lazy(sprintf "% 1x" 88uy)) " 58" + test "test2876" (lazy(sprintf "% *x" 7 88uy)) " 58" + test "test2877" (lazy(sprintf "%- x" 88uy)) " 58" + test "test2878" (lazy(sprintf "%- 5x" 88uy)) " 58 " + test "test2879" (lazy(sprintf "%- 1x" 88uy)) " 58" + test "test2880" (lazy(sprintf "%- *x" 7 88uy)) " 58 " + test "test2881" (lazy(sprintf "% 0x" 88uy)) " 58" + test "test2882" (lazy(sprintf "% 05x" 88uy)) " 0058" + test "test2883" (lazy(sprintf "% 01x" 88uy)) " 58" + test "test2884" (lazy(sprintf "% 0*x" 7 88uy)) " 000058" + test "test2885" (lazy(sprintf "%- 0x" 88uy)) " 58" + test "test2886" (lazy(sprintf "%- 05x" 88uy)) " 58 " + test "test2887" (lazy(sprintf "%- 01x" 88uy)) " 58" + test "test2888" (lazy(sprintf "%- 0*x" 7 88uy)) " 58 " + test "test2889" (lazy(sprintf "%x" 999L)) "3e7" + test "test2890" (lazy(sprintf "%5x" 999L)) " 3e7" + test "test2891" (lazy(sprintf "%1x" 999L)) "3e7" + test "test2892" (lazy(sprintf "%*x" 7 999L)) " 3e7" + test "test2893" (lazy(sprintf "%-x" 999L)) "3e7" + test "test2894" (lazy(sprintf "%-5x" 999L)) "3e7 " + test "test2895" (lazy(sprintf "%-1x" 999L)) "3e7" + test "test2896" (lazy(sprintf "%-*x" 7 999L)) "3e7 " + test "test2897" (lazy(sprintf "%0x" 999L)) "3e7" + test "test2898" (lazy(sprintf "%05x" 999L)) "003e7" + test "test2899" (lazy(sprintf "%01x" 999L)) "3e7" + test "test2900" (lazy(sprintf "%0*x" 7 999L)) "00003e7" + test "test2901" (lazy(sprintf "%-0x" 999L)) "3e7" + test "test2902" (lazy(sprintf "%-05x" 999L)) "3e7 " + test "test2903" (lazy(sprintf "%-01x" 999L)) "3e7" + test "test2904" (lazy(sprintf "%-0*x" 7 999L)) "3e7 " + test "test2905" (lazy(sprintf "%+x" 999L)) "+3e7" + test "test2906" (lazy(sprintf "%+5x" 999L)) " +3e7" + test "test2907" (lazy(sprintf "%+1x" 999L)) "+3e7" + test "test2908" (lazy(sprintf "%+*x" 7 999L)) " +3e7" + test "test2909" (lazy(sprintf "%-+x" 999L)) "+3e7" + test "test2910" (lazy(sprintf "%-+5x" 999L)) "+3e7 " + test "test2911" (lazy(sprintf "%-+1x" 999L)) "+3e7" + test "test2912" (lazy(sprintf "%-+*x" 7 999L)) "+3e7 " + test "test2913" (lazy(sprintf "%+0x" 999L)) "+3e7" + test "test2914" (lazy(sprintf "%+05x" 999L)) "+03e7" + test "test2915" (lazy(sprintf "%+01x" 999L)) "+3e7" + test "test2916" (lazy(sprintf "%+0*x" 7 999L)) "+0003e7" + test "test2917" (lazy(sprintf "%-+0x" 999L)) "+3e7" + test "test2918" (lazy(sprintf "%-+05x" 999L)) "+3e7 " + test "test2919" (lazy(sprintf "%-+01x" 999L)) "+3e7" + test "test2920" (lazy(sprintf "%-+0*x" 7 999L)) "+3e7 " + test "test2921" (lazy(sprintf "% x" 999L)) " 3e7" + test "test2922" (lazy(sprintf "% 5x" 999L)) " 3e7" + test "test2923" (lazy(sprintf "% 1x" 999L)) " 3e7" + test "test2924" (lazy(sprintf "% *x" 7 999L)) " 3e7" + test "test2925" (lazy(sprintf "%- x" 999L)) " 3e7" + test "test2926" (lazy(sprintf "%- 5x" 999L)) " 3e7 " + test "test2927" (lazy(sprintf "%- 1x" 999L)) " 3e7" + test "test2928" (lazy(sprintf "%- *x" 7 999L)) " 3e7 " + test "test2929" (lazy(sprintf "% 0x" 999L)) " 3e7" + test "test2930" (lazy(sprintf "% 05x" 999L)) " 03e7" + test "test2931" (lazy(sprintf "% 01x" 999L)) " 3e7" + test "test2932" (lazy(sprintf "% 0*x" 7 999L)) " 0003e7" + test "test2933" (lazy(sprintf "%- 0x" 999L)) " 3e7" + test "test2934" (lazy(sprintf "%- 05x" 999L)) " 3e7 " + test "test2935" (lazy(sprintf "%- 01x" 999L)) " 3e7" + test "test2936" (lazy(sprintf "%- 0*x" 7 999L)) " 3e7 " + test "test2937" (lazy(sprintf "%x" -321L)) "fffffffffffffebf" + test "test2938" (lazy(sprintf "%5x" -321L)) "fffffffffffffebf" + test "test2939" (lazy(sprintf "%1x" -321L)) "fffffffffffffebf" + test "test2940" (lazy(sprintf "%*x" 7 -321L)) "fffffffffffffebf" + test "test2941" (lazy(sprintf "%-x" -321L)) "fffffffffffffebf" + test "test2942" (lazy(sprintf "%-5x" -321L)) "fffffffffffffebf" + test "test2943" (lazy(sprintf "%-1x" -321L)) "fffffffffffffebf" + test "test2944" (lazy(sprintf "%-*x" 7 -321L)) "fffffffffffffebf" + test "test2945" (lazy(sprintf "%0x" -321L)) "fffffffffffffebf" + test "test2946" (lazy(sprintf "%05x" -321L)) "fffffffffffffebf" + test "test2947" (lazy(sprintf "%01x" -321L)) "fffffffffffffebf" + test "test2948" (lazy(sprintf "%0*x" 7 -321L)) "fffffffffffffebf" + test "test2949" (lazy(sprintf "%-0x" -321L)) "fffffffffffffebf" + test "test2950" (lazy(sprintf "%-05x" -321L)) "fffffffffffffebf" + test "test2951" (lazy(sprintf "%-01x" -321L)) "fffffffffffffebf" + test "test2952" (lazy(sprintf "%-0*x" 7 -321L)) "fffffffffffffebf" + test "test2953" (lazy(sprintf "%+x" -321L)) "+fffffffffffffebf" + test "test2954" (lazy(sprintf "%+5x" -321L)) "+fffffffffffffebf" + test "test2955" (lazy(sprintf "%+1x" -321L)) "+fffffffffffffebf" + test "test2956" (lazy(sprintf "%+*x" 7 -321L)) "+fffffffffffffebf" + test "test2957" (lazy(sprintf "%-+x" -321L)) "+fffffffffffffebf" + test "test2958" (lazy(sprintf "%-+5x" -321L)) "+fffffffffffffebf" + test "test2959" (lazy(sprintf "%-+1x" -321L)) "+fffffffffffffebf" + test "test2960" (lazy(sprintf "%-+*x" 7 -321L)) "+fffffffffffffebf" + test "test2961" (lazy(sprintf "%+0x" -321L)) "+fffffffffffffebf" + test "test2962" (lazy(sprintf "%+05x" -321L)) "+fffffffffffffebf" + test "test2963" (lazy(sprintf "%+01x" -321L)) "+fffffffffffffebf" + test "test2964" (lazy(sprintf "%+0*x" 7 -321L)) "+fffffffffffffebf" + test "test2965" (lazy(sprintf "%-+0x" -321L)) "+fffffffffffffebf" + test "test2966" (lazy(sprintf "%-+05x" -321L)) "+fffffffffffffebf" + test "test2967" (lazy(sprintf "%-+01x" -321L)) "+fffffffffffffebf" + test "test2968" (lazy(sprintf "%-+0*x" 7 -321L)) "+fffffffffffffebf" + test "test2969" (lazy(sprintf "% x" -321L)) " fffffffffffffebf" + test "test2970" (lazy(sprintf "% 5x" -321L)) " fffffffffffffebf" + test "test2971" (lazy(sprintf "% 1x" -321L)) " fffffffffffffebf" + test "test2972" (lazy(sprintf "% *x" 7 -321L)) " fffffffffffffebf" + test "test2973" (lazy(sprintf "%- x" -321L)) " fffffffffffffebf" + test "test2974" (lazy(sprintf "%- 5x" -321L)) " fffffffffffffebf" + test "test2975" (lazy(sprintf "%- 1x" -321L)) " fffffffffffffebf" + test "test2976" (lazy(sprintf "%- *x" 7 -321L)) " fffffffffffffebf" + test "test2977" (lazy(sprintf "% 0x" -321L)) " fffffffffffffebf" + test "test2978" (lazy(sprintf "% 05x" -321L)) " fffffffffffffebf" + test "test2979" (lazy(sprintf "% 01x" -321L)) " fffffffffffffebf" + test "test2980" (lazy(sprintf "% 0*x" 7 -321L)) " fffffffffffffebf" + test "test2981" (lazy(sprintf "%- 0x" -321L)) " fffffffffffffebf" + test "test2982" (lazy(sprintf "%- 05x" -321L)) " fffffffffffffebf" + test "test2983" (lazy(sprintf "%- 01x" -321L)) " fffffffffffffebf" + test "test2984" (lazy(sprintf "%- 0*x" 7 -321L)) " fffffffffffffebf" + test "test2985" (lazy(sprintf "%x" 50000UL)) "c350" + test "test2986" (lazy(sprintf "%5x" 50000UL)) " c350" + test "test2987" (lazy(sprintf "%1x" 50000UL)) "c350" + test "test2988" (lazy(sprintf "%*x" 7 50000UL)) " c350" + test "test2989" (lazy(sprintf "%-x" 50000UL)) "c350" + test "test2990" (lazy(sprintf "%-5x" 50000UL)) "c350 " + test "test2991" (lazy(sprintf "%-1x" 50000UL)) "c350" + test "test2992" (lazy(sprintf "%-*x" 7 50000UL)) "c350 " + test "test2993" (lazy(sprintf "%0x" 50000UL)) "c350" + test "test2994" (lazy(sprintf "%05x" 50000UL)) "0c350" + test "test2995" (lazy(sprintf "%01x" 50000UL)) "c350" + test "test2996" (lazy(sprintf "%0*x" 7 50000UL)) "000c350" + test "test2997" (lazy(sprintf "%-0x" 50000UL)) "c350" + test "test2998" (lazy(sprintf "%-05x" 50000UL)) "c350 " + test "test2999" (lazy(sprintf "%-01x" 50000UL)) "c350" + test "test3000" (lazy(sprintf "%-0*x" 7 50000UL)) "c350 " + +let func3000()= + test "test3001" (lazy(sprintf "%+x" 50000UL)) "+c350" + test "test3002" (lazy(sprintf "%+5x" 50000UL)) "+c350" + test "test3003" (lazy(sprintf "%+1x" 50000UL)) "+c350" + test "test3004" (lazy(sprintf "%+*x" 7 50000UL)) " +c350" + test "test3005" (lazy(sprintf "%-+x" 50000UL)) "+c350" + test "test3006" (lazy(sprintf "%-+5x" 50000UL)) "+c350" + test "test3007" (lazy(sprintf "%-+1x" 50000UL)) "+c350" + test "test3008" (lazy(sprintf "%-+*x" 7 50000UL)) "+c350 " + test "test3009" (lazy(sprintf "%+0x" 50000UL)) "+c350" + test "test3010" (lazy(sprintf "%+05x" 50000UL)) "+c350" + test "test3011" (lazy(sprintf "%+01x" 50000UL)) "+c350" + test "test3012" (lazy(sprintf "%+0*x" 7 50000UL)) "+00c350" + test "test3013" (lazy(sprintf "%-+0x" 50000UL)) "+c350" + test "test3014" (lazy(sprintf "%-+05x" 50000UL)) "+c350" + test "test3015" (lazy(sprintf "%-+01x" 50000UL)) "+c350" + test "test3016" (lazy(sprintf "%-+0*x" 7 50000UL)) "+c350 " + test "test3017" (lazy(sprintf "% x" 50000UL)) " c350" + test "test3018" (lazy(sprintf "% 5x" 50000UL)) " c350" + test "test3019" (lazy(sprintf "% 1x" 50000UL)) " c350" + test "test3020" (lazy(sprintf "% *x" 7 50000UL)) " c350" + test "test3021" (lazy(sprintf "%- x" 50000UL)) " c350" + test "test3022" (lazy(sprintf "%- 5x" 50000UL)) " c350" + test "test3023" (lazy(sprintf "%- 1x" 50000UL)) " c350" + test "test3024" (lazy(sprintf "%- *x" 7 50000UL)) " c350 " + test "test3025" (lazy(sprintf "% 0x" 50000UL)) " c350" + test "test3026" (lazy(sprintf "% 05x" 50000UL)) " c350" + test "test3027" (lazy(sprintf "% 01x" 50000UL)) " c350" + test "test3028" (lazy(sprintf "% 0*x" 7 50000UL)) " 00c350" + test "test3029" (lazy(sprintf "%- 0x" 50000UL)) " c350" + test "test3030" (lazy(sprintf "%- 05x" 50000UL)) " c350" + test "test3031" (lazy(sprintf "%- 01x" 50000UL)) " c350" + test "test3032" (lazy(sprintf "%- 0*x" 7 50000UL)) " c350 " + test "test3033" (lazy(sprintf "%x" System.Int32.MaxValue)) "7fffffff" + test "test3034" (lazy(sprintf "%5x" System.Int32.MaxValue)) "7fffffff" + test "test3035" (lazy(sprintf "%1x" System.Int32.MaxValue)) "7fffffff" + test "test3036" (lazy(sprintf "%*x" 7 System.Int32.MaxValue)) "7fffffff" + test "test3037" (lazy(sprintf "%-x" System.Int32.MaxValue)) "7fffffff" + test "test3038" (lazy(sprintf "%-5x" System.Int32.MaxValue)) "7fffffff" + test "test3039" (lazy(sprintf "%-1x" System.Int32.MaxValue)) "7fffffff" + test "test3040" (lazy(sprintf "%-*x" 7 System.Int32.MaxValue)) "7fffffff" + test "test3041" (lazy(sprintf "%0x" System.Int32.MaxValue)) "7fffffff" + test "test3042" (lazy(sprintf "%05x" System.Int32.MaxValue)) "7fffffff" + test "test3043" (lazy(sprintf "%01x" System.Int32.MaxValue)) "7fffffff" + test "test3044" (lazy(sprintf "%0*x" 7 System.Int32.MaxValue)) "7fffffff" + test "test3045" (lazy(sprintf "%-0x" System.Int32.MaxValue)) "7fffffff" + test "test3046" (lazy(sprintf "%-05x" System.Int32.MaxValue)) "7fffffff" + test "test3047" (lazy(sprintf "%-01x" System.Int32.MaxValue)) "7fffffff" + test "test3048" (lazy(sprintf "%-0*x" 7 System.Int32.MaxValue)) "7fffffff" + test "test3049" (lazy(sprintf "%+x" System.Int32.MaxValue)) "+7fffffff" + test "test3050" (lazy(sprintf "%+5x" System.Int32.MaxValue)) "+7fffffff" + test "test3051" (lazy(sprintf "%+1x" System.Int32.MaxValue)) "+7fffffff" + test "test3052" (lazy(sprintf "%+*x" 7 System.Int32.MaxValue)) "+7fffffff" + test "test3053" (lazy(sprintf "%-+x" System.Int32.MaxValue)) "+7fffffff" + test "test3054" (lazy(sprintf "%-+5x" System.Int32.MaxValue)) "+7fffffff" + test "test3055" (lazy(sprintf "%-+1x" System.Int32.MaxValue)) "+7fffffff" + test "test3056" (lazy(sprintf "%-+*x" 7 System.Int32.MaxValue)) "+7fffffff" + test "test3057" (lazy(sprintf "%+0x" System.Int32.MaxValue)) "+7fffffff" + test "test3058" (lazy(sprintf "%+05x" System.Int32.MaxValue)) "+7fffffff" + test "test3059" (lazy(sprintf "%+01x" System.Int32.MaxValue)) "+7fffffff" + test "test3060" (lazy(sprintf "%+0*x" 7 System.Int32.MaxValue)) "+7fffffff" + test "test3061" (lazy(sprintf "%-+0x" System.Int32.MaxValue)) "+7fffffff" + test "test3062" (lazy(sprintf "%-+05x" System.Int32.MaxValue)) "+7fffffff" + test "test3063" (lazy(sprintf "%-+01x" System.Int32.MaxValue)) "+7fffffff" + test "test3064" (lazy(sprintf "%-+0*x" 7 System.Int32.MaxValue)) "+7fffffff" + test "test3065" (lazy(sprintf "% x" System.Int32.MaxValue)) " 7fffffff" + test "test3066" (lazy(sprintf "% 5x" System.Int32.MaxValue)) " 7fffffff" + test "test3067" (lazy(sprintf "% 1x" System.Int32.MaxValue)) " 7fffffff" + test "test3068" (lazy(sprintf "% *x" 7 System.Int32.MaxValue)) " 7fffffff" + test "test3069" (lazy(sprintf "%- x" System.Int32.MaxValue)) " 7fffffff" + test "test3070" (lazy(sprintf "%- 5x" System.Int32.MaxValue)) " 7fffffff" + test "test3071" (lazy(sprintf "%- 1x" System.Int32.MaxValue)) " 7fffffff" + test "test3072" (lazy(sprintf "%- *x" 7 System.Int32.MaxValue)) " 7fffffff" + test "test3073" (lazy(sprintf "% 0x" System.Int32.MaxValue)) " 7fffffff" + test "test3074" (lazy(sprintf "% 05x" System.Int32.MaxValue)) " 7fffffff" + test "test3075" (lazy(sprintf "% 01x" System.Int32.MaxValue)) " 7fffffff" + test "test3076" (lazy(sprintf "% 0*x" 7 System.Int32.MaxValue)) " 7fffffff" + test "test3077" (lazy(sprintf "%- 0x" System.Int32.MaxValue)) " 7fffffff" + test "test3078" (lazy(sprintf "%- 05x" System.Int32.MaxValue)) " 7fffffff" + test "test3079" (lazy(sprintf "%- 01x" System.Int32.MaxValue)) " 7fffffff" + test "test3080" (lazy(sprintf "%- 0*x" 7 System.Int32.MaxValue)) " 7fffffff" + test "test3081" (lazy(sprintf "%x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3082" (lazy(sprintf "%5x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3083" (lazy(sprintf "%1x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3084" (lazy(sprintf "%*x" 7 System.Int64.MaxValue)) "7fffffffffffffff" + test "test3085" (lazy(sprintf "%-x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3086" (lazy(sprintf "%-5x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3087" (lazy(sprintf "%-1x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3088" (lazy(sprintf "%-*x" 7 System.Int64.MaxValue)) "7fffffffffffffff" + test "test3089" (lazy(sprintf "%0x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3090" (lazy(sprintf "%05x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3091" (lazy(sprintf "%01x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3092" (lazy(sprintf "%0*x" 7 System.Int64.MaxValue)) "7fffffffffffffff" + test "test3093" (lazy(sprintf "%-0x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3094" (lazy(sprintf "%-05x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3095" (lazy(sprintf "%-01x" System.Int64.MaxValue)) "7fffffffffffffff" + test "test3096" (lazy(sprintf "%-0*x" 7 System.Int64.MaxValue)) "7fffffffffffffff" + test "test3097" (lazy(sprintf "%+x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3098" (lazy(sprintf "%+5x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3099" (lazy(sprintf "%+1x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3100" (lazy(sprintf "%+*x" 7 System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3101" (lazy(sprintf "%-+x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3102" (lazy(sprintf "%-+5x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3103" (lazy(sprintf "%-+1x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3104" (lazy(sprintf "%-+*x" 7 System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3105" (lazy(sprintf "%+0x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3106" (lazy(sprintf "%+05x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3107" (lazy(sprintf "%+01x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3108" (lazy(sprintf "%+0*x" 7 System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3109" (lazy(sprintf "%-+0x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3110" (lazy(sprintf "%-+05x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3111" (lazy(sprintf "%-+01x" System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3112" (lazy(sprintf "%-+0*x" 7 System.Int64.MaxValue)) "+7fffffffffffffff" + test "test3113" (lazy(sprintf "% x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3114" (lazy(sprintf "% 5x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3115" (lazy(sprintf "% 1x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3116" (lazy(sprintf "% *x" 7 System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3117" (lazy(sprintf "%- x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3118" (lazy(sprintf "%- 5x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3119" (lazy(sprintf "%- 1x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3120" (lazy(sprintf "%- *x" 7 System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3121" (lazy(sprintf "% 0x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3122" (lazy(sprintf "% 05x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3123" (lazy(sprintf "% 01x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3124" (lazy(sprintf "% 0*x" 7 System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3125" (lazy(sprintf "%- 0x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3126" (lazy(sprintf "%- 05x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3127" (lazy(sprintf "%- 01x" System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3128" (lazy(sprintf "%- 0*x" 7 System.Int64.MaxValue)) " 7fffffffffffffff" + test "test3129" (lazy(sprintf "%x" System.Int32.MinValue)) "80000000" + test "test3130" (lazy(sprintf "%5x" System.Int32.MinValue)) "80000000" + test "test3131" (lazy(sprintf "%1x" System.Int32.MinValue)) "80000000" + test "test3132" (lazy(sprintf "%*x" 7 System.Int32.MinValue)) "80000000" + test "test3133" (lazy(sprintf "%-x" System.Int32.MinValue)) "80000000" + test "test3134" (lazy(sprintf "%-5x" System.Int32.MinValue)) "80000000" + test "test3135" (lazy(sprintf "%-1x" System.Int32.MinValue)) "80000000" + test "test3136" (lazy(sprintf "%-*x" 7 System.Int32.MinValue)) "80000000" + test "test3137" (lazy(sprintf "%0x" System.Int32.MinValue)) "80000000" + test "test3138" (lazy(sprintf "%05x" System.Int32.MinValue)) "80000000" + test "test3139" (lazy(sprintf "%01x" System.Int32.MinValue)) "80000000" + test "test3140" (lazy(sprintf "%0*x" 7 System.Int32.MinValue)) "80000000" + test "test3141" (lazy(sprintf "%-0x" System.Int32.MinValue)) "80000000" + test "test3142" (lazy(sprintf "%-05x" System.Int32.MinValue)) "80000000" + test "test3143" (lazy(sprintf "%-01x" System.Int32.MinValue)) "80000000" + test "test3144" (lazy(sprintf "%-0*x" 7 System.Int32.MinValue)) "80000000" + test "test3145" (lazy(sprintf "%+x" System.Int32.MinValue)) "+80000000" + test "test3146" (lazy(sprintf "%+5x" System.Int32.MinValue)) "+80000000" + test "test3147" (lazy(sprintf "%+1x" System.Int32.MinValue)) "+80000000" + test "test3148" (lazy(sprintf "%+*x" 7 System.Int32.MinValue)) "+80000000" + test "test3149" (lazy(sprintf "%-+x" System.Int32.MinValue)) "+80000000" + test "test3150" (lazy(sprintf "%-+5x" System.Int32.MinValue)) "+80000000" + test "test3151" (lazy(sprintf "%-+1x" System.Int32.MinValue)) "+80000000" + test "test3152" (lazy(sprintf "%-+*x" 7 System.Int32.MinValue)) "+80000000" + test "test3153" (lazy(sprintf "%+0x" System.Int32.MinValue)) "+80000000" + test "test3154" (lazy(sprintf "%+05x" System.Int32.MinValue)) "+80000000" + test "test3155" (lazy(sprintf "%+01x" System.Int32.MinValue)) "+80000000" + test "test3156" (lazy(sprintf "%+0*x" 7 System.Int32.MinValue)) "+80000000" + test "test3157" (lazy(sprintf "%-+0x" System.Int32.MinValue)) "+80000000" + test "test3158" (lazy(sprintf "%-+05x" System.Int32.MinValue)) "+80000000" + test "test3159" (lazy(sprintf "%-+01x" System.Int32.MinValue)) "+80000000" + test "test3160" (lazy(sprintf "%-+0*x" 7 System.Int32.MinValue)) "+80000000" + test "test3161" (lazy(sprintf "% x" System.Int32.MinValue)) " 80000000" + test "test3162" (lazy(sprintf "% 5x" System.Int32.MinValue)) " 80000000" + test "test3163" (lazy(sprintf "% 1x" System.Int32.MinValue)) " 80000000" + test "test3164" (lazy(sprintf "% *x" 7 System.Int32.MinValue)) " 80000000" + test "test3165" (lazy(sprintf "%- x" System.Int32.MinValue)) " 80000000" + test "test3166" (lazy(sprintf "%- 5x" System.Int32.MinValue)) " 80000000" + test "test3167" (lazy(sprintf "%- 1x" System.Int32.MinValue)) " 80000000" + test "test3168" (lazy(sprintf "%- *x" 7 System.Int32.MinValue)) " 80000000" + test "test3169" (lazy(sprintf "% 0x" System.Int32.MinValue)) " 80000000" + test "test3170" (lazy(sprintf "% 05x" System.Int32.MinValue)) " 80000000" + test "test3171" (lazy(sprintf "% 01x" System.Int32.MinValue)) " 80000000" + test "test3172" (lazy(sprintf "% 0*x" 7 System.Int32.MinValue)) " 80000000" + test "test3173" (lazy(sprintf "%- 0x" System.Int32.MinValue)) " 80000000" + test "test3174" (lazy(sprintf "%- 05x" System.Int32.MinValue)) " 80000000" + test "test3175" (lazy(sprintf "%- 01x" System.Int32.MinValue)) " 80000000" + test "test3176" (lazy(sprintf "%- 0*x" 7 System.Int32.MinValue)) " 80000000" + test "test3177" (lazy(sprintf "%x" System.Int64.MinValue)) "8000000000000000" + test "test3178" (lazy(sprintf "%5x" System.Int64.MinValue)) "8000000000000000" + test "test3179" (lazy(sprintf "%1x" System.Int64.MinValue)) "8000000000000000" + test "test3180" (lazy(sprintf "%*x" 7 System.Int64.MinValue)) "8000000000000000" + test "test3181" (lazy(sprintf "%-x" System.Int64.MinValue)) "8000000000000000" + test "test3182" (lazy(sprintf "%-5x" System.Int64.MinValue)) "8000000000000000" + test "test3183" (lazy(sprintf "%-1x" System.Int64.MinValue)) "8000000000000000" + test "test3184" (lazy(sprintf "%-*x" 7 System.Int64.MinValue)) "8000000000000000" + test "test3185" (lazy(sprintf "%0x" System.Int64.MinValue)) "8000000000000000" + test "test3186" (lazy(sprintf "%05x" System.Int64.MinValue)) "8000000000000000" + test "test3187" (lazy(sprintf "%01x" System.Int64.MinValue)) "8000000000000000" + test "test3188" (lazy(sprintf "%0*x" 7 System.Int64.MinValue)) "8000000000000000" + test "test3189" (lazy(sprintf "%-0x" System.Int64.MinValue)) "8000000000000000" + test "test3190" (lazy(sprintf "%-05x" System.Int64.MinValue)) "8000000000000000" + test "test3191" (lazy(sprintf "%-01x" System.Int64.MinValue)) "8000000000000000" + test "test3192" (lazy(sprintf "%-0*x" 7 System.Int64.MinValue)) "8000000000000000" + test "test3193" (lazy(sprintf "%+x" System.Int64.MinValue)) "+8000000000000000" + test "test3194" (lazy(sprintf "%+5x" System.Int64.MinValue)) "+8000000000000000" + test "test3195" (lazy(sprintf "%+1x" System.Int64.MinValue)) "+8000000000000000" + test "test3196" (lazy(sprintf "%+*x" 7 System.Int64.MinValue)) "+8000000000000000" + test "test3197" (lazy(sprintf "%-+x" System.Int64.MinValue)) "+8000000000000000" + test "test3198" (lazy(sprintf "%-+5x" System.Int64.MinValue)) "+8000000000000000" + test "test3199" (lazy(sprintf "%-+1x" System.Int64.MinValue)) "+8000000000000000" + test "test3200" (lazy(sprintf "%-+*x" 7 System.Int64.MinValue)) "+8000000000000000" + test "test3201" (lazy(sprintf "%+0x" System.Int64.MinValue)) "+8000000000000000" + test "test3202" (lazy(sprintf "%+05x" System.Int64.MinValue)) "+8000000000000000" + test "test3203" (lazy(sprintf "%+01x" System.Int64.MinValue)) "+8000000000000000" + test "test3204" (lazy(sprintf "%+0*x" 7 System.Int64.MinValue)) "+8000000000000000" + test "test3205" (lazy(sprintf "%-+0x" System.Int64.MinValue)) "+8000000000000000" + test "test3206" (lazy(sprintf "%-+05x" System.Int64.MinValue)) "+8000000000000000" + test "test3207" (lazy(sprintf "%-+01x" System.Int64.MinValue)) "+8000000000000000" + test "test3208" (lazy(sprintf "%-+0*x" 7 System.Int64.MinValue)) "+8000000000000000" + test "test3209" (lazy(sprintf "% x" System.Int64.MinValue)) " 8000000000000000" + test "test3210" (lazy(sprintf "% 5x" System.Int64.MinValue)) " 8000000000000000" + test "test3211" (lazy(sprintf "% 1x" System.Int64.MinValue)) " 8000000000000000" + test "test3212" (lazy(sprintf "% *x" 7 System.Int64.MinValue)) " 8000000000000000" + test "test3213" (lazy(sprintf "%- x" System.Int64.MinValue)) " 8000000000000000" + test "test3214" (lazy(sprintf "%- 5x" System.Int64.MinValue)) " 8000000000000000" + test "test3215" (lazy(sprintf "%- 1x" System.Int64.MinValue)) " 8000000000000000" + test "test3216" (lazy(sprintf "%- *x" 7 System.Int64.MinValue)) " 8000000000000000" + test "test3217" (lazy(sprintf "% 0x" System.Int64.MinValue)) " 8000000000000000" + test "test3218" (lazy(sprintf "% 05x" System.Int64.MinValue)) " 8000000000000000" + test "test3219" (lazy(sprintf "% 01x" System.Int64.MinValue)) " 8000000000000000" + test "test3220" (lazy(sprintf "% 0*x" 7 System.Int64.MinValue)) " 8000000000000000" + test "test3221" (lazy(sprintf "%- 0x" System.Int64.MinValue)) " 8000000000000000" + test "test3222" (lazy(sprintf "%- 05x" System.Int64.MinValue)) " 8000000000000000" + test "test3223" (lazy(sprintf "%- 01x" System.Int64.MinValue)) " 8000000000000000" + test "test3224" (lazy(sprintf "%- 0*x" 7 System.Int64.MinValue)) " 8000000000000000" + test "test3225" (lazy(sprintf "%x" 55n)) "37" + test "test3226" (lazy(sprintf "%5x" 55n)) " 37" + test "test3227" (lazy(sprintf "%1x" 55n)) "37" + test "test3228" (lazy(sprintf "%*x" 7 55n)) " 37" + test "test3229" (lazy(sprintf "%-x" 55n)) "37" + test "test3230" (lazy(sprintf "%-5x" 55n)) "37 " + test "test3231" (lazy(sprintf "%-1x" 55n)) "37" + test "test3232" (lazy(sprintf "%-*x" 7 55n)) "37 " + test "test3233" (lazy(sprintf "%0x" 55n)) "37" + test "test3234" (lazy(sprintf "%05x" 55n)) "00037" + test "test3235" (lazy(sprintf "%01x" 55n)) "37" + test "test3236" (lazy(sprintf "%0*x" 7 55n)) "0000037" + test "test3237" (lazy(sprintf "%-0x" 55n)) "37" + test "test3238" (lazy(sprintf "%-05x" 55n)) "37 " + test "test3239" (lazy(sprintf "%-01x" 55n)) "37" + test "test3240" (lazy(sprintf "%-0*x" 7 55n)) "37 " + test "test3241" (lazy(sprintf "%+x" 55n)) "+37" + test "test3242" (lazy(sprintf "%+5x" 55n)) " +37" + test "test3243" (lazy(sprintf "%+1x" 55n)) "+37" + test "test3244" (lazy(sprintf "%+*x" 7 55n)) " +37" + test "test3245" (lazy(sprintf "%-+x" 55n)) "+37" + test "test3246" (lazy(sprintf "%-+5x" 55n)) "+37 " + test "test3247" (lazy(sprintf "%-+1x" 55n)) "+37" + test "test3248" (lazy(sprintf "%-+*x" 7 55n)) "+37 " + test "test3249" (lazy(sprintf "%+0x" 55n)) "+37" + test "test3250" (lazy(sprintf "%+05x" 55n)) "+0037" + test "test3251" (lazy(sprintf "%+01x" 55n)) "+37" + test "test3252" (lazy(sprintf "%+0*x" 7 55n)) "+000037" + test "test3253" (lazy(sprintf "%-+0x" 55n)) "+37" + test "test3254" (lazy(sprintf "%-+05x" 55n)) "+37 " + test "test3255" (lazy(sprintf "%-+01x" 55n)) "+37" + test "test3256" (lazy(sprintf "%-+0*x" 7 55n)) "+37 " + test "test3257" (lazy(sprintf "% x" 55n)) " 37" + test "test3258" (lazy(sprintf "% 5x" 55n)) " 37" + test "test3259" (lazy(sprintf "% 1x" 55n)) " 37" + test "test3260" (lazy(sprintf "% *x" 7 55n)) " 37" + test "test3261" (lazy(sprintf "%- x" 55n)) " 37" + test "test3262" (lazy(sprintf "%- 5x" 55n)) " 37 " + test "test3263" (lazy(sprintf "%- 1x" 55n)) " 37" + test "test3264" (lazy(sprintf "%- *x" 7 55n)) " 37 " + test "test3265" (lazy(sprintf "% 0x" 55n)) " 37" + test "test3266" (lazy(sprintf "% 05x" 55n)) " 0037" + test "test3267" (lazy(sprintf "% 01x" 55n)) " 37" + test "test3268" (lazy(sprintf "% 0*x" 7 55n)) " 000037" + test "test3269" (lazy(sprintf "%- 0x" 55n)) " 37" + test "test3270" (lazy(sprintf "%- 05x" 55n)) " 37 " + test "test3271" (lazy(sprintf "%- 01x" 55n)) " 37" + test "test3272" (lazy(sprintf "%- 0*x" 7 55n)) " 37 " + test "test3273" (lazy(sprintf "%x" 999un)) "3e7" + test "test3274" (lazy(sprintf "%5x" 999un)) " 3e7" + test "test3275" (lazy(sprintf "%1x" 999un)) "3e7" + test "test3276" (lazy(sprintf "%*x" 7 999un)) " 3e7" + test "test3277" (lazy(sprintf "%-x" 999un)) "3e7" + test "test3278" (lazy(sprintf "%-5x" 999un)) "3e7 " + test "test3279" (lazy(sprintf "%-1x" 999un)) "3e7" + test "test3280" (lazy(sprintf "%-*x" 7 999un)) "3e7 " + test "test3281" (lazy(sprintf "%0x" 999un)) "3e7" + test "test3282" (lazy(sprintf "%05x" 999un)) "003e7" + test "test3283" (lazy(sprintf "%01x" 999un)) "3e7" + test "test3284" (lazy(sprintf "%0*x" 7 999un)) "00003e7" + test "test3285" (lazy(sprintf "%-0x" 999un)) "3e7" + test "test3286" (lazy(sprintf "%-05x" 999un)) "3e7 " + test "test3287" (lazy(sprintf "%-01x" 999un)) "3e7" + test "test3288" (lazy(sprintf "%-0*x" 7 999un)) "3e7 " + test "test3289" (lazy(sprintf "%+x" 999un)) "+3e7" + test "test3290" (lazy(sprintf "%+5x" 999un)) " +3e7" + test "test3291" (lazy(sprintf "%+1x" 999un)) "+3e7" + test "test3292" (lazy(sprintf "%+*x" 7 999un)) " +3e7" + test "test3293" (lazy(sprintf "%-+x" 999un)) "+3e7" + test "test3294" (lazy(sprintf "%-+5x" 999un)) "+3e7 " + test "test3295" (lazy(sprintf "%-+1x" 999un)) "+3e7" + test "test3296" (lazy(sprintf "%-+*x" 7 999un)) "+3e7 " + test "test3297" (lazy(sprintf "%+0x" 999un)) "+3e7" + test "test3298" (lazy(sprintf "%+05x" 999un)) "+03e7" + test "test3299" (lazy(sprintf "%+01x" 999un)) "+3e7" + test "test3300" (lazy(sprintf "%+0*x" 7 999un)) "+0003e7" + test "test3301" (lazy(sprintf "%-+0x" 999un)) "+3e7" + test "test3302" (lazy(sprintf "%-+05x" 999un)) "+3e7 " + test "test3303" (lazy(sprintf "%-+01x" 999un)) "+3e7" + test "test3304" (lazy(sprintf "%-+0*x" 7 999un)) "+3e7 " + test "test3305" (lazy(sprintf "% x" 999un)) " 3e7" + test "test3306" (lazy(sprintf "% 5x" 999un)) " 3e7" + test "test3307" (lazy(sprintf "% 1x" 999un)) " 3e7" + test "test3308" (lazy(sprintf "% *x" 7 999un)) " 3e7" + test "test3309" (lazy(sprintf "%- x" 999un)) " 3e7" + test "test3310" (lazy(sprintf "%- 5x" 999un)) " 3e7 " + test "test3311" (lazy(sprintf "%- 1x" 999un)) " 3e7" + test "test3312" (lazy(sprintf "%- *x" 7 999un)) " 3e7 " + test "test3313" (lazy(sprintf "% 0x" 999un)) " 3e7" + test "test3314" (lazy(sprintf "% 05x" 999un)) " 03e7" + test "test3315" (lazy(sprintf "% 01x" 999un)) " 3e7" + test "test3316" (lazy(sprintf "% 0*x" 7 999un)) " 0003e7" + test "test3317" (lazy(sprintf "%- 0x" 999un)) " 3e7" + test "test3318" (lazy(sprintf "%- 05x" 999un)) " 3e7 " + test "test3319" (lazy(sprintf "%- 01x" 999un)) " 3e7" + test "test3320" (lazy(sprintf "%- 0*x" 7 999un)) " 3e7 " + test "test3321" (lazy(sprintf "%X" 14)) "E" + test "test3322" (lazy(sprintf "%5X" 14)) " E" + test "test3323" (lazy(sprintf "%1X" 14)) "E" + test "test3324" (lazy(sprintf "%*X" 7 14)) " E" + test "test3325" (lazy(sprintf "%-X" 14)) "E" + test "test3326" (lazy(sprintf "%-5X" 14)) "E " + test "test3327" (lazy(sprintf "%-1X" 14)) "E" + test "test3328" (lazy(sprintf "%-*X" 7 14)) "E " + test "test3329" (lazy(sprintf "%0X" 14)) "E" + test "test3330" (lazy(sprintf "%05X" 14)) "0000E" + test "test3331" (lazy(sprintf "%01X" 14)) "E" + test "test3332" (lazy(sprintf "%0*X" 7 14)) "000000E" + test "test3333" (lazy(sprintf "%-0X" 14)) "E" + test "test3334" (lazy(sprintf "%-05X" 14)) "E " + test "test3335" (lazy(sprintf "%-01X" 14)) "E" + test "test3336" (lazy(sprintf "%-0*X" 7 14)) "E " + test "test3337" (lazy(sprintf "%+X" 14)) "+E" + test "test3338" (lazy(sprintf "%+5X" 14)) " +E" + test "test3339" (lazy(sprintf "%+1X" 14)) "+E" + test "test3340" (lazy(sprintf "%+*X" 7 14)) " +E" + test "test3341" (lazy(sprintf "%-+X" 14)) "+E" + test "test3342" (lazy(sprintf "%-+5X" 14)) "+E " + test "test3343" (lazy(sprintf "%-+1X" 14)) "+E" + test "test3344" (lazy(sprintf "%-+*X" 7 14)) "+E " + test "test3345" (lazy(sprintf "%+0X" 14)) "+E" + test "test3346" (lazy(sprintf "%+05X" 14)) "+000E" + test "test3347" (lazy(sprintf "%+01X" 14)) "+E" + test "test3348" (lazy(sprintf "%+0*X" 7 14)) "+00000E" + test "test3349" (lazy(sprintf "%-+0X" 14)) "+E" + test "test3350" (lazy(sprintf "%-+05X" 14)) "+E " + test "test3351" (lazy(sprintf "%-+01X" 14)) "+E" + test "test3352" (lazy(sprintf "%-+0*X" 7 14)) "+E " + test "test3353" (lazy(sprintf "% X" 14)) " E" + test "test3354" (lazy(sprintf "% 5X" 14)) " E" + test "test3355" (lazy(sprintf "% 1X" 14)) " E" + test "test3356" (lazy(sprintf "% *X" 7 14)) " E" + test "test3357" (lazy(sprintf "%- X" 14)) " E" + test "test3358" (lazy(sprintf "%- 5X" 14)) " E " + test "test3359" (lazy(sprintf "%- 1X" 14)) " E" + test "test3360" (lazy(sprintf "%- *X" 7 14)) " E " + test "test3361" (lazy(sprintf "% 0X" 14)) " E" + test "test3362" (lazy(sprintf "% 05X" 14)) " 000E" + test "test3363" (lazy(sprintf "% 01X" 14)) " E" + test "test3364" (lazy(sprintf "% 0*X" 7 14)) " 00000E" + test "test3365" (lazy(sprintf "%- 0X" 14)) " E" + test "test3366" (lazy(sprintf "%- 05X" 14)) " E " + test "test3367" (lazy(sprintf "%- 01X" 14)) " E" + test "test3368" (lazy(sprintf "%- 0*X" 7 14)) " E " + test "test3369" (lazy(sprintf "%X" -10)) "FFFFFFF6" + test "test3370" (lazy(sprintf "%5X" -10)) "FFFFFFF6" + test "test3371" (lazy(sprintf "%1X" -10)) "FFFFFFF6" + test "test3372" (lazy(sprintf "%*X" 7 -10)) "FFFFFFF6" + test "test3373" (lazy(sprintf "%-X" -10)) "FFFFFFF6" + test "test3374" (lazy(sprintf "%-5X" -10)) "FFFFFFF6" + test "test3375" (lazy(sprintf "%-1X" -10)) "FFFFFFF6" + test "test3376" (lazy(sprintf "%-*X" 7 -10)) "FFFFFFF6" + test "test3377" (lazy(sprintf "%0X" -10)) "FFFFFFF6" + test "test3378" (lazy(sprintf "%05X" -10)) "FFFFFFF6" + test "test3379" (lazy(sprintf "%01X" -10)) "FFFFFFF6" + test "test3380" (lazy(sprintf "%0*X" 7 -10)) "FFFFFFF6" + test "test3381" (lazy(sprintf "%-0X" -10)) "FFFFFFF6" + test "test3382" (lazy(sprintf "%-05X" -10)) "FFFFFFF6" + test "test3383" (lazy(sprintf "%-01X" -10)) "FFFFFFF6" + test "test3384" (lazy(sprintf "%-0*X" 7 -10)) "FFFFFFF6" + test "test3385" (lazy(sprintf "%+X" -10)) "+FFFFFFF6" + test "test3386" (lazy(sprintf "%+5X" -10)) "+FFFFFFF6" + test "test3387" (lazy(sprintf "%+1X" -10)) "+FFFFFFF6" + test "test3388" (lazy(sprintf "%+*X" 7 -10)) "+FFFFFFF6" + test "test3389" (lazy(sprintf "%-+X" -10)) "+FFFFFFF6" + test "test3390" (lazy(sprintf "%-+5X" -10)) "+FFFFFFF6" + test "test3391" (lazy(sprintf "%-+1X" -10)) "+FFFFFFF6" + test "test3392" (lazy(sprintf "%-+*X" 7 -10)) "+FFFFFFF6" + test "test3393" (lazy(sprintf "%+0X" -10)) "+FFFFFFF6" + test "test3394" (lazy(sprintf "%+05X" -10)) "+FFFFFFF6" + test "test3395" (lazy(sprintf "%+01X" -10)) "+FFFFFFF6" + test "test3396" (lazy(sprintf "%+0*X" 7 -10)) "+FFFFFFF6" + test "test3397" (lazy(sprintf "%-+0X" -10)) "+FFFFFFF6" + test "test3398" (lazy(sprintf "%-+05X" -10)) "+FFFFFFF6" + test "test3399" (lazy(sprintf "%-+01X" -10)) "+FFFFFFF6" + test "test3400" (lazy(sprintf "%-+0*X" 7 -10)) "+FFFFFFF6" + test "test3401" (lazy(sprintf "% X" -10)) " FFFFFFF6" + test "test3402" (lazy(sprintf "% 5X" -10)) " FFFFFFF6" + test "test3403" (lazy(sprintf "% 1X" -10)) " FFFFFFF6" + test "test3404" (lazy(sprintf "% *X" 7 -10)) " FFFFFFF6" + test "test3405" (lazy(sprintf "%- X" -10)) " FFFFFFF6" + test "test3406" (lazy(sprintf "%- 5X" -10)) " FFFFFFF6" + test "test3407" (lazy(sprintf "%- 1X" -10)) " FFFFFFF6" + test "test3408" (lazy(sprintf "%- *X" 7 -10)) " FFFFFFF6" + test "test3409" (lazy(sprintf "% 0X" -10)) " FFFFFFF6" + test "test3410" (lazy(sprintf "% 05X" -10)) " FFFFFFF6" + test "test3411" (lazy(sprintf "% 01X" -10)) " FFFFFFF6" + test "test3412" (lazy(sprintf "% 0*X" 7 -10)) " FFFFFFF6" + test "test3413" (lazy(sprintf "%- 0X" -10)) " FFFFFFF6" + test "test3414" (lazy(sprintf "%- 05X" -10)) " FFFFFFF6" + test "test3415" (lazy(sprintf "%- 01X" -10)) " FFFFFFF6" + test "test3416" (lazy(sprintf "%- 0*X" 7 -10)) " FFFFFFF6" + test "test3417" (lazy(sprintf "%X" 55s)) "37" + test "test3418" (lazy(sprintf "%5X" 55s)) " 37" + test "test3419" (lazy(sprintf "%1X" 55s)) "37" + test "test3420" (lazy(sprintf "%*X" 7 55s)) " 37" + test "test3421" (lazy(sprintf "%-X" 55s)) "37" + test "test3422" (lazy(sprintf "%-5X" 55s)) "37 " + test "test3423" (lazy(sprintf "%-1X" 55s)) "37" + test "test3424" (lazy(sprintf "%-*X" 7 55s)) "37 " + test "test3425" (lazy(sprintf "%0X" 55s)) "37" + test "test3426" (lazy(sprintf "%05X" 55s)) "00037" + test "test3427" (lazy(sprintf "%01X" 55s)) "37" + test "test3428" (lazy(sprintf "%0*X" 7 55s)) "0000037" + test "test3429" (lazy(sprintf "%-0X" 55s)) "37" + test "test3430" (lazy(sprintf "%-05X" 55s)) "37 " + test "test3431" (lazy(sprintf "%-01X" 55s)) "37" + test "test3432" (lazy(sprintf "%-0*X" 7 55s)) "37 " + test "test3433" (lazy(sprintf "%+X" 55s)) "+37" + test "test3434" (lazy(sprintf "%+5X" 55s)) " +37" + test "test3435" (lazy(sprintf "%+1X" 55s)) "+37" + test "test3436" (lazy(sprintf "%+*X" 7 55s)) " +37" + test "test3437" (lazy(sprintf "%-+X" 55s)) "+37" + test "test3438" (lazy(sprintf "%-+5X" 55s)) "+37 " + test "test3439" (lazy(sprintf "%-+1X" 55s)) "+37" + test "test3440" (lazy(sprintf "%-+*X" 7 55s)) "+37 " + test "test3441" (lazy(sprintf "%+0X" 55s)) "+37" + test "test3442" (lazy(sprintf "%+05X" 55s)) "+0037" + test "test3443" (lazy(sprintf "%+01X" 55s)) "+37" + test "test3444" (lazy(sprintf "%+0*X" 7 55s)) "+000037" + test "test3445" (lazy(sprintf "%-+0X" 55s)) "+37" + test "test3446" (lazy(sprintf "%-+05X" 55s)) "+37 " + test "test3447" (lazy(sprintf "%-+01X" 55s)) "+37" + test "test3448" (lazy(sprintf "%-+0*X" 7 55s)) "+37 " + test "test3449" (lazy(sprintf "% X" 55s)) " 37" + test "test3450" (lazy(sprintf "% 5X" 55s)) " 37" + test "test3451" (lazy(sprintf "% 1X" 55s)) " 37" + test "test3452" (lazy(sprintf "% *X" 7 55s)) " 37" + test "test3453" (lazy(sprintf "%- X" 55s)) " 37" + test "test3454" (lazy(sprintf "%- 5X" 55s)) " 37 " + test "test3455" (lazy(sprintf "%- 1X" 55s)) " 37" + test "test3456" (lazy(sprintf "%- *X" 7 55s)) " 37 " + test "test3457" (lazy(sprintf "% 0X" 55s)) " 37" + test "test3458" (lazy(sprintf "% 05X" 55s)) " 0037" + test "test3459" (lazy(sprintf "% 01X" 55s)) " 37" + test "test3460" (lazy(sprintf "% 0*X" 7 55s)) " 000037" + test "test3461" (lazy(sprintf "%- 0X" 55s)) " 37" + test "test3462" (lazy(sprintf "%- 05X" 55s)) " 37 " + test "test3463" (lazy(sprintf "%- 01X" 55s)) " 37" + test "test3464" (lazy(sprintf "%- 0*X" 7 55s)) " 37 " + test "test3465" (lazy(sprintf "%X" -88s)) "FFA8" + test "test3466" (lazy(sprintf "%5X" -88s)) " FFA8" + test "test3467" (lazy(sprintf "%1X" -88s)) "FFA8" + test "test3468" (lazy(sprintf "%*X" 7 -88s)) " FFA8" + test "test3469" (lazy(sprintf "%-X" -88s)) "FFA8" + test "test3470" (lazy(sprintf "%-5X" -88s)) "FFA8 " + test "test3471" (lazy(sprintf "%-1X" -88s)) "FFA8" + test "test3472" (lazy(sprintf "%-*X" 7 -88s)) "FFA8 " + test "test3473" (lazy(sprintf "%0X" -88s)) "FFA8" + test "test3474" (lazy(sprintf "%05X" -88s)) "0FFA8" + test "test3475" (lazy(sprintf "%01X" -88s)) "FFA8" + test "test3476" (lazy(sprintf "%0*X" 7 -88s)) "000FFA8" + test "test3477" (lazy(sprintf "%-0X" -88s)) "FFA8" + test "test3478" (lazy(sprintf "%-05X" -88s)) "FFA8 " + test "test3479" (lazy(sprintf "%-01X" -88s)) "FFA8" + test "test3480" (lazy(sprintf "%-0*X" 7 -88s)) "FFA8 " + test "test3481" (lazy(sprintf "%+X" -88s)) "+FFA8" + test "test3482" (lazy(sprintf "%+5X" -88s)) "+FFA8" + test "test3483" (lazy(sprintf "%+1X" -88s)) "+FFA8" + test "test3484" (lazy(sprintf "%+*X" 7 -88s)) " +FFA8" + test "test3485" (lazy(sprintf "%-+X" -88s)) "+FFA8" + test "test3486" (lazy(sprintf "%-+5X" -88s)) "+FFA8" + test "test3487" (lazy(sprintf "%-+1X" -88s)) "+FFA8" + test "test3488" (lazy(sprintf "%-+*X" 7 -88s)) "+FFA8 " + test "test3489" (lazy(sprintf "%+0X" -88s)) "+FFA8" + test "test3490" (lazy(sprintf "%+05X" -88s)) "+FFA8" + test "test3491" (lazy(sprintf "%+01X" -88s)) "+FFA8" + test "test3492" (lazy(sprintf "%+0*X" 7 -88s)) "+00FFA8" + test "test3493" (lazy(sprintf "%-+0X" -88s)) "+FFA8" + test "test3494" (lazy(sprintf "%-+05X" -88s)) "+FFA8" + test "test3495" (lazy(sprintf "%-+01X" -88s)) "+FFA8" + test "test3496" (lazy(sprintf "%-+0*X" 7 -88s)) "+FFA8 " + test "test3497" (lazy(sprintf "% X" -88s)) " FFA8" + test "test3498" (lazy(sprintf "% 5X" -88s)) " FFA8" + test "test3499" (lazy(sprintf "% 1X" -88s)) " FFA8" + test "test3500" (lazy(sprintf "% *X" 7 -88s)) " FFA8" + test "test3501" (lazy(sprintf "%- X" -88s)) " FFA8" + test "test3502" (lazy(sprintf "%- 5X" -88s)) " FFA8" + test "test3503" (lazy(sprintf "%- 1X" -88s)) " FFA8" + test "test3504" (lazy(sprintf "%- *X" 7 -88s)) " FFA8 " + test "test3505" (lazy(sprintf "% 0X" -88s)) " FFA8" + test "test3506" (lazy(sprintf "% 05X" -88s)) " FFA8" + test "test3507" (lazy(sprintf "% 01X" -88s)) " FFA8" + test "test3508" (lazy(sprintf "% 0*X" 7 -88s)) " 00FFA8" + test "test3509" (lazy(sprintf "%- 0X" -88s)) " FFA8" + test "test3510" (lazy(sprintf "%- 05X" -88s)) " FFA8" + test "test3511" (lazy(sprintf "%- 01X" -88s)) " FFA8" + test "test3512" (lazy(sprintf "%- 0*X" 7 -88s)) " FFA8 " + test "test3513" (lazy(sprintf "%X" 104us)) "68" + test "test3514" (lazy(sprintf "%5X" 104us)) " 68" + test "test3515" (lazy(sprintf "%1X" 104us)) "68" + test "test3516" (lazy(sprintf "%*X" 7 104us)) " 68" + test "test3517" (lazy(sprintf "%-X" 104us)) "68" + test "test3518" (lazy(sprintf "%-5X" 104us)) "68 " + test "test3519" (lazy(sprintf "%-1X" 104us)) "68" + test "test3520" (lazy(sprintf "%-*X" 7 104us)) "68 " + test "test3521" (lazy(sprintf "%0X" 104us)) "68" + test "test3522" (lazy(sprintf "%05X" 104us)) "00068" + test "test3523" (lazy(sprintf "%01X" 104us)) "68" + test "test3524" (lazy(sprintf "%0*X" 7 104us)) "0000068" + test "test3525" (lazy(sprintf "%-0X" 104us)) "68" + test "test3526" (lazy(sprintf "%-05X" 104us)) "68 " + test "test3527" (lazy(sprintf "%-01X" 104us)) "68" + test "test3528" (lazy(sprintf "%-0*X" 7 104us)) "68 " + test "test3529" (lazy(sprintf "%+X" 104us)) "+68" + test "test3530" (lazy(sprintf "%+5X" 104us)) " +68" + test "test3531" (lazy(sprintf "%+1X" 104us)) "+68" + test "test3532" (lazy(sprintf "%+*X" 7 104us)) " +68" + test "test3533" (lazy(sprintf "%-+X" 104us)) "+68" + test "test3534" (lazy(sprintf "%-+5X" 104us)) "+68 " + test "test3535" (lazy(sprintf "%-+1X" 104us)) "+68" + test "test3536" (lazy(sprintf "%-+*X" 7 104us)) "+68 " + test "test3537" (lazy(sprintf "%+0X" 104us)) "+68" + test "test3538" (lazy(sprintf "%+05X" 104us)) "+0068" + test "test3539" (lazy(sprintf "%+01X" 104us)) "+68" + test "test3540" (lazy(sprintf "%+0*X" 7 104us)) "+000068" + test "test3541" (lazy(sprintf "%-+0X" 104us)) "+68" + test "test3542" (lazy(sprintf "%-+05X" 104us)) "+68 " + test "test3543" (lazy(sprintf "%-+01X" 104us)) "+68" + test "test3544" (lazy(sprintf "%-+0*X" 7 104us)) "+68 " + test "test3545" (lazy(sprintf "% X" 104us)) " 68" + test "test3546" (lazy(sprintf "% 5X" 104us)) " 68" + test "test3547" (lazy(sprintf "% 1X" 104us)) " 68" + test "test3548" (lazy(sprintf "% *X" 7 104us)) " 68" + test "test3549" (lazy(sprintf "%- X" 104us)) " 68" + test "test3550" (lazy(sprintf "%- 5X" 104us)) " 68 " + test "test3551" (lazy(sprintf "%- 1X" 104us)) " 68" + test "test3552" (lazy(sprintf "%- *X" 7 104us)) " 68 " + test "test3553" (lazy(sprintf "% 0X" 104us)) " 68" + test "test3554" (lazy(sprintf "% 05X" 104us)) " 0068" + test "test3555" (lazy(sprintf "% 01X" 104us)) " 68" + test "test3556" (lazy(sprintf "% 0*X" 7 104us)) " 000068" + test "test3557" (lazy(sprintf "%- 0X" 104us)) " 68" + test "test3558" (lazy(sprintf "%- 05X" 104us)) " 68 " + test "test3559" (lazy(sprintf "%- 01X" 104us)) " 68" + test "test3560" (lazy(sprintf "%- 0*X" 7 104us)) " 68 " + test "test3561" (lazy(sprintf "%X" 12y)) "C" + test "test3562" (lazy(sprintf "%5X" 12y)) " C" + test "test3563" (lazy(sprintf "%1X" 12y)) "C" + test "test3564" (lazy(sprintf "%*X" 7 12y)) " C" + test "test3565" (lazy(sprintf "%-X" 12y)) "C" + test "test3566" (lazy(sprintf "%-5X" 12y)) "C " + test "test3567" (lazy(sprintf "%-1X" 12y)) "C" + test "test3568" (lazy(sprintf "%-*X" 7 12y)) "C " + test "test3569" (lazy(sprintf "%0X" 12y)) "C" + test "test3570" (lazy(sprintf "%05X" 12y)) "0000C" + test "test3571" (lazy(sprintf "%01X" 12y)) "C" + test "test3572" (lazy(sprintf "%0*X" 7 12y)) "000000C" + test "test3573" (lazy(sprintf "%-0X" 12y)) "C" + test "test3574" (lazy(sprintf "%-05X" 12y)) "C " + test "test3575" (lazy(sprintf "%-01X" 12y)) "C" + test "test3576" (lazy(sprintf "%-0*X" 7 12y)) "C " + test "test3577" (lazy(sprintf "%+X" 12y)) "+C" + test "test3578" (lazy(sprintf "%+5X" 12y)) " +C" + test "test3579" (lazy(sprintf "%+1X" 12y)) "+C" + test "test3580" (lazy(sprintf "%+*X" 7 12y)) " +C" + test "test3581" (lazy(sprintf "%-+X" 12y)) "+C" + test "test3582" (lazy(sprintf "%-+5X" 12y)) "+C " + test "test3583" (lazy(sprintf "%-+1X" 12y)) "+C" + test "test3584" (lazy(sprintf "%-+*X" 7 12y)) "+C " + test "test3585" (lazy(sprintf "%+0X" 12y)) "+C" + test "test3586" (lazy(sprintf "%+05X" 12y)) "+000C" + test "test3587" (lazy(sprintf "%+01X" 12y)) "+C" + test "test3588" (lazy(sprintf "%+0*X" 7 12y)) "+00000C" + test "test3589" (lazy(sprintf "%-+0X" 12y)) "+C" + test "test3590" (lazy(sprintf "%-+05X" 12y)) "+C " + test "test3591" (lazy(sprintf "%-+01X" 12y)) "+C" + test "test3592" (lazy(sprintf "%-+0*X" 7 12y)) "+C " + test "test3593" (lazy(sprintf "% X" 12y)) " C" + test "test3594" (lazy(sprintf "% 5X" 12y)) " C" + test "test3595" (lazy(sprintf "% 1X" 12y)) " C" + test "test3596" (lazy(sprintf "% *X" 7 12y)) " C" + test "test3597" (lazy(sprintf "%- X" 12y)) " C" + test "test3598" (lazy(sprintf "%- 5X" 12y)) " C " + test "test3599" (lazy(sprintf "%- 1X" 12y)) " C" + test "test3600" (lazy(sprintf "%- *X" 7 12y)) " C " + test "test3601" (lazy(sprintf "% 0X" 12y)) " C" + test "test3602" (lazy(sprintf "% 05X" 12y)) " 000C" + test "test3603" (lazy(sprintf "% 01X" 12y)) " C" + test "test3604" (lazy(sprintf "% 0*X" 7 12y)) " 00000C" + test "test3605" (lazy(sprintf "%- 0X" 12y)) " C" + test "test3606" (lazy(sprintf "%- 05X" 12y)) " C " + test "test3607" (lazy(sprintf "%- 01X" 12y)) " C" + test "test3608" (lazy(sprintf "%- 0*X" 7 12y)) " C " + test "test3609" (lazy(sprintf "%X" -94y)) "A2" + test "test3610" (lazy(sprintf "%5X" -94y)) " A2" + test "test3611" (lazy(sprintf "%1X" -94y)) "A2" + test "test3612" (lazy(sprintf "%*X" 7 -94y)) " A2" + test "test3613" (lazy(sprintf "%-X" -94y)) "A2" + test "test3614" (lazy(sprintf "%-5X" -94y)) "A2 " + test "test3615" (lazy(sprintf "%-1X" -94y)) "A2" + test "test3616" (lazy(sprintf "%-*X" 7 -94y)) "A2 " + test "test3617" (lazy(sprintf "%0X" -94y)) "A2" + test "test3618" (lazy(sprintf "%05X" -94y)) "000A2" + test "test3619" (lazy(sprintf "%01X" -94y)) "A2" + test "test3620" (lazy(sprintf "%0*X" 7 -94y)) "00000A2" + test "test3621" (lazy(sprintf "%-0X" -94y)) "A2" + test "test3622" (lazy(sprintf "%-05X" -94y)) "A2 " + test "test3623" (lazy(sprintf "%-01X" -94y)) "A2" + test "test3624" (lazy(sprintf "%-0*X" 7 -94y)) "A2 " + test "test3625" (lazy(sprintf "%+X" -94y)) "+A2" + test "test3626" (lazy(sprintf "%+5X" -94y)) " +A2" + test "test3627" (lazy(sprintf "%+1X" -94y)) "+A2" + test "test3628" (lazy(sprintf "%+*X" 7 -94y)) " +A2" + test "test3629" (lazy(sprintf "%-+X" -94y)) "+A2" + test "test3630" (lazy(sprintf "%-+5X" -94y)) "+A2 " + test "test3631" (lazy(sprintf "%-+1X" -94y)) "+A2" + test "test3632" (lazy(sprintf "%-+*X" 7 -94y)) "+A2 " + test "test3633" (lazy(sprintf "%+0X" -94y)) "+A2" + test "test3634" (lazy(sprintf "%+05X" -94y)) "+00A2" + test "test3635" (lazy(sprintf "%+01X" -94y)) "+A2" + test "test3636" (lazy(sprintf "%+0*X" 7 -94y)) "+0000A2" + test "test3637" (lazy(sprintf "%-+0X" -94y)) "+A2" + test "test3638" (lazy(sprintf "%-+05X" -94y)) "+A2 " + test "test3639" (lazy(sprintf "%-+01X" -94y)) "+A2" + test "test3640" (lazy(sprintf "%-+0*X" 7 -94y)) "+A2 " + test "test3641" (lazy(sprintf "% X" -94y)) " A2" + test "test3642" (lazy(sprintf "% 5X" -94y)) " A2" + test "test3643" (lazy(sprintf "% 1X" -94y)) " A2" + test "test3644" (lazy(sprintf "% *X" 7 -94y)) " A2" + test "test3645" (lazy(sprintf "%- X" -94y)) " A2" + test "test3646" (lazy(sprintf "%- 5X" -94y)) " A2 " + test "test3647" (lazy(sprintf "%- 1X" -94y)) " A2" + test "test3648" (lazy(sprintf "%- *X" 7 -94y)) " A2 " + test "test3649" (lazy(sprintf "% 0X" -94y)) " A2" + test "test3650" (lazy(sprintf "% 05X" -94y)) " 00A2" + test "test3651" (lazy(sprintf "% 01X" -94y)) " A2" + test "test3652" (lazy(sprintf "% 0*X" 7 -94y)) " 0000A2" + test "test3653" (lazy(sprintf "%- 0X" -94y)) " A2" + test "test3654" (lazy(sprintf "%- 05X" -94y)) " A2 " + test "test3655" (lazy(sprintf "%- 01X" -94y)) " A2" + test "test3656" (lazy(sprintf "%- 0*X" 7 -94y)) " A2 " + test "test3657" (lazy(sprintf "%X" 88uy)) "58" + test "test3658" (lazy(sprintf "%5X" 88uy)) " 58" + test "test3659" (lazy(sprintf "%1X" 88uy)) "58" + test "test3660" (lazy(sprintf "%*X" 7 88uy)) " 58" + test "test3661" (lazy(sprintf "%-X" 88uy)) "58" + test "test3662" (lazy(sprintf "%-5X" 88uy)) "58 " + test "test3663" (lazy(sprintf "%-1X" 88uy)) "58" + test "test3664" (lazy(sprintf "%-*X" 7 88uy)) "58 " + test "test3665" (lazy(sprintf "%0X" 88uy)) "58" + test "test3666" (lazy(sprintf "%05X" 88uy)) "00058" + test "test3667" (lazy(sprintf "%01X" 88uy)) "58" + test "test3668" (lazy(sprintf "%0*X" 7 88uy)) "0000058" + test "test3669" (lazy(sprintf "%-0X" 88uy)) "58" + test "test3670" (lazy(sprintf "%-05X" 88uy)) "58 " + test "test3671" (lazy(sprintf "%-01X" 88uy)) "58" + test "test3672" (lazy(sprintf "%-0*X" 7 88uy)) "58 " + test "test3673" (lazy(sprintf "%+X" 88uy)) "+58" + test "test3674" (lazy(sprintf "%+5X" 88uy)) " +58" + test "test3675" (lazy(sprintf "%+1X" 88uy)) "+58" + test "test3676" (lazy(sprintf "%+*X" 7 88uy)) " +58" + test "test3677" (lazy(sprintf "%-+X" 88uy)) "+58" + test "test3678" (lazy(sprintf "%-+5X" 88uy)) "+58 " + test "test3679" (lazy(sprintf "%-+1X" 88uy)) "+58" + test "test3680" (lazy(sprintf "%-+*X" 7 88uy)) "+58 " + test "test3681" (lazy(sprintf "%+0X" 88uy)) "+58" + test "test3682" (lazy(sprintf "%+05X" 88uy)) "+0058" + test "test3683" (lazy(sprintf "%+01X" 88uy)) "+58" + test "test3684" (lazy(sprintf "%+0*X" 7 88uy)) "+000058" + test "test3685" (lazy(sprintf "%-+0X" 88uy)) "+58" + test "test3686" (lazy(sprintf "%-+05X" 88uy)) "+58 " + test "test3687" (lazy(sprintf "%-+01X" 88uy)) "+58" + test "test3688" (lazy(sprintf "%-+0*X" 7 88uy)) "+58 " + test "test3689" (lazy(sprintf "% X" 88uy)) " 58" + test "test3690" (lazy(sprintf "% 5X" 88uy)) " 58" + test "test3691" (lazy(sprintf "% 1X" 88uy)) " 58" + test "test3692" (lazy(sprintf "% *X" 7 88uy)) " 58" + test "test3693" (lazy(sprintf "%- X" 88uy)) " 58" + test "test3694" (lazy(sprintf "%- 5X" 88uy)) " 58 " + test "test3695" (lazy(sprintf "%- 1X" 88uy)) " 58" + test "test3696" (lazy(sprintf "%- *X" 7 88uy)) " 58 " + test "test3697" (lazy(sprintf "% 0X" 88uy)) " 58" + test "test3698" (lazy(sprintf "% 05X" 88uy)) " 0058" + test "test3699" (lazy(sprintf "% 01X" 88uy)) " 58" + test "test3700" (lazy(sprintf "% 0*X" 7 88uy)) " 000058" + test "test3701" (lazy(sprintf "%- 0X" 88uy)) " 58" + test "test3702" (lazy(sprintf "%- 05X" 88uy)) " 58 " + test "test3703" (lazy(sprintf "%- 01X" 88uy)) " 58" + test "test3704" (lazy(sprintf "%- 0*X" 7 88uy)) " 58 " + test "test3705" (lazy(sprintf "%X" 999L)) "3E7" + test "test3706" (lazy(sprintf "%5X" 999L)) " 3E7" + test "test3707" (lazy(sprintf "%1X" 999L)) "3E7" + test "test3708" (lazy(sprintf "%*X" 7 999L)) " 3E7" + test "test3709" (lazy(sprintf "%-X" 999L)) "3E7" + test "test3710" (lazy(sprintf "%-5X" 999L)) "3E7 " + test "test3711" (lazy(sprintf "%-1X" 999L)) "3E7" + test "test3712" (lazy(sprintf "%-*X" 7 999L)) "3E7 " + test "test3713" (lazy(sprintf "%0X" 999L)) "3E7" + test "test3714" (lazy(sprintf "%05X" 999L)) "003E7" + test "test3715" (lazy(sprintf "%01X" 999L)) "3E7" + test "test3716" (lazy(sprintf "%0*X" 7 999L)) "00003E7" + test "test3717" (lazy(sprintf "%-0X" 999L)) "3E7" + test "test3718" (lazy(sprintf "%-05X" 999L)) "3E7 " + test "test3719" (lazy(sprintf "%-01X" 999L)) "3E7" + test "test3720" (lazy(sprintf "%-0*X" 7 999L)) "3E7 " + test "test3721" (lazy(sprintf "%+X" 999L)) "+3E7" + test "test3722" (lazy(sprintf "%+5X" 999L)) " +3E7" + test "test3723" (lazy(sprintf "%+1X" 999L)) "+3E7" + test "test3724" (lazy(sprintf "%+*X" 7 999L)) " +3E7" + test "test3725" (lazy(sprintf "%-+X" 999L)) "+3E7" + test "test3726" (lazy(sprintf "%-+5X" 999L)) "+3E7 " + test "test3727" (lazy(sprintf "%-+1X" 999L)) "+3E7" + test "test3728" (lazy(sprintf "%-+*X" 7 999L)) "+3E7 " + test "test3729" (lazy(sprintf "%+0X" 999L)) "+3E7" + test "test3730" (lazy(sprintf "%+05X" 999L)) "+03E7" + test "test3731" (lazy(sprintf "%+01X" 999L)) "+3E7" + test "test3732" (lazy(sprintf "%+0*X" 7 999L)) "+0003E7" + test "test3733" (lazy(sprintf "%-+0X" 999L)) "+3E7" + test "test3734" (lazy(sprintf "%-+05X" 999L)) "+3E7 " + test "test3735" (lazy(sprintf "%-+01X" 999L)) "+3E7" + test "test3736" (lazy(sprintf "%-+0*X" 7 999L)) "+3E7 " + test "test3737" (lazy(sprintf "% X" 999L)) " 3E7" + test "test3738" (lazy(sprintf "% 5X" 999L)) " 3E7" + test "test3739" (lazy(sprintf "% 1X" 999L)) " 3E7" + test "test3740" (lazy(sprintf "% *X" 7 999L)) " 3E7" + test "test3741" (lazy(sprintf "%- X" 999L)) " 3E7" + test "test3742" (lazy(sprintf "%- 5X" 999L)) " 3E7 " + test "test3743" (lazy(sprintf "%- 1X" 999L)) " 3E7" + test "test3744" (lazy(sprintf "%- *X" 7 999L)) " 3E7 " + test "test3745" (lazy(sprintf "% 0X" 999L)) " 3E7" + test "test3746" (lazy(sprintf "% 05X" 999L)) " 03E7" + test "test3747" (lazy(sprintf "% 01X" 999L)) " 3E7" + test "test3748" (lazy(sprintf "% 0*X" 7 999L)) " 0003E7" + test "test3749" (lazy(sprintf "%- 0X" 999L)) " 3E7" + test "test3750" (lazy(sprintf "%- 05X" 999L)) " 3E7 " + test "test3751" (lazy(sprintf "%- 01X" 999L)) " 3E7" + test "test3752" (lazy(sprintf "%- 0*X" 7 999L)) " 3E7 " + test "test3753" (lazy(sprintf "%X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3754" (lazy(sprintf "%5X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3755" (lazy(sprintf "%1X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3756" (lazy(sprintf "%*X" 7 -321L)) "FFFFFFFFFFFFFEBF" + test "test3757" (lazy(sprintf "%-X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3758" (lazy(sprintf "%-5X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3759" (lazy(sprintf "%-1X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3760" (lazy(sprintf "%-*X" 7 -321L)) "FFFFFFFFFFFFFEBF" + test "test3761" (lazy(sprintf "%0X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3762" (lazy(sprintf "%05X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3763" (lazy(sprintf "%01X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3764" (lazy(sprintf "%0*X" 7 -321L)) "FFFFFFFFFFFFFEBF" + test "test3765" (lazy(sprintf "%-0X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3766" (lazy(sprintf "%-05X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3767" (lazy(sprintf "%-01X" -321L)) "FFFFFFFFFFFFFEBF" + test "test3768" (lazy(sprintf "%-0*X" 7 -321L)) "FFFFFFFFFFFFFEBF" + test "test3769" (lazy(sprintf "%+X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3770" (lazy(sprintf "%+5X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3771" (lazy(sprintf "%+1X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3772" (lazy(sprintf "%+*X" 7 -321L)) "+FFFFFFFFFFFFFEBF" + test "test3773" (lazy(sprintf "%-+X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3774" (lazy(sprintf "%-+5X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3775" (lazy(sprintf "%-+1X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3776" (lazy(sprintf "%-+*X" 7 -321L)) "+FFFFFFFFFFFFFEBF" + test "test3777" (lazy(sprintf "%+0X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3778" (lazy(sprintf "%+05X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3779" (lazy(sprintf "%+01X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3780" (lazy(sprintf "%+0*X" 7 -321L)) "+FFFFFFFFFFFFFEBF" + test "test3781" (lazy(sprintf "%-+0X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3782" (lazy(sprintf "%-+05X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3783" (lazy(sprintf "%-+01X" -321L)) "+FFFFFFFFFFFFFEBF" + test "test3784" (lazy(sprintf "%-+0*X" 7 -321L)) "+FFFFFFFFFFFFFEBF" + test "test3785" (lazy(sprintf "% X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3786" (lazy(sprintf "% 5X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3787" (lazy(sprintf "% 1X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3788" (lazy(sprintf "% *X" 7 -321L)) " FFFFFFFFFFFFFEBF" + test "test3789" (lazy(sprintf "%- X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3790" (lazy(sprintf "%- 5X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3791" (lazy(sprintf "%- 1X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3792" (lazy(sprintf "%- *X" 7 -321L)) " FFFFFFFFFFFFFEBF" + test "test3793" (lazy(sprintf "% 0X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3794" (lazy(sprintf "% 05X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3795" (lazy(sprintf "% 01X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3796" (lazy(sprintf "% 0*X" 7 -321L)) " FFFFFFFFFFFFFEBF" + test "test3797" (lazy(sprintf "%- 0X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3798" (lazy(sprintf "%- 05X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3799" (lazy(sprintf "%- 01X" -321L)) " FFFFFFFFFFFFFEBF" + test "test3800" (lazy(sprintf "%- 0*X" 7 -321L)) " FFFFFFFFFFFFFEBF" + test "test3801" (lazy(sprintf "%X" 50000UL)) "C350" + test "test3802" (lazy(sprintf "%5X" 50000UL)) " C350" + test "test3803" (lazy(sprintf "%1X" 50000UL)) "C350" + test "test3804" (lazy(sprintf "%*X" 7 50000UL)) " C350" + test "test3805" (lazy(sprintf "%-X" 50000UL)) "C350" + test "test3806" (lazy(sprintf "%-5X" 50000UL)) "C350 " + test "test3807" (lazy(sprintf "%-1X" 50000UL)) "C350" + test "test3808" (lazy(sprintf "%-*X" 7 50000UL)) "C350 " + test "test3809" (lazy(sprintf "%0X" 50000UL)) "C350" + test "test3810" (lazy(sprintf "%05X" 50000UL)) "0C350" + test "test3811" (lazy(sprintf "%01X" 50000UL)) "C350" + test "test3812" (lazy(sprintf "%0*X" 7 50000UL)) "000C350" + test "test3813" (lazy(sprintf "%-0X" 50000UL)) "C350" + test "test3814" (lazy(sprintf "%-05X" 50000UL)) "C350 " + test "test3815" (lazy(sprintf "%-01X" 50000UL)) "C350" + test "test3816" (lazy(sprintf "%-0*X" 7 50000UL)) "C350 " + test "test3817" (lazy(sprintf "%+X" 50000UL)) "+C350" + test "test3818" (lazy(sprintf "%+5X" 50000UL)) "+C350" + test "test3819" (lazy(sprintf "%+1X" 50000UL)) "+C350" + test "test3820" (lazy(sprintf "%+*X" 7 50000UL)) " +C350" + test "test3821" (lazy(sprintf "%-+X" 50000UL)) "+C350" + test "test3822" (lazy(sprintf "%-+5X" 50000UL)) "+C350" + test "test3823" (lazy(sprintf "%-+1X" 50000UL)) "+C350" + test "test3824" (lazy(sprintf "%-+*X" 7 50000UL)) "+C350 " + test "test3825" (lazy(sprintf "%+0X" 50000UL)) "+C350" + test "test3826" (lazy(sprintf "%+05X" 50000UL)) "+C350" + test "test3827" (lazy(sprintf "%+01X" 50000UL)) "+C350" + test "test3828" (lazy(sprintf "%+0*X" 7 50000UL)) "+00C350" + test "test3829" (lazy(sprintf "%-+0X" 50000UL)) "+C350" + test "test3830" (lazy(sprintf "%-+05X" 50000UL)) "+C350" + test "test3831" (lazy(sprintf "%-+01X" 50000UL)) "+C350" + test "test3832" (lazy(sprintf "%-+0*X" 7 50000UL)) "+C350 " + test "test3833" (lazy(sprintf "% X" 50000UL)) " C350" + test "test3834" (lazy(sprintf "% 5X" 50000UL)) " C350" + test "test3835" (lazy(sprintf "% 1X" 50000UL)) " C350" + test "test3836" (lazy(sprintf "% *X" 7 50000UL)) " C350" + test "test3837" (lazy(sprintf "%- X" 50000UL)) " C350" + test "test3838" (lazy(sprintf "%- 5X" 50000UL)) " C350" + test "test3839" (lazy(sprintf "%- 1X" 50000UL)) " C350" + test "test3840" (lazy(sprintf "%- *X" 7 50000UL)) " C350 " + test "test3841" (lazy(sprintf "% 0X" 50000UL)) " C350" + test "test3842" (lazy(sprintf "% 05X" 50000UL)) " C350" + test "test3843" (lazy(sprintf "% 01X" 50000UL)) " C350" + test "test3844" (lazy(sprintf "% 0*X" 7 50000UL)) " 00C350" + test "test3845" (lazy(sprintf "%- 0X" 50000UL)) " C350" + test "test3846" (lazy(sprintf "%- 05X" 50000UL)) " C350" + test "test3847" (lazy(sprintf "%- 01X" 50000UL)) " C350" + test "test3848" (lazy(sprintf "%- 0*X" 7 50000UL)) " C350 " + test "test3849" (lazy(sprintf "%X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3850" (lazy(sprintf "%5X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3851" (lazy(sprintf "%1X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3852" (lazy(sprintf "%*X" 7 System.Int32.MaxValue)) "7FFFFFFF" + test "test3853" (lazy(sprintf "%-X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3854" (lazy(sprintf "%-5X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3855" (lazy(sprintf "%-1X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3856" (lazy(sprintf "%-*X" 7 System.Int32.MaxValue)) "7FFFFFFF" + test "test3857" (lazy(sprintf "%0X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3858" (lazy(sprintf "%05X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3859" (lazy(sprintf "%01X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3860" (lazy(sprintf "%0*X" 7 System.Int32.MaxValue)) "7FFFFFFF" + test "test3861" (lazy(sprintf "%-0X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3862" (lazy(sprintf "%-05X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3863" (lazy(sprintf "%-01X" System.Int32.MaxValue)) "7FFFFFFF" + test "test3864" (lazy(sprintf "%-0*X" 7 System.Int32.MaxValue)) "7FFFFFFF" + test "test3865" (lazy(sprintf "%+X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3866" (lazy(sprintf "%+5X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3867" (lazy(sprintf "%+1X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3868" (lazy(sprintf "%+*X" 7 System.Int32.MaxValue)) "+7FFFFFFF" + test "test3869" (lazy(sprintf "%-+X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3870" (lazy(sprintf "%-+5X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3871" (lazy(sprintf "%-+1X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3872" (lazy(sprintf "%-+*X" 7 System.Int32.MaxValue)) "+7FFFFFFF" + test "test3873" (lazy(sprintf "%+0X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3874" (lazy(sprintf "%+05X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3875" (lazy(sprintf "%+01X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3876" (lazy(sprintf "%+0*X" 7 System.Int32.MaxValue)) "+7FFFFFFF" + test "test3877" (lazy(sprintf "%-+0X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3878" (lazy(sprintf "%-+05X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3879" (lazy(sprintf "%-+01X" System.Int32.MaxValue)) "+7FFFFFFF" + test "test3880" (lazy(sprintf "%-+0*X" 7 System.Int32.MaxValue)) "+7FFFFFFF" + test "test3881" (lazy(sprintf "% X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3882" (lazy(sprintf "% 5X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3883" (lazy(sprintf "% 1X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3884" (lazy(sprintf "% *X" 7 System.Int32.MaxValue)) " 7FFFFFFF" + test "test3885" (lazy(sprintf "%- X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3886" (lazy(sprintf "%- 5X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3887" (lazy(sprintf "%- 1X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3888" (lazy(sprintf "%- *X" 7 System.Int32.MaxValue)) " 7FFFFFFF" + test "test3889" (lazy(sprintf "% 0X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3890" (lazy(sprintf "% 05X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3891" (lazy(sprintf "% 01X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3892" (lazy(sprintf "% 0*X" 7 System.Int32.MaxValue)) " 7FFFFFFF" + test "test3893" (lazy(sprintf "%- 0X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3894" (lazy(sprintf "%- 05X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3895" (lazy(sprintf "%- 01X" System.Int32.MaxValue)) " 7FFFFFFF" + test "test3896" (lazy(sprintf "%- 0*X" 7 System.Int32.MaxValue)) " 7FFFFFFF" + test "test3897" (lazy(sprintf "%X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3898" (lazy(sprintf "%5X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3899" (lazy(sprintf "%1X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3900" (lazy(sprintf "%*X" 7 System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3901" (lazy(sprintf "%-X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3902" (lazy(sprintf "%-5X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3903" (lazy(sprintf "%-1X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3904" (lazy(sprintf "%-*X" 7 System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3905" (lazy(sprintf "%0X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3906" (lazy(sprintf "%05X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3907" (lazy(sprintf "%01X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3908" (lazy(sprintf "%0*X" 7 System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3909" (lazy(sprintf "%-0X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3910" (lazy(sprintf "%-05X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3911" (lazy(sprintf "%-01X" System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3912" (lazy(sprintf "%-0*X" 7 System.Int64.MaxValue)) "7FFFFFFFFFFFFFFF" + test "test3913" (lazy(sprintf "%+X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3914" (lazy(sprintf "%+5X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3915" (lazy(sprintf "%+1X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3916" (lazy(sprintf "%+*X" 7 System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3917" (lazy(sprintf "%-+X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3918" (lazy(sprintf "%-+5X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3919" (lazy(sprintf "%-+1X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3920" (lazy(sprintf "%-+*X" 7 System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3921" (lazy(sprintf "%+0X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3922" (lazy(sprintf "%+05X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3923" (lazy(sprintf "%+01X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3924" (lazy(sprintf "%+0*X" 7 System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3925" (lazy(sprintf "%-+0X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3926" (lazy(sprintf "%-+05X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3927" (lazy(sprintf "%-+01X" System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3928" (lazy(sprintf "%-+0*X" 7 System.Int64.MaxValue)) "+7FFFFFFFFFFFFFFF" + test "test3929" (lazy(sprintf "% X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3930" (lazy(sprintf "% 5X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3931" (lazy(sprintf "% 1X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3932" (lazy(sprintf "% *X" 7 System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3933" (lazy(sprintf "%- X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3934" (lazy(sprintf "%- 5X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3935" (lazy(sprintf "%- 1X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3936" (lazy(sprintf "%- *X" 7 System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3937" (lazy(sprintf "% 0X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3938" (lazy(sprintf "% 05X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3939" (lazy(sprintf "% 01X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3940" (lazy(sprintf "% 0*X" 7 System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3941" (lazy(sprintf "%- 0X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3942" (lazy(sprintf "%- 05X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3943" (lazy(sprintf "%- 01X" System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3944" (lazy(sprintf "%- 0*X" 7 System.Int64.MaxValue)) " 7FFFFFFFFFFFFFFF" + test "test3945" (lazy(sprintf "%X" System.Int32.MinValue)) "80000000" + test "test3946" (lazy(sprintf "%5X" System.Int32.MinValue)) "80000000" + test "test3947" (lazy(sprintf "%1X" System.Int32.MinValue)) "80000000" + test "test3948" (lazy(sprintf "%*X" 7 System.Int32.MinValue)) "80000000" + test "test3949" (lazy(sprintf "%-X" System.Int32.MinValue)) "80000000" + test "test3950" (lazy(sprintf "%-5X" System.Int32.MinValue)) "80000000" + test "test3951" (lazy(sprintf "%-1X" System.Int32.MinValue)) "80000000" + test "test3952" (lazy(sprintf "%-*X" 7 System.Int32.MinValue)) "80000000" + test "test3953" (lazy(sprintf "%0X" System.Int32.MinValue)) "80000000" + test "test3954" (lazy(sprintf "%05X" System.Int32.MinValue)) "80000000" + test "test3955" (lazy(sprintf "%01X" System.Int32.MinValue)) "80000000" + test "test3956" (lazy(sprintf "%0*X" 7 System.Int32.MinValue)) "80000000" + test "test3957" (lazy(sprintf "%-0X" System.Int32.MinValue)) "80000000" + test "test3958" (lazy(sprintf "%-05X" System.Int32.MinValue)) "80000000" + test "test3959" (lazy(sprintf "%-01X" System.Int32.MinValue)) "80000000" + test "test3960" (lazy(sprintf "%-0*X" 7 System.Int32.MinValue)) "80000000" + test "test3961" (lazy(sprintf "%+X" System.Int32.MinValue)) "+80000000" + test "test3962" (lazy(sprintf "%+5X" System.Int32.MinValue)) "+80000000" + test "test3963" (lazy(sprintf "%+1X" System.Int32.MinValue)) "+80000000" + test "test3964" (lazy(sprintf "%+*X" 7 System.Int32.MinValue)) "+80000000" + test "test3965" (lazy(sprintf "%-+X" System.Int32.MinValue)) "+80000000" + test "test3966" (lazy(sprintf "%-+5X" System.Int32.MinValue)) "+80000000" + test "test3967" (lazy(sprintf "%-+1X" System.Int32.MinValue)) "+80000000" + test "test3968" (lazy(sprintf "%-+*X" 7 System.Int32.MinValue)) "+80000000" + test "test3969" (lazy(sprintf "%+0X" System.Int32.MinValue)) "+80000000" + test "test3970" (lazy(sprintf "%+05X" System.Int32.MinValue)) "+80000000" + test "test3971" (lazy(sprintf "%+01X" System.Int32.MinValue)) "+80000000" + test "test3972" (lazy(sprintf "%+0*X" 7 System.Int32.MinValue)) "+80000000" + test "test3973" (lazy(sprintf "%-+0X" System.Int32.MinValue)) "+80000000" + test "test3974" (lazy(sprintf "%-+05X" System.Int32.MinValue)) "+80000000" + test "test3975" (lazy(sprintf "%-+01X" System.Int32.MinValue)) "+80000000" + test "test3976" (lazy(sprintf "%-+0*X" 7 System.Int32.MinValue)) "+80000000" + test "test3977" (lazy(sprintf "% X" System.Int32.MinValue)) " 80000000" + test "test3978" (lazy(sprintf "% 5X" System.Int32.MinValue)) " 80000000" + test "test3979" (lazy(sprintf "% 1X" System.Int32.MinValue)) " 80000000" + test "test3980" (lazy(sprintf "% *X" 7 System.Int32.MinValue)) " 80000000" + test "test3981" (lazy(sprintf "%- X" System.Int32.MinValue)) " 80000000" + test "test3982" (lazy(sprintf "%- 5X" System.Int32.MinValue)) " 80000000" + test "test3983" (lazy(sprintf "%- 1X" System.Int32.MinValue)) " 80000000" + test "test3984" (lazy(sprintf "%- *X" 7 System.Int32.MinValue)) " 80000000" + test "test3985" (lazy(sprintf "% 0X" System.Int32.MinValue)) " 80000000" + test "test3986" (lazy(sprintf "% 05X" System.Int32.MinValue)) " 80000000" + test "test3987" (lazy(sprintf "% 01X" System.Int32.MinValue)) " 80000000" + test "test3988" (lazy(sprintf "% 0*X" 7 System.Int32.MinValue)) " 80000000" + test "test3989" (lazy(sprintf "%- 0X" System.Int32.MinValue)) " 80000000" + test "test3990" (lazy(sprintf "%- 05X" System.Int32.MinValue)) " 80000000" + test "test3991" (lazy(sprintf "%- 01X" System.Int32.MinValue)) " 80000000" + test "test3992" (lazy(sprintf "%- 0*X" 7 System.Int32.MinValue)) " 80000000" + test "test3993" (lazy(sprintf "%X" System.Int64.MinValue)) "8000000000000000" + test "test3994" (lazy(sprintf "%5X" System.Int64.MinValue)) "8000000000000000" + test "test3995" (lazy(sprintf "%1X" System.Int64.MinValue)) "8000000000000000" + test "test3996" (lazy(sprintf "%*X" 7 System.Int64.MinValue)) "8000000000000000" + test "test3997" (lazy(sprintf "%-X" System.Int64.MinValue)) "8000000000000000" + test "test3998" (lazy(sprintf "%-5X" System.Int64.MinValue)) "8000000000000000" + test "test3999" (lazy(sprintf "%-1X" System.Int64.MinValue)) "8000000000000000" + test "test4000" (lazy(sprintf "%-*X" 7 System.Int64.MinValue)) "8000000000000000" +let func4000()= + test "test4001" (lazy(sprintf "%0X" System.Int64.MinValue)) "8000000000000000" + test "test4002" (lazy(sprintf "%05X" System.Int64.MinValue)) "8000000000000000" + test "test4003" (lazy(sprintf "%01X" System.Int64.MinValue)) "8000000000000000" + test "test4004" (lazy(sprintf "%0*X" 7 System.Int64.MinValue)) "8000000000000000" + test "test4005" (lazy(sprintf "%-0X" System.Int64.MinValue)) "8000000000000000" + test "test4006" (lazy(sprintf "%-05X" System.Int64.MinValue)) "8000000000000000" + test "test4007" (lazy(sprintf "%-01X" System.Int64.MinValue)) "8000000000000000" + test "test4008" (lazy(sprintf "%-0*X" 7 System.Int64.MinValue)) "8000000000000000" + test "test4009" (lazy(sprintf "%+X" System.Int64.MinValue)) "+8000000000000000" + test "test4010" (lazy(sprintf "%+5X" System.Int64.MinValue)) "+8000000000000000" + test "test4011" (lazy(sprintf "%+1X" System.Int64.MinValue)) "+8000000000000000" + test "test4012" (lazy(sprintf "%+*X" 7 System.Int64.MinValue)) "+8000000000000000" + test "test4013" (lazy(sprintf "%-+X" System.Int64.MinValue)) "+8000000000000000" + test "test4014" (lazy(sprintf "%-+5X" System.Int64.MinValue)) "+8000000000000000" + test "test4015" (lazy(sprintf "%-+1X" System.Int64.MinValue)) "+8000000000000000" + test "test4016" (lazy(sprintf "%-+*X" 7 System.Int64.MinValue)) "+8000000000000000" + test "test4017" (lazy(sprintf "%+0X" System.Int64.MinValue)) "+8000000000000000" + test "test4018" (lazy(sprintf "%+05X" System.Int64.MinValue)) "+8000000000000000" + test "test4019" (lazy(sprintf "%+01X" System.Int64.MinValue)) "+8000000000000000" + test "test4020" (lazy(sprintf "%+0*X" 7 System.Int64.MinValue)) "+8000000000000000" + test "test4021" (lazy(sprintf "%-+0X" System.Int64.MinValue)) "+8000000000000000" + test "test4022" (lazy(sprintf "%-+05X" System.Int64.MinValue)) "+8000000000000000" + test "test4023" (lazy(sprintf "%-+01X" System.Int64.MinValue)) "+8000000000000000" + test "test4024" (lazy(sprintf "%-+0*X" 7 System.Int64.MinValue)) "+8000000000000000" + test "test4025" (lazy(sprintf "% X" System.Int64.MinValue)) " 8000000000000000" + test "test4026" (lazy(sprintf "% 5X" System.Int64.MinValue)) " 8000000000000000" + test "test4027" (lazy(sprintf "% 1X" System.Int64.MinValue)) " 8000000000000000" + test "test4028" (lazy(sprintf "% *X" 7 System.Int64.MinValue)) " 8000000000000000" + test "test4029" (lazy(sprintf "%- X" System.Int64.MinValue)) " 8000000000000000" + test "test4030" (lazy(sprintf "%- 5X" System.Int64.MinValue)) " 8000000000000000" + test "test4031" (lazy(sprintf "%- 1X" System.Int64.MinValue)) " 8000000000000000" + test "test4032" (lazy(sprintf "%- *X" 7 System.Int64.MinValue)) " 8000000000000000" + test "test4033" (lazy(sprintf "% 0X" System.Int64.MinValue)) " 8000000000000000" + test "test4034" (lazy(sprintf "% 05X" System.Int64.MinValue)) " 8000000000000000" + test "test4035" (lazy(sprintf "% 01X" System.Int64.MinValue)) " 8000000000000000" + test "test4036" (lazy(sprintf "% 0*X" 7 System.Int64.MinValue)) " 8000000000000000" + test "test4037" (lazy(sprintf "%- 0X" System.Int64.MinValue)) " 8000000000000000" + test "test4038" (lazy(sprintf "%- 05X" System.Int64.MinValue)) " 8000000000000000" + test "test4039" (lazy(sprintf "%- 01X" System.Int64.MinValue)) " 8000000000000000" + test "test4040" (lazy(sprintf "%- 0*X" 7 System.Int64.MinValue)) " 8000000000000000" + test "test4041" (lazy(sprintf "%X" 55n)) "37" + test "test4042" (lazy(sprintf "%5X" 55n)) " 37" + test "test4043" (lazy(sprintf "%1X" 55n)) "37" + test "test4044" (lazy(sprintf "%*X" 7 55n)) " 37" + test "test4045" (lazy(sprintf "%-X" 55n)) "37" + test "test4046" (lazy(sprintf "%-5X" 55n)) "37 " + test "test4047" (lazy(sprintf "%-1X" 55n)) "37" + test "test4048" (lazy(sprintf "%-*X" 7 55n)) "37 " + test "test4049" (lazy(sprintf "%0X" 55n)) "37" + test "test4050" (lazy(sprintf "%05X" 55n)) "00037" + test "test4051" (lazy(sprintf "%01X" 55n)) "37" + test "test4052" (lazy(sprintf "%0*X" 7 55n)) "0000037" + test "test4053" (lazy(sprintf "%-0X" 55n)) "37" + test "test4054" (lazy(sprintf "%-05X" 55n)) "37 " + test "test4055" (lazy(sprintf "%-01X" 55n)) "37" + test "test4056" (lazy(sprintf "%-0*X" 7 55n)) "37 " + test "test4057" (lazy(sprintf "%+X" 55n)) "+37" + test "test4058" (lazy(sprintf "%+5X" 55n)) " +37" + test "test4059" (lazy(sprintf "%+1X" 55n)) "+37" + test "test4060" (lazy(sprintf "%+*X" 7 55n)) " +37" + test "test4061" (lazy(sprintf "%-+X" 55n)) "+37" + test "test4062" (lazy(sprintf "%-+5X" 55n)) "+37 " + test "test4063" (lazy(sprintf "%-+1X" 55n)) "+37" + test "test4064" (lazy(sprintf "%-+*X" 7 55n)) "+37 " + test "test4065" (lazy(sprintf "%+0X" 55n)) "+37" + test "test4066" (lazy(sprintf "%+05X" 55n)) "+0037" + test "test4067" (lazy(sprintf "%+01X" 55n)) "+37" + test "test4068" (lazy(sprintf "%+0*X" 7 55n)) "+000037" + test "test4069" (lazy(sprintf "%-+0X" 55n)) "+37" + test "test4070" (lazy(sprintf "%-+05X" 55n)) "+37 " + test "test4071" (lazy(sprintf "%-+01X" 55n)) "+37" + test "test4072" (lazy(sprintf "%-+0*X" 7 55n)) "+37 " + test "test4073" (lazy(sprintf "% X" 55n)) " 37" + test "test4074" (lazy(sprintf "% 5X" 55n)) " 37" + test "test4075" (lazy(sprintf "% 1X" 55n)) " 37" + test "test4076" (lazy(sprintf "% *X" 7 55n)) " 37" + test "test4077" (lazy(sprintf "%- X" 55n)) " 37" + test "test4078" (lazy(sprintf "%- 5X" 55n)) " 37 " + test "test4079" (lazy(sprintf "%- 1X" 55n)) " 37" + test "test4080" (lazy(sprintf "%- *X" 7 55n)) " 37 " + test "test4081" (lazy(sprintf "% 0X" 55n)) " 37" + test "test4082" (lazy(sprintf "% 05X" 55n)) " 0037" + test "test4083" (lazy(sprintf "% 01X" 55n)) " 37" + test "test4084" (lazy(sprintf "% 0*X" 7 55n)) " 000037" + test "test4085" (lazy(sprintf "%- 0X" 55n)) " 37" + test "test4086" (lazy(sprintf "%- 05X" 55n)) " 37 " + test "test4087" (lazy(sprintf "%- 01X" 55n)) " 37" + test "test4088" (lazy(sprintf "%- 0*X" 7 55n)) " 37 " + test "test4089" (lazy(sprintf "%X" 999un)) "3E7" + test "test4090" (lazy(sprintf "%5X" 999un)) " 3E7" + test "test4091" (lazy(sprintf "%1X" 999un)) "3E7" + test "test4092" (lazy(sprintf "%*X" 7 999un)) " 3E7" + test "test4093" (lazy(sprintf "%-X" 999un)) "3E7" + test "test4094" (lazy(sprintf "%-5X" 999un)) "3E7 " + test "test4095" (lazy(sprintf "%-1X" 999un)) "3E7" + test "test4096" (lazy(sprintf "%-*X" 7 999un)) "3E7 " + test "test4097" (lazy(sprintf "%0X" 999un)) "3E7" + test "test4098" (lazy(sprintf "%05X" 999un)) "003E7" + test "test4099" (lazy(sprintf "%01X" 999un)) "3E7" + test "test4100" (lazy(sprintf "%0*X" 7 999un)) "00003E7" + test "test4101" (lazy(sprintf "%-0X" 999un)) "3E7" + test "test4102" (lazy(sprintf "%-05X" 999un)) "3E7 " + test "test4103" (lazy(sprintf "%-01X" 999un)) "3E7" + test "test4104" (lazy(sprintf "%-0*X" 7 999un)) "3E7 " + test "test4105" (lazy(sprintf "%+X" 999un)) "+3E7" + test "test4106" (lazy(sprintf "%+5X" 999un)) " +3E7" + test "test4107" (lazy(sprintf "%+1X" 999un)) "+3E7" + test "test4108" (lazy(sprintf "%+*X" 7 999un)) " +3E7" + test "test4109" (lazy(sprintf "%-+X" 999un)) "+3E7" + test "test4110" (lazy(sprintf "%-+5X" 999un)) "+3E7 " + test "test4111" (lazy(sprintf "%-+1X" 999un)) "+3E7" + test "test4112" (lazy(sprintf "%-+*X" 7 999un)) "+3E7 " + test "test4113" (lazy(sprintf "%+0X" 999un)) "+3E7" + test "test4114" (lazy(sprintf "%+05X" 999un)) "+03E7" + test "test4115" (lazy(sprintf "%+01X" 999un)) "+3E7" + test "test4116" (lazy(sprintf "%+0*X" 7 999un)) "+0003E7" + test "test4117" (lazy(sprintf "%-+0X" 999un)) "+3E7" + test "test4118" (lazy(sprintf "%-+05X" 999un)) "+3E7 " + test "test4119" (lazy(sprintf "%-+01X" 999un)) "+3E7" + test "test4120" (lazy(sprintf "%-+0*X" 7 999un)) "+3E7 " + test "test4121" (lazy(sprintf "% X" 999un)) " 3E7" + test "test4122" (lazy(sprintf "% 5X" 999un)) " 3E7" + test "test4123" (lazy(sprintf "% 1X" 999un)) " 3E7" + test "test4124" (lazy(sprintf "% *X" 7 999un)) " 3E7" + test "test4125" (lazy(sprintf "%- X" 999un)) " 3E7" + test "test4126" (lazy(sprintf "%- 5X" 999un)) " 3E7 " + test "test4127" (lazy(sprintf "%- 1X" 999un)) " 3E7" + test "test4128" (lazy(sprintf "%- *X" 7 999un)) " 3E7 " + test "test4129" (lazy(sprintf "% 0X" 999un)) " 3E7" + test "test4130" (lazy(sprintf "% 05X" 999un)) " 03E7" + test "test4131" (lazy(sprintf "% 01X" 999un)) " 3E7" + test "test4132" (lazy(sprintf "% 0*X" 7 999un)) " 0003E7" + test "test4133" (lazy(sprintf "%- 0X" 999un)) " 3E7" + test "test4134" (lazy(sprintf "%- 05X" 999un)) " 3E7 " + test "test4135" (lazy(sprintf "%- 01X" 999un)) " 3E7" + test "test4136" (lazy(sprintf "%- 0*X" 7 999un)) " 3E7 " + test "test4137" (lazy(sprintf "%o" 14)) "16" + test "test4138" (lazy(sprintf "%5o" 14)) " 16" + test "test4139" (lazy(sprintf "%1o" 14)) "16" + test "test4140" (lazy(sprintf "%*o" 7 14)) " 16" + test "test4141" (lazy(sprintf "%-o" 14)) "16" + test "test4142" (lazy(sprintf "%-5o" 14)) "16 " + test "test4143" (lazy(sprintf "%-1o" 14)) "16" + test "test4144" (lazy(sprintf "%-*o" 7 14)) "16 " + test "test4145" (lazy(sprintf "%0o" 14)) "16" + test "test4146" (lazy(sprintf "%05o" 14)) "00016" + test "test4147" (lazy(sprintf "%01o" 14)) "16" + test "test4148" (lazy(sprintf "%0*o" 7 14)) "0000016" + test "test4149" (lazy(sprintf "%-0o" 14)) "16" + test "test4150" (lazy(sprintf "%-05o" 14)) "16 " + test "test4151" (lazy(sprintf "%-01o" 14)) "16" + test "test4152" (lazy(sprintf "%-0*o" 7 14)) "16 " + test "test4153" (lazy(sprintf "%+o" 14)) "+16" + test "test4154" (lazy(sprintf "%+5o" 14)) " +16" + test "test4155" (lazy(sprintf "%+1o" 14)) "+16" + test "test4156" (lazy(sprintf "%+*o" 7 14)) " +16" + test "test4157" (lazy(sprintf "%-+o" 14)) "+16" + test "test4158" (lazy(sprintf "%-+5o" 14)) "+16 " + test "test4159" (lazy(sprintf "%-+1o" 14)) "+16" + test "test4160" (lazy(sprintf "%-+*o" 7 14)) "+16 " + test "test4161" (lazy(sprintf "%+0o" 14)) "+16" + test "test4162" (lazy(sprintf "%+05o" 14)) "+0016" + test "test4163" (lazy(sprintf "%+01o" 14)) "+16" + test "test4164" (lazy(sprintf "%+0*o" 7 14)) "+000016" + test "test4165" (lazy(sprintf "%-+0o" 14)) "+16" + test "test4166" (lazy(sprintf "%-+05o" 14)) "+16 " + test "test4167" (lazy(sprintf "%-+01o" 14)) "+16" + test "test4168" (lazy(sprintf "%-+0*o" 7 14)) "+16 " + test "test4169" (lazy(sprintf "% o" 14)) " 16" + test "test4170" (lazy(sprintf "% 5o" 14)) " 16" + test "test4171" (lazy(sprintf "% 1o" 14)) " 16" + test "test4172" (lazy(sprintf "% *o" 7 14)) " 16" + test "test4173" (lazy(sprintf "%- o" 14)) " 16" + test "test4174" (lazy(sprintf "%- 5o" 14)) " 16 " + test "test4175" (lazy(sprintf "%- 1o" 14)) " 16" + test "test4176" (lazy(sprintf "%- *o" 7 14)) " 16 " + test "test4177" (lazy(sprintf "% 0o" 14)) " 16" + test "test4178" (lazy(sprintf "% 05o" 14)) " 0016" + test "test4179" (lazy(sprintf "% 01o" 14)) " 16" + test "test4180" (lazy(sprintf "% 0*o" 7 14)) " 000016" + test "test4181" (lazy(sprintf "%- 0o" 14)) " 16" + test "test4182" (lazy(sprintf "%- 05o" 14)) " 16 " + test "test4183" (lazy(sprintf "%- 01o" 14)) " 16" + test "test4184" (lazy(sprintf "%- 0*o" 7 14)) " 16 " + test "test4185" (lazy(sprintf "%o" -10)) "37777777766" + test "test4186" (lazy(sprintf "%5o" -10)) "37777777766" + test "test4187" (lazy(sprintf "%1o" -10)) "37777777766" + test "test4188" (lazy(sprintf "%*o" 7 -10)) "37777777766" + test "test4189" (lazy(sprintf "%-o" -10)) "37777777766" + test "test4190" (lazy(sprintf "%-5o" -10)) "37777777766" + test "test4191" (lazy(sprintf "%-1o" -10)) "37777777766" + test "test4192" (lazy(sprintf "%-*o" 7 -10)) "37777777766" + test "test4193" (lazy(sprintf "%0o" -10)) "37777777766" + test "test4194" (lazy(sprintf "%05o" -10)) "37777777766" + test "test4195" (lazy(sprintf "%01o" -10)) "37777777766" + test "test4196" (lazy(sprintf "%0*o" 7 -10)) "37777777766" + test "test4197" (lazy(sprintf "%-0o" -10)) "37777777766" + test "test4198" (lazy(sprintf "%-05o" -10)) "37777777766" + test "test4199" (lazy(sprintf "%-01o" -10)) "37777777766" + test "test4200" (lazy(sprintf "%-0*o" 7 -10)) "37777777766" + test "test4201" (lazy(sprintf "%+o" -10)) "+37777777766" + test "test4202" (lazy(sprintf "%+5o" -10)) "+37777777766" + test "test4203" (lazy(sprintf "%+1o" -10)) "+37777777766" + test "test4204" (lazy(sprintf "%+*o" 7 -10)) "+37777777766" + test "test4205" (lazy(sprintf "%-+o" -10)) "+37777777766" + test "test4206" (lazy(sprintf "%-+5o" -10)) "+37777777766" + test "test4207" (lazy(sprintf "%-+1o" -10)) "+37777777766" + test "test4208" (lazy(sprintf "%-+*o" 7 -10)) "+37777777766" + test "test4209" (lazy(sprintf "%+0o" -10)) "+37777777766" + test "test4210" (lazy(sprintf "%+05o" -10)) "+37777777766" + test "test4211" (lazy(sprintf "%+01o" -10)) "+37777777766" + test "test4212" (lazy(sprintf "%+0*o" 7 -10)) "+37777777766" + test "test4213" (lazy(sprintf "%-+0o" -10)) "+37777777766" + test "test4214" (lazy(sprintf "%-+05o" -10)) "+37777777766" + test "test4215" (lazy(sprintf "%-+01o" -10)) "+37777777766" + test "test4216" (lazy(sprintf "%-+0*o" 7 -10)) "+37777777766" + test "test4217" (lazy(sprintf "% o" -10)) " 37777777766" + test "test4218" (lazy(sprintf "% 5o" -10)) " 37777777766" + test "test4219" (lazy(sprintf "% 1o" -10)) " 37777777766" + test "test4220" (lazy(sprintf "% *o" 7 -10)) " 37777777766" + test "test4221" (lazy(sprintf "%- o" -10)) " 37777777766" + test "test4222" (lazy(sprintf "%- 5o" -10)) " 37777777766" + test "test4223" (lazy(sprintf "%- 1o" -10)) " 37777777766" + test "test4224" (lazy(sprintf "%- *o" 7 -10)) " 37777777766" + test "test4225" (lazy(sprintf "% 0o" -10)) " 37777777766" + test "test4226" (lazy(sprintf "% 05o" -10)) " 37777777766" + test "test4227" (lazy(sprintf "% 01o" -10)) " 37777777766" + test "test4228" (lazy(sprintf "% 0*o" 7 -10)) " 37777777766" + test "test4229" (lazy(sprintf "%- 0o" -10)) " 37777777766" + test "test4230" (lazy(sprintf "%- 05o" -10)) " 37777777766" + test "test4231" (lazy(sprintf "%- 01o" -10)) " 37777777766" + test "test4232" (lazy(sprintf "%- 0*o" 7 -10)) " 37777777766" + test "test4233" (lazy(sprintf "%o" 55s)) "67" + test "test4234" (lazy(sprintf "%5o" 55s)) " 67" + test "test4235" (lazy(sprintf "%1o" 55s)) "67" + test "test4236" (lazy(sprintf "%*o" 7 55s)) " 67" + test "test4237" (lazy(sprintf "%-o" 55s)) "67" + test "test4238" (lazy(sprintf "%-5o" 55s)) "67 " + test "test4239" (lazy(sprintf "%-1o" 55s)) "67" + test "test4240" (lazy(sprintf "%-*o" 7 55s)) "67 " + test "test4241" (lazy(sprintf "%0o" 55s)) "67" + test "test4242" (lazy(sprintf "%05o" 55s)) "00067" + test "test4243" (lazy(sprintf "%01o" 55s)) "67" + test "test4244" (lazy(sprintf "%0*o" 7 55s)) "0000067" + test "test4245" (lazy(sprintf "%-0o" 55s)) "67" + test "test4246" (lazy(sprintf "%-05o" 55s)) "67 " + test "test4247" (lazy(sprintf "%-01o" 55s)) "67" + test "test4248" (lazy(sprintf "%-0*o" 7 55s)) "67 " + test "test4249" (lazy(sprintf "%+o" 55s)) "+67" + test "test4250" (lazy(sprintf "%+5o" 55s)) " +67" + test "test4251" (lazy(sprintf "%+1o" 55s)) "+67" + test "test4252" (lazy(sprintf "%+*o" 7 55s)) " +67" + test "test4253" (lazy(sprintf "%-+o" 55s)) "+67" + test "test4254" (lazy(sprintf "%-+5o" 55s)) "+67 " + test "test4255" (lazy(sprintf "%-+1o" 55s)) "+67" + test "test4256" (lazy(sprintf "%-+*o" 7 55s)) "+67 " + test "test4257" (lazy(sprintf "%+0o" 55s)) "+67" + test "test4258" (lazy(sprintf "%+05o" 55s)) "+0067" + test "test4259" (lazy(sprintf "%+01o" 55s)) "+67" + test "test4260" (lazy(sprintf "%+0*o" 7 55s)) "+000067" + test "test4261" (lazy(sprintf "%-+0o" 55s)) "+67" + test "test4262" (lazy(sprintf "%-+05o" 55s)) "+67 " + test "test4263" (lazy(sprintf "%-+01o" 55s)) "+67" + test "test4264" (lazy(sprintf "%-+0*o" 7 55s)) "+67 " + test "test4265" (lazy(sprintf "% o" 55s)) " 67" + test "test4266" (lazy(sprintf "% 5o" 55s)) " 67" + test "test4267" (lazy(sprintf "% 1o" 55s)) " 67" + test "test4268" (lazy(sprintf "% *o" 7 55s)) " 67" + test "test4269" (lazy(sprintf "%- o" 55s)) " 67" + test "test4270" (lazy(sprintf "%- 5o" 55s)) " 67 " + test "test4271" (lazy(sprintf "%- 1o" 55s)) " 67" + test "test4272" (lazy(sprintf "%- *o" 7 55s)) " 67 " + test "test4273" (lazy(sprintf "% 0o" 55s)) " 67" + test "test4274" (lazy(sprintf "% 05o" 55s)) " 0067" + test "test4275" (lazy(sprintf "% 01o" 55s)) " 67" + test "test4276" (lazy(sprintf "% 0*o" 7 55s)) " 000067" + test "test4277" (lazy(sprintf "%- 0o" 55s)) " 67" + test "test4278" (lazy(sprintf "%- 05o" 55s)) " 67 " + test "test4279" (lazy(sprintf "%- 01o" 55s)) " 67" + test "test4280" (lazy(sprintf "%- 0*o" 7 55s)) " 67 " + test "test4281" (lazy(sprintf "%o" -88s)) "177650" + test "test4282" (lazy(sprintf "%5o" -88s)) "177650" + test "test4283" (lazy(sprintf "%1o" -88s)) "177650" + test "test4284" (lazy(sprintf "%*o" 7 -88s)) " 177650" + test "test4285" (lazy(sprintf "%-o" -88s)) "177650" + test "test4286" (lazy(sprintf "%-5o" -88s)) "177650" + test "test4287" (lazy(sprintf "%-1o" -88s)) "177650" + test "test4288" (lazy(sprintf "%-*o" 7 -88s)) "177650 " + test "test4289" (lazy(sprintf "%0o" -88s)) "177650" + test "test4290" (lazy(sprintf "%05o" -88s)) "177650" + test "test4291" (lazy(sprintf "%01o" -88s)) "177650" + test "test4292" (lazy(sprintf "%0*o" 7 -88s)) "0177650" + test "test4293" (lazy(sprintf "%-0o" -88s)) "177650" + test "test4294" (lazy(sprintf "%-05o" -88s)) "177650" + test "test4295" (lazy(sprintf "%-01o" -88s)) "177650" + test "test4296" (lazy(sprintf "%-0*o" 7 -88s)) "177650 " + test "test4297" (lazy(sprintf "%+o" -88s)) "+177650" + test "test4298" (lazy(sprintf "%+5o" -88s)) "+177650" + test "test4299" (lazy(sprintf "%+1o" -88s)) "+177650" + test "test4300" (lazy(sprintf "%+*o" 7 -88s)) "+177650" + test "test4301" (lazy(sprintf "%-+o" -88s)) "+177650" + test "test4302" (lazy(sprintf "%-+5o" -88s)) "+177650" + test "test4303" (lazy(sprintf "%-+1o" -88s)) "+177650" + test "test4304" (lazy(sprintf "%-+*o" 7 -88s)) "+177650" + test "test4305" (lazy(sprintf "%+0o" -88s)) "+177650" + test "test4306" (lazy(sprintf "%+05o" -88s)) "+177650" + test "test4307" (lazy(sprintf "%+01o" -88s)) "+177650" + test "test4308" (lazy(sprintf "%+0*o" 7 -88s)) "+177650" + test "test4309" (lazy(sprintf "%-+0o" -88s)) "+177650" + test "test4310" (lazy(sprintf "%-+05o" -88s)) "+177650" + test "test4311" (lazy(sprintf "%-+01o" -88s)) "+177650" + test "test4312" (lazy(sprintf "%-+0*o" 7 -88s)) "+177650" + test "test4313" (lazy(sprintf "% o" -88s)) " 177650" + test "test4314" (lazy(sprintf "% 5o" -88s)) " 177650" + test "test4315" (lazy(sprintf "% 1o" -88s)) " 177650" + test "test4316" (lazy(sprintf "% *o" 7 -88s)) " 177650" + test "test4317" (lazy(sprintf "%- o" -88s)) " 177650" + test "test4318" (lazy(sprintf "%- 5o" -88s)) " 177650" + test "test4319" (lazy(sprintf "%- 1o" -88s)) " 177650" + test "test4320" (lazy(sprintf "%- *o" 7 -88s)) " 177650" + test "test4321" (lazy(sprintf "% 0o" -88s)) " 177650" + test "test4322" (lazy(sprintf "% 05o" -88s)) " 177650" + test "test4323" (lazy(sprintf "% 01o" -88s)) " 177650" + test "test4324" (lazy(sprintf "% 0*o" 7 -88s)) " 177650" + test "test4325" (lazy(sprintf "%- 0o" -88s)) " 177650" + test "test4326" (lazy(sprintf "%- 05o" -88s)) " 177650" + test "test4327" (lazy(sprintf "%- 01o" -88s)) " 177650" + test "test4328" (lazy(sprintf "%- 0*o" 7 -88s)) " 177650" + test "test4329" (lazy(sprintf "%o" 104us)) "150" + test "test4330" (lazy(sprintf "%5o" 104us)) " 150" + test "test4331" (lazy(sprintf "%1o" 104us)) "150" + test "test4332" (lazy(sprintf "%*o" 7 104us)) " 150" + test "test4333" (lazy(sprintf "%-o" 104us)) "150" + test "test4334" (lazy(sprintf "%-5o" 104us)) "150 " + test "test4335" (lazy(sprintf "%-1o" 104us)) "150" + test "test4336" (lazy(sprintf "%-*o" 7 104us)) "150 " + test "test4337" (lazy(sprintf "%0o" 104us)) "150" + test "test4338" (lazy(sprintf "%05o" 104us)) "00150" + test "test4339" (lazy(sprintf "%01o" 104us)) "150" + test "test4340" (lazy(sprintf "%0*o" 7 104us)) "0000150" + test "test4341" (lazy(sprintf "%-0o" 104us)) "150" + test "test4342" (lazy(sprintf "%-05o" 104us)) "150 " + test "test4343" (lazy(sprintf "%-01o" 104us)) "150" + test "test4344" (lazy(sprintf "%-0*o" 7 104us)) "150 " + test "test4345" (lazy(sprintf "%+o" 104us)) "+150" + test "test4346" (lazy(sprintf "%+5o" 104us)) " +150" + test "test4347" (lazy(sprintf "%+1o" 104us)) "+150" + test "test4348" (lazy(sprintf "%+*o" 7 104us)) " +150" + test "test4349" (lazy(sprintf "%-+o" 104us)) "+150" + test "test4350" (lazy(sprintf "%-+5o" 104us)) "+150 " + test "test4351" (lazy(sprintf "%-+1o" 104us)) "+150" + test "test4352" (lazy(sprintf "%-+*o" 7 104us)) "+150 " + test "test4353" (lazy(sprintf "%+0o" 104us)) "+150" + test "test4354" (lazy(sprintf "%+05o" 104us)) "+0150" + test "test4355" (lazy(sprintf "%+01o" 104us)) "+150" + test "test4356" (lazy(sprintf "%+0*o" 7 104us)) "+000150" + test "test4357" (lazy(sprintf "%-+0o" 104us)) "+150" + test "test4358" (lazy(sprintf "%-+05o" 104us)) "+150 " + test "test4359" (lazy(sprintf "%-+01o" 104us)) "+150" + test "test4360" (lazy(sprintf "%-+0*o" 7 104us)) "+150 " + test "test4361" (lazy(sprintf "% o" 104us)) " 150" + test "test4362" (lazy(sprintf "% 5o" 104us)) " 150" + test "test4363" (lazy(sprintf "% 1o" 104us)) " 150" + test "test4364" (lazy(sprintf "% *o" 7 104us)) " 150" + test "test4365" (lazy(sprintf "%- o" 104us)) " 150" + test "test4366" (lazy(sprintf "%- 5o" 104us)) " 150 " + test "test4367" (lazy(sprintf "%- 1o" 104us)) " 150" + test "test4368" (lazy(sprintf "%- *o" 7 104us)) " 150 " + test "test4369" (lazy(sprintf "% 0o" 104us)) " 150" + test "test4370" (lazy(sprintf "% 05o" 104us)) " 0150" + test "test4371" (lazy(sprintf "% 01o" 104us)) " 150" + test "test4372" (lazy(sprintf "% 0*o" 7 104us)) " 000150" + test "test4373" (lazy(sprintf "%- 0o" 104us)) " 150" + test "test4374" (lazy(sprintf "%- 05o" 104us)) " 150 " + test "test4375" (lazy(sprintf "%- 01o" 104us)) " 150" + test "test4376" (lazy(sprintf "%- 0*o" 7 104us)) " 150 " + test "test4377" (lazy(sprintf "%o" 12y)) "14" + test "test4378" (lazy(sprintf "%5o" 12y)) " 14" + test "test4379" (lazy(sprintf "%1o" 12y)) "14" + test "test4380" (lazy(sprintf "%*o" 7 12y)) " 14" + test "test4381" (lazy(sprintf "%-o" 12y)) "14" + test "test4382" (lazy(sprintf "%-5o" 12y)) "14 " + test "test4383" (lazy(sprintf "%-1o" 12y)) "14" + test "test4384" (lazy(sprintf "%-*o" 7 12y)) "14 " + test "test4385" (lazy(sprintf "%0o" 12y)) "14" + test "test4386" (lazy(sprintf "%05o" 12y)) "00014" + test "test4387" (lazy(sprintf "%01o" 12y)) "14" + test "test4388" (lazy(sprintf "%0*o" 7 12y)) "0000014" + test "test4389" (lazy(sprintf "%-0o" 12y)) "14" + test "test4390" (lazy(sprintf "%-05o" 12y)) "14 " + test "test4391" (lazy(sprintf "%-01o" 12y)) "14" + test "test4392" (lazy(sprintf "%-0*o" 7 12y)) "14 " + test "test4393" (lazy(sprintf "%+o" 12y)) "+14" + test "test4394" (lazy(sprintf "%+5o" 12y)) " +14" + test "test4395" (lazy(sprintf "%+1o" 12y)) "+14" + test "test4396" (lazy(sprintf "%+*o" 7 12y)) " +14" + test "test4397" (lazy(sprintf "%-+o" 12y)) "+14" + test "test4398" (lazy(sprintf "%-+5o" 12y)) "+14 " + test "test4399" (lazy(sprintf "%-+1o" 12y)) "+14" + test "test4400" (lazy(sprintf "%-+*o" 7 12y)) "+14 " + test "test4401" (lazy(sprintf "%+0o" 12y)) "+14" + test "test4402" (lazy(sprintf "%+05o" 12y)) "+0014" + test "test4403" (lazy(sprintf "%+01o" 12y)) "+14" + test "test4404" (lazy(sprintf "%+0*o" 7 12y)) "+000014" + test "test4405" (lazy(sprintf "%-+0o" 12y)) "+14" + test "test4406" (lazy(sprintf "%-+05o" 12y)) "+14 " + test "test4407" (lazy(sprintf "%-+01o" 12y)) "+14" + test "test4408" (lazy(sprintf "%-+0*o" 7 12y)) "+14 " + test "test4409" (lazy(sprintf "% o" 12y)) " 14" + test "test4410" (lazy(sprintf "% 5o" 12y)) " 14" + test "test4411" (lazy(sprintf "% 1o" 12y)) " 14" + test "test4412" (lazy(sprintf "% *o" 7 12y)) " 14" + test "test4413" (lazy(sprintf "%- o" 12y)) " 14" + test "test4414" (lazy(sprintf "%- 5o" 12y)) " 14 " + test "test4415" (lazy(sprintf "%- 1o" 12y)) " 14" + test "test4416" (lazy(sprintf "%- *o" 7 12y)) " 14 " + test "test4417" (lazy(sprintf "% 0o" 12y)) " 14" + test "test4418" (lazy(sprintf "% 05o" 12y)) " 0014" + test "test4419" (lazy(sprintf "% 01o" 12y)) " 14" + test "test4420" (lazy(sprintf "% 0*o" 7 12y)) " 000014" + test "test4421" (lazy(sprintf "%- 0o" 12y)) " 14" + test "test4422" (lazy(sprintf "%- 05o" 12y)) " 14 " + test "test4423" (lazy(sprintf "%- 01o" 12y)) " 14" + test "test4424" (lazy(sprintf "%- 0*o" 7 12y)) " 14 " + test "test4425" (lazy(sprintf "%o" -94y)) "242" + test "test4426" (lazy(sprintf "%5o" -94y)) " 242" + test "test4427" (lazy(sprintf "%1o" -94y)) "242" + test "test4428" (lazy(sprintf "%*o" 7 -94y)) " 242" + test "test4429" (lazy(sprintf "%-o" -94y)) "242" + test "test4430" (lazy(sprintf "%-5o" -94y)) "242 " + test "test4431" (lazy(sprintf "%-1o" -94y)) "242" + test "test4432" (lazy(sprintf "%-*o" 7 -94y)) "242 " + test "test4433" (lazy(sprintf "%0o" -94y)) "242" + test "test4434" (lazy(sprintf "%05o" -94y)) "00242" + test "test4435" (lazy(sprintf "%01o" -94y)) "242" + test "test4436" (lazy(sprintf "%0*o" 7 -94y)) "0000242" + test "test4437" (lazy(sprintf "%-0o" -94y)) "242" + test "test4438" (lazy(sprintf "%-05o" -94y)) "242 " + test "test4439" (lazy(sprintf "%-01o" -94y)) "242" + test "test4440" (lazy(sprintf "%-0*o" 7 -94y)) "242 " + test "test4441" (lazy(sprintf "%+o" -94y)) "+242" + test "test4442" (lazy(sprintf "%+5o" -94y)) " +242" + test "test4443" (lazy(sprintf "%+1o" -94y)) "+242" + test "test4444" (lazy(sprintf "%+*o" 7 -94y)) " +242" + test "test4445" (lazy(sprintf "%-+o" -94y)) "+242" + test "test4446" (lazy(sprintf "%-+5o" -94y)) "+242 " + test "test4447" (lazy(sprintf "%-+1o" -94y)) "+242" + test "test4448" (lazy(sprintf "%-+*o" 7 -94y)) "+242 " + test "test4449" (lazy(sprintf "%+0o" -94y)) "+242" + test "test4450" (lazy(sprintf "%+05o" -94y)) "+0242" + test "test4451" (lazy(sprintf "%+01o" -94y)) "+242" + test "test4452" (lazy(sprintf "%+0*o" 7 -94y)) "+000242" + test "test4453" (lazy(sprintf "%-+0o" -94y)) "+242" + test "test4454" (lazy(sprintf "%-+05o" -94y)) "+242 " + test "test4455" (lazy(sprintf "%-+01o" -94y)) "+242" + test "test4456" (lazy(sprintf "%-+0*o" 7 -94y)) "+242 " + test "test4457" (lazy(sprintf "% o" -94y)) " 242" + test "test4458" (lazy(sprintf "% 5o" -94y)) " 242" + test "test4459" (lazy(sprintf "% 1o" -94y)) " 242" + test "test4460" (lazy(sprintf "% *o" 7 -94y)) " 242" + test "test4461" (lazy(sprintf "%- o" -94y)) " 242" + test "test4462" (lazy(sprintf "%- 5o" -94y)) " 242 " + test "test4463" (lazy(sprintf "%- 1o" -94y)) " 242" + test "test4464" (lazy(sprintf "%- *o" 7 -94y)) " 242 " + test "test4465" (lazy(sprintf "% 0o" -94y)) " 242" + test "test4466" (lazy(sprintf "% 05o" -94y)) " 0242" + test "test4467" (lazy(sprintf "% 01o" -94y)) " 242" + test "test4468" (lazy(sprintf "% 0*o" 7 -94y)) " 000242" + test "test4469" (lazy(sprintf "%- 0o" -94y)) " 242" + test "test4470" (lazy(sprintf "%- 05o" -94y)) " 242 " + test "test4471" (lazy(sprintf "%- 01o" -94y)) " 242" + test "test4472" (lazy(sprintf "%- 0*o" 7 -94y)) " 242 " + test "test4473" (lazy(sprintf "%o" 88uy)) "130" + test "test4474" (lazy(sprintf "%5o" 88uy)) " 130" + test "test4475" (lazy(sprintf "%1o" 88uy)) "130" + test "test4476" (lazy(sprintf "%*o" 7 88uy)) " 130" + test "test4477" (lazy(sprintf "%-o" 88uy)) "130" + test "test4478" (lazy(sprintf "%-5o" 88uy)) "130 " + test "test4479" (lazy(sprintf "%-1o" 88uy)) "130" + test "test4480" (lazy(sprintf "%-*o" 7 88uy)) "130 " + test "test4481" (lazy(sprintf "%0o" 88uy)) "130" + test "test4482" (lazy(sprintf "%05o" 88uy)) "00130" + test "test4483" (lazy(sprintf "%01o" 88uy)) "130" + test "test4484" (lazy(sprintf "%0*o" 7 88uy)) "0000130" + test "test4485" (lazy(sprintf "%-0o" 88uy)) "130" + test "test4486" (lazy(sprintf "%-05o" 88uy)) "130 " + test "test4487" (lazy(sprintf "%-01o" 88uy)) "130" + test "test4488" (lazy(sprintf "%-0*o" 7 88uy)) "130 " + test "test4489" (lazy(sprintf "%+o" 88uy)) "+130" + test "test4490" (lazy(sprintf "%+5o" 88uy)) " +130" + test "test4491" (lazy(sprintf "%+1o" 88uy)) "+130" + test "test4492" (lazy(sprintf "%+*o" 7 88uy)) " +130" + test "test4493" (lazy(sprintf "%-+o" 88uy)) "+130" + test "test4494" (lazy(sprintf "%-+5o" 88uy)) "+130 " + test "test4495" (lazy(sprintf "%-+1o" 88uy)) "+130" + test "test4496" (lazy(sprintf "%-+*o" 7 88uy)) "+130 " + test "test4497" (lazy(sprintf "%+0o" 88uy)) "+130" + test "test4498" (lazy(sprintf "%+05o" 88uy)) "+0130" + test "test4499" (lazy(sprintf "%+01o" 88uy)) "+130" + test "test4500" (lazy(sprintf "%+0*o" 7 88uy)) "+000130" + test "test4501" (lazy(sprintf "%-+0o" 88uy)) "+130" + test "test4502" (lazy(sprintf "%-+05o" 88uy)) "+130 " + test "test4503" (lazy(sprintf "%-+01o" 88uy)) "+130" + test "test4504" (lazy(sprintf "%-+0*o" 7 88uy)) "+130 " + test "test4505" (lazy(sprintf "% o" 88uy)) " 130" + test "test4506" (lazy(sprintf "% 5o" 88uy)) " 130" + test "test4507" (lazy(sprintf "% 1o" 88uy)) " 130" + test "test4508" (lazy(sprintf "% *o" 7 88uy)) " 130" + test "test4509" (lazy(sprintf "%- o" 88uy)) " 130" + test "test4510" (lazy(sprintf "%- 5o" 88uy)) " 130 " + test "test4511" (lazy(sprintf "%- 1o" 88uy)) " 130" + test "test4512" (lazy(sprintf "%- *o" 7 88uy)) " 130 " + test "test4513" (lazy(sprintf "% 0o" 88uy)) " 130" + test "test4514" (lazy(sprintf "% 05o" 88uy)) " 0130" + test "test4515" (lazy(sprintf "% 01o" 88uy)) " 130" + test "test4516" (lazy(sprintf "% 0*o" 7 88uy)) " 000130" + test "test4517" (lazy(sprintf "%- 0o" 88uy)) " 130" + test "test4518" (lazy(sprintf "%- 05o" 88uy)) " 130 " + test "test4519" (lazy(sprintf "%- 01o" 88uy)) " 130" + test "test4520" (lazy(sprintf "%- 0*o" 7 88uy)) " 130 " + test "test4521" (lazy(sprintf "%o" 999L)) "1747" + test "test4522" (lazy(sprintf "%5o" 999L)) " 1747" + test "test4523" (lazy(sprintf "%1o" 999L)) "1747" + test "test4524" (lazy(sprintf "%*o" 7 999L)) " 1747" + test "test4525" (lazy(sprintf "%-o" 999L)) "1747" + test "test4526" (lazy(sprintf "%-5o" 999L)) "1747 " + test "test4527" (lazy(sprintf "%-1o" 999L)) "1747" + test "test4528" (lazy(sprintf "%-*o" 7 999L)) "1747 " + test "test4529" (lazy(sprintf "%0o" 999L)) "1747" + test "test4530" (lazy(sprintf "%05o" 999L)) "01747" + test "test4531" (lazy(sprintf "%01o" 999L)) "1747" + test "test4532" (lazy(sprintf "%0*o" 7 999L)) "0001747" + test "test4533" (lazy(sprintf "%-0o" 999L)) "1747" + test "test4534" (lazy(sprintf "%-05o" 999L)) "1747 " + test "test4535" (lazy(sprintf "%-01o" 999L)) "1747" + test "test4536" (lazy(sprintf "%-0*o" 7 999L)) "1747 " + test "test4537" (lazy(sprintf "%+o" 999L)) "+1747" + test "test4538" (lazy(sprintf "%+5o" 999L)) "+1747" + test "test4539" (lazy(sprintf "%+1o" 999L)) "+1747" + test "test4540" (lazy(sprintf "%+*o" 7 999L)) " +1747" + test "test4541" (lazy(sprintf "%-+o" 999L)) "+1747" + test "test4542" (lazy(sprintf "%-+5o" 999L)) "+1747" + test "test4543" (lazy(sprintf "%-+1o" 999L)) "+1747" + test "test4544" (lazy(sprintf "%-+*o" 7 999L)) "+1747 " + test "test4545" (lazy(sprintf "%+0o" 999L)) "+1747" + test "test4546" (lazy(sprintf "%+05o" 999L)) "+1747" + test "test4547" (lazy(sprintf "%+01o" 999L)) "+1747" + test "test4548" (lazy(sprintf "%+0*o" 7 999L)) "+001747" + test "test4549" (lazy(sprintf "%-+0o" 999L)) "+1747" + test "test4550" (lazy(sprintf "%-+05o" 999L)) "+1747" + test "test4551" (lazy(sprintf "%-+01o" 999L)) "+1747" + test "test4552" (lazy(sprintf "%-+0*o" 7 999L)) "+1747 " + test "test4553" (lazy(sprintf "% o" 999L)) " 1747" + test "test4554" (lazy(sprintf "% 5o" 999L)) " 1747" + test "test4555" (lazy(sprintf "% 1o" 999L)) " 1747" + test "test4556" (lazy(sprintf "% *o" 7 999L)) " 1747" + test "test4557" (lazy(sprintf "%- o" 999L)) " 1747" + test "test4558" (lazy(sprintf "%- 5o" 999L)) " 1747" + test "test4559" (lazy(sprintf "%- 1o" 999L)) " 1747" + test "test4560" (lazy(sprintf "%- *o" 7 999L)) " 1747 " + test "test4561" (lazy(sprintf "% 0o" 999L)) " 1747" + test "test4562" (lazy(sprintf "% 05o" 999L)) " 1747" + test "test4563" (lazy(sprintf "% 01o" 999L)) " 1747" + test "test4564" (lazy(sprintf "% 0*o" 7 999L)) " 001747" + test "test4565" (lazy(sprintf "%- 0o" 999L)) " 1747" + test "test4566" (lazy(sprintf "%- 05o" 999L)) " 1747" + test "test4567" (lazy(sprintf "%- 01o" 999L)) " 1747" + test "test4568" (lazy(sprintf "%- 0*o" 7 999L)) " 1747 " + test "test4569" (lazy(sprintf "%o" -321L)) "1777777777777777777277" + test "test4570" (lazy(sprintf "%5o" -321L)) "1777777777777777777277" + test "test4571" (lazy(sprintf "%1o" -321L)) "1777777777777777777277" + test "test4572" (lazy(sprintf "%*o" 7 -321L)) "1777777777777777777277" + test "test4573" (lazy(sprintf "%-o" -321L)) "1777777777777777777277" + test "test4574" (lazy(sprintf "%-5o" -321L)) "1777777777777777777277" + test "test4575" (lazy(sprintf "%-1o" -321L)) "1777777777777777777277" + test "test4576" (lazy(sprintf "%-*o" 7 -321L)) "1777777777777777777277" + test "test4577" (lazy(sprintf "%0o" -321L)) "1777777777777777777277" + test "test4578" (lazy(sprintf "%05o" -321L)) "1777777777777777777277" + test "test4579" (lazy(sprintf "%01o" -321L)) "1777777777777777777277" + test "test4580" (lazy(sprintf "%0*o" 7 -321L)) "1777777777777777777277" + test "test4581" (lazy(sprintf "%-0o" -321L)) "1777777777777777777277" + test "test4582" (lazy(sprintf "%-05o" -321L)) "1777777777777777777277" + test "test4583" (lazy(sprintf "%-01o" -321L)) "1777777777777777777277" + test "test4584" (lazy(sprintf "%-0*o" 7 -321L)) "1777777777777777777277" + test "test4585" (lazy(sprintf "%+o" -321L)) "+1777777777777777777277" + test "test4586" (lazy(sprintf "%+5o" -321L)) "+1777777777777777777277" + test "test4587" (lazy(sprintf "%+1o" -321L)) "+1777777777777777777277" + test "test4588" (lazy(sprintf "%+*o" 7 -321L)) "+1777777777777777777277" + test "test4589" (lazy(sprintf "%-+o" -321L)) "+1777777777777777777277" + test "test4590" (lazy(sprintf "%-+5o" -321L)) "+1777777777777777777277" + test "test4591" (lazy(sprintf "%-+1o" -321L)) "+1777777777777777777277" + test "test4592" (lazy(sprintf "%-+*o" 7 -321L)) "+1777777777777777777277" + test "test4593" (lazy(sprintf "%+0o" -321L)) "+1777777777777777777277" + test "test4594" (lazy(sprintf "%+05o" -321L)) "+1777777777777777777277" + test "test4595" (lazy(sprintf "%+01o" -321L)) "+1777777777777777777277" + test "test4596" (lazy(sprintf "%+0*o" 7 -321L)) "+1777777777777777777277" + test "test4597" (lazy(sprintf "%-+0o" -321L)) "+1777777777777777777277" + test "test4598" (lazy(sprintf "%-+05o" -321L)) "+1777777777777777777277" + test "test4599" (lazy(sprintf "%-+01o" -321L)) "+1777777777777777777277" + test "test4600" (lazy(sprintf "%-+0*o" 7 -321L)) "+1777777777777777777277" + test "test4601" (lazy(sprintf "% o" -321L)) " 1777777777777777777277" + test "test4602" (lazy(sprintf "% 5o" -321L)) " 1777777777777777777277" + test "test4603" (lazy(sprintf "% 1o" -321L)) " 1777777777777777777277" + test "test4604" (lazy(sprintf "% *o" 7 -321L)) " 1777777777777777777277" + test "test4605" (lazy(sprintf "%- o" -321L)) " 1777777777777777777277" + test "test4606" (lazy(sprintf "%- 5o" -321L)) " 1777777777777777777277" + test "test4607" (lazy(sprintf "%- 1o" -321L)) " 1777777777777777777277" + test "test4608" (lazy(sprintf "%- *o" 7 -321L)) " 1777777777777777777277" + test "test4609" (lazy(sprintf "% 0o" -321L)) " 1777777777777777777277" + test "test4610" (lazy(sprintf "% 05o" -321L)) " 1777777777777777777277" + test "test4611" (lazy(sprintf "% 01o" -321L)) " 1777777777777777777277" + test "test4612" (lazy(sprintf "% 0*o" 7 -321L)) " 1777777777777777777277" + test "test4613" (lazy(sprintf "%- 0o" -321L)) " 1777777777777777777277" + test "test4614" (lazy(sprintf "%- 05o" -321L)) " 1777777777777777777277" + test "test4615" (lazy(sprintf "%- 01o" -321L)) " 1777777777777777777277" + test "test4616" (lazy(sprintf "%- 0*o" 7 -321L)) " 1777777777777777777277" + test "test4617" (lazy(sprintf "%o" 50000UL)) "141520" + test "test4618" (lazy(sprintf "%5o" 50000UL)) "141520" + test "test4619" (lazy(sprintf "%1o" 50000UL)) "141520" + test "test4620" (lazy(sprintf "%*o" 7 50000UL)) " 141520" + test "test4621" (lazy(sprintf "%-o" 50000UL)) "141520" + test "test4622" (lazy(sprintf "%-5o" 50000UL)) "141520" + test "test4623" (lazy(sprintf "%-1o" 50000UL)) "141520" + test "test4624" (lazy(sprintf "%-*o" 7 50000UL)) "141520 " + test "test4625" (lazy(sprintf "%0o" 50000UL)) "141520" + test "test4626" (lazy(sprintf "%05o" 50000UL)) "141520" + test "test4627" (lazy(sprintf "%01o" 50000UL)) "141520" + test "test4628" (lazy(sprintf "%0*o" 7 50000UL)) "0141520" + test "test4629" (lazy(sprintf "%-0o" 50000UL)) "141520" + test "test4630" (lazy(sprintf "%-05o" 50000UL)) "141520" + test "test4631" (lazy(sprintf "%-01o" 50000UL)) "141520" + test "test4632" (lazy(sprintf "%-0*o" 7 50000UL)) "141520 " + test "test4633" (lazy(sprintf "%+o" 50000UL)) "+141520" + test "test4634" (lazy(sprintf "%+5o" 50000UL)) "+141520" + test "test4635" (lazy(sprintf "%+1o" 50000UL)) "+141520" + test "test4636" (lazy(sprintf "%+*o" 7 50000UL)) "+141520" + test "test4637" (lazy(sprintf "%-+o" 50000UL)) "+141520" + test "test4638" (lazy(sprintf "%-+5o" 50000UL)) "+141520" + test "test4639" (lazy(sprintf "%-+1o" 50000UL)) "+141520" + test "test4640" (lazy(sprintf "%-+*o" 7 50000UL)) "+141520" + test "test4641" (lazy(sprintf "%+0o" 50000UL)) "+141520" + test "test4642" (lazy(sprintf "%+05o" 50000UL)) "+141520" + test "test4643" (lazy(sprintf "%+01o" 50000UL)) "+141520" + test "test4644" (lazy(sprintf "%+0*o" 7 50000UL)) "+141520" + test "test4645" (lazy(sprintf "%-+0o" 50000UL)) "+141520" + test "test4646" (lazy(sprintf "%-+05o" 50000UL)) "+141520" + test "test4647" (lazy(sprintf "%-+01o" 50000UL)) "+141520" + test "test4648" (lazy(sprintf "%-+0*o" 7 50000UL)) "+141520" + test "test4649" (lazy(sprintf "% o" 50000UL)) " 141520" + test "test4650" (lazy(sprintf "% 5o" 50000UL)) " 141520" + test "test4651" (lazy(sprintf "% 1o" 50000UL)) " 141520" + test "test4652" (lazy(sprintf "% *o" 7 50000UL)) " 141520" + test "test4653" (lazy(sprintf "%- o" 50000UL)) " 141520" + test "test4654" (lazy(sprintf "%- 5o" 50000UL)) " 141520" + test "test4655" (lazy(sprintf "%- 1o" 50000UL)) " 141520" + test "test4656" (lazy(sprintf "%- *o" 7 50000UL)) " 141520" + test "test4657" (lazy(sprintf "% 0o" 50000UL)) " 141520" + test "test4658" (lazy(sprintf "% 05o" 50000UL)) " 141520" + test "test4659" (lazy(sprintf "% 01o" 50000UL)) " 141520" + test "test4660" (lazy(sprintf "% 0*o" 7 50000UL)) " 141520" + test "test4661" (lazy(sprintf "%- 0o" 50000UL)) " 141520" + test "test4662" (lazy(sprintf "%- 05o" 50000UL)) " 141520" + test "test4663" (lazy(sprintf "%- 01o" 50000UL)) " 141520" + test "test4664" (lazy(sprintf "%- 0*o" 7 50000UL)) " 141520" + test "test4665" (lazy(sprintf "%o" System.Int32.MaxValue)) "17777777777" + test "test4666" (lazy(sprintf "%5o" System.Int32.MaxValue)) "17777777777" + test "test4667" (lazy(sprintf "%1o" System.Int32.MaxValue)) "17777777777" + test "test4668" (lazy(sprintf "%*o" 7 System.Int32.MaxValue)) "17777777777" + test "test4669" (lazy(sprintf "%-o" System.Int32.MaxValue)) "17777777777" + test "test4670" (lazy(sprintf "%-5o" System.Int32.MaxValue)) "17777777777" + test "test4671" (lazy(sprintf "%-1o" System.Int32.MaxValue)) "17777777777" + test "test4672" (lazy(sprintf "%-*o" 7 System.Int32.MaxValue)) "17777777777" + test "test4673" (lazy(sprintf "%0o" System.Int32.MaxValue)) "17777777777" + test "test4674" (lazy(sprintf "%05o" System.Int32.MaxValue)) "17777777777" + test "test4675" (lazy(sprintf "%01o" System.Int32.MaxValue)) "17777777777" + test "test4676" (lazy(sprintf "%0*o" 7 System.Int32.MaxValue)) "17777777777" + test "test4677" (lazy(sprintf "%-0o" System.Int32.MaxValue)) "17777777777" + test "test4678" (lazy(sprintf "%-05o" System.Int32.MaxValue)) "17777777777" + test "test4679" (lazy(sprintf "%-01o" System.Int32.MaxValue)) "17777777777" + test "test4680" (lazy(sprintf "%-0*o" 7 System.Int32.MaxValue)) "17777777777" + test "test4681" (lazy(sprintf "%+o" System.Int32.MaxValue)) "+17777777777" + test "test4682" (lazy(sprintf "%+5o" System.Int32.MaxValue)) "+17777777777" + test "test4683" (lazy(sprintf "%+1o" System.Int32.MaxValue)) "+17777777777" + test "test4684" (lazy(sprintf "%+*o" 7 System.Int32.MaxValue)) "+17777777777" + test "test4685" (lazy(sprintf "%-+o" System.Int32.MaxValue)) "+17777777777" + test "test4686" (lazy(sprintf "%-+5o" System.Int32.MaxValue)) "+17777777777" + test "test4687" (lazy(sprintf "%-+1o" System.Int32.MaxValue)) "+17777777777" + test "test4688" (lazy(sprintf "%-+*o" 7 System.Int32.MaxValue)) "+17777777777" + test "test4689" (lazy(sprintf "%+0o" System.Int32.MaxValue)) "+17777777777" + test "test4690" (lazy(sprintf "%+05o" System.Int32.MaxValue)) "+17777777777" + test "test4691" (lazy(sprintf "%+01o" System.Int32.MaxValue)) "+17777777777" + test "test4692" (lazy(sprintf "%+0*o" 7 System.Int32.MaxValue)) "+17777777777" + test "test4693" (lazy(sprintf "%-+0o" System.Int32.MaxValue)) "+17777777777" + test "test4694" (lazy(sprintf "%-+05o" System.Int32.MaxValue)) "+17777777777" + test "test4695" (lazy(sprintf "%-+01o" System.Int32.MaxValue)) "+17777777777" + test "test4696" (lazy(sprintf "%-+0*o" 7 System.Int32.MaxValue)) "+17777777777" + test "test4697" (lazy(sprintf "% o" System.Int32.MaxValue)) " 17777777777" + test "test4698" (lazy(sprintf "% 5o" System.Int32.MaxValue)) " 17777777777" + test "test4699" (lazy(sprintf "% 1o" System.Int32.MaxValue)) " 17777777777" + test "test4700" (lazy(sprintf "% *o" 7 System.Int32.MaxValue)) " 17777777777" + test "test4701" (lazy(sprintf "%- o" System.Int32.MaxValue)) " 17777777777" + test "test4702" (lazy(sprintf "%- 5o" System.Int32.MaxValue)) " 17777777777" + test "test4703" (lazy(sprintf "%- 1o" System.Int32.MaxValue)) " 17777777777" + test "test4704" (lazy(sprintf "%- *o" 7 System.Int32.MaxValue)) " 17777777777" + test "test4705" (lazy(sprintf "% 0o" System.Int32.MaxValue)) " 17777777777" + test "test4706" (lazy(sprintf "% 05o" System.Int32.MaxValue)) " 17777777777" + test "test4707" (lazy(sprintf "% 01o" System.Int32.MaxValue)) " 17777777777" + test "test4708" (lazy(sprintf "% 0*o" 7 System.Int32.MaxValue)) " 17777777777" + test "test4709" (lazy(sprintf "%- 0o" System.Int32.MaxValue)) " 17777777777" + test "test4710" (lazy(sprintf "%- 05o" System.Int32.MaxValue)) " 17777777777" + test "test4711" (lazy(sprintf "%- 01o" System.Int32.MaxValue)) " 17777777777" + test "test4712" (lazy(sprintf "%- 0*o" 7 System.Int32.MaxValue)) " 17777777777" + test "test4713" (lazy(sprintf "%o" System.Int64.MaxValue)) "777777777777777777777" + test "test4714" (lazy(sprintf "%5o" System.Int64.MaxValue)) "777777777777777777777" + test "test4715" (lazy(sprintf "%1o" System.Int64.MaxValue)) "777777777777777777777" + test "test4716" (lazy(sprintf "%*o" 7 System.Int64.MaxValue)) "777777777777777777777" + test "test4717" (lazy(sprintf "%-o" System.Int64.MaxValue)) "777777777777777777777" + test "test4718" (lazy(sprintf "%-5o" System.Int64.MaxValue)) "777777777777777777777" + test "test4719" (lazy(sprintf "%-1o" System.Int64.MaxValue)) "777777777777777777777" + test "test4720" (lazy(sprintf "%-*o" 7 System.Int64.MaxValue)) "777777777777777777777" + test "test4721" (lazy(sprintf "%0o" System.Int64.MaxValue)) "777777777777777777777" + test "test4722" (lazy(sprintf "%05o" System.Int64.MaxValue)) "777777777777777777777" + test "test4723" (lazy(sprintf "%01o" System.Int64.MaxValue)) "777777777777777777777" + test "test4724" (lazy(sprintf "%0*o" 7 System.Int64.MaxValue)) "777777777777777777777" + test "test4725" (lazy(sprintf "%-0o" System.Int64.MaxValue)) "777777777777777777777" + test "test4726" (lazy(sprintf "%-05o" System.Int64.MaxValue)) "777777777777777777777" + test "test4727" (lazy(sprintf "%-01o" System.Int64.MaxValue)) "777777777777777777777" + test "test4728" (lazy(sprintf "%-0*o" 7 System.Int64.MaxValue)) "777777777777777777777" + test "test4729" (lazy(sprintf "%+o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4730" (lazy(sprintf "%+5o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4731" (lazy(sprintf "%+1o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4732" (lazy(sprintf "%+*o" 7 System.Int64.MaxValue)) "+777777777777777777777" + test "test4733" (lazy(sprintf "%-+o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4734" (lazy(sprintf "%-+5o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4735" (lazy(sprintf "%-+1o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4736" (lazy(sprintf "%-+*o" 7 System.Int64.MaxValue)) "+777777777777777777777" + test "test4737" (lazy(sprintf "%+0o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4738" (lazy(sprintf "%+05o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4739" (lazy(sprintf "%+01o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4740" (lazy(sprintf "%+0*o" 7 System.Int64.MaxValue)) "+777777777777777777777" + test "test4741" (lazy(sprintf "%-+0o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4742" (lazy(sprintf "%-+05o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4743" (lazy(sprintf "%-+01o" System.Int64.MaxValue)) "+777777777777777777777" + test "test4744" (lazy(sprintf "%-+0*o" 7 System.Int64.MaxValue)) "+777777777777777777777" + test "test4745" (lazy(sprintf "% o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4746" (lazy(sprintf "% 5o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4747" (lazy(sprintf "% 1o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4748" (lazy(sprintf "% *o" 7 System.Int64.MaxValue)) " 777777777777777777777" + test "test4749" (lazy(sprintf "%- o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4750" (lazy(sprintf "%- 5o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4751" (lazy(sprintf "%- 1o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4752" (lazy(sprintf "%- *o" 7 System.Int64.MaxValue)) " 777777777777777777777" + test "test4753" (lazy(sprintf "% 0o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4754" (lazy(sprintf "% 05o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4755" (lazy(sprintf "% 01o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4756" (lazy(sprintf "% 0*o" 7 System.Int64.MaxValue)) " 777777777777777777777" + test "test4757" (lazy(sprintf "%- 0o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4758" (lazy(sprintf "%- 05o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4759" (lazy(sprintf "%- 01o" System.Int64.MaxValue)) " 777777777777777777777" + test "test4760" (lazy(sprintf "%- 0*o" 7 System.Int64.MaxValue)) " 777777777777777777777" + test "test4761" (lazy(sprintf "%o" System.Int32.MinValue)) "20000000000" + test "test4762" (lazy(sprintf "%5o" System.Int32.MinValue)) "20000000000" + test "test4763" (lazy(sprintf "%1o" System.Int32.MinValue)) "20000000000" + test "test4764" (lazy(sprintf "%*o" 7 System.Int32.MinValue)) "20000000000" + test "test4765" (lazy(sprintf "%-o" System.Int32.MinValue)) "20000000000" + test "test4766" (lazy(sprintf "%-5o" System.Int32.MinValue)) "20000000000" + test "test4767" (lazy(sprintf "%-1o" System.Int32.MinValue)) "20000000000" + test "test4768" (lazy(sprintf "%-*o" 7 System.Int32.MinValue)) "20000000000" + test "test4769" (lazy(sprintf "%0o" System.Int32.MinValue)) "20000000000" + test "test4770" (lazy(sprintf "%05o" System.Int32.MinValue)) "20000000000" + test "test4771" (lazy(sprintf "%01o" System.Int32.MinValue)) "20000000000" + test "test4772" (lazy(sprintf "%0*o" 7 System.Int32.MinValue)) "20000000000" + test "test4773" (lazy(sprintf "%-0o" System.Int32.MinValue)) "20000000000" + test "test4774" (lazy(sprintf "%-05o" System.Int32.MinValue)) "20000000000" + test "test4775" (lazy(sprintf "%-01o" System.Int32.MinValue)) "20000000000" + test "test4776" (lazy(sprintf "%-0*o" 7 System.Int32.MinValue)) "20000000000" + test "test4777" (lazy(sprintf "%+o" System.Int32.MinValue)) "+20000000000" + test "test4778" (lazy(sprintf "%+5o" System.Int32.MinValue)) "+20000000000" + test "test4779" (lazy(sprintf "%+1o" System.Int32.MinValue)) "+20000000000" + test "test4780" (lazy(sprintf "%+*o" 7 System.Int32.MinValue)) "+20000000000" + test "test4781" (lazy(sprintf "%-+o" System.Int32.MinValue)) "+20000000000" + test "test4782" (lazy(sprintf "%-+5o" System.Int32.MinValue)) "+20000000000" + test "test4783" (lazy(sprintf "%-+1o" System.Int32.MinValue)) "+20000000000" + test "test4784" (lazy(sprintf "%-+*o" 7 System.Int32.MinValue)) "+20000000000" + test "test4785" (lazy(sprintf "%+0o" System.Int32.MinValue)) "+20000000000" + test "test4786" (lazy(sprintf "%+05o" System.Int32.MinValue)) "+20000000000" + test "test4787" (lazy(sprintf "%+01o" System.Int32.MinValue)) "+20000000000" + test "test4788" (lazy(sprintf "%+0*o" 7 System.Int32.MinValue)) "+20000000000" + test "test4789" (lazy(sprintf "%-+0o" System.Int32.MinValue)) "+20000000000" + test "test4790" (lazy(sprintf "%-+05o" System.Int32.MinValue)) "+20000000000" + test "test4791" (lazy(sprintf "%-+01o" System.Int32.MinValue)) "+20000000000" + test "test4792" (lazy(sprintf "%-+0*o" 7 System.Int32.MinValue)) "+20000000000" + test "test4793" (lazy(sprintf "% o" System.Int32.MinValue)) " 20000000000" + test "test4794" (lazy(sprintf "% 5o" System.Int32.MinValue)) " 20000000000" + test "test4795" (lazy(sprintf "% 1o" System.Int32.MinValue)) " 20000000000" + test "test4796" (lazy(sprintf "% *o" 7 System.Int32.MinValue)) " 20000000000" + test "test4797" (lazy(sprintf "%- o" System.Int32.MinValue)) " 20000000000" + test "test4798" (lazy(sprintf "%- 5o" System.Int32.MinValue)) " 20000000000" + test "test4799" (lazy(sprintf "%- 1o" System.Int32.MinValue)) " 20000000000" + test "test4800" (lazy(sprintf "%- *o" 7 System.Int32.MinValue)) " 20000000000" + test "test4801" (lazy(sprintf "% 0o" System.Int32.MinValue)) " 20000000000" + test "test4802" (lazy(sprintf "% 05o" System.Int32.MinValue)) " 20000000000" + test "test4803" (lazy(sprintf "% 01o" System.Int32.MinValue)) " 20000000000" + test "test4804" (lazy(sprintf "% 0*o" 7 System.Int32.MinValue)) " 20000000000" + test "test4805" (lazy(sprintf "%- 0o" System.Int32.MinValue)) " 20000000000" + test "test4806" (lazy(sprintf "%- 05o" System.Int32.MinValue)) " 20000000000" + test "test4807" (lazy(sprintf "%- 01o" System.Int32.MinValue)) " 20000000000" + test "test4808" (lazy(sprintf "%- 0*o" 7 System.Int32.MinValue)) " 20000000000" + test "test4809" (lazy(sprintf "%o" System.Int64.MinValue)) "1000000000000000000000" + test "test4810" (lazy(sprintf "%5o" System.Int64.MinValue)) "1000000000000000000000" + test "test4811" (lazy(sprintf "%1o" System.Int64.MinValue)) "1000000000000000000000" + test "test4812" (lazy(sprintf "%*o" 7 System.Int64.MinValue)) "1000000000000000000000" + test "test4813" (lazy(sprintf "%-o" System.Int64.MinValue)) "1000000000000000000000" + test "test4814" (lazy(sprintf "%-5o" System.Int64.MinValue)) "1000000000000000000000" + test "test4815" (lazy(sprintf "%-1o" System.Int64.MinValue)) "1000000000000000000000" + test "test4816" (lazy(sprintf "%-*o" 7 System.Int64.MinValue)) "1000000000000000000000" + test "test4817" (lazy(sprintf "%0o" System.Int64.MinValue)) "1000000000000000000000" + test "test4818" (lazy(sprintf "%05o" System.Int64.MinValue)) "1000000000000000000000" + test "test4819" (lazy(sprintf "%01o" System.Int64.MinValue)) "1000000000000000000000" + test "test4820" (lazy(sprintf "%0*o" 7 System.Int64.MinValue)) "1000000000000000000000" + test "test4821" (lazy(sprintf "%-0o" System.Int64.MinValue)) "1000000000000000000000" + test "test4822" (lazy(sprintf "%-05o" System.Int64.MinValue)) "1000000000000000000000" + test "test4823" (lazy(sprintf "%-01o" System.Int64.MinValue)) "1000000000000000000000" + test "test4824" (lazy(sprintf "%-0*o" 7 System.Int64.MinValue)) "1000000000000000000000" + test "test4825" (lazy(sprintf "%+o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4826" (lazy(sprintf "%+5o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4827" (lazy(sprintf "%+1o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4828" (lazy(sprintf "%+*o" 7 System.Int64.MinValue)) "+1000000000000000000000" + test "test4829" (lazy(sprintf "%-+o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4830" (lazy(sprintf "%-+5o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4831" (lazy(sprintf "%-+1o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4832" (lazy(sprintf "%-+*o" 7 System.Int64.MinValue)) "+1000000000000000000000" + test "test4833" (lazy(sprintf "%+0o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4834" (lazy(sprintf "%+05o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4835" (lazy(sprintf "%+01o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4836" (lazy(sprintf "%+0*o" 7 System.Int64.MinValue)) "+1000000000000000000000" + test "test4837" (lazy(sprintf "%-+0o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4838" (lazy(sprintf "%-+05o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4839" (lazy(sprintf "%-+01o" System.Int64.MinValue)) "+1000000000000000000000" + test "test4840" (lazy(sprintf "%-+0*o" 7 System.Int64.MinValue)) "+1000000000000000000000" + test "test4841" (lazy(sprintf "% o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4842" (lazy(sprintf "% 5o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4843" (lazy(sprintf "% 1o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4844" (lazy(sprintf "% *o" 7 System.Int64.MinValue)) " 1000000000000000000000" + test "test4845" (lazy(sprintf "%- o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4846" (lazy(sprintf "%- 5o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4847" (lazy(sprintf "%- 1o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4848" (lazy(sprintf "%- *o" 7 System.Int64.MinValue)) " 1000000000000000000000" + test "test4849" (lazy(sprintf "% 0o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4850" (lazy(sprintf "% 05o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4851" (lazy(sprintf "% 01o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4852" (lazy(sprintf "% 0*o" 7 System.Int64.MinValue)) " 1000000000000000000000" + test "test4853" (lazy(sprintf "%- 0o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4854" (lazy(sprintf "%- 05o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4855" (lazy(sprintf "%- 01o" System.Int64.MinValue)) " 1000000000000000000000" + test "test4856" (lazy(sprintf "%- 0*o" 7 System.Int64.MinValue)) " 1000000000000000000000" + test "test4857" (lazy(sprintf "%o" 55n)) "67" + test "test4858" (lazy(sprintf "%5o" 55n)) " 67" + test "test4859" (lazy(sprintf "%1o" 55n)) "67" + test "test4860" (lazy(sprintf "%*o" 7 55n)) " 67" + test "test4861" (lazy(sprintf "%-o" 55n)) "67" + test "test4862" (lazy(sprintf "%-5o" 55n)) "67 " + test "test4863" (lazy(sprintf "%-1o" 55n)) "67" + test "test4864" (lazy(sprintf "%-*o" 7 55n)) "67 " + test "test4865" (lazy(sprintf "%0o" 55n)) "67" + test "test4866" (lazy(sprintf "%05o" 55n)) "00067" + test "test4867" (lazy(sprintf "%01o" 55n)) "67" + test "test4868" (lazy(sprintf "%0*o" 7 55n)) "0000067" + test "test4869" (lazy(sprintf "%-0o" 55n)) "67" + test "test4870" (lazy(sprintf "%-05o" 55n)) "67 " + test "test4871" (lazy(sprintf "%-01o" 55n)) "67" + test "test4872" (lazy(sprintf "%-0*o" 7 55n)) "67 " + test "test4873" (lazy(sprintf "%+o" 55n)) "+67" + test "test4874" (lazy(sprintf "%+5o" 55n)) " +67" + test "test4875" (lazy(sprintf "%+1o" 55n)) "+67" + test "test4876" (lazy(sprintf "%+*o" 7 55n)) " +67" + test "test4877" (lazy(sprintf "%-+o" 55n)) "+67" + test "test4878" (lazy(sprintf "%-+5o" 55n)) "+67 " + test "test4879" (lazy(sprintf "%-+1o" 55n)) "+67" + test "test4880" (lazy(sprintf "%-+*o" 7 55n)) "+67 " + test "test4881" (lazy(sprintf "%+0o" 55n)) "+67" + test "test4882" (lazy(sprintf "%+05o" 55n)) "+0067" + test "test4883" (lazy(sprintf "%+01o" 55n)) "+67" + test "test4884" (lazy(sprintf "%+0*o" 7 55n)) "+000067" + test "test4885" (lazy(sprintf "%-+0o" 55n)) "+67" + test "test4886" (lazy(sprintf "%-+05o" 55n)) "+67 " + test "test4887" (lazy(sprintf "%-+01o" 55n)) "+67" + test "test4888" (lazy(sprintf "%-+0*o" 7 55n)) "+67 " + test "test4889" (lazy(sprintf "% o" 55n)) " 67" + test "test4890" (lazy(sprintf "% 5o" 55n)) " 67" + test "test4891" (lazy(sprintf "% 1o" 55n)) " 67" + test "test4892" (lazy(sprintf "% *o" 7 55n)) " 67" + test "test4893" (lazy(sprintf "%- o" 55n)) " 67" + test "test4894" (lazy(sprintf "%- 5o" 55n)) " 67 " + test "test4895" (lazy(sprintf "%- 1o" 55n)) " 67" + test "test4896" (lazy(sprintf "%- *o" 7 55n)) " 67 " + test "test4897" (lazy(sprintf "% 0o" 55n)) " 67" + test "test4898" (lazy(sprintf "% 05o" 55n)) " 0067" + test "test4899" (lazy(sprintf "% 01o" 55n)) " 67" + test "test4900" (lazy(sprintf "% 0*o" 7 55n)) " 000067" + test "test4901" (lazy(sprintf "%- 0o" 55n)) " 67" + test "test4902" (lazy(sprintf "%- 05o" 55n)) " 67 " + test "test4903" (lazy(sprintf "%- 01o" 55n)) " 67" + test "test4904" (lazy(sprintf "%- 0*o" 7 55n)) " 67 " + test "test4905" (lazy(sprintf "%o" 999un)) "1747" + test "test4906" (lazy(sprintf "%5o" 999un)) " 1747" + test "test4907" (lazy(sprintf "%1o" 999un)) "1747" + test "test4908" (lazy(sprintf "%*o" 7 999un)) " 1747" + test "test4909" (lazy(sprintf "%-o" 999un)) "1747" + test "test4910" (lazy(sprintf "%-5o" 999un)) "1747 " + test "test4911" (lazy(sprintf "%-1o" 999un)) "1747" + test "test4912" (lazy(sprintf "%-*o" 7 999un)) "1747 " + test "test4913" (lazy(sprintf "%0o" 999un)) "1747" + test "test4914" (lazy(sprintf "%05o" 999un)) "01747" + test "test4915" (lazy(sprintf "%01o" 999un)) "1747" + test "test4916" (lazy(sprintf "%0*o" 7 999un)) "0001747" + test "test4917" (lazy(sprintf "%-0o" 999un)) "1747" + test "test4918" (lazy(sprintf "%-05o" 999un)) "1747 " + test "test4919" (lazy(sprintf "%-01o" 999un)) "1747" + test "test4920" (lazy(sprintf "%-0*o" 7 999un)) "1747 " + test "test4921" (lazy(sprintf "%+o" 999un)) "+1747" + test "test4922" (lazy(sprintf "%+5o" 999un)) "+1747" + test "test4923" (lazy(sprintf "%+1o" 999un)) "+1747" + test "test4924" (lazy(sprintf "%+*o" 7 999un)) " +1747" + test "test4925" (lazy(sprintf "%-+o" 999un)) "+1747" + test "test4926" (lazy(sprintf "%-+5o" 999un)) "+1747" + test "test4927" (lazy(sprintf "%-+1o" 999un)) "+1747" + test "test4928" (lazy(sprintf "%-+*o" 7 999un)) "+1747 " + test "test4929" (lazy(sprintf "%+0o" 999un)) "+1747" + test "test4930" (lazy(sprintf "%+05o" 999un)) "+1747" + test "test4931" (lazy(sprintf "%+01o" 999un)) "+1747" + test "test4932" (lazy(sprintf "%+0*o" 7 999un)) "+001747" + test "test4933" (lazy(sprintf "%-+0o" 999un)) "+1747" + test "test4934" (lazy(sprintf "%-+05o" 999un)) "+1747" + test "test4935" (lazy(sprintf "%-+01o" 999un)) "+1747" + test "test4936" (lazy(sprintf "%-+0*o" 7 999un)) "+1747 " + test "test4937" (lazy(sprintf "% o" 999un)) " 1747" + test "test4938" (lazy(sprintf "% 5o" 999un)) " 1747" + test "test4939" (lazy(sprintf "% 1o" 999un)) " 1747" + test "test4940" (lazy(sprintf "% *o" 7 999un)) " 1747" + test "test4941" (lazy(sprintf "%- o" 999un)) " 1747" + test "test4942" (lazy(sprintf "%- 5o" 999un)) " 1747" + test "test4943" (lazy(sprintf "%- 1o" 999un)) " 1747" + test "test4944" (lazy(sprintf "%- *o" 7 999un)) " 1747 " + test "test4945" (lazy(sprintf "% 0o" 999un)) " 1747" + test "test4946" (lazy(sprintf "% 05o" 999un)) " 1747" + test "test4947" (lazy(sprintf "% 01o" 999un)) " 1747" + test "test4948" (lazy(sprintf "% 0*o" 7 999un)) " 001747" + test "test4949" (lazy(sprintf "%- 0o" 999un)) " 1747" + test "test4950" (lazy(sprintf "%- 05o" 999un)) " 1747" + test "test4951" (lazy(sprintf "%- 01o" 999un)) " 1747" + test "test4952" (lazy(sprintf "%- 0*o" 7 999un)) " 1747 " + test "test4953" (lazy(sprintf "%e" 5.0)) "5.000000e+000" + test "test4954" (lazy(sprintf "%5e" 5.0)) "5.000000e+000" + test "test4955" (lazy(sprintf "%1e" 5.0)) "5.000000e+000" + test "test4956" (lazy(sprintf "%*e" 7 5.0)) "5.000000e+000" + test "test4957" (lazy(sprintf "%.5e" 5.0)) "5.00000e+000" + test "test4958" (lazy(sprintf "%.*e" 4 5.0)) "5.0000e+000" + test "test4959" (lazy(sprintf "%*.*e" 5 4 5.0)) "5.0000e+000" + test "test4960" (lazy(sprintf "%-e" 5.0)) "5.000000e+000" + test "test4961" (lazy(sprintf "%-5e" 5.0)) "5.000000e+000" + test "test4962" (lazy(sprintf "%-1e" 5.0)) "5.000000e+000" + test "test4963" (lazy(sprintf "%-*e" 7 5.0)) "5.000000e+000" + test "test4964" (lazy(sprintf "%-.5e" 5.0)) "5.00000e+000" + test "test4965" (lazy(sprintf "%-.*e" 4 5.0)) "5.0000e+000" + test "test4966" (lazy(sprintf "%-*.*e" 5 4 5.0)) "5.0000e+000" + test "test4967" (lazy(sprintf "%0e" 5.0)) "5.000000e+000" + test "test4968" (lazy(sprintf "%05e" 5.0)) "5.000000e+000" + test "test4969" (lazy(sprintf "%01e" 5.0)) "5.000000e+000" + test "test4970" (lazy(sprintf "%0*e" 7 5.0)) "5.000000e+000" + test "test4971" (lazy(sprintf "%0.5e" 5.0)) "5.00000e+000" + test "test4972" (lazy(sprintf "%0.*e" 4 5.0)) "5.0000e+000" + test "test4973" (lazy(sprintf "%0*.*e" 5 4 5.0)) "5.0000e+000" + test "test4974" (lazy(sprintf "%-0e" 5.0)) "5.000000e+000" + test "test4975" (lazy(sprintf "%-05e" 5.0)) "5.000000e+000" + test "test4976" (lazy(sprintf "%-01e" 5.0)) "5.000000e+000" + test "test4977" (lazy(sprintf "%-0*e" 7 5.0)) "5.000000e+000" + test "test4978" (lazy(sprintf "%-0.5e" 5.0)) "5.00000e+000" + test "test4979" (lazy(sprintf "%-0.*e" 4 5.0)) "5.0000e+000" + test "test4980" (lazy(sprintf "%-0*.*e" 5 4 5.0)) "5.0000e+000" + test "test4981" (lazy(sprintf "%+e" 5.0)) "+5.000000e+000" + test "test4982" (lazy(sprintf "%+5e" 5.0)) "+5.000000e+000" + test "test4983" (lazy(sprintf "%+1e" 5.0)) "+5.000000e+000" + test "test4984" (lazy(sprintf "%+*e" 7 5.0)) "+5.000000e+000" + test "test4985" (lazy(sprintf "%+.5e" 5.0)) "+5.00000e+000" + test "test4986" (lazy(sprintf "%+.*e" 4 5.0)) "+5.0000e+000" + test "test4987" (lazy(sprintf "%+*.*e" 5 4 5.0)) "+5.0000e+000" + test "test4988" (lazy(sprintf "%-+e" 5.0)) "+5.000000e+000" + test "test4989" (lazy(sprintf "%-+5e" 5.0)) "+5.000000e+000" + test "test4990" (lazy(sprintf "%-+1e" 5.0)) "+5.000000e+000" + test "test4991" (lazy(sprintf "%-+*e" 7 5.0)) "+5.000000e+000" + test "test4992" (lazy(sprintf "%-+.5e" 5.0)) "+5.00000e+000" + test "test4993" (lazy(sprintf "%-+.*e" 4 5.0)) "+5.0000e+000" + test "test4994" (lazy(sprintf "%-+*.*e" 5 4 5.0)) "+5.0000e+000" + test "test4995" (lazy(sprintf "%+0e" 5.0)) "+5.000000e+000" + test "test4996" (lazy(sprintf "%+05e" 5.0)) "+5.000000e+000" + test "test4997" (lazy(sprintf "%+01e" 5.0)) "+5.000000e+000" + test "test4998" (lazy(sprintf "%+0*e" 7 5.0)) "+5.000000e+000" + test "test4999" (lazy(sprintf "%+0.5e" 5.0)) "+5.00000e+000" + test "test5000" (lazy(sprintf "%+0.*e" 4 5.0)) "+5.0000e+000" +let func5000()= + test "test5001" (lazy(sprintf "%+0*.*e" 5 4 5.0)) "+5.0000e+000" + test "test5002" (lazy(sprintf "%-+0e" 5.0)) "+5.000000e+000" + test "test5003" (lazy(sprintf "%-+05e" 5.0)) "+5.000000e+000" + test "test5004" (lazy(sprintf "%-+01e" 5.0)) "+5.000000e+000" + test "test5005" (lazy(sprintf "%-+0*e" 7 5.0)) "+5.000000e+000" + test "test5006" (lazy(sprintf "%-+0.5e" 5.0)) "+5.00000e+000" + test "test5007" (lazy(sprintf "%-+0.*e" 4 5.0)) "+5.0000e+000" + test "test5008" (lazy(sprintf "%-+0*.*e" 5 4 5.0)) "+5.0000e+000" + test "test5009" (lazy(sprintf "% e" 5.0)) " 5.000000e+000" + test "test5010" (lazy(sprintf "% 5e" 5.0)) " 5.000000e+000" + test "test5011" (lazy(sprintf "% 1e" 5.0)) " 5.000000e+000" + test "test5012" (lazy(sprintf "% *e" 7 5.0)) " 5.000000e+000" + test "test5013" (lazy(sprintf "% .5e" 5.0)) " 5.00000e+000" + test "test5014" (lazy(sprintf "% .*e" 4 5.0)) " 5.0000e+000" + test "test5015" (lazy(sprintf "% *.*e" 5 4 5.0)) " 5.0000e+000" + test "test5016" (lazy(sprintf "%- e" 5.0)) " 5.000000e+000" + test "test5017" (lazy(sprintf "%- 5e" 5.0)) " 5.000000e+000" + test "test5018" (lazy(sprintf "%- 1e" 5.0)) " 5.000000e+000" + test "test5019" (lazy(sprintf "%- *e" 7 5.0)) " 5.000000e+000" + test "test5020" (lazy(sprintf "%- .5e" 5.0)) " 5.00000e+000" + test "test5021" (lazy(sprintf "%- .*e" 4 5.0)) " 5.0000e+000" + test "test5022" (lazy(sprintf "%- *.*e" 5 4 5.0)) " 5.0000e+000" + test "test5023" (lazy(sprintf "% 0e" 5.0)) " 5.000000e+000" + test "test5024" (lazy(sprintf "% 05e" 5.0)) " 5.000000e+000" + test "test5025" (lazy(sprintf "% 01e" 5.0)) " 5.000000e+000" + test "test5026" (lazy(sprintf "% 0*e" 7 5.0)) " 5.000000e+000" + test "test5027" (lazy(sprintf "% 0.5e" 5.0)) " 5.00000e+000" + test "test5028" (lazy(sprintf "% 0.*e" 4 5.0)) " 5.0000e+000" + test "test5029" (lazy(sprintf "% 0*.*e" 5 4 5.0)) " 5.0000e+000" + test "test5030" (lazy(sprintf "%- 0e" 5.0)) " 5.000000e+000" + test "test5031" (lazy(sprintf "%- 05e" 5.0)) " 5.000000e+000" + test "test5032" (lazy(sprintf "%- 01e" 5.0)) " 5.000000e+000" + test "test5033" (lazy(sprintf "%- 0*e" 7 5.0)) " 5.000000e+000" + test "test5034" (lazy(sprintf "%- 0.5e" 5.0)) " 5.00000e+000" + test "test5035" (lazy(sprintf "%- 0.*e" 4 5.0)) " 5.0000e+000" + test "test5036" (lazy(sprintf "%- 0*.*e" 5 4 5.0)) " 5.0000e+000" + test "test5037" (lazy(sprintf "%e" -10.0)) "-1.000000e+001" + test "test5038" (lazy(sprintf "%5e" -10.0)) "-1.000000e+001" + test "test5039" (lazy(sprintf "%1e" -10.0)) "-1.000000e+001" + test "test5040" (lazy(sprintf "%*e" 7 -10.0)) "-1.000000e+001" + test "test5041" (lazy(sprintf "%.5e" -10.0)) "-1.00000e+001" + test "test5042" (lazy(sprintf "%.*e" 4 -10.0)) "-1.0000e+001" + test "test5043" (lazy(sprintf "%*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5044" (lazy(sprintf "%-e" -10.0)) "-1.000000e+001" + test "test5045" (lazy(sprintf "%-5e" -10.0)) "-1.000000e+001" + test "test5046" (lazy(sprintf "%-1e" -10.0)) "-1.000000e+001" + test "test5047" (lazy(sprintf "%-*e" 7 -10.0)) "-1.000000e+001" + test "test5048" (lazy(sprintf "%-.5e" -10.0)) "-1.00000e+001" + test "test5049" (lazy(sprintf "%-.*e" 4 -10.0)) "-1.0000e+001" + test "test5050" (lazy(sprintf "%-*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5051" (lazy(sprintf "%0e" -10.0)) "-1.000000e+001" + test "test5052" (lazy(sprintf "%05e" -10.0)) "-1.000000e+001" + test "test5053" (lazy(sprintf "%01e" -10.0)) "-1.000000e+001" + test "test5054" (lazy(sprintf "%0*e" 7 -10.0)) "-1.000000e+001" + test "test5055" (lazy(sprintf "%0.5e" -10.0)) "-1.00000e+001" + test "test5056" (lazy(sprintf "%0.*e" 4 -10.0)) "-1.0000e+001" + test "test5057" (lazy(sprintf "%0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5058" (lazy(sprintf "%-0e" -10.0)) "-1.000000e+001" + test "test5059" (lazy(sprintf "%-05e" -10.0)) "-1.000000e+001" + test "test5060" (lazy(sprintf "%-01e" -10.0)) "-1.000000e+001" + test "test5061" (lazy(sprintf "%-0*e" 7 -10.0)) "-1.000000e+001" + test "test5062" (lazy(sprintf "%-0.5e" -10.0)) "-1.00000e+001" + test "test5063" (lazy(sprintf "%-0.*e" 4 -10.0)) "-1.0000e+001" + test "test5064" (lazy(sprintf "%-0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5065" (lazy(sprintf "%+e" -10.0)) "-1.000000e+001" + test "test5066" (lazy(sprintf "%+5e" -10.0)) "-1.000000e+001" + test "test5067" (lazy(sprintf "%+1e" -10.0)) "-1.000000e+001" + test "test5068" (lazy(sprintf "%+*e" 7 -10.0)) "-1.000000e+001" + test "test5069" (lazy(sprintf "%+.5e" -10.0)) "-1.00000e+001" + test "test5070" (lazy(sprintf "%+.*e" 4 -10.0)) "-1.0000e+001" + test "test5071" (lazy(sprintf "%+*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5072" (lazy(sprintf "%-+e" -10.0)) "-1.000000e+001" + test "test5073" (lazy(sprintf "%-+5e" -10.0)) "-1.000000e+001" + test "test5074" (lazy(sprintf "%-+1e" -10.0)) "-1.000000e+001" + test "test5075" (lazy(sprintf "%-+*e" 7 -10.0)) "-1.000000e+001" + test "test5076" (lazy(sprintf "%-+.5e" -10.0)) "-1.00000e+001" + test "test5077" (lazy(sprintf "%-+.*e" 4 -10.0)) "-1.0000e+001" + test "test5078" (lazy(sprintf "%-+*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5079" (lazy(sprintf "%+0e" -10.0)) "-1.000000e+001" + test "test5080" (lazy(sprintf "%+05e" -10.0)) "-1.000000e+001" + test "test5081" (lazy(sprintf "%+01e" -10.0)) "-1.000000e+001" + test "test5082" (lazy(sprintf "%+0*e" 7 -10.0)) "-1.000000e+001" + test "test5083" (lazy(sprintf "%+0.5e" -10.0)) "-1.00000e+001" + test "test5084" (lazy(sprintf "%+0.*e" 4 -10.0)) "-1.0000e+001" + test "test5085" (lazy(sprintf "%+0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5086" (lazy(sprintf "%-+0e" -10.0)) "-1.000000e+001" + test "test5087" (lazy(sprintf "%-+05e" -10.0)) "-1.000000e+001" + test "test5088" (lazy(sprintf "%-+01e" -10.0)) "-1.000000e+001" + test "test5089" (lazy(sprintf "%-+0*e" 7 -10.0)) "-1.000000e+001" + test "test5090" (lazy(sprintf "%-+0.5e" -10.0)) "-1.00000e+001" + test "test5091" (lazy(sprintf "%-+0.*e" 4 -10.0)) "-1.0000e+001" + test "test5092" (lazy(sprintf "%-+0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5093" (lazy(sprintf "% e" -10.0)) "-1.000000e+001" + test "test5094" (lazy(sprintf "% 5e" -10.0)) "-1.000000e+001" + test "test5095" (lazy(sprintf "% 1e" -10.0)) "-1.000000e+001" + test "test5096" (lazy(sprintf "% *e" 7 -10.0)) "-1.000000e+001" + test "test5097" (lazy(sprintf "% .5e" -10.0)) "-1.00000e+001" + test "test5098" (lazy(sprintf "% .*e" 4 -10.0)) "-1.0000e+001" + test "test5099" (lazy(sprintf "% *.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5100" (lazy(sprintf "%- e" -10.0)) "-1.000000e+001" + test "test5101" (lazy(sprintf "%- 5e" -10.0)) "-1.000000e+001" + test "test5102" (lazy(sprintf "%- 1e" -10.0)) "-1.000000e+001" + test "test5103" (lazy(sprintf "%- *e" 7 -10.0)) "-1.000000e+001" + test "test5104" (lazy(sprintf "%- .5e" -10.0)) "-1.00000e+001" + test "test5105" (lazy(sprintf "%- .*e" 4 -10.0)) "-1.0000e+001" + test "test5106" (lazy(sprintf "%- *.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5107" (lazy(sprintf "% 0e" -10.0)) "-1.000000e+001" + test "test5108" (lazy(sprintf "% 05e" -10.0)) "-1.000000e+001" + test "test5109" (lazy(sprintf "% 01e" -10.0)) "-1.000000e+001" + test "test5110" (lazy(sprintf "% 0*e" 7 -10.0)) "-1.000000e+001" + test "test5111" (lazy(sprintf "% 0.5e" -10.0)) "-1.00000e+001" + test "test5112" (lazy(sprintf "% 0.*e" 4 -10.0)) "-1.0000e+001" + test "test5113" (lazy(sprintf "% 0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5114" (lazy(sprintf "%- 0e" -10.0)) "-1.000000e+001" + test "test5115" (lazy(sprintf "%- 05e" -10.0)) "-1.000000e+001" + test "test5116" (lazy(sprintf "%- 01e" -10.0)) "-1.000000e+001" + test "test5117" (lazy(sprintf "%- 0*e" 7 -10.0)) "-1.000000e+001" + test "test5118" (lazy(sprintf "%- 0.5e" -10.0)) "-1.00000e+001" + test "test5119" (lazy(sprintf "%- 0.*e" 4 -10.0)) "-1.0000e+001" + test "test5120" (lazy(sprintf "%- 0*.*e" 5 4 -10.0)) "-1.0000e+001" + test "test5121" (lazy(sprintf "%e" 5.0f)) "5.000000e+000" + test "test5122" (lazy(sprintf "%5e" 5.0f)) "5.000000e+000" + test "test5123" (lazy(sprintf "%1e" 5.0f)) "5.000000e+000" + test "test5124" (lazy(sprintf "%*e" 7 5.0f)) "5.000000e+000" + test "test5125" (lazy(sprintf "%.5e" 5.0f)) "5.00000e+000" + test "test5126" (lazy(sprintf "%.*e" 4 5.0f)) "5.0000e+000" + test "test5127" (lazy(sprintf "%*.*e" 5 4 5.0f)) "5.0000e+000" + test "test5128" (lazy(sprintf "%-e" 5.0f)) "5.000000e+000" + test "test5129" (lazy(sprintf "%-5e" 5.0f)) "5.000000e+000" + test "test5130" (lazy(sprintf "%-1e" 5.0f)) "5.000000e+000" + test "test5131" (lazy(sprintf "%-*e" 7 5.0f)) "5.000000e+000" + test "test5132" (lazy(sprintf "%-.5e" 5.0f)) "5.00000e+000" + test "test5133" (lazy(sprintf "%-.*e" 4 5.0f)) "5.0000e+000" + test "test5134" (lazy(sprintf "%-*.*e" 5 4 5.0f)) "5.0000e+000" + test "test5135" (lazy(sprintf "%0e" 5.0f)) "5.000000e+000" + test "test5136" (lazy(sprintf "%05e" 5.0f)) "5.000000e+000" + test "test5137" (lazy(sprintf "%01e" 5.0f)) "5.000000e+000" + test "test5138" (lazy(sprintf "%0*e" 7 5.0f)) "5.000000e+000" + test "test5139" (lazy(sprintf "%0.5e" 5.0f)) "5.00000e+000" + test "test5140" (lazy(sprintf "%0.*e" 4 5.0f)) "5.0000e+000" + test "test5141" (lazy(sprintf "%0*.*e" 5 4 5.0f)) "5.0000e+000" + test "test5142" (lazy(sprintf "%-0e" 5.0f)) "5.000000e+000" + test "test5143" (lazy(sprintf "%-05e" 5.0f)) "5.000000e+000" + test "test5144" (lazy(sprintf "%-01e" 5.0f)) "5.000000e+000" + test "test5145" (lazy(sprintf "%-0*e" 7 5.0f)) "5.000000e+000" + test "test5146" (lazy(sprintf "%-0.5e" 5.0f)) "5.00000e+000" + test "test5147" (lazy(sprintf "%-0.*e" 4 5.0f)) "5.0000e+000" + test "test5148" (lazy(sprintf "%-0*.*e" 5 4 5.0f)) "5.0000e+000" + test "test5149" (lazy(sprintf "%+e" 5.0f)) "+5.000000e+000" + test "test5150" (lazy(sprintf "%+5e" 5.0f)) "+5.000000e+000" + test "test5151" (lazy(sprintf "%+1e" 5.0f)) "+5.000000e+000" + test "test5152" (lazy(sprintf "%+*e" 7 5.0f)) "+5.000000e+000" + test "test5153" (lazy(sprintf "%+.5e" 5.0f)) "+5.00000e+000" + test "test5154" (lazy(sprintf "%+.*e" 4 5.0f)) "+5.0000e+000" + test "test5155" (lazy(sprintf "%+*.*e" 5 4 5.0f)) "+5.0000e+000" + test "test5156" (lazy(sprintf "%-+e" 5.0f)) "+5.000000e+000" + test "test5157" (lazy(sprintf "%-+5e" 5.0f)) "+5.000000e+000" + test "test5158" (lazy(sprintf "%-+1e" 5.0f)) "+5.000000e+000" + test "test5159" (lazy(sprintf "%-+*e" 7 5.0f)) "+5.000000e+000" + test "test5160" (lazy(sprintf "%-+.5e" 5.0f)) "+5.00000e+000" + test "test5161" (lazy(sprintf "%-+.*e" 4 5.0f)) "+5.0000e+000" + test "test5162" (lazy(sprintf "%-+*.*e" 5 4 5.0f)) "+5.0000e+000" + test "test5163" (lazy(sprintf "%+0e" 5.0f)) "+5.000000e+000" + test "test5164" (lazy(sprintf "%+05e" 5.0f)) "+5.000000e+000" + test "test5165" (lazy(sprintf "%+01e" 5.0f)) "+5.000000e+000" + test "test5166" (lazy(sprintf "%+0*e" 7 5.0f)) "+5.000000e+000" + test "test5167" (lazy(sprintf "%+0.5e" 5.0f)) "+5.00000e+000" + test "test5168" (lazy(sprintf "%+0.*e" 4 5.0f)) "+5.0000e+000" + test "test5169" (lazy(sprintf "%+0*.*e" 5 4 5.0f)) "+5.0000e+000" + test "test5170" (lazy(sprintf "%-+0e" 5.0f)) "+5.000000e+000" + test "test5171" (lazy(sprintf "%-+05e" 5.0f)) "+5.000000e+000" + test "test5172" (lazy(sprintf "%-+01e" 5.0f)) "+5.000000e+000" + test "test5173" (lazy(sprintf "%-+0*e" 7 5.0f)) "+5.000000e+000" + test "test5174" (lazy(sprintf "%-+0.5e" 5.0f)) "+5.00000e+000" + test "test5175" (lazy(sprintf "%-+0.*e" 4 5.0f)) "+5.0000e+000" + test "test5176" (lazy(sprintf "%-+0*.*e" 5 4 5.0f)) "+5.0000e+000" + test "test5177" (lazy(sprintf "% e" 5.0f)) " 5.000000e+000" + test "test5178" (lazy(sprintf "% 5e" 5.0f)) " 5.000000e+000" + test "test5179" (lazy(sprintf "% 1e" 5.0f)) " 5.000000e+000" + test "test5180" (lazy(sprintf "% *e" 7 5.0f)) " 5.000000e+000" + test "test5181" (lazy(sprintf "% .5e" 5.0f)) " 5.00000e+000" + test "test5182" (lazy(sprintf "% .*e" 4 5.0f)) " 5.0000e+000" + test "test5183" (lazy(sprintf "% *.*e" 5 4 5.0f)) " 5.0000e+000" + test "test5184" (lazy(sprintf "%- e" 5.0f)) " 5.000000e+000" + test "test5185" (lazy(sprintf "%- 5e" 5.0f)) " 5.000000e+000" + test "test5186" (lazy(sprintf "%- 1e" 5.0f)) " 5.000000e+000" + test "test5187" (lazy(sprintf "%- *e" 7 5.0f)) " 5.000000e+000" + test "test5188" (lazy(sprintf "%- .5e" 5.0f)) " 5.00000e+000" + test "test5189" (lazy(sprintf "%- .*e" 4 5.0f)) " 5.0000e+000" + test "test5190" (lazy(sprintf "%- *.*e" 5 4 5.0f)) " 5.0000e+000" + test "test5191" (lazy(sprintf "% 0e" 5.0f)) " 5.000000e+000" + test "test5192" (lazy(sprintf "% 05e" 5.0f)) " 5.000000e+000" + test "test5193" (lazy(sprintf "% 01e" 5.0f)) " 5.000000e+000" + test "test5194" (lazy(sprintf "% 0*e" 7 5.0f)) " 5.000000e+000" + test "test5195" (lazy(sprintf "% 0.5e" 5.0f)) " 5.00000e+000" + test "test5196" (lazy(sprintf "% 0.*e" 4 5.0f)) " 5.0000e+000" + test "test5197" (lazy(sprintf "% 0*.*e" 5 4 5.0f)) " 5.0000e+000" + test "test5198" (lazy(sprintf "%- 0e" 5.0f)) " 5.000000e+000" + test "test5199" (lazy(sprintf "%- 05e" 5.0f)) " 5.000000e+000" + test "test5200" (lazy(sprintf "%- 01e" 5.0f)) " 5.000000e+000" + test "test5201" (lazy(sprintf "%- 0*e" 7 5.0f)) " 5.000000e+000" + test "test5202" (lazy(sprintf "%- 0.5e" 5.0f)) " 5.00000e+000" + test "test5203" (lazy(sprintf "%- 0.*e" 4 5.0f)) " 5.0000e+000" + test "test5204" (lazy(sprintf "%- 0*.*e" 5 4 5.0f)) " 5.0000e+000" + test "test5205" (lazy(sprintf "%e" -10.0f)) "-1.000000e+001" + test "test5206" (lazy(sprintf "%5e" -10.0f)) "-1.000000e+001" + test "test5207" (lazy(sprintf "%1e" -10.0f)) "-1.000000e+001" + test "test5208" (lazy(sprintf "%*e" 7 -10.0f)) "-1.000000e+001" + test "test5209" (lazy(sprintf "%.5e" -10.0f)) "-1.00000e+001" + test "test5210" (lazy(sprintf "%.*e" 4 -10.0f)) "-1.0000e+001" + test "test5211" (lazy(sprintf "%*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5212" (lazy(sprintf "%-e" -10.0f)) "-1.000000e+001" + test "test5213" (lazy(sprintf "%-5e" -10.0f)) "-1.000000e+001" + test "test5214" (lazy(sprintf "%-1e" -10.0f)) "-1.000000e+001" + test "test5215" (lazy(sprintf "%-*e" 7 -10.0f)) "-1.000000e+001" + test "test5216" (lazy(sprintf "%-.5e" -10.0f)) "-1.00000e+001" + test "test5217" (lazy(sprintf "%-.*e" 4 -10.0f)) "-1.0000e+001" + test "test5218" (lazy(sprintf "%-*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5219" (lazy(sprintf "%0e" -10.0f)) "-1.000000e+001" + test "test5220" (lazy(sprintf "%05e" -10.0f)) "-1.000000e+001" + test "test5221" (lazy(sprintf "%01e" -10.0f)) "-1.000000e+001" + test "test5222" (lazy(sprintf "%0*e" 7 -10.0f)) "-1.000000e+001" + test "test5223" (lazy(sprintf "%0.5e" -10.0f)) "-1.00000e+001" + test "test5224" (lazy(sprintf "%0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5225" (lazy(sprintf "%0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5226" (lazy(sprintf "%-0e" -10.0f)) "-1.000000e+001" + test "test5227" (lazy(sprintf "%-05e" -10.0f)) "-1.000000e+001" + test "test5228" (lazy(sprintf "%-01e" -10.0f)) "-1.000000e+001" + test "test5229" (lazy(sprintf "%-0*e" 7 -10.0f)) "-1.000000e+001" + test "test5230" (lazy(sprintf "%-0.5e" -10.0f)) "-1.00000e+001" + test "test5231" (lazy(sprintf "%-0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5232" (lazy(sprintf "%-0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5233" (lazy(sprintf "%+e" -10.0f)) "-1.000000e+001" + test "test5234" (lazy(sprintf "%+5e" -10.0f)) "-1.000000e+001" + test "test5235" (lazy(sprintf "%+1e" -10.0f)) "-1.000000e+001" + test "test5236" (lazy(sprintf "%+*e" 7 -10.0f)) "-1.000000e+001" + test "test5237" (lazy(sprintf "%+.5e" -10.0f)) "-1.00000e+001" + test "test5238" (lazy(sprintf "%+.*e" 4 -10.0f)) "-1.0000e+001" + test "test5239" (lazy(sprintf "%+*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5240" (lazy(sprintf "%-+e" -10.0f)) "-1.000000e+001" + test "test5241" (lazy(sprintf "%-+5e" -10.0f)) "-1.000000e+001" + test "test5242" (lazy(sprintf "%-+1e" -10.0f)) "-1.000000e+001" + test "test5243" (lazy(sprintf "%-+*e" 7 -10.0f)) "-1.000000e+001" + test "test5244" (lazy(sprintf "%-+.5e" -10.0f)) "-1.00000e+001" + test "test5245" (lazy(sprintf "%-+.*e" 4 -10.0f)) "-1.0000e+001" + test "test5246" (lazy(sprintf "%-+*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5247" (lazy(sprintf "%+0e" -10.0f)) "-1.000000e+001" + test "test5248" (lazy(sprintf "%+05e" -10.0f)) "-1.000000e+001" + test "test5249" (lazy(sprintf "%+01e" -10.0f)) "-1.000000e+001" + test "test5250" (lazy(sprintf "%+0*e" 7 -10.0f)) "-1.000000e+001" + test "test5251" (lazy(sprintf "%+0.5e" -10.0f)) "-1.00000e+001" + test "test5252" (lazy(sprintf "%+0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5253" (lazy(sprintf "%+0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5254" (lazy(sprintf "%-+0e" -10.0f)) "-1.000000e+001" + test "test5255" (lazy(sprintf "%-+05e" -10.0f)) "-1.000000e+001" + test "test5256" (lazy(sprintf "%-+01e" -10.0f)) "-1.000000e+001" + test "test5257" (lazy(sprintf "%-+0*e" 7 -10.0f)) "-1.000000e+001" + test "test5258" (lazy(sprintf "%-+0.5e" -10.0f)) "-1.00000e+001" + test "test5259" (lazy(sprintf "%-+0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5260" (lazy(sprintf "%-+0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5261" (lazy(sprintf "% e" -10.0f)) "-1.000000e+001" + test "test5262" (lazy(sprintf "% 5e" -10.0f)) "-1.000000e+001" + test "test5263" (lazy(sprintf "% 1e" -10.0f)) "-1.000000e+001" + test "test5264" (lazy(sprintf "% *e" 7 -10.0f)) "-1.000000e+001" + test "test5265" (lazy(sprintf "% .5e" -10.0f)) "-1.00000e+001" + test "test5266" (lazy(sprintf "% .*e" 4 -10.0f)) "-1.0000e+001" + test "test5267" (lazy(sprintf "% *.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5268" (lazy(sprintf "%- e" -10.0f)) "-1.000000e+001" + test "test5269" (lazy(sprintf "%- 5e" -10.0f)) "-1.000000e+001" + test "test5270" (lazy(sprintf "%- 1e" -10.0f)) "-1.000000e+001" + test "test5271" (lazy(sprintf "%- *e" 7 -10.0f)) "-1.000000e+001" + test "test5272" (lazy(sprintf "%- .5e" -10.0f)) "-1.00000e+001" + test "test5273" (lazy(sprintf "%- .*e" 4 -10.0f)) "-1.0000e+001" + test "test5274" (lazy(sprintf "%- *.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5275" (lazy(sprintf "% 0e" -10.0f)) "-1.000000e+001" + test "test5276" (lazy(sprintf "% 05e" -10.0f)) "-1.000000e+001" + test "test5277" (lazy(sprintf "% 01e" -10.0f)) "-1.000000e+001" + test "test5278" (lazy(sprintf "% 0*e" 7 -10.0f)) "-1.000000e+001" + test "test5279" (lazy(sprintf "% 0.5e" -10.0f)) "-1.00000e+001" + test "test5280" (lazy(sprintf "% 0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5281" (lazy(sprintf "% 0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5282" (lazy(sprintf "%- 0e" -10.0f)) "-1.000000e+001" + test "test5283" (lazy(sprintf "%- 05e" -10.0f)) "-1.000000e+001" + test "test5284" (lazy(sprintf "%- 01e" -10.0f)) "-1.000000e+001" + test "test5285" (lazy(sprintf "%- 0*e" 7 -10.0f)) "-1.000000e+001" + test "test5286" (lazy(sprintf "%- 0.5e" -10.0f)) "-1.00000e+001" + test "test5287" (lazy(sprintf "%- 0.*e" 4 -10.0f)) "-1.0000e+001" + test "test5288" (lazy(sprintf "%- 0*.*e" 5 4 -10.0f)) "-1.0000e+001" + test "test5289" (lazy(sprintf "%e" 5.0M)) "5.000000e+000" + test "test5290" (lazy(sprintf "%5e" 5.0M)) "5.000000e+000" + test "test5291" (lazy(sprintf "%1e" 5.0M)) "5.000000e+000" + test "test5292" (lazy(sprintf "%*e" 7 5.0M)) "5.000000e+000" + test "test5293" (lazy(sprintf "%.5e" 5.0M)) "5.00000e+000" + test "test5294" (lazy(sprintf "%.*e" 4 5.0M)) "5.0000e+000" + test "test5295" (lazy(sprintf "%*.*e" 5 4 5.0M)) "5.0000e+000" + test "test5296" (lazy(sprintf "%-e" 5.0M)) "5.000000e+000" + test "test5297" (lazy(sprintf "%-5e" 5.0M)) "5.000000e+000" + test "test5298" (lazy(sprintf "%-1e" 5.0M)) "5.000000e+000" + test "test5299" (lazy(sprintf "%-*e" 7 5.0M)) "5.000000e+000" + test "test5300" (lazy(sprintf "%-.5e" 5.0M)) "5.00000e+000" + test "test5301" (lazy(sprintf "%-.*e" 4 5.0M)) "5.0000e+000" + test "test5302" (lazy(sprintf "%-*.*e" 5 4 5.0M)) "5.0000e+000" + test "test5303" (lazy(sprintf "%0e" 5.0M)) "5.000000e+000" + test "test5304" (lazy(sprintf "%05e" 5.0M)) "5.000000e+000" + test "test5305" (lazy(sprintf "%01e" 5.0M)) "5.000000e+000" + test "test5306" (lazy(sprintf "%0*e" 7 5.0M)) "5.000000e+000" + test "test5307" (lazy(sprintf "%0.5e" 5.0M)) "5.00000e+000" + test "test5308" (lazy(sprintf "%0.*e" 4 5.0M)) "5.0000e+000" + test "test5309" (lazy(sprintf "%0*.*e" 5 4 5.0M)) "5.0000e+000" + test "test5310" (lazy(sprintf "%-0e" 5.0M)) "5.000000e+000" + test "test5311" (lazy(sprintf "%-05e" 5.0M)) "5.000000e+000" + test "test5312" (lazy(sprintf "%-01e" 5.0M)) "5.000000e+000" + test "test5313" (lazy(sprintf "%-0*e" 7 5.0M)) "5.000000e+000" + test "test5314" (lazy(sprintf "%-0.5e" 5.0M)) "5.00000e+000" + test "test5315" (lazy(sprintf "%-0.*e" 4 5.0M)) "5.0000e+000" + test "test5316" (lazy(sprintf "%-0*.*e" 5 4 5.0M)) "5.0000e+000" + test "test5317" (lazy(sprintf "%+e" 5.0M)) "+5.000000e+000" + test "test5318" (lazy(sprintf "%+5e" 5.0M)) "+5.000000e+000" + test "test5319" (lazy(sprintf "%+1e" 5.0M)) "+5.000000e+000" + test "test5320" (lazy(sprintf "%+*e" 7 5.0M)) "+5.000000e+000" + test "test5321" (lazy(sprintf "%+.5e" 5.0M)) "+5.00000e+000" + test "test5322" (lazy(sprintf "%+.*e" 4 5.0M)) "+5.0000e+000" + test "test5323" (lazy(sprintf "%+*.*e" 5 4 5.0M)) "+5.0000e+000" + test "test5324" (lazy(sprintf "%-+e" 5.0M)) "+5.000000e+000" + test "test5325" (lazy(sprintf "%-+5e" 5.0M)) "+5.000000e+000" + test "test5326" (lazy(sprintf "%-+1e" 5.0M)) "+5.000000e+000" + test "test5327" (lazy(sprintf "%-+*e" 7 5.0M)) "+5.000000e+000" + test "test5328" (lazy(sprintf "%-+.5e" 5.0M)) "+5.00000e+000" + test "test5329" (lazy(sprintf "%-+.*e" 4 5.0M)) "+5.0000e+000" + test "test5330" (lazy(sprintf "%-+*.*e" 5 4 5.0M)) "+5.0000e+000" + test "test5331" (lazy(sprintf "%+0e" 5.0M)) "+5.000000e+000" + test "test5332" (lazy(sprintf "%+05e" 5.0M)) "+5.000000e+000" + test "test5333" (lazy(sprintf "%+01e" 5.0M)) "+5.000000e+000" + test "test5334" (lazy(sprintf "%+0*e" 7 5.0M)) "+5.000000e+000" + test "test5335" (lazy(sprintf "%+0.5e" 5.0M)) "+5.00000e+000" + test "test5336" (lazy(sprintf "%+0.*e" 4 5.0M)) "+5.0000e+000" + test "test5337" (lazy(sprintf "%+0*.*e" 5 4 5.0M)) "+5.0000e+000" + test "test5338" (lazy(sprintf "%-+0e" 5.0M)) "+5.000000e+000" + test "test5339" (lazy(sprintf "%-+05e" 5.0M)) "+5.000000e+000" + test "test5340" (lazy(sprintf "%-+01e" 5.0M)) "+5.000000e+000" + test "test5341" (lazy(sprintf "%-+0*e" 7 5.0M)) "+5.000000e+000" + test "test5342" (lazy(sprintf "%-+0.5e" 5.0M)) "+5.00000e+000" + test "test5343" (lazy(sprintf "%-+0.*e" 4 5.0M)) "+5.0000e+000" + test "test5344" (lazy(sprintf "%-+0*.*e" 5 4 5.0M)) "+5.0000e+000" + test "test5345" (lazy(sprintf "% e" 5.0M)) " 5.000000e+000" + test "test5346" (lazy(sprintf "% 5e" 5.0M)) " 5.000000e+000" + test "test5347" (lazy(sprintf "% 1e" 5.0M)) " 5.000000e+000" + test "test5348" (lazy(sprintf "% *e" 7 5.0M)) " 5.000000e+000" + test "test5349" (lazy(sprintf "% .5e" 5.0M)) " 5.00000e+000" + test "test5350" (lazy(sprintf "% .*e" 4 5.0M)) " 5.0000e+000" + test "test5351" (lazy(sprintf "% *.*e" 5 4 5.0M)) " 5.0000e+000" + test "test5352" (lazy(sprintf "%- e" 5.0M)) " 5.000000e+000" + test "test5353" (lazy(sprintf "%- 5e" 5.0M)) " 5.000000e+000" + test "test5354" (lazy(sprintf "%- 1e" 5.0M)) " 5.000000e+000" + test "test5355" (lazy(sprintf "%- *e" 7 5.0M)) " 5.000000e+000" + test "test5356" (lazy(sprintf "%- .5e" 5.0M)) " 5.00000e+000" + test "test5357" (lazy(sprintf "%- .*e" 4 5.0M)) " 5.0000e+000" + test "test5358" (lazy(sprintf "%- *.*e" 5 4 5.0M)) " 5.0000e+000" + test "test5359" (lazy(sprintf "% 0e" 5.0M)) " 5.000000e+000" + test "test5360" (lazy(sprintf "% 05e" 5.0M)) " 5.000000e+000" + test "test5361" (lazy(sprintf "% 01e" 5.0M)) " 5.000000e+000" + test "test5362" (lazy(sprintf "% 0*e" 7 5.0M)) " 5.000000e+000" + test "test5363" (lazy(sprintf "% 0.5e" 5.0M)) " 5.00000e+000" + test "test5364" (lazy(sprintf "% 0.*e" 4 5.0M)) " 5.0000e+000" + test "test5365" (lazy(sprintf "% 0*.*e" 5 4 5.0M)) " 5.0000e+000" + test "test5366" (lazy(sprintf "%- 0e" 5.0M)) " 5.000000e+000" + test "test5367" (lazy(sprintf "%- 05e" 5.0M)) " 5.000000e+000" + test "test5368" (lazy(sprintf "%- 01e" 5.0M)) " 5.000000e+000" + test "test5369" (lazy(sprintf "%- 0*e" 7 5.0M)) " 5.000000e+000" + test "test5370" (lazy(sprintf "%- 0.5e" 5.0M)) " 5.00000e+000" + test "test5371" (lazy(sprintf "%- 0.*e" 4 5.0M)) " 5.0000e+000" + test "test5372" (lazy(sprintf "%- 0*.*e" 5 4 5.0M)) " 5.0000e+000" + test "test5373" (lazy(sprintf "%e" -10.0M)) "-1.000000e+001" + test "test5374" (lazy(sprintf "%5e" -10.0M)) "-1.000000e+001" + test "test5375" (lazy(sprintf "%1e" -10.0M)) "-1.000000e+001" + test "test5376" (lazy(sprintf "%*e" 7 -10.0M)) "-1.000000e+001" + test "test5377" (lazy(sprintf "%.5e" -10.0M)) "-1.00000e+001" + test "test5378" (lazy(sprintf "%.*e" 4 -10.0M)) "-1.0000e+001" + test "test5379" (lazy(sprintf "%*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5380" (lazy(sprintf "%-e" -10.0M)) "-1.000000e+001" + test "test5381" (lazy(sprintf "%-5e" -10.0M)) "-1.000000e+001" + test "test5382" (lazy(sprintf "%-1e" -10.0M)) "-1.000000e+001" + test "test5383" (lazy(sprintf "%-*e" 7 -10.0M)) "-1.000000e+001" + test "test5384" (lazy(sprintf "%-.5e" -10.0M)) "-1.00000e+001" + test "test5385" (lazy(sprintf "%-.*e" 4 -10.0M)) "-1.0000e+001" + test "test5386" (lazy(sprintf "%-*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5387" (lazy(sprintf "%0e" -10.0M)) "-1.000000e+001" + test "test5388" (lazy(sprintf "%05e" -10.0M)) "-1.000000e+001" + test "test5389" (lazy(sprintf "%01e" -10.0M)) "-1.000000e+001" + test "test5390" (lazy(sprintf "%0*e" 7 -10.0M)) "-1.000000e+001" + test "test5391" (lazy(sprintf "%0.5e" -10.0M)) "-1.00000e+001" + test "test5392" (lazy(sprintf "%0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5393" (lazy(sprintf "%0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5394" (lazy(sprintf "%-0e" -10.0M)) "-1.000000e+001" + test "test5395" (lazy(sprintf "%-05e" -10.0M)) "-1.000000e+001" + test "test5396" (lazy(sprintf "%-01e" -10.0M)) "-1.000000e+001" + test "test5397" (lazy(sprintf "%-0*e" 7 -10.0M)) "-1.000000e+001" + test "test5398" (lazy(sprintf "%-0.5e" -10.0M)) "-1.00000e+001" + test "test5399" (lazy(sprintf "%-0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5400" (lazy(sprintf "%-0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5401" (lazy(sprintf "%+e" -10.0M)) "-1.000000e+001" + test "test5402" (lazy(sprintf "%+5e" -10.0M)) "-1.000000e+001" + test "test5403" (lazy(sprintf "%+1e" -10.0M)) "-1.000000e+001" + test "test5404" (lazy(sprintf "%+*e" 7 -10.0M)) "-1.000000e+001" + test "test5405" (lazy(sprintf "%+.5e" -10.0M)) "-1.00000e+001" + test "test5406" (lazy(sprintf "%+.*e" 4 -10.0M)) "-1.0000e+001" + test "test5407" (lazy(sprintf "%+*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5408" (lazy(sprintf "%-+e" -10.0M)) "-1.000000e+001" + test "test5409" (lazy(sprintf "%-+5e" -10.0M)) "-1.000000e+001" + test "test5410" (lazy(sprintf "%-+1e" -10.0M)) "-1.000000e+001" + test "test5411" (lazy(sprintf "%-+*e" 7 -10.0M)) "-1.000000e+001" + test "test5412" (lazy(sprintf "%-+.5e" -10.0M)) "-1.00000e+001" + test "test5413" (lazy(sprintf "%-+.*e" 4 -10.0M)) "-1.0000e+001" + test "test5414" (lazy(sprintf "%-+*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5415" (lazy(sprintf "%+0e" -10.0M)) "-1.000000e+001" + test "test5416" (lazy(sprintf "%+05e" -10.0M)) "-1.000000e+001" + test "test5417" (lazy(sprintf "%+01e" -10.0M)) "-1.000000e+001" + test "test5418" (lazy(sprintf "%+0*e" 7 -10.0M)) "-1.000000e+001" + test "test5419" (lazy(sprintf "%+0.5e" -10.0M)) "-1.00000e+001" + test "test5420" (lazy(sprintf "%+0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5421" (lazy(sprintf "%+0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5422" (lazy(sprintf "%-+0e" -10.0M)) "-1.000000e+001" + test "test5423" (lazy(sprintf "%-+05e" -10.0M)) "-1.000000e+001" + test "test5424" (lazy(sprintf "%-+01e" -10.0M)) "-1.000000e+001" + test "test5425" (lazy(sprintf "%-+0*e" 7 -10.0M)) "-1.000000e+001" + test "test5426" (lazy(sprintf "%-+0.5e" -10.0M)) "-1.00000e+001" + test "test5427" (lazy(sprintf "%-+0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5428" (lazy(sprintf "%-+0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5429" (lazy(sprintf "% e" -10.0M)) "-1.000000e+001" + test "test5430" (lazy(sprintf "% 5e" -10.0M)) "-1.000000e+001" + test "test5431" (lazy(sprintf "% 1e" -10.0M)) "-1.000000e+001" + test "test5432" (lazy(sprintf "% *e" 7 -10.0M)) "-1.000000e+001" + test "test5433" (lazy(sprintf "% .5e" -10.0M)) "-1.00000e+001" + test "test5434" (lazy(sprintf "% .*e" 4 -10.0M)) "-1.0000e+001" + test "test5435" (lazy(sprintf "% *.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5436" (lazy(sprintf "%- e" -10.0M)) "-1.000000e+001" + test "test5437" (lazy(sprintf "%- 5e" -10.0M)) "-1.000000e+001" + test "test5438" (lazy(sprintf "%- 1e" -10.0M)) "-1.000000e+001" + test "test5439" (lazy(sprintf "%- *e" 7 -10.0M)) "-1.000000e+001" + test "test5440" (lazy(sprintf "%- .5e" -10.0M)) "-1.00000e+001" + test "test5441" (lazy(sprintf "%- .*e" 4 -10.0M)) "-1.0000e+001" + test "test5442" (lazy(sprintf "%- *.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5443" (lazy(sprintf "% 0e" -10.0M)) "-1.000000e+001" + test "test5444" (lazy(sprintf "% 05e" -10.0M)) "-1.000000e+001" + test "test5445" (lazy(sprintf "% 01e" -10.0M)) "-1.000000e+001" + test "test5446" (lazy(sprintf "% 0*e" 7 -10.0M)) "-1.000000e+001" + test "test5447" (lazy(sprintf "% 0.5e" -10.0M)) "-1.00000e+001" + test "test5448" (lazy(sprintf "% 0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5449" (lazy(sprintf "% 0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5450" (lazy(sprintf "%- 0e" -10.0M)) "-1.000000e+001" + test "test5451" (lazy(sprintf "%- 05e" -10.0M)) "-1.000000e+001" + test "test5452" (lazy(sprintf "%- 01e" -10.0M)) "-1.000000e+001" + test "test5453" (lazy(sprintf "%- 0*e" 7 -10.0M)) "-1.000000e+001" + test "test5454" (lazy(sprintf "%- 0.5e" -10.0M)) "-1.00000e+001" + test "test5455" (lazy(sprintf "%- 0.*e" 4 -10.0M)) "-1.0000e+001" + test "test5456" (lazy(sprintf "%- 0*.*e" 5 4 -10.0M)) "-1.0000e+001" + test "test5457" (lazy(sprintf "%E" 5.0)) "5.000000E+000" + test "test5458" (lazy(sprintf "%5E" 5.0)) "5.000000E+000" + test "test5459" (lazy(sprintf "%1E" 5.0)) "5.000000E+000" + test "test5460" (lazy(sprintf "%*E" 7 5.0)) "5.000000E+000" + test "test5461" (lazy(sprintf "%.5E" 5.0)) "5.00000E+000" + test "test5462" (lazy(sprintf "%.*E" 4 5.0)) "5.0000E+000" + test "test5463" (lazy(sprintf "%*.*E" 5 4 5.0)) "5.0000E+000" + test "test5464" (lazy(sprintf "%-E" 5.0)) "5.000000E+000" + test "test5465" (lazy(sprintf "%-5E" 5.0)) "5.000000E+000" + test "test5466" (lazy(sprintf "%-1E" 5.0)) "5.000000E+000" + test "test5467" (lazy(sprintf "%-*E" 7 5.0)) "5.000000E+000" + test "test5468" (lazy(sprintf "%-.5E" 5.0)) "5.00000E+000" + test "test5469" (lazy(sprintf "%-.*E" 4 5.0)) "5.0000E+000" + test "test5470" (lazy(sprintf "%-*.*E" 5 4 5.0)) "5.0000E+000" + test "test5471" (lazy(sprintf "%0E" 5.0)) "5.000000E+000" + test "test5472" (lazy(sprintf "%05E" 5.0)) "5.000000E+000" + test "test5473" (lazy(sprintf "%01E" 5.0)) "5.000000E+000" + test "test5474" (lazy(sprintf "%0*E" 7 5.0)) "5.000000E+000" + test "test5475" (lazy(sprintf "%0.5E" 5.0)) "5.00000E+000" + test "test5476" (lazy(sprintf "%0.*E" 4 5.0)) "5.0000E+000" + test "test5477" (lazy(sprintf "%0*.*E" 5 4 5.0)) "5.0000E+000" + test "test5478" (lazy(sprintf "%-0E" 5.0)) "5.000000E+000" + test "test5479" (lazy(sprintf "%-05E" 5.0)) "5.000000E+000" + test "test5480" (lazy(sprintf "%-01E" 5.0)) "5.000000E+000" + test "test5481" (lazy(sprintf "%-0*E" 7 5.0)) "5.000000E+000" + test "test5482" (lazy(sprintf "%-0.5E" 5.0)) "5.00000E+000" + test "test5483" (lazy(sprintf "%-0.*E" 4 5.0)) "5.0000E+000" + test "test5484" (lazy(sprintf "%-0*.*E" 5 4 5.0)) "5.0000E+000" + test "test5485" (lazy(sprintf "%+E" 5.0)) "+5.000000E+000" + test "test5486" (lazy(sprintf "%+5E" 5.0)) "+5.000000E+000" + test "test5487" (lazy(sprintf "%+1E" 5.0)) "+5.000000E+000" + test "test5488" (lazy(sprintf "%+*E" 7 5.0)) "+5.000000E+000" + test "test5489" (lazy(sprintf "%+.5E" 5.0)) "+5.00000E+000" + test "test5490" (lazy(sprintf "%+.*E" 4 5.0)) "+5.0000E+000" + test "test5491" (lazy(sprintf "%+*.*E" 5 4 5.0)) "+5.0000E+000" + test "test5492" (lazy(sprintf "%-+E" 5.0)) "+5.000000E+000" + test "test5493" (lazy(sprintf "%-+5E" 5.0)) "+5.000000E+000" + test "test5494" (lazy(sprintf "%-+1E" 5.0)) "+5.000000E+000" + test "test5495" (lazy(sprintf "%-+*E" 7 5.0)) "+5.000000E+000" + test "test5496" (lazy(sprintf "%-+.5E" 5.0)) "+5.00000E+000" + test "test5497" (lazy(sprintf "%-+.*E" 4 5.0)) "+5.0000E+000" + test "test5498" (lazy(sprintf "%-+*.*E" 5 4 5.0)) "+5.0000E+000" + test "test5499" (lazy(sprintf "%+0E" 5.0)) "+5.000000E+000" + test "test5500" (lazy(sprintf "%+05E" 5.0)) "+5.000000E+000" + test "test5501" (lazy(sprintf "%+01E" 5.0)) "+5.000000E+000" + test "test5502" (lazy(sprintf "%+0*E" 7 5.0)) "+5.000000E+000" + test "test5503" (lazy(sprintf "%+0.5E" 5.0)) "+5.00000E+000" + test "test5504" (lazy(sprintf "%+0.*E" 4 5.0)) "+5.0000E+000" + test "test5505" (lazy(sprintf "%+0*.*E" 5 4 5.0)) "+5.0000E+000" + test "test5506" (lazy(sprintf "%-+0E" 5.0)) "+5.000000E+000" + test "test5507" (lazy(sprintf "%-+05E" 5.0)) "+5.000000E+000" + test "test5508" (lazy(sprintf "%-+01E" 5.0)) "+5.000000E+000" + test "test5509" (lazy(sprintf "%-+0*E" 7 5.0)) "+5.000000E+000" + test "test5510" (lazy(sprintf "%-+0.5E" 5.0)) "+5.00000E+000" + test "test5511" (lazy(sprintf "%-+0.*E" 4 5.0)) "+5.0000E+000" + test "test5512" (lazy(sprintf "%-+0*.*E" 5 4 5.0)) "+5.0000E+000" + test "test5513" (lazy(sprintf "% E" 5.0)) " 5.000000E+000" + test "test5514" (lazy(sprintf "% 5E" 5.0)) " 5.000000E+000" + test "test5515" (lazy(sprintf "% 1E" 5.0)) " 5.000000E+000" + test "test5516" (lazy(sprintf "% *E" 7 5.0)) " 5.000000E+000" + test "test5517" (lazy(sprintf "% .5E" 5.0)) " 5.00000E+000" + test "test5518" (lazy(sprintf "% .*E" 4 5.0)) " 5.0000E+000" + test "test5519" (lazy(sprintf "% *.*E" 5 4 5.0)) " 5.0000E+000" + test "test5520" (lazy(sprintf "%- E" 5.0)) " 5.000000E+000" + test "test5521" (lazy(sprintf "%- 5E" 5.0)) " 5.000000E+000" + test "test5522" (lazy(sprintf "%- 1E" 5.0)) " 5.000000E+000" + test "test5523" (lazy(sprintf "%- *E" 7 5.0)) " 5.000000E+000" + test "test5524" (lazy(sprintf "%- .5E" 5.0)) " 5.00000E+000" + test "test5525" (lazy(sprintf "%- .*E" 4 5.0)) " 5.0000E+000" + test "test5526" (lazy(sprintf "%- *.*E" 5 4 5.0)) " 5.0000E+000" + test "test5527" (lazy(sprintf "% 0E" 5.0)) " 5.000000E+000" + test "test5528" (lazy(sprintf "% 05E" 5.0)) " 5.000000E+000" + test "test5529" (lazy(sprintf "% 01E" 5.0)) " 5.000000E+000" + test "test5530" (lazy(sprintf "% 0*E" 7 5.0)) " 5.000000E+000" + test "test5531" (lazy(sprintf "% 0.5E" 5.0)) " 5.00000E+000" + test "test5532" (lazy(sprintf "% 0.*E" 4 5.0)) " 5.0000E+000" + test "test5533" (lazy(sprintf "% 0*.*E" 5 4 5.0)) " 5.0000E+000" + test "test5534" (lazy(sprintf "%- 0E" 5.0)) " 5.000000E+000" + test "test5535" (lazy(sprintf "%- 05E" 5.0)) " 5.000000E+000" + test "test5536" (lazy(sprintf "%- 01E" 5.0)) " 5.000000E+000" + test "test5537" (lazy(sprintf "%- 0*E" 7 5.0)) " 5.000000E+000" + test "test5538" (lazy(sprintf "%- 0.5E" 5.0)) " 5.00000E+000" + test "test5539" (lazy(sprintf "%- 0.*E" 4 5.0)) " 5.0000E+000" + test "test5540" (lazy(sprintf "%- 0*.*E" 5 4 5.0)) " 5.0000E+000" + test "test5541" (lazy(sprintf "%E" -10.0)) "-1.000000E+001" + test "test5542" (lazy(sprintf "%5E" -10.0)) "-1.000000E+001" + test "test5543" (lazy(sprintf "%1E" -10.0)) "-1.000000E+001" + test "test5544" (lazy(sprintf "%*E" 7 -10.0)) "-1.000000E+001" + test "test5545" (lazy(sprintf "%.5E" -10.0)) "-1.00000E+001" + test "test5546" (lazy(sprintf "%.*E" 4 -10.0)) "-1.0000E+001" + test "test5547" (lazy(sprintf "%*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5548" (lazy(sprintf "%-E" -10.0)) "-1.000000E+001" + test "test5549" (lazy(sprintf "%-5E" -10.0)) "-1.000000E+001" + test "test5550" (lazy(sprintf "%-1E" -10.0)) "-1.000000E+001" + test "test5551" (lazy(sprintf "%-*E" 7 -10.0)) "-1.000000E+001" + test "test5552" (lazy(sprintf "%-.5E" -10.0)) "-1.00000E+001" + test "test5553" (lazy(sprintf "%-.*E" 4 -10.0)) "-1.0000E+001" + test "test5554" (lazy(sprintf "%-*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5555" (lazy(sprintf "%0E" -10.0)) "-1.000000E+001" + test "test5556" (lazy(sprintf "%05E" -10.0)) "-1.000000E+001" + test "test5557" (lazy(sprintf "%01E" -10.0)) "-1.000000E+001" + test "test5558" (lazy(sprintf "%0*E" 7 -10.0)) "-1.000000E+001" + test "test5559" (lazy(sprintf "%0.5E" -10.0)) "-1.00000E+001" + test "test5560" (lazy(sprintf "%0.*E" 4 -10.0)) "-1.0000E+001" + test "test5561" (lazy(sprintf "%0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5562" (lazy(sprintf "%-0E" -10.0)) "-1.000000E+001" + test "test5563" (lazy(sprintf "%-05E" -10.0)) "-1.000000E+001" + test "test5564" (lazy(sprintf "%-01E" -10.0)) "-1.000000E+001" + test "test5565" (lazy(sprintf "%-0*E" 7 -10.0)) "-1.000000E+001" + test "test5566" (lazy(sprintf "%-0.5E" -10.0)) "-1.00000E+001" + test "test5567" (lazy(sprintf "%-0.*E" 4 -10.0)) "-1.0000E+001" + test "test5568" (lazy(sprintf "%-0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5569" (lazy(sprintf "%+E" -10.0)) "-1.000000E+001" + test "test5570" (lazy(sprintf "%+5E" -10.0)) "-1.000000E+001" + test "test5571" (lazy(sprintf "%+1E" -10.0)) "-1.000000E+001" + test "test5572" (lazy(sprintf "%+*E" 7 -10.0)) "-1.000000E+001" + test "test5573" (lazy(sprintf "%+.5E" -10.0)) "-1.00000E+001" + test "test5574" (lazy(sprintf "%+.*E" 4 -10.0)) "-1.0000E+001" + test "test5575" (lazy(sprintf "%+*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5576" (lazy(sprintf "%-+E" -10.0)) "-1.000000E+001" + test "test5577" (lazy(sprintf "%-+5E" -10.0)) "-1.000000E+001" + test "test5578" (lazy(sprintf "%-+1E" -10.0)) "-1.000000E+001" + test "test5579" (lazy(sprintf "%-+*E" 7 -10.0)) "-1.000000E+001" + test "test5580" (lazy(sprintf "%-+.5E" -10.0)) "-1.00000E+001" + test "test5581" (lazy(sprintf "%-+.*E" 4 -10.0)) "-1.0000E+001" + test "test5582" (lazy(sprintf "%-+*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5583" (lazy(sprintf "%+0E" -10.0)) "-1.000000E+001" + test "test5584" (lazy(sprintf "%+05E" -10.0)) "-1.000000E+001" + test "test5585" (lazy(sprintf "%+01E" -10.0)) "-1.000000E+001" + test "test5586" (lazy(sprintf "%+0*E" 7 -10.0)) "-1.000000E+001" + test "test5587" (lazy(sprintf "%+0.5E" -10.0)) "-1.00000E+001" + test "test5588" (lazy(sprintf "%+0.*E" 4 -10.0)) "-1.0000E+001" + test "test5589" (lazy(sprintf "%+0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5590" (lazy(sprintf "%-+0E" -10.0)) "-1.000000E+001" + test "test5591" (lazy(sprintf "%-+05E" -10.0)) "-1.000000E+001" + test "test5592" (lazy(sprintf "%-+01E" -10.0)) "-1.000000E+001" + test "test5593" (lazy(sprintf "%-+0*E" 7 -10.0)) "-1.000000E+001" + test "test5594" (lazy(sprintf "%-+0.5E" -10.0)) "-1.00000E+001" + test "test5595" (lazy(sprintf "%-+0.*E" 4 -10.0)) "-1.0000E+001" + test "test5596" (lazy(sprintf "%-+0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5597" (lazy(sprintf "% E" -10.0)) "-1.000000E+001" + test "test5598" (lazy(sprintf "% 5E" -10.0)) "-1.000000E+001" + test "test5599" (lazy(sprintf "% 1E" -10.0)) "-1.000000E+001" + test "test5600" (lazy(sprintf "% *E" 7 -10.0)) "-1.000000E+001" + test "test5601" (lazy(sprintf "% .5E" -10.0)) "-1.00000E+001" + test "test5602" (lazy(sprintf "% .*E" 4 -10.0)) "-1.0000E+001" + test "test5603" (lazy(sprintf "% *.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5604" (lazy(sprintf "%- E" -10.0)) "-1.000000E+001" + test "test5605" (lazy(sprintf "%- 5E" -10.0)) "-1.000000E+001" + test "test5606" (lazy(sprintf "%- 1E" -10.0)) "-1.000000E+001" + test "test5607" (lazy(sprintf "%- *E" 7 -10.0)) "-1.000000E+001" + test "test5608" (lazy(sprintf "%- .5E" -10.0)) "-1.00000E+001" + test "test5609" (lazy(sprintf "%- .*E" 4 -10.0)) "-1.0000E+001" + test "test5610" (lazy(sprintf "%- *.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5611" (lazy(sprintf "% 0E" -10.0)) "-1.000000E+001" + test "test5612" (lazy(sprintf "% 05E" -10.0)) "-1.000000E+001" + test "test5613" (lazy(sprintf "% 01E" -10.0)) "-1.000000E+001" + test "test5614" (lazy(sprintf "% 0*E" 7 -10.0)) "-1.000000E+001" + test "test5615" (lazy(sprintf "% 0.5E" -10.0)) "-1.00000E+001" + test "test5616" (lazy(sprintf "% 0.*E" 4 -10.0)) "-1.0000E+001" + test "test5617" (lazy(sprintf "% 0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5618" (lazy(sprintf "%- 0E" -10.0)) "-1.000000E+001" + test "test5619" (lazy(sprintf "%- 05E" -10.0)) "-1.000000E+001" + test "test5620" (lazy(sprintf "%- 01E" -10.0)) "-1.000000E+001" + test "test5621" (lazy(sprintf "%- 0*E" 7 -10.0)) "-1.000000E+001" + test "test5622" (lazy(sprintf "%- 0.5E" -10.0)) "-1.00000E+001" + test "test5623" (lazy(sprintf "%- 0.*E" 4 -10.0)) "-1.0000E+001" + test "test5624" (lazy(sprintf "%- 0*.*E" 5 4 -10.0)) "-1.0000E+001" + test "test5625" (lazy(sprintf "%E" 5.0f)) "5.000000E+000" + test "test5626" (lazy(sprintf "%5E" 5.0f)) "5.000000E+000" + test "test5627" (lazy(sprintf "%1E" 5.0f)) "5.000000E+000" + test "test5628" (lazy(sprintf "%*E" 7 5.0f)) "5.000000E+000" + test "test5629" (lazy(sprintf "%.5E" 5.0f)) "5.00000E+000" + test "test5630" (lazy(sprintf "%.*E" 4 5.0f)) "5.0000E+000" + test "test5631" (lazy(sprintf "%*.*E" 5 4 5.0f)) "5.0000E+000" + test "test5632" (lazy(sprintf "%-E" 5.0f)) "5.000000E+000" + test "test5633" (lazy(sprintf "%-5E" 5.0f)) "5.000000E+000" + test "test5634" (lazy(sprintf "%-1E" 5.0f)) "5.000000E+000" + test "test5635" (lazy(sprintf "%-*E" 7 5.0f)) "5.000000E+000" + test "test5636" (lazy(sprintf "%-.5E" 5.0f)) "5.00000E+000" + test "test5637" (lazy(sprintf "%-.*E" 4 5.0f)) "5.0000E+000" + test "test5638" (lazy(sprintf "%-*.*E" 5 4 5.0f)) "5.0000E+000" + test "test5639" (lazy(sprintf "%0E" 5.0f)) "5.000000E+000" + test "test5640" (lazy(sprintf "%05E" 5.0f)) "5.000000E+000" + test "test5641" (lazy(sprintf "%01E" 5.0f)) "5.000000E+000" + test "test5642" (lazy(sprintf "%0*E" 7 5.0f)) "5.000000E+000" + test "test5643" (lazy(sprintf "%0.5E" 5.0f)) "5.00000E+000" + test "test5644" (lazy(sprintf "%0.*E" 4 5.0f)) "5.0000E+000" + test "test5645" (lazy(sprintf "%0*.*E" 5 4 5.0f)) "5.0000E+000" + test "test5646" (lazy(sprintf "%-0E" 5.0f)) "5.000000E+000" + test "test5647" (lazy(sprintf "%-05E" 5.0f)) "5.000000E+000" + test "test5648" (lazy(sprintf "%-01E" 5.0f)) "5.000000E+000" + test "test5649" (lazy(sprintf "%-0*E" 7 5.0f)) "5.000000E+000" + test "test5650" (lazy(sprintf "%-0.5E" 5.0f)) "5.00000E+000" + test "test5651" (lazy(sprintf "%-0.*E" 4 5.0f)) "5.0000E+000" + test "test5652" (lazy(sprintf "%-0*.*E" 5 4 5.0f)) "5.0000E+000" + test "test5653" (lazy(sprintf "%+E" 5.0f)) "+5.000000E+000" + test "test5654" (lazy(sprintf "%+5E" 5.0f)) "+5.000000E+000" + test "test5655" (lazy(sprintf "%+1E" 5.0f)) "+5.000000E+000" + test "test5656" (lazy(sprintf "%+*E" 7 5.0f)) "+5.000000E+000" + test "test5657" (lazy(sprintf "%+.5E" 5.0f)) "+5.00000E+000" + test "test5658" (lazy(sprintf "%+.*E" 4 5.0f)) "+5.0000E+000" + test "test5659" (lazy(sprintf "%+*.*E" 5 4 5.0f)) "+5.0000E+000" + test "test5660" (lazy(sprintf "%-+E" 5.0f)) "+5.000000E+000" + test "test5661" (lazy(sprintf "%-+5E" 5.0f)) "+5.000000E+000" + test "test5662" (lazy(sprintf "%-+1E" 5.0f)) "+5.000000E+000" + test "test5663" (lazy(sprintf "%-+*E" 7 5.0f)) "+5.000000E+000" + test "test5664" (lazy(sprintf "%-+.5E" 5.0f)) "+5.00000E+000" + test "test5665" (lazy(sprintf "%-+.*E" 4 5.0f)) "+5.0000E+000" + test "test5666" (lazy(sprintf "%-+*.*E" 5 4 5.0f)) "+5.0000E+000" + test "test5667" (lazy(sprintf "%+0E" 5.0f)) "+5.000000E+000" + test "test5668" (lazy(sprintf "%+05E" 5.0f)) "+5.000000E+000" + test "test5669" (lazy(sprintf "%+01E" 5.0f)) "+5.000000E+000" + test "test5670" (lazy(sprintf "%+0*E" 7 5.0f)) "+5.000000E+000" + test "test5671" (lazy(sprintf "%+0.5E" 5.0f)) "+5.00000E+000" + test "test5672" (lazy(sprintf "%+0.*E" 4 5.0f)) "+5.0000E+000" + test "test5673" (lazy(sprintf "%+0*.*E" 5 4 5.0f)) "+5.0000E+000" + test "test5674" (lazy(sprintf "%-+0E" 5.0f)) "+5.000000E+000" + test "test5675" (lazy(sprintf "%-+05E" 5.0f)) "+5.000000E+000" + test "test5676" (lazy(sprintf "%-+01E" 5.0f)) "+5.000000E+000" + test "test5677" (lazy(sprintf "%-+0*E" 7 5.0f)) "+5.000000E+000" + test "test5678" (lazy(sprintf "%-+0.5E" 5.0f)) "+5.00000E+000" + test "test5679" (lazy(sprintf "%-+0.*E" 4 5.0f)) "+5.0000E+000" + test "test5680" (lazy(sprintf "%-+0*.*E" 5 4 5.0f)) "+5.0000E+000" + test "test5681" (lazy(sprintf "% E" 5.0f)) " 5.000000E+000" + test "test5682" (lazy(sprintf "% 5E" 5.0f)) " 5.000000E+000" + test "test5683" (lazy(sprintf "% 1E" 5.0f)) " 5.000000E+000" + test "test5684" (lazy(sprintf "% *E" 7 5.0f)) " 5.000000E+000" + test "test5685" (lazy(sprintf "% .5E" 5.0f)) " 5.00000E+000" + test "test5686" (lazy(sprintf "% .*E" 4 5.0f)) " 5.0000E+000" + test "test5687" (lazy(sprintf "% *.*E" 5 4 5.0f)) " 5.0000E+000" + test "test5688" (lazy(sprintf "%- E" 5.0f)) " 5.000000E+000" + test "test5689" (lazy(sprintf "%- 5E" 5.0f)) " 5.000000E+000" + test "test5690" (lazy(sprintf "%- 1E" 5.0f)) " 5.000000E+000" + test "test5691" (lazy(sprintf "%- *E" 7 5.0f)) " 5.000000E+000" + test "test5692" (lazy(sprintf "%- .5E" 5.0f)) " 5.00000E+000" + test "test5693" (lazy(sprintf "%- .*E" 4 5.0f)) " 5.0000E+000" + test "test5694" (lazy(sprintf "%- *.*E" 5 4 5.0f)) " 5.0000E+000" + test "test5695" (lazy(sprintf "% 0E" 5.0f)) " 5.000000E+000" + test "test5696" (lazy(sprintf "% 05E" 5.0f)) " 5.000000E+000" + test "test5697" (lazy(sprintf "% 01E" 5.0f)) " 5.000000E+000" + test "test5698" (lazy(sprintf "% 0*E" 7 5.0f)) " 5.000000E+000" + test "test5699" (lazy(sprintf "% 0.5E" 5.0f)) " 5.00000E+000" + test "test5700" (lazy(sprintf "% 0.*E" 4 5.0f)) " 5.0000E+000" + test "test5701" (lazy(sprintf "% 0*.*E" 5 4 5.0f)) " 5.0000E+000" + test "test5702" (lazy(sprintf "%- 0E" 5.0f)) " 5.000000E+000" + test "test5703" (lazy(sprintf "%- 05E" 5.0f)) " 5.000000E+000" + test "test5704" (lazy(sprintf "%- 01E" 5.0f)) " 5.000000E+000" + test "test5705" (lazy(sprintf "%- 0*E" 7 5.0f)) " 5.000000E+000" + test "test5706" (lazy(sprintf "%- 0.5E" 5.0f)) " 5.00000E+000" + test "test5707" (lazy(sprintf "%- 0.*E" 4 5.0f)) " 5.0000E+000" + test "test5708" (lazy(sprintf "%- 0*.*E" 5 4 5.0f)) " 5.0000E+000" + test "test5709" (lazy(sprintf "%E" -10.0f)) "-1.000000E+001" + test "test5710" (lazy(sprintf "%5E" -10.0f)) "-1.000000E+001" + test "test5711" (lazy(sprintf "%1E" -10.0f)) "-1.000000E+001" + test "test5712" (lazy(sprintf "%*E" 7 -10.0f)) "-1.000000E+001" + test "test5713" (lazy(sprintf "%.5E" -10.0f)) "-1.00000E+001" + test "test5714" (lazy(sprintf "%.*E" 4 -10.0f)) "-1.0000E+001" + test "test5715" (lazy(sprintf "%*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5716" (lazy(sprintf "%-E" -10.0f)) "-1.000000E+001" + test "test5717" (lazy(sprintf "%-5E" -10.0f)) "-1.000000E+001" + test "test5718" (lazy(sprintf "%-1E" -10.0f)) "-1.000000E+001" + test "test5719" (lazy(sprintf "%-*E" 7 -10.0f)) "-1.000000E+001" + test "test5720" (lazy(sprintf "%-.5E" -10.0f)) "-1.00000E+001" + test "test5721" (lazy(sprintf "%-.*E" 4 -10.0f)) "-1.0000E+001" + test "test5722" (lazy(sprintf "%-*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5723" (lazy(sprintf "%0E" -10.0f)) "-1.000000E+001" + test "test5724" (lazy(sprintf "%05E" -10.0f)) "-1.000000E+001" + test "test5725" (lazy(sprintf "%01E" -10.0f)) "-1.000000E+001" + test "test5726" (lazy(sprintf "%0*E" 7 -10.0f)) "-1.000000E+001" + test "test5727" (lazy(sprintf "%0.5E" -10.0f)) "-1.00000E+001" + test "test5728" (lazy(sprintf "%0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5729" (lazy(sprintf "%0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5730" (lazy(sprintf "%-0E" -10.0f)) "-1.000000E+001" + test "test5731" (lazy(sprintf "%-05E" -10.0f)) "-1.000000E+001" + test "test5732" (lazy(sprintf "%-01E" -10.0f)) "-1.000000E+001" + test "test5733" (lazy(sprintf "%-0*E" 7 -10.0f)) "-1.000000E+001" + test "test5734" (lazy(sprintf "%-0.5E" -10.0f)) "-1.00000E+001" + test "test5735" (lazy(sprintf "%-0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5736" (lazy(sprintf "%-0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5737" (lazy(sprintf "%+E" -10.0f)) "-1.000000E+001" + test "test5738" (lazy(sprintf "%+5E" -10.0f)) "-1.000000E+001" + test "test5739" (lazy(sprintf "%+1E" -10.0f)) "-1.000000E+001" + test "test5740" (lazy(sprintf "%+*E" 7 -10.0f)) "-1.000000E+001" + test "test5741" (lazy(sprintf "%+.5E" -10.0f)) "-1.00000E+001" + test "test5742" (lazy(sprintf "%+.*E" 4 -10.0f)) "-1.0000E+001" + test "test5743" (lazy(sprintf "%+*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5744" (lazy(sprintf "%-+E" -10.0f)) "-1.000000E+001" + test "test5745" (lazy(sprintf "%-+5E" -10.0f)) "-1.000000E+001" + test "test5746" (lazy(sprintf "%-+1E" -10.0f)) "-1.000000E+001" + test "test5747" (lazy(sprintf "%-+*E" 7 -10.0f)) "-1.000000E+001" + test "test5748" (lazy(sprintf "%-+.5E" -10.0f)) "-1.00000E+001" + test "test5749" (lazy(sprintf "%-+.*E" 4 -10.0f)) "-1.0000E+001" + test "test5750" (lazy(sprintf "%-+*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5751" (lazy(sprintf "%+0E" -10.0f)) "-1.000000E+001" + test "test5752" (lazy(sprintf "%+05E" -10.0f)) "-1.000000E+001" + test "test5753" (lazy(sprintf "%+01E" -10.0f)) "-1.000000E+001" + test "test5754" (lazy(sprintf "%+0*E" 7 -10.0f)) "-1.000000E+001" + test "test5755" (lazy(sprintf "%+0.5E" -10.0f)) "-1.00000E+001" + test "test5756" (lazy(sprintf "%+0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5757" (lazy(sprintf "%+0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5758" (lazy(sprintf "%-+0E" -10.0f)) "-1.000000E+001" + test "test5759" (lazy(sprintf "%-+05E" -10.0f)) "-1.000000E+001" + test "test5760" (lazy(sprintf "%-+01E" -10.0f)) "-1.000000E+001" + test "test5761" (lazy(sprintf "%-+0*E" 7 -10.0f)) "-1.000000E+001" + test "test5762" (lazy(sprintf "%-+0.5E" -10.0f)) "-1.00000E+001" + test "test5763" (lazy(sprintf "%-+0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5764" (lazy(sprintf "%-+0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5765" (lazy(sprintf "% E" -10.0f)) "-1.000000E+001" + test "test5766" (lazy(sprintf "% 5E" -10.0f)) "-1.000000E+001" + test "test5767" (lazy(sprintf "% 1E" -10.0f)) "-1.000000E+001" + test "test5768" (lazy(sprintf "% *E" 7 -10.0f)) "-1.000000E+001" + test "test5769" (lazy(sprintf "% .5E" -10.0f)) "-1.00000E+001" + test "test5770" (lazy(sprintf "% .*E" 4 -10.0f)) "-1.0000E+001" + test "test5771" (lazy(sprintf "% *.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5772" (lazy(sprintf "%- E" -10.0f)) "-1.000000E+001" + test "test5773" (lazy(sprintf "%- 5E" -10.0f)) "-1.000000E+001" + test "test5774" (lazy(sprintf "%- 1E" -10.0f)) "-1.000000E+001" + test "test5775" (lazy(sprintf "%- *E" 7 -10.0f)) "-1.000000E+001" + test "test5776" (lazy(sprintf "%- .5E" -10.0f)) "-1.00000E+001" + test "test5777" (lazy(sprintf "%- .*E" 4 -10.0f)) "-1.0000E+001" + test "test5778" (lazy(sprintf "%- *.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5779" (lazy(sprintf "% 0E" -10.0f)) "-1.000000E+001" + test "test5780" (lazy(sprintf "% 05E" -10.0f)) "-1.000000E+001" + test "test5781" (lazy(sprintf "% 01E" -10.0f)) "-1.000000E+001" + test "test5782" (lazy(sprintf "% 0*E" 7 -10.0f)) "-1.000000E+001" + test "test5783" (lazy(sprintf "% 0.5E" -10.0f)) "-1.00000E+001" + test "test5784" (lazy(sprintf "% 0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5785" (lazy(sprintf "% 0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5786" (lazy(sprintf "%- 0E" -10.0f)) "-1.000000E+001" + test "test5787" (lazy(sprintf "%- 05E" -10.0f)) "-1.000000E+001" + test "test5788" (lazy(sprintf "%- 01E" -10.0f)) "-1.000000E+001" + test "test5789" (lazy(sprintf "%- 0*E" 7 -10.0f)) "-1.000000E+001" + test "test5790" (lazy(sprintf "%- 0.5E" -10.0f)) "-1.00000E+001" + test "test5791" (lazy(sprintf "%- 0.*E" 4 -10.0f)) "-1.0000E+001" + test "test5792" (lazy(sprintf "%- 0*.*E" 5 4 -10.0f)) "-1.0000E+001" + test "test5793" (lazy(sprintf "%E" 5.0M)) "5.000000E+000" + test "test5794" (lazy(sprintf "%5E" 5.0M)) "5.000000E+000" + test "test5795" (lazy(sprintf "%1E" 5.0M)) "5.000000E+000" + test "test5796" (lazy(sprintf "%*E" 7 5.0M)) "5.000000E+000" + test "test5797" (lazy(sprintf "%.5E" 5.0M)) "5.00000E+000" + test "test5798" (lazy(sprintf "%.*E" 4 5.0M)) "5.0000E+000" + test "test5799" (lazy(sprintf "%*.*E" 5 4 5.0M)) "5.0000E+000" + test "test5800" (lazy(sprintf "%-E" 5.0M)) "5.000000E+000" + test "test5801" (lazy(sprintf "%-5E" 5.0M)) "5.000000E+000" + test "test5802" (lazy(sprintf "%-1E" 5.0M)) "5.000000E+000" + test "test5803" (lazy(sprintf "%-*E" 7 5.0M)) "5.000000E+000" + test "test5804" (lazy(sprintf "%-.5E" 5.0M)) "5.00000E+000" + test "test5805" (lazy(sprintf "%-.*E" 4 5.0M)) "5.0000E+000" + test "test5806" (lazy(sprintf "%-*.*E" 5 4 5.0M)) "5.0000E+000" + test "test5807" (lazy(sprintf "%0E" 5.0M)) "5.000000E+000" + test "test5808" (lazy(sprintf "%05E" 5.0M)) "5.000000E+000" + test "test5809" (lazy(sprintf "%01E" 5.0M)) "5.000000E+000" + test "test5810" (lazy(sprintf "%0*E" 7 5.0M)) "5.000000E+000" + test "test5811" (lazy(sprintf "%0.5E" 5.0M)) "5.00000E+000" + test "test5812" (lazy(sprintf "%0.*E" 4 5.0M)) "5.0000E+000" + test "test5813" (lazy(sprintf "%0*.*E" 5 4 5.0M)) "5.0000E+000" + test "test5814" (lazy(sprintf "%-0E" 5.0M)) "5.000000E+000" + test "test5815" (lazy(sprintf "%-05E" 5.0M)) "5.000000E+000" + test "test5816" (lazy(sprintf "%-01E" 5.0M)) "5.000000E+000" + test "test5817" (lazy(sprintf "%-0*E" 7 5.0M)) "5.000000E+000" + test "test5818" (lazy(sprintf "%-0.5E" 5.0M)) "5.00000E+000" + test "test5819" (lazy(sprintf "%-0.*E" 4 5.0M)) "5.0000E+000" + test "test5820" (lazy(sprintf "%-0*.*E" 5 4 5.0M)) "5.0000E+000" + test "test5821" (lazy(sprintf "%+E" 5.0M)) "+5.000000E+000" + test "test5822" (lazy(sprintf "%+5E" 5.0M)) "+5.000000E+000" + test "test5823" (lazy(sprintf "%+1E" 5.0M)) "+5.000000E+000" + test "test5824" (lazy(sprintf "%+*E" 7 5.0M)) "+5.000000E+000" + test "test5825" (lazy(sprintf "%+.5E" 5.0M)) "+5.00000E+000" + test "test5826" (lazy(sprintf "%+.*E" 4 5.0M)) "+5.0000E+000" + test "test5827" (lazy(sprintf "%+*.*E" 5 4 5.0M)) "+5.0000E+000" + test "test5828" (lazy(sprintf "%-+E" 5.0M)) "+5.000000E+000" + test "test5829" (lazy(sprintf "%-+5E" 5.0M)) "+5.000000E+000" + test "test5830" (lazy(sprintf "%-+1E" 5.0M)) "+5.000000E+000" + test "test5831" (lazy(sprintf "%-+*E" 7 5.0M)) "+5.000000E+000" + test "test5832" (lazy(sprintf "%-+.5E" 5.0M)) "+5.00000E+000" + test "test5833" (lazy(sprintf "%-+.*E" 4 5.0M)) "+5.0000E+000" + test "test5834" (lazy(sprintf "%-+*.*E" 5 4 5.0M)) "+5.0000E+000" + test "test5835" (lazy(sprintf "%+0E" 5.0M)) "+5.000000E+000" + test "test5836" (lazy(sprintf "%+05E" 5.0M)) "+5.000000E+000" + test "test5837" (lazy(sprintf "%+01E" 5.0M)) "+5.000000E+000" + test "test5838" (lazy(sprintf "%+0*E" 7 5.0M)) "+5.000000E+000" + test "test5839" (lazy(sprintf "%+0.5E" 5.0M)) "+5.00000E+000" + test "test5840" (lazy(sprintf "%+0.*E" 4 5.0M)) "+5.0000E+000" + test "test5841" (lazy(sprintf "%+0*.*E" 5 4 5.0M)) "+5.0000E+000" + test "test5842" (lazy(sprintf "%-+0E" 5.0M)) "+5.000000E+000" + test "test5843" (lazy(sprintf "%-+05E" 5.0M)) "+5.000000E+000" + test "test5844" (lazy(sprintf "%-+01E" 5.0M)) "+5.000000E+000" + test "test5845" (lazy(sprintf "%-+0*E" 7 5.0M)) "+5.000000E+000" + test "test5846" (lazy(sprintf "%-+0.5E" 5.0M)) "+5.00000E+000" + test "test5847" (lazy(sprintf "%-+0.*E" 4 5.0M)) "+5.0000E+000" + test "test5848" (lazy(sprintf "%-+0*.*E" 5 4 5.0M)) "+5.0000E+000" + test "test5849" (lazy(sprintf "% E" 5.0M)) " 5.000000E+000" + test "test5850" (lazy(sprintf "% 5E" 5.0M)) " 5.000000E+000" + test "test5851" (lazy(sprintf "% 1E" 5.0M)) " 5.000000E+000" + test "test5852" (lazy(sprintf "% *E" 7 5.0M)) " 5.000000E+000" + test "test5853" (lazy(sprintf "% .5E" 5.0M)) " 5.00000E+000" + test "test5854" (lazy(sprintf "% .*E" 4 5.0M)) " 5.0000E+000" + test "test5855" (lazy(sprintf "% *.*E" 5 4 5.0M)) " 5.0000E+000" + test "test5856" (lazy(sprintf "%- E" 5.0M)) " 5.000000E+000" + test "test5857" (lazy(sprintf "%- 5E" 5.0M)) " 5.000000E+000" + test "test5858" (lazy(sprintf "%- 1E" 5.0M)) " 5.000000E+000" + test "test5859" (lazy(sprintf "%- *E" 7 5.0M)) " 5.000000E+000" + test "test5860" (lazy(sprintf "%- .5E" 5.0M)) " 5.00000E+000" + test "test5861" (lazy(sprintf "%- .*E" 4 5.0M)) " 5.0000E+000" + test "test5862" (lazy(sprintf "%- *.*E" 5 4 5.0M)) " 5.0000E+000" + test "test5863" (lazy(sprintf "% 0E" 5.0M)) " 5.000000E+000" + test "test5864" (lazy(sprintf "% 05E" 5.0M)) " 5.000000E+000" + test "test5865" (lazy(sprintf "% 01E" 5.0M)) " 5.000000E+000" + test "test5866" (lazy(sprintf "% 0*E" 7 5.0M)) " 5.000000E+000" + test "test5867" (lazy(sprintf "% 0.5E" 5.0M)) " 5.00000E+000" + test "test5868" (lazy(sprintf "% 0.*E" 4 5.0M)) " 5.0000E+000" + test "test5869" (lazy(sprintf "% 0*.*E" 5 4 5.0M)) " 5.0000E+000" + test "test5870" (lazy(sprintf "%- 0E" 5.0M)) " 5.000000E+000" + test "test5871" (lazy(sprintf "%- 05E" 5.0M)) " 5.000000E+000" + test "test5872" (lazy(sprintf "%- 01E" 5.0M)) " 5.000000E+000" + test "test5873" (lazy(sprintf "%- 0*E" 7 5.0M)) " 5.000000E+000" + test "test5874" (lazy(sprintf "%- 0.5E" 5.0M)) " 5.00000E+000" + test "test5875" (lazy(sprintf "%- 0.*E" 4 5.0M)) " 5.0000E+000" + test "test5876" (lazy(sprintf "%- 0*.*E" 5 4 5.0M)) " 5.0000E+000" + test "test5877" (lazy(sprintf "%E" -10.0M)) "-1.000000E+001" + test "test5878" (lazy(sprintf "%5E" -10.0M)) "-1.000000E+001" + test "test5879" (lazy(sprintf "%1E" -10.0M)) "-1.000000E+001" + test "test5880" (lazy(sprintf "%*E" 7 -10.0M)) "-1.000000E+001" + test "test5881" (lazy(sprintf "%.5E" -10.0M)) "-1.00000E+001" + test "test5882" (lazy(sprintf "%.*E" 4 -10.0M)) "-1.0000E+001" + test "test5883" (lazy(sprintf "%*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5884" (lazy(sprintf "%-E" -10.0M)) "-1.000000E+001" + test "test5885" (lazy(sprintf "%-5E" -10.0M)) "-1.000000E+001" + test "test5886" (lazy(sprintf "%-1E" -10.0M)) "-1.000000E+001" + test "test5887" (lazy(sprintf "%-*E" 7 -10.0M)) "-1.000000E+001" + test "test5888" (lazy(sprintf "%-.5E" -10.0M)) "-1.00000E+001" + test "test5889" (lazy(sprintf "%-.*E" 4 -10.0M)) "-1.0000E+001" + test "test5890" (lazy(sprintf "%-*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5891" (lazy(sprintf "%0E" -10.0M)) "-1.000000E+001" + test "test5892" (lazy(sprintf "%05E" -10.0M)) "-1.000000E+001" + test "test5893" (lazy(sprintf "%01E" -10.0M)) "-1.000000E+001" + test "test5894" (lazy(sprintf "%0*E" 7 -10.0M)) "-1.000000E+001" + test "test5895" (lazy(sprintf "%0.5E" -10.0M)) "-1.00000E+001" + test "test5896" (lazy(sprintf "%0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5897" (lazy(sprintf "%0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5898" (lazy(sprintf "%-0E" -10.0M)) "-1.000000E+001" + test "test5899" (lazy(sprintf "%-05E" -10.0M)) "-1.000000E+001" + test "test5900" (lazy(sprintf "%-01E" -10.0M)) "-1.000000E+001" + test "test5901" (lazy(sprintf "%-0*E" 7 -10.0M)) "-1.000000E+001" + test "test5902" (lazy(sprintf "%-0.5E" -10.0M)) "-1.00000E+001" + test "test5903" (lazy(sprintf "%-0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5904" (lazy(sprintf "%-0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5905" (lazy(sprintf "%+E" -10.0M)) "-1.000000E+001" + test "test5906" (lazy(sprintf "%+5E" -10.0M)) "-1.000000E+001" + test "test5907" (lazy(sprintf "%+1E" -10.0M)) "-1.000000E+001" + test "test5908" (lazy(sprintf "%+*E" 7 -10.0M)) "-1.000000E+001" + test "test5909" (lazy(sprintf "%+.5E" -10.0M)) "-1.00000E+001" + test "test5910" (lazy(sprintf "%+.*E" 4 -10.0M)) "-1.0000E+001" + test "test5911" (lazy(sprintf "%+*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5912" (lazy(sprintf "%-+E" -10.0M)) "-1.000000E+001" + test "test5913" (lazy(sprintf "%-+5E" -10.0M)) "-1.000000E+001" + test "test5914" (lazy(sprintf "%-+1E" -10.0M)) "-1.000000E+001" + test "test5915" (lazy(sprintf "%-+*E" 7 -10.0M)) "-1.000000E+001" + test "test5916" (lazy(sprintf "%-+.5E" -10.0M)) "-1.00000E+001" + test "test5917" (lazy(sprintf "%-+.*E" 4 -10.0M)) "-1.0000E+001" + test "test5918" (lazy(sprintf "%-+*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5919" (lazy(sprintf "%+0E" -10.0M)) "-1.000000E+001" + test "test5920" (lazy(sprintf "%+05E" -10.0M)) "-1.000000E+001" + test "test5921" (lazy(sprintf "%+01E" -10.0M)) "-1.000000E+001" + test "test5922" (lazy(sprintf "%+0*E" 7 -10.0M)) "-1.000000E+001" + test "test5923" (lazy(sprintf "%+0.5E" -10.0M)) "-1.00000E+001" + test "test5924" (lazy(sprintf "%+0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5925" (lazy(sprintf "%+0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5926" (lazy(sprintf "%-+0E" -10.0M)) "-1.000000E+001" + test "test5927" (lazy(sprintf "%-+05E" -10.0M)) "-1.000000E+001" + test "test5928" (lazy(sprintf "%-+01E" -10.0M)) "-1.000000E+001" + test "test5929" (lazy(sprintf "%-+0*E" 7 -10.0M)) "-1.000000E+001" + test "test5930" (lazy(sprintf "%-+0.5E" -10.0M)) "-1.00000E+001" + test "test5931" (lazy(sprintf "%-+0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5932" (lazy(sprintf "%-+0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5933" (lazy(sprintf "% E" -10.0M)) "-1.000000E+001" + test "test5934" (lazy(sprintf "% 5E" -10.0M)) "-1.000000E+001" + test "test5935" (lazy(sprintf "% 1E" -10.0M)) "-1.000000E+001" + test "test5936" (lazy(sprintf "% *E" 7 -10.0M)) "-1.000000E+001" + test "test5937" (lazy(sprintf "% .5E" -10.0M)) "-1.00000E+001" + test "test5938" (lazy(sprintf "% .*E" 4 -10.0M)) "-1.0000E+001" + test "test5939" (lazy(sprintf "% *.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5940" (lazy(sprintf "%- E" -10.0M)) "-1.000000E+001" + test "test5941" (lazy(sprintf "%- 5E" -10.0M)) "-1.000000E+001" + test "test5942" (lazy(sprintf "%- 1E" -10.0M)) "-1.000000E+001" + test "test5943" (lazy(sprintf "%- *E" 7 -10.0M)) "-1.000000E+001" + test "test5944" (lazy(sprintf "%- .5E" -10.0M)) "-1.00000E+001" + test "test5945" (lazy(sprintf "%- .*E" 4 -10.0M)) "-1.0000E+001" + test "test5946" (lazy(sprintf "%- *.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5947" (lazy(sprintf "% 0E" -10.0M)) "-1.000000E+001" + test "test5948" (lazy(sprintf "% 05E" -10.0M)) "-1.000000E+001" + test "test5949" (lazy(sprintf "% 01E" -10.0M)) "-1.000000E+001" + test "test5950" (lazy(sprintf "% 0*E" 7 -10.0M)) "-1.000000E+001" + test "test5951" (lazy(sprintf "% 0.5E" -10.0M)) "-1.00000E+001" + test "test5952" (lazy(sprintf "% 0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5953" (lazy(sprintf "% 0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5954" (lazy(sprintf "%- 0E" -10.0M)) "-1.000000E+001" + test "test5955" (lazy(sprintf "%- 05E" -10.0M)) "-1.000000E+001" + test "test5956" (lazy(sprintf "%- 01E" -10.0M)) "-1.000000E+001" + test "test5957" (lazy(sprintf "%- 0*E" 7 -10.0M)) "-1.000000E+001" + test "test5958" (lazy(sprintf "%- 0.5E" -10.0M)) "-1.00000E+001" + test "test5959" (lazy(sprintf "%- 0.*E" 4 -10.0M)) "-1.0000E+001" + test "test5960" (lazy(sprintf "%- 0*.*E" 5 4 -10.0M)) "-1.0000E+001" + test "test5961" (lazy(sprintf "%f" 5.0)) "5.000000" + test "test5962" (lazy(sprintf "%5f" 5.0)) "5.000000" + test "test5963" (lazy(sprintf "%1f" 5.0)) "5.000000" + test "test5964" (lazy(sprintf "%*f" 7 5.0)) "5.000000" + test "test5965" (lazy(sprintf "%.5f" 5.0)) "5.00000" + test "test5966" (lazy(sprintf "%.*f" 4 5.0)) "5.0000" + test "test5967" (lazy(sprintf "%*.*f" 5 4 5.0)) "5.0000" + test "test5968" (lazy(sprintf "%-f" 5.0)) "5.000000" + test "test5969" (lazy(sprintf "%-5f" 5.0)) "5.000000" + test "test5970" (lazy(sprintf "%-1f" 5.0)) "5.000000" + test "test5971" (lazy(sprintf "%-*f" 7 5.0)) "5.000000" + test "test5972" (lazy(sprintf "%-.5f" 5.0)) "5.00000" + test "test5973" (lazy(sprintf "%-.*f" 4 5.0)) "5.0000" + test "test5974" (lazy(sprintf "%-*.*f" 5 4 5.0)) "5.0000" + test "test5975" (lazy(sprintf "%0f" 5.0)) "5.000000" + test "test5976" (lazy(sprintf "%05f" 5.0)) "5.000000" + test "test5977" (lazy(sprintf "%01f" 5.0)) "5.000000" + test "test5978" (lazy(sprintf "%0*f" 7 5.0)) "5.000000" + test "test5979" (lazy(sprintf "%0.5f" 5.0)) "5.00000" + test "test5980" (lazy(sprintf "%0.*f" 4 5.0)) "5.0000" + test "test5981" (lazy(sprintf "%0*.*f" 5 4 5.0)) "5.0000" + test "test5982" (lazy(sprintf "%-0f" 5.0)) "5.000000" + test "test5983" (lazy(sprintf "%-05f" 5.0)) "5.000000" + test "test5984" (lazy(sprintf "%-01f" 5.0)) "5.000000" + test "test5985" (lazy(sprintf "%-0*f" 7 5.0)) "5.000000" + test "test5986" (lazy(sprintf "%-0.5f" 5.0)) "5.00000" + test "test5987" (lazy(sprintf "%-0.*f" 4 5.0)) "5.0000" + test "test5988" (lazy(sprintf "%-0*.*f" 5 4 5.0)) "5.0000" + test "test5989" (lazy(sprintf "%+f" 5.0)) "+5.000000" + test "test5990" (lazy(sprintf "%+5f" 5.0)) "+5.000000" + test "test5991" (lazy(sprintf "%+1f" 5.0)) "+5.000000" + test "test5992" (lazy(sprintf "%+*f" 7 5.0)) "+5.000000" + test "test5993" (lazy(sprintf "%+.5f" 5.0)) "+5.00000" + test "test5994" (lazy(sprintf "%+.*f" 4 5.0)) "+5.0000" + test "test5995" (lazy(sprintf "%+*.*f" 5 4 5.0)) "+5.0000" + test "test5996" (lazy(sprintf "%-+f" 5.0)) "+5.000000" + test "test5997" (lazy(sprintf "%-+5f" 5.0)) "+5.000000" + test "test5998" (lazy(sprintf "%-+1f" 5.0)) "+5.000000" + test "test5999" (lazy(sprintf "%-+*f" 7 5.0)) "+5.000000" + test "test6000" (lazy(sprintf "%-+.5f" 5.0)) "+5.00000" +let func6000()= + test "test6001" (lazy(sprintf "%-+.*f" 4 5.0)) "+5.0000" + test "test6002" (lazy(sprintf "%-+*.*f" 5 4 5.0)) "+5.0000" + test "test6003" (lazy(sprintf "%+0f" 5.0)) "+5.000000" + test "test6004" (lazy(sprintf "%+05f" 5.0)) "+5.000000" + test "test6005" (lazy(sprintf "%+01f" 5.0)) "+5.000000" + test "test6006" (lazy(sprintf "%+0*f" 7 5.0)) "+5.000000" + test "test6007" (lazy(sprintf "%+0.5f" 5.0)) "+5.00000" + test "test6008" (lazy(sprintf "%+0.*f" 4 5.0)) "+5.0000" + test "test6009" (lazy(sprintf "%+0*.*f" 5 4 5.0)) "+5.0000" + test "test6010" (lazy(sprintf "%-+0f" 5.0)) "+5.000000" + test "test6011" (lazy(sprintf "%-+05f" 5.0)) "+5.000000" + test "test6012" (lazy(sprintf "%-+01f" 5.0)) "+5.000000" + test "test6013" (lazy(sprintf "%-+0*f" 7 5.0)) "+5.000000" + test "test6014" (lazy(sprintf "%-+0.5f" 5.0)) "+5.00000" + test "test6015" (lazy(sprintf "%-+0.*f" 4 5.0)) "+5.0000" + test "test6016" (lazy(sprintf "%-+0*.*f" 5 4 5.0)) "+5.0000" + test "test6017" (lazy(sprintf "% f" 5.0)) " 5.000000" + test "test6018" (lazy(sprintf "% 5f" 5.0)) " 5.000000" + test "test6019" (lazy(sprintf "% 1f" 5.0)) " 5.000000" + test "test6020" (lazy(sprintf "% *f" 7 5.0)) " 5.000000" + test "test6021" (lazy(sprintf "% .5f" 5.0)) " 5.00000" + test "test6022" (lazy(sprintf "% .*f" 4 5.0)) " 5.0000" + test "test6023" (lazy(sprintf "% *.*f" 5 4 5.0)) " 5.0000" + test "test6024" (lazy(sprintf "%- f" 5.0)) " 5.000000" + test "test6025" (lazy(sprintf "%- 5f" 5.0)) " 5.000000" + test "test6026" (lazy(sprintf "%- 1f" 5.0)) " 5.000000" + test "test6027" (lazy(sprintf "%- *f" 7 5.0)) " 5.000000" + test "test6028" (lazy(sprintf "%- .5f" 5.0)) " 5.00000" + test "test6029" (lazy(sprintf "%- .*f" 4 5.0)) " 5.0000" + test "test6030" (lazy(sprintf "%- *.*f" 5 4 5.0)) " 5.0000" + test "test6031" (lazy(sprintf "% 0f" 5.0)) " 5.000000" + test "test6032" (lazy(sprintf "% 05f" 5.0)) " 5.000000" + test "test6033" (lazy(sprintf "% 01f" 5.0)) " 5.000000" + test "test6034" (lazy(sprintf "% 0*f" 7 5.0)) " 5.000000" + test "test6035" (lazy(sprintf "% 0.5f" 5.0)) " 5.00000" + test "test6036" (lazy(sprintf "% 0.*f" 4 5.0)) " 5.0000" + test "test6037" (lazy(sprintf "% 0*.*f" 5 4 5.0)) " 5.0000" + test "test6038" (lazy(sprintf "%- 0f" 5.0)) " 5.000000" + test "test6039" (lazy(sprintf "%- 05f" 5.0)) " 5.000000" + test "test6040" (lazy(sprintf "%- 01f" 5.0)) " 5.000000" + test "test6041" (lazy(sprintf "%- 0*f" 7 5.0)) " 5.000000" + test "test6042" (lazy(sprintf "%- 0.5f" 5.0)) " 5.00000" + test "test6043" (lazy(sprintf "%- 0.*f" 4 5.0)) " 5.0000" + test "test6044" (lazy(sprintf "%- 0*.*f" 5 4 5.0)) " 5.0000" + test "test6045" (lazy(sprintf "%f" -10.0)) "-10.000000" + test "test6046" (lazy(sprintf "%5f" -10.0)) "-10.000000" + test "test6047" (lazy(sprintf "%1f" -10.0)) "-10.000000" + test "test6048" (lazy(sprintf "%*f" 7 -10.0)) "-10.000000" + test "test6049" (lazy(sprintf "%.5f" -10.0)) "-10.00000" + test "test6050" (lazy(sprintf "%.*f" 4 -10.0)) "-10.0000" + test "test6051" (lazy(sprintf "%*.*f" 5 4 -10.0)) "-10.0000" + test "test6052" (lazy(sprintf "%-f" -10.0)) "-10.000000" + test "test6053" (lazy(sprintf "%-5f" -10.0)) "-10.000000" + test "test6054" (lazy(sprintf "%-1f" -10.0)) "-10.000000" + test "test6055" (lazy(sprintf "%-*f" 7 -10.0)) "-10.000000" + test "test6056" (lazy(sprintf "%-.5f" -10.0)) "-10.00000" + test "test6057" (lazy(sprintf "%-.*f" 4 -10.0)) "-10.0000" + test "test6058" (lazy(sprintf "%-*.*f" 5 4 -10.0)) "-10.0000" + test "test6059" (lazy(sprintf "%0f" -10.0)) "-10.000000" + test "test6060" (lazy(sprintf "%05f" -10.0)) "-10.000000" + test "test6061" (lazy(sprintf "%01f" -10.0)) "-10.000000" + test "test6062" (lazy(sprintf "%0*f" 7 -10.0)) "-10.000000" + test "test6063" (lazy(sprintf "%0.5f" -10.0)) "-10.00000" + test "test6064" (lazy(sprintf "%0.*f" 4 -10.0)) "-10.0000" + test "test6065" (lazy(sprintf "%0*.*f" 5 4 -10.0)) "-10.0000" + test "test6066" (lazy(sprintf "%-0f" -10.0)) "-10.000000" + test "test6067" (lazy(sprintf "%-05f" -10.0)) "-10.000000" + test "test6068" (lazy(sprintf "%-01f" -10.0)) "-10.000000" + test "test6069" (lazy(sprintf "%-0*f" 7 -10.0)) "-10.000000" + test "test6070" (lazy(sprintf "%-0.5f" -10.0)) "-10.00000" + test "test6071" (lazy(sprintf "%-0.*f" 4 -10.0)) "-10.0000" + test "test6072" (lazy(sprintf "%-0*.*f" 5 4 -10.0)) "-10.0000" + test "test6073" (lazy(sprintf "%+f" -10.0)) "-10.000000" + test "test6074" (lazy(sprintf "%+5f" -10.0)) "-10.000000" + test "test6075" (lazy(sprintf "%+1f" -10.0)) "-10.000000" + test "test6076" (lazy(sprintf "%+*f" 7 -10.0)) "-10.000000" + test "test6077" (lazy(sprintf "%+.5f" -10.0)) "-10.00000" + test "test6078" (lazy(sprintf "%+.*f" 4 -10.0)) "-10.0000" + test "test6079" (lazy(sprintf "%+*.*f" 5 4 -10.0)) "-10.0000" + test "test6080" (lazy(sprintf "%-+f" -10.0)) "-10.000000" + test "test6081" (lazy(sprintf "%-+5f" -10.0)) "-10.000000" + test "test6082" (lazy(sprintf "%-+1f" -10.0)) "-10.000000" + test "test6083" (lazy(sprintf "%-+*f" 7 -10.0)) "-10.000000" + test "test6084" (lazy(sprintf "%-+.5f" -10.0)) "-10.00000" + test "test6085" (lazy(sprintf "%-+.*f" 4 -10.0)) "-10.0000" + test "test6086" (lazy(sprintf "%-+*.*f" 5 4 -10.0)) "-10.0000" + test "test6087" (lazy(sprintf "%+0f" -10.0)) "-10.000000" + test "test6088" (lazy(sprintf "%+05f" -10.0)) "-10.000000" + test "test6089" (lazy(sprintf "%+01f" -10.0)) "-10.000000" + test "test6090" (lazy(sprintf "%+0*f" 7 -10.0)) "-10.000000" + test "test6091" (lazy(sprintf "%+0.5f" -10.0)) "-10.00000" + test "test6092" (lazy(sprintf "%+0.*f" 4 -10.0)) "-10.0000" + test "test6093" (lazy(sprintf "%+0*.*f" 5 4 -10.0)) "-10.0000" + test "test6094" (lazy(sprintf "%-+0f" -10.0)) "-10.000000" + test "test6095" (lazy(sprintf "%-+05f" -10.0)) "-10.000000" + test "test6096" (lazy(sprintf "%-+01f" -10.0)) "-10.000000" + test "test6097" (lazy(sprintf "%-+0*f" 7 -10.0)) "-10.000000" + test "test6098" (lazy(sprintf "%-+0.5f" -10.0)) "-10.00000" + test "test6099" (lazy(sprintf "%-+0.*f" 4 -10.0)) "-10.0000" + test "test6100" (lazy(sprintf "%-+0*.*f" 5 4 -10.0)) "-10.0000" + test "test6101" (lazy(sprintf "% f" -10.0)) "-10.000000" + test "test6102" (lazy(sprintf "% 5f" -10.0)) "-10.000000" + test "test6103" (lazy(sprintf "% 1f" -10.0)) "-10.000000" + test "test6104" (lazy(sprintf "% *f" 7 -10.0)) "-10.000000" + test "test6105" (lazy(sprintf "% .5f" -10.0)) "-10.00000" + test "test6106" (lazy(sprintf "% .*f" 4 -10.0)) "-10.0000" + test "test6107" (lazy(sprintf "% *.*f" 5 4 -10.0)) "-10.0000" + test "test6108" (lazy(sprintf "%- f" -10.0)) "-10.000000" + test "test6109" (lazy(sprintf "%- 5f" -10.0)) "-10.000000" + test "test6110" (lazy(sprintf "%- 1f" -10.0)) "-10.000000" + test "test6111" (lazy(sprintf "%- *f" 7 -10.0)) "-10.000000" + test "test6112" (lazy(sprintf "%- .5f" -10.0)) "-10.00000" + test "test6113" (lazy(sprintf "%- .*f" 4 -10.0)) "-10.0000" + test "test6114" (lazy(sprintf "%- *.*f" 5 4 -10.0)) "-10.0000" + test "test6115" (lazy(sprintf "% 0f" -10.0)) "-10.000000" + test "test6116" (lazy(sprintf "% 05f" -10.0)) "-10.000000" + test "test6117" (lazy(sprintf "% 01f" -10.0)) "-10.000000" + test "test6118" (lazy(sprintf "% 0*f" 7 -10.0)) "-10.000000" + test "test6119" (lazy(sprintf "% 0.5f" -10.0)) "-10.00000" + test "test6120" (lazy(sprintf "% 0.*f" 4 -10.0)) "-10.0000" + test "test6121" (lazy(sprintf "% 0*.*f" 5 4 -10.0)) "-10.0000" + test "test6122" (lazy(sprintf "%- 0f" -10.0)) "-10.000000" + test "test6123" (lazy(sprintf "%- 05f" -10.0)) "-10.000000" + test "test6124" (lazy(sprintf "%- 01f" -10.0)) "-10.000000" + test "test6125" (lazy(sprintf "%- 0*f" 7 -10.0)) "-10.000000" + test "test6126" (lazy(sprintf "%- 0.5f" -10.0)) "-10.00000" + test "test6127" (lazy(sprintf "%- 0.*f" 4 -10.0)) "-10.0000" + test "test6128" (lazy(sprintf "%- 0*.*f" 5 4 -10.0)) "-10.0000" + test "test6129" (lazy(sprintf "%f" 5.0f)) "5.000000" + test "test6130" (lazy(sprintf "%5f" 5.0f)) "5.000000" + test "test6131" (lazy(sprintf "%1f" 5.0f)) "5.000000" + test "test6132" (lazy(sprintf "%*f" 7 5.0f)) "5.000000" + test "test6133" (lazy(sprintf "%.5f" 5.0f)) "5.00000" + test "test6134" (lazy(sprintf "%.*f" 4 5.0f)) "5.0000" + test "test6135" (lazy(sprintf "%*.*f" 5 4 5.0f)) "5.0000" + test "test6136" (lazy(sprintf "%-f" 5.0f)) "5.000000" + test "test6137" (lazy(sprintf "%-5f" 5.0f)) "5.000000" + test "test6138" (lazy(sprintf "%-1f" 5.0f)) "5.000000" + test "test6139" (lazy(sprintf "%-*f" 7 5.0f)) "5.000000" + test "test6140" (lazy(sprintf "%-.5f" 5.0f)) "5.00000" + test "test6141" (lazy(sprintf "%-.*f" 4 5.0f)) "5.0000" + test "test6142" (lazy(sprintf "%-*.*f" 5 4 5.0f)) "5.0000" + test "test6143" (lazy(sprintf "%0f" 5.0f)) "5.000000" + test "test6144" (lazy(sprintf "%05f" 5.0f)) "5.000000" + test "test6145" (lazy(sprintf "%01f" 5.0f)) "5.000000" + test "test6146" (lazy(sprintf "%0*f" 7 5.0f)) "5.000000" + test "test6147" (lazy(sprintf "%0.5f" 5.0f)) "5.00000" + test "test6148" (lazy(sprintf "%0.*f" 4 5.0f)) "5.0000" + test "test6149" (lazy(sprintf "%0*.*f" 5 4 5.0f)) "5.0000" + test "test6150" (lazy(sprintf "%-0f" 5.0f)) "5.000000" + test "test6151" (lazy(sprintf "%-05f" 5.0f)) "5.000000" + test "test6152" (lazy(sprintf "%-01f" 5.0f)) "5.000000" + test "test6153" (lazy(sprintf "%-0*f" 7 5.0f)) "5.000000" + test "test6154" (lazy(sprintf "%-0.5f" 5.0f)) "5.00000" + test "test6155" (lazy(sprintf "%-0.*f" 4 5.0f)) "5.0000" + test "test6156" (lazy(sprintf "%-0*.*f" 5 4 5.0f)) "5.0000" + test "test6157" (lazy(sprintf "%+f" 5.0f)) "+5.000000" + test "test6158" (lazy(sprintf "%+5f" 5.0f)) "+5.000000" + test "test6159" (lazy(sprintf "%+1f" 5.0f)) "+5.000000" + test "test6160" (lazy(sprintf "%+*f" 7 5.0f)) "+5.000000" + test "test6161" (lazy(sprintf "%+.5f" 5.0f)) "+5.00000" + test "test6162" (lazy(sprintf "%+.*f" 4 5.0f)) "+5.0000" + test "test6163" (lazy(sprintf "%+*.*f" 5 4 5.0f)) "+5.0000" + test "test6164" (lazy(sprintf "%-+f" 5.0f)) "+5.000000" + test "test6165" (lazy(sprintf "%-+5f" 5.0f)) "+5.000000" + test "test6166" (lazy(sprintf "%-+1f" 5.0f)) "+5.000000" + test "test6167" (lazy(sprintf "%-+*f" 7 5.0f)) "+5.000000" + test "test6168" (lazy(sprintf "%-+.5f" 5.0f)) "+5.00000" + test "test6169" (lazy(sprintf "%-+.*f" 4 5.0f)) "+5.0000" + test "test6170" (lazy(sprintf "%-+*.*f" 5 4 5.0f)) "+5.0000" + test "test6171" (lazy(sprintf "%+0f" 5.0f)) "+5.000000" + test "test6172" (lazy(sprintf "%+05f" 5.0f)) "+5.000000" + test "test6173" (lazy(sprintf "%+01f" 5.0f)) "+5.000000" + test "test6174" (lazy(sprintf "%+0*f" 7 5.0f)) "+5.000000" + test "test6175" (lazy(sprintf "%+0.5f" 5.0f)) "+5.00000" + test "test6176" (lazy(sprintf "%+0.*f" 4 5.0f)) "+5.0000" + test "test6177" (lazy(sprintf "%+0*.*f" 5 4 5.0f)) "+5.0000" + test "test6178" (lazy(sprintf "%-+0f" 5.0f)) "+5.000000" + test "test6179" (lazy(sprintf "%-+05f" 5.0f)) "+5.000000" + test "test6180" (lazy(sprintf "%-+01f" 5.0f)) "+5.000000" + test "test6181" (lazy(sprintf "%-+0*f" 7 5.0f)) "+5.000000" + test "test6182" (lazy(sprintf "%-+0.5f" 5.0f)) "+5.00000" + test "test6183" (lazy(sprintf "%-+0.*f" 4 5.0f)) "+5.0000" + test "test6184" (lazy(sprintf "%-+0*.*f" 5 4 5.0f)) "+5.0000" + test "test6185" (lazy(sprintf "% f" 5.0f)) " 5.000000" + test "test6186" (lazy(sprintf "% 5f" 5.0f)) " 5.000000" + test "test6187" (lazy(sprintf "% 1f" 5.0f)) " 5.000000" + test "test6188" (lazy(sprintf "% *f" 7 5.0f)) " 5.000000" + test "test6189" (lazy(sprintf "% .5f" 5.0f)) " 5.00000" + test "test6190" (lazy(sprintf "% .*f" 4 5.0f)) " 5.0000" + test "test6191" (lazy(sprintf "% *.*f" 5 4 5.0f)) " 5.0000" + test "test6192" (lazy(sprintf "%- f" 5.0f)) " 5.000000" + test "test6193" (lazy(sprintf "%- 5f" 5.0f)) " 5.000000" + test "test6194" (lazy(sprintf "%- 1f" 5.0f)) " 5.000000" + test "test6195" (lazy(sprintf "%- *f" 7 5.0f)) " 5.000000" + test "test6196" (lazy(sprintf "%- .5f" 5.0f)) " 5.00000" + test "test6197" (lazy(sprintf "%- .*f" 4 5.0f)) " 5.0000" + test "test6198" (lazy(sprintf "%- *.*f" 5 4 5.0f)) " 5.0000" + test "test6199" (lazy(sprintf "% 0f" 5.0f)) " 5.000000" + test "test6200" (lazy(sprintf "% 05f" 5.0f)) " 5.000000" + test "test6201" (lazy(sprintf "% 01f" 5.0f)) " 5.000000" + test "test6202" (lazy(sprintf "% 0*f" 7 5.0f)) " 5.000000" + test "test6203" (lazy(sprintf "% 0.5f" 5.0f)) " 5.00000" + test "test6204" (lazy(sprintf "% 0.*f" 4 5.0f)) " 5.0000" + test "test6205" (lazy(sprintf "% 0*.*f" 5 4 5.0f)) " 5.0000" + test "test6206" (lazy(sprintf "%- 0f" 5.0f)) " 5.000000" + test "test6207" (lazy(sprintf "%- 05f" 5.0f)) " 5.000000" + test "test6208" (lazy(sprintf "%- 01f" 5.0f)) " 5.000000" + test "test6209" (lazy(sprintf "%- 0*f" 7 5.0f)) " 5.000000" + test "test6210" (lazy(sprintf "%- 0.5f" 5.0f)) " 5.00000" + test "test6211" (lazy(sprintf "%- 0.*f" 4 5.0f)) " 5.0000" + test "test6212" (lazy(sprintf "%- 0*.*f" 5 4 5.0f)) " 5.0000" + test "test6213" (lazy(sprintf "%f" -10.0f)) "-10.000000" + test "test6214" (lazy(sprintf "%5f" -10.0f)) "-10.000000" + test "test6215" (lazy(sprintf "%1f" -10.0f)) "-10.000000" + test "test6216" (lazy(sprintf "%*f" 7 -10.0f)) "-10.000000" + test "test6217" (lazy(sprintf "%.5f" -10.0f)) "-10.00000" + test "test6218" (lazy(sprintf "%.*f" 4 -10.0f)) "-10.0000" + test "test6219" (lazy(sprintf "%*.*f" 5 4 -10.0f)) "-10.0000" + test "test6220" (lazy(sprintf "%-f" -10.0f)) "-10.000000" + test "test6221" (lazy(sprintf "%-5f" -10.0f)) "-10.000000" + test "test6222" (lazy(sprintf "%-1f" -10.0f)) "-10.000000" + test "test6223" (lazy(sprintf "%-*f" 7 -10.0f)) "-10.000000" + test "test6224" (lazy(sprintf "%-.5f" -10.0f)) "-10.00000" + test "test6225" (lazy(sprintf "%-.*f" 4 -10.0f)) "-10.0000" + test "test6226" (lazy(sprintf "%-*.*f" 5 4 -10.0f)) "-10.0000" + test "test6227" (lazy(sprintf "%0f" -10.0f)) "-10.000000" + test "test6228" (lazy(sprintf "%05f" -10.0f)) "-10.000000" + test "test6229" (lazy(sprintf "%01f" -10.0f)) "-10.000000" + test "test6230" (lazy(sprintf "%0*f" 7 -10.0f)) "-10.000000" + test "test6231" (lazy(sprintf "%0.5f" -10.0f)) "-10.00000" + test "test6232" (lazy(sprintf "%0.*f" 4 -10.0f)) "-10.0000" + test "test6233" (lazy(sprintf "%0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6234" (lazy(sprintf "%-0f" -10.0f)) "-10.000000" + test "test6235" (lazy(sprintf "%-05f" -10.0f)) "-10.000000" + test "test6236" (lazy(sprintf "%-01f" -10.0f)) "-10.000000" + test "test6237" (lazy(sprintf "%-0*f" 7 -10.0f)) "-10.000000" + test "test6238" (lazy(sprintf "%-0.5f" -10.0f)) "-10.00000" + test "test6239" (lazy(sprintf "%-0.*f" 4 -10.0f)) "-10.0000" + test "test6240" (lazy(sprintf "%-0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6241" (lazy(sprintf "%+f" -10.0f)) "-10.000000" + test "test6242" (lazy(sprintf "%+5f" -10.0f)) "-10.000000" + test "test6243" (lazy(sprintf "%+1f" -10.0f)) "-10.000000" + test "test6244" (lazy(sprintf "%+*f" 7 -10.0f)) "-10.000000" + test "test6245" (lazy(sprintf "%+.5f" -10.0f)) "-10.00000" + test "test6246" (lazy(sprintf "%+.*f" 4 -10.0f)) "-10.0000" + test "test6247" (lazy(sprintf "%+*.*f" 5 4 -10.0f)) "-10.0000" + test "test6248" (lazy(sprintf "%-+f" -10.0f)) "-10.000000" + test "test6249" (lazy(sprintf "%-+5f" -10.0f)) "-10.000000" + test "test6250" (lazy(sprintf "%-+1f" -10.0f)) "-10.000000" + test "test6251" (lazy(sprintf "%-+*f" 7 -10.0f)) "-10.000000" + test "test6252" (lazy(sprintf "%-+.5f" -10.0f)) "-10.00000" + test "test6253" (lazy(sprintf "%-+.*f" 4 -10.0f)) "-10.0000" + test "test6254" (lazy(sprintf "%-+*.*f" 5 4 -10.0f)) "-10.0000" + test "test6255" (lazy(sprintf "%+0f" -10.0f)) "-10.000000" + test "test6256" (lazy(sprintf "%+05f" -10.0f)) "-10.000000" + test "test6257" (lazy(sprintf "%+01f" -10.0f)) "-10.000000" + test "test6258" (lazy(sprintf "%+0*f" 7 -10.0f)) "-10.000000" + test "test6259" (lazy(sprintf "%+0.5f" -10.0f)) "-10.00000" + test "test6260" (lazy(sprintf "%+0.*f" 4 -10.0f)) "-10.0000" + test "test6261" (lazy(sprintf "%+0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6262" (lazy(sprintf "%-+0f" -10.0f)) "-10.000000" + test "test6263" (lazy(sprintf "%-+05f" -10.0f)) "-10.000000" + test "test6264" (lazy(sprintf "%-+01f" -10.0f)) "-10.000000" + test "test6265" (lazy(sprintf "%-+0*f" 7 -10.0f)) "-10.000000" + test "test6266" (lazy(sprintf "%-+0.5f" -10.0f)) "-10.00000" + test "test6267" (lazy(sprintf "%-+0.*f" 4 -10.0f)) "-10.0000" + test "test6268" (lazy(sprintf "%-+0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6269" (lazy(sprintf "% f" -10.0f)) "-10.000000" + test "test6270" (lazy(sprintf "% 5f" -10.0f)) "-10.000000" + test "test6271" (lazy(sprintf "% 1f" -10.0f)) "-10.000000" + test "test6272" (lazy(sprintf "% *f" 7 -10.0f)) "-10.000000" + test "test6273" (lazy(sprintf "% .5f" -10.0f)) "-10.00000" + test "test6274" (lazy(sprintf "% .*f" 4 -10.0f)) "-10.0000" + test "test6275" (lazy(sprintf "% *.*f" 5 4 -10.0f)) "-10.0000" + test "test6276" (lazy(sprintf "%- f" -10.0f)) "-10.000000" + test "test6277" (lazy(sprintf "%- 5f" -10.0f)) "-10.000000" + test "test6278" (lazy(sprintf "%- 1f" -10.0f)) "-10.000000" + test "test6279" (lazy(sprintf "%- *f" 7 -10.0f)) "-10.000000" + test "test6280" (lazy(sprintf "%- .5f" -10.0f)) "-10.00000" + test "test6281" (lazy(sprintf "%- .*f" 4 -10.0f)) "-10.0000" + test "test6282" (lazy(sprintf "%- *.*f" 5 4 -10.0f)) "-10.0000" + test "test6283" (lazy(sprintf "% 0f" -10.0f)) "-10.000000" + test "test6284" (lazy(sprintf "% 05f" -10.0f)) "-10.000000" + test "test6285" (lazy(sprintf "% 01f" -10.0f)) "-10.000000" + test "test6286" (lazy(sprintf "% 0*f" 7 -10.0f)) "-10.000000" + test "test6287" (lazy(sprintf "% 0.5f" -10.0f)) "-10.00000" + test "test6288" (lazy(sprintf "% 0.*f" 4 -10.0f)) "-10.0000" + test "test6289" (lazy(sprintf "% 0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6290" (lazy(sprintf "%- 0f" -10.0f)) "-10.000000" + test "test6291" (lazy(sprintf "%- 05f" -10.0f)) "-10.000000" + test "test6292" (lazy(sprintf "%- 01f" -10.0f)) "-10.000000" + test "test6293" (lazy(sprintf "%- 0*f" 7 -10.0f)) "-10.000000" + test "test6294" (lazy(sprintf "%- 0.5f" -10.0f)) "-10.00000" + test "test6295" (lazy(sprintf "%- 0.*f" 4 -10.0f)) "-10.0000" + test "test6296" (lazy(sprintf "%- 0*.*f" 5 4 -10.0f)) "-10.0000" + test "test6297" (lazy(sprintf "%f" 5.0M)) "5.000000" + test "test6298" (lazy(sprintf "%5f" 5.0M)) "5.000000" + test "test6299" (lazy(sprintf "%1f" 5.0M)) "5.000000" + test "test6300" (lazy(sprintf "%*f" 7 5.0M)) "5.000000" + test "test6301" (lazy(sprintf "%.5f" 5.0M)) "5.00000" + test "test6302" (lazy(sprintf "%.*f" 4 5.0M)) "5.0000" + test "test6303" (lazy(sprintf "%*.*f" 5 4 5.0M)) "5.0000" + test "test6304" (lazy(sprintf "%-f" 5.0M)) "5.000000" + test "test6305" (lazy(sprintf "%-5f" 5.0M)) "5.000000" + test "test6306" (lazy(sprintf "%-1f" 5.0M)) "5.000000" + test "test6307" (lazy(sprintf "%-*f" 7 5.0M)) "5.000000" + test "test6308" (lazy(sprintf "%-.5f" 5.0M)) "5.00000" + test "test6309" (lazy(sprintf "%-.*f" 4 5.0M)) "5.0000" + test "test6310" (lazy(sprintf "%-*.*f" 5 4 5.0M)) "5.0000" + test "test6311" (lazy(sprintf "%0f" 5.0M)) "5.000000" + test "test6312" (lazy(sprintf "%05f" 5.0M)) "5.000000" + test "test6313" (lazy(sprintf "%01f" 5.0M)) "5.000000" + test "test6314" (lazy(sprintf "%0*f" 7 5.0M)) "5.000000" + test "test6315" (lazy(sprintf "%0.5f" 5.0M)) "5.00000" + test "test6316" (lazy(sprintf "%0.*f" 4 5.0M)) "5.0000" + test "test6317" (lazy(sprintf "%0*.*f" 5 4 5.0M)) "5.0000" + test "test6318" (lazy(sprintf "%-0f" 5.0M)) "5.000000" + test "test6319" (lazy(sprintf "%-05f" 5.0M)) "5.000000" + test "test6320" (lazy(sprintf "%-01f" 5.0M)) "5.000000" + test "test6321" (lazy(sprintf "%-0*f" 7 5.0M)) "5.000000" + test "test6322" (lazy(sprintf "%-0.5f" 5.0M)) "5.00000" + test "test6323" (lazy(sprintf "%-0.*f" 4 5.0M)) "5.0000" + test "test6324" (lazy(sprintf "%-0*.*f" 5 4 5.0M)) "5.0000" + test "test6325" (lazy(sprintf "%+f" 5.0M)) "+5.000000" + test "test6326" (lazy(sprintf "%+5f" 5.0M)) "+5.000000" + test "test6327" (lazy(sprintf "%+1f" 5.0M)) "+5.000000" + test "test6328" (lazy(sprintf "%+*f" 7 5.0M)) "+5.000000" + test "test6329" (lazy(sprintf "%+.5f" 5.0M)) "+5.00000" + test "test6330" (lazy(sprintf "%+.*f" 4 5.0M)) "+5.0000" + test "test6331" (lazy(sprintf "%+*.*f" 5 4 5.0M)) "+5.0000" + test "test6332" (lazy(sprintf "%-+f" 5.0M)) "+5.000000" + test "test6333" (lazy(sprintf "%-+5f" 5.0M)) "+5.000000" + test "test6334" (lazy(sprintf "%-+1f" 5.0M)) "+5.000000" + test "test6335" (lazy(sprintf "%-+*f" 7 5.0M)) "+5.000000" + test "test6336" (lazy(sprintf "%-+.5f" 5.0M)) "+5.00000" + test "test6337" (lazy(sprintf "%-+.*f" 4 5.0M)) "+5.0000" + test "test6338" (lazy(sprintf "%-+*.*f" 5 4 5.0M)) "+5.0000" + test "test6339" (lazy(sprintf "%+0f" 5.0M)) "+5.000000" + test "test6340" (lazy(sprintf "%+05f" 5.0M)) "+5.000000" + test "test6341" (lazy(sprintf "%+01f" 5.0M)) "+5.000000" + test "test6342" (lazy(sprintf "%+0*f" 7 5.0M)) "+5.000000" + test "test6343" (lazy(sprintf "%+0.5f" 5.0M)) "+5.00000" + test "test6344" (lazy(sprintf "%+0.*f" 4 5.0M)) "+5.0000" + test "test6345" (lazy(sprintf "%+0*.*f" 5 4 5.0M)) "+5.0000" + test "test6346" (lazy(sprintf "%-+0f" 5.0M)) "+5.000000" + test "test6347" (lazy(sprintf "%-+05f" 5.0M)) "+5.000000" + test "test6348" (lazy(sprintf "%-+01f" 5.0M)) "+5.000000" + test "test6349" (lazy(sprintf "%-+0*f" 7 5.0M)) "+5.000000" + test "test6350" (lazy(sprintf "%-+0.5f" 5.0M)) "+5.00000" + test "test6351" (lazy(sprintf "%-+0.*f" 4 5.0M)) "+5.0000" + test "test6352" (lazy(sprintf "%-+0*.*f" 5 4 5.0M)) "+5.0000" + test "test6353" (lazy(sprintf "% f" 5.0M)) " 5.000000" + test "test6354" (lazy(sprintf "% 5f" 5.0M)) " 5.000000" + test "test6355" (lazy(sprintf "% 1f" 5.0M)) " 5.000000" + test "test6356" (lazy(sprintf "% *f" 7 5.0M)) " 5.000000" + test "test6357" (lazy(sprintf "% .5f" 5.0M)) " 5.00000" + test "test6358" (lazy(sprintf "% .*f" 4 5.0M)) " 5.0000" + test "test6359" (lazy(sprintf "% *.*f" 5 4 5.0M)) " 5.0000" + test "test6360" (lazy(sprintf "%- f" 5.0M)) " 5.000000" + test "test6361" (lazy(sprintf "%- 5f" 5.0M)) " 5.000000" + test "test6362" (lazy(sprintf "%- 1f" 5.0M)) " 5.000000" + test "test6363" (lazy(sprintf "%- *f" 7 5.0M)) " 5.000000" + test "test6364" (lazy(sprintf "%- .5f" 5.0M)) " 5.00000" + test "test6365" (lazy(sprintf "%- .*f" 4 5.0M)) " 5.0000" + test "test6366" (lazy(sprintf "%- *.*f" 5 4 5.0M)) " 5.0000" + test "test6367" (lazy(sprintf "% 0f" 5.0M)) " 5.000000" + test "test6368" (lazy(sprintf "% 05f" 5.0M)) " 5.000000" + test "test6369" (lazy(sprintf "% 01f" 5.0M)) " 5.000000" + test "test6370" (lazy(sprintf "% 0*f" 7 5.0M)) " 5.000000" + test "test6371" (lazy(sprintf "% 0.5f" 5.0M)) " 5.00000" + test "test6372" (lazy(sprintf "% 0.*f" 4 5.0M)) " 5.0000" + test "test6373" (lazy(sprintf "% 0*.*f" 5 4 5.0M)) " 5.0000" + test "test6374" (lazy(sprintf "%- 0f" 5.0M)) " 5.000000" + test "test6375" (lazy(sprintf "%- 05f" 5.0M)) " 5.000000" + test "test6376" (lazy(sprintf "%- 01f" 5.0M)) " 5.000000" + test "test6377" (lazy(sprintf "%- 0*f" 7 5.0M)) " 5.000000" + test "test6378" (lazy(sprintf "%- 0.5f" 5.0M)) " 5.00000" + test "test6379" (lazy(sprintf "%- 0.*f" 4 5.0M)) " 5.0000" + test "test6380" (lazy(sprintf "%- 0*.*f" 5 4 5.0M)) " 5.0000" + test "test6381" (lazy(sprintf "%f" -10.0M)) "-10.000000" + test "test6382" (lazy(sprintf "%5f" -10.0M)) "-10.000000" + test "test6383" (lazy(sprintf "%1f" -10.0M)) "-10.000000" + test "test6384" (lazy(sprintf "%*f" 7 -10.0M)) "-10.000000" + test "test6385" (lazy(sprintf "%.5f" -10.0M)) "-10.00000" + test "test6386" (lazy(sprintf "%.*f" 4 -10.0M)) "-10.0000" + test "test6387" (lazy(sprintf "%*.*f" 5 4 -10.0M)) "-10.0000" + test "test6388" (lazy(sprintf "%-f" -10.0M)) "-10.000000" + test "test6389" (lazy(sprintf "%-5f" -10.0M)) "-10.000000" + test "test6390" (lazy(sprintf "%-1f" -10.0M)) "-10.000000" + test "test6391" (lazy(sprintf "%-*f" 7 -10.0M)) "-10.000000" + test "test6392" (lazy(sprintf "%-.5f" -10.0M)) "-10.00000" + test "test6393" (lazy(sprintf "%-.*f" 4 -10.0M)) "-10.0000" + test "test6394" (lazy(sprintf "%-*.*f" 5 4 -10.0M)) "-10.0000" + test "test6395" (lazy(sprintf "%0f" -10.0M)) "-10.000000" + test "test6396" (lazy(sprintf "%05f" -10.0M)) "-10.000000" + test "test6397" (lazy(sprintf "%01f" -10.0M)) "-10.000000" + test "test6398" (lazy(sprintf "%0*f" 7 -10.0M)) "-10.000000" + test "test6399" (lazy(sprintf "%0.5f" -10.0M)) "-10.00000" + test "test6400" (lazy(sprintf "%0.*f" 4 -10.0M)) "-10.0000" + test "test6401" (lazy(sprintf "%0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6402" (lazy(sprintf "%-0f" -10.0M)) "-10.000000" + test "test6403" (lazy(sprintf "%-05f" -10.0M)) "-10.000000" + test "test6404" (lazy(sprintf "%-01f" -10.0M)) "-10.000000" + test "test6405" (lazy(sprintf "%-0*f" 7 -10.0M)) "-10.000000" + test "test6406" (lazy(sprintf "%-0.5f" -10.0M)) "-10.00000" + test "test6407" (lazy(sprintf "%-0.*f" 4 -10.0M)) "-10.0000" + test "test6408" (lazy(sprintf "%-0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6409" (lazy(sprintf "%+f" -10.0M)) "-10.000000" + test "test6410" (lazy(sprintf "%+5f" -10.0M)) "-10.000000" + test "test6411" (lazy(sprintf "%+1f" -10.0M)) "-10.000000" + test "test6412" (lazy(sprintf "%+*f" 7 -10.0M)) "-10.000000" + test "test6413" (lazy(sprintf "%+.5f" -10.0M)) "-10.00000" + test "test6414" (lazy(sprintf "%+.*f" 4 -10.0M)) "-10.0000" + test "test6415" (lazy(sprintf "%+*.*f" 5 4 -10.0M)) "-10.0000" + test "test6416" (lazy(sprintf "%-+f" -10.0M)) "-10.000000" + test "test6417" (lazy(sprintf "%-+5f" -10.0M)) "-10.000000" + test "test6418" (lazy(sprintf "%-+1f" -10.0M)) "-10.000000" + test "test6419" (lazy(sprintf "%-+*f" 7 -10.0M)) "-10.000000" + test "test6420" (lazy(sprintf "%-+.5f" -10.0M)) "-10.00000" + test "test6421" (lazy(sprintf "%-+.*f" 4 -10.0M)) "-10.0000" + test "test6422" (lazy(sprintf "%-+*.*f" 5 4 -10.0M)) "-10.0000" + test "test6423" (lazy(sprintf "%+0f" -10.0M)) "-10.000000" + test "test6424" (lazy(sprintf "%+05f" -10.0M)) "-10.000000" + test "test6425" (lazy(sprintf "%+01f" -10.0M)) "-10.000000" + test "test6426" (lazy(sprintf "%+0*f" 7 -10.0M)) "-10.000000" + test "test6427" (lazy(sprintf "%+0.5f" -10.0M)) "-10.00000" + test "test6428" (lazy(sprintf "%+0.*f" 4 -10.0M)) "-10.0000" + test "test6429" (lazy(sprintf "%+0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6430" (lazy(sprintf "%-+0f" -10.0M)) "-10.000000" + test "test6431" (lazy(sprintf "%-+05f" -10.0M)) "-10.000000" + test "test6432" (lazy(sprintf "%-+01f" -10.0M)) "-10.000000" + test "test6433" (lazy(sprintf "%-+0*f" 7 -10.0M)) "-10.000000" + test "test6434" (lazy(sprintf "%-+0.5f" -10.0M)) "-10.00000" + test "test6435" (lazy(sprintf "%-+0.*f" 4 -10.0M)) "-10.0000" + test "test6436" (lazy(sprintf "%-+0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6437" (lazy(sprintf "% f" -10.0M)) "-10.000000" + test "test6438" (lazy(sprintf "% 5f" -10.0M)) "-10.000000" + test "test6439" (lazy(sprintf "% 1f" -10.0M)) "-10.000000" + test "test6440" (lazy(sprintf "% *f" 7 -10.0M)) "-10.000000" + test "test6441" (lazy(sprintf "% .5f" -10.0M)) "-10.00000" + test "test6442" (lazy(sprintf "% .*f" 4 -10.0M)) "-10.0000" + test "test6443" (lazy(sprintf "% *.*f" 5 4 -10.0M)) "-10.0000" + test "test6444" (lazy(sprintf "%- f" -10.0M)) "-10.000000" + test "test6445" (lazy(sprintf "%- 5f" -10.0M)) "-10.000000" + test "test6446" (lazy(sprintf "%- 1f" -10.0M)) "-10.000000" + test "test6447" (lazy(sprintf "%- *f" 7 -10.0M)) "-10.000000" + test "test6448" (lazy(sprintf "%- .5f" -10.0M)) "-10.00000" + test "test6449" (lazy(sprintf "%- .*f" 4 -10.0M)) "-10.0000" + test "test6450" (lazy(sprintf "%- *.*f" 5 4 -10.0M)) "-10.0000" + test "test6451" (lazy(sprintf "% 0f" -10.0M)) "-10.000000" + test "test6452" (lazy(sprintf "% 05f" -10.0M)) "-10.000000" + test "test6453" (lazy(sprintf "% 01f" -10.0M)) "-10.000000" + test "test6454" (lazy(sprintf "% 0*f" 7 -10.0M)) "-10.000000" + test "test6455" (lazy(sprintf "% 0.5f" -10.0M)) "-10.00000" + test "test6456" (lazy(sprintf "% 0.*f" 4 -10.0M)) "-10.0000" + test "test6457" (lazy(sprintf "% 0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6458" (lazy(sprintf "%- 0f" -10.0M)) "-10.000000" + test "test6459" (lazy(sprintf "%- 05f" -10.0M)) "-10.000000" + test "test6460" (lazy(sprintf "%- 01f" -10.0M)) "-10.000000" + test "test6461" (lazy(sprintf "%- 0*f" 7 -10.0M)) "-10.000000" + test "test6462" (lazy(sprintf "%- 0.5f" -10.0M)) "-10.00000" + test "test6463" (lazy(sprintf "%- 0.*f" 4 -10.0M)) "-10.0000" + test "test6464" (lazy(sprintf "%- 0*.*f" 5 4 -10.0M)) "-10.0000" + test "test6465" (lazy(sprintf "%F" 5.0)) "5.000000" + test "test6466" (lazy(sprintf "%5F" 5.0)) "5.000000" + test "test6467" (lazy(sprintf "%1F" 5.0)) "5.000000" + test "test6468" (lazy(sprintf "%*F" 7 5.0)) "5.000000" + test "test6469" (lazy(sprintf "%.5F" 5.0)) "5.00000" + test "test6470" (lazy(sprintf "%.*F" 4 5.0)) "5.0000" + test "test6471" (lazy(sprintf "%*.*F" 5 4 5.0)) "5.0000" + test "test6472" (lazy(sprintf "%-F" 5.0)) "5.000000" + test "test6473" (lazy(sprintf "%-5F" 5.0)) "5.000000" + test "test6474" (lazy(sprintf "%-1F" 5.0)) "5.000000" + test "test6475" (lazy(sprintf "%-*F" 7 5.0)) "5.000000" + test "test6476" (lazy(sprintf "%-.5F" 5.0)) "5.00000" + test "test6477" (lazy(sprintf "%-.*F" 4 5.0)) "5.0000" + test "test6478" (lazy(sprintf "%-*.*F" 5 4 5.0)) "5.0000" + test "test6479" (lazy(sprintf "%0F" 5.0)) "5.000000" + test "test6480" (lazy(sprintf "%05F" 5.0)) "5.000000" + test "test6481" (lazy(sprintf "%01F" 5.0)) "5.000000" + test "test6482" (lazy(sprintf "%0*F" 7 5.0)) "5.000000" + test "test6483" (lazy(sprintf "%0.5F" 5.0)) "5.00000" + test "test6484" (lazy(sprintf "%0.*F" 4 5.0)) "5.0000" + test "test6485" (lazy(sprintf "%0*.*F" 5 4 5.0)) "5.0000" + test "test6486" (lazy(sprintf "%-0F" 5.0)) "5.000000" + test "test6487" (lazy(sprintf "%-05F" 5.0)) "5.000000" + test "test6488" (lazy(sprintf "%-01F" 5.0)) "5.000000" + test "test6489" (lazy(sprintf "%-0*F" 7 5.0)) "5.000000" + test "test6490" (lazy(sprintf "%-0.5F" 5.0)) "5.00000" + test "test6491" (lazy(sprintf "%-0.*F" 4 5.0)) "5.0000" + test "test6492" (lazy(sprintf "%-0*.*F" 5 4 5.0)) "5.0000" + test "test6493" (lazy(sprintf "%+F" 5.0)) "+5.000000" + test "test6494" (lazy(sprintf "%+5F" 5.0)) "+5.000000" + test "test6495" (lazy(sprintf "%+1F" 5.0)) "+5.000000" + test "test6496" (lazy(sprintf "%+*F" 7 5.0)) "+5.000000" + test "test6497" (lazy(sprintf "%+.5F" 5.0)) "+5.00000" + test "test6498" (lazy(sprintf "%+.*F" 4 5.0)) "+5.0000" + test "test6499" (lazy(sprintf "%+*.*F" 5 4 5.0)) "+5.0000" + test "test6500" (lazy(sprintf "%-+F" 5.0)) "+5.000000" + test "test6501" (lazy(sprintf "%-+5F" 5.0)) "+5.000000" + test "test6502" (lazy(sprintf "%-+1F" 5.0)) "+5.000000" + test "test6503" (lazy(sprintf "%-+*F" 7 5.0)) "+5.000000" + test "test6504" (lazy(sprintf "%-+.5F" 5.0)) "+5.00000" + test "test6505" (lazy(sprintf "%-+.*F" 4 5.0)) "+5.0000" + test "test6506" (lazy(sprintf "%-+*.*F" 5 4 5.0)) "+5.0000" + test "test6507" (lazy(sprintf "%+0F" 5.0)) "+5.000000" + test "test6508" (lazy(sprintf "%+05F" 5.0)) "+5.000000" + test "test6509" (lazy(sprintf "%+01F" 5.0)) "+5.000000" + test "test6510" (lazy(sprintf "%+0*F" 7 5.0)) "+5.000000" + test "test6511" (lazy(sprintf "%+0.5F" 5.0)) "+5.00000" + test "test6512" (lazy(sprintf "%+0.*F" 4 5.0)) "+5.0000" + test "test6513" (lazy(sprintf "%+0*.*F" 5 4 5.0)) "+5.0000" + test "test6514" (lazy(sprintf "%-+0F" 5.0)) "+5.000000" + test "test6515" (lazy(sprintf "%-+05F" 5.0)) "+5.000000" + test "test6516" (lazy(sprintf "%-+01F" 5.0)) "+5.000000" + test "test6517" (lazy(sprintf "%-+0*F" 7 5.0)) "+5.000000" + test "test6518" (lazy(sprintf "%-+0.5F" 5.0)) "+5.00000" + test "test6519" (lazy(sprintf "%-+0.*F" 4 5.0)) "+5.0000" + test "test6520" (lazy(sprintf "%-+0*.*F" 5 4 5.0)) "+5.0000" + test "test6521" (lazy(sprintf "% F" 5.0)) " 5.000000" + test "test6522" (lazy(sprintf "% 5F" 5.0)) " 5.000000" + test "test6523" (lazy(sprintf "% 1F" 5.0)) " 5.000000" + test "test6524" (lazy(sprintf "% *F" 7 5.0)) " 5.000000" + test "test6525" (lazy(sprintf "% .5F" 5.0)) " 5.00000" + test "test6526" (lazy(sprintf "% .*F" 4 5.0)) " 5.0000" + test "test6527" (lazy(sprintf "% *.*F" 5 4 5.0)) " 5.0000" + test "test6528" (lazy(sprintf "%- F" 5.0)) " 5.000000" + test "test6529" (lazy(sprintf "%- 5F" 5.0)) " 5.000000" + test "test6530" (lazy(sprintf "%- 1F" 5.0)) " 5.000000" + test "test6531" (lazy(sprintf "%- *F" 7 5.0)) " 5.000000" + test "test6532" (lazy(sprintf "%- .5F" 5.0)) " 5.00000" + test "test6533" (lazy(sprintf "%- .*F" 4 5.0)) " 5.0000" + test "test6534" (lazy(sprintf "%- *.*F" 5 4 5.0)) " 5.0000" + test "test6535" (lazy(sprintf "% 0F" 5.0)) " 5.000000" + test "test6536" (lazy(sprintf "% 05F" 5.0)) " 5.000000" + test "test6537" (lazy(sprintf "% 01F" 5.0)) " 5.000000" + test "test6538" (lazy(sprintf "% 0*F" 7 5.0)) " 5.000000" + test "test6539" (lazy(sprintf "% 0.5F" 5.0)) " 5.00000" + test "test6540" (lazy(sprintf "% 0.*F" 4 5.0)) " 5.0000" + test "test6541" (lazy(sprintf "% 0*.*F" 5 4 5.0)) " 5.0000" + test "test6542" (lazy(sprintf "%- 0F" 5.0)) " 5.000000" + test "test6543" (lazy(sprintf "%- 05F" 5.0)) " 5.000000" + test "test6544" (lazy(sprintf "%- 01F" 5.0)) " 5.000000" + test "test6545" (lazy(sprintf "%- 0*F" 7 5.0)) " 5.000000" + test "test6546" (lazy(sprintf "%- 0.5F" 5.0)) " 5.00000" + test "test6547" (lazy(sprintf "%- 0.*F" 4 5.0)) " 5.0000" + test "test6548" (lazy(sprintf "%- 0*.*F" 5 4 5.0)) " 5.0000" + test "test6549" (lazy(sprintf "%F" -10.0)) "-10.000000" + test "test6550" (lazy(sprintf "%5F" -10.0)) "-10.000000" + test "test6551" (lazy(sprintf "%1F" -10.0)) "-10.000000" + test "test6552" (lazy(sprintf "%*F" 7 -10.0)) "-10.000000" + test "test6553" (lazy(sprintf "%.5F" -10.0)) "-10.00000" + test "test6554" (lazy(sprintf "%.*F" 4 -10.0)) "-10.0000" + test "test6555" (lazy(sprintf "%*.*F" 5 4 -10.0)) "-10.0000" + test "test6556" (lazy(sprintf "%-F" -10.0)) "-10.000000" + test "test6557" (lazy(sprintf "%-5F" -10.0)) "-10.000000" + test "test6558" (lazy(sprintf "%-1F" -10.0)) "-10.000000" + test "test6559" (lazy(sprintf "%-*F" 7 -10.0)) "-10.000000" + test "test6560" (lazy(sprintf "%-.5F" -10.0)) "-10.00000" + test "test6561" (lazy(sprintf "%-.*F" 4 -10.0)) "-10.0000" + test "test6562" (lazy(sprintf "%-*.*F" 5 4 -10.0)) "-10.0000" + test "test6563" (lazy(sprintf "%0F" -10.0)) "-10.000000" + test "test6564" (lazy(sprintf "%05F" -10.0)) "-10.000000" + test "test6565" (lazy(sprintf "%01F" -10.0)) "-10.000000" + test "test6566" (lazy(sprintf "%0*F" 7 -10.0)) "-10.000000" + test "test6567" (lazy(sprintf "%0.5F" -10.0)) "-10.00000" + test "test6568" (lazy(sprintf "%0.*F" 4 -10.0)) "-10.0000" + test "test6569" (lazy(sprintf "%0*.*F" 5 4 -10.0)) "-10.0000" + test "test6570" (lazy(sprintf "%-0F" -10.0)) "-10.000000" + test "test6571" (lazy(sprintf "%-05F" -10.0)) "-10.000000" + test "test6572" (lazy(sprintf "%-01F" -10.0)) "-10.000000" + test "test6573" (lazy(sprintf "%-0*F" 7 -10.0)) "-10.000000" + test "test6574" (lazy(sprintf "%-0.5F" -10.0)) "-10.00000" + test "test6575" (lazy(sprintf "%-0.*F" 4 -10.0)) "-10.0000" + test "test6576" (lazy(sprintf "%-0*.*F" 5 4 -10.0)) "-10.0000" + test "test6577" (lazy(sprintf "%+F" -10.0)) "-10.000000" + test "test6578" (lazy(sprintf "%+5F" -10.0)) "-10.000000" + test "test6579" (lazy(sprintf "%+1F" -10.0)) "-10.000000" + test "test6580" (lazy(sprintf "%+*F" 7 -10.0)) "-10.000000" + test "test6581" (lazy(sprintf "%+.5F" -10.0)) "-10.00000" + test "test6582" (lazy(sprintf "%+.*F" 4 -10.0)) "-10.0000" + test "test6583" (lazy(sprintf "%+*.*F" 5 4 -10.0)) "-10.0000" + test "test6584" (lazy(sprintf "%-+F" -10.0)) "-10.000000" + test "test6585" (lazy(sprintf "%-+5F" -10.0)) "-10.000000" + test "test6586" (lazy(sprintf "%-+1F" -10.0)) "-10.000000" + test "test6587" (lazy(sprintf "%-+*F" 7 -10.0)) "-10.000000" + test "test6588" (lazy(sprintf "%-+.5F" -10.0)) "-10.00000" + test "test6589" (lazy(sprintf "%-+.*F" 4 -10.0)) "-10.0000" + test "test6590" (lazy(sprintf "%-+*.*F" 5 4 -10.0)) "-10.0000" + test "test6591" (lazy(sprintf "%+0F" -10.0)) "-10.000000" + test "test6592" (lazy(sprintf "%+05F" -10.0)) "-10.000000" + test "test6593" (lazy(sprintf "%+01F" -10.0)) "-10.000000" + test "test6594" (lazy(sprintf "%+0*F" 7 -10.0)) "-10.000000" + test "test6595" (lazy(sprintf "%+0.5F" -10.0)) "-10.00000" + test "test6596" (lazy(sprintf "%+0.*F" 4 -10.0)) "-10.0000" + test "test6597" (lazy(sprintf "%+0*.*F" 5 4 -10.0)) "-10.0000" + test "test6598" (lazy(sprintf "%-+0F" -10.0)) "-10.000000" + test "test6599" (lazy(sprintf "%-+05F" -10.0)) "-10.000000" + test "test6600" (lazy(sprintf "%-+01F" -10.0)) "-10.000000" + test "test6601" (lazy(sprintf "%-+0*F" 7 -10.0)) "-10.000000" + test "test6602" (lazy(sprintf "%-+0.5F" -10.0)) "-10.00000" + test "test6603" (lazy(sprintf "%-+0.*F" 4 -10.0)) "-10.0000" + test "test6604" (lazy(sprintf "%-+0*.*F" 5 4 -10.0)) "-10.0000" + test "test6605" (lazy(sprintf "% F" -10.0)) "-10.000000" + test "test6606" (lazy(sprintf "% 5F" -10.0)) "-10.000000" + test "test6607" (lazy(sprintf "% 1F" -10.0)) "-10.000000" + test "test6608" (lazy(sprintf "% *F" 7 -10.0)) "-10.000000" + test "test6609" (lazy(sprintf "% .5F" -10.0)) "-10.00000" + test "test6610" (lazy(sprintf "% .*F" 4 -10.0)) "-10.0000" + test "test6611" (lazy(sprintf "% *.*F" 5 4 -10.0)) "-10.0000" + test "test6612" (lazy(sprintf "%- F" -10.0)) "-10.000000" + test "test6613" (lazy(sprintf "%- 5F" -10.0)) "-10.000000" + test "test6614" (lazy(sprintf "%- 1F" -10.0)) "-10.000000" + test "test6615" (lazy(sprintf "%- *F" 7 -10.0)) "-10.000000" + test "test6616" (lazy(sprintf "%- .5F" -10.0)) "-10.00000" + test "test6617" (lazy(sprintf "%- .*F" 4 -10.0)) "-10.0000" + test "test6618" (lazy(sprintf "%- *.*F" 5 4 -10.0)) "-10.0000" + test "test6619" (lazy(sprintf "% 0F" -10.0)) "-10.000000" + test "test6620" (lazy(sprintf "% 05F" -10.0)) "-10.000000" + test "test6621" (lazy(sprintf "% 01F" -10.0)) "-10.000000" + test "test6622" (lazy(sprintf "% 0*F" 7 -10.0)) "-10.000000" + test "test6623" (lazy(sprintf "% 0.5F" -10.0)) "-10.00000" + test "test6624" (lazy(sprintf "% 0.*F" 4 -10.0)) "-10.0000" + test "test6625" (lazy(sprintf "% 0*.*F" 5 4 -10.0)) "-10.0000" + test "test6626" (lazy(sprintf "%- 0F" -10.0)) "-10.000000" + test "test6627" (lazy(sprintf "%- 05F" -10.0)) "-10.000000" + test "test6628" (lazy(sprintf "%- 01F" -10.0)) "-10.000000" + test "test6629" (lazy(sprintf "%- 0*F" 7 -10.0)) "-10.000000" + test "test6630" (lazy(sprintf "%- 0.5F" -10.0)) "-10.00000" + test "test6631" (lazy(sprintf "%- 0.*F" 4 -10.0)) "-10.0000" + test "test6632" (lazy(sprintf "%- 0*.*F" 5 4 -10.0)) "-10.0000" + test "test6633" (lazy(sprintf "%F" 5.0f)) "5.000000" + test "test6634" (lazy(sprintf "%5F" 5.0f)) "5.000000" + test "test6635" (lazy(sprintf "%1F" 5.0f)) "5.000000" + test "test6636" (lazy(sprintf "%*F" 7 5.0f)) "5.000000" + test "test6637" (lazy(sprintf "%.5F" 5.0f)) "5.00000" + test "test6638" (lazy(sprintf "%.*F" 4 5.0f)) "5.0000" + test "test6639" (lazy(sprintf "%*.*F" 5 4 5.0f)) "5.0000" + test "test6640" (lazy(sprintf "%-F" 5.0f)) "5.000000" + test "test6641" (lazy(sprintf "%-5F" 5.0f)) "5.000000" + test "test6642" (lazy(sprintf "%-1F" 5.0f)) "5.000000" + test "test6643" (lazy(sprintf "%-*F" 7 5.0f)) "5.000000" + test "test6644" (lazy(sprintf "%-.5F" 5.0f)) "5.00000" + test "test6645" (lazy(sprintf "%-.*F" 4 5.0f)) "5.0000" + test "test6646" (lazy(sprintf "%-*.*F" 5 4 5.0f)) "5.0000" + test "test6647" (lazy(sprintf "%0F" 5.0f)) "5.000000" + test "test6648" (lazy(sprintf "%05F" 5.0f)) "5.000000" + test "test6649" (lazy(sprintf "%01F" 5.0f)) "5.000000" + test "test6650" (lazy(sprintf "%0*F" 7 5.0f)) "5.000000" + test "test6651" (lazy(sprintf "%0.5F" 5.0f)) "5.00000" + test "test6652" (lazy(sprintf "%0.*F" 4 5.0f)) "5.0000" + test "test6653" (lazy(sprintf "%0*.*F" 5 4 5.0f)) "5.0000" + test "test6654" (lazy(sprintf "%-0F" 5.0f)) "5.000000" + test "test6655" (lazy(sprintf "%-05F" 5.0f)) "5.000000" + test "test6656" (lazy(sprintf "%-01F" 5.0f)) "5.000000" + test "test6657" (lazy(sprintf "%-0*F" 7 5.0f)) "5.000000" + test "test6658" (lazy(sprintf "%-0.5F" 5.0f)) "5.00000" + test "test6659" (lazy(sprintf "%-0.*F" 4 5.0f)) "5.0000" + test "test6660" (lazy(sprintf "%-0*.*F" 5 4 5.0f)) "5.0000" + test "test6661" (lazy(sprintf "%+F" 5.0f)) "+5.000000" + test "test6662" (lazy(sprintf "%+5F" 5.0f)) "+5.000000" + test "test6663" (lazy(sprintf "%+1F" 5.0f)) "+5.000000" + test "test6664" (lazy(sprintf "%+*F" 7 5.0f)) "+5.000000" + test "test6665" (lazy(sprintf "%+.5F" 5.0f)) "+5.00000" + test "test6666" (lazy(sprintf "%+.*F" 4 5.0f)) "+5.0000" + test "test6667" (lazy(sprintf "%+*.*F" 5 4 5.0f)) "+5.0000" + test "test6668" (lazy(sprintf "%-+F" 5.0f)) "+5.000000" + test "test6669" (lazy(sprintf "%-+5F" 5.0f)) "+5.000000" + test "test6670" (lazy(sprintf "%-+1F" 5.0f)) "+5.000000" + test "test6671" (lazy(sprintf "%-+*F" 7 5.0f)) "+5.000000" + test "test6672" (lazy(sprintf "%-+.5F" 5.0f)) "+5.00000" + test "test6673" (lazy(sprintf "%-+.*F" 4 5.0f)) "+5.0000" + test "test6674" (lazy(sprintf "%-+*.*F" 5 4 5.0f)) "+5.0000" + test "test6675" (lazy(sprintf "%+0F" 5.0f)) "+5.000000" + test "test6676" (lazy(sprintf "%+05F" 5.0f)) "+5.000000" + test "test6677" (lazy(sprintf "%+01F" 5.0f)) "+5.000000" + test "test6678" (lazy(sprintf "%+0*F" 7 5.0f)) "+5.000000" + test "test6679" (lazy(sprintf "%+0.5F" 5.0f)) "+5.00000" + test "test6680" (lazy(sprintf "%+0.*F" 4 5.0f)) "+5.0000" + test "test6681" (lazy(sprintf "%+0*.*F" 5 4 5.0f)) "+5.0000" + test "test6682" (lazy(sprintf "%-+0F" 5.0f)) "+5.000000" + test "test6683" (lazy(sprintf "%-+05F" 5.0f)) "+5.000000" + test "test6684" (lazy(sprintf "%-+01F" 5.0f)) "+5.000000" + test "test6685" (lazy(sprintf "%-+0*F" 7 5.0f)) "+5.000000" + test "test6686" (lazy(sprintf "%-+0.5F" 5.0f)) "+5.00000" + test "test6687" (lazy(sprintf "%-+0.*F" 4 5.0f)) "+5.0000" + test "test6688" (lazy(sprintf "%-+0*.*F" 5 4 5.0f)) "+5.0000" + test "test6689" (lazy(sprintf "% F" 5.0f)) " 5.000000" + test "test6690" (lazy(sprintf "% 5F" 5.0f)) " 5.000000" + test "test6691" (lazy(sprintf "% 1F" 5.0f)) " 5.000000" + test "test6692" (lazy(sprintf "% *F" 7 5.0f)) " 5.000000" + test "test6693" (lazy(sprintf "% .5F" 5.0f)) " 5.00000" + test "test6694" (lazy(sprintf "% .*F" 4 5.0f)) " 5.0000" + test "test6695" (lazy(sprintf "% *.*F" 5 4 5.0f)) " 5.0000" + test "test6696" (lazy(sprintf "%- F" 5.0f)) " 5.000000" + test "test6697" (lazy(sprintf "%- 5F" 5.0f)) " 5.000000" + test "test6698" (lazy(sprintf "%- 1F" 5.0f)) " 5.000000" + test "test6699" (lazy(sprintf "%- *F" 7 5.0f)) " 5.000000" + test "test6700" (lazy(sprintf "%- .5F" 5.0f)) " 5.00000" + test "test6701" (lazy(sprintf "%- .*F" 4 5.0f)) " 5.0000" + test "test6702" (lazy(sprintf "%- *.*F" 5 4 5.0f)) " 5.0000" + test "test6703" (lazy(sprintf "% 0F" 5.0f)) " 5.000000" + test "test6704" (lazy(sprintf "% 05F" 5.0f)) " 5.000000" + test "test6705" (lazy(sprintf "% 01F" 5.0f)) " 5.000000" + test "test6706" (lazy(sprintf "% 0*F" 7 5.0f)) " 5.000000" + test "test6707" (lazy(sprintf "% 0.5F" 5.0f)) " 5.00000" + test "test6708" (lazy(sprintf "% 0.*F" 4 5.0f)) " 5.0000" + test "test6709" (lazy(sprintf "% 0*.*F" 5 4 5.0f)) " 5.0000" + test "test6710" (lazy(sprintf "%- 0F" 5.0f)) " 5.000000" + test "test6711" (lazy(sprintf "%- 05F" 5.0f)) " 5.000000" + test "test6712" (lazy(sprintf "%- 01F" 5.0f)) " 5.000000" + test "test6713" (lazy(sprintf "%- 0*F" 7 5.0f)) " 5.000000" + test "test6714" (lazy(sprintf "%- 0.5F" 5.0f)) " 5.00000" + test "test6715" (lazy(sprintf "%- 0.*F" 4 5.0f)) " 5.0000" + test "test6716" (lazy(sprintf "%- 0*.*F" 5 4 5.0f)) " 5.0000" + test "test6717" (lazy(sprintf "%F" -10.0f)) "-10.000000" + test "test6718" (lazy(sprintf "%5F" -10.0f)) "-10.000000" + test "test6719" (lazy(sprintf "%1F" -10.0f)) "-10.000000" + test "test6720" (lazy(sprintf "%*F" 7 -10.0f)) "-10.000000" + test "test6721" (lazy(sprintf "%.5F" -10.0f)) "-10.00000" + test "test6722" (lazy(sprintf "%.*F" 4 -10.0f)) "-10.0000" + test "test6723" (lazy(sprintf "%*.*F" 5 4 -10.0f)) "-10.0000" + test "test6724" (lazy(sprintf "%-F" -10.0f)) "-10.000000" + test "test6725" (lazy(sprintf "%-5F" -10.0f)) "-10.000000" + test "test6726" (lazy(sprintf "%-1F" -10.0f)) "-10.000000" + test "test6727" (lazy(sprintf "%-*F" 7 -10.0f)) "-10.000000" + test "test6728" (lazy(sprintf "%-.5F" -10.0f)) "-10.00000" + test "test6729" (lazy(sprintf "%-.*F" 4 -10.0f)) "-10.0000" + test "test6730" (lazy(sprintf "%-*.*F" 5 4 -10.0f)) "-10.0000" + test "test6731" (lazy(sprintf "%0F" -10.0f)) "-10.000000" + test "test6732" (lazy(sprintf "%05F" -10.0f)) "-10.000000" + test "test6733" (lazy(sprintf "%01F" -10.0f)) "-10.000000" + test "test6734" (lazy(sprintf "%0*F" 7 -10.0f)) "-10.000000" + test "test6735" (lazy(sprintf "%0.5F" -10.0f)) "-10.00000" + test "test6736" (lazy(sprintf "%0.*F" 4 -10.0f)) "-10.0000" + test "test6737" (lazy(sprintf "%0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6738" (lazy(sprintf "%-0F" -10.0f)) "-10.000000" + test "test6739" (lazy(sprintf "%-05F" -10.0f)) "-10.000000" + test "test6740" (lazy(sprintf "%-01F" -10.0f)) "-10.000000" + test "test6741" (lazy(sprintf "%-0*F" 7 -10.0f)) "-10.000000" + test "test6742" (lazy(sprintf "%-0.5F" -10.0f)) "-10.00000" + test "test6743" (lazy(sprintf "%-0.*F" 4 -10.0f)) "-10.0000" + test "test6744" (lazy(sprintf "%-0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6745" (lazy(sprintf "%+F" -10.0f)) "-10.000000" + test "test6746" (lazy(sprintf "%+5F" -10.0f)) "-10.000000" + test "test6747" (lazy(sprintf "%+1F" -10.0f)) "-10.000000" + test "test6748" (lazy(sprintf "%+*F" 7 -10.0f)) "-10.000000" + test "test6749" (lazy(sprintf "%+.5F" -10.0f)) "-10.00000" + test "test6750" (lazy(sprintf "%+.*F" 4 -10.0f)) "-10.0000" + test "test6751" (lazy(sprintf "%+*.*F" 5 4 -10.0f)) "-10.0000" + test "test6752" (lazy(sprintf "%-+F" -10.0f)) "-10.000000" + test "test6753" (lazy(sprintf "%-+5F" -10.0f)) "-10.000000" + test "test6754" (lazy(sprintf "%-+1F" -10.0f)) "-10.000000" + test "test6755" (lazy(sprintf "%-+*F" 7 -10.0f)) "-10.000000" + test "test6756" (lazy(sprintf "%-+.5F" -10.0f)) "-10.00000" + test "test6757" (lazy(sprintf "%-+.*F" 4 -10.0f)) "-10.0000" + test "test6758" (lazy(sprintf "%-+*.*F" 5 4 -10.0f)) "-10.0000" + test "test6759" (lazy(sprintf "%+0F" -10.0f)) "-10.000000" + test "test6760" (lazy(sprintf "%+05F" -10.0f)) "-10.000000" + test "test6761" (lazy(sprintf "%+01F" -10.0f)) "-10.000000" + test "test6762" (lazy(sprintf "%+0*F" 7 -10.0f)) "-10.000000" + test "test6763" (lazy(sprintf "%+0.5F" -10.0f)) "-10.00000" + test "test6764" (lazy(sprintf "%+0.*F" 4 -10.0f)) "-10.0000" + test "test6765" (lazy(sprintf "%+0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6766" (lazy(sprintf "%-+0F" -10.0f)) "-10.000000" + test "test6767" (lazy(sprintf "%-+05F" -10.0f)) "-10.000000" + test "test6768" (lazy(sprintf "%-+01F" -10.0f)) "-10.000000" + test "test6769" (lazy(sprintf "%-+0*F" 7 -10.0f)) "-10.000000" + test "test6770" (lazy(sprintf "%-+0.5F" -10.0f)) "-10.00000" + test "test6771" (lazy(sprintf "%-+0.*F" 4 -10.0f)) "-10.0000" + test "test6772" (lazy(sprintf "%-+0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6773" (lazy(sprintf "% F" -10.0f)) "-10.000000" + test "test6774" (lazy(sprintf "% 5F" -10.0f)) "-10.000000" + test "test6775" (lazy(sprintf "% 1F" -10.0f)) "-10.000000" + test "test6776" (lazy(sprintf "% *F" 7 -10.0f)) "-10.000000" + test "test6777" (lazy(sprintf "% .5F" -10.0f)) "-10.00000" + test "test6778" (lazy(sprintf "% .*F" 4 -10.0f)) "-10.0000" + test "test6779" (lazy(sprintf "% *.*F" 5 4 -10.0f)) "-10.0000" + test "test6780" (lazy(sprintf "%- F" -10.0f)) "-10.000000" + test "test6781" (lazy(sprintf "%- 5F" -10.0f)) "-10.000000" + test "test6782" (lazy(sprintf "%- 1F" -10.0f)) "-10.000000" + test "test6783" (lazy(sprintf "%- *F" 7 -10.0f)) "-10.000000" + test "test6784" (lazy(sprintf "%- .5F" -10.0f)) "-10.00000" + test "test6785" (lazy(sprintf "%- .*F" 4 -10.0f)) "-10.0000" + test "test6786" (lazy(sprintf "%- *.*F" 5 4 -10.0f)) "-10.0000" + test "test6787" (lazy(sprintf "% 0F" -10.0f)) "-10.000000" + test "test6788" (lazy(sprintf "% 05F" -10.0f)) "-10.000000" + test "test6789" (lazy(sprintf "% 01F" -10.0f)) "-10.000000" + test "test6790" (lazy(sprintf "% 0*F" 7 -10.0f)) "-10.000000" + test "test6791" (lazy(sprintf "% 0.5F" -10.0f)) "-10.00000" + test "test6792" (lazy(sprintf "% 0.*F" 4 -10.0f)) "-10.0000" + test "test6793" (lazy(sprintf "% 0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6794" (lazy(sprintf "%- 0F" -10.0f)) "-10.000000" + test "test6795" (lazy(sprintf "%- 05F" -10.0f)) "-10.000000" + test "test6796" (lazy(sprintf "%- 01F" -10.0f)) "-10.000000" + test "test6797" (lazy(sprintf "%- 0*F" 7 -10.0f)) "-10.000000" + test "test6798" (lazy(sprintf "%- 0.5F" -10.0f)) "-10.00000" + test "test6799" (lazy(sprintf "%- 0.*F" 4 -10.0f)) "-10.0000" + test "test6800" (lazy(sprintf "%- 0*.*F" 5 4 -10.0f)) "-10.0000" + test "test6801" (lazy(sprintf "%F" 5.0M)) "5.000000" + test "test6802" (lazy(sprintf "%5F" 5.0M)) "5.000000" + test "test6803" (lazy(sprintf "%1F" 5.0M)) "5.000000" + test "test6804" (lazy(sprintf "%*F" 7 5.0M)) "5.000000" + test "test6805" (lazy(sprintf "%.5F" 5.0M)) "5.00000" + test "test6806" (lazy(sprintf "%.*F" 4 5.0M)) "5.0000" + test "test6807" (lazy(sprintf "%*.*F" 5 4 5.0M)) "5.0000" + test "test6808" (lazy(sprintf "%-F" 5.0M)) "5.000000" + test "test6809" (lazy(sprintf "%-5F" 5.0M)) "5.000000" + test "test6810" (lazy(sprintf "%-1F" 5.0M)) "5.000000" + test "test6811" (lazy(sprintf "%-*F" 7 5.0M)) "5.000000" + test "test6812" (lazy(sprintf "%-.5F" 5.0M)) "5.00000" + test "test6813" (lazy(sprintf "%-.*F" 4 5.0M)) "5.0000" + test "test6814" (lazy(sprintf "%-*.*F" 5 4 5.0M)) "5.0000" + test "test6815" (lazy(sprintf "%0F" 5.0M)) "5.000000" + test "test6816" (lazy(sprintf "%05F" 5.0M)) "5.000000" + test "test6817" (lazy(sprintf "%01F" 5.0M)) "5.000000" + test "test6818" (lazy(sprintf "%0*F" 7 5.0M)) "5.000000" + test "test6819" (lazy(sprintf "%0.5F" 5.0M)) "5.00000" + test "test6820" (lazy(sprintf "%0.*F" 4 5.0M)) "5.0000" + test "test6821" (lazy(sprintf "%0*.*F" 5 4 5.0M)) "5.0000" + test "test6822" (lazy(sprintf "%-0F" 5.0M)) "5.000000" + test "test6823" (lazy(sprintf "%-05F" 5.0M)) "5.000000" + test "test6824" (lazy(sprintf "%-01F" 5.0M)) "5.000000" + test "test6825" (lazy(sprintf "%-0*F" 7 5.0M)) "5.000000" + test "test6826" (lazy(sprintf "%-0.5F" 5.0M)) "5.00000" + test "test6827" (lazy(sprintf "%-0.*F" 4 5.0M)) "5.0000" + test "test6828" (lazy(sprintf "%-0*.*F" 5 4 5.0M)) "5.0000" + test "test6829" (lazy(sprintf "%+F" 5.0M)) "+5.000000" + test "test6830" (lazy(sprintf "%+5F" 5.0M)) "+5.000000" + test "test6831" (lazy(sprintf "%+1F" 5.0M)) "+5.000000" + test "test6832" (lazy(sprintf "%+*F" 7 5.0M)) "+5.000000" + test "test6833" (lazy(sprintf "%+.5F" 5.0M)) "+5.00000" + test "test6834" (lazy(sprintf "%+.*F" 4 5.0M)) "+5.0000" + test "test6835" (lazy(sprintf "%+*.*F" 5 4 5.0M)) "+5.0000" + test "test6836" (lazy(sprintf "%-+F" 5.0M)) "+5.000000" + test "test6837" (lazy(sprintf "%-+5F" 5.0M)) "+5.000000" + test "test6838" (lazy(sprintf "%-+1F" 5.0M)) "+5.000000" + test "test6839" (lazy(sprintf "%-+*F" 7 5.0M)) "+5.000000" + test "test6840" (lazy(sprintf "%-+.5F" 5.0M)) "+5.00000" + test "test6841" (lazy(sprintf "%-+.*F" 4 5.0M)) "+5.0000" + test "test6842" (lazy(sprintf "%-+*.*F" 5 4 5.0M)) "+5.0000" + test "test6843" (lazy(sprintf "%+0F" 5.0M)) "+5.000000" + test "test6844" (lazy(sprintf "%+05F" 5.0M)) "+5.000000" + test "test6845" (lazy(sprintf "%+01F" 5.0M)) "+5.000000" + test "test6846" (lazy(sprintf "%+0*F" 7 5.0M)) "+5.000000" + test "test6847" (lazy(sprintf "%+0.5F" 5.0M)) "+5.00000" + test "test6848" (lazy(sprintf "%+0.*F" 4 5.0M)) "+5.0000" + test "test6849" (lazy(sprintf "%+0*.*F" 5 4 5.0M)) "+5.0000" + test "test6850" (lazy(sprintf "%-+0F" 5.0M)) "+5.000000" + test "test6851" (lazy(sprintf "%-+05F" 5.0M)) "+5.000000" + test "test6852" (lazy(sprintf "%-+01F" 5.0M)) "+5.000000" + test "test6853" (lazy(sprintf "%-+0*F" 7 5.0M)) "+5.000000" + test "test6854" (lazy(sprintf "%-+0.5F" 5.0M)) "+5.00000" + test "test6855" (lazy(sprintf "%-+0.*F" 4 5.0M)) "+5.0000" + test "test6856" (lazy(sprintf "%-+0*.*F" 5 4 5.0M)) "+5.0000" + test "test6857" (lazy(sprintf "% F" 5.0M)) " 5.000000" + test "test6858" (lazy(sprintf "% 5F" 5.0M)) " 5.000000" + test "test6859" (lazy(sprintf "% 1F" 5.0M)) " 5.000000" + test "test6860" (lazy(sprintf "% *F" 7 5.0M)) " 5.000000" + test "test6861" (lazy(sprintf "% .5F" 5.0M)) " 5.00000" + test "test6862" (lazy(sprintf "% .*F" 4 5.0M)) " 5.0000" + test "test6863" (lazy(sprintf "% *.*F" 5 4 5.0M)) " 5.0000" + test "test6864" (lazy(sprintf "%- F" 5.0M)) " 5.000000" + test "test6865" (lazy(sprintf "%- 5F" 5.0M)) " 5.000000" + test "test6866" (lazy(sprintf "%- 1F" 5.0M)) " 5.000000" + test "test6867" (lazy(sprintf "%- *F" 7 5.0M)) " 5.000000" + test "test6868" (lazy(sprintf "%- .5F" 5.0M)) " 5.00000" + test "test6869" (lazy(sprintf "%- .*F" 4 5.0M)) " 5.0000" + test "test6870" (lazy(sprintf "%- *.*F" 5 4 5.0M)) " 5.0000" + test "test6871" (lazy(sprintf "% 0F" 5.0M)) " 5.000000" + test "test6872" (lazy(sprintf "% 05F" 5.0M)) " 5.000000" + test "test6873" (lazy(sprintf "% 01F" 5.0M)) " 5.000000" + test "test6874" (lazy(sprintf "% 0*F" 7 5.0M)) " 5.000000" + test "test6875" (lazy(sprintf "% 0.5F" 5.0M)) " 5.00000" + test "test6876" (lazy(sprintf "% 0.*F" 4 5.0M)) " 5.0000" + test "test6877" (lazy(sprintf "% 0*.*F" 5 4 5.0M)) " 5.0000" + test "test6878" (lazy(sprintf "%- 0F" 5.0M)) " 5.000000" + test "test6879" (lazy(sprintf "%- 05F" 5.0M)) " 5.000000" + test "test6880" (lazy(sprintf "%- 01F" 5.0M)) " 5.000000" + test "test6881" (lazy(sprintf "%- 0*F" 7 5.0M)) " 5.000000" + test "test6882" (lazy(sprintf "%- 0.5F" 5.0M)) " 5.00000" + test "test6883" (lazy(sprintf "%- 0.*F" 4 5.0M)) " 5.0000" + test "test6884" (lazy(sprintf "%- 0*.*F" 5 4 5.0M)) " 5.0000" + test "test6885" (lazy(sprintf "%F" -10.0M)) "-10.000000" + test "test6886" (lazy(sprintf "%5F" -10.0M)) "-10.000000" + test "test6887" (lazy(sprintf "%1F" -10.0M)) "-10.000000" + test "test6888" (lazy(sprintf "%*F" 7 -10.0M)) "-10.000000" + test "test6889" (lazy(sprintf "%.5F" -10.0M)) "-10.00000" + test "test6890" (lazy(sprintf "%.*F" 4 -10.0M)) "-10.0000" + test "test6891" (lazy(sprintf "%*.*F" 5 4 -10.0M)) "-10.0000" + test "test6892" (lazy(sprintf "%-F" -10.0M)) "-10.000000" + test "test6893" (lazy(sprintf "%-5F" -10.0M)) "-10.000000" + test "test6894" (lazy(sprintf "%-1F" -10.0M)) "-10.000000" + test "test6895" (lazy(sprintf "%-*F" 7 -10.0M)) "-10.000000" + test "test6896" (lazy(sprintf "%-.5F" -10.0M)) "-10.00000" + test "test6897" (lazy(sprintf "%-.*F" 4 -10.0M)) "-10.0000" + test "test6898" (lazy(sprintf "%-*.*F" 5 4 -10.0M)) "-10.0000" + test "test6899" (lazy(sprintf "%0F" -10.0M)) "-10.000000" + test "test6900" (lazy(sprintf "%05F" -10.0M)) "-10.000000" + test "test6901" (lazy(sprintf "%01F" -10.0M)) "-10.000000" + test "test6902" (lazy(sprintf "%0*F" 7 -10.0M)) "-10.000000" + test "test6903" (lazy(sprintf "%0.5F" -10.0M)) "-10.00000" + test "test6904" (lazy(sprintf "%0.*F" 4 -10.0M)) "-10.0000" + test "test6905" (lazy(sprintf "%0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6906" (lazy(sprintf "%-0F" -10.0M)) "-10.000000" + test "test6907" (lazy(sprintf "%-05F" -10.0M)) "-10.000000" + test "test6908" (lazy(sprintf "%-01F" -10.0M)) "-10.000000" + test "test6909" (lazy(sprintf "%-0*F" 7 -10.0M)) "-10.000000" + test "test6910" (lazy(sprintf "%-0.5F" -10.0M)) "-10.00000" + test "test6911" (lazy(sprintf "%-0.*F" 4 -10.0M)) "-10.0000" + test "test6912" (lazy(sprintf "%-0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6913" (lazy(sprintf "%+F" -10.0M)) "-10.000000" + test "test6914" (lazy(sprintf "%+5F" -10.0M)) "-10.000000" + test "test6915" (lazy(sprintf "%+1F" -10.0M)) "-10.000000" + test "test6916" (lazy(sprintf "%+*F" 7 -10.0M)) "-10.000000" + test "test6917" (lazy(sprintf "%+.5F" -10.0M)) "-10.00000" + test "test6918" (lazy(sprintf "%+.*F" 4 -10.0M)) "-10.0000" + test "test6919" (lazy(sprintf "%+*.*F" 5 4 -10.0M)) "-10.0000" + test "test6920" (lazy(sprintf "%-+F" -10.0M)) "-10.000000" + test "test6921" (lazy(sprintf "%-+5F" -10.0M)) "-10.000000" + test "test6922" (lazy(sprintf "%-+1F" -10.0M)) "-10.000000" + test "test6923" (lazy(sprintf "%-+*F" 7 -10.0M)) "-10.000000" + test "test6924" (lazy(sprintf "%-+.5F" -10.0M)) "-10.00000" + test "test6925" (lazy(sprintf "%-+.*F" 4 -10.0M)) "-10.0000" + test "test6926" (lazy(sprintf "%-+*.*F" 5 4 -10.0M)) "-10.0000" + test "test6927" (lazy(sprintf "%+0F" -10.0M)) "-10.000000" + test "test6928" (lazy(sprintf "%+05F" -10.0M)) "-10.000000" + test "test6929" (lazy(sprintf "%+01F" -10.0M)) "-10.000000" + test "test6930" (lazy(sprintf "%+0*F" 7 -10.0M)) "-10.000000" + test "test6931" (lazy(sprintf "%+0.5F" -10.0M)) "-10.00000" + test "test6932" (lazy(sprintf "%+0.*F" 4 -10.0M)) "-10.0000" + test "test6933" (lazy(sprintf "%+0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6934" (lazy(sprintf "%-+0F" -10.0M)) "-10.000000" + test "test6935" (lazy(sprintf "%-+05F" -10.0M)) "-10.000000" + test "test6936" (lazy(sprintf "%-+01F" -10.0M)) "-10.000000" + test "test6937" (lazy(sprintf "%-+0*F" 7 -10.0M)) "-10.000000" + test "test6938" (lazy(sprintf "%-+0.5F" -10.0M)) "-10.00000" + test "test6939" (lazy(sprintf "%-+0.*F" 4 -10.0M)) "-10.0000" + test "test6940" (lazy(sprintf "%-+0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6941" (lazy(sprintf "% F" -10.0M)) "-10.000000" + test "test6942" (lazy(sprintf "% 5F" -10.0M)) "-10.000000" + test "test6943" (lazy(sprintf "% 1F" -10.0M)) "-10.000000" + test "test6944" (lazy(sprintf "% *F" 7 -10.0M)) "-10.000000" + test "test6945" (lazy(sprintf "% .5F" -10.0M)) "-10.00000" + test "test6946" (lazy(sprintf "% .*F" 4 -10.0M)) "-10.0000" + test "test6947" (lazy(sprintf "% *.*F" 5 4 -10.0M)) "-10.0000" + test "test6948" (lazy(sprintf "%- F" -10.0M)) "-10.000000" + test "test6949" (lazy(sprintf "%- 5F" -10.0M)) "-10.000000" + test "test6950" (lazy(sprintf "%- 1F" -10.0M)) "-10.000000" + test "test6951" (lazy(sprintf "%- *F" 7 -10.0M)) "-10.000000" + test "test6952" (lazy(sprintf "%- .5F" -10.0M)) "-10.00000" + test "test6953" (lazy(sprintf "%- .*F" 4 -10.0M)) "-10.0000" + test "test6954" (lazy(sprintf "%- *.*F" 5 4 -10.0M)) "-10.0000" + test "test6955" (lazy(sprintf "% 0F" -10.0M)) "-10.000000" + test "test6956" (lazy(sprintf "% 05F" -10.0M)) "-10.000000" + test "test6957" (lazy(sprintf "% 01F" -10.0M)) "-10.000000" + test "test6958" (lazy(sprintf "% 0*F" 7 -10.0M)) "-10.000000" + test "test6959" (lazy(sprintf "% 0.5F" -10.0M)) "-10.00000" + test "test6960" (lazy(sprintf "% 0.*F" 4 -10.0M)) "-10.0000" + test "test6961" (lazy(sprintf "% 0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6962" (lazy(sprintf "%- 0F" -10.0M)) "-10.000000" + test "test6963" (lazy(sprintf "%- 05F" -10.0M)) "-10.000000" + test "test6964" (lazy(sprintf "%- 01F" -10.0M)) "-10.000000" + test "test6965" (lazy(sprintf "%- 0*F" 7 -10.0M)) "-10.000000" + test "test6966" (lazy(sprintf "%- 0.5F" -10.0M)) "-10.00000" + test "test6967" (lazy(sprintf "%- 0.*F" 4 -10.0M)) "-10.0000" + test "test6968" (lazy(sprintf "%- 0*.*F" 5 4 -10.0M)) "-10.0000" + test "test6969" (lazy(sprintf "%g" 5.0)) "5" + test "test6970" (lazy(sprintf "%5g" 5.0)) " 5" + test "test6971" (lazy(sprintf "%1g" 5.0)) "5" + test "test6972" (lazy(sprintf "%*g" 7 5.0)) " 5" + test "test6973" (lazy(sprintf "%.5g" 5.0)) "5" + test "test6974" (lazy(sprintf "%.*g" 4 5.0)) "5" + test "test6975" (lazy(sprintf "%*.*g" 5 4 5.0)) " 5" + test "test6976" (lazy(sprintf "%-g" 5.0)) "5" + test "test6977" (lazy(sprintf "%-5g" 5.0)) "5 " + test "test6978" (lazy(sprintf "%-1g" 5.0)) "5" + test "test6979" (lazy(sprintf "%-*g" 7 5.0)) "5 " + test "test6980" (lazy(sprintf "%-.5g" 5.0)) "5" + test "test6981" (lazy(sprintf "%-.*g" 4 5.0)) "5" + test "test6982" (lazy(sprintf "%-*.*g" 5 4 5.0)) "5 " + test "test6983" (lazy(sprintf "%0g" 5.0)) "5" + test "test6984" (lazy(sprintf "%05g" 5.0)) "00005" + test "test6985" (lazy(sprintf "%01g" 5.0)) "5" + test "test6986" (lazy(sprintf "%0*g" 7 5.0)) "0000005" + test "test6987" (lazy(sprintf "%0.5g" 5.0)) "5" + test "test6988" (lazy(sprintf "%0.*g" 4 5.0)) "5" + test "test6989" (lazy(sprintf "%0*.*g" 5 4 5.0)) "00005" + test "test6990" (lazy(sprintf "%-0g" 5.0)) "5" + test "test6991" (lazy(sprintf "%-05g" 5.0)) "5 "// "50000" + test "test6992" (lazy(sprintf "%-01g" 5.0)) "5" + test "test6993" (lazy(sprintf "%-0*g" 7 5.0)) "5 "//"5000000" + test "test6994" (lazy(sprintf "%-0.5g" 5.0)) "5" + test "test6995" (lazy(sprintf "%-0.*g" 4 5.0)) "5" + test "test6996" (lazy(sprintf "%-0*.*g" 5 4 5.0)) "5 "// "50000" + test "test6997" (lazy(sprintf "%+g" 5.0)) "+5" + test "test6998" (lazy(sprintf "%+5g" 5.0)) " +5" + test "test6999" (lazy(sprintf "%+1g" 5.0)) "+5" + test "test7000" (lazy(sprintf "%+*g" 7 5.0)) " +5" +let func7000()= + test "test7001" (lazy(sprintf "%+.5g" 5.0)) "+5" + test "test7002" (lazy(sprintf "%+.*g" 4 5.0)) "+5" + test "test7003" (lazy(sprintf "%+*.*g" 5 4 5.0)) " +5" + test "test7004" (lazy(sprintf "%-+g" 5.0)) "+5" + test "test7005" (lazy(sprintf "%-+5g" 5.0)) "+5 " + test "test7006" (lazy(sprintf "%-+1g" 5.0)) "+5" + test "test7007" (lazy(sprintf "%-+*g" 7 5.0)) "+5 " + test "test7008" (lazy(sprintf "%-+.5g" 5.0)) "+5" + test "test7009" (lazy(sprintf "%-+.*g" 4 5.0)) "+5" + test "test7010" (lazy(sprintf "%-+*.*g" 5 4 5.0)) "+5 " + test "test7011" (lazy(sprintf "%+0g" 5.0)) "+5" + test "test7012" (lazy(sprintf "%+05g" 5.0)) "+0005"//"000+5" + test "test7013" (lazy(sprintf "%+01g" 5.0)) "+5" + test "test7014" (lazy(sprintf "%+0*g" 7 5.0)) "+000005"// "00000+5" + test "test7015" (lazy(sprintf "%+0.5g" 5.0)) "+5" + test "test7016" (lazy(sprintf "%+0.*g" 4 5.0)) "+5" + test "test7017" (lazy(sprintf "%+0*.*g" 5 4 5.0)) "+0005"// "000+5" + test "test7018" (lazy(sprintf "%-+0g" 5.0)) "+5" + test "test7019" (lazy(sprintf "%-+05g" 5.0)) "+5 "//"+5000" + test "test7020" (lazy(sprintf "%-+01g" 5.0)) "+5" + test "test7021" (lazy(sprintf "%-+0*g" 7 5.0)) "+5 "// "+500000" + test "test7022" (lazy(sprintf "%-+0.5g" 5.0)) "+5" + test "test7023" (lazy(sprintf "%-+0.*g" 4 5.0)) "+5" + test "test7024" (lazy(sprintf "%-+0*.*g" 5 4 5.0)) "+5 "//"+5000" + test "test7025" (lazy(sprintf "% g" 5.0)) " 5" + test "test7026" (lazy(sprintf "% 5g" 5.0)) " 5" + test "test7027" (lazy(sprintf "% 1g" 5.0)) " 5" + test "test7028" (lazy(sprintf "% *g" 7 5.0)) " 5" + test "test7029" (lazy(sprintf "% .5g" 5.0)) " 5" + test "test7030" (lazy(sprintf "% .*g" 4 5.0)) " 5" + test "test7031" (lazy(sprintf "% *.*g" 5 4 5.0)) " 5" + test "test7032" (lazy(sprintf "%- g" 5.0)) " 5" + test "test7033" (lazy(sprintf "%- 5g" 5.0)) " 5 " + test "test7034" (lazy(sprintf "%- 1g" 5.0)) " 5" + test "test7035" (lazy(sprintf "%- *g" 7 5.0)) " 5 " + test "test7036" (lazy(sprintf "%- .5g" 5.0)) " 5" + test "test7037" (lazy(sprintf "%- .*g" 4 5.0)) " 5" + test "test7038" (lazy(sprintf "%- *.*g" 5 4 5.0)) " 5 " + test "test7039" (lazy(sprintf "% 0g" 5.0)) " 5" + test "test7040" (lazy(sprintf "% 05g" 5.0)) " 0005"//"000 5" + test "test7041" (lazy(sprintf "% 01g" 5.0)) " 5" + test "test7042" (lazy(sprintf "% 0*g" 7 5.0)) " 000005"//"00000 5" + test "test7043" (lazy(sprintf "% 0.5g" 5.0)) " 5" + test "test7044" (lazy(sprintf "% 0.*g" 4 5.0)) " 5" + test "test7045" (lazy(sprintf "% 0*.*g" 5 4 5.0)) " 0005"// "000 5" + test "test7046" (lazy(sprintf "%- 0g" 5.0)) " 5" + test "test7047" (lazy(sprintf "%- 05g" 5.0)) " 5 "//" 5000" + test "test7048" (lazy(sprintf "%- 01g" 5.0)) " 5" + test "test7049" (lazy(sprintf "%- 0*g" 7 5.0)) " 5 "// " 500000" + test "test7050" (lazy(sprintf "%- 0.5g" 5.0)) " 5" + test "test7051" (lazy(sprintf "%- 0.*g" 4 5.0)) " 5" + test "test7052" (lazy(sprintf "%- 0*.*g" 5 4 5.0)) " 5 "// " 5000" + test "test7053" (lazy(sprintf "%g" -10.0)) "-10" + test "test7054" (lazy(sprintf "%5g" -10.0)) " -10" + test "test7055" (lazy(sprintf "%1g" -10.0)) "-10" + test "test7056" (lazy(sprintf "%*g" 7 -10.0)) " -10" + test "test7057" (lazy(sprintf "%.5g" -10.0)) "-10" + test "test7058" (lazy(sprintf "%.*g" 4 -10.0)) "-10" + test "test7059" (lazy(sprintf "%*.*g" 5 4 -10.0)) " -10" + test "test7060" (lazy(sprintf "%-g" -10.0)) "-10" + test "test7061" (lazy(sprintf "%-5g" -10.0)) "-10 " + test "test7062" (lazy(sprintf "%-1g" -10.0)) "-10" + test "test7063" (lazy(sprintf "%-*g" 7 -10.0)) "-10 " + test "test7064" (lazy(sprintf "%-.5g" -10.0)) "-10" + test "test7065" (lazy(sprintf "%-.*g" 4 -10.0)) "-10" + test "test7066" (lazy(sprintf "%-*.*g" 5 4 -10.0)) "-10 " + test "test7067" (lazy(sprintf "%0g" -10.0)) "-10" + test "test7068" (lazy(sprintf "%05g" -10.0)) "-0010"// "00-10" + test "test7069" (lazy(sprintf "%01g" -10.0)) "-10" + test "test7070" (lazy(sprintf "%0*g" 7 -10.0)) "-000010"// "0000-10" + test "test7071" (lazy(sprintf "%0.5g" -10.0)) "-10" + test "test7072" (lazy(sprintf "%0.*g" 4 -10.0)) "-10" + test "test7073" (lazy(sprintf "%0*.*g" 5 4 -10.0)) "-0010"// "00-10" + test "test7074" (lazy(sprintf "%-0g" -10.0)) "-10" + test "test7075" (lazy(sprintf "%-05g" -10.0)) "-10 "// "-1000" + test "test7076" (lazy(sprintf "%-01g" -10.0)) "-10" + test "test7077" (lazy(sprintf "%-0*g" 7 -10.0)) "-10 "// "-100000" + test "test7078" (lazy(sprintf "%-0.5g" -10.0)) "-10" + test "test7079" (lazy(sprintf "%-0.*g" 4 -10.0)) "-10" + test "test7080" (lazy(sprintf "%-0*.*g" 5 4 -10.0)) "-10 "// "-1000" + test "test7081" (lazy(sprintf "%+g" -10.0)) "-10" + test "test7082" (lazy(sprintf "%+5g" -10.0)) " -10" + test "test7083" (lazy(sprintf "%+1g" -10.0)) "-10" + test "test7084" (lazy(sprintf "%+*g" 7 -10.0)) " -10" + test "test7085" (lazy(sprintf "%+.5g" -10.0)) "-10" + test "test7086" (lazy(sprintf "%+.*g" 4 -10.0)) "-10" + test "test7087" (lazy(sprintf "%+*.*g" 5 4 -10.0)) " -10" + test "test7088" (lazy(sprintf "%-+g" -10.0)) "-10" + test "test7089" (lazy(sprintf "%-+5g" -10.0)) "-10 " + test "test7090" (lazy(sprintf "%-+1g" -10.0)) "-10" + test "test7091" (lazy(sprintf "%-+*g" 7 -10.0)) "-10 " + test "test7092" (lazy(sprintf "%-+.5g" -10.0)) "-10" + test "test7093" (lazy(sprintf "%-+.*g" 4 -10.0)) "-10" + test "test7094" (lazy(sprintf "%-+*.*g" 5 4 -10.0)) "-10 " + test "test7095" (lazy(sprintf "%+0g" -10.0)) "-10" + test "test7096" (lazy(sprintf "%+05g" -10.0)) "-0010"// "00-10" + test "test7097" (lazy(sprintf "%+01g" -10.0)) "-10" + test "test7098" (lazy(sprintf "%+0*g" 7 -10.0)) "-000010"// "0000-10" + test "test7099" (lazy(sprintf "%+0.5g" -10.0)) "-10" + test "test7100" (lazy(sprintf "%+0.*g" 4 -10.0)) "-10" + test "test7101" (lazy(sprintf "%+0*.*g" 5 4 -10.0)) "-0010"// "00-10" + test "test7102" (lazy(sprintf "%-+0g" -10.0)) "-10" + test "test7103" (lazy(sprintf "%-+05g" -10.0)) "-10 "// "-1000" + test "test7104" (lazy(sprintf "%-+01g" -10.0)) "-10" + test "test7105" (lazy(sprintf "%-+0*g" 7 -10.0)) "-10 "// "-100000" + test "test7106" (lazy(sprintf "%-+0.5g" -10.0)) "-10" + test "test7107" (lazy(sprintf "%-+0.*g" 4 -10.0)) "-10" + test "test7108" (lazy(sprintf "%-+0*.*g" 5 4 -10.0)) "-10 "// "-1000" + test "test7109" (lazy(sprintf "% g" -10.0)) "-10" + test "test7110" (lazy(sprintf "% 5g" -10.0)) " -10" + test "test7111" (lazy(sprintf "% 1g" -10.0)) "-10" + test "test7112" (lazy(sprintf "% *g" 7 -10.0)) " -10" + test "test7113" (lazy(sprintf "% .5g" -10.0)) "-10" + test "test7114" (lazy(sprintf "% .*g" 4 -10.0)) "-10" + test "test7115" (lazy(sprintf "% *.*g" 5 4 -10.0)) " -10" + test "test7116" (lazy(sprintf "%- g" -10.0)) "-10" + test "test7117" (lazy(sprintf "%- 5g" -10.0)) "-10 " + test "test7118" (lazy(sprintf "%- 1g" -10.0)) "-10" + test "test7119" (lazy(sprintf "%- *g" 7 -10.0)) "-10 " + test "test7120" (lazy(sprintf "%- .5g" -10.0)) "-10" + test "test7121" (lazy(sprintf "%- .*g" 4 -10.0)) "-10" + test "test7122" (lazy(sprintf "%- *.*g" 5 4 -10.0)) "-10 " + test "test7123" (lazy(sprintf "% 0g" -10.0)) "-10" + test "test7124" (lazy(sprintf "% 05g" -10.0)) "-0010"// "00-10" + test "test7125" (lazy(sprintf "% 01g" -10.0)) "-10" + test "test7126" (lazy(sprintf "% 0*g" 7 -10.0)) "-000010"// "0000-10" + test "test7127" (lazy(sprintf "% 0.5g" -10.0)) "-10" + test "test7128" (lazy(sprintf "% 0.*g" 4 -10.0)) "-10" + test "test7129" (lazy(sprintf "% 0*.*g" 5 4 -10.0)) "-0010"// "00-10" + test "test7130" (lazy(sprintf "%- 0g" -10.0)) "-10" + test "test7131" (lazy(sprintf "%- 05g" -10.0)) "-10 "// "-1000" + test "test7132" (lazy(sprintf "%- 01g" -10.0)) "-10" + test "test7133" (lazy(sprintf "%- 0*g" 7 -10.0)) "-10 "// "-100000" + test "test7134" (lazy(sprintf "%- 0.5g" -10.0)) "-10" + test "test7135" (lazy(sprintf "%- 0.*g" 4 -10.0)) "-10" + test "test7136" (lazy(sprintf "%- 0*.*g" 5 4 -10.0)) "-10 "// "-1000" + test "test7137" (lazy(sprintf "%g" 5.0f)) "5" + test "test7138" (lazy(sprintf "%5g" 5.0f)) " 5" + test "test7139" (lazy(sprintf "%1g" 5.0f)) "5" + test "test7140" (lazy(sprintf "%*g" 7 5.0f)) " 5" + test "test7141" (lazy(sprintf "%.5g" 5.0f)) "5" + test "test7142" (lazy(sprintf "%.*g" 4 5.0f)) "5" + test "test7143" (lazy(sprintf "%*.*g" 5 4 5.0f)) " 5" + test "test7144" (lazy(sprintf "%-g" 5.0f)) "5" + test "test7145" (lazy(sprintf "%-5g" 5.0f)) "5 " + test "test7146" (lazy(sprintf "%-1g" 5.0f)) "5" + test "test7147" (lazy(sprintf "%-*g" 7 5.0f)) "5 " + test "test7148" (lazy(sprintf "%-.5g" 5.0f)) "5" + test "test7149" (lazy(sprintf "%-.*g" 4 5.0f)) "5" + test "test7150" (lazy(sprintf "%-*.*g" 5 4 5.0f)) "5 " + test "test7151" (lazy(sprintf "%0g" 5.0f)) "5" + test "test7152" (lazy(sprintf "%05g" 5.0f)) "00005" + test "test7153" (lazy(sprintf "%01g" 5.0f)) "5" + test "test7154" (lazy(sprintf "%0*g" 7 5.0f)) "0000005" + test "test7155" (lazy(sprintf "%0.5g" 5.0f)) "5" + test "test7156" (lazy(sprintf "%0.*g" 4 5.0f)) "5" + test "test7157" (lazy(sprintf "%0*.*g" 5 4 5.0f)) "00005" + test "test7158" (lazy(sprintf "%-0g" 5.0f)) "5" + test "test7159" (lazy(sprintf "%-05g" 5.0f)) "5 "// "50000" + test "test7160" (lazy(sprintf "%-01g" 5.0f)) "5" + test "test7161" (lazy(sprintf "%-0*g" 7 5.0f)) "5 "// "5000000" + test "test7162" (lazy(sprintf "%-0.5g" 5.0f)) "5" + test "test7163" (lazy(sprintf "%-0.*g" 4 5.0f)) "5" + test "test7164" (lazy(sprintf "%-0*.*g" 5 4 5.0f)) "5 "// "50000" + test "test7165" (lazy(sprintf "%+g" 5.0f)) "+5" + test "test7166" (lazy(sprintf "%+5g" 5.0f)) " +5" + test "test7167" (lazy(sprintf "%+1g" 5.0f)) "+5" + test "test7168" (lazy(sprintf "%+*g" 7 5.0f)) " +5" + test "test7169" (lazy(sprintf "%+.5g" 5.0f)) "+5" + test "test7170" (lazy(sprintf "%+.*g" 4 5.0f)) "+5" + test "test7171" (lazy(sprintf "%+*.*g" 5 4 5.0f)) " +5" + test "test7172" (lazy(sprintf "%-+g" 5.0f)) "+5" + test "test7173" (lazy(sprintf "%-+5g" 5.0f)) "+5 " + test "test7174" (lazy(sprintf "%-+1g" 5.0f)) "+5" + test "test7175" (lazy(sprintf "%-+*g" 7 5.0f)) "+5 " + test "test7176" (lazy(sprintf "%-+.5g" 5.0f)) "+5" + test "test7177" (lazy(sprintf "%-+.*g" 4 5.0f)) "+5" + test "test7178" (lazy(sprintf "%-+*.*g" 5 4 5.0f)) "+5 " + test "test7179" (lazy(sprintf "%+0g" 5.0f)) "+5" + test "test7180" (lazy(sprintf "%+05g" 5.0f)) "+0005"// "000+5" + test "test7181" (lazy(sprintf "%+01g" 5.0f)) "+5" + test "test7182" (lazy(sprintf "%+0*g" 7 5.0f)) "+000005"// "00000+5" + test "test7183" (lazy(sprintf "%+0.5g" 5.0f)) "+5" + test "test7184" (lazy(sprintf "%+0.*g" 4 5.0f)) "+5" + test "test7185" (lazy(sprintf "%+0*.*g" 5 4 5.0f)) "+0005"// "000+5" + test "test7186" (lazy(sprintf "%-+0g" 5.0f)) "+5" + test "test7187" (lazy(sprintf "%-+05g" 5.0f)) "+5 "// "+5000" + test "test7188" (lazy(sprintf "%-+01g" 5.0f)) "+5" + test "test7189" (lazy(sprintf "%-+0*g" 7 5.0f)) "+5 "// "+500000" + test "test7190" (lazy(sprintf "%-+0.5g" 5.0f)) "+5" + test "test7191" (lazy(sprintf "%-+0.*g" 4 5.0f)) "+5" + test "test7192" (lazy(sprintf "%-+0*.*g" 5 4 5.0f)) "+5 "// "+5000" + test "test7193" (lazy(sprintf "% g" 5.0f)) " 5" + test "test7194" (lazy(sprintf "% 5g" 5.0f)) " 5" + test "test7195" (lazy(sprintf "% 1g" 5.0f)) " 5" + test "test7196" (lazy(sprintf "% *g" 7 5.0f)) " 5" + test "test7197" (lazy(sprintf "% .5g" 5.0f)) " 5" + test "test7198" (lazy(sprintf "% .*g" 4 5.0f)) " 5" + test "test7199" (lazy(sprintf "% *.*g" 5 4 5.0f)) " 5" + test "test7200" (lazy(sprintf "%- g" 5.0f)) " 5" + test "test7201" (lazy(sprintf "%- 5g" 5.0f)) " 5 " + test "test7202" (lazy(sprintf "%- 1g" 5.0f)) " 5" + test "test7203" (lazy(sprintf "%- *g" 7 5.0f)) " 5 " + test "test7204" (lazy(sprintf "%- .5g" 5.0f)) " 5" + test "test7205" (lazy(sprintf "%- .*g" 4 5.0f)) " 5" + test "test7206" (lazy(sprintf "%- *.*g" 5 4 5.0f)) " 5 " + test "test7207" (lazy(sprintf "% 0g" 5.0f)) " 5" + test "test7208" (lazy(sprintf "% 05g" 5.0f)) " 0005"// "000 5" + test "test7209" (lazy(sprintf "% 01g" 5.0f)) " 5" + test "test7210" (lazy(sprintf "% 0*g" 7 5.0f)) " 000005"// "00000 5" + test "test7211" (lazy(sprintf "% 0.5g" 5.0f)) " 5" + test "test7212" (lazy(sprintf "% 0.*g" 4 5.0f)) " 5" + test "test7213" (lazy(sprintf "% 0*.*g" 5 4 5.0f)) " 0005"// "000 5" + test "test7214" (lazy(sprintf "%- 0g" 5.0f)) " 5" + test "test7215" (lazy(sprintf "%- 05g" 5.0f)) " 5 "// " 5000" + test "test7216" (lazy(sprintf "%- 01g" 5.0f)) " 5" + test "test7217" (lazy(sprintf "%- 0*g" 7 5.0f)) " 5 "// " 500000" + test "test7218" (lazy(sprintf "%- 0.5g" 5.0f)) " 5" + test "test7219" (lazy(sprintf "%- 0.*g" 4 5.0f)) " 5" + test "test7220" (lazy(sprintf "%- 0*.*g" 5 4 5.0f)) " 5 "// " 5000" + test "test7221" (lazy(sprintf "%g" -10.0f)) "-10" + test "test7222" (lazy(sprintf "%5g" -10.0f)) " -10" + test "test7223" (lazy(sprintf "%1g" -10.0f)) "-10" + test "test7224" (lazy(sprintf "%*g" 7 -10.0f)) " -10" + test "test7225" (lazy(sprintf "%.5g" -10.0f)) "-10" + test "test7226" (lazy(sprintf "%.*g" 4 -10.0f)) "-10" + test "test7227" (lazy(sprintf "%*.*g" 5 4 -10.0f)) " -10" + test "test7228" (lazy(sprintf "%-g" -10.0f)) "-10" + test "test7229" (lazy(sprintf "%-5g" -10.0f)) "-10 " + test "test7230" (lazy(sprintf "%-1g" -10.0f)) "-10" + test "test7231" (lazy(sprintf "%-*g" 7 -10.0f)) "-10 " + test "test7232" (lazy(sprintf "%-.5g" -10.0f)) "-10" + test "test7233" (lazy(sprintf "%-.*g" 4 -10.0f)) "-10" + test "test7234" (lazy(sprintf "%-*.*g" 5 4 -10.0f)) "-10 " + test "test7235" (lazy(sprintf "%0g" -10.0f)) "-10" + test "test7236" (lazy(sprintf "%05g" -10.0f)) "-0010"//"00-10" + test "test7237" (lazy(sprintf "%01g" -10.0f)) "-10" + test "test7238" (lazy(sprintf "%0*g" 7 -10.0f)) "-000010"// "0000-10" + test "test7239" (lazy(sprintf "%0.5g" -10.0f)) "-10" + test "test7240" (lazy(sprintf "%0.*g" 4 -10.0f)) "-10" + test "test7241" (lazy(sprintf "%0*.*g" 5 4 -10.0f)) "-0010"// "00-10" + test "test7242" (lazy(sprintf "%-0g" -10.0f)) "-10" + test "test7243" (lazy(sprintf "%-05g" -10.0f)) "-10 "// "-1000" + test "test7244" (lazy(sprintf "%-01g" -10.0f)) "-10" + test "test7245" (lazy(sprintf "%-0*g" 7 -10.0f)) "-10 "// "-100000" + test "test7246" (lazy(sprintf "%-0.5g" -10.0f)) "-10" + test "test7247" (lazy(sprintf "%-0.*g" 4 -10.0f)) "-10" + test "test7248" (lazy(sprintf "%-0*.*g" 5 4 -10.0f)) "-10 "// "-1000" + test "test7249" (lazy(sprintf "%+g" -10.0f)) "-10" + test "test7250" (lazy(sprintf "%+5g" -10.0f)) " -10" + test "test7251" (lazy(sprintf "%+1g" -10.0f)) "-10" + test "test7252" (lazy(sprintf "%+*g" 7 -10.0f)) " -10" + test "test7253" (lazy(sprintf "%+.5g" -10.0f)) "-10" + test "test7254" (lazy(sprintf "%+.*g" 4 -10.0f)) "-10" + test "test7255" (lazy(sprintf "%+*.*g" 5 4 -10.0f)) " -10" + test "test7256" (lazy(sprintf "%-+g" -10.0f)) "-10" + test "test7257" (lazy(sprintf "%-+5g" -10.0f)) "-10 " + test "test7258" (lazy(sprintf "%-+1g" -10.0f)) "-10" + test "test7259" (lazy(sprintf "%-+*g" 7 -10.0f)) "-10 " + test "test7260" (lazy(sprintf "%-+.5g" -10.0f)) "-10" + test "test7261" (lazy(sprintf "%-+.*g" 4 -10.0f)) "-10" + test "test7262" (lazy(sprintf "%-+*.*g" 5 4 -10.0f)) "-10 " + test "test7263" (lazy(sprintf "%+0g" -10.0f)) "-10" + test "test7264" (lazy(sprintf "%+05g" -10.0f)) "-0010"// "00-10" + test "test7265" (lazy(sprintf "%+01g" -10.0f)) "-10" + test "test7266" (lazy(sprintf "%+0*g" 7 -10.0f)) "-000010"// "0000-10" + test "test7267" (lazy(sprintf "%+0.5g" -10.0f)) "-10" + test "test7268" (lazy(sprintf "%+0.*g" 4 -10.0f)) "-10" + test "test7269" (lazy(sprintf "%+0*.*g" 5 4 -10.0f)) "-0010"// "00-10" + test "test7270" (lazy(sprintf "%-+0g" -10.0f)) "-10" + test "test7271" (lazy(sprintf "%-+05g" -10.0f)) "-10 " // "-1000" + test "test7272" (lazy(sprintf "%-+01g" -10.0f)) "-10" + test "test7273" (lazy(sprintf "%-+0*g" 7 -10.0f)) "-10 "// "-100000" + test "test7274" (lazy(sprintf "%-+0.5g" -10.0f)) "-10" + test "test7275" (lazy(sprintf "%-+0.*g" 4 -10.0f)) "-10" + test "test7276" (lazy(sprintf "%-+0*.*g" 5 4 -10.0f)) "-10 "// "-1000" + test "test7277" (lazy(sprintf "% g" -10.0f)) "-10" + test "test7278" (lazy(sprintf "% 5g" -10.0f)) " -10" + test "test7279" (lazy(sprintf "% 1g" -10.0f)) "-10" + test "test7280" (lazy(sprintf "% *g" 7 -10.0f)) " -10" + test "test7281" (lazy(sprintf "% .5g" -10.0f)) "-10" + test "test7282" (lazy(sprintf "% .*g" 4 -10.0f)) "-10" + test "test7283" (lazy(sprintf "% *.*g" 5 4 -10.0f)) " -10" + test "test7284" (lazy(sprintf "%- g" -10.0f)) "-10" + test "test7285" (lazy(sprintf "%- 5g" -10.0f)) "-10 " + test "test7286" (lazy(sprintf "%- 1g" -10.0f)) "-10" + test "test7287" (lazy(sprintf "%- *g" 7 -10.0f)) "-10 " + test "test7288" (lazy(sprintf "%- .5g" -10.0f)) "-10" + test "test7289" (lazy(sprintf "%- .*g" 4 -10.0f)) "-10" + test "test7290" (lazy(sprintf "%- *.*g" 5 4 -10.0f)) "-10 " + test "test7291" (lazy(sprintf "% 0g" -10.0f)) "-10" + test "test7292" (lazy(sprintf "% 05g" -10.0f)) "-0010"// "00-10" + test "test7293" (lazy(sprintf "% 01g" -10.0f)) "-10" + test "test7294" (lazy(sprintf "% 0*g" 7 -10.0f)) "-000010"// "0000-10" + test "test7295" (lazy(sprintf "% 0.5g" -10.0f)) "-10" + test "test7296" (lazy(sprintf "% 0.*g" 4 -10.0f)) "-10" + test "test7297" (lazy(sprintf "% 0*.*g" 5 4 -10.0f)) "-0010"// "00-10" + test "test7298" (lazy(sprintf "%- 0g" -10.0f)) "-10" + test "test7299" (lazy(sprintf "%- 05g" -10.0f)) "-10 "// "-1000" + test "test7300" (lazy(sprintf "%- 01g" -10.0f)) "-10" + test "test7301" (lazy(sprintf "%- 0*g" 7 -10.0f)) "-10 "// "-100000" + test "test7302" (lazy(sprintf "%- 0.5g" -10.0f)) "-10" + test "test7303" (lazy(sprintf "%- 0.*g" 4 -10.0f)) "-10" + test "test7304" (lazy(sprintf "%- 0*.*g" 5 4 -10.0f)) "-10 "// "-1000" + test "test7305" (lazy(sprintf "%g" 5.0M)) "5" + test "test7306" (lazy(sprintf "%5g" 5.0M)) " 5" + test "test7307" (lazy(sprintf "%1g" 5.0M)) "5" + test "test7308" (lazy(sprintf "%*g" 7 5.0M)) " 5" + test "test7309" (lazy(sprintf "%.5g" 5.0M)) "5" + test "test7310" (lazy(sprintf "%.*g" 4 5.0M)) "5" + test "test7311" (lazy(sprintf "%*.*g" 5 4 5.0M)) " 5" + test "test7312" (lazy(sprintf "%-g" 5.0M)) "5" + test "test7313" (lazy(sprintf "%-5g" 5.0M)) "5 " + test "test7314" (lazy(sprintf "%-1g" 5.0M)) "5" + test "test7315" (lazy(sprintf "%-*g" 7 5.0M)) "5 " + test "test7316" (lazy(sprintf "%-.5g" 5.0M)) "5" + test "test7317" (lazy(sprintf "%-.*g" 4 5.0M)) "5" + test "test7318" (lazy(sprintf "%-*.*g" 5 4 5.0M)) "5 " + test "test7319" (lazy(sprintf "%0g" 5.0M)) "5" + test "test7320" (lazy(sprintf "%05g" 5.0M)) "00005" + test "test7321" (lazy(sprintf "%01g" 5.0M)) "5" + test "test7322" (lazy(sprintf "%0*g" 7 5.0M)) "0000005" + test "test7323" (lazy(sprintf "%0.5g" 5.0M)) "5" + test "test7324" (lazy(sprintf "%0.*g" 4 5.0M)) "5" + test "test7325" (lazy(sprintf "%0*.*g" 5 4 5.0M)) "00005" + test "test7326" (lazy(sprintf "%-0g" 5.0M)) "5" + test "test7327" (lazy(sprintf "%-05g" 5.0M)) "5 "// "50000" + test "test7328" (lazy(sprintf "%-01g" 5.0M)) "5" + test "test7329" (lazy(sprintf "%-0*g" 7 5.0M)) "5 "// "5000000" + test "test7330" (lazy(sprintf "%-0.5g" 5.0M)) "5" + test "test7331" (lazy(sprintf "%-0.*g" 4 5.0M)) "5" + test "test7332" (lazy(sprintf "%-0*.*g" 5 4 5.0M)) "5 "// "50000" + test "test7333" (lazy(sprintf "%+g" 5.0M)) "+5" + test "test7334" (lazy(sprintf "%+5g" 5.0M)) " +5" + test "test7335" (lazy(sprintf "%+1g" 5.0M)) "+5" + test "test7336" (lazy(sprintf "%+*g" 7 5.0M)) " +5" + test "test7337" (lazy(sprintf "%+.5g" 5.0M)) "+5" + test "test7338" (lazy(sprintf "%+.*g" 4 5.0M)) "+5" + test "test7339" (lazy(sprintf "%+*.*g" 5 4 5.0M)) " +5" + test "test7340" (lazy(sprintf "%-+g" 5.0M)) "+5" + test "test7341" (lazy(sprintf "%-+5g" 5.0M)) "+5 " + test "test7342" (lazy(sprintf "%-+1g" 5.0M)) "+5" + test "test7343" (lazy(sprintf "%-+*g" 7 5.0M)) "+5 " + test "test7344" (lazy(sprintf "%-+.5g" 5.0M)) "+5" + test "test7345" (lazy(sprintf "%-+.*g" 4 5.0M)) "+5" + test "test7346" (lazy(sprintf "%-+*.*g" 5 4 5.0M)) "+5 " + test "test7347" (lazy(sprintf "%+0g" 5.0M)) "+5" + test "test7348" (lazy(sprintf "%+05g" 5.0M)) "+0005"// "000+5" + test "test7349" (lazy(sprintf "%+01g" 5.0M)) "+5" + test "test7350" (lazy(sprintf "%+0*g" 7 5.0M)) "+000005"// "00000+5" + test "test7351" (lazy(sprintf "%+0.5g" 5.0M)) "+5" + test "test7352" (lazy(sprintf "%+0.*g" 4 5.0M)) "+5" + test "test7353" (lazy(sprintf "%+0*.*g" 5 4 5.0M)) "+0005"// "000+5" + test "test7354" (lazy(sprintf "%-+0g" 5.0M)) "+5" + test "test7355" (lazy(sprintf "%-+05g" 5.0M)) "+5 "// "+5000" + test "test7356" (lazy(sprintf "%-+01g" 5.0M)) "+5" + test "test7357" (lazy(sprintf "%-+0*g" 7 5.0M)) "+5 "// "+500000" + test "test7358" (lazy(sprintf "%-+0.5g" 5.0M)) "+5" + test "test7359" (lazy(sprintf "%-+0.*g" 4 5.0M)) "+5" + test "test7360" (lazy(sprintf "%-+0*.*g" 5 4 5.0M)) "+5 "//"+5000" + test "test7361" (lazy(sprintf "% g" 5.0M)) " 5" + test "test7362" (lazy(sprintf "% 5g" 5.0M)) " 5" + test "test7363" (lazy(sprintf "% 1g" 5.0M)) " 5" + test "test7364" (lazy(sprintf "% *g" 7 5.0M)) " 5" + test "test7365" (lazy(sprintf "% .5g" 5.0M)) " 5" + test "test7366" (lazy(sprintf "% .*g" 4 5.0M)) " 5" + test "test7367" (lazy(sprintf "% *.*g" 5 4 5.0M)) " 5" + test "test7368" (lazy(sprintf "%- g" 5.0M)) " 5" + test "test7369" (lazy(sprintf "%- 5g" 5.0M)) " 5 " + test "test7370" (lazy(sprintf "%- 1g" 5.0M)) " 5" + test "test7371" (lazy(sprintf "%- *g" 7 5.0M)) " 5 " + test "test7372" (lazy(sprintf "%- .5g" 5.0M)) " 5" + test "test7373" (lazy(sprintf "%- .*g" 4 5.0M)) " 5" + test "test7374" (lazy(sprintf "%- *.*g" 5 4 5.0M)) " 5 " + test "test7375" (lazy(sprintf "% 0g" 5.0M)) " 5" + test "test7376" (lazy(sprintf "% 05g" 5.0M)) " 0005"// "000 5" + test "test7377" (lazy(sprintf "% 01g" 5.0M)) " 5" + test "test7378" (lazy(sprintf "% 0*g" 7 5.0M)) " 000005"// "00000 5" + test "test7379" (lazy(sprintf "% 0.5g" 5.0M)) " 5" + test "test7380" (lazy(sprintf "% 0.*g" 4 5.0M)) " 5" + test "test7381" (lazy(sprintf "% 0*.*g" 5 4 5.0M)) " 0005"// "000 5" + test "test7382" (lazy(sprintf "%- 0g" 5.0M)) " 5" + test "test7383" (lazy(sprintf "%- 05g" 5.0M)) " 5 "// " 5000" + test "test7384" (lazy(sprintf "%- 01g" 5.0M)) " 5" + test "test7385" (lazy(sprintf "%- 0*g" 7 5.0M)) " 5 "// " 500000" + test "test7386" (lazy(sprintf "%- 0.5g" 5.0M)) " 5" + test "test7387" (lazy(sprintf "%- 0.*g" 4 5.0M)) " 5" + test "test7388" (lazy(sprintf "%- 0*.*g" 5 4 5.0M)) " 5 "// " 5000" + test "test7389" (lazy(sprintf "%g" -10.0M)) "-10" + test "test7390" (lazy(sprintf "%5g" -10.0M)) " -10" + test "test7391" (lazy(sprintf "%1g" -10.0M)) "-10" + test "test7392" (lazy(sprintf "%*g" 7 -10.0M)) " -10" + test "test7393" (lazy(sprintf "%.5g" -10.0M)) "-10" + test "test7394" (lazy(sprintf "%.*g" 4 -10.0M)) "-10" + test "test7395" (lazy(sprintf "%*.*g" 5 4 -10.0M)) " -10" + test "test7396" (lazy(sprintf "%-g" -10.0M)) "-10" + test "test7397" (lazy(sprintf "%-5g" -10.0M)) "-10 " + test "test7398" (lazy(sprintf "%-1g" -10.0M)) "-10" + test "test7399" (lazy(sprintf "%-*g" 7 -10.0M)) "-10 " + test "test7400" (lazy(sprintf "%-.5g" -10.0M)) "-10" + test "test7401" (lazy(sprintf "%-.*g" 4 -10.0M)) "-10" + test "test7402" (lazy(sprintf "%-*.*g" 5 4 -10.0M)) "-10 " + test "test7403" (lazy(sprintf "%0g" -10.0M)) "-10" + test "test7404" (lazy(sprintf "%05g" -10.0M)) "-0010"// "00-10" + test "test7405" (lazy(sprintf "%01g" -10.0M)) "-10" + test "test7406" (lazy(sprintf "%0*g" 7 -10.0M)) "-000010"// "0000-10" + test "test7407" (lazy(sprintf "%0.5g" -10.0M)) "-10" + test "test7408" (lazy(sprintf "%0.*g" 4 -10.0M)) "-10" + test "test7409" (lazy(sprintf "%0*.*g" 5 4 -10.0M)) "-0010"// "00-10" + test "test7410" (lazy(sprintf "%-0g" -10.0M)) "-10" + test "test7411" (lazy(sprintf "%-05g" -10.0M)) "-10 "// "-1000" + test "test7412" (lazy(sprintf "%-01g" -10.0M)) "-10" + test "test7413" (lazy(sprintf "%-0*g" 7 -10.0M)) "-10 "// "-100000" + test "test7414" (lazy(sprintf "%-0.5g" -10.0M)) "-10" + test "test7415" (lazy(sprintf "%-0.*g" 4 -10.0M)) "-10" + test "test7416" (lazy(sprintf "%-0*.*g" 5 4 -10.0M)) "-10 "// "-1000" + test "test7417" (lazy(sprintf "%+g" -10.0M)) "-10" + test "test7418" (lazy(sprintf "%+5g" -10.0M)) " -10" + test "test7419" (lazy(sprintf "%+1g" -10.0M)) "-10" + test "test7420" (lazy(sprintf "%+*g" 7 -10.0M)) " -10" + test "test7421" (lazy(sprintf "%+.5g" -10.0M)) "-10" + test "test7422" (lazy(sprintf "%+.*g" 4 -10.0M)) "-10" + test "test7423" (lazy(sprintf "%+*.*g" 5 4 -10.0M)) " -10" + test "test7424" (lazy(sprintf "%-+g" -10.0M)) "-10" + test "test7425" (lazy(sprintf "%-+5g" -10.0M)) "-10 " + test "test7426" (lazy(sprintf "%-+1g" -10.0M)) "-10" + test "test7427" (lazy(sprintf "%-+*g" 7 -10.0M)) "-10 " + test "test7428" (lazy(sprintf "%-+.5g" -10.0M)) "-10" + test "test7429" (lazy(sprintf "%-+.*g" 4 -10.0M)) "-10" + test "test7430" (lazy(sprintf "%-+*.*g" 5 4 -10.0M)) "-10 " + test "test7431" (lazy(sprintf "%+0g" -10.0M)) "-10" + test "test7432" (lazy(sprintf "%+05g" -10.0M)) "-0010"// "00-10" + test "test7433" (lazy(sprintf "%+01g" -10.0M)) "-10" + test "test7434" (lazy(sprintf "%+0*g" 7 -10.0M)) "-000010"// "0000-10" + test "test7435" (lazy(sprintf "%+0.5g" -10.0M)) "-10" + test "test7436" (lazy(sprintf "%+0.*g" 4 -10.0M)) "-10" + test "test7437" (lazy(sprintf "%+0*.*g" 5 4 -10.0M)) "-0010"// "00-10" + test "test7438" (lazy(sprintf "%-+0g" -10.0M)) "-10" + test "test7439" (lazy(sprintf "%-+05g" -10.0M)) "-10 "// "-1000" + test "test7440" (lazy(sprintf "%-+01g" -10.0M)) "-10" + test "test7441" (lazy(sprintf "%-+0*g" 7 -10.0M)) "-10 "// "-100000" + test "test7442" (lazy(sprintf "%-+0.5g" -10.0M)) "-10" + test "test7443" (lazy(sprintf "%-+0.*g" 4 -10.0M)) "-10" + test "test7444" (lazy(sprintf "%-+0*.*g" 5 4 -10.0M)) "-10 "//"-1000" + test "test7445" (lazy(sprintf "% g" -10.0M)) "-10" + test "test7446" (lazy(sprintf "% 5g" -10.0M)) " -10" + test "test7447" (lazy(sprintf "% 1g" -10.0M)) "-10" + test "test7448" (lazy(sprintf "% *g" 7 -10.0M)) " -10" + test "test7449" (lazy(sprintf "% .5g" -10.0M)) "-10" + test "test7450" (lazy(sprintf "% .*g" 4 -10.0M)) "-10" + test "test7451" (lazy(sprintf "% *.*g" 5 4 -10.0M)) " -10" + test "test7452" (lazy(sprintf "%- g" -10.0M)) "-10" + test "test7453" (lazy(sprintf "%- 5g" -10.0M)) "-10 " + test "test7454" (lazy(sprintf "%- 1g" -10.0M)) "-10" + test "test7455" (lazy(sprintf "%- *g" 7 -10.0M)) "-10 " + test "test7456" (lazy(sprintf "%- .5g" -10.0M)) "-10" + test "test7457" (lazy(sprintf "%- .*g" 4 -10.0M)) "-10" + test "test7458" (lazy(sprintf "%- *.*g" 5 4 -10.0M)) "-10 " + test "test7459" (lazy(sprintf "% 0g" -10.0M)) "-10" + test "test7460" (lazy(sprintf "% 05g" -10.0M)) "-0010"// "00-10" + test "test7461" (lazy(sprintf "% 01g" -10.0M)) "-10" + test "test7462" (lazy(sprintf "% 0*g" 7 -10.0M)) "-000010"// "0000-10" + test "test7463" (lazy(sprintf "% 0.5g" -10.0M)) "-10" + test "test7464" (lazy(sprintf "% 0.*g" 4 -10.0M)) "-10" + test "test7465" (lazy(sprintf "% 0*.*g" 5 4 -10.0M)) "-0010"// "00-10" + test "test7466" (lazy(sprintf "%- 0g" -10.0M)) "-10" + test "test7467" (lazy(sprintf "%- 05g" -10.0M)) "-10 "// "-1000" + test "test7468" (lazy(sprintf "%- 01g" -10.0M)) "-10" + test "test7469" (lazy(sprintf "%- 0*g" 7 -10.0M)) "-10 "// "-100000" + test "test7470" (lazy(sprintf "%- 0.5g" -10.0M)) "-10" + test "test7471" (lazy(sprintf "%- 0.*g" 4 -10.0M)) "-10" + test "test7472" (lazy(sprintf "%- 0*.*g" 5 4 -10.0M)) "-10 "// "-1000" + test "test7473" (lazy(sprintf "%G" 5.0)) "5" + test "test7474" (lazy(sprintf "%5G" 5.0)) " 5" + test "test7475" (lazy(sprintf "%1G" 5.0)) "5" + test "test7476" (lazy(sprintf "%*G" 7 5.0)) " 5" + test "test7477" (lazy(sprintf "%.5G" 5.0)) "5" + test "test7478" (lazy(sprintf "%.*G" 4 5.0)) "5" + test "test7479" (lazy(sprintf "%*.*G" 5 4 5.0)) " 5" + test "test7480" (lazy(sprintf "%-G" 5.0)) "5" + test "test7481" (lazy(sprintf "%-5G" 5.0)) "5 " + test "test7482" (lazy(sprintf "%-1G" 5.0)) "5" + test "test7483" (lazy(sprintf "%-*G" 7 5.0)) "5 " + test "test7484" (lazy(sprintf "%-.5G" 5.0)) "5" + test "test7485" (lazy(sprintf "%-.*G" 4 5.0)) "5" + test "test7486" (lazy(sprintf "%-*.*G" 5 4 5.0)) "5 " + test "test7487" (lazy(sprintf "%0G" 5.0)) "5" + test "test7488" (lazy(sprintf "%05G" 5.0)) "00005" + test "test7489" (lazy(sprintf "%01G" 5.0)) "5" + test "test7490" (lazy(sprintf "%0*G" 7 5.0)) "0000005" + test "test7491" (lazy(sprintf "%0.5G" 5.0)) "5" + test "test7492" (lazy(sprintf "%0.*G" 4 5.0)) "5" + test "test7493" (lazy(sprintf "%0*.*G" 5 4 5.0)) "00005" + test "test7494" (lazy(sprintf "%-0G" 5.0)) "5" + test "test7495" (lazy(sprintf "%-05G" 5.0)) "5 "// "50000" + test "test7496" (lazy(sprintf "%-01G" 5.0)) "5" + test "test7497" (lazy(sprintf "%-0*G" 7 5.0)) "5 "// "5000000" + test "test7498" (lazy(sprintf "%-0.5G" 5.0)) "5" + test "test7499" (lazy(sprintf "%-0.*G" 4 5.0)) "5" + test "test7500" (lazy(sprintf "%-0*.*G" 5 4 5.0)) "5 "// "50000" + test "test7501" (lazy(sprintf "%+G" 5.0)) "+5" + test "test7502" (lazy(sprintf "%+5G" 5.0)) " +5" + test "test7503" (lazy(sprintf "%+1G" 5.0)) "+5" + test "test7504" (lazy(sprintf "%+*G" 7 5.0)) " +5" + test "test7505" (lazy(sprintf "%+.5G" 5.0)) "+5" + test "test7506" (lazy(sprintf "%+.*G" 4 5.0)) "+5" + test "test7507" (lazy(sprintf "%+*.*G" 5 4 5.0)) " +5" + test "test7508" (lazy(sprintf "%-+G" 5.0)) "+5" + test "test7509" (lazy(sprintf "%-+5G" 5.0)) "+5 " + test "test7510" (lazy(sprintf "%-+1G" 5.0)) "+5" + test "test7511" (lazy(sprintf "%-+*G" 7 5.0)) "+5 " + test "test7512" (lazy(sprintf "%-+.5G" 5.0)) "+5" + test "test7513" (lazy(sprintf "%-+.*G" 4 5.0)) "+5" + test "test7514" (lazy(sprintf "%-+*.*G" 5 4 5.0)) "+5 " + test "test7515" (lazy(sprintf "%+0G" 5.0)) "+5" + test "test7516" (lazy(sprintf "%+05G" 5.0)) "+0005"// "000+5" + test "test7517" (lazy(sprintf "%+01G" 5.0)) "+5" + test "test7518" (lazy(sprintf "%+0*G" 7 5.0)) "+000005"// "00000+5" + test "test7519" (lazy(sprintf "%+0.5G" 5.0)) "+5" + test "test7520" (lazy(sprintf "%+0.*G" 4 5.0)) "+5" + test "test7521" (lazy(sprintf "%+0*.*G" 5 4 5.0)) "+0005"// "000+5" + test "test7522" (lazy(sprintf "%-+0G" 5.0)) "+5" + test "test7523" (lazy(sprintf "%-+05G" 5.0)) "+5 "//"+5000" + test "test7524" (lazy(sprintf "%-+01G" 5.0)) "+5" + test "test7525" (lazy(sprintf "%-+0*G" 7 5.0)) "+5 "// "+500000" + test "test7526" (lazy(sprintf "%-+0.5G" 5.0)) "+5" + test "test7527" (lazy(sprintf "%-+0.*G" 4 5.0)) "+5" + test "test7528" (lazy(sprintf "%-+0*.*G" 5 4 5.0)) "+5 "// "+5000" + test "test7529" (lazy(sprintf "% G" 5.0)) " 5" + test "test7530" (lazy(sprintf "% 5G" 5.0)) " 5" + test "test7531" (lazy(sprintf "% 1G" 5.0)) " 5" + test "test7532" (lazy(sprintf "% *G" 7 5.0)) " 5" + test "test7533" (lazy(sprintf "% .5G" 5.0)) " 5" + test "test7534" (lazy(sprintf "% .*G" 4 5.0)) " 5" + test "test7535" (lazy(sprintf "% *.*G" 5 4 5.0)) " 5" + test "test7536" (lazy(sprintf "%- G" 5.0)) " 5" + test "test7537" (lazy(sprintf "%- 5G" 5.0)) " 5 " + test "test7538" (lazy(sprintf "%- 1G" 5.0)) " 5" + test "test7539" (lazy(sprintf "%- *G" 7 5.0)) " 5 " + test "test7540" (lazy(sprintf "%- .5G" 5.0)) " 5" + test "test7541" (lazy(sprintf "%- .*G" 4 5.0)) " 5" + test "test7542" (lazy(sprintf "%- *.*G" 5 4 5.0)) " 5 " + test "test7543" (lazy(sprintf "% 0G" 5.0)) " 5" + test "test7544" (lazy(sprintf "% 05G" 5.0)) " 0005"// "000 5" + test "test7545" (lazy(sprintf "% 01G" 5.0)) " 5" + test "test7546" (lazy(sprintf "% 0*G" 7 5.0)) " 000005"// "00000 5" + test "test7547" (lazy(sprintf "% 0.5G" 5.0)) " 5" + test "test7548" (lazy(sprintf "% 0.*G" 4 5.0)) " 5" + test "test7549" (lazy(sprintf "% 0*.*G" 5 4 5.0)) " 0005"// "000 5" + test "test7550" (lazy(sprintf "%- 0G" 5.0)) " 5" + test "test7551" (lazy(sprintf "%- 05G" 5.0)) " 5 "// " 5000" + test "test7552" (lazy(sprintf "%- 01G" 5.0)) " 5" + test "test7553" (lazy(sprintf "%- 0*G" 7 5.0)) " 5 "// " 500000" + test "test7554" (lazy(sprintf "%- 0.5G" 5.0)) " 5" + test "test7555" (lazy(sprintf "%- 0.*G" 4 5.0)) " 5" + test "test7556" (lazy(sprintf "%- 0*.*G" 5 4 5.0)) " 5 "//" 5000" + test "test7557" (lazy(sprintf "%G" -10.0)) "-10" + test "test7558" (lazy(sprintf "%5G" -10.0)) " -10" + test "test7559" (lazy(sprintf "%1G" -10.0)) "-10" + test "test7560" (lazy(sprintf "%*G" 7 -10.0)) " -10" + test "test7561" (lazy(sprintf "%.5G" -10.0)) "-10" + test "test7562" (lazy(sprintf "%.*G" 4 -10.0)) "-10" + test "test7563" (lazy(sprintf "%*.*G" 5 4 -10.0)) " -10" + test "test7564" (lazy(sprintf "%-G" -10.0)) "-10" + test "test7565" (lazy(sprintf "%-5G" -10.0)) "-10 " + test "test7566" (lazy(sprintf "%-1G" -10.0)) "-10" + test "test7567" (lazy(sprintf "%-*G" 7 -10.0)) "-10 " + test "test7568" (lazy(sprintf "%-.5G" -10.0)) "-10" + test "test7569" (lazy(sprintf "%-.*G" 4 -10.0)) "-10" + test "test7570" (lazy(sprintf "%-*.*G" 5 4 -10.0)) "-10 " + test "test7571" (lazy(sprintf "%0G" -10.0)) "-10" + test "test7572" (lazy(sprintf "%05G" -10.0)) "-0010"// "00-10" + test "test7573" (lazy(sprintf "%01G" -10.0)) "-10" + test "test7574" (lazy(sprintf "%0*G" 7 -10.0)) "-000010"// "0000-10" + test "test7575" (lazy(sprintf "%0.5G" -10.0)) "-10" + test "test7576" (lazy(sprintf "%0.*G" 4 -10.0)) "-10" + test "test7577" (lazy(sprintf "%0*.*G" 5 4 -10.0)) "-0010"// "00-10" + test "test7578" (lazy(sprintf "%-0G" -10.0)) "-10" + test "test7579" (lazy(sprintf "%-05G" -10.0)) "-10 "// "-1000" + test "test7580" (lazy(sprintf "%-01G" -10.0)) "-10" + test "test7581" (lazy(sprintf "%-0*G" 7 -10.0)) "-10 "// "-100000" + test "test7582" (lazy(sprintf "%-0.5G" -10.0)) "-10" + test "test7583" (lazy(sprintf "%-0.*G" 4 -10.0)) "-10" + test "test7584" (lazy(sprintf "%-0*.*G" 5 4 -10.0)) "-10 "// "-1000" + test "test7585" (lazy(sprintf "%+G" -10.0)) "-10" + test "test7586" (lazy(sprintf "%+5G" -10.0)) " -10" + test "test7587" (lazy(sprintf "%+1G" -10.0)) "-10" + test "test7588" (lazy(sprintf "%+*G" 7 -10.0)) " -10" + test "test7589" (lazy(sprintf "%+.5G" -10.0)) "-10" + test "test7590" (lazy(sprintf "%+.*G" 4 -10.0)) "-10" + test "test7591" (lazy(sprintf "%+*.*G" 5 4 -10.0)) " -10" + test "test7592" (lazy(sprintf "%-+G" -10.0)) "-10" + test "test7593" (lazy(sprintf "%-+5G" -10.0)) "-10 " + test "test7594" (lazy(sprintf "%-+1G" -10.0)) "-10" + test "test7595" (lazy(sprintf "%-+*G" 7 -10.0)) "-10 " + test "test7596" (lazy(sprintf "%-+.5G" -10.0)) "-10" + test "test7597" (lazy(sprintf "%-+.*G" 4 -10.0)) "-10" + test "test7598" (lazy(sprintf "%-+*.*G" 5 4 -10.0)) "-10 " + test "test7599" (lazy(sprintf "%+0G" -10.0)) "-10" + test "test7600" (lazy(sprintf "%+05G" -10.0)) "-0010"//"00-10" + test "test7601" (lazy(sprintf "%+01G" -10.0)) "-10" + test "test7602" (lazy(sprintf "%+0*G" 7 -10.0)) "-000010"// "0000-10" + test "test7603" (lazy(sprintf "%+0.5G" -10.0)) "-10" + test "test7604" (lazy(sprintf "%+0.*G" 4 -10.0)) "-10" + test "test7605" (lazy(sprintf "%+0*.*G" 5 4 -10.0)) "-0010"// "00-10" + test "test7606" (lazy(sprintf "%-+0G" -10.0)) "-10" + test "test7607" (lazy(sprintf "%-+05G" -10.0)) "-10 "// "-1000" + test "test7608" (lazy(sprintf "%-+01G" -10.0)) "-10" + test "test7609" (lazy(sprintf "%-+0*G" 7 -10.0)) "-10 "// "-100000" + test "test7610" (lazy(sprintf "%-+0.5G" -10.0)) "-10" + test "test7611" (lazy(sprintf "%-+0.*G" 4 -10.0)) "-10" + test "test7612" (lazy(sprintf "%-+0*.*G" 5 4 -10.0)) "-10 "// "-1000" + test "test7613" (lazy(sprintf "% G" -10.0)) "-10" + test "test7614" (lazy(sprintf "% 5G" -10.0)) " -10" + test "test7615" (lazy(sprintf "% 1G" -10.0)) "-10" + test "test7616" (lazy(sprintf "% *G" 7 -10.0)) " -10" + test "test7617" (lazy(sprintf "% .5G" -10.0)) "-10" + test "test7618" (lazy(sprintf "% .*G" 4 -10.0)) "-10" + test "test7619" (lazy(sprintf "% *.*G" 5 4 -10.0)) " -10" + test "test7620" (lazy(sprintf "%- G" -10.0)) "-10" + test "test7621" (lazy(sprintf "%- 5G" -10.0)) "-10 " + test "test7622" (lazy(sprintf "%- 1G" -10.0)) "-10" + test "test7623" (lazy(sprintf "%- *G" 7 -10.0)) "-10 " + test "test7624" (lazy(sprintf "%- .5G" -10.0)) "-10" + test "test7625" (lazy(sprintf "%- .*G" 4 -10.0)) "-10" + test "test7626" (lazy(sprintf "%- *.*G" 5 4 -10.0)) "-10 " + test "test7627" (lazy(sprintf "% 0G" -10.0)) "-10" + test "test7628" (lazy(sprintf "% 05G" -10.0)) "-0010"// "00-10" + test "test7629" (lazy(sprintf "% 01G" -10.0)) "-10" + test "test7630" (lazy(sprintf "% 0*G" 7 -10.0)) "-000010"// "0000-10" + test "test7631" (lazy(sprintf "% 0.5G" -10.0)) "-10" + test "test7632" (lazy(sprintf "% 0.*G" 4 -10.0)) "-10" + test "test7633" (lazy(sprintf "% 0*.*G" 5 4 -10.0)) "-0010"// "00-10" + test "test7634" (lazy(sprintf "%- 0G" -10.0)) "-10" + test "test7635" (lazy(sprintf "%- 05G" -10.0)) "-10 "// "-1000" + test "test7636" (lazy(sprintf "%- 01G" -10.0)) "-10" + test "test7637" (lazy(sprintf "%- 0*G" 7 -10.0)) "-10 "// "-100000" + test "test7638" (lazy(sprintf "%- 0.5G" -10.0)) "-10" + test "test7639" (lazy(sprintf "%- 0.*G" 4 -10.0)) "-10" + test "test7640" (lazy(sprintf "%- 0*.*G" 5 4 -10.0)) "-10 "// "-1000" + test "test7641" (lazy(sprintf "%G" 5.0f)) "5" + test "test7642" (lazy(sprintf "%5G" 5.0f)) " 5" + test "test7643" (lazy(sprintf "%1G" 5.0f)) "5" + test "test7644" (lazy(sprintf "%*G" 7 5.0f)) " 5" + test "test7645" (lazy(sprintf "%.5G" 5.0f)) "5" + test "test7646" (lazy(sprintf "%.*G" 4 5.0f)) "5" + test "test7647" (lazy(sprintf "%*.*G" 5 4 5.0f)) " 5" + test "test7648" (lazy(sprintf "%-G" 5.0f)) "5" + test "test7649" (lazy(sprintf "%-5G" 5.0f)) "5 " + test "test7650" (lazy(sprintf "%-1G" 5.0f)) "5" + test "test7651" (lazy(sprintf "%-*G" 7 5.0f)) "5 " + test "test7652" (lazy(sprintf "%-.5G" 5.0f)) "5" + test "test7653" (lazy(sprintf "%-.*G" 4 5.0f)) "5" + test "test7654" (lazy(sprintf "%-*.*G" 5 4 5.0f)) "5 " + test "test7655" (lazy(sprintf "%0G" 5.0f)) "5" + test "test7656" (lazy(sprintf "%05G" 5.0f)) "00005" + test "test7657" (lazy(sprintf "%01G" 5.0f)) "5" + test "test7658" (lazy(sprintf "%0*G" 7 5.0f)) "0000005" + test "test7659" (lazy(sprintf "%0.5G" 5.0f)) "5" + test "test7660" (lazy(sprintf "%0.*G" 4 5.0f)) "5" + test "test7661" (lazy(sprintf "%0*.*G" 5 4 5.0f)) "00005" + test "test7662" (lazy(sprintf "%-0G" 5.0f)) "5" + test "test7663" (lazy(sprintf "%-05G" 5.0f)) "5 "// "50000" + test "test7664" (lazy(sprintf "%-01G" 5.0f)) "5" + test "test7665" (lazy(sprintf "%-0*G" 7 5.0f)) "5 "// "5000000" + test "test7666" (lazy(sprintf "%-0.5G" 5.0f)) "5" + test "test7667" (lazy(sprintf "%-0.*G" 4 5.0f)) "5" + test "test7668" (lazy(sprintf "%-0*.*G" 5 4 5.0f)) "5 "// "50000" + test "test7669" (lazy(sprintf "%+G" 5.0f)) "+5" + test "test7670" (lazy(sprintf "%+5G" 5.0f)) " +5" + test "test7671" (lazy(sprintf "%+1G" 5.0f)) "+5" + test "test7672" (lazy(sprintf "%+*G" 7 5.0f)) " +5" + test "test7673" (lazy(sprintf "%+.5G" 5.0f)) "+5" + test "test7674" (lazy(sprintf "%+.*G" 4 5.0f)) "+5" + test "test7675" (lazy(sprintf "%+*.*G" 5 4 5.0f)) " +5" + test "test7676" (lazy(sprintf "%-+G" 5.0f)) "+5" + test "test7677" (lazy(sprintf "%-+5G" 5.0f)) "+5 " + test "test7678" (lazy(sprintf "%-+1G" 5.0f)) "+5" + test "test7679" (lazy(sprintf "%-+*G" 7 5.0f)) "+5 " + test "test7680" (lazy(sprintf "%-+.5G" 5.0f)) "+5" + test "test7681" (lazy(sprintf "%-+.*G" 4 5.0f)) "+5" + test "test7682" (lazy(sprintf "%-+*.*G" 5 4 5.0f)) "+5 " + test "test7683" (lazy(sprintf "%+0G" 5.0f)) "+5" + test "test7684" (lazy(sprintf "%+05G" 5.0f)) "+0005"// "000+5" + test "test7685" (lazy(sprintf "%+01G" 5.0f)) "+5" + test "test7686" (lazy(sprintf "%+0*G" 7 5.0f)) "+000005"// "00000+5" + test "test7687" (lazy(sprintf "%+0.5G" 5.0f)) "+5" + test "test7688" (lazy(sprintf "%+0.*G" 4 5.0f)) "+5" + test "test7689" (lazy(sprintf "%+0*.*G" 5 4 5.0f)) "+0005"// "000+5" + test "test7690" (lazy(sprintf "%-+0G" 5.0f)) "+5" + test "test7691" (lazy(sprintf "%-+05G" 5.0f)) "+5 "// "+5000" + test "test7692" (lazy(sprintf "%-+01G" 5.0f)) "+5" + test "test7693" (lazy(sprintf "%-+0*G" 7 5.0f)) "+5 "// "+500000" + test "test7694" (lazy(sprintf "%-+0.5G" 5.0f)) "+5" + test "test7695" (lazy(sprintf "%-+0.*G" 4 5.0f)) "+5" + test "test7696" (lazy(sprintf "%-+0*.*G" 5 4 5.0f)) "+5 "// "+5000" + test "test7697" (lazy(sprintf "% G" 5.0f)) " 5" + test "test7698" (lazy(sprintf "% 5G" 5.0f)) " 5" + test "test7699" (lazy(sprintf "% 1G" 5.0f)) " 5" + test "test7700" (lazy(sprintf "% *G" 7 5.0f)) " 5" + test "test7701" (lazy(sprintf "% .5G" 5.0f)) " 5" + test "test7702" (lazy(sprintf "% .*G" 4 5.0f)) " 5" + test "test7703" (lazy(sprintf "% *.*G" 5 4 5.0f)) " 5" + test "test7704" (lazy(sprintf "%- G" 5.0f)) " 5" + test "test7705" (lazy(sprintf "%- 5G" 5.0f)) " 5 " + test "test7706" (lazy(sprintf "%- 1G" 5.0f)) " 5" + test "test7707" (lazy(sprintf "%- *G" 7 5.0f)) " 5 " + test "test7708" (lazy(sprintf "%- .5G" 5.0f)) " 5" + test "test7709" (lazy(sprintf "%- .*G" 4 5.0f)) " 5" + test "test7710" (lazy(sprintf "%- *.*G" 5 4 5.0f)) " 5 " + test "test7711" (lazy(sprintf "% 0G" 5.0f)) " 5" + test "test7712" (lazy(sprintf "% 05G" 5.0f)) " 0005"//"000 5" + test "test7713" (lazy(sprintf "% 01G" 5.0f)) " 5" + test "test7714" (lazy(sprintf "% 0*G" 7 5.0f)) " 000005"// "00000 5" + test "test7715" (lazy(sprintf "% 0.5G" 5.0f)) " 5" + test "test7716" (lazy(sprintf "% 0.*G" 4 5.0f)) " 5" + test "test7717" (lazy(sprintf "% 0*.*G" 5 4 5.0f)) " 0005"// "000 5" + test "test7718" (lazy(sprintf "%- 0G" 5.0f)) " 5" + test "test7719" (lazy(sprintf "%- 05G" 5.0f)) " 5 "// " 5000" + test "test7720" (lazy(sprintf "%- 01G" 5.0f)) " 5" + test "test7721" (lazy(sprintf "%- 0*G" 7 5.0f)) " 5 "// " 500000" + test "test7722" (lazy(sprintf "%- 0.5G" 5.0f)) " 5" + test "test7723" (lazy(sprintf "%- 0.*G" 4 5.0f)) " 5" + test "test7724" (lazy(sprintf "%- 0*.*G" 5 4 5.0f)) " 5 "// " 5000" + test "test7725" (lazy(sprintf "%G" -10.0f)) "-10" + test "test7726" (lazy(sprintf "%5G" -10.0f)) " -10" + test "test7727" (lazy(sprintf "%1G" -10.0f)) "-10" + test "test7728" (lazy(sprintf "%*G" 7 -10.0f)) " -10" + test "test7729" (lazy(sprintf "%.5G" -10.0f)) "-10" + test "test7730" (lazy(sprintf "%.*G" 4 -10.0f)) "-10" + test "test7731" (lazy(sprintf "%*.*G" 5 4 -10.0f)) " -10" + test "test7732" (lazy(sprintf "%-G" -10.0f)) "-10" + test "test7733" (lazy(sprintf "%-5G" -10.0f)) "-10 " + test "test7734" (lazy(sprintf "%-1G" -10.0f)) "-10" + test "test7735" (lazy(sprintf "%-*G" 7 -10.0f)) "-10 " + test "test7736" (lazy(sprintf "%-.5G" -10.0f)) "-10" + test "test7737" (lazy(sprintf "%-.*G" 4 -10.0f)) "-10" + test "test7738" (lazy(sprintf "%-*.*G" 5 4 -10.0f)) "-10 " + test "test7739" (lazy(sprintf "%0G" -10.0f)) "-10" + test "test7740" (lazy(sprintf "%05G" -10.0f)) "-0010"// "00-10" + test "test7741" (lazy(sprintf "%01G" -10.0f)) "-10" + test "test7742" (lazy(sprintf "%0*G" 7 -10.0f)) "-000010"// "0000-10" + test "test7743" (lazy(sprintf "%0.5G" -10.0f)) "-10" + test "test7744" (lazy(sprintf "%0.*G" 4 -10.0f)) "-10" + test "test7745" (lazy(sprintf "%0*.*G" 5 4 -10.0f)) "-0010"// "00-10" + test "test7746" (lazy(sprintf "%-0G" -10.0f)) "-10" + test "test7747" (lazy(sprintf "%-05G" -10.0f)) "-10 "//"-1000" + test "test7748" (lazy(sprintf "%-01G" -10.0f)) "-10" + test "test7749" (lazy(sprintf "%-0*G" 7 -10.0f)) "-10 "// "-100000" + test "test7750" (lazy(sprintf "%-0.5G" -10.0f)) "-10" + test "test7751" (lazy(sprintf "%-0.*G" 4 -10.0f)) "-10" + test "test7752" (lazy(sprintf "%-0*.*G" 5 4 -10.0f)) "-10 "// "-1000" + test "test7753" (lazy(sprintf "%+G" -10.0f)) "-10" + test "test7754" (lazy(sprintf "%+5G" -10.0f)) " -10" + test "test7755" (lazy(sprintf "%+1G" -10.0f)) "-10" + test "test7756" (lazy(sprintf "%+*G" 7 -10.0f)) " -10" + test "test7757" (lazy(sprintf "%+.5G" -10.0f)) "-10" + test "test7758" (lazy(sprintf "%+.*G" 4 -10.0f)) "-10" + test "test7759" (lazy(sprintf "%+*.*G" 5 4 -10.0f)) " -10" + test "test7760" (lazy(sprintf "%-+G" -10.0f)) "-10" + test "test7761" (lazy(sprintf "%-+5G" -10.0f)) "-10 " + test "test7762" (lazy(sprintf "%-+1G" -10.0f)) "-10" + test "test7763" (lazy(sprintf "%-+*G" 7 -10.0f)) "-10 " + test "test7764" (lazy(sprintf "%-+.5G" -10.0f)) "-10" + test "test7765" (lazy(sprintf "%-+.*G" 4 -10.0f)) "-10" + test "test7766" (lazy(sprintf "%-+*.*G" 5 4 -10.0f)) "-10 " + test "test7767" (lazy(sprintf "%+0G" -10.0f)) "-10" + test "test7768" (lazy(sprintf "%+05G" -10.0f)) "-0010"// "00-10" + test "test7769" (lazy(sprintf "%+01G" -10.0f)) "-10" + test "test7770" (lazy(sprintf "%+0*G" 7 -10.0f)) "-000010"// "0000-10" + test "test7771" (lazy(sprintf "%+0.5G" -10.0f)) "-10" + test "test7772" (lazy(sprintf "%+0.*G" 4 -10.0f)) "-10" + test "test7773" (lazy(sprintf "%+0*.*G" 5 4 -10.0f)) "-0010"// "00-10" + test "test7774" (lazy(sprintf "%-+0G" -10.0f)) "-10" + test "test7775" (lazy(sprintf "%-+05G" -10.0f)) "-10 "//"-1000" + test "test7776" (lazy(sprintf "%-+01G" -10.0f)) "-10" + test "test7777" (lazy(sprintf "%-+0*G" 7 -10.0f)) "-10 "//"-100000" + test "test7778" (lazy(sprintf "%-+0.5G" -10.0f)) "-10" + test "test7779" (lazy(sprintf "%-+0.*G" 4 -10.0f)) "-10" + test "test7780" (lazy(sprintf "%-+0*.*G" 5 4 -10.0f)) "-10 "// "-1000" + test "test7781" (lazy(sprintf "% G" -10.0f)) "-10" + test "test7782" (lazy(sprintf "% 5G" -10.0f)) " -10" + test "test7783" (lazy(sprintf "% 1G" -10.0f)) "-10" + test "test7784" (lazy(sprintf "% *G" 7 -10.0f)) " -10" + test "test7785" (lazy(sprintf "% .5G" -10.0f)) "-10" + test "test7786" (lazy(sprintf "% .*G" 4 -10.0f)) "-10" + test "test7787" (lazy(sprintf "% *.*G" 5 4 -10.0f)) " -10" + test "test7788" (lazy(sprintf "%- G" -10.0f)) "-10" + test "test7789" (lazy(sprintf "%- 5G" -10.0f)) "-10 " + test "test7790" (lazy(sprintf "%- 1G" -10.0f)) "-10" + test "test7791" (lazy(sprintf "%- *G" 7 -10.0f)) "-10 " + test "test7792" (lazy(sprintf "%- .5G" -10.0f)) "-10" + test "test7793" (lazy(sprintf "%- .*G" 4 -10.0f)) "-10" + test "test7794" (lazy(sprintf "%- *.*G" 5 4 -10.0f)) "-10 " + test "test7795" (lazy(sprintf "% 0G" -10.0f)) "-10" + test "test7796" (lazy(sprintf "% 05G" -10.0f)) "-0010"// "00-10" + test "test7797" (lazy(sprintf "% 01G" -10.0f)) "-10" + test "test7798" (lazy(sprintf "% 0*G" 7 -10.0f)) "-000010"// "0000-10" + test "test7799" (lazy(sprintf "% 0.5G" -10.0f)) "-10" + test "test7800" (lazy(sprintf "% 0.*G" 4 -10.0f)) "-10" + test "test7801" (lazy(sprintf "% 0*.*G" 5 4 -10.0f)) "-0010"// "00-10" + test "test7802" (lazy(sprintf "%- 0G" -10.0f)) "-10" + test "test7803" (lazy(sprintf "%- 05G" -10.0f)) "-10 "// "-1000" + test "test7804" (lazy(sprintf "%- 01G" -10.0f)) "-10" + test "test7805" (lazy(sprintf "%- 0*G" 7 -10.0f)) "-10 "// "-100000" + test "test7806" (lazy(sprintf "%- 0.5G" -10.0f)) "-10" + test "test7807" (lazy(sprintf "%- 0.*G" 4 -10.0f)) "-10" + test "test7808" (lazy(sprintf "%- 0*.*G" 5 4 -10.0f)) "-10 "// "-1000" + test "test7809" (lazy(sprintf "%G" 5.0M)) "5" + test "test7810" (lazy(sprintf "%5G" 5.0M)) " 5" + test "test7811" (lazy(sprintf "%1G" 5.0M)) "5" + test "test7812" (lazy(sprintf "%*G" 7 5.0M)) " 5" + test "test7813" (lazy(sprintf "%.5G" 5.0M)) "5" + test "test7814" (lazy(sprintf "%.*G" 4 5.0M)) "5" + test "test7815" (lazy(sprintf "%*.*G" 5 4 5.0M)) " 5" + test "test7816" (lazy(sprintf "%-G" 5.0M)) "5" + test "test7817" (lazy(sprintf "%-5G" 5.0M)) "5 " + test "test7818" (lazy(sprintf "%-1G" 5.0M)) "5" + test "test7819" (lazy(sprintf "%-*G" 7 5.0M)) "5 " + test "test7820" (lazy(sprintf "%-.5G" 5.0M)) "5" + test "test7821" (lazy(sprintf "%-.*G" 4 5.0M)) "5" + test "test7822" (lazy(sprintf "%-*.*G" 5 4 5.0M)) "5 " + test "test7823" (lazy(sprintf "%0G" 5.0M)) "5" + test "test7824" (lazy(sprintf "%05G" 5.0M)) "00005" + test "test7825" (lazy(sprintf "%01G" 5.0M)) "5" + test "test7826" (lazy(sprintf "%0*G" 7 5.0M)) "0000005" + test "test7827" (lazy(sprintf "%0.5G" 5.0M)) "5" + test "test7828" (lazy(sprintf "%0.*G" 4 5.0M)) "5" + test "test7829" (lazy(sprintf "%0*.*G" 5 4 5.0M)) "00005" + test "test7830" (lazy(sprintf "%-0G" 5.0M)) "5" + test "test7831" (lazy(sprintf "%-05G" 5.0M)) "5 "// "50000" + test "test7832" (lazy(sprintf "%-01G" 5.0M)) "5" + test "test7833" (lazy(sprintf "%-0*G" 7 5.0M)) "5 "// "5000000" + test "test7834" (lazy(sprintf "%-0.5G" 5.0M)) "5" + test "test7835" (lazy(sprintf "%-0.*G" 4 5.0M)) "5" + test "test7836" (lazy(sprintf "%-0*.*G" 5 4 5.0M)) "5 "// "50000" + test "test7837" (lazy(sprintf "%+G" 5.0M)) "+5" + test "test7838" (lazy(sprintf "%+5G" 5.0M)) " +5" + test "test7839" (lazy(sprintf "%+1G" 5.0M)) "+5" + test "test7840" (lazy(sprintf "%+*G" 7 5.0M)) " +5" + test "test7841" (lazy(sprintf "%+.5G" 5.0M)) "+5" + test "test7842" (lazy(sprintf "%+.*G" 4 5.0M)) "+5" + test "test7843" (lazy(sprintf "%+*.*G" 5 4 5.0M)) " +5" + test "test7844" (lazy(sprintf "%-+G" 5.0M)) "+5" + test "test7845" (lazy(sprintf "%-+5G" 5.0M)) "+5 " + test "test7846" (lazy(sprintf "%-+1G" 5.0M)) "+5" + test "test7847" (lazy(sprintf "%-+*G" 7 5.0M)) "+5 " + test "test7848" (lazy(sprintf "%-+.5G" 5.0M)) "+5" + test "test7849" (lazy(sprintf "%-+.*G" 4 5.0M)) "+5" + test "test7850" (lazy(sprintf "%-+*.*G" 5 4 5.0M)) "+5 " + test "test7851" (lazy(sprintf "%+0G" 5.0M)) "+5" + test "test7852" (lazy(sprintf "%+05G" 5.0M)) "+0005"// "000+5" + test "test7853" (lazy(sprintf "%+01G" 5.0M)) "+5" + test "test7854" (lazy(sprintf "%+0*G" 7 5.0M)) "+000005"// "00000+5" + test "test7855" (lazy(sprintf "%+0.5G" 5.0M)) "+5" + test "test7856" (lazy(sprintf "%+0.*G" 4 5.0M)) "+5" + test "test7857" (lazy(sprintf "%+0*.*G" 5 4 5.0M)) "+0005"// "000+5" + test "test7858" (lazy(sprintf "%-+0G" 5.0M)) "+5" + test "test7859" (lazy(sprintf "%-+05G" 5.0M)) "+5 "// "+5000" + test "test7860" (lazy(sprintf "%-+01G" 5.0M)) "+5" + test "test7861" (lazy(sprintf "%-+0*G" 7 5.0M)) "+5 "// "+500000" + test "test7862" (lazy(sprintf "%-+0.5G" 5.0M)) "+5" + test "test7863" (lazy(sprintf "%-+0.*G" 4 5.0M)) "+5" + test "test7864" (lazy(sprintf "%-+0*.*G" 5 4 5.0M)) "+5 "// "+5000" + test "test7865" (lazy(sprintf "% G" 5.0M)) " 5" + test "test7866" (lazy(sprintf "% 5G" 5.0M)) " 5" + test "test7867" (lazy(sprintf "% 1G" 5.0M)) " 5" + test "test7868" (lazy(sprintf "% *G" 7 5.0M)) " 5" + test "test7869" (lazy(sprintf "% .5G" 5.0M)) " 5" + test "test7870" (lazy(sprintf "% .*G" 4 5.0M)) " 5" + test "test7871" (lazy(sprintf "% *.*G" 5 4 5.0M)) " 5" + test "test7872" (lazy(sprintf "%- G" 5.0M)) " 5" + test "test7873" (lazy(sprintf "%- 5G" 5.0M)) " 5 " + test "test7874" (lazy(sprintf "%- 1G" 5.0M)) " 5" + test "test7875" (lazy(sprintf "%- *G" 7 5.0M)) " 5 " + test "test7876" (lazy(sprintf "%- .5G" 5.0M)) " 5" + test "test7877" (lazy(sprintf "%- .*G" 4 5.0M)) " 5" + test "test7878" (lazy(sprintf "%- *.*G" 5 4 5.0M)) " 5 " + test "test7879" (lazy(sprintf "% 0G" 5.0M)) " 5" + test "test7880" (lazy(sprintf "% 05G" 5.0M)) " 0005"// "000 5" + test "test7881" (lazy(sprintf "% 01G" 5.0M)) " 5" + test "test7882" (lazy(sprintf "% 0*G" 7 5.0M)) " 000005"// "00000 5" + test "test7883" (lazy(sprintf "% 0.5G" 5.0M)) " 5" + test "test7884" (lazy(sprintf "% 0.*G" 4 5.0M)) " 5" + test "test7885" (lazy(sprintf "% 0*.*G" 5 4 5.0M)) " 0005"// "000 5" + test "test7886" (lazy(sprintf "%- 0G" 5.0M)) " 5" + test "test7887" (lazy(sprintf "%- 05G" 5.0M)) " 5 "// " 5000" + test "test7888" (lazy(sprintf "%- 01G" 5.0M)) " 5" + test "test7889" (lazy(sprintf "%- 0*G" 7 5.0M)) " 5 "// " 500000" + test "test7890" (lazy(sprintf "%- 0.5G" 5.0M)) " 5" + test "test7891" (lazy(sprintf "%- 0.*G" 4 5.0M)) " 5" + test "test7892" (lazy(sprintf "%- 0*.*G" 5 4 5.0M)) " 5 "// " 5000" + test "test7893" (lazy(sprintf "%G" -10.0M)) "-10" + test "test7894" (lazy(sprintf "%5G" -10.0M)) " -10" + test "test7895" (lazy(sprintf "%1G" -10.0M)) "-10" + test "test7896" (lazy(sprintf "%*G" 7 -10.0M)) " -10" + test "test7897" (lazy(sprintf "%.5G" -10.0M)) "-10" + test "test7898" (lazy(sprintf "%.*G" 4 -10.0M)) "-10" + test "test7899" (lazy(sprintf "%*.*G" 5 4 -10.0M)) " -10" + test "test7900" (lazy(sprintf "%-G" -10.0M)) "-10" + test "test7901" (lazy(sprintf "%-5G" -10.0M)) "-10 " + test "test7902" (lazy(sprintf "%-1G" -10.0M)) "-10" + test "test7903" (lazy(sprintf "%-*G" 7 -10.0M)) "-10 " + test "test7904" (lazy(sprintf "%-.5G" -10.0M)) "-10" + test "test7905" (lazy(sprintf "%-.*G" 4 -10.0M)) "-10" + test "test7906" (lazy(sprintf "%-*.*G" 5 4 -10.0M)) "-10 " + test "test7907" (lazy(sprintf "%0G" -10.0M)) "-10" + test "test7908" (lazy(sprintf "%05G" -10.0M)) "-0010"// "00-10" + test "test7909" (lazy(sprintf "%01G" -10.0M)) "-10" + test "test7910" (lazy(sprintf "%0*G" 7 -10.0M)) "-000010"// "0000-10" + test "test7911" (lazy(sprintf "%0.5G" -10.0M)) "-10" + test "test7912" (lazy(sprintf "%0.*G" 4 -10.0M)) "-10" + test "test7913" (lazy(sprintf "%0*.*G" 5 4 -10.0M)) "-0010"// "00-10" + test "test7914" (lazy(sprintf "%-0G" -10.0M)) "-10" + test "test7915" (lazy(sprintf "%-05G" -10.0M)) "-10 "// "-1000" + test "test7916" (lazy(sprintf "%-01G" -10.0M)) "-10" + test "test7917" (lazy(sprintf "%-0*G" 7 -10.0M)) "-10 "// "-100000" + test "test7918" (lazy(sprintf "%-0.5G" -10.0M)) "-10" + test "test7919" (lazy(sprintf "%-0.*G" 4 -10.0M)) "-10" + test "test7920" (lazy(sprintf "%-0*.*G" 5 4 -10.0M)) "-10 "// "-1000" + test "test7921" (lazy(sprintf "%+G" -10.0M)) "-10" + test "test7922" (lazy(sprintf "%+5G" -10.0M)) " -10" + test "test7923" (lazy(sprintf "%+1G" -10.0M)) "-10" + test "test7924" (lazy(sprintf "%+*G" 7 -10.0M)) " -10" + test "test7925" (lazy(sprintf "%+.5G" -10.0M)) "-10" + test "test7926" (lazy(sprintf "%+.*G" 4 -10.0M)) "-10" + test "test7927" (lazy(sprintf "%+*.*G" 5 4 -10.0M)) " -10" + test "test7928" (lazy(sprintf "%-+G" -10.0M)) "-10" + test "test7929" (lazy(sprintf "%-+5G" -10.0M)) "-10 " + test "test7930" (lazy(sprintf "%-+1G" -10.0M)) "-10" + test "test7931" (lazy(sprintf "%-+*G" 7 -10.0M)) "-10 " + test "test7932" (lazy(sprintf "%-+.5G" -10.0M)) "-10" + test "test7933" (lazy(sprintf "%-+.*G" 4 -10.0M)) "-10" + test "test7934" (lazy(sprintf "%-+*.*G" 5 4 -10.0M)) "-10 " + test "test7935" (lazy(sprintf "%+0G" -10.0M)) "-10" + test "test7936" (lazy(sprintf "%+05G" -10.0M)) "-0010"// "00-10" + test "test7937" (lazy(sprintf "%+01G" -10.0M)) "-10" + test "test7938" (lazy(sprintf "%+0*G" 7 -10.0M)) "-000010"/// "0000-10" + test "test7939" (lazy(sprintf "%+0.5G" -10.0M)) "-10" + test "test7940" (lazy(sprintf "%+0.*G" 4 -10.0M)) "-10" + test "test7941" (lazy(sprintf "%+0*.*G" 5 4 -10.0M)) "-0010"// "00-10" + test "test7942" (lazy(sprintf "%-+0G" -10.0M)) "-10" + test "test7943" (lazy(sprintf "%-+05G" -10.0M)) "-10 "// "-1000" + test "test7944" (lazy(sprintf "%-+01G" -10.0M)) "-10" + test "test7945" (lazy(sprintf "%-+0*G" 7 -10.0M)) "-10 "// "-100000" + test "test7946" (lazy(sprintf "%-+0.5G" -10.0M)) "-10" + test "test7947" (lazy(sprintf "%-+0.*G" 4 -10.0M)) "-10" + test "test7948" (lazy(sprintf "%-+0*.*G" 5 4 -10.0M)) "-10 "// "-1000" + test "test7949" (lazy(sprintf "% G" -10.0M)) "-10" + test "test7950" (lazy(sprintf "% 5G" -10.0M)) " -10" + test "test7951" (lazy(sprintf "% 1G" -10.0M)) "-10" + test "test7952" (lazy(sprintf "% *G" 7 -10.0M)) " -10" + test "test7953" (lazy(sprintf "% .5G" -10.0M)) "-10" + test "test7954" (lazy(sprintf "% .*G" 4 -10.0M)) "-10" + test "test7955" (lazy(sprintf "% *.*G" 5 4 -10.0M)) " -10" + test "test7956" (lazy(sprintf "%- G" -10.0M)) "-10" + test "test7957" (lazy(sprintf "%- 5G" -10.0M)) "-10 " + test "test7958" (lazy(sprintf "%- 1G" -10.0M)) "-10" + test "test7959" (lazy(sprintf "%- *G" 7 -10.0M)) "-10 " + test "test7960" (lazy(sprintf "%- .5G" -10.0M)) "-10" + test "test7961" (lazy(sprintf "%- .*G" 4 -10.0M)) "-10" + test "test7962" (lazy(sprintf "%- *.*G" 5 4 -10.0M)) "-10 " + test "test7963" (lazy(sprintf "% 0G" -10.0M)) "-10" + test "test7964" (lazy(sprintf "% 05G" -10.0M)) "-0010"// "00-10" + test "test7965" (lazy(sprintf "% 01G" -10.0M)) "-10" + test "test7966" (lazy(sprintf "% 0*G" 7 -10.0M)) "-000010"// "0000-10" + test "test7967" (lazy(sprintf "% 0.5G" -10.0M)) "-10" + test "test7968" (lazy(sprintf "% 0.*G" 4 -10.0M)) "-10" + test "test7969" (lazy(sprintf "% 0*.*G" 5 4 -10.0M)) "-0010"// "00-10" + test "test7970" (lazy(sprintf "%- 0G" -10.0M)) "-10" + test "test7971" (lazy(sprintf "%- 05G" -10.0M)) "-10 "// "-1000" + test "test7972" (lazy(sprintf "%- 01G" -10.0M)) "-10" + test "test7973" (lazy(sprintf "%- 0*G" 7 -10.0M)) "-10 "// "-100000" + test "test7974" (lazy(sprintf "%- 0.5G" -10.0M)) "-10" + test "test7975" (lazy(sprintf "%- 0.*G" 4 -10.0M)) "-10" + test "test7976" (lazy(sprintf "%- 0*.*G" 5 4 -10.0M)) "-10 "// "-1000" + test "test7977" (lazy(sprintf "%M" 10M)) "10" + test "test7978" (lazy(sprintf "%5M" 10M)) " 10" + test "test7979" (lazy(sprintf "%1M" 10M)) "10" + test "test7980" (lazy(sprintf "%*M" 7 10M)) " 10" + test "test7981" (lazy(sprintf "%.5M" 10M)) "10" + test "test7982" (lazy(sprintf "%.*M" 4 10M)) "10" + test "test7983" (lazy(sprintf "%*.*M" 5 4 10M)) " 10" + test "test7984" (lazy(sprintf "%-M" 10M)) "10" + test "test7985" (lazy(sprintf "%-5M" 10M)) "10 " + test "test7986" (lazy(sprintf "%-1M" 10M)) "10" + test "test7987" (lazy(sprintf "%-*M" 7 10M)) "10 " + test "test7988" (lazy(sprintf "%-.5M" 10M)) "10" + test "test7989" (lazy(sprintf "%-.*M" 4 10M)) "10" + test "test7990" (lazy(sprintf "%-*.*M" 5 4 10M)) "10 " + test "test7991" (lazy(sprintf "%0M" 10M)) "10" + test "test7992" (lazy(sprintf "%05M" 10M)) "00010" + test "test7993" (lazy(sprintf "%01M" 10M)) "10" + test "test7994" (lazy(sprintf "%0*M" 7 10M)) "0000010" + test "test7995" (lazy(sprintf "%0.5M" 10M)) "10" + test "test7996" (lazy(sprintf "%0.*M" 4 10M)) "10" + test "test7997" (lazy(sprintf "%0*.*M" 5 4 10M)) "00010" + test "test7998" (lazy(sprintf "%-0M" 10M)) "10" + test "test7999" (lazy(sprintf "%-05M" 10M)) "10 "//"10000" + test "test8000" (lazy(sprintf "%-01M" 10M)) "10" +let func8000()= + test "test8001" (lazy(sprintf "%-0*M" 7 10M)) "10 "//"1000000" + test "test8002" (lazy(sprintf "%-0.5M" 10M)) "10" + test "test8003" (lazy(sprintf "%-0.*M" 4 10M)) "10" + test "test8004" (lazy(sprintf "%-0*.*M" 5 4 10M)) "10 "//"10000" + test "test8005" (lazy(sprintf "%+M" 10M)) "+10" + test "test8006" (lazy(sprintf "%+5M" 10M)) " +10" + test "test8007" (lazy(sprintf "%+1M" 10M)) "+10" + test "test8008" (lazy(sprintf "%+*M" 7 10M)) " +10" + test "test8009" (lazy(sprintf "%+.5M" 10M)) "+10" + test "test8010" (lazy(sprintf "%+.*M" 4 10M)) "+10" + test "test8011" (lazy(sprintf "%+*.*M" 5 4 10M)) " +10" + test "test8012" (lazy(sprintf "%-+M" 10M)) "+10" + test "test8013" (lazy(sprintf "%-+5M" 10M)) "+10 " + test "test8014" (lazy(sprintf "%-+1M" 10M)) "+10" + test "test8015" (lazy(sprintf "%-+*M" 7 10M)) "+10 " + test "test8016" (lazy(sprintf "%-+.5M" 10M)) "+10" + test "test8017" (lazy(sprintf "%-+.*M" 4 10M)) "+10" + test "test8018" (lazy(sprintf "%-+*.*M" 5 4 10M)) "+10 " + test "test8019" (lazy(sprintf "%+0M" 10M)) "+10" + test "test8020" (lazy(sprintf "%+05M" 10M)) "+0010"// "00+10" + test "test8021" (lazy(sprintf "%+01M" 10M)) "+10" + test "test8022" (lazy(sprintf "%+0*M" 7 10M)) "+000010"// "0000+10" + test "test8023" (lazy(sprintf "%+0.5M" 10M)) "+10" + test "test8024" (lazy(sprintf "%+0.*M" 4 10M)) "+10" + test "test8025" (lazy(sprintf "%+0*.*M" 5 4 10M)) "+0010"// "00+10" + test "test8026" (lazy(sprintf "%-+0M" 10M)) "+10" + test "test8027" (lazy(sprintf "%-+05M" 10M)) "+10 "//"+1000" + test "test8028" (lazy(sprintf "%-+01M" 10M)) "+10" + test "test8029" (lazy(sprintf "%-+0*M" 7 10M)) "+10 "// "+100000" + test "test8030" (lazy(sprintf "%-+0.5M" 10M)) "+10" + test "test8031" (lazy(sprintf "%-+0.*M" 4 10M)) "+10" + test "test8032" (lazy(sprintf "%-+0*.*M" 5 4 10M)) "+10 "//"+1000" + test "test8033" (lazy(sprintf "% M" 10M)) " 10" + test "test8034" (lazy(sprintf "% 5M" 10M)) " 10" + test "test8035" (lazy(sprintf "% 1M" 10M)) " 10" + test "test8036" (lazy(sprintf "% *M" 7 10M)) " 10" + test "test8037" (lazy(sprintf "% .5M" 10M)) " 10" + test "test8038" (lazy(sprintf "% .*M" 4 10M)) " 10" + test "test8039" (lazy(sprintf "% *.*M" 5 4 10M)) " 10" + test "test8040" (lazy(sprintf "%- M" 10M)) " 10" + test "test8041" (lazy(sprintf "%- 5M" 10M)) " 10 " + test "test8042" (lazy(sprintf "%- 1M" 10M)) " 10" + test "test8043" (lazy(sprintf "%- *M" 7 10M)) " 10 " + test "test8044" (lazy(sprintf "%- .5M" 10M)) " 10" + test "test8045" (lazy(sprintf "%- .*M" 4 10M)) " 10" + test "test8046" (lazy(sprintf "%- *.*M" 5 4 10M)) " 10 " + test "test8047" (lazy(sprintf "% 0M" 10M)) " 10" + test "test8048" (lazy(sprintf "% 05M" 10M)) " 0010"// "00 10" + test "test8049" (lazy(sprintf "% 01M" 10M)) " 10" + test "test8050" (lazy(sprintf "% 0*M" 7 10M)) " 000010"// "0000 10" + test "test8051" (lazy(sprintf "% 0.5M" 10M)) " 10" + test "test8052" (lazy(sprintf "% 0.*M" 4 10M)) " 10" + test "test8053" (lazy(sprintf "% 0*.*M" 5 4 10M)) " 0010"// "00 10" + test "test8054" (lazy(sprintf "%- 0M" 10M)) " 10" + test "test8055" (lazy(sprintf "%- 05M" 10M)) " 10 "// " 1000" + test "test8056" (lazy(sprintf "%- 01M" 10M)) " 10" + test "test8057" (lazy(sprintf "%- 0*M" 7 10M)) " 10 "//" 100000" + test "test8058" (lazy(sprintf "%- 0.5M" 10M)) " 10" + test "test8059" (lazy(sprintf "%- 0.*M" 4 10M)) " 10" + test "test8060" (lazy(sprintf "%- 0*.*M" 5 4 10M)) " 10 "//" 1000" + test "test8061" (lazy(sprintf "%M" 1.3M)) "1.3" + test "test8062" (lazy(sprintf "%5M" 1.3M)) " 1.3" + test "test8063" (lazy(sprintf "%1M" 1.3M)) "1.3" + test "test8064" (lazy(sprintf "%*M" 7 1.3M)) " 1.3" + test "test8065" (lazy(sprintf "%.5M" 1.3M)) "1.3" + test "test8066" (lazy(sprintf "%.*M" 4 1.3M)) "1.3" + test "test8067" (lazy(sprintf "%*.*M" 5 4 1.3M)) " 1.3" + test "test8068" (lazy(sprintf "%-M" 1.3M)) "1.3" + test "test8069" (lazy(sprintf "%-5M" 1.3M)) "1.3 " + test "test8070" (lazy(sprintf "%-1M" 1.3M)) "1.3" + test "test8071" (lazy(sprintf "%-*M" 7 1.3M)) "1.3 " + test "test8072" (lazy(sprintf "%-.5M" 1.3M)) "1.3" + test "test8073" (lazy(sprintf "%-.*M" 4 1.3M)) "1.3" + test "test8074" (lazy(sprintf "%-*.*M" 5 4 1.3M)) "1.3 " + test "test8075" (lazy(sprintf "%0M" 1.3M)) "1.3" + test "test8076" (lazy(sprintf "%05M" 1.3M)) "001.3" + test "test8077" (lazy(sprintf "%01M" 1.3M)) "1.3" + test "test8078" (lazy(sprintf "%0*M" 7 1.3M)) "00001.3" + test "test8079" (lazy(sprintf "%0.5M" 1.3M)) "1.3" + test "test8080" (lazy(sprintf "%0.*M" 4 1.3M)) "1.3" + test "test8081" (lazy(sprintf "%0*.*M" 5 4 1.3M)) "001.3" + test "test8082" (lazy(sprintf "%-0M" 1.3M)) "1.3" + test "test8083" (lazy(sprintf "%-05M" 1.3M)) "1.300" + test "test8084" (lazy(sprintf "%-01M" 1.3M)) "1.3" + test "test8085" (lazy(sprintf "%-0*M" 7 1.3M)) "1.30000" + test "test8086" (lazy(sprintf "%-0.5M" 1.3M)) "1.3" + test "test8087" (lazy(sprintf "%-0.*M" 4 1.3M)) "1.3" + test "test8088" (lazy(sprintf "%-0*.*M" 5 4 1.3M)) "1.300" + test "test8089" (lazy(sprintf "%+M" 1.3M)) "+1.3" + test "test8090" (lazy(sprintf "%+5M" 1.3M)) " +1.3" + test "test8091" (lazy(sprintf "%+1M" 1.3M)) "+1.3" + test "test8092" (lazy(sprintf "%+*M" 7 1.3M)) " +1.3" + test "test8093" (lazy(sprintf "%+.5M" 1.3M)) "+1.3" + test "test8094" (lazy(sprintf "%+.*M" 4 1.3M)) "+1.3" + test "test8095" (lazy(sprintf "%+*.*M" 5 4 1.3M)) " +1.3" + test "test8096" (lazy(sprintf "%-+M" 1.3M)) "+1.3" + test "test8097" (lazy(sprintf "%-+5M" 1.3M)) "+1.3 " + test "test8098" (lazy(sprintf "%-+1M" 1.3M)) "+1.3" + test "test8099" (lazy(sprintf "%-+*M" 7 1.3M)) "+1.3 " + test "test8100" (lazy(sprintf "%-+.5M" 1.3M)) "+1.3" + test "test8101" (lazy(sprintf "%-+.*M" 4 1.3M)) "+1.3" + test "test8102" (lazy(sprintf "%-+*.*M" 5 4 1.3M)) "+1.3 " + test "test8103" (lazy(sprintf "%+0M" 1.3M)) "+1.3" + test "test8104" (lazy(sprintf "%+05M" 1.3M)) "+01.3"//"0+1.3" + test "test8105" (lazy(sprintf "%+01M" 1.3M)) "+1.3" + test "test8106" (lazy(sprintf "%+0*M" 7 1.3M)) "+0001.3"//"000+1.3" + test "test8107" (lazy(sprintf "%+0.5M" 1.3M)) "+1.3" + test "test8108" (lazy(sprintf "%+0.*M" 4 1.3M)) "+1.3" + test "test8109" (lazy(sprintf "%+0*.*M" 5 4 1.3M)) "+01.3"//"0+1.3" + test "test8110" (lazy(sprintf "%-+0M" 1.3M)) "+1.3" + test "test8111" (lazy(sprintf "%-+05M" 1.3M)) "+1.30" + test "test8112" (lazy(sprintf "%-+01M" 1.3M)) "+1.3" + test "test8113" (lazy(sprintf "%-+0*M" 7 1.3M)) "+1.3000" + test "test8114" (lazy(sprintf "%-+0.5M" 1.3M)) "+1.3" + test "test8115" (lazy(sprintf "%-+0.*M" 4 1.3M)) "+1.3" + test "test8116" (lazy(sprintf "%-+0*.*M" 5 4 1.3M)) "+1.30" + test "test8117" (lazy(sprintf "% M" 1.3M)) " 1.3" + test "test8118" (lazy(sprintf "% 5M" 1.3M)) " 1.3" + test "test8119" (lazy(sprintf "% 1M" 1.3M)) " 1.3" + test "test8120" (lazy(sprintf "% *M" 7 1.3M)) " 1.3" + test "test8121" (lazy(sprintf "% .5M" 1.3M)) " 1.3" + test "test8122" (lazy(sprintf "% .*M" 4 1.3M)) " 1.3" + test "test8123" (lazy(sprintf "% *.*M" 5 4 1.3M)) " 1.3" + test "test8124" (lazy(sprintf "%- M" 1.3M)) " 1.3" + test "test8125" (lazy(sprintf "%- 5M" 1.3M)) " 1.3 " + test "test8126" (lazy(sprintf "%- 1M" 1.3M)) " 1.3" + test "test8127" (lazy(sprintf "%- *M" 7 1.3M)) " 1.3 " + test "test8128" (lazy(sprintf "%- .5M" 1.3M)) " 1.3" + test "test8129" (lazy(sprintf "%- .*M" 4 1.3M)) " 1.3" + test "test8130" (lazy(sprintf "%- *.*M" 5 4 1.3M)) " 1.3 " + test "test8131" (lazy(sprintf "% 0M" 1.3M)) " 1.3" + test "test8132" (lazy(sprintf "% 05M" 1.3M)) " 01.3"//"0 1.3" + test "test8133" (lazy(sprintf "% 01M" 1.3M)) " 1.3" + test "test8134" (lazy(sprintf "% 0*M" 7 1.3M)) " 0001.3"// "000 1.3" + test "test8135" (lazy(sprintf "% 0.5M" 1.3M)) " 1.3" + test "test8136" (lazy(sprintf "% 0.*M" 4 1.3M)) " 1.3" + test "test8137" (lazy(sprintf "% 0*.*M" 5 4 1.3M)) " 01.3"// "0 1.3" + test "test8138" (lazy(sprintf "%- 0M" 1.3M)) " 1.3" + test "test8139" (lazy(sprintf "%- 05M" 1.3M)) " 1.30" + test "test8140" (lazy(sprintf "%- 01M" 1.3M)) " 1.3" + test "test8141" (lazy(sprintf "%- 0*M" 7 1.3M)) " 1.3000" + test "test8142" (lazy(sprintf "%- 0.5M" 1.3M)) " 1.3" + test "test8143" (lazy(sprintf "%- 0.*M" 4 1.3M)) " 1.3" + test "test8144" (lazy(sprintf "%- 0*.*M" 5 4 1.3M)) " 1.30" + test "test8145" (lazy(sprintf "%M" -15.5M)) "-15.5" + test "test8146" (lazy(sprintf "%5M" -15.5M)) "-15.5" + test "test8147" (lazy(sprintf "%1M" -15.5M)) "-15.5" + test "test8148" (lazy(sprintf "%*M" 7 -15.5M)) " -15.5" + test "test8149" (lazy(sprintf "%.5M" -15.5M)) "-15.5" + test "test8150" (lazy(sprintf "%.*M" 4 -15.5M)) "-15.5" + test "test8151" (lazy(sprintf "%*.*M" 5 4 -15.5M)) "-15.5" + test "test8152" (lazy(sprintf "%-M" -15.5M)) "-15.5" + test "test8153" (lazy(sprintf "%-5M" -15.5M)) "-15.5" + test "test8154" (lazy(sprintf "%-1M" -15.5M)) "-15.5" + test "test8155" (lazy(sprintf "%-*M" 7 -15.5M)) "-15.5 " + test "test8156" (lazy(sprintf "%-.5M" -15.5M)) "-15.5" + test "test8157" (lazy(sprintf "%-.*M" 4 -15.5M)) "-15.5" + test "test8158" (lazy(sprintf "%-*.*M" 5 4 -15.5M)) "-15.5" + test "test8159" (lazy(sprintf "%0M" -15.5M)) "-15.5" + test "test8160" (lazy(sprintf "%05M" -15.5M)) "-15.5" + test "test8161" (lazy(sprintf "%01M" -15.5M)) "-15.5" + test "test8162" (lazy(sprintf "%0*M" 7 -15.5M)) "-0015.5"// "00-15.5" + test "test8163" (lazy(sprintf "%0.5M" -15.5M)) "-15.5" + test "test8164" (lazy(sprintf "%0.*M" 4 -15.5M)) "-15.5" + test "test8165" (lazy(sprintf "%0*.*M" 5 4 -15.5M)) "-15.5" + test "test8166" (lazy(sprintf "%-0M" -15.5M)) "-15.5" + test "test8167" (lazy(sprintf "%-05M" -15.5M)) "-15.5" + test "test8168" (lazy(sprintf "%-01M" -15.5M)) "-15.5" + test "test8169" (lazy(sprintf "%-0*M" 7 -15.5M)) "-15.500" + test "test8170" (lazy(sprintf "%-0.5M" -15.5M)) "-15.5" + test "test8171" (lazy(sprintf "%-0.*M" 4 -15.5M)) "-15.5" + test "test8172" (lazy(sprintf "%-0*.*M" 5 4 -15.5M)) "-15.5" + test "test8173" (lazy(sprintf "%+M" -15.5M)) "-15.5" + test "test8174" (lazy(sprintf "%+5M" -15.5M)) "-15.5" + test "test8175" (lazy(sprintf "%+1M" -15.5M)) "-15.5" + test "test8176" (lazy(sprintf "%+*M" 7 -15.5M)) " -15.5" + test "test8177" (lazy(sprintf "%+.5M" -15.5M)) "-15.5" + test "test8178" (lazy(sprintf "%+.*M" 4 -15.5M)) "-15.5" + test "test8179" (lazy(sprintf "%+*.*M" 5 4 -15.5M)) "-15.5" + test "test8180" (lazy(sprintf "%-+M" -15.5M)) "-15.5" + test "test8181" (lazy(sprintf "%-+5M" -15.5M)) "-15.5" + test "test8182" (lazy(sprintf "%-+1M" -15.5M)) "-15.5" + test "test8183" (lazy(sprintf "%-+*M" 7 -15.5M)) "-15.5 " + test "test8184" (lazy(sprintf "%-+.5M" -15.5M)) "-15.5" + test "test8185" (lazy(sprintf "%-+.*M" 4 -15.5M)) "-15.5" + test "test8186" (lazy(sprintf "%-+*.*M" 5 4 -15.5M)) "-15.5" + test "test8187" (lazy(sprintf "%+0M" -15.5M)) "-15.5" + test "test8188" (lazy(sprintf "%+05M" -15.5M)) "-15.5" + test "test8189" (lazy(sprintf "%+01M" -15.5M)) "-15.5" + test "test8190" (lazy(sprintf "%+0*M" 7 -15.5M)) "-0015.5"//"00-15.5" + test "test8191" (lazy(sprintf "%+0.5M" -15.5M)) "-15.5" + test "test8192" (lazy(sprintf "%+0.*M" 4 -15.5M)) "-15.5" + test "test8193" (lazy(sprintf "%+0*.*M" 5 4 -15.5M)) "-15.5" + test "test8194" (lazy(sprintf "%-+0M" -15.5M)) "-15.5" + test "test8195" (lazy(sprintf "%-+05M" -15.5M)) "-15.5" + test "test8196" (lazy(sprintf "%-+01M" -15.5M)) "-15.5" + test "test8197" (lazy(sprintf "%-+0*M" 7 -15.5M)) "-15.500" + test "test8198" (lazy(sprintf "%-+0.5M" -15.5M)) "-15.5" + test "test8199" (lazy(sprintf "%-+0.*M" 4 -15.5M)) "-15.5" + test "test8200" (lazy(sprintf "%-+0*.*M" 5 4 -15.5M)) "-15.5" + test "test8201" (lazy(sprintf "% M" -15.5M)) "-15.5" + test "test8202" (lazy(sprintf "% 5M" -15.5M)) "-15.5" + test "test8203" (lazy(sprintf "% 1M" -15.5M)) "-15.5" + test "test8204" (lazy(sprintf "% *M" 7 -15.5M)) " -15.5" + test "test8205" (lazy(sprintf "% .5M" -15.5M)) "-15.5" + test "test8206" (lazy(sprintf "% .*M" 4 -15.5M)) "-15.5" + test "test8207" (lazy(sprintf "% *.*M" 5 4 -15.5M)) "-15.5" + test "test8208" (lazy(sprintf "%- M" -15.5M)) "-15.5" + test "test8209" (lazy(sprintf "%- 5M" -15.5M)) "-15.5" + test "test8210" (lazy(sprintf "%- 1M" -15.5M)) "-15.5" + test "test8211" (lazy(sprintf "%- *M" 7 -15.5M)) "-15.5 " + test "test8212" (lazy(sprintf "%- .5M" -15.5M)) "-15.5" + test "test8213" (lazy(sprintf "%- .*M" 4 -15.5M)) "-15.5" + test "test8214" (lazy(sprintf "%- *.*M" 5 4 -15.5M)) "-15.5" + test "test8215" (lazy(sprintf "% 0M" -15.5M)) "-15.5" + test "test8216" (lazy(sprintf "% 05M" -15.5M)) "-15.5" + test "test8217" (lazy(sprintf "% 01M" -15.5M)) "-15.5" + test "test8218" (lazy(sprintf "% 0*M" 7 -15.5M)) "-0015.5"//"00-15.5" + test "test8219" (lazy(sprintf "% 0.5M" -15.5M)) "-15.5" + test "test8220" (lazy(sprintf "% 0.*M" 4 -15.5M)) "-15.5" + test "test8221" (lazy(sprintf "% 0*.*M" 5 4 -15.5M)) "-15.5" + test "test8222" (lazy(sprintf "%- 0M" -15.5M)) "-15.5" + test "test8223" (lazy(sprintf "%- 05M" -15.5M)) "-15.5" + test "test8224" (lazy(sprintf "%- 01M" -15.5M)) "-15.5" + test "test8225" (lazy(sprintf "%- 0*M" 7 -15.5M)) "-15.500" + test "test8226" (lazy(sprintf "%- 0.5M" -15.5M)) "-15.5" + test "test8227" (lazy(sprintf "%- 0.*M" 4 -15.5M)) "-15.5" + test "test8228" (lazy(sprintf "%- 0*.*M" 5 4 -15.5M)) "-15.5" + test "test8229" (lazy(sprintf "%M" -7M)) "-7" + test "test8230" (lazy(sprintf "%5M" -7M)) " -7" + test "test8231" (lazy(sprintf "%1M" -7M)) "-7" + test "test8232" (lazy(sprintf "%*M" 7 -7M)) " -7" + test "test8233" (lazy(sprintf "%.5M" -7M)) "-7" + test "test8234" (lazy(sprintf "%.*M" 4 -7M)) "-7" + test "test8235" (lazy(sprintf "%*.*M" 5 4 -7M)) " -7" + test "test8236" (lazy(sprintf "%-M" -7M)) "-7" + test "test8237" (lazy(sprintf "%-5M" -7M)) "-7 " + test "test8238" (lazy(sprintf "%-1M" -7M)) "-7" + test "test8239" (lazy(sprintf "%-*M" 7 -7M)) "-7 " + test "test8240" (lazy(sprintf "%-.5M" -7M)) "-7" + test "test8241" (lazy(sprintf "%-.*M" 4 -7M)) "-7" + test "test8242" (lazy(sprintf "%-*.*M" 5 4 -7M)) "-7 " + test "test8243" (lazy(sprintf "%0M" -7M)) "-7" + test "test8244" (lazy(sprintf "%05M" -7M)) "-0007"//"000-7" + test "test8245" (lazy(sprintf "%01M" -7M)) "-7" + test "test8246" (lazy(sprintf "%0*M" 7 -7M)) "-000007"// "00000-7" + test "test8247" (lazy(sprintf "%0.5M" -7M)) "-7" + test "test8248" (lazy(sprintf "%0.*M" 4 -7M)) "-7" + test "test8249" (lazy(sprintf "%0*.*M" 5 4 -7M)) "-0007"// "000-7" + test "test8250" (lazy(sprintf "%-0M" -7M)) "-7" + test "test8251" (lazy(sprintf "%-05M" -7M)) "-7 "// "-7000" + test "test8252" (lazy(sprintf "%-01M" -7M)) "-7" + test "test8253" (lazy(sprintf "%-0*M" 7 -7M)) "-7 "//"-700000" + test "test8254" (lazy(sprintf "%-0.5M" -7M)) "-7" + test "test8255" (lazy(sprintf "%-0.*M" 4 -7M)) "-7" + test "test8256" (lazy(sprintf "%-0*.*M" 5 4 -7M)) "-7 "//"-7000" + test "test8257" (lazy(sprintf "%+M" -7M)) "-7" + test "test8258" (lazy(sprintf "%+5M" -7M)) " -7" + test "test8259" (lazy(sprintf "%+1M" -7M)) "-7" + test "test8260" (lazy(sprintf "%+*M" 7 -7M)) " -7" + test "test8261" (lazy(sprintf "%+.5M" -7M)) "-7" + test "test8262" (lazy(sprintf "%+.*M" 4 -7M)) "-7" + test "test8263" (lazy(sprintf "%+*.*M" 5 4 -7M)) " -7" + test "test8264" (lazy(sprintf "%-+M" -7M)) "-7" + test "test8265" (lazy(sprintf "%-+5M" -7M)) "-7 " + test "test8266" (lazy(sprintf "%-+1M" -7M)) "-7" + test "test8267" (lazy(sprintf "%-+*M" 7 -7M)) "-7 " + test "test8268" (lazy(sprintf "%-+.5M" -7M)) "-7" + test "test8269" (lazy(sprintf "%-+.*M" 4 -7M)) "-7" + test "test8270" (lazy(sprintf "%-+*.*M" 5 4 -7M)) "-7 " + test "test8271" (lazy(sprintf "%+0M" -7M)) "-7" + test "test8272" (lazy(sprintf "%+05M" -7M)) "-0007"// "000-7" + test "test8273" (lazy(sprintf "%+01M" -7M)) "-7" + test "test8274" (lazy(sprintf "%+0*M" 7 -7M)) "-000007"//"00000-7" + test "test8275" (lazy(sprintf "%+0.5M" -7M)) "-7" + test "test8276" (lazy(sprintf "%+0.*M" 4 -7M)) "-7" + test "test8277" (lazy(sprintf "%+0*.*M" 5 4 -7M)) "-0007"//"000-7" + test "test8278" (lazy(sprintf "%-+0M" -7M)) "-7" + test "test8279" (lazy(sprintf "%-+05M" -7M)) "-7 "// "-7000" + test "test8280" (lazy(sprintf "%-+01M" -7M)) "-7" + test "test8281" (lazy(sprintf "%-+0*M" 7 -7M)) "-7 "// "-700000" + test "test8282" (lazy(sprintf "%-+0.5M" -7M)) "-7" + test "test8283" (lazy(sprintf "%-+0.*M" 4 -7M)) "-7" + test "test8284" (lazy(sprintf "%-+0*.*M" 5 4 -7M)) "-7 "//"-7000" + test "test8285" (lazy(sprintf "% M" -7M)) "-7" + test "test8286" (lazy(sprintf "% 5M" -7M)) " -7" + test "test8287" (lazy(sprintf "% 1M" -7M)) "-7" + test "test8288" (lazy(sprintf "% *M" 7 -7M)) " -7" + test "test8289" (lazy(sprintf "% .5M" -7M)) "-7" + test "test8290" (lazy(sprintf "% .*M" 4 -7M)) "-7" + test "test8291" (lazy(sprintf "% *.*M" 5 4 -7M)) " -7" + test "test8292" (lazy(sprintf "%- M" -7M)) "-7" + test "test8293" (lazy(sprintf "%- 5M" -7M)) "-7 " + test "test8294" (lazy(sprintf "%- 1M" -7M)) "-7" + test "test8295" (lazy(sprintf "%- *M" 7 -7M)) "-7 " + test "test8296" (lazy(sprintf "%- .5M" -7M)) "-7" + test "test8297" (lazy(sprintf "%- .*M" 4 -7M)) "-7" + test "test8298" (lazy(sprintf "%- *.*M" 5 4 -7M)) "-7 " + test "test8299" (lazy(sprintf "% 0M" -7M)) "-7" + test "test8300" (lazy(sprintf "% 05M" -7M)) "-0007"//"000-7" + test "test8301" (lazy(sprintf "% 01M" -7M)) "-7" + test "test8302" (lazy(sprintf "% 0*M" 7 -7M)) "-000007"//"00000-7" + test "test8303" (lazy(sprintf "% 0.5M" -7M)) "-7" + test "test8304" (lazy(sprintf "% 0.*M" 4 -7M)) "-7" + test "test8305" (lazy(sprintf "% 0*.*M" 5 4 -7M)) "-0007"// "000-7" + test "test8306" (lazy(sprintf "%- 0M" -7M)) "-7" + test "test8307" (lazy(sprintf "%- 05M" -7M)) "-7 "// "-7000" + test "test8308" (lazy(sprintf "%- 01M" -7M)) "-7" + test "test8309" (lazy(sprintf "%- 0*M" 7 -7M)) "-7 "//"-700000" + test "test8310" (lazy(sprintf "%- 0.5M" -7M)) "-7" + test "test8311" (lazy(sprintf "%- 0.*M" 4 -7M)) "-7" + test "test8312" (lazy(sprintf "%- 0*.*M" 5 4 -7M)) "-7 "///"-7000" + test "test8313" (lazy(sprintf "%O" "abc")) "abc" + test "test8314" (lazy(sprintf "%5O" "abc")) " abc" + test "test8315" (lazy(sprintf "%1O" "abc")) "abc" + test "test8316" (lazy(sprintf "%*O" 7 "abc")) " abc" + test "test8317" (lazy(sprintf "%-O" "abc")) "abc" + test "test8318" (lazy(sprintf "%-5O" "abc")) "abc " + test "test8319" (lazy(sprintf "%-1O" "abc")) "abc" + test "test8320" (lazy(sprintf "%-*O" 7 "abc")) "abc " + test "test8321" (lazy(sprintf "%O" 15)) "15" + test "test8322" (lazy(sprintf "%5O" 15)) " 15" + test "test8323" (lazy(sprintf "%1O" 15)) "15" + test "test8324" (lazy(sprintf "%*O" 7 15)) " 15" + test "test8325" (lazy(sprintf "%-O" 15)) "15" + test "test8326" (lazy(sprintf "%-5O" 15)) "15 " + test "test8327" (lazy(sprintf "%-1O" 15)) "15" + test "test8328" (lazy(sprintf "%-*O" 7 15)) "15 " + test "test8329" (lazy(sprintf "%O" -10)) "-10" + test "test8330" (lazy(sprintf "%5O" -10)) " -10" + test "test8331" (lazy(sprintf "%1O" -10)) "-10" + test "test8332" (lazy(sprintf "%*O" 7 -10)) " -10" + test "test8333" (lazy(sprintf "%-O" -10)) "-10" + test "test8334" (lazy(sprintf "%-5O" -10)) "-10 " + test "test8335" (lazy(sprintf "%-1O" -10)) "-10" + test "test8336" (lazy(sprintf "%-*O" 7 -10)) "-10 " + test "test8337" (lazy(sprintf "%O" null)) "" + test "test8338" (lazy(sprintf "%5O" null)) "" + test "test8339" (lazy(sprintf "%1O" null)) "" + test "test8340" (lazy(sprintf "%*O" 7 null)) " " + test "test8341" (lazy(sprintf "%-O" null)) "" + test "test8342" (lazy(sprintf "%-5O" null)) "" + test "test8343" (lazy(sprintf "%-1O" null)) "" + test "test8344" (lazy(sprintf "%-*O" 7 null)) " " + test "test8345" (lazy(sprintf "%O" 'P')) "P" + test "test8346" (lazy(sprintf "%5O" 'P')) " P" + test "test8347" (lazy(sprintf "%1O" 'P')) "P" + test "test8348" (lazy(sprintf "%*O" 7 'P')) " P" + test "test8349" (lazy(sprintf "%-O" 'P')) "P" + test "test8350" (lazy(sprintf "%-5O" 'P')) "P " + test "test8351" (lazy(sprintf "%-1O" 'P')) "P" + test "test8352" (lazy(sprintf "%-*O" 7 'P')) "P " + test "test8353" (lazy(sprintf "%O" System.IO.FileShare.None)) "None" + test "test8354" (lazy(sprintf "%5O" System.IO.FileShare.None)) " None" + test "test8355" (lazy(sprintf "%1O" System.IO.FileShare.None)) "None" + test "test8356" (lazy(sprintf "%*O" 7 System.IO.FileShare.None)) " None" + test "test8357" (lazy(sprintf "%-O" System.IO.FileShare.None)) "None" + test "test8358" (lazy(sprintf "%-5O" System.IO.FileShare.None)) "None " + test "test8359" (lazy(sprintf "%-1O" System.IO.FileShare.None)) "None" + test "test8360" (lazy(sprintf "%-*O" 7 System.IO.FileShare.None)) "None " + test "test8361" (lazy(sprintf "%A" "abc")) "\"abc\"" + test "test8362" (lazy(sprintf "%5A" "abc")) "\"abc\"" + test "test8363" (lazy(sprintf "%1A" "abc")) "\"abc\"" + test "test8364" (lazy(sprintf "%*A" 7 "abc")) "\"abc\"" + test "test8365" (lazy(sprintf "%.5A" "abc")) "\"abc\"" + test "test8366" (lazy(sprintf "%.*A" 4 "abc")) "\"abc\"" + test "test8367" (lazy(sprintf "%*.*A" 5 4 "abc")) "\"abc\"" + test "test8368" (lazy(sprintf "%-A" "abc")) "\"abc\"" + test "test8369" (lazy(sprintf "%-5A" "abc")) "\"abc\"" + test "test8370" (lazy(sprintf "%-1A" "abc")) "\"abc\"" + test "test8371" (lazy(sprintf "%-*A" 7 "abc")) "\"abc\"" + test "test8372" (lazy(sprintf "%-.5A" "abc")) "\"abc\"" + test "test8373" (lazy(sprintf "%-.*A" 4 "abc")) "\"abc\"" + test "test8374" (lazy(sprintf "%-*.*A" 5 4 "abc")) "\"abc\"" + test "test8375" (lazy(sprintf "%+A" "abc")) "\"abc\"" + test "test8376" (lazy(sprintf "%+5A" "abc")) "\"abc\"" + test "test8377" (lazy(sprintf "%+1A" "abc")) "\"abc\"" + test "test8378" (lazy(sprintf "%+*A" 7 "abc")) "\"abc\"" + test "test8379" (lazy(sprintf "%+.5A" "abc")) "\"abc\"" + test "test8380" (lazy(sprintf "%+.*A" 4 "abc")) "\"abc\"" + test "test8381" (lazy(sprintf "%+*.*A" 5 4 "abc")) "\"abc\"" + test "test8382" (lazy(sprintf "%-+A" "abc")) "\"abc\"" + test "test8383" (lazy(sprintf "%-+5A" "abc")) "\"abc\"" + test "test8384" (lazy(sprintf "%-+1A" "abc")) "\"abc\"" + test "test8385" (lazy(sprintf "%-+*A" 7 "abc")) "\"abc\"" + test "test8386" (lazy(sprintf "%-+.5A" "abc")) "\"abc\"" + test "test8387" (lazy(sprintf "%-+.*A" 4 "abc")) "\"abc\"" + test "test8388" (lazy(sprintf "%-+*.*A" 5 4 "abc")) "\"abc\"" + test "test8389" (lazy(sprintf "%A" 15)) "15" + test "test8390" (lazy(sprintf "%5A" 15)) "15" + test "test8391" (lazy(sprintf "%1A" 15)) "15" + test "test8392" (lazy(sprintf "%*A" 7 15)) "15" + test "test8393" (lazy(sprintf "%.5A" 15)) "15" + test "test8394" (lazy(sprintf "%.*A" 4 15)) "15" + test "test8395" (lazy(sprintf "%*.*A" 5 4 15)) "15" + test "test8396" (lazy(sprintf "%-A" 15)) "15" + test "test8397" (lazy(sprintf "%-5A" 15)) "15" + test "test8398" (lazy(sprintf "%-1A" 15)) "15" + test "test8399" (lazy(sprintf "%-*A" 7 15)) "15" + test "test8400" (lazy(sprintf "%-.5A" 15)) "15" + test "test8401" (lazy(sprintf "%-.*A" 4 15)) "15" + test "test8402" (lazy(sprintf "%-*.*A" 5 4 15)) "15" + test "test8403" (lazy(sprintf "%+A" 15)) "15" + test "test8404" (lazy(sprintf "%+5A" 15)) "15" + test "test8405" (lazy(sprintf "%+1A" 15)) "15" + test "test8406" (lazy(sprintf "%+*A" 7 15)) "15" + test "test8407" (lazy(sprintf "%+.5A" 15)) "15" + test "test8408" (lazy(sprintf "%+.*A" 4 15)) "15" + test "test8409" (lazy(sprintf "%+*.*A" 5 4 15)) "15" + test "test8410" (lazy(sprintf "%-+A" 15)) "15" + test "test8411" (lazy(sprintf "%-+5A" 15)) "15" + test "test8412" (lazy(sprintf "%-+1A" 15)) "15" + test "test8413" (lazy(sprintf "%-+*A" 7 15)) "15" + test "test8414" (lazy(sprintf "%-+.5A" 15)) "15" + test "test8415" (lazy(sprintf "%-+.*A" 4 15)) "15" + test "test8416" (lazy(sprintf "%-+*.*A" 5 4 15)) "15" + test "test8417" (lazy(sprintf "%A" -10)) "-10" + test "test8418" (lazy(sprintf "%5A" -10)) "-10" + test "test8419" (lazy(sprintf "%1A" -10)) "-10" + test "test8420" (lazy(sprintf "%*A" 7 -10)) "-10" + test "test8421" (lazy(sprintf "%.5A" -10)) "-10" + test "test8422" (lazy(sprintf "%.*A" 4 -10)) "-10" + test "test8423" (lazy(sprintf "%*.*A" 5 4 -10)) "-10" + test "test8424" (lazy(sprintf "%-A" -10)) "-10" + test "test8425" (lazy(sprintf "%-5A" -10)) "-10" + test "test8426" (lazy(sprintf "%-1A" -10)) "-10" + test "test8427" (lazy(sprintf "%-*A" 7 -10)) "-10" + test "test8428" (lazy(sprintf "%-.5A" -10)) "-10" + test "test8429" (lazy(sprintf "%-.*A" 4 -10)) "-10" + test "test8430" (lazy(sprintf "%-*.*A" 5 4 -10)) "-10" + test "test8431" (lazy(sprintf "%+A" -10)) "-10" + test "test8432" (lazy(sprintf "%+5A" -10)) "-10" + test "test8433" (lazy(sprintf "%+1A" -10)) "-10" + test "test8434" (lazy(sprintf "%+*A" 7 -10)) "-10" + test "test8435" (lazy(sprintf "%+.5A" -10)) "-10" + test "test8436" (lazy(sprintf "%+.*A" 4 -10)) "-10" + test "test8437" (lazy(sprintf "%+*.*A" 5 4 -10)) "-10" + test "test8438" (lazy(sprintf "%-+A" -10)) "-10" + test "test8439" (lazy(sprintf "%-+5A" -10)) "-10" + test "test8440" (lazy(sprintf "%-+1A" -10)) "-10" + test "test8441" (lazy(sprintf "%-+*A" 7 -10)) "-10" + test "test8442" (lazy(sprintf "%-+.5A" -10)) "-10" + test "test8443" (lazy(sprintf "%-+.*A" 4 -10)) "-10" + test "test8444" (lazy(sprintf "%-+*.*A" 5 4 -10)) "-10" + test "test8445" (lazy(sprintf "%A" null)) "" + test "test8446" (lazy(sprintf "%5A" null)) "" + test "test8447" (lazy(sprintf "%1A" null)) "" + test "test8448" (lazy(sprintf "%*A" 7 null)) "" + test "test8449" (lazy(sprintf "%.5A" null)) "" + test "test8450" (lazy(sprintf "%.*A" 4 null)) "" + test "test8451" (lazy(sprintf "%*.*A" 5 4 null)) "" + test "test8452" (lazy(sprintf "%-A" null)) "" + test "test8453" (lazy(sprintf "%-5A" null)) "" + test "test8454" (lazy(sprintf "%-1A" null)) "" + test "test8455" (lazy(sprintf "%-*A" 7 null)) "" + test "test8456" (lazy(sprintf "%-.5A" null)) "" + test "test8457" (lazy(sprintf "%-.*A" 4 null)) "" + test "test8458" (lazy(sprintf "%-*.*A" 5 4 null)) "" + test "test8459" (lazy(sprintf "%+A" null)) "" + test "test8460" (lazy(sprintf "%+5A" null)) "" + test "test8461" (lazy(sprintf "%+1A" null)) "" + test "test8462" (lazy(sprintf "%+*A" 7 null)) "" + test "test8463" (lazy(sprintf "%+.5A" null)) "" + test "test8464" (lazy(sprintf "%+.*A" 4 null)) "" + test "test8465" (lazy(sprintf "%+*.*A" 5 4 null)) "" + test "test8466" (lazy(sprintf "%-+A" null)) "" + test "test8467" (lazy(sprintf "%-+5A" null)) "" + test "test8468" (lazy(sprintf "%-+1A" null)) "" + test "test8469" (lazy(sprintf "%-+*A" 7 null)) "" + test "test8470" (lazy(sprintf "%-+.5A" null)) "" + test "test8471" (lazy(sprintf "%-+.*A" 4 null)) "" + test "test8472" (lazy(sprintf "%-+*.*A" 5 4 null)) "" + test "test8473" (lazy(sprintf "%A" 'P')) "'P'" + test "test8474" (lazy(sprintf "%5A" 'P')) "'P'" + test "test8475" (lazy(sprintf "%1A" 'P')) "'P'" + test "test8476" (lazy(sprintf "%*A" 7 'P')) "'P'" + test "test8477" (lazy(sprintf "%.5A" 'P')) "'P'" + test "test8478" (lazy(sprintf "%.*A" 4 'P')) "'P'" + test "test8479" (lazy(sprintf "%*.*A" 5 4 'P')) "'P'" + test "test8480" (lazy(sprintf "%-A" 'P')) "'P'" + test "test8481" (lazy(sprintf "%-5A" 'P')) "'P'" + test "test8482" (lazy(sprintf "%-1A" 'P')) "'P'" + test "test8483" (lazy(sprintf "%-*A" 7 'P')) "'P'" + test "test8484" (lazy(sprintf "%-.5A" 'P')) "'P'" + test "test8485" (lazy(sprintf "%-.*A" 4 'P')) "'P'" + test "test8486" (lazy(sprintf "%-*.*A" 5 4 'P')) "'P'" + test "test8487" (lazy(sprintf "%+A" 'P')) "'P'" + test "test8488" (lazy(sprintf "%+5A" 'P')) "'P'" + test "test8489" (lazy(sprintf "%+1A" 'P')) "'P'" + test "test8490" (lazy(sprintf "%+*A" 7 'P')) "'P'" + test "test8491" (lazy(sprintf "%+.5A" 'P')) "'P'" + test "test8492" (lazy(sprintf "%+.*A" 4 'P')) "'P'" + test "test8493" (lazy(sprintf "%+*.*A" 5 4 'P')) "'P'" + test "test8494" (lazy(sprintf "%-+A" 'P')) "'P'" + test "test8495" (lazy(sprintf "%-+5A" 'P')) "'P'" + test "test8496" (lazy(sprintf "%-+1A" 'P')) "'P'" + test "test8497" (lazy(sprintf "%-+*A" 7 'P')) "'P'" + test "test8498" (lazy(sprintf "%-+.5A" 'P')) "'P'" + test "test8499" (lazy(sprintf "%-+.*A" 4 'P')) "'P'" + test "test8500" (lazy(sprintf "%-+*.*A" 5 4 'P')) "'P'" + test "test8501" (lazy(sprintf "%A" System.IO.FileShare.None)) "None" + test "test8502" (lazy(sprintf "%5A" System.IO.FileShare.None)) "None" + test "test8503" (lazy(sprintf "%1A" System.IO.FileShare.None)) "None" + test "test8504" (lazy(sprintf "%*A" 7 System.IO.FileShare.None)) "None" + test "test8505" (lazy(sprintf "%.5A" System.IO.FileShare.None)) "None" + test "test8506" (lazy(sprintf "%.*A" 4 System.IO.FileShare.None)) "None" + test "test8507" (lazy(sprintf "%*.*A" 5 4 System.IO.FileShare.None)) "None" + test "test8508" (lazy(sprintf "%-A" System.IO.FileShare.None)) "None" + test "test8509" (lazy(sprintf "%-5A" System.IO.FileShare.None)) "None" + test "test8510" (lazy(sprintf "%-1A" System.IO.FileShare.None)) "None" + test "test8511" (lazy(sprintf "%-*A" 7 System.IO.FileShare.None)) "None" + test "test8512" (lazy(sprintf "%-.5A" System.IO.FileShare.None)) "None" + test "test8513" (lazy(sprintf "%-.*A" 4 System.IO.FileShare.None)) "None" + test "test8514" (lazy(sprintf "%-*.*A" 5 4 System.IO.FileShare.None)) "None" + test "test8515" (lazy(sprintf "%+A" System.IO.FileShare.None)) "None" + test "test8516" (lazy(sprintf "%+5A" System.IO.FileShare.None)) "None" + test "test8517" (lazy(sprintf "%+1A" System.IO.FileShare.None)) "None" + test "test8518" (lazy(sprintf "%+*A" 7 System.IO.FileShare.None)) "None" + test "test8519" (lazy(sprintf "%+.5A" System.IO.FileShare.None)) "None" + test "test8520" (lazy(sprintf "%+.*A" 4 System.IO.FileShare.None)) "None" + test "test8521" (lazy(sprintf "%+*.*A" 5 4 System.IO.FileShare.None)) "None" + test "test8522" (lazy(sprintf "%-+A" System.IO.FileShare.None)) "None" + test "test8523" (lazy(sprintf "%-+5A" System.IO.FileShare.None)) "None" + test "test8524" (lazy(sprintf "%-+1A" System.IO.FileShare.None)) "None" + test "test8525" (lazy(sprintf "%-+*A" 7 System.IO.FileShare.None)) "None" + test "test8526" (lazy(sprintf "%-+.5A" System.IO.FileShare.None)) "None" + test "test8527" (lazy(sprintf "%-+.*A" 4 System.IO.FileShare.None)) "None" + test "test8528" (lazy(sprintf "%-+*.*A" 5 4 System.IO.FileShare.None)) "None" + test "test8529" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") "abc")) "abc!!!" + test "test8530" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") 15)) "15!!!" + test "test8531" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") -10)) "-10!!!" + test "test8532" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") null)) "!!!" + test "test8533" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") 'P')) "P!!!" + test "test8534" (lazy(sprintf "%a" (fun _ s -> (string s) + "!!!") System.IO.FileShare.None)) "None!!!" + test "test8535" (lazy(sprintf "%t" (fun _ -> "???"))) "???" + test "test8536" (lazy(sprintf "A%dB" 0)) "A0B" + test "test8537" (lazy(sprintf "A%dB%dC" 0 1)) "A0B1C" + test "test8538" (lazy(sprintf "A%dB%dC%dD" 0 1 2)) "A0B1C2D" + test "test8539" (lazy(sprintf "A%dB%dC%dD%dE" 0 1 2 3)) "A0B1C2D3E" + test "test8540" (lazy(sprintf "A%dB%dC%dD%dE%dF" 0 1 2 3 4)) "A0B1C2D3E4F" + test "test8541" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG" 0 1 2 3 4 5)) "A0B1C2D3E4F5G" + test "test8542" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH" 0 1 2 3 4 5 6)) "A0B1C2D3E4F5G6H" + test "test8543" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI" 0 1 2 3 4 5 6 7)) "A0B1C2D3E4F5G6H7I" + test "test8544" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ" 0 1 2 3 4 5 6 7 8)) "A0B1C2D3E4F5G6H7I8J" + test "test8545" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK" 0 1 2 3 4 5 6 7 8 9)) "A0B1C2D3E4F5G6H7I8J9K" + test "test8546" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL" 0 1 2 3 4 5 6 7 8 9 10)) "A0B1C2D3E4F5G6H7I8J9K10L" + test "test8547" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM" 0 1 2 3 4 5 6 7 8 9 10 11)) "A0B1C2D3E4F5G6H7I8J9K10L11M" + test "test8548" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN" 0 1 2 3 4 5 6 7 8 9 10 11 12)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N" + test "test8549" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO" 0 1 2 3 4 5 6 7 8 9 10 11 12 13)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O" + test "test8550" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P" + test "test8551" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP%dQ" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q" + test "test8552" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP%dQ%dR" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R" + test "test8553" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP%dQ%dR%dS" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S" + test "test8554" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP%dQ%dR%dS%dT" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S18T" + test "test8555" (lazy(sprintf "A%dB%dC%dD%dE%dF%dG%dH%dI%dJ%dK%dL%dM%dN%dO%dP%dQ%dR%dS%dT%dU" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S18T19U" + test "test8556" (lazy(sprintf "A%aB" (fun _ v -> string v) 0)) "A0B" + test "test8557" (lazy(sprintf "A%aB%aC" (fun _ v -> string v) 0 (fun _ v -> string v) 1)) "A0B1C" + test "test8558" (lazy(sprintf "A%aB%aC%aD" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2)) "A0B1C2D" + test "test8559" (lazy(sprintf "A%aB%aC%aD%aE" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3)) "A0B1C2D3E" + test "test8560" (lazy(sprintf "A%aB%aC%aD%aE%aF" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4)) "A0B1C2D3E4F" + test "test8561" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5)) "A0B1C2D3E4F5G" + test "test8562" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6)) "A0B1C2D3E4F5G6H" + test "test8563" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7)) "A0B1C2D3E4F5G6H7I" + test "test8564" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8)) "A0B1C2D3E4F5G6H7I8J" + test "test8565" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9)) "A0B1C2D3E4F5G6H7I8J9K" + test "test8566" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10)) "A0B1C2D3E4F5G6H7I8J9K10L" + test "test8567" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11)) "A0B1C2D3E4F5G6H7I8J9K10L11M" + test "test8568" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N" + test "test8569" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O" + test "test8570" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P" + test "test8571" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP%aQ" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14 (fun _ v -> string v) 15)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q" + test "test8572" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP%aQ%aR" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14 (fun _ v -> string v) 15 (fun _ v -> string v) 16)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R" + test "test8573" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP%aQ%aR%aS" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14 (fun _ v -> string v) 15 (fun _ v -> string v) 16 (fun _ v -> string v) 17)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S" + test "test8574" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP%aQ%aR%aS%aT" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14 (fun _ v -> string v) 15 (fun _ v -> string v) 16 (fun _ v -> string v) 17 (fun _ v -> string v) 18)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S18T" + test "test8575" (lazy(sprintf "A%aB%aC%aD%aE%aF%aG%aH%aI%aJ%aK%aL%aM%aN%aO%aP%aQ%aR%aS%aT%aU" (fun _ v -> string v) 0 (fun _ v -> string v) 1 (fun _ v -> string v) 2 (fun _ v -> string v) 3 (fun _ v -> string v) 4 (fun _ v -> string v) 5 (fun _ v -> string v) 6 (fun _ v -> string v) 7 (fun _ v -> string v) 8 (fun _ v -> string v) 9 (fun _ v -> string v) 10 (fun _ v -> string v) 11 (fun _ v -> string v) 12 (fun _ v -> string v) 13 (fun _ v -> string v) 14 (fun _ v -> string v) 15 (fun _ v -> string v) 16 (fun _ v -> string v) 17 (fun _ v -> string v) 18 (fun _ v -> string v) 19)) "A0B1C2D3E4F5G6H7I8J9K10L11M12N13O14P15Q16R17S18T19U" + test "test8576" (lazy(sprintf "01-00%d01-01%a11-10%d11-11" 0 (fun _ v -> (string v) + "X") 1 10 )) "01-00001-011X11-101011-11" + test "test8577" (lazy(sprintf "01-00%d01-01%a11-10%d11-11%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-011X11-101011-11ReadX_TAIL" + test "test8578" (lazy(sprintf "01-00%d01-01%d01-02%a11-10%d11-11%d11-12" 0 1 (fun _ v -> (string v) + "X") 1 10 11 )) "01-00001-01101-021X11-101011-111111-12" + test "test8579" (lazy(sprintf "01-00%d01-01%d01-02%a11-10%d11-11%d11-12%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-021X11-101011-111111-12ReadX_TAIL" + test "test8580" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%a11-10%d11-11%d11-12%d11-13" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 )) "01-00001-01101-02201-031X11-101011-111111-121211-13" + test "test8581" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%a11-10%d11-11%d11-12%d11-13%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-02201-031X11-101011-111111-121211-13ReadX_TAIL" + test "test8582" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%a11-10%d11-11%d11-12%d11-13%d11-14" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 )) "01-00001-01101-02201-03301-041X11-101011-111111-121211-131311-14" + test "test8583" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%a11-10%d11-11%d11-12%d11-13%d11-14%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-041X11-101011-111111-121211-131311-14ReadX_TAIL" + test "test8584" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 )) "01-00001-01101-02201-03301-04401-051X11-101011-111111-121211-131311-141411-15" + test "test8585" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-04401-051X11-101011-111111-121211-131311-141411-15ReadX_TAIL" + test "test8586" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 )) "01-00001-01101-02201-03301-04401-05501-061X11-101011-111111-121211-131311-141411-151511-16" + test "test8587" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-04401-05501-061X11-101011-111111-121211-131311-141411-151511-16ReadX_TAIL" + test "test8588" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 )) "01-00001-01101-02201-03301-04401-05501-06601-071X11-101011-111111-121211-131311-141411-151511-161611-17" + test "test8589" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-04401-05501-06601-071X11-101011-111111-121211-131311-141411-151511-161611-17ReadX_TAIL" + test "test8590" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%d01-08%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17%d11-18" 0 1 2 3 4 5 6 7 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 )) "01-00001-01101-02201-03301-04401-05501-06601-07701-081X11-101011-111111-121211-131311-141411-151511-161611-171711-18" + test "test8591" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%d01-08%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17%d11-18%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") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-04401-05501-06601-07701-081X11-101011-111111-121211-131311-141411-151511-161611-171711-18ReadX_TAIL" + test "test8592" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%d01-08%d01-09%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17%d11-18%d11-19" 0 1 2 3 4 5 6 7 8 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 18 )) "01-00001-01101-02201-03301-04401-05501-06601-07701-08801-091X11-101011-111111-121211-131311-141411-151511-161611-171711-181811-19" + test "test8593" (lazy(sprintf "01-00%d01-01%d01-02%d01-03%d01-04%d01-05%d01-06%d01-07%d01-08%d01-09%a11-10%d11-11%d11-12%d11-13%d11-14%d11-15%d11-16%d11-17%d11-18%d11-19%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") System.IO.FileShare.Read )) "01-00001-01101-02201-03301-04401-05501-06601-07701-08801-091X11-101011-111111-121211-131311-141411-151511-161611-171711-181811-19ReadX_TAIL" + test "test8594" (lazy(sprintf "02-00%d02-01%a12-10%d12-11%a22-20%d22-21" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 )) "02-00002-011X12-101012-112X22-202022-21" + test "test8595" (lazy(sprintf "02-00%d02-01%a12-10%d12-11%a22-20%d22-21%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-011X12-101012-112X22-202022-21ReadX_TAIL" + test "test8596" (lazy(sprintf "02-00%d02-01%d02-02%a12-10%d12-11%d12-12%a22-20%d22-21%d22-22" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 )) "02-00002-01102-021X12-101012-111112-122X22-202022-212122-22" + test "test8597" (lazy(sprintf "02-00%d02-01%d02-02%a12-10%d12-11%d12-12%a22-20%d22-21%d22-22%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-021X12-101012-111112-122X22-202022-212122-22ReadX_TAIL" + test "test8598" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%a12-10%d12-11%d12-12%d12-13%a22-20%d22-21%d22-22%d22-23" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 )) "02-00002-01102-02202-031X12-101012-111112-121212-132X22-202022-212122-222222-23" + test "test8599" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%a12-10%d12-11%d12-12%d12-13%a22-20%d22-21%d22-22%d22-23%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-02202-031X12-101012-111112-121212-132X22-202022-212122-222222-23ReadX_TAIL" + test "test8600" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%a12-10%d12-11%d12-12%d12-13%d12-14%a22-20%d22-21%d22-22%d22-23%d22-24" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 )) "02-00002-01102-02202-03302-041X12-101012-111112-121212-131312-142X22-202022-212122-222222-232322-24" + test "test8601" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%a12-10%d12-11%d12-12%d12-13%d12-14%a22-20%d22-21%d22-22%d22-23%d22-24%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-041X12-101012-111112-121212-131312-142X22-202022-212122-222222-232322-24ReadX_TAIL" + test "test8602" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 )) "02-00002-01102-02202-03302-04402-051X12-101012-111112-121212-131312-141412-152X22-202022-212122-222222-232322-242422-25" + test "test8603" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-04402-051X12-101012-111112-121212-131312-141412-152X22-202022-212122-222222-232322-242422-25ReadX_TAIL" + test "test8604" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 )) "02-00002-01102-02202-03302-04402-05502-061X12-101012-111112-121212-131312-141412-151512-162X22-202022-212122-222222-232322-242422-252522-26" + test "test8605" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-04402-05502-061X12-101012-111112-121212-131312-141412-151512-162X22-202022-212122-222222-232322-242422-252522-26ReadX_TAIL" + test "test8606" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 )) "02-00002-01102-02202-03302-04402-05502-06602-071X12-101012-111112-121212-131312-141412-151512-161612-172X22-202022-212122-222222-232322-242422-252522-262622-27" + test "test8607" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-04402-05502-06602-071X12-101012-111112-121212-131312-141412-151512-161612-172X22-202022-212122-222222-232322-242422-252522-262622-27ReadX_TAIL" + test "test8608" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%d02-08%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%d12-18%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27%d22-28" 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 )) "02-00002-01102-02202-03302-04402-05502-06602-07702-081X12-101012-111112-121212-131312-141412-151512-161612-171712-182X22-202022-212122-222222-232322-242422-252522-262622-272722-28" + test "test8609" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%d02-08%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%d12-18%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27%d22-28%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") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-04402-05502-06602-07702-081X12-101012-111112-121212-131312-141412-151512-161612-171712-182X22-202022-212122-222222-232322-242422-252522-262622-272722-28ReadX_TAIL" + test "test8610" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%d02-08%d02-09%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%d12-18%d12-19%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27%d22-28%d22-29" 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 )) "02-00002-01102-02202-03302-04402-05502-06602-07702-08802-091X12-101012-111112-121212-131312-141412-151512-161612-171712-181812-192X22-202022-212122-222222-232322-242422-252522-262622-272722-282822-29" + test "test8611" (lazy(sprintf "02-00%d02-01%d02-02%d02-03%d02-04%d02-05%d02-06%d02-07%d02-08%d02-09%a12-10%d12-11%d12-12%d12-13%d12-14%d12-15%d12-16%d12-17%d12-18%d12-19%a22-20%d22-21%d22-22%d22-23%d22-24%d22-25%d22-26%d22-27%d22-28%d22-29%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") System.IO.FileShare.Read )) "02-00002-01102-02202-03302-04402-05502-06602-07702-08802-091X12-101012-111112-121212-131312-141412-151512-161612-171712-181812-192X22-202022-212122-222222-232322-242422-252522-262622-272722-282822-29ReadX_TAIL" + test "test8612" (lazy(sprintf "03-00%d03-01%a13-10%d13-11%a23-20%d23-21%a33-30%d33-31" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 )) "03-00003-011X13-101013-112X23-202023-213X33-303033-31" + test "test8613" (lazy(sprintf "03-00%d03-01%a13-10%d13-11%a23-20%d23-21%a33-30%d33-31%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-011X13-101013-112X23-202023-213X33-303033-31ReadX_TAIL" + test "test8614" (lazy(sprintf "03-00%d03-01%d03-02%a13-10%d13-11%d13-12%a23-20%d23-21%d23-22%a33-30%d33-31%d33-32" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 )) "03-00003-01103-021X13-101013-111113-122X23-202023-212123-223X33-303033-313133-32" + test "test8615" (lazy(sprintf "03-00%d03-01%d03-02%a13-10%d13-11%d13-12%a23-20%d23-21%d23-22%a33-30%d33-31%d33-32%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-021X13-101013-111113-122X23-202023-212123-223X33-303033-313133-32ReadX_TAIL" + test "test8616" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%a13-10%d13-11%d13-12%d13-13%a23-20%d23-21%d23-22%d23-23%a33-30%d33-31%d33-32%d33-33" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 )) "03-00003-01103-02203-031X13-101013-111113-121213-132X23-202023-212123-222223-233X33-303033-313133-323233-33" + test "test8617" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%a13-10%d13-11%d13-12%d13-13%a23-20%d23-21%d23-22%d23-23%a33-30%d33-31%d33-32%d33-33%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-02203-031X13-101013-111113-121213-132X23-202023-212123-222223-233X33-303033-313133-323233-33ReadX_TAIL" + test "test8618" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%a13-10%d13-11%d13-12%d13-13%d13-14%a23-20%d23-21%d23-22%d23-23%d23-24%a33-30%d33-31%d33-32%d33-33%d33-34" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 )) "03-00003-01103-02203-03303-041X13-101013-111113-121213-131313-142X23-202023-212123-222223-232323-243X33-303033-313133-323233-333333-34" + test "test8619" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%a13-10%d13-11%d13-12%d13-13%d13-14%a23-20%d23-21%d23-22%d23-23%d23-24%a33-30%d33-31%d33-32%d33-33%d33-34%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-041X13-101013-111113-121213-131313-142X23-202023-212123-222223-232323-243X33-303033-313133-323233-333333-34ReadX_TAIL" + test "test8620" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 )) "03-00003-01103-02203-03303-04403-051X13-101013-111113-121213-131313-141413-152X23-202023-212123-222223-232323-242423-253X33-303033-313133-323233-333333-343433-35" + test "test8621" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-04403-051X13-101013-111113-121213-131313-141413-152X23-202023-212123-222223-232323-242423-253X33-303033-313133-323233-333333-343433-35ReadX_TAIL" + test "test8622" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 )) "03-00003-01103-02203-03303-04403-05503-061X13-101013-111113-121213-131313-141413-151513-162X23-202023-212123-222223-232323-242423-252523-263X33-303033-313133-323233-333333-343433-353533-36" + test "test8623" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-04403-05503-061X13-101013-111113-121213-131313-141413-151513-162X23-202023-212123-222223-232323-242423-252523-263X33-303033-313133-323233-333333-343433-353533-36ReadX_TAIL" + test "test8624" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 )) "03-00003-01103-02203-03303-04403-05503-06603-071X13-101013-111113-121213-131313-141413-151513-161613-172X23-202023-212123-222223-232323-242423-252523-262623-273X33-303033-313133-323233-333333-343433-353533-363633-37" + test "test8625" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-04403-05503-06603-071X13-101013-111113-121213-131313-141413-151513-161613-172X23-202023-212123-222223-232323-242423-252523-262623-273X33-303033-313133-323233-333333-343433-353533-363633-37ReadX_TAIL" + test "test8626" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%d03-08%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%d13-18%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%d23-28%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37%d33-38" 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 )) "03-00003-01103-02203-03303-04403-05503-06603-07703-081X13-101013-111113-121213-131313-141413-151513-161613-171713-182X23-202023-212123-222223-232323-242423-252523-262623-272723-283X33-303033-313133-323233-333333-343433-353533-363633-373733-38" + test "test8627" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%d03-08%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%d13-18%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%d23-28%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37%d33-38%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") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-04403-05503-06603-07703-081X13-101013-111113-121213-131313-141413-151513-161613-171713-182X23-202023-212123-222223-232323-242423-252523-262623-272723-283X33-303033-313133-323233-333333-343433-353533-363633-373733-38ReadX_TAIL" + test "test8628" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%d03-08%d03-09%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%d13-18%d13-19%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%d23-28%d23-29%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37%d33-38%d33-39" 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 )) "03-00003-01103-02203-03303-04403-05503-06603-07703-08803-091X13-101013-111113-121213-131313-141413-151513-161613-171713-181813-192X23-202023-212123-222223-232323-242423-252523-262623-272723-282823-293X33-303033-313133-323233-333333-343433-353533-363633-373733-383833-39" + test "test8629" (lazy(sprintf "03-00%d03-01%d03-02%d03-03%d03-04%d03-05%d03-06%d03-07%d03-08%d03-09%a13-10%d13-11%d13-12%d13-13%d13-14%d13-15%d13-16%d13-17%d13-18%d13-19%a23-20%d23-21%d23-22%d23-23%d23-24%d23-25%d23-26%d23-27%d23-28%d23-29%a33-30%d33-31%d33-32%d33-33%d33-34%d33-35%d33-36%d33-37%d33-38%d33-39%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") System.IO.FileShare.Read )) "03-00003-01103-02203-03303-04403-05503-06603-07703-08803-091X13-101013-111113-121213-131313-141413-151513-161613-171713-181813-192X23-202023-212123-222223-232323-242423-252523-262623-272723-282823-293X33-303033-313133-323233-333333-343433-353533-363633-373733-383833-39ReadX_TAIL" + test "test8630" (lazy(sprintf "04-00%d04-01%a14-10%d14-11%a24-20%d24-21%a34-30%d34-31%a44-40%d44-41" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 )) "04-00004-011X14-101014-112X24-202024-213X34-303034-314X44-404044-41" + test "test8631" (lazy(sprintf "04-00%d04-01%a14-10%d14-11%a24-20%d24-21%a34-30%d34-31%a44-40%d44-41%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-011X14-101014-112X24-202024-213X34-303034-314X44-404044-41ReadX_TAIL" + test "test8632" (lazy(sprintf "04-00%d04-01%d04-02%a14-10%d14-11%d14-12%a24-20%d24-21%d24-22%a34-30%d34-31%d34-32%a44-40%d44-41%d44-42" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 )) "04-00004-01104-021X14-101014-111114-122X24-202024-212124-223X34-303034-313134-324X44-404044-414144-42" + test "test8633" (lazy(sprintf "04-00%d04-01%d04-02%a14-10%d14-11%d14-12%a24-20%d24-21%d24-22%a34-30%d34-31%d34-32%a44-40%d44-41%d44-42%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-021X14-101014-111114-122X24-202024-212124-223X34-303034-313134-324X44-404044-414144-42ReadX_TAIL" + test "test8634" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%a14-10%d14-11%d14-12%d14-13%a24-20%d24-21%d24-22%d24-23%a34-30%d34-31%d34-32%d34-33%a44-40%d44-41%d44-42%d44-43" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 )) "04-00004-01104-02204-031X14-101014-111114-121214-132X24-202024-212124-222224-233X34-303034-313134-323234-334X44-404044-414144-424244-43" + test "test8635" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%a14-10%d14-11%d14-12%d14-13%a24-20%d24-21%d24-22%d24-23%a34-30%d34-31%d34-32%d34-33%a44-40%d44-41%d44-42%d44-43%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-02204-031X14-101014-111114-121214-132X24-202024-212124-222224-233X34-303034-313134-323234-334X44-404044-414144-424244-43ReadX_TAIL" + test "test8636" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%a14-10%d14-11%d14-12%d14-13%d14-14%a24-20%d24-21%d24-22%d24-23%d24-24%a34-30%d34-31%d34-32%d34-33%d34-34%a44-40%d44-41%d44-42%d44-43%d44-44" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 )) "04-00004-01104-02204-03304-041X14-101014-111114-121214-131314-142X24-202024-212124-222224-232324-243X34-303034-313134-323234-333334-344X44-404044-414144-424244-434344-44" + test "test8637" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%a14-10%d14-11%d14-12%d14-13%d14-14%a24-20%d24-21%d24-22%d24-23%d24-24%a34-30%d34-31%d34-32%d34-33%d34-34%a44-40%d44-41%d44-42%d44-43%d44-44%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-041X14-101014-111114-121214-131314-142X24-202024-212124-222224-232324-243X34-303034-313134-323234-333334-344X44-404044-414144-424244-434344-44ReadX_TAIL" + test "test8638" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 )) "04-00004-01104-02204-03304-04404-051X14-101014-111114-121214-131314-141414-152X24-202024-212124-222224-232324-242424-253X34-303034-313134-323234-333334-343434-354X44-404044-414144-424244-434344-444444-45" + test "test8639" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-04404-051X14-101014-111114-121214-131314-141414-152X24-202024-212124-222224-232324-242424-253X34-303034-313134-323234-333334-343434-354X44-404044-414144-424244-434344-444444-45ReadX_TAIL" + test "test8640" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 )) "04-00004-01104-02204-03304-04404-05504-061X14-101014-111114-121214-131314-141414-151514-162X24-202024-212124-222224-232324-242424-252524-263X34-303034-313134-323234-333334-343434-353534-364X44-404044-414144-424244-434344-444444-454544-46" + test "test8641" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-04404-05504-061X14-101014-111114-121214-131314-141414-151514-162X24-202024-212124-222224-232324-242424-252524-263X34-303034-313134-323234-333334-343434-353534-364X44-404044-414144-424244-434344-444444-454544-46ReadX_TAIL" + test "test8642" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 )) "04-00004-01104-02204-03304-04404-05504-06604-071X14-101014-111114-121214-131314-141414-151514-161614-172X24-202024-212124-222224-232324-242424-252524-262624-273X34-303034-313134-323234-333334-343434-353534-363634-374X44-404044-414144-424244-434344-444444-454544-464644-47" + test "test8643" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-04404-05504-06604-071X14-101014-111114-121214-131314-141414-151514-161614-172X24-202024-212124-222224-232324-242424-252524-262624-273X34-303034-313134-323234-333334-343434-353534-363634-374X44-404044-414144-424244-434344-444444-454544-464644-47ReadX_TAIL" + test "test8644" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%d04-08%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%d14-18%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%d24-28%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%d34-38%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47%d44-48" 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 )) "04-00004-01104-02204-03304-04404-05504-06604-07704-081X14-101014-111114-121214-131314-141414-151514-161614-171714-182X24-202024-212124-222224-232324-242424-252524-262624-272724-283X34-303034-313134-323234-333334-343434-353534-363634-373734-384X44-404044-414144-424244-434344-444444-454544-464644-474744-48" + test "test8645" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%d04-08%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%d14-18%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%d24-28%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%d34-38%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47%d44-48%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") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-04404-05504-06604-07704-081X14-101014-111114-121214-131314-141414-151514-161614-171714-182X24-202024-212124-222224-232324-242424-252524-262624-272724-283X34-303034-313134-323234-333334-343434-353534-363634-373734-384X44-404044-414144-424244-434344-444444-454544-464644-474744-48ReadX_TAIL" + test "test8646" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%d04-08%d04-09%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%d14-18%d14-19%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%d24-28%d24-29%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%d34-38%d34-39%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47%d44-48%d44-49" 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 )) "04-00004-01104-02204-03304-04404-05504-06604-07704-08804-091X14-101014-111114-121214-131314-141414-151514-161614-171714-181814-192X24-202024-212124-222224-232324-242424-252524-262624-272724-282824-293X34-303034-313134-323234-333334-343434-353534-363634-373734-383834-394X44-404044-414144-424244-434344-444444-454544-464644-474744-484844-49" + test "test8647" (lazy(sprintf "04-00%d04-01%d04-02%d04-03%d04-04%d04-05%d04-06%d04-07%d04-08%d04-09%a14-10%d14-11%d14-12%d14-13%d14-14%d14-15%d14-16%d14-17%d14-18%d14-19%a24-20%d24-21%d24-22%d24-23%d24-24%d24-25%d24-26%d24-27%d24-28%d24-29%a34-30%d34-31%d34-32%d34-33%d34-34%d34-35%d34-36%d34-37%d34-38%d34-39%a44-40%d44-41%d44-42%d44-43%d44-44%d44-45%d44-46%d44-47%d44-48%d44-49%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") System.IO.FileShare.Read )) "04-00004-01104-02204-03304-04404-05504-06604-07704-08804-091X14-101014-111114-121214-131314-141414-151514-161614-171714-181814-192X24-202024-212124-222224-232324-242424-252524-262624-272724-282824-293X34-303034-313134-323234-333334-343434-353534-363634-373734-383834-394X44-404044-414144-424244-434344-444444-454544-464644-474744-484844-49ReadX_TAIL" + test "test8648" (lazy(sprintf "05-00%d05-01%a15-10%d15-11%a25-20%d25-21%a35-30%d35-31%a45-40%d45-41%a55-50%d55-51" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 )) "05-00005-011X15-101015-112X25-202025-213X35-303035-314X45-404045-415X55-505055-51" + test "test8649" (lazy(sprintf "05-00%d05-01%a15-10%d15-11%a25-20%d25-21%a35-30%d35-31%a45-40%d45-41%a55-50%d55-51%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-011X15-101015-112X25-202025-213X35-303035-314X45-404045-415X55-505055-51ReadX_TAIL" + test "test8650" (lazy(sprintf "05-00%d05-01%d05-02%a15-10%d15-11%d15-12%a25-20%d25-21%d25-22%a35-30%d35-31%d35-32%a45-40%d45-41%d45-42%a55-50%d55-51%d55-52" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 )) "05-00005-01105-021X15-101015-111115-122X25-202025-212125-223X35-303035-313135-324X45-404045-414145-425X55-505055-515155-52" + test "test8651" (lazy(sprintf "05-00%d05-01%d05-02%a15-10%d15-11%d15-12%a25-20%d25-21%d25-22%a35-30%d35-31%d35-32%a45-40%d45-41%d45-42%a55-50%d55-51%d55-52%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-021X15-101015-111115-122X25-202025-212125-223X35-303035-313135-324X45-404045-414145-425X55-505055-515155-52ReadX_TAIL" + test "test8652" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%a15-10%d15-11%d15-12%d15-13%a25-20%d25-21%d25-22%d25-23%a35-30%d35-31%d35-32%d35-33%a45-40%d45-41%d45-42%d45-43%a55-50%d55-51%d55-52%d55-53" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 )) "05-00005-01105-02205-031X15-101015-111115-121215-132X25-202025-212125-222225-233X35-303035-313135-323235-334X45-404045-414145-424245-435X55-505055-515155-525255-53" + test "test8653" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%a15-10%d15-11%d15-12%d15-13%a25-20%d25-21%d25-22%d25-23%a35-30%d35-31%d35-32%d35-33%a45-40%d45-41%d45-42%d45-43%a55-50%d55-51%d55-52%d55-53%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-02205-031X15-101015-111115-121215-132X25-202025-212125-222225-233X35-303035-313135-323235-334X45-404045-414145-424245-435X55-505055-515155-525255-53ReadX_TAIL" + test "test8654" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%a15-10%d15-11%d15-12%d15-13%d15-14%a25-20%d25-21%d25-22%d25-23%d25-24%a35-30%d35-31%d35-32%d35-33%d35-34%a45-40%d45-41%d45-42%d45-43%d45-44%a55-50%d55-51%d55-52%d55-53%d55-54" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 )) "05-00005-01105-02205-03305-041X15-101015-111115-121215-131315-142X25-202025-212125-222225-232325-243X35-303035-313135-323235-333335-344X45-404045-414145-424245-434345-445X55-505055-515155-525255-535355-54" + test "test8655" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%a15-10%d15-11%d15-12%d15-13%d15-14%a25-20%d25-21%d25-22%d25-23%d25-24%a35-30%d35-31%d35-32%d35-33%d35-34%a45-40%d45-41%d45-42%d45-43%d45-44%a55-50%d55-51%d55-52%d55-53%d55-54%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-041X15-101015-111115-121215-131315-142X25-202025-212125-222225-232325-243X35-303035-313135-323235-333335-344X45-404045-414145-424245-434345-445X55-505055-515155-525255-535355-54ReadX_TAIL" + test "test8656" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 )) "05-00005-01105-02205-03305-04405-051X15-101015-111115-121215-131315-141415-152X25-202025-212125-222225-232325-242425-253X35-303035-313135-323235-333335-343435-354X45-404045-414145-424245-434345-444445-455X55-505055-515155-525255-535355-545455-55" + test "test8657" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-04405-051X15-101015-111115-121215-131315-141415-152X25-202025-212125-222225-232325-242425-253X35-303035-313135-323235-333335-343435-354X45-404045-414145-424245-434345-444445-455X55-505055-515155-525255-535355-545455-55ReadX_TAIL" + test "test8658" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 )) "05-00005-01105-02205-03305-04405-05505-061X15-101015-111115-121215-131315-141415-151515-162X25-202025-212125-222225-232325-242425-252525-263X35-303035-313135-323235-333335-343435-353535-364X45-404045-414145-424245-434345-444445-454545-465X55-505055-515155-525255-535355-545455-555555-56" + test "test8659" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-04405-05505-061X15-101015-111115-121215-131315-141415-151515-162X25-202025-212125-222225-232325-242425-252525-263X35-303035-313135-323235-333335-343435-353535-364X45-404045-414145-424245-434345-444445-454545-465X55-505055-515155-525255-535355-545455-555555-56ReadX_TAIL" + test "test8660" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 )) "05-00005-01105-02205-03305-04405-05505-06605-071X15-101015-111115-121215-131315-141415-151515-161615-172X25-202025-212125-222225-232325-242425-252525-262625-273X35-303035-313135-323235-333335-343435-353535-363635-374X45-404045-414145-424245-434345-444445-454545-464645-475X55-505055-515155-525255-535355-545455-555555-565655-57" + test "test8661" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-04405-05505-06605-071X15-101015-111115-121215-131315-141415-151515-161615-172X25-202025-212125-222225-232325-242425-252525-262625-273X35-303035-313135-323235-333335-343435-353535-363635-374X45-404045-414145-424245-434345-444445-454545-464645-475X55-505055-515155-525255-535355-545455-555555-565655-57ReadX_TAIL" + test "test8662" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%d05-08%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%d15-18%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%d25-28%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%d35-38%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%d45-48%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57%d55-58" 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 )) "05-00005-01105-02205-03305-04405-05505-06605-07705-081X15-101015-111115-121215-131315-141415-151515-161615-171715-182X25-202025-212125-222225-232325-242425-252525-262625-272725-283X35-303035-313135-323235-333335-343435-353535-363635-373735-384X45-404045-414145-424245-434345-444445-454545-464645-474745-485X55-505055-515155-525255-535355-545455-555555-565655-575755-58" + test "test8663" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%d05-08%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%d15-18%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%d25-28%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%d35-38%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%d45-48%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57%d55-58%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") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-04405-05505-06605-07705-081X15-101015-111115-121215-131315-141415-151515-161615-171715-182X25-202025-212125-222225-232325-242425-252525-262625-272725-283X35-303035-313135-323235-333335-343435-353535-363635-373735-384X45-404045-414145-424245-434345-444445-454545-464645-474745-485X55-505055-515155-525255-535355-545455-555555-565655-575755-58ReadX_TAIL" + test "test8664" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%d05-08%d05-09%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%d15-18%d15-19%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%d25-28%d25-29%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%d35-38%d35-39%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%d45-48%d45-49%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57%d55-58%d55-59" 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 )) "05-00005-01105-02205-03305-04405-05505-06605-07705-08805-091X15-101015-111115-121215-131315-141415-151515-161615-171715-181815-192X25-202025-212125-222225-232325-242425-252525-262625-272725-282825-293X35-303035-313135-323235-333335-343435-353535-363635-373735-383835-394X45-404045-414145-424245-434345-444445-454545-464645-474745-484845-495X55-505055-515155-525255-535355-545455-555555-565655-575755-585855-59" + test "test8665" (lazy(sprintf "05-00%d05-01%d05-02%d05-03%d05-04%d05-05%d05-06%d05-07%d05-08%d05-09%a15-10%d15-11%d15-12%d15-13%d15-14%d15-15%d15-16%d15-17%d15-18%d15-19%a25-20%d25-21%d25-22%d25-23%d25-24%d25-25%d25-26%d25-27%d25-28%d25-29%a35-30%d35-31%d35-32%d35-33%d35-34%d35-35%d35-36%d35-37%d35-38%d35-39%a45-40%d45-41%d45-42%d45-43%d45-44%d45-45%d45-46%d45-47%d45-48%d45-49%a55-50%d55-51%d55-52%d55-53%d55-54%d55-55%d55-56%d55-57%d55-58%d55-59%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") System.IO.FileShare.Read )) "05-00005-01105-02205-03305-04405-05505-06605-07705-08805-091X15-101015-111115-121215-131315-141415-151515-161615-171715-181815-192X25-202025-212125-222225-232325-242425-252525-262625-272725-282825-293X35-303035-313135-323235-333335-343435-353535-363635-373735-383835-394X45-404045-414145-424245-434345-444445-454545-464645-474745-484845-495X55-505055-515155-525255-535355-545455-555555-565655-575755-585855-59ReadX_TAIL" + test "test8666" (lazy(sprintf "06-00%d06-01%a16-10%d16-11%a26-20%d26-21%a36-30%d36-31%a46-40%d46-41%a56-50%d56-51%a66-60%d66-61" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 )) "06-00006-011X16-101016-112X26-202026-213X36-303036-314X46-404046-415X56-505056-516X66-606066-61" + test "test8667" (lazy(sprintf "06-00%d06-01%a16-10%d16-11%a26-20%d26-21%a36-30%d36-31%a46-40%d46-41%a56-50%d56-51%a66-60%d66-61%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-011X16-101016-112X26-202026-213X36-303036-314X46-404046-415X56-505056-516X66-606066-61ReadX_TAIL" + test "test8668" (lazy(sprintf "06-00%d06-01%d06-02%a16-10%d16-11%d16-12%a26-20%d26-21%d26-22%a36-30%d36-31%d36-32%a46-40%d46-41%d46-42%a56-50%d56-51%d56-52%a66-60%d66-61%d66-62" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 )) "06-00006-01106-021X16-101016-111116-122X26-202026-212126-223X36-303036-313136-324X46-404046-414146-425X56-505056-515156-526X66-606066-616166-62" + test "test8669" (lazy(sprintf "06-00%d06-01%d06-02%a16-10%d16-11%d16-12%a26-20%d26-21%d26-22%a36-30%d36-31%d36-32%a46-40%d46-41%d46-42%a56-50%d56-51%d56-52%a66-60%d66-61%d66-62%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-021X16-101016-111116-122X26-202026-212126-223X36-303036-313136-324X46-404046-414146-425X56-505056-515156-526X66-606066-616166-62ReadX_TAIL" + test "test8670" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%a16-10%d16-11%d16-12%d16-13%a26-20%d26-21%d26-22%d26-23%a36-30%d36-31%d36-32%d36-33%a46-40%d46-41%d46-42%d46-43%a56-50%d56-51%d56-52%d56-53%a66-60%d66-61%d66-62%d66-63" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 )) "06-00006-01106-02206-031X16-101016-111116-121216-132X26-202026-212126-222226-233X36-303036-313136-323236-334X46-404046-414146-424246-435X56-505056-515156-525256-536X66-606066-616166-626266-63" + test "test8671" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%a16-10%d16-11%d16-12%d16-13%a26-20%d26-21%d26-22%d26-23%a36-30%d36-31%d36-32%d36-33%a46-40%d46-41%d46-42%d46-43%a56-50%d56-51%d56-52%d56-53%a66-60%d66-61%d66-62%d66-63%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-02206-031X16-101016-111116-121216-132X26-202026-212126-222226-233X36-303036-313136-323236-334X46-404046-414146-424246-435X56-505056-515156-525256-536X66-606066-616166-626266-63ReadX_TAIL" + test "test8672" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%a16-10%d16-11%d16-12%d16-13%d16-14%a26-20%d26-21%d26-22%d26-23%d26-24%a36-30%d36-31%d36-32%d36-33%d36-34%a46-40%d46-41%d46-42%d46-43%d46-44%a56-50%d56-51%d56-52%d56-53%d56-54%a66-60%d66-61%d66-62%d66-63%d66-64" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 )) "06-00006-01106-02206-03306-041X16-101016-111116-121216-131316-142X26-202026-212126-222226-232326-243X36-303036-313136-323236-333336-344X46-404046-414146-424246-434346-445X56-505056-515156-525256-535356-546X66-606066-616166-626266-636366-64" + test "test8673" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%a16-10%d16-11%d16-12%d16-13%d16-14%a26-20%d26-21%d26-22%d26-23%d26-24%a36-30%d36-31%d36-32%d36-33%d36-34%a46-40%d46-41%d46-42%d46-43%d46-44%a56-50%d56-51%d56-52%d56-53%d56-54%a66-60%d66-61%d66-62%d66-63%d66-64%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-041X16-101016-111116-121216-131316-142X26-202026-212126-222226-232326-243X36-303036-313136-323236-333336-344X46-404046-414146-424246-434346-445X56-505056-515156-525256-535356-546X66-606066-616166-626266-636366-64ReadX_TAIL" + test "test8674" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 )) "06-00006-01106-02206-03306-04406-051X16-101016-111116-121216-131316-141416-152X26-202026-212126-222226-232326-242426-253X36-303036-313136-323236-333336-343436-354X46-404046-414146-424246-434346-444446-455X56-505056-515156-525256-535356-545456-556X66-606066-616166-626266-636366-646466-65" + test "test8675" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-04406-051X16-101016-111116-121216-131316-141416-152X26-202026-212126-222226-232326-242426-253X36-303036-313136-323236-333336-343436-354X46-404046-414146-424246-434346-444446-455X56-505056-515156-525256-535356-545456-556X66-606066-616166-626266-636366-646466-65ReadX_TAIL" + test "test8676" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 )) "06-00006-01106-02206-03306-04406-05506-061X16-101016-111116-121216-131316-141416-151516-162X26-202026-212126-222226-232326-242426-252526-263X36-303036-313136-323236-333336-343436-353536-364X46-404046-414146-424246-434346-444446-454546-465X56-505056-515156-525256-535356-545456-555556-566X66-606066-616166-626266-636366-646466-656566-66" + test "test8677" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-04406-05506-061X16-101016-111116-121216-131316-141416-151516-162X26-202026-212126-222226-232326-242426-252526-263X36-303036-313136-323236-333336-343436-353536-364X46-404046-414146-424246-434346-444446-454546-465X56-505056-515156-525256-535356-545456-555556-566X66-606066-616166-626266-636366-646466-656566-66ReadX_TAIL" + test "test8678" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 )) "06-00006-01106-02206-03306-04406-05506-06606-071X16-101016-111116-121216-131316-141416-151516-161616-172X26-202026-212126-222226-232326-242426-252526-262626-273X36-303036-313136-323236-333336-343436-353536-363636-374X46-404046-414146-424246-434346-444446-454546-464646-475X56-505056-515156-525256-535356-545456-555556-565656-576X66-606066-616166-626266-636366-646466-656566-666666-67" + test "test8679" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-04406-05506-06606-071X16-101016-111116-121216-131316-141416-151516-161616-172X26-202026-212126-222226-232326-242426-252526-262626-273X36-303036-313136-323236-333336-343436-353536-363636-374X46-404046-414146-424246-434346-444446-454546-464646-475X56-505056-515156-525256-535356-545456-555556-565656-576X66-606066-616166-626266-636366-646466-656566-666666-67ReadX_TAIL" + test "test8680" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%d06-08%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%d16-18%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%d26-28%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%d36-38%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%d46-48%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%d56-58%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67%d66-68" 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 )) "06-00006-01106-02206-03306-04406-05506-06606-07706-081X16-101016-111116-121216-131316-141416-151516-161616-171716-182X26-202026-212126-222226-232326-242426-252526-262626-272726-283X36-303036-313136-323236-333336-343436-353536-363636-373736-384X46-404046-414146-424246-434346-444446-454546-464646-474746-485X56-505056-515156-525256-535356-545456-555556-565656-575756-586X66-606066-616166-626266-636366-646466-656566-666666-676766-68" + test "test8681" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%d06-08%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%d16-18%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%d26-28%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%d36-38%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%d46-48%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%d56-58%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67%d66-68%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") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-04406-05506-06606-07706-081X16-101016-111116-121216-131316-141416-151516-161616-171716-182X26-202026-212126-222226-232326-242426-252526-262626-272726-283X36-303036-313136-323236-333336-343436-353536-363636-373736-384X46-404046-414146-424246-434346-444446-454546-464646-474746-485X56-505056-515156-525256-535356-545456-555556-565656-575756-586X66-606066-616166-626266-636366-646466-656566-666666-676766-68ReadX_TAIL" + test "test8682" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%d06-08%d06-09%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%d16-18%d16-19%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%d26-28%d26-29%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%d36-38%d36-39%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%d46-48%d46-49%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%d56-58%d56-59%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67%d66-68%d66-69" 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 )) "06-00006-01106-02206-03306-04406-05506-06606-07706-08806-091X16-101016-111116-121216-131316-141416-151516-161616-171716-181816-192X26-202026-212126-222226-232326-242426-252526-262626-272726-282826-293X36-303036-313136-323236-333336-343436-353536-363636-373736-383836-394X46-404046-414146-424246-434346-444446-454546-464646-474746-484846-495X56-505056-515156-525256-535356-545456-555556-565656-575756-585856-596X66-606066-616166-626266-636366-646466-656566-666666-676766-686866-69" + test "test8683" (lazy(sprintf "06-00%d06-01%d06-02%d06-03%d06-04%d06-05%d06-06%d06-07%d06-08%d06-09%a16-10%d16-11%d16-12%d16-13%d16-14%d16-15%d16-16%d16-17%d16-18%d16-19%a26-20%d26-21%d26-22%d26-23%d26-24%d26-25%d26-26%d26-27%d26-28%d26-29%a36-30%d36-31%d36-32%d36-33%d36-34%d36-35%d36-36%d36-37%d36-38%d36-39%a46-40%d46-41%d46-42%d46-43%d46-44%d46-45%d46-46%d46-47%d46-48%d46-49%a56-50%d56-51%d56-52%d56-53%d56-54%d56-55%d56-56%d56-57%d56-58%d56-59%a66-60%d66-61%d66-62%d66-63%d66-64%d66-65%d66-66%d66-67%d66-68%d66-69%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") System.IO.FileShare.Read )) "06-00006-01106-02206-03306-04406-05506-06606-07706-08806-091X16-101016-111116-121216-131316-141416-151516-161616-171716-181816-192X26-202026-212126-222226-232326-242426-252526-262626-272726-282826-293X36-303036-313136-323236-333336-343436-353536-363636-373736-383836-394X46-404046-414146-424246-434346-444446-454546-464646-474746-484846-495X56-505056-515156-525256-535356-545456-555556-565656-575756-585856-596X66-606066-616166-626266-636366-646466-656566-666666-676766-686866-69ReadX_TAIL" + test "test8684" (lazy(sprintf "07-00%d07-01%a17-10%d17-11%a27-20%d27-21%a37-30%d37-31%a47-40%d47-41%a57-50%d57-51%a67-60%d67-61%a77-70%d77-71" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 )) "07-00007-011X17-101017-112X27-202027-213X37-303037-314X47-404047-415X57-505057-516X67-606067-617X77-707077-71" + test "test8685" (lazy(sprintf "07-00%d07-01%a17-10%d17-11%a27-20%d27-21%a37-30%d37-31%a47-40%d47-41%a57-50%d57-51%a67-60%d67-61%a77-70%d77-71%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-011X17-101017-112X27-202027-213X37-303037-314X47-404047-415X57-505057-516X67-606067-617X77-707077-71ReadX_TAIL" + test "test8686" (lazy(sprintf "07-00%d07-01%d07-02%a17-10%d17-11%d17-12%a27-20%d27-21%d27-22%a37-30%d37-31%d37-32%a47-40%d47-41%d47-42%a57-50%d57-51%d57-52%a67-60%d67-61%d67-62%a77-70%d77-71%d77-72" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 )) "07-00007-01107-021X17-101017-111117-122X27-202027-212127-223X37-303037-313137-324X47-404047-414147-425X57-505057-515157-526X67-606067-616167-627X77-707077-717177-72" + test "test8687" (lazy(sprintf "07-00%d07-01%d07-02%a17-10%d17-11%d17-12%a27-20%d27-21%d27-22%a37-30%d37-31%d37-32%a47-40%d47-41%d47-42%a57-50%d57-51%d57-52%a67-60%d67-61%d67-62%a77-70%d77-71%d77-72%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-021X17-101017-111117-122X27-202027-212127-223X37-303037-313137-324X47-404047-414147-425X57-505057-515157-526X67-606067-616167-627X77-707077-717177-72ReadX_TAIL" + test "test8688" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%a17-10%d17-11%d17-12%d17-13%a27-20%d27-21%d27-22%d27-23%a37-30%d37-31%d37-32%d37-33%a47-40%d47-41%d47-42%d47-43%a57-50%d57-51%d57-52%d57-53%a67-60%d67-61%d67-62%d67-63%a77-70%d77-71%d77-72%d77-73" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 )) "07-00007-01107-02207-031X17-101017-111117-121217-132X27-202027-212127-222227-233X37-303037-313137-323237-334X47-404047-414147-424247-435X57-505057-515157-525257-536X67-606067-616167-626267-637X77-707077-717177-727277-73" + test "test8689" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%a17-10%d17-11%d17-12%d17-13%a27-20%d27-21%d27-22%d27-23%a37-30%d37-31%d37-32%d37-33%a47-40%d47-41%d47-42%d47-43%a57-50%d57-51%d57-52%d57-53%a67-60%d67-61%d67-62%d67-63%a77-70%d77-71%d77-72%d77-73%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-02207-031X17-101017-111117-121217-132X27-202027-212127-222227-233X37-303037-313137-323237-334X47-404047-414147-424247-435X57-505057-515157-525257-536X67-606067-616167-626267-637X77-707077-717177-727277-73ReadX_TAIL" + test "test8690" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%a17-10%d17-11%d17-12%d17-13%d17-14%a27-20%d27-21%d27-22%d27-23%d27-24%a37-30%d37-31%d37-32%d37-33%d37-34%a47-40%d47-41%d47-42%d47-43%d47-44%a57-50%d57-51%d57-52%d57-53%d57-54%a67-60%d67-61%d67-62%d67-63%d67-64%a77-70%d77-71%d77-72%d77-73%d77-74" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 )) "07-00007-01107-02207-03307-041X17-101017-111117-121217-131317-142X27-202027-212127-222227-232327-243X37-303037-313137-323237-333337-344X47-404047-414147-424247-434347-445X57-505057-515157-525257-535357-546X67-606067-616167-626267-636367-647X77-707077-717177-727277-737377-74" + test "test8691" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%a17-10%d17-11%d17-12%d17-13%d17-14%a27-20%d27-21%d27-22%d27-23%d27-24%a37-30%d37-31%d37-32%d37-33%d37-34%a47-40%d47-41%d47-42%d47-43%d47-44%a57-50%d57-51%d57-52%d57-53%d57-54%a67-60%d67-61%d67-62%d67-63%d67-64%a77-70%d77-71%d77-72%d77-73%d77-74%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-041X17-101017-111117-121217-131317-142X27-202027-212127-222227-232327-243X37-303037-313137-323237-333337-344X47-404047-414147-424247-434347-445X57-505057-515157-525257-535357-546X67-606067-616167-626267-636367-647X77-707077-717177-727277-737377-74ReadX_TAIL" + test "test8692" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 )) "07-00007-01107-02207-03307-04407-051X17-101017-111117-121217-131317-141417-152X27-202027-212127-222227-232327-242427-253X37-303037-313137-323237-333337-343437-354X47-404047-414147-424247-434347-444447-455X57-505057-515157-525257-535357-545457-556X67-606067-616167-626267-636367-646467-657X77-707077-717177-727277-737377-747477-75" + test "test8693" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-04407-051X17-101017-111117-121217-131317-141417-152X27-202027-212127-222227-232327-242427-253X37-303037-313137-323237-333337-343437-354X47-404047-414147-424247-434347-444447-455X57-505057-515157-525257-535357-545457-556X67-606067-616167-626267-636367-646467-657X77-707077-717177-727277-737377-747477-75ReadX_TAIL" + test "test8694" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 )) "07-00007-01107-02207-03307-04407-05507-061X17-101017-111117-121217-131317-141417-151517-162X27-202027-212127-222227-232327-242427-252527-263X37-303037-313137-323237-333337-343437-353537-364X47-404047-414147-424247-434347-444447-454547-465X57-505057-515157-525257-535357-545457-555557-566X67-606067-616167-626267-636367-646467-656567-667X77-707077-717177-727277-737377-747477-757577-76" + test "test8695" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-04407-05507-061X17-101017-111117-121217-131317-141417-151517-162X27-202027-212127-222227-232327-242427-252527-263X37-303037-313137-323237-333337-343437-353537-364X47-404047-414147-424247-434347-444447-454547-465X57-505057-515157-525257-535357-545457-555557-566X67-606067-616167-626267-636367-646467-656567-667X77-707077-717177-727277-737377-747477-757577-76ReadX_TAIL" + test "test8696" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 )) "07-00007-01107-02207-03307-04407-05507-06607-071X17-101017-111117-121217-131317-141417-151517-161617-172X27-202027-212127-222227-232327-242427-252527-262627-273X37-303037-313137-323237-333337-343437-353537-363637-374X47-404047-414147-424247-434347-444447-454547-464647-475X57-505057-515157-525257-535357-545457-555557-565657-576X67-606067-616167-626267-636367-646467-656567-666667-677X77-707077-717177-727277-737377-747477-757577-767677-77" + test "test8697" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-04407-05507-06607-071X17-101017-111117-121217-131317-141417-151517-161617-172X27-202027-212127-222227-232327-242427-252527-262627-273X37-303037-313137-323237-333337-343437-353537-363637-374X47-404047-414147-424247-434347-444447-454547-464647-475X57-505057-515157-525257-535357-545457-555557-565657-576X67-606067-616167-626267-636367-646467-656567-666667-677X77-707077-717177-727277-737377-747477-757577-767677-77ReadX_TAIL" + test "test8698" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%d07-08%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%d17-18%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%d27-28%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%d37-38%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%d47-48%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%d57-58%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%d67-68%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77%d77-78" 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 )) "07-00007-01107-02207-03307-04407-05507-06607-07707-081X17-101017-111117-121217-131317-141417-151517-161617-171717-182X27-202027-212127-222227-232327-242427-252527-262627-272727-283X37-303037-313137-323237-333337-343437-353537-363637-373737-384X47-404047-414147-424247-434347-444447-454547-464647-474747-485X57-505057-515157-525257-535357-545457-555557-565657-575757-586X67-606067-616167-626267-636367-646467-656567-666667-676767-687X77-707077-717177-727277-737377-747477-757577-767677-777777-78" + test "test8699" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%d07-08%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%d17-18%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%d27-28%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%d37-38%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%d47-48%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%d57-58%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%d67-68%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77%d77-78%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") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-04407-05507-06607-07707-081X17-101017-111117-121217-131317-141417-151517-161617-171717-182X27-202027-212127-222227-232327-242427-252527-262627-272727-283X37-303037-313137-323237-333337-343437-353537-363637-373737-384X47-404047-414147-424247-434347-444447-454547-464647-474747-485X57-505057-515157-525257-535357-545457-555557-565657-575757-586X67-606067-616167-626267-636367-646467-656567-666667-676767-687X77-707077-717177-727277-737377-747477-757577-767677-777777-78ReadX_TAIL" + test "test8700" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%d07-08%d07-09%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%d17-18%d17-19%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%d27-28%d27-29%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%d37-38%d37-39%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%d47-48%d47-49%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%d57-58%d57-59%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%d67-68%d67-69%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77%d77-78%d77-79" 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 )) "07-00007-01107-02207-03307-04407-05507-06607-07707-08807-091X17-101017-111117-121217-131317-141417-151517-161617-171717-181817-192X27-202027-212127-222227-232327-242427-252527-262627-272727-282827-293X37-303037-313137-323237-333337-343437-353537-363637-373737-383837-394X47-404047-414147-424247-434347-444447-454547-464647-474747-484847-495X57-505057-515157-525257-535357-545457-555557-565657-575757-585857-596X67-606067-616167-626267-636367-646467-656567-666667-676767-686867-697X77-707077-717177-727277-737377-747477-757577-767677-777777-787877-79" + test "test8701" (lazy(sprintf "07-00%d07-01%d07-02%d07-03%d07-04%d07-05%d07-06%d07-07%d07-08%d07-09%a17-10%d17-11%d17-12%d17-13%d17-14%d17-15%d17-16%d17-17%d17-18%d17-19%a27-20%d27-21%d27-22%d27-23%d27-24%d27-25%d27-26%d27-27%d27-28%d27-29%a37-30%d37-31%d37-32%d37-33%d37-34%d37-35%d37-36%d37-37%d37-38%d37-39%a47-40%d47-41%d47-42%d47-43%d47-44%d47-45%d47-46%d47-47%d47-48%d47-49%a57-50%d57-51%d57-52%d57-53%d57-54%d57-55%d57-56%d57-57%d57-58%d57-59%a67-60%d67-61%d67-62%d67-63%d67-64%d67-65%d67-66%d67-67%d67-68%d67-69%a77-70%d77-71%d77-72%d77-73%d77-74%d77-75%d77-76%d77-77%d77-78%d77-79%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") System.IO.FileShare.Read )) "07-00007-01107-02207-03307-04407-05507-06607-07707-08807-091X17-101017-111117-121217-131317-141417-151517-161617-171717-181817-192X27-202027-212127-222227-232327-242427-252527-262627-272727-282827-293X37-303037-313137-323237-333337-343437-353537-363637-373737-383837-394X47-404047-414147-424247-434347-444447-454547-464647-474747-484847-495X57-505057-515157-525257-535357-545457-555557-565657-575757-585857-596X67-606067-616167-626267-636367-646467-656567-666667-676767-686867-697X77-707077-717177-727277-737377-747477-757577-767677-777777-787877-79ReadX_TAIL" + test "test8702" (lazy(sprintf "08-00%d08-01%a18-10%d18-11%a28-20%d28-21%a38-30%d38-31%a48-40%d48-41%a58-50%d58-51%a68-60%d68-61%a78-70%d78-71%a88-80%d88-81" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 (fun _ v -> (string v) + "X") 8 80 )) "08-00008-011X18-101018-112X28-202028-213X38-303038-314X48-404048-415X58-505058-516X68-606068-617X78-707078-718X88-808088-81" + test "test8703" (lazy(sprintf "08-00%d08-01%a18-10%d18-11%a28-20%d28-21%a38-30%d38-31%a48-40%d48-41%a58-50%d58-51%a68-60%d68-61%a78-70%d78-71%a88-80%d88-81%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 (fun _ v -> (string v) + "X") 8 80 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-011X18-101018-112X28-202028-213X38-303038-314X48-404048-415X58-505058-516X68-606068-617X78-707078-718X88-808088-81ReadX_TAIL" + test "test8704" (lazy(sprintf "08-00%d08-01%d08-02%a18-10%d18-11%d18-12%a28-20%d28-21%d28-22%a38-30%d38-31%d38-32%a48-40%d48-41%d48-42%a58-50%d58-51%d58-52%a68-60%d68-61%d68-62%a78-70%d78-71%d78-72%a88-80%d88-81%d88-82" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 (fun _ v -> (string v) + "X") 8 80 81 )) "08-00008-01108-021X18-101018-111118-122X28-202028-212128-223X38-303038-313138-324X48-404048-414148-425X58-505058-515158-526X68-606068-616168-627X78-707078-717178-728X88-808088-818188-82" + test "test8705" (lazy(sprintf "08-00%d08-01%d08-02%a18-10%d18-11%d18-12%a28-20%d28-21%d28-22%a38-30%d38-31%d38-32%a48-40%d48-41%d48-42%a58-50%d58-51%d58-52%a68-60%d68-61%d68-62%a78-70%d78-71%d78-72%a88-80%d88-81%d88-82%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 (fun _ v -> (string v) + "X") 8 80 81 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-021X18-101018-111118-122X28-202028-212128-223X38-303038-313138-324X48-404048-414148-425X58-505058-515158-526X68-606068-616168-627X78-707078-717178-728X88-808088-818188-82ReadX_TAIL" + test "test8706" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%a18-10%d18-11%d18-12%d18-13%a28-20%d28-21%d28-22%d28-23%a38-30%d38-31%d38-32%d38-33%a48-40%d48-41%d48-42%d48-43%a58-50%d58-51%d58-52%d58-53%a68-60%d68-61%d68-62%d68-63%a78-70%d78-71%d78-72%d78-73%a88-80%d88-81%d88-82%d88-83" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 (fun _ v -> (string v) + "X") 8 80 81 82 )) "08-00008-01108-02208-031X18-101018-111118-121218-132X28-202028-212128-222228-233X38-303038-313138-323238-334X48-404048-414148-424248-435X58-505058-515158-525258-536X68-606068-616168-626268-637X78-707078-717178-727278-738X88-808088-818188-828288-83" + test "test8707" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%a18-10%d18-11%d18-12%d18-13%a28-20%d28-21%d28-22%d28-23%a38-30%d38-31%d38-32%d38-33%a48-40%d48-41%d48-42%d48-43%a58-50%d58-51%d58-52%d58-53%a68-60%d68-61%d68-62%d68-63%a78-70%d78-71%d78-72%d78-73%a88-80%d88-81%d88-82%d88-83%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 (fun _ v -> (string v) + "X") 8 80 81 82 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-02208-031X18-101018-111118-121218-132X28-202028-212128-222228-233X38-303038-313138-323238-334X48-404048-414148-424248-435X58-505058-515158-525258-536X68-606068-616168-626268-637X78-707078-717178-727278-738X88-808088-818188-828288-83ReadX_TAIL" + test "test8708" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%a18-10%d18-11%d18-12%d18-13%d18-14%a28-20%d28-21%d28-22%d28-23%d28-24%a38-30%d38-31%d38-32%d38-33%d38-34%a48-40%d48-41%d48-42%d48-43%d48-44%a58-50%d58-51%d58-52%d58-53%d58-54%a68-60%d68-61%d68-62%d68-63%d68-64%a78-70%d78-71%d78-72%d78-73%d78-74%a88-80%d88-81%d88-82%d88-83%d88-84" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 (fun _ v -> (string v) + "X") 8 80 81 82 83 )) "08-00008-01108-02208-03308-041X18-101018-111118-121218-131318-142X28-202028-212128-222228-232328-243X38-303038-313138-323238-333338-344X48-404048-414148-424248-434348-445X58-505058-515158-525258-535358-546X68-606068-616168-626268-636368-647X78-707078-717178-727278-737378-748X88-808088-818188-828288-838388-84" + test "test8709" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%a18-10%d18-11%d18-12%d18-13%d18-14%a28-20%d28-21%d28-22%d28-23%d28-24%a38-30%d38-31%d38-32%d38-33%d38-34%a48-40%d48-41%d48-42%d48-43%d48-44%a58-50%d58-51%d58-52%d58-53%d58-54%a68-60%d68-61%d68-62%d68-63%d68-64%a78-70%d78-71%d78-72%d78-73%d78-74%a88-80%d88-81%d88-82%d88-83%d88-84%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 (fun _ v -> (string v) + "X") 8 80 81 82 83 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-041X18-101018-111118-121218-131318-142X28-202028-212128-222228-232328-243X38-303038-313138-323238-333338-344X48-404048-414148-424248-434348-445X58-505058-515158-525258-535358-546X68-606068-616168-626268-636368-647X78-707078-717178-727278-737378-748X88-808088-818188-828288-838388-84ReadX_TAIL" + test "test8710" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 )) "08-00008-01108-02208-03308-04408-051X18-101018-111118-121218-131318-141418-152X28-202028-212128-222228-232328-242428-253X38-303038-313138-323238-333338-343438-354X48-404048-414148-424248-434348-444448-455X58-505058-515158-525258-535358-545458-556X68-606068-616168-626268-636368-646468-657X78-707078-717178-727278-737378-747478-758X88-808088-818188-828288-838388-848488-85" + test "test8711" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-04408-051X18-101018-111118-121218-131318-141418-152X28-202028-212128-222228-232328-242428-253X38-303038-313138-323238-333338-343438-354X48-404048-414148-424248-434348-444448-455X58-505058-515158-525258-535358-545458-556X68-606068-616168-626268-636368-646468-657X78-707078-717178-727278-737378-747478-758X88-808088-818188-828288-838388-848488-85ReadX_TAIL" + test "test8712" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 )) "08-00008-01108-02208-03308-04408-05508-061X18-101018-111118-121218-131318-141418-151518-162X28-202028-212128-222228-232328-242428-252528-263X38-303038-313138-323238-333338-343438-353538-364X48-404048-414148-424248-434348-444448-454548-465X58-505058-515158-525258-535358-545458-555558-566X68-606068-616168-626268-636368-646468-656568-667X78-707078-717178-727278-737378-747478-757578-768X88-808088-818188-828288-838388-848488-858588-86" + test "test8713" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-04408-05508-061X18-101018-111118-121218-131318-141418-151518-162X28-202028-212128-222228-232328-242428-252528-263X38-303038-313138-323238-333338-343438-353538-364X48-404048-414148-424248-434348-444448-454548-465X58-505058-515158-525258-535358-545458-555558-566X68-606068-616168-626268-636368-646468-656568-667X78-707078-717178-727278-737378-747478-757578-768X88-808088-818188-828288-838388-848488-858588-86ReadX_TAIL" + test "test8714" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 )) "08-00008-01108-02208-03308-04408-05508-06608-071X18-101018-111118-121218-131318-141418-151518-161618-172X28-202028-212128-222228-232328-242428-252528-262628-273X38-303038-313138-323238-333338-343438-353538-363638-374X48-404048-414148-424248-434348-444448-454548-464648-475X58-505058-515158-525258-535358-545458-555558-565658-576X68-606068-616168-626268-636368-646468-656568-666668-677X78-707078-717178-727278-737378-747478-757578-767678-778X88-808088-818188-828288-838388-848488-858588-868688-87" + test "test8715" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-04408-05508-06608-071X18-101018-111118-121218-131318-141418-151518-161618-172X28-202028-212128-222228-232328-242428-252528-262628-273X38-303038-313138-323238-333338-343438-353538-363638-374X48-404048-414148-424248-434348-444448-454548-464648-475X58-505058-515158-525258-535358-545458-555558-565658-576X68-606068-616168-626268-636368-646468-656568-666668-677X78-707078-717178-727278-737378-747478-757578-767678-778X88-808088-818188-828288-838388-848488-858588-868688-87ReadX_TAIL" + test "test8716" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%d08-08%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%d18-18%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%d28-28%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%d38-38%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%d48-48%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%d58-58%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%d68-68%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%d78-78%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87%d88-88" 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 )) "08-00008-01108-02208-03308-04408-05508-06608-07708-081X18-101018-111118-121218-131318-141418-151518-161618-171718-182X28-202028-212128-222228-232328-242428-252528-262628-272728-283X38-303038-313138-323238-333338-343438-353538-363638-373738-384X48-404048-414148-424248-434348-444448-454548-464648-474748-485X58-505058-515158-525258-535358-545458-555558-565658-575758-586X68-606068-616168-626268-636368-646468-656568-666668-676768-687X78-707078-717178-727278-737378-747478-757578-767678-777778-788X88-808088-818188-828288-838388-848488-858588-868688-878788-88" + test "test8717" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%d08-08%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%d18-18%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%d28-28%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%d38-38%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%d48-48%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%d58-58%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%d68-68%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%d78-78%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87%d88-88%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") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-04408-05508-06608-07708-081X18-101018-111118-121218-131318-141418-151518-161618-171718-182X28-202028-212128-222228-232328-242428-252528-262628-272728-283X38-303038-313138-323238-333338-343438-353538-363638-373738-384X48-404048-414148-424248-434348-444448-454548-464648-474748-485X58-505058-515158-525258-535358-545458-555558-565658-575758-586X68-606068-616168-626268-636368-646468-656568-666668-676768-687X78-707078-717178-727278-737378-747478-757578-767678-777778-788X88-808088-818188-828288-838388-848488-858588-868688-878788-88ReadX_TAIL" + test "test8718" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%d08-08%d08-09%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%d18-18%d18-19%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%d28-28%d28-29%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%d38-38%d38-39%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%d48-48%d48-49%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%d58-58%d58-59%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%d68-68%d68-69%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%d78-78%d78-79%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87%d88-88%d88-89" 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 )) "08-00008-01108-02208-03308-04408-05508-06608-07708-08808-091X18-101018-111118-121218-131318-141418-151518-161618-171718-181818-192X28-202028-212128-222228-232328-242428-252528-262628-272728-282828-293X38-303038-313138-323238-333338-343438-353538-363638-373738-383838-394X48-404048-414148-424248-434348-444448-454548-464648-474748-484848-495X58-505058-515158-525258-535358-545458-555558-565658-575758-585858-596X68-606068-616168-626268-636368-646468-656568-666668-676768-686868-697X78-707078-717178-727278-737378-747478-757578-767678-777778-787878-798X88-808088-818188-828288-838388-848488-858588-868688-878788-888888-89" + test "test8719" (lazy(sprintf "08-00%d08-01%d08-02%d08-03%d08-04%d08-05%d08-06%d08-07%d08-08%d08-09%a18-10%d18-11%d18-12%d18-13%d18-14%d18-15%d18-16%d18-17%d18-18%d18-19%a28-20%d28-21%d28-22%d28-23%d28-24%d28-25%d28-26%d28-27%d28-28%d28-29%a38-30%d38-31%d38-32%d38-33%d38-34%d38-35%d38-36%d38-37%d38-38%d38-39%a48-40%d48-41%d48-42%d48-43%d48-44%d48-45%d48-46%d48-47%d48-48%d48-49%a58-50%d58-51%d58-52%d58-53%d58-54%d58-55%d58-56%d58-57%d58-58%d58-59%a68-60%d68-61%d68-62%d68-63%d68-64%d68-65%d68-66%d68-67%d68-68%d68-69%a78-70%d78-71%d78-72%d78-73%d78-74%d78-75%d78-76%d78-77%d78-78%d78-79%a88-80%d88-81%d88-82%d88-83%d88-84%d88-85%d88-86%d88-87%d88-88%d88-89%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") System.IO.FileShare.Read )) "08-00008-01108-02208-03308-04408-05508-06608-07708-08808-091X18-101018-111118-121218-131318-141418-151518-161618-171718-181818-192X28-202028-212128-222228-232328-242428-252528-262628-272728-282828-293X38-303038-313138-323238-333338-343438-353538-363638-373738-383838-394X48-404048-414148-424248-434348-444448-454548-464648-474748-484848-495X58-505058-515158-525258-535358-545458-555558-565658-575758-585858-596X68-606068-616168-626268-636368-646468-656568-666668-676768-686868-697X78-707078-717178-727278-737378-747478-757578-767678-777778-787878-798X88-808088-818188-828288-838388-848488-858588-868688-878788-888888-89ReadX_TAIL" + test "test8720" (lazy(sprintf "09-00%d09-01%a19-10%d19-11%a29-20%d29-21%a39-30%d39-31%a49-40%d49-41%a59-50%d59-51%a69-60%d69-61%a79-70%d79-71%a89-80%d89-81%a99-90%d99-91" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 (fun _ v -> (string v) + "X") 8 80 (fun _ v -> (string v) + "X") 9 90 )) "09-00009-011X19-101019-112X29-202029-213X39-303039-314X49-404049-415X59-505059-516X69-606069-617X79-707079-718X89-808089-819X99-909099-91" + test "test8721" (lazy(sprintf "09-00%d09-01%a19-10%d19-11%a29-20%d29-21%a39-30%d39-31%a49-40%d49-41%a59-50%d59-51%a69-60%d69-61%a79-70%d79-71%a89-80%d89-81%a99-90%d99-91%a_TAIL" 0 (fun _ v -> (string v) + "X") 1 10 (fun _ v -> (string v) + "X") 2 20 (fun _ v -> (string v) + "X") 3 30 (fun _ v -> (string v) + "X") 4 40 (fun _ v -> (string v) + "X") 5 50 (fun _ v -> (string v) + "X") 6 60 (fun _ v -> (string v) + "X") 7 70 (fun _ v -> (string v) + "X") 8 80 (fun _ v -> (string v) + "X") 9 90 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-011X19-101019-112X29-202029-213X39-303039-314X49-404049-415X59-505059-516X69-606069-617X79-707079-718X89-808089-819X99-909099-91ReadX_TAIL" + test "test8722" (lazy(sprintf "09-00%d09-01%d09-02%a19-10%d19-11%d19-12%a29-20%d29-21%d29-22%a39-30%d39-31%d39-32%a49-40%d49-41%d49-42%a59-50%d59-51%d59-52%a69-60%d69-61%d69-62%a79-70%d79-71%d79-72%a89-80%d89-81%d89-82%a99-90%d99-91%d99-92" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 (fun _ v -> (string v) + "X") 8 80 81 (fun _ v -> (string v) + "X") 9 90 91 )) "09-00009-01109-021X19-101019-111119-122X29-202029-212129-223X39-303039-313139-324X49-404049-414149-425X59-505059-515159-526X69-606069-616169-627X79-707079-717179-728X89-808089-818189-829X99-909099-919199-92" + test "test8723" (lazy(sprintf "09-00%d09-01%d09-02%a19-10%d19-11%d19-12%a29-20%d29-21%d29-22%a39-30%d39-31%d39-32%a49-40%d49-41%d49-42%a59-50%d59-51%d59-52%a69-60%d69-61%d69-62%a79-70%d79-71%d79-72%a89-80%d89-81%d89-82%a99-90%d99-91%d99-92%a_TAIL" 0 1 (fun _ v -> (string v) + "X") 1 10 11 (fun _ v -> (string v) + "X") 2 20 21 (fun _ v -> (string v) + "X") 3 30 31 (fun _ v -> (string v) + "X") 4 40 41 (fun _ v -> (string v) + "X") 5 50 51 (fun _ v -> (string v) + "X") 6 60 61 (fun _ v -> (string v) + "X") 7 70 71 (fun _ v -> (string v) + "X") 8 80 81 (fun _ v -> (string v) + "X") 9 90 91 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-021X19-101019-111119-122X29-202029-212129-223X39-303039-313139-324X49-404049-414149-425X59-505059-515159-526X69-606069-616169-627X79-707079-717179-728X89-808089-818189-829X99-909099-919199-92ReadX_TAIL" + test "test8724" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%a19-10%d19-11%d19-12%d19-13%a29-20%d29-21%d29-22%d29-23%a39-30%d39-31%d39-32%d39-33%a49-40%d49-41%d49-42%d49-43%a59-50%d59-51%d59-52%d59-53%a69-60%d69-61%d69-62%d69-63%a79-70%d79-71%d79-72%d79-73%a89-80%d89-81%d89-82%d89-83%a99-90%d99-91%d99-92%d99-93" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 (fun _ v -> (string v) + "X") 8 80 81 82 (fun _ v -> (string v) + "X") 9 90 91 92 )) "09-00009-01109-02209-031X19-101019-111119-121219-132X29-202029-212129-222229-233X39-303039-313139-323239-334X49-404049-414149-424249-435X59-505059-515159-525259-536X69-606069-616169-626269-637X79-707079-717179-727279-738X89-808089-818189-828289-839X99-909099-919199-929299-93" + test "test8725" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%a19-10%d19-11%d19-12%d19-13%a29-20%d29-21%d29-22%d29-23%a39-30%d39-31%d39-32%d39-33%a49-40%d49-41%d49-42%d49-43%a59-50%d59-51%d59-52%d59-53%a69-60%d69-61%d69-62%d69-63%a79-70%d79-71%d79-72%d79-73%a89-80%d89-81%d89-82%d89-83%a99-90%d99-91%d99-92%d99-93%a_TAIL" 0 1 2 (fun _ v -> (string v) + "X") 1 10 11 12 (fun _ v -> (string v) + "X") 2 20 21 22 (fun _ v -> (string v) + "X") 3 30 31 32 (fun _ v -> (string v) + "X") 4 40 41 42 (fun _ v -> (string v) + "X") 5 50 51 52 (fun _ v -> (string v) + "X") 6 60 61 62 (fun _ v -> (string v) + "X") 7 70 71 72 (fun _ v -> (string v) + "X") 8 80 81 82 (fun _ v -> (string v) + "X") 9 90 91 92 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-031X19-101019-111119-121219-132X29-202029-212129-222229-233X39-303039-313139-323239-334X49-404049-414149-424249-435X59-505059-515159-525259-536X69-606069-616169-626269-637X79-707079-717179-727279-738X89-808089-818189-828289-839X99-909099-919199-929299-93ReadX_TAIL" + test "test8726" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%a19-10%d19-11%d19-12%d19-13%d19-14%a29-20%d29-21%d29-22%d29-23%d29-24%a39-30%d39-31%d39-32%d39-33%d39-34%a49-40%d49-41%d49-42%d49-43%d49-44%a59-50%d59-51%d59-52%d59-53%d59-54%a69-60%d69-61%d69-62%d69-63%d69-64%a79-70%d79-71%d79-72%d79-73%d79-74%a89-80%d89-81%d89-82%d89-83%d89-84%a99-90%d99-91%d99-92%d99-93%d99-94" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 (fun _ v -> (string v) + "X") 8 80 81 82 83 (fun _ v -> (string v) + "X") 9 90 91 92 93 )) "09-00009-01109-02209-03309-041X19-101019-111119-121219-131319-142X29-202029-212129-222229-232329-243X39-303039-313139-323239-333339-344X49-404049-414149-424249-434349-445X59-505059-515159-525259-535359-546X69-606069-616169-626269-636369-647X79-707079-717179-727279-737379-748X89-808089-818189-828289-838389-849X99-909099-919199-929299-939399-94" + test "test8727" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%a19-10%d19-11%d19-12%d19-13%d19-14%a29-20%d29-21%d29-22%d29-23%d29-24%a39-30%d39-31%d39-32%d39-33%d39-34%a49-40%d49-41%d49-42%d49-43%d49-44%a59-50%d59-51%d59-52%d59-53%d59-54%a69-60%d69-61%d69-62%d69-63%d69-64%a79-70%d79-71%d79-72%d79-73%d79-74%a89-80%d89-81%d89-82%d89-83%d89-84%a99-90%d99-91%d99-92%d99-93%d99-94%a_TAIL" 0 1 2 3 (fun _ v -> (string v) + "X") 1 10 11 12 13 (fun _ v -> (string v) + "X") 2 20 21 22 23 (fun _ v -> (string v) + "X") 3 30 31 32 33 (fun _ v -> (string v) + "X") 4 40 41 42 43 (fun _ v -> (string v) + "X") 5 50 51 52 53 (fun _ v -> (string v) + "X") 6 60 61 62 63 (fun _ v -> (string v) + "X") 7 70 71 72 73 (fun _ v -> (string v) + "X") 8 80 81 82 83 (fun _ v -> (string v) + "X") 9 90 91 92 93 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-041X19-101019-111119-121219-131319-142X29-202029-212129-222229-232329-243X39-303039-313139-323239-333339-344X49-404049-414149-424249-434349-445X59-505059-515159-525259-535359-546X69-606069-616169-626269-636369-647X79-707079-717179-727279-737379-748X89-808089-818189-828289-838389-849X99-909099-919199-929299-939399-94ReadX_TAIL" + test "test8728" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 )) "09-00009-01109-02209-03309-04409-051X19-101019-111119-121219-131319-141419-152X29-202029-212129-222229-232329-242429-253X39-303039-313139-323239-333339-343439-354X49-404049-414149-424249-434349-444449-455X59-505059-515159-525259-535359-545459-556X69-606069-616169-626269-636369-646469-657X79-707079-717179-727279-737379-747479-758X89-808089-818189-828289-838389-848489-859X99-909099-919199-929299-939399-949499-95" + test "test8729" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%a_TAIL" 0 1 2 3 4 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-051X19-101019-111119-121219-131319-141419-152X29-202029-212129-222229-232329-242429-253X39-303039-313139-323239-333339-343439-354X49-404049-414149-424249-434349-444449-455X59-505059-515159-525259-535359-545459-556X69-606069-616169-626269-636369-646469-657X79-707079-717179-727279-737379-747479-758X89-808089-818189-828289-838389-848489-859X99-909099-919199-929299-939399-949499-95ReadX_TAIL" + test "test8730" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 )) "09-00009-01109-02209-03309-04409-05509-061X19-101019-111119-121219-131319-141419-151519-162X29-202029-212129-222229-232329-242429-252529-263X39-303039-313139-323239-333339-343439-353539-364X49-404049-414149-424249-434349-444449-454549-465X59-505059-515159-525259-535359-545459-555559-566X69-606069-616169-626269-636369-646469-656569-667X79-707079-717179-727279-737379-747479-757579-768X89-808089-818189-828289-838389-848489-858589-869X99-909099-919199-929299-939399-949499-959599-96" + test "test8731" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%a_TAIL" 0 1 2 3 4 5 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-05509-061X19-101019-111119-121219-131319-141419-151519-162X29-202029-212129-222229-232329-242429-252529-263X39-303039-313139-323239-333339-343439-353539-364X49-404049-414149-424249-434349-444449-454549-465X59-505059-515159-525259-535359-545459-555559-566X69-606069-616169-626269-636369-646469-656569-667X79-707079-717179-727279-737379-747479-757579-768X89-808089-818189-828289-838389-848489-858589-869X99-909099-919199-929299-939399-949499-959599-96ReadX_TAIL" + test "test8732" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 )) "09-00009-01109-02209-03309-04409-05509-06609-071X19-101019-111119-121219-131319-141419-151519-161619-172X29-202029-212129-222229-232329-242429-252529-262629-273X39-303039-313139-323239-333339-343439-353539-363639-374X49-404049-414149-424249-434349-444449-454549-464649-475X59-505059-515159-525259-535359-545459-555559-565659-576X69-606069-616169-626269-636369-646469-656569-666669-677X79-707079-717179-727279-737379-747479-757579-767679-778X89-808089-818189-828289-838389-848489-858589-868689-879X99-909099-919199-929299-939399-949499-959599-969699-97" + test "test8733" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%a_TAIL" 0 1 2 3 4 5 6 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-05509-06609-071X19-101019-111119-121219-131319-141419-151519-161619-172X29-202029-212129-222229-232329-242429-252529-262629-273X39-303039-313139-323239-333339-343439-353539-363639-374X49-404049-414149-424249-434349-444449-454549-464649-475X59-505059-515159-525259-535359-545459-555559-565659-576X69-606069-616169-626269-636369-646469-656569-666669-677X79-707079-717179-727279-737379-747479-757579-767679-778X89-808089-818189-828289-838389-848489-858589-868689-879X99-909099-919199-929299-939399-949499-959599-969699-97ReadX_TAIL" + test "test8734" (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" 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 )) "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-98" + 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" + +[] +let main _ = + testing1() + func0() + func1000() + func2000() + func3000() + func4000() + func5000() + func6000() + func7000() + func8000() + match !failures with + | [] -> + stdout.WriteLine "All tests passed" + exit 0 + | _ -> + stdout.WriteLine "Some tests failed" + exit 1 + 0 \ No newline at end of file diff --git a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj new file mode 100644 index 00000000000..b60d71ac565 --- /dev/null +++ b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -0,0 +1,40 @@ + + + + Exe + net7.0 + preview + true + true + + + + true + true + win-x64 + + + + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net7.0/fsc.dll + $(MSBuildThisFileDirectory)../../../artifacts/bin/fsc/Release/net7.0/fsc.dll + False + True + + + + + + + + + + + $(MSBuildThisFileDirectory)/../../../artifacts/packages/Release/Release + + + + + + + + diff --git a/tests/projects/SelfContained_Trimming_Test/check.cmd b/tests/projects/SelfContained_Trimming_Test/check.cmd new file mode 100644 index 00000000000..4eefff011c5 --- /dev/null +++ b/tests/projects/SelfContained_Trimming_Test/check.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0check.ps1"""" diff --git a/tests/projects/SelfContained_Trimming_Test/check.ps1 b/tests/projects/SelfContained_Trimming_Test/check.ps1 new file mode 100644 index 00000000000..3e8c36c6d3f --- /dev/null +++ b/tests/projects/SelfContained_Trimming_Test/check.ps1 @@ -0,0 +1,23 @@ +$output = .\bin\Release\net7.0\win-x64\publish\SelfContained_Trimming_Test.exe + +# Checking that it is actually running. +if (-not ($LASTEXITCODE -eq 0)) +{ + Write-Error "Test failed with exit code ${LASTEXITCODE}" -ErrorAction Stop +} + +# Checking that the output is as expected. +$expected = "All tests passed" +if (-not ($output -eq $expected)) +{ + Write-Error "Test failed with unexpected output:`nExpected:`n`t${expected}`nActual`n`t${output}" -ErrorAction Stop +} + +# Checking that FSharp.Core binary is of expected size (needs adjustments if test is updated). +$expected_len = 2181119 # In bytes +$file = Get-Item .\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll +$file_len = $file.Length +if ($file_len -le $expected_len) +{ + Write-Error "Test failed with unexpected FSharp.Core length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes" -ErrorAction Stop +} \ No newline at end of file From 745a9ffc57e82f33c417f902c262fe47a54caf98 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 14 Sep 2022 13:19:06 -0700 Subject: [PATCH 172/226] Introduce SynType.SignatureParameter. (#13879) (#13898) * Introduce SynType.SignatureParameter. * Add missing SynType cases in walkers. Co-authored-by: Florian Verdonck Co-authored-by: Vlad Zarytovskii --- src/Compiler/Checking/CheckExpressions.fs | 3 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 9 ++- src/Compiler/Service/ServiceParsedInputOps.fs | 23 ++++-- src/Compiler/SyntaxTree/SyntaxTree.fs | 5 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 8 +++ src/Compiler/pars.fsy | 17 +++-- ...erService.SurfaceArea.netstandard.expected | 15 ++++ .../SyntaxTreeTests/SignatureTypeTests.fs | 41 +++++++++++ tests/service/SyntaxTreeTests/TypeTests.fs | 70 +++++++++++++++++++ .../service/SyntaxTreeTests/UnionCaseTests.fs | 29 +++++++- 10 files changed, 206 insertions(+), 14 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 50efadc072e..8b4b99a745e 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4353,7 +4353,8 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn | SynType.App(arg1, _, args, _, _, postfix, m) -> TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m - | SynType.Paren(innerType, _) -> + | SynType.Paren(innerType, _) + | SynType.SignatureParameter(usedType = innerType) -> TcTypeOrMeasure kindOpt cenv newOk checkConstraints occ iwsam env tpenv innerType and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 9a1a53ac658..9a4263d4975 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -823,8 +823,13 @@ module SyntaxTraversal = | SynType.MeasureDivide (ty1, ty2, _) -> [ ty1; ty2 ] |> List.tryPick (traverseSynType path) | SynType.Tuple (path = segments) -> getTypeFromTuplePath segments |> List.tryPick (traverseSynType path) | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr - | SynType.Anon _ -> None - | _ -> None + | SynType.Paren (innerType = t) + | SynType.SignatureParameter (usedType = t) -> traverseSynType path t + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.LongIdent _ + | SynType.Var _ + | SynType.StaticConstant _ -> None visitor.VisitType(origPath, defaultTraverse, ty) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index d41cef4a04b..7b1fc766c1d 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -669,8 +669,15 @@ module ParsedInput = | SynType.HashConstraint (t, _) -> walkType t | SynType.MeasureDivide (t1, t2, _) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.MeasurePower (t, _, _) -> walkType t - | SynType.Paren (t, _) -> walkType t - | _ -> None + | SynType.Paren (t, _) + | SynType.SignatureParameter (usedType = t) -> walkType t + | SynType.StaticConstantExpr (e, _) -> walkExpr e + | SynType.StaticConstantNamed (ident, value, _) -> List.tryPick walkType [ ident; value ] + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.LongIdent _ + | SynType.Var _ + | SynType.StaticConstant _ -> None and walkClause clause = let (SynMatchClause (pat = pat; whenExpr = e1; resultExpr = e2)) = clause @@ -1661,7 +1668,8 @@ module ParsedInput = | SynType.Array (_, t, _) | SynType.HashConstraint (t, _) | SynType.MeasurePower (t, _, _) - | SynType.Paren (t, _) -> walkType t + | SynType.Paren (t, _) + | SynType.SignatureParameter (usedType = t) -> walkType t | SynType.Fun (argType = t1; returnType = t2) | SynType.MeasureDivide (t1, t2, _) -> walkType t1 @@ -1675,7 +1683,14 @@ module ParsedInput = | SynType.WithGlobalConstraints (t, typeConstraints, _) -> walkType t List.iter walkTypeConstraint typeConstraints - | _ -> () + | SynType.StaticConstantExpr (e, _) -> walkExpr e + | SynType.StaticConstantNamed (ident, value, _) -> + walkType ident + walkType value + | SynType.Anon _ + | SynType.AnonRecd _ + | SynType.Var _ + | SynType.StaticConstant _ -> () and walkClause (SynMatchClause (pat = pat; whenExpr = e1; resultExpr = e2)) = walkPat pat diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8a0b853f63e..ce5571ab4d9 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -435,6 +435,8 @@ type SynType = | Paren of innerType: SynType * range: range + | SignatureParameter of attributes: SynAttributes * optional: bool * id: Ident option * usedType: SynType * range: range + member x.Range = match x with | SynType.App (range = m) @@ -452,7 +454,8 @@ type SynType = | SynType.HashConstraint (range = m) | SynType.MeasureDivide (range = m) | SynType.MeasurePower (range = m) - | SynType.Paren (range = m) -> m + | SynType.Paren (range = m) + | SynType.SignatureParameter (range = m) -> m | SynType.LongIdent lidwd -> lidwd.Range [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 503a7b2faa7..2af399af0e4 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -510,6 +510,14 @@ type SynType = | Paren of innerType: SynType * range: range + /// F# syntax: a: b, used in signatures and type annotations + | SignatureParameter of + attributes: SynAttributes * + optional: bool * + id: Ident option * + usedType: SynType * + range: range + /// Gets the syntax range of this construct member Range: range diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index c0453c0c80c..d7bbdaaf68e 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5082,22 +5082,29 @@ topTupleTypeElements: topAppType: | attributes appType COLON appType { match $2 with - | SynType.LongIdent(SynLongIdent([id], _, _)) -> $4, SynArgInfo($1, false, Some id) + | SynType.LongIdent(SynLongIdent([id], _, _)) -> + let m = rhs2 parseState 1 4 + SynType.SignatureParameter($1, false, Some id, $4, m), SynArgInfo($1, false, Some id) | _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) } | attributes QMARK ident COLON appType - { $5, SynArgInfo($1, true, Some $3) } + { let m = rhs2 parseState 1 5 + SynType.SignatureParameter($1, true, Some $3, $5, m), SynArgInfo($1, true, Some $3) } | attributes appType - { ($2, SynArgInfo($1, false, None)) } + { let m = rhs2 parseState 1 2 + SynType.SignatureParameter($1, false, None, $2, m), SynArgInfo($1, false, None) } | appType COLON appType { match $1 with - | SynType.LongIdent(SynLongIdent([id], _, _)) -> $3, SynArgInfo([], false, Some id) + | SynType.LongIdent(SynLongIdent([id], _, _)) -> + let m = rhs2 parseState 1 3 + SynType.SignatureParameter([], false, Some id, $3, m), SynArgInfo([], false, Some id) | _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsSyntaxErrorInLabeledType()) } | QMARK ident COLON appType - { $4, SynArgInfo([], true, Some $2) } + { let m = rhs2 parseState 1 4 + SynType.SignatureParameter([], true, Some $2, $4, m), SynArgInfo([], true, Some $2) } | appType { $1, SynArgInfo([], false, None) } diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index b808314ad58..083c2ea9310 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -8483,6 +8483,16 @@ FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType get_innerTy FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Syntax.SynType innerType FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynType+Paren: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean get_optional() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Boolean optional +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType get_usedType() +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Syntax.SynType usedType +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+SignatureParameter: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] get_id() +FSharp.Compiler.Syntax.SynType+SignatureParameter: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident] id FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst constant FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Syntax.SynConst get_constant() FSharp.Compiler.Syntax.SynType+StaticConstant: FSharp.Compiler.Text.Range get_range() @@ -8508,6 +8518,7 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 LongIdentApp FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasureDivide FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasurePower FSharp.Compiler.Syntax.SynType+Tags: Int32 Paren +FSharp.Compiler.Syntax.SynType+Tags: Int32 SignatureParameter FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstant FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantExpr FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNamed @@ -8541,6 +8552,7 @@ FSharp.Compiler.Syntax.SynType: Boolean IsLongIdentApp FSharp.Compiler.Syntax.SynType: Boolean IsMeasureDivide FSharp.Compiler.Syntax.SynType: Boolean IsMeasurePower FSharp.Compiler.Syntax.SynType: Boolean IsParen +FSharp.Compiler.Syntax.SynType: Boolean IsSignatureParameter FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstant FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantExpr FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNamed @@ -8558,6 +8570,7 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsLongIdentApp() FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasureDivide() FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasurePower() FSharp.Compiler.Syntax.SynType: Boolean get_IsParen() +FSharp.Compiler.Syntax.SynType: Boolean get_IsSignatureParameter() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstant() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantExpr() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNamed() @@ -8575,6 +8588,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewLongIdentApp(F FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasureDivide(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasurePower(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynRationalConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewParen(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewSignatureParameter(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) @@ -8592,6 +8606,7 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+LongIdentApp FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasureDivide FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasurePower FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Paren +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+SignatureParameter FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstant FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantExpr FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNamed diff --git a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs index 943fa5ba5e3..e7f8055fee9 100644 --- a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs +++ b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs @@ -471,3 +471,44 @@ type Z with assertRange (14, 0) (14, 4) mType3 assertRange (14, 7) (14, 11) mWith3 | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``SynValSig contains parameter names`` () = + let parseResults = + getParseResultsOfSignatureFile + """ +module Meh +val InferSynValData: + memberFlagsOpt: SynMemberFlags option * pat: SynPat option * SynReturnInfo option * origRhsExpr: SynExpr -> + x: string -> + SynValData2 +""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + SynModuleOrNamespaceSig(decls=[ + SynModuleSigDecl.Val(valSig = SynValSig(synType = + SynType.Fun( + argType = + SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some memberFlagsOpt)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some pat)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.App _) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some origRhsExpr)) + ]) + returnType = + SynType.Fun( + argType = SynType.SignatureParameter(id = Some x) + returnType = SynType.LongIdent _ + ) + ) + )) + ] ) ])) -> + Assert.AreEqual("memberFlagsOpt", memberFlagsOpt.idText) + Assert.AreEqual("pat", pat.idText) + Assert.AreEqual("origRhsExpr", origRhsExpr.idText) + Assert.AreEqual("x", x.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/TypeTests.fs b/tests/service/SyntaxTreeTests/TypeTests.fs index c38e684ada3..0c822ea94dc 100644 --- a/tests/service/SyntaxTreeTests/TypeTests.fs +++ b/tests/service/SyntaxTreeTests/TypeTests.fs @@ -524,3 +524,73 @@ let _: struct (int * int = () assertRange (2, 7) (2, 24) mTuple | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Named parameters in delegate type`` () = + let parseResults = + getParseResults + """ +type Foo = delegate of a: A * b: B -> c:C -> D + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = + SynTypeDefnKind.Delegate(signature = SynType.Fun( + argType = + SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some a)) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some b)) + ]) + returnType = + SynType.Fun( + argType = SynType.SignatureParameter(id = Some c) + returnType = SynType.LongIdent _ + ) + )))) + ]) + ]) + ])) -> + Assert.AreEqual("a", a.idText) + Assert.AreEqual("b", b.idText) + Assert.AreEqual("c", c.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Attributes in optional named member parameter`` () = + let parseResults = + getParseResults + """ +type X = + abstract member Y: [] ?a: A -> B + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel( + members = [ + SynMemberDefn.AbstractSlot(slotSig = SynValSig(synType = + SynType.Fun( + argType = SynType.SignatureParameter( + [ { Attributes = [ _ ; _ ] } ], + true, + Some a, + SynType.LongIdent _, + m + ) + returnType = SynType.LongIdent _ + ) + )) + ] + )) + ]) + ]) + ])) -> + Assert.AreEqual("a", a.idText) + assertRange (3, 23) (3, 41) m + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/UnionCaseTests.fs b/tests/service/SyntaxTreeTests/UnionCaseTests.fs index 2cb1f80b730..c9c480cc16e 100644 --- a/tests/service/SyntaxTreeTests/UnionCaseTests.fs +++ b/tests/service/SyntaxTreeTests/UnionCaseTests.fs @@ -135,4 +135,31 @@ type Currency = ])) -> assertRange (7, 4) (7, 11) mPrivate | _ -> - Assert.Fail "Could not get valid AST" \ No newline at end of file + Assert.Fail "Could not get valid AST" + +[] +let ``SynUnionCaseKind.FullType`` () = + let parseResults = + getParseResults + """ +type X = + | a: int * z:int + """ + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types(typeDefns = [ + SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = + SynTypeDefnSimpleRepr.Union(unionCases = [ + SynUnionCase(caseType = SynUnionCaseKind.FullType(fullType = SynType.Tuple(path = [ + SynTupleTypeSegment.Type(SynType.LongIdent _) + SynTupleTypeSegment.Star _ + SynTupleTypeSegment.Type(SynType.SignatureParameter(id = Some z)) + ]))) + ]))) + ]) + ]) + ])) -> + Assert.AreEqual("z", z.idText) + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" \ No newline at end of file From cb177b1e8b0d65d3ddf39d238a64d3f05622c295 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Thu, 15 Sep 2022 12:01:14 +0200 Subject: [PATCH 173/226] Print int[] as int array. (#13700) Co-authored-by: Edgar Co-authored-by: Don Syme Co-authored-by: Vlad Zarytovskii --- src/Compiler/Checking/CheckExpressions.fs | 3 + src/Compiler/Checking/NicePrint.fs | 26 +- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 16 + src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 2 + src/Compiler/TypedTree/TypedTreeOps.fs | 16 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 + .../CustomAttributes/Basic/Basic.fs | 2 +- .../MethodsAndProperties.fs | 16 +- .../Conformance/RecordTypes/RecordTypes.fs | 2 +- .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Signatures/ArrayTests.fs | 51 ++++ .../Signatures/TestHelpers.fs | 8 +- .../TypeChecks/CheckDeclarationsTests.fs | 11 + .../E_LeftToRightOverloadResolution01.bsl | 8 +- tests/fsharp/core/auto-widen/5.0/test.bsl | 36 +-- tests/fsharp/core/auto-widen/preview/test.bsl | 30 +- .../core/printing/output.1000.stdout.bsl | 256 ++++++++-------- .../core/printing/output.200.stdout.bsl | 284 +++++++++--------- .../fsharp/core/printing/output.47.stdout.bsl | 256 ++++++++-------- .../core/printing/output.multiemit.stdout.bsl | 256 ++++++++-------- .../core/printing/output.off.stdout.bsl | 240 +++++++-------- tests/fsharp/core/printing/output.stdout.bsl | 256 ++++++++-------- tests/fsharp/typecheck/sigs/neg04.bsl | 2 +- tests/fsharp/typecheck/sigs/neg117.bsl | 4 +- tests/fsharp/typecheck/sigs/neg20.bsl | 12 +- .../fsharp/typecheck/sigs/version50/neg20.bsl | 12 +- tests/service/EditorTests.fs | 4 +- tests/service/ExprTests.fs | 10 +- .../Tests.LanguageService.ErrorList.fs | 4 +- .../Tests.LanguageService.ParameterInfo.fs | 10 +- .../Tests.LanguageService.QuickInfo.fs | 8 +- .../tests/UnitTests/QuickInfoProviderTests.fs | 2 +- 32 files changed, 984 insertions(+), 863 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 8b4b99a745e..104d1df5eac 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4303,6 +4303,9 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn | SynType.LongIdent synLongId -> TcLongIdentType kindOpt cenv newOk checkConstraints occ iwsam env tpenv synLongId + | MultiDimensionArrayType (rank, elemTy, m) -> + TcElementType cenv newOk checkConstraints occ env tpenv rank elemTy m + | SynType.App (StripParenTypes (SynType.LongIdent longId), _, args, _, _, postfix, m) -> TcLongIdentAppType kindOpt cenv newOk checkConstraints occ iwsam env tpenv longId postfix args m diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index e32789c9fe2..63b927f0800 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -180,7 +180,11 @@ module internal PrintUtilities = let isArray = not prefix && isArrayTyconRef denv.g tcref let demangled = if isArray then - tcref.DisplayNameCore // no backticks for arrays "int[]" + let numberOfCommas = tcref.CompiledName |> Seq.filter (fun c -> c = ',') |> Seq.length + if numberOfCommas = 0 then + "array" + else + $"array{numberOfCommas + 1}d" else let name = if denv.includeStaticParametersInTypeNames then @@ -198,11 +202,7 @@ module internal PrintUtilities = tagEntityRefName denv tcref demangled |> mkNav tcref.DefinitionRange - let tyconTextL = - if isArray then - tyconTagged |> rightL - else - tyconTagged |> wordL + let tyconTextL = tyconTagged |> wordL if denv.shortTypeNames then tyconTextL @@ -873,6 +873,16 @@ module PrintTypes = | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) + and layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level = + let innerLayout = layoutTypeWithInfoAndPrec denv env prec innerT + + let arrayLayout = + tagEntityRefName denv tcref $"array{level}d" + |> mkNav tcref.DefinitionRange + |> wordL + + innerLayout ^^ arrayLayout + /// Layout a type, taking precedence into account to insert brackets where needed and layoutTypeWithInfoAndPrec denv env prec ty = let g = denv.g @@ -893,6 +903,10 @@ module PrintTypes = // Always prefer 'float' to 'float<1>' | TType_app (tc, args, _) when tc.IsMeasureableReprTycon && List.forall (isDimensionless g) args -> layoutTypeWithInfoAndPrec denv env prec (reduceTyconRefMeasureableOrProvided g tc args) + + // Special case for nested array> shape + | TTypeMultiDimensionalArrayAsGeneric (tcref, innerT, level) -> + layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level // Layout a type application | TType_ucase (UnionCaseRef(tc, _), args) diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 590f5523214..b36ec372a78 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1059,3 +1059,19 @@ let getTypeFromTuplePath (path: SynTupleTypeSegment list) : SynType list = |> List.choose (function | SynTupleTypeSegment.Type t -> Some t | _ -> None) + +let (|MultiDimensionArrayType|_|) (t: SynType) = + match t with + | 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 System.Char.IsDigit + |> Seq.toArray + |> System.String + |> int + + Some(rank, elementType, m) + else + None + | _ -> None diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index cafafaa0ec3..5af8180d05e 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -353,3 +353,5 @@ val normalizeTupleExpr: exprs: SynExpr list -> commas: range list -> SynExpr lis val desugarGetSetMembers: memberDefns: SynMemberDefns -> SynMemberDefns val getTypeFromTuplePath: path: SynTupleTypeSegment list -> SynType list + +val (|MultiDimensionArrayType|_|): t: SynType -> (int * SynType * range) option diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 7842afdc105..6678298f4b8 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10384,7 +10384,7 @@ let (|EmptyModuleOrNamespaces|_|) (moduleOrNamespaceContents: ModuleOrNamespaceC | ModuleOrNamespaceContents.TMDefRec _ | ModuleOrNamespaceContents.TMDefs _ -> true | _ -> false) - + let emptyModuleOrNamespaces = defs |> List.choose (function @@ -10407,3 +10407,17 @@ let (|EmptyModuleOrNamespaces|_|) (moduleOrNamespaceContents: ModuleOrNamespaceC else None | _ -> None + +let (|TTypeMultiDimensionalArrayAsGeneric|_|) (t: TType) = + let rec (|Impl|_|) t = + match t with + | TType_app(tc, [Impl(outerTc, innerT, currentLevel)], _) when tc.DisplayNameCore = "array" -> + Some (outerTc, innerT, currentLevel + 1) + | TType_app(tc, [arg], _) when tc.DisplayNameCore = "array" -> + Some (tc, arg, 1) + | _ -> None + + match t with + | Impl (tc, arg, level) -> + if level > 2 then Some (tc, arg, level) else None + | _ -> None diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 2c6ce527458..c4afc142086 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2687,3 +2687,6 @@ type TraitConstraintInfo with /// This will match anything that does not have any types or bindings. val (|EmptyModuleOrNamespaces|_|): moduleOrNamespaceContents: ModuleOrNamespaceContents -> (ModuleOrNamespace list) option + +/// Captures an application type with a multi-dimensional array as postfix. +val (|TTypeMultiDimensionalArrayAsGeneric|_|): t: TType -> (TyconRef * TType * int) option diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/CustomAttributes/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/CustomAttributes/Basic/Basic.fs index e7257c873cf..8bc5e456829 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/CustomAttributes/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/CustomAttributes/Basic/Basic.fs @@ -103,7 +103,7 @@ module Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 1, Line 10, Col 3, Line 10, Col 59, "This expression was expected to have type\n 'int[]' \nbut here has type\n 'unit' ") + (Error 1, Line 10, Col 3, Line 10, Col 59, "This expression was expected to have type\n 'int array' \nbut here has type\n 'unit' ") (Error 267, Line 10, Col 3, Line 10, Col 59, "This is not a valid constant expression or custom attribute value") (Error 850, Line 10, Col 3, Line 10, Col 59, "This attribute cannot be used in this version of F#") (Error 850, Line 13, Col 3, Line 13, Col 52, "This attribute cannot be used in this version of F#") diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs index c95880733f7..363e045f26a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs @@ -97,10 +97,10 @@ module MethodsAndProperties = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 1, Line 11, Col 24, Line 11, Col 33, "This expression was expected to have type\n ''a[,]' \nbut here has type\n 'int[]' ") - (Error 1, Line 12, Col 25, Line 12, Col 32, "This expression was expected to have type\n ''a[]' \nbut here has type\n 'int[,]' ") - (Error 1, Line 13, Col 26, Line 13, Col 37, "This expression was expected to have type\n ''a[]' \nbut here has type\n 'int[,,]' ") - (Error 1, Line 14, Col 27, Line 14, Col 38, "This expression was expected to have type\n ''a[]' \nbut here has type\n 'int[,,,]' ") + (Error 1, Line 11, Col 24, Line 11, Col 33, "This expression was expected to have type\n ''a array2d' \nbut here has type\n 'int array' ") + (Error 1, Line 12, Col 25, Line 12, Col 32, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array2d' ") + (Error 1, Line 13, Col 26, Line 13, Col 37, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array3d' ") + (Error 1, Line 14, Col 27, Line 14, Col 38, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array4d' ") ] // SOURCE=E_IndexerArityMismatch02.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_IndexerArityMismatch02.fs @@ -110,10 +110,10 @@ module MethodsAndProperties = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 1, Line 11, Col 24, Line 11, Col 35, "This expression was expected to have type\n ''a[,,]' \nbut here has type\n 'int[]' ") - (Error 1, Line 12, Col 25, Line 12, Col 32, "This expression was expected to have type\n ''a[]' \nbut here has type\n 'int[,]' ") - (Error 1, Line 13, Col 27, Line 13, Col 38, "This expression was expected to have type\n ''a[,,]' \nbut here has type\n 'int[,,,]' ") - (Error 1, Line 14, Col 27, Line 14, Col 36, "This expression was expected to have type\n ''a[,]' \nbut here has type\n 'int[,,,]' ") + (Error 1, Line 11, Col 24, Line 11, Col 35, "This expression was expected to have type\n ''a array3d' \nbut here has type\n 'int array' ") + (Error 1, Line 12, Col 25, Line 12, Col 32, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array2d' ") + (Error 1, Line 13, Col 27, Line 13, Col 38, "This expression was expected to have type\n ''a array3d' \nbut here has type\n 'int array4d' ") + (Error 1, Line 14, Col 27, Line 14, Col 36, "This expression was expected to have type\n ''a array2d' \nbut here has type\n 'int array4d' ") ] // SOURCE=E_IndexerIndeterminateType01.fs SCFLAGS=--test:ErrorRanges # E_IndexerIndeterminateType01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/RecordTypes/RecordTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/RecordTypes/RecordTypes.fs index f03fa9ca86b..bfd7f87ce75 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/RecordTypes/RecordTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/RecordTypes/RecordTypes.fs @@ -118,7 +118,7 @@ module RecordTypes = |> verifyTypeCheck |> shouldFail |> withDiagnostics [ - (Error 1, Line 7, Col 17, Line 7, Col 47, "This expression was expected to have type\n 'int[]' \nbut here has type\n 'RecType' ") + (Error 1, Line 7, Col 17, Line 7, Col 47, "This expression was expected to have type\n 'int array' \nbut here has type\n 'RecType' ") ] // SOURCE=E_RecordsNotNull01.fs # E_RecordsNotNull01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index d8bd7df90cf..e6e08b27af7 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -199,6 +199,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs new file mode 100644 index 00000000000..2317005032f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs @@ -0,0 +1,51 @@ +module FSharp.Compiler.ComponentTests.Signatures.SignatureTests + +open Xunit +open FSharp.Compiler.ComponentTests.Signatures.TestHelpers + +[] +[] +[] +[ = [| 3 |]", + "val c: int array")>] +let ``Value with int array return type`` implementation expectedSignature = + assertSingleSignatureBinding implementation expectedSignature + +[] +let ``2 dimensional array`` () = + assertSingleSignatureBinding + "let a : int[,] = failwith \"todo\"" + "val a: int array2d" + +[] +let ``3 dimensional array`` () = + assertSingleSignatureBinding + "let a : int[,,] = failwith \"todo\"" + "val a: int array3d" + +[] +let ``4 dimensional array`` () = + assertSingleSignatureBinding + "let a : int[,,,] = failwith \"todo\"" + "val a: int array4d" + +[] +let ``5 till 32 dimensional array`` () = + [ 5 .. 32 ] + |> List.iter (fun idx -> + let arrayType = + [ 1 .. idx ] + |> List.fold (fun acc _ -> $"array<{acc}>") "int" + + assertSingleSignatureBinding + $"let a : {arrayType} = failwith \"todo\"" + $"val a: int array{idx}d" + ) + +[] +let ``Use array2d syntax in implementation`` () = + assertSingleSignatureBinding + "let y : int array2d = Array2D.init 0 0 (fun _ _ -> 0)" + "val y: int array2d" diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs index 23ad4176c8b..b7fd2f13742 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/TestHelpers.fs @@ -2,6 +2,7 @@ open System open FsUnit +open FSharp.Test.Compiler let prependNewline v = String.Concat("\n", v) @@ -11,4 +12,9 @@ let equal x = | :? String as s -> s.Replace("\r\n", "\n") |> box | x -> x - equal x \ No newline at end of file + equal x + +let assertSingleSignatureBinding implementation signature = + FSharp $"module A\n\n{implementation}" + |> printSignatures + |> should equal $"\nmodule A\n\n{signature}" diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs index 1be9ceb6910..885bb0aa0a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckDeclarationsTests.fs @@ -103,6 +103,17 @@ namespace FSharpTest exception CustomException of details: string with member self.Details with get (): string = self.details +""" + |> compile + |> shouldSucceed + |> ignore + + [] + let ``Array2 in return type`` () = + FSharp """ +module Foo + +let y : int array2d = Array2D.init 0 0 (fun _ _ -> 0) """ |> compile |> shouldSucceed diff --git a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl index 1eebf220332..8d60e94af11 100644 --- a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl +++ b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl @@ -4,8 +4,8 @@ E_LeftToRightOverloadResolution01.fsx(7,23,7,51): typecheck error FS0041: A uniq Known type of argument: 'a Candidates: - - System.Console.WriteLine(buffer: char[]) : unit - - System.Console.WriteLine(format: string, [] arg: obj[]) : unit + - System.Console.WriteLine(buffer: char array) : unit + - System.Console.WriteLine(format: string, [] arg: obj array) : unit - System.Console.WriteLine(value: bool) : unit - System.Console.WriteLine(value: char) : unit - System.Console.WriteLine(value: decimal) : unit @@ -23,8 +23,8 @@ E_LeftToRightOverloadResolution01.fsx(9,23,9,51): typecheck error FS0041: A uniq Known type of argument: 'a Candidates: - - System.Console.WriteLine(buffer: char[]) : unit - - System.Console.WriteLine(format: string, [] arg: obj[]) : unit + - System.Console.WriteLine(buffer: char array) : unit + - System.Console.WriteLine(format: string, [] arg: obj array) : unit - System.Console.WriteLine(value: bool) : unit - System.Console.WriteLine(value: char) : unit - System.Console.WriteLine(value: decimal) : unit diff --git a/tests/fsharp/core/auto-widen/5.0/test.bsl b/tests/fsharp/core/auto-widen/5.0/test.bsl index 9aac4fe55fb..d5b3e596509 100644 --- a/tests/fsharp/core/auto-widen/5.0/test.bsl +++ b/tests/fsharp/core/auto-widen/5.0/test.bsl @@ -190,8 +190,8 @@ test.fsx(121,14,121,21): typecheck error FS0041: No overloads match for method ' Known type of argument: int Available overloads: - - static member C.M1: [] x: int64[] -> int64 // Argument 'x' doesn't match - - static member C.M1: [] x: int64[] -> int64 // Argument at index 1 doesn't match + - static member C.M1: [] x: int64 array -> int64 // Argument 'x' doesn't match + - static member C.M1: [] x: int64 array -> int64 // Argument at index 1 doesn't match test.fsx(122,19,122,20): typecheck error FS0001: This expression was expected to have type 'int64' @@ -208,8 +208,8 @@ test.fsx(127,14,127,21): typecheck error FS0041: No overloads match for method ' Known type of argument: int Available overloads: - - static member C.M1: [] x: double[] -> double // Argument 'x' doesn't match - - static member C.M1: [] x: double[] -> double // Argument at index 1 doesn't match + - static member C.M1: [] x: double array -> double // Argument 'x' doesn't match + - static member C.M1: [] x: double array -> double // Argument at index 1 doesn't match test.fsx(128,19,128,20): typecheck error FS0001: This expression was expected to have type 'double' @@ -446,12 +446,12 @@ but here has type test.fsx(256,30,256,39): typecheck error FS0001: This expression was expected to have type 'Array' but here has type - 'uint16[]' + 'uint16 array' test.fsx(258,30,258,38): typecheck error FS0001: This expression was expected to have type 'Array' but here has type - ''a[]' + ''a array' test.fsx(260,36,260,38): typecheck error FS0001: This expression was expected to have type 'IComparable' @@ -801,62 +801,62 @@ but here has type test.fsx(390,28,390,41): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(391,30,392,57): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(393,30,394,56): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(395,30,396,58): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(397,30,398,59): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(399,30,399,59): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(400,30,400,63): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(401,30,402,63): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(403,30,404,64): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(405,31,405,59): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(406,31,407,60): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(408,31,409,61): typecheck error FS0001: This expression was expected to have type 'seq' but here has type - ''a[]' + ''a array' test.fsx(429,10,437,16): typecheck error FS0001: This expression was expected to have type 'seq' diff --git a/tests/fsharp/core/auto-widen/preview/test.bsl b/tests/fsharp/core/auto-widen/preview/test.bsl index 94ad06d8bc0..f449e09a610 100644 --- a/tests/fsharp/core/auto-widen/preview/test.bsl +++ b/tests/fsharp/core/auto-widen/preview/test.bsl @@ -269,9 +269,9 @@ test.fsx(248,51,248,52): typecheck error FS3388: This expression implicitly conv test.fsx(253,36,253,37): typecheck error FS3388: This expression implicitly converts type 'int' to type 'IComparable'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(256,30,256,39): typecheck error FS3388: This expression implicitly converts type 'uint16[]' to type 'Array'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(256,30,256,39): typecheck error FS3388: This expression implicitly converts type 'uint16 array' to type 'Array'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(258,30,258,38): typecheck error FS3388: This expression implicitly converts type ''a[]' to type 'Array'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(258,30,258,38): typecheck error FS3388: This expression implicitly converts type ''a array' to type 'Array'. See https://aka.ms/fsharp-implicit-convs. test.fsx(260,36,260,38): typecheck error FS3388: This expression implicitly converts type 'Numerics.BigInteger' to type 'IComparable'. See https://aka.ms/fsharp-implicit-convs. @@ -507,69 +507,69 @@ test.fsx(386,40,386,41): typecheck error FS3389: This expression uses a built-in test.fsx(386,40,386,41): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(390,28,390,41): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(390,28,390,41): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(390,37,390,38): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(390,37,390,38): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(391,30,392,57): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(391,30,392,57): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(391,39,391,40): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(391,39,391,40): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(393,30,394,56): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(393,30,394,56): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(394,52,394,53): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(394,52,394,53): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(395,30,396,58): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(395,30,396,58): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(396,54,396,55): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(396,54,396,55): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(397,30,398,59): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(397,30,398,59): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(397,39,397,40): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(397,39,397,40): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(399,30,399,59): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(399,30,399,59): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(400,30,400,63): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(400,30,400,63): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(400,59,400,60): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(400,59,400,60): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(401,30,402,63): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(401,30,402,63): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(402,59,402,60): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(402,59,402,60): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(403,30,404,64): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(403,30,404,64): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(403,39,403,40): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(403,39,403,40): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(405,31,405,59): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(405,31,405,59): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(405,44,405,45): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(405,44,405,45): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(406,31,407,60): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(406,31,407,60): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(407,44,407,45): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. test.fsx(407,44,407,45): typecheck error FS3388: This expression implicitly converts type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(408,31,409,61): typecheck error FS3388: This expression implicitly converts type 'int64[]' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. +test.fsx(408,31,409,61): typecheck error FS3388: This expression implicitly converts type 'int64 array' to type 'seq'. See https://aka.ms/fsharp-implicit-convs. test.fsx(408,40,408,41): typecheck error FS3389: This expression uses a built-in implicit conversion to convert type 'int' to type 'int64'. See https://aka.ms/fsharp-implicit-convs. @@ -639,4 +639,4 @@ test.fsx(544,14,544,21): typecheck error FS0039: The type 'float64' is not defin test.fsx(610,25,610,43): typecheck error FS3388: This expression implicitly converts type 'int -> unit' to type 'Action'. See https://aka.ms/fsharp-implicit-convs. -test.fsx(617,18,617,22): typecheck error FS3388: This expression implicitly converts type 'int -> int' to type 'Func'. See https://aka.ms/fsharp-implicit-convs. \ No newline at end of file +test.fsx(617,18,617,22): typecheck error FS3388: This expression implicitly converts type 'int -> int' to type 'Func'. See https://aka.ms/fsharp-implicit-convs. diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index cdf91519c8d..00b60931d99 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -13,7 +13,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -26,7 +26,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -39,7 +39,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -48,7 +48,7 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form = System.Windows.Forms.Form, Text: f1 form -val fs: System.Windows.Forms.Form[] = +val fs: System.Windows.Forms.Form array = [|System.Windows.Forms.Form, Text: fs #0; System.Windows.Forms.Form, Text: fs #1; System.Windows.Forms.Form, Text: fs #2; @@ -159,7 +159,7 @@ val xs: string list = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...] -val xa: string[] = +val xa: string array = [|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; "20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"; "28"; "29"; "30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"; @@ -169,14 +169,14 @@ val xa: string[] = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...|] -val xa2: string[,] = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] - ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] - ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] - ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] - ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] - ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] - ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] - ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] +val xa2: string array2d = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] + ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] + ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] + ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] + ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] + ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] + ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] + ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] val sxs0: Set = set [] > val sxs1: Set = set ["0"] @@ -209,7 +209,7 @@ val sxs0: Set = set [] val a: string = "sub-binding" val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option = + (string list * string list * string array2d) option = (Some (, , , System.Windows.Forms.Form, Text: f1 form), Some (["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; @@ -253,7 +253,7 @@ val opt5: int list option option option option option list = 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 0]))))] val mkStr: n: int -> string -val strs: string[] = +val strs: string array = [|""; "-"; "--"; "---"; "----"; "-----"; "------"; "-------"; "--------"; "---------"; "----------"; "-----------"; "------------"; "-------------"; "--------------"; "---------------"; "----------------"; @@ -331,7 +331,7 @@ val strs: string[] = "-------------------------------------------------------------"+[37 chars]; "-------------------------------------------------------------"+[38 chars]; ...|] -val str7s: string[] = +val str7s: string array = [|""; "-------"; "--------------"; "---------------------"; "----------------------------"; "-----------------------------------"; "------------------------------------------"; @@ -429,7 +429,7 @@ val str7s: string[] = "-------------------------------------------------------------"+[625 chars]; "-------------------------------------------------------------"+[632 chars]; ...|] -val grids: string[,] = +val grids: string array2d = [[""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""] @@ -873,7 +873,7 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C = -val csA: C[] = +val csA: C array = [|; ; ; ; ; ; @@ -924,7 +924,7 @@ val csA: C[] = ; ; ; ; ; ; ...|] -val csB: C[] = +val csB: C array = [|; ; ; ; ; ; @@ -975,7 +975,7 @@ val csB: C[] = ; ; ; ; ; ; ...|] -val csC: C[] = +val csC: C array = [|; ; ; ; ; ; @@ -1085,10 +1085,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > val it: string = "Check #help" @@ -1244,7 +1244,7 @@ val r10: r = { f0 = 0 f7 = 7 f8 = 8 f9 = 9 } -val r10s: r[] = +val r10s: r array = [|{ f0 = 0 f1 = 1 f2 = 2 @@ -1291,7 +1291,7 @@ val r10s: r[] = f7 = 7 f8 = 8 f9 = 9 }; ...|] -val r10s': string * r[] = +val r10s': string * r array = ("one extra node", [|{ f0 = 0 f1 = 1 @@ -1482,11 +1482,11 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list = [1; 2; 3] - val xArray: int[] = [|1; 2; 3|] + val xArray: int array = [|1; 2; 3|] val xString: string = "abcdef" val xOption: int option = Some 12 - val xArray2: (int * int)[,] = [[(0, 0); (0, 1)] - [(1, 0); (1, 1)]] + val xArray2: (int * int) array2d = [[(0, 0); (0, 1)] + [(1, 0); (1, 1)]] val xSeq: seq module Test4343e = type C = @@ -1712,707 +1712,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index cb22322c94a..2c12e25b197 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -13,7 +13,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -26,7 +26,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -39,7 +39,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -48,7 +48,7 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form = System.Windows.Forms.Form, Text: f1 form -val fs: System.Windows.Forms.Form[] = +val fs: System.Windows.Forms.Form array = [|System.Windows.Forms.Form, Text: fs #0; System.Windows.Forms.Form, Text: fs #1; System.Windows.Forms.Form, Text: fs #2; @@ -72,13 +72,13 @@ val fs: System.Windows.Forms.Form[] = val xs: string list = ["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; ...] -val xa: string[] = +val xa: string array = [|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; ...|] -val xa2: string[,] = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] - ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] - ["20"; "21"; "22"; "23"; ...] - ...] +val xa2: string array2d = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] + ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] + ["20"; "21"; "22"; "23"; ...] + ...] val sxs0: Set = set [] > val sxs1: Set = set ["0"] @@ -111,7 +111,7 @@ val sxs0: Set = set [] val a: string = "sub-binding" val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option = + (string list * string list * string array2d) option = (Some (, , , System.Windows.Forms.Form, Text: f1 form), Some (["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; @@ -141,12 +141,12 @@ val opt5: int list option option option option option list = Some (Some (Some (Some (Some [1; 2; 3; 4; 5; 6])))); Some (Some (Some (Some ...))); ...] val mkStr: n: int -> string -val strs: string[] = +val strs: string array = [|""; "-"; "--"; "---"; "----"; "-----"; "------"; "-------"; "--------"; "---------"; "----------"; "-----------"; "------------"; "-------------"; "--------------"; "---------------"; "----------------"; "-----------------"; "------------------"; "-------------------"; ...|] -val str7s: string[] = +val str7s: string array = [|""; "-------"; "--------------"; "---------------------"; "----------------------------"; "-----------------------------------"; "------------------------------------------"; @@ -164,7 +164,7 @@ val str7s: string[] = "-------------------------------------------------------------"+[65 chars]; "-------------------------------------------------------------"+[72 chars]; ...|] -val grids: string[,] = +val grids: string array2d = [[""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ...] ...] @@ -313,7 +313,7 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C = -val csA: C[] = +val csA: C array = [|; ; ; ; ; ; @@ -324,7 +324,7 @@ val csA: C[] = ; ; ; ; ; ; ...|] -val csB: C[] = +val csB: C array = [|; ; ; ; ; ; @@ -335,7 +335,7 @@ val csB: C[] = ; ; ; ; ; ; ...|] -val csC: C[] = +val csC: C array = [|; ; ; ; ; ; @@ -405,10 +405,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > val it: string = "Check #help" @@ -564,26 +564,26 @@ val r10: r = { f0 = 0 f7 = 7 f8 = 8 f9 = 9 } -val r10s: r[] = [|{ f0 = 0 - f1 = 1 - f2 = 2 - f3 = 3 - f4 = 4 - f5 = 5 - f6 = 6 - f7 = 7 - f8 = 8 - f9 = 9 }; ...|] -val r10s': string * r[] = ("one extra node", [|{ f0 = 0 - f1 = 1 - f2 = 2 - f3 = 3 - f4 = 4 - f5 = 5 - f6 = 6 - f7 = 7 - f8 = 8 - f9 = ... }; ...|]) +val r10s: r array = [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = 9 }; ...|] +val r10s': string * r array = ("one extra node", [|{ f0 = 0 + f1 = 1 + f2 = 2 + f3 = 3 + f4 = 4 + f5 = 5 + f6 = 6 + f7 = 7 + f8 = 8 + f9 = ... }; ...|]) > val x1564_A1: int = 1 @@ -727,11 +727,11 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list = [1; 2; 3] - val xArray: int[] = [|1; 2; 3|] + val xArray: int array = [|1; 2; 3|] val xString: string = "abcdef" val xOption: int option = Some 12 - val xArray2: (int * int)[,] = [[(0, 0); (0, 1)] - [(1, 0); (1, 1)]] + val xArray2: (int * int) array2d = [[(0, 0); (0, 1)] + [(1, 0); (1, 1)]] val xSeq: seq module Test4343e = type C = @@ -957,707 +957,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index b6f38074b36..2887d6021ac 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -11,7 +11,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -24,7 +24,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -37,7 +37,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -46,7 +46,7 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form = System.Windows.Forms.Form, Text: f1 form -val fs: System.Windows.Forms.Form[] = +val fs: System.Windows.Forms.Form array = [|System.Windows.Forms.Form, Text: fs #0; System.Windows.Forms.Form, Text: fs #1; System.Windows.Forms.Form, Text: fs #2; @@ -157,7 +157,7 @@ val xs: string list = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...] -val xa: string[] = +val xa: string array = [|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; "20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"; "28"; "29"; "30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"; @@ -167,14 +167,14 @@ val xa: string[] = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...|] -val xa2: string[,] = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] - ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] - ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] - ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] - ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] - ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] - ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] - ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] +val xa2: string array2d = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] + ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] + ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] + ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] + ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] + ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] + ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] + ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] val sxs0: Set = set [] > val sxs1: Set = set ["0"] @@ -207,7 +207,7 @@ val sxs0: Set = set [] val a: string = "sub-binding" val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option = + (string list * string list * string array2d) option = (Some (, , , System.Windows.Forms.Form, Text: f1 form), Some (["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; @@ -268,7 +268,7 @@ val opt5: int list option option option option option list = 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 0]))))] val mkStr: n: int -> string -val strs: string[] = +val strs: string array = [|""; "-"; "--"; "---"; "----"; "-----"; "------"; "-------"; "--------"; "---------"; "----------"; "-----------"; "------------"; "-------------"; "--------------"; "---------------"; "----------------"; @@ -345,7 +345,7 @@ val strs: string[] = "-------------------------------------------------------------"+[36 chars]; "-------------------------------------------------------------"+[37 chars]; "-------------------------------------------------------------"+[38 chars]|] -val str7s: string[] = +val str7s: string array = [|""; "-------"; "--------------"; "---------------------"; "----------------------------"; "-----------------------------------"; "------------------------------------------"; @@ -442,7 +442,7 @@ val str7s: string[] = "-------------------------------------------------------------"+[618 chars]; "-------------------------------------------------------------"+[625 chars]; "-------------------------------------------------------------"+[632 chars]|] -val grids: string[,] = +val grids: string array2d = [[""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""] @@ -3832,7 +3832,7 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C = -val csA: C[] = +val csA: C array = [|; ; ; ; ; ; @@ -3883,7 +3883,7 @@ val csA: C[] = ; ; ; ; ; ; ...|] -val csB: C[] = +val csB: C array = [|; ; ; ; ; ; @@ -3934,7 +3934,7 @@ val csB: C[] = ; ; ; ; ; ; ...|] -val csC: C[] = +val csC: C array = [|; ; ; ; ; ; @@ -4044,10 +4044,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > val it: string = "Check #help" @@ -4201,7 +4201,7 @@ val r10: r = { f0 = 0 f7 = 7 f8 = 8 f9 = 9 } -val r10s: r[] = +val r10s: r array = [|{ f0 = 0 f1 = 1 f2 = 2 @@ -4542,7 +4542,7 @@ val r10s: r[] = f7 = 7 f8 = 8 f9 = 9 }|] -val r10s': string * r[] = +val r10s': string * r array = ("one extra node", [|{ f0 = 0 f1 = 1 @@ -5027,11 +5027,11 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list = [1; 2; 3] - val xArray: int[] = [|1; 2; 3|] + val xArray: int array = [|1; 2; 3|] val xString: string = "abcdef" val xOption: int option = Some 12 - val xArray2: (int * int)[,] = [[(0, 0); (0, 1)] - [(1, 0); (1, 1)]] + val xArray2: (int * int) array2d = [[(0, 0); (0, 1)] + [(1, 0); (1, 1)]] val xSeq: seq module Test4343e = type C = @@ -5257,707 +5257,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 9183285f872..4b00548df81 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -11,7 +11,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -24,7 +24,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -37,7 +37,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -46,7 +46,7 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form = System.Windows.Forms.Form, Text: f1 form -val fs: System.Windows.Forms.Form[] = +val fs: System.Windows.Forms.Form array = [|System.Windows.Forms.Form, Text: fs #0; System.Windows.Forms.Form, Text: fs #1; System.Windows.Forms.Form, Text: fs #2; @@ -157,7 +157,7 @@ val xs: string list = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...] -val xa: string[] = +val xa: string array = [|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; "20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"; "28"; "29"; "30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"; @@ -167,14 +167,14 @@ val xa: string[] = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...|] -val xa2: string[,] = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] - ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] - ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] - ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] - ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] - ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] - ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] - ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] +val xa2: string array2d = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] + ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] + ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] + ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] + ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] + ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] + ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] + ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] val sxs0: Set = set [] > val sxs1: Set = set ["0"] @@ -207,7 +207,7 @@ val sxs0: Set = set [] val a: string = "sub-binding" val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option = + (string list * string list * string array2d) option = (Some (, , , System.Windows.Forms.Form, Text: f1 form), Some (["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; @@ -268,7 +268,7 @@ val opt5: int list option option option option option list = 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 0]))))] val mkStr: n: int -> string -val strs: string[] = +val strs: string array = [|""; "-"; "--"; "---"; "----"; "-----"; "------"; "-------"; "--------"; "---------"; "----------"; "-----------"; "------------"; "-------------"; "--------------"; "---------------"; "----------------"; @@ -345,7 +345,7 @@ val strs: string[] = "-------------------------------------------------------------"+[36 chars]; "-------------------------------------------------------------"+[37 chars]; "-------------------------------------------------------------"+[38 chars]|] -val str7s: string[] = +val str7s: string array = [|""; "-------"; "--------------"; "---------------------"; "----------------------------"; "-----------------------------------"; "------------------------------------------"; @@ -442,7 +442,7 @@ val str7s: string[] = "-------------------------------------------------------------"+[618 chars]; "-------------------------------------------------------------"+[625 chars]; "-------------------------------------------------------------"+[632 chars]|] -val grids: string[,] = +val grids: string array2d = [[""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""] @@ -3832,7 +3832,7 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C = -val csA: C[] = +val csA: C array = [|; ; ; ; ; ; @@ -3883,7 +3883,7 @@ val csA: C[] = ; ; ; ; ; ; ...|] -val csB: C[] = +val csB: C array = [|; ; ; ; ; ; @@ -3934,7 +3934,7 @@ val csB: C[] = ; ; ; ; ; ; ...|] -val csC: C[] = +val csC: C array = [|; ; ; ; ; ; @@ -4044,10 +4044,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > val it: string = "Check #help" @@ -4203,7 +4203,7 @@ val r10: r = { f0 = 0 f7 = 7 f8 = 8 f9 = 9 } -val r10s: r[] = +val r10s: r array = [|{ f0 = 0 f1 = 1 f2 = 2 @@ -4544,7 +4544,7 @@ val r10s: r[] = f7 = 7 f8 = 8 f9 = 9 }|] -val r10s': string * r[] = +val r10s': string * r array = ("one extra node", [|{ f0 = 0 f1 = 1 @@ -5029,11 +5029,11 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list = [1; 2; 3] - val xArray: int[] = [|1; 2; 3|] + val xArray: int array = [|1; 2; 3|] val xString: string = "abcdef" val xOption: int option = Some 12 - val xArray2: (int * int)[,] = [[(0, 0); (0, 1)] - [(1, 0); (1, 1)]] + val xArray2: (int * int) array2d = [[(0, 0); (0, 1)] + [(1, 0); (1, 1)]] val xSeq: seq module Test4343e = type C = @@ -5259,707 +5259,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 586d7a58860..f9c6d893f87 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -13,7 +13,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -26,7 +26,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -39,7 +39,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -48,10 +48,10 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form -val fs: System.Windows.Forms.Form[] +val fs: System.Windows.Forms.Form array val xs: string list -val xa: string[] -val xa2: string[,] +val xa: string array +val xa2: string array2d val sxs0: Set > val sxs1: Set @@ -80,7 +80,7 @@ val sxs0: Set val a: string val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option + (string list * string list * string array2d) option type T = new: a: int * b: int -> T member AMethod: x: int -> int @@ -103,9 +103,9 @@ val opt4: 'a option option option option val opt4b: int option option option option val opt5: int list option option option option option list val mkStr: n: int -> string -val strs: string[] -val str7s: string[] -val grids: string[,] +val strs: string array +val str7s: string array +val grids: string array2d > type tree = | L @@ -170,9 +170,9 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C -val csA: C[] -val csB: C[] -val csC: C[] +val csA: C array +val csB: C array +val csC: C array > exception Abc @@ -232,10 +232,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] + val repeatedByteLiteral: byte array > module RepeatedModule = - val repeatedByteLiteral: byte[] + val repeatedByteLiteral: byte array > val it: string = "Check #help" @@ -382,8 +382,8 @@ type 'a T1Pre with f9: int } val r10: r -val r10s: r[] -val r10s': string * r[] +val r10s: r array +val r10s': string * r array > val x1564_A1: int @@ -518,10 +518,10 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list - val xArray: int[] + val xArray: int array val xString: string val xOption: int option - val xArray2: (int * int)[,] + val xArray2: (int * int) array2d val xSeq: seq module Test4343e = type C = @@ -729,707 +729,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 9183285f872..4b00548df81 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -11,7 +11,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -24,7 +24,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile1 = new: unit -> ClassInFile1 @@ -37,7 +37,7 @@ val x4: int option val x5: 'a list val x6: int list val x7: System.Windows.Forms.Form -val x8: int[,] +val x8: int array2d val x9: Lazy type ClassInFile2 = new: unit -> ClassInFile2 @@ -46,7 +46,7 @@ type ClassInFile2 = val x2: seq val x3: seq val f1: System.Windows.Forms.Form = System.Windows.Forms.Form, Text: f1 form -val fs: System.Windows.Forms.Form[] = +val fs: System.Windows.Forms.Form array = [|System.Windows.Forms.Form, Text: fs #0; System.Windows.Forms.Form, Text: fs #1; System.Windows.Forms.Form, Text: fs #2; @@ -157,7 +157,7 @@ val xs: string list = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...] -val xa: string[] = +val xa: string array = [|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"; "18"; "19"; "20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"; "28"; "29"; "30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"; @@ -167,14 +167,14 @@ val xa: string[] = "74"; "75"; "76"; "77"; "78"; "79"; "80"; "81"; "82"; "83"; "84"; "85"; "86"; "87"; "88"; "89"; "90"; "91"; "92"; "93"; "94"; "95"; "96"; "97"; "98"; "99"; ...|] -val xa2: string[,] = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] - ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] - ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] - ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] - ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] - ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] - ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] - ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] +val xa2: string array2d = [["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"] + ["10"; "11"; "12"; "13"; "14"; "15"; "16"; "17"] + ["20"; "21"; "22"; "23"; "24"; "25"; "26"; "27"] + ["30"; "31"; "32"; "33"; "34"; "35"; "36"; "37"] + ["40"; "41"; "42"; "43"; "44"; "45"; "46"; "47"] + ["50"; "51"; "52"; "53"; "54"; "55"; "56"; "57"] + ["60"; "61"; "62"; "63"; "64"; "65"; "66"; "67"] + ["70"; "71"; "72"; "73"; "74"; "75"; "76"; "77"]] val sxs0: Set = set [] > val sxs1: Set = set ["0"] @@ -207,7 +207,7 @@ val sxs0: Set = set [] val a: string = "sub-binding" val b: (seq * seq * seq * System.Windows.Forms.Form) option * - (string list * string list * string[,]) option = + (string list * string list * string array2d) option = (Some (, , , System.Windows.Forms.Form, Text: f1 form), Some (["0"; "1"; "2"; "3"; "4"; "5"; "6"; "7"; "8"; "9"; "10"; "11"; "12"; @@ -268,7 +268,7 @@ val opt5: int list option option option option option list = 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 1; 2; 3; 4; 5; 6; 7; 8; 9; 0]))))] val mkStr: n: int -> string -val strs: string[] = +val strs: string array = [|""; "-"; "--"; "---"; "----"; "-----"; "------"; "-------"; "--------"; "---------"; "----------"; "-----------"; "------------"; "-------------"; "--------------"; "---------------"; "----------------"; @@ -345,7 +345,7 @@ val strs: string[] = "-------------------------------------------------------------"+[36 chars]; "-------------------------------------------------------------"+[37 chars]; "-------------------------------------------------------------"+[38 chars]|] -val str7s: string[] = +val str7s: string array = [|""; "-------"; "--------------"; "---------------------"; "----------------------------"; "-----------------------------------"; "------------------------------------------"; @@ -442,7 +442,7 @@ val str7s: string[] = "-------------------------------------------------------------"+[618 chars]; "-------------------------------------------------------------"+[625 chars]; "-------------------------------------------------------------"+[632 chars]|] -val grids: string[,] = +val grids: string array2d = [[""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""; ""] @@ -3832,7 +3832,7 @@ val generate: x: int -> X new: x: string -> C override ToString: unit -> string val c1: C = -val csA: C[] = +val csA: C array = [|; ; ; ; ; ; @@ -3883,7 +3883,7 @@ val csA: C[] = ; ; ; ; ; ; ...|] -val csB: C[] = +val csB: C array = [|; ; ; ; ; ; @@ -3934,7 +3934,7 @@ val csB: C[] = ; ; ; ; ; ; ...|] -val csC: C[] = +val csC: C array = [|; ; ; ; ; ; @@ -4044,10 +4044,10 @@ type 'a T4063 = | AT4063 of 'a > val it: (unit -> string) = > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > module RepeatedModule = - val repeatedByteLiteral: byte[] = [|12uy; 13uy; 14uy|] + val repeatedByteLiteral: byte array = [|12uy; 13uy; 14uy|] > val it: string = "Check #help" @@ -4203,7 +4203,7 @@ val r10: r = { f0 = 0 f7 = 7 f8 = 8 f9 = 9 } -val r10s: r[] = +val r10s: r array = [|{ f0 = 0 f1 = 1 f2 = 2 @@ -4544,7 +4544,7 @@ val r10s: r[] = f7 = 7 f8 = 8 f9 = 9 }|] -val r10s': string * r[] = +val r10s': string * r array = ("one extra node", [|{ f0 = 0 f1 = 1 @@ -5029,11 +5029,11 @@ module Test4343c = val typename2<'a> : string * string module Test4343d = val xList: int list = [1; 2; 3] - val xArray: int[] = [|1; 2; 3|] + val xArray: int array = [|1; 2; 3|] val xString: string = "abcdef" val xOption: int option = Some 12 - val xArray2: (int * int)[,] = [[(0, 0); (0, 1)] - [(1, 0); (1, 1)]] + val xArray2: (int * int) array2d = [[(0, 0); (0, 1)] + [(1, 0); (1, 1)]] val xSeq: seq module Test4343e = type C = @@ -5259,707 +5259,707 @@ val f: (unit -> int) > val it: int = 3 -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|] -> val it: int[] = +> val it: int array = [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; diff --git a/tests/fsharp/typecheck/sigs/neg04.bsl b/tests/fsharp/typecheck/sigs/neg04.bsl index 46f93b4fc91..f71119b8722 100644 --- a/tests/fsharp/typecheck/sigs/neg04.bsl +++ b/tests/fsharp/typecheck/sigs/neg04.bsl @@ -117,7 +117,7 @@ is not compatible with type neg04.fs(147,10,147,20): typecheck error FS0193: Type constraint mismatch. The type - 'int[]' + 'int array' is not compatible with type 'IBar' diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl index 44484072f2a..2e029e468fe 100644 --- a/tests/fsharp/typecheck/sigs/neg117.bsl +++ b/tests/fsharp/typecheck/sigs/neg117.bsl @@ -1,9 +1,9 @@ neg117.fs(79,18,79,59): ilxgen error FS0041: No overloads match for method 'Transform'. -Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[]) +Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.array) -Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.[] , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > +Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.array , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > Available overloads: - static member Neg117.Superpower.Transformer.Transform: ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform: ^f * Neg117.TargetB.TargetB -> (Neg117.TargetB.TransformerKind -> ^f)) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index c22048de0aa..6fe2d2e3295 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -150,8 +150,8 @@ neg20.fs(182,14,182,31): typecheck error FS0041: No overloads match for method ' Known types of arguments: string * obj Available overloads: - - static member C2.M: fmt: string * [] args: int[] -> string // Argument 'args' doesn't match - - static member C2.M: fmt: string * [] args: int[] -> string // Argument at index 1 doesn't match + - static member C2.M: fmt: string * [] args: int array -> string // Argument 'args' doesn't match + - static member C2.M: fmt: string * [] args: int array -> string // Argument at index 1 doesn't match neg20.fs(183,29,183,34): typecheck error FS0001: This expression was expected to have type 'int' @@ -204,8 +204,8 @@ neg20.fs(188,14,188,31): typecheck error FS0041: No overloads match for method ' Known types of arguments: string * obj Available overloads: - - static member C3.M: fmt: string * [] args: string[] -> string // Argument 'args' doesn't match - - static member C3.M: fmt: string * [] args: string[] -> string // Argument at index 1 doesn't match + - static member C3.M: fmt: string * [] args: string array -> string // Argument 'args' doesn't match + - static member C3.M: fmt: string * [] args: string array -> string // Argument at index 1 doesn't match neg20.fs(189,29,189,34): typecheck error FS0001: This expression was expected to have type 'string' @@ -334,7 +334,7 @@ neg20.fs(335,11,335,24): typecheck error FS0041: A unique overload for method 'S Known type of argument: 'a0 Candidates: - - System.String(value: char[]) : System.String + - System.String(value: char array) : System.String - System.String(value: nativeptr) : System.String - System.String(value: nativeptr) : System.String @@ -343,7 +343,7 @@ neg20.fs(336,11,336,22): typecheck error FS0041: A unique overload for method 'G Known type of argument: 'a0 Candidates: - - System.Guid(b: byte[]) : System.Guid + - System.Guid(b: byte array) : System.Guid - System.Guid(g: string) : System.Guid neg20.fs(355,19,355,38): typecheck error FS1124: Multiple types exist called 'OverloadedClassName', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. 'OverloadedClassName<_>'. diff --git a/tests/fsharp/typecheck/sigs/version50/neg20.bsl b/tests/fsharp/typecheck/sigs/version50/neg20.bsl index 9bc473d3a3b..b1e3b87ffb5 100644 --- a/tests/fsharp/typecheck/sigs/version50/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/version50/neg20.bsl @@ -200,8 +200,8 @@ neg20.fs(182,14,182,31): typecheck error FS0041: No overloads match for method ' Known types of arguments: string * obj Available overloads: - - static member C2.M: fmt: string * [] args: int[] -> string // Argument 'args' doesn't match - - static member C2.M: fmt: string * [] args: int[] -> string // Argument at index 1 doesn't match + - static member C2.M: fmt: string * [] args: int array -> string // Argument 'args' doesn't match + - static member C2.M: fmt: string * [] args: int array -> string // Argument at index 1 doesn't match neg20.fs(183,29,183,34): typecheck error FS0001: This expression was expected to have type 'int' @@ -253,8 +253,8 @@ neg20.fs(188,14,188,31): typecheck error FS0041: No overloads match for method ' Known types of arguments: string * obj Available overloads: - - static member C3.M: fmt: string * [] args: string[] -> string // Argument 'args' doesn't match - - static member C3.M: fmt: string * [] args: string[] -> string // Argument at index 1 doesn't match + - static member C3.M: fmt: string * [] args: string array -> string // Argument 'args' doesn't match + - static member C3.M: fmt: string * [] args: string array -> string // Argument at index 1 doesn't match neg20.fs(189,29,189,34): typecheck error FS0001: This expression was expected to have type 'string' @@ -382,7 +382,7 @@ neg20.fs(335,11,335,24): typecheck error FS0041: A unique overload for method 'S Known type of argument: 'a0 Candidates: - - System.String(value: char[]) : System.String + - System.String(value: char array) : System.String - System.String(value: nativeptr) : System.String - System.String(value: nativeptr) : System.String @@ -391,7 +391,7 @@ neg20.fs(336,11,336,22): typecheck error FS0041: A unique overload for method 'G Known type of argument: 'a0 Candidates: - - System.Guid(b: byte[]) : System.Guid + - System.Guid(b: byte array) : System.Guid - System.Guid(g: string) : System.Guid neg20.fs(355,19,355,38): typecheck error FS1124: Multiple types exist called 'OverloadedClassName', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. 'OverloadedClassName<_>'. diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index 8b2f9b9acdd..2c9b12da11a 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -139,8 +139,8 @@ let ``GetMethodsAsSymbols should return all overloads of a method as FSharpSymbo [("Concat", [("values", "Collections.Generic.IEnumerable<'T>")]); ("Concat", [("values", "Collections.Generic.IEnumerable")]); ("Concat", [("arg0", "obj")]); - ("Concat", [("args", "obj[]")]); - ("Concat", [("values", "string[]")]); + ("Concat", [("args", "obj array")]); + ("Concat", [("values", "string array")]); #if NETCOREAPP ("Concat", [("str0", "ReadOnlySpan");("str1", "ReadOnlySpan")]); #endif diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 428e08d96e1..02a62ba5b99 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -791,7 +791,7 @@ let ``Test Unoptimized Declarations Project1`` () = "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),m.Method(7,8),fun tupledArg -> let arg00: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg01: Microsoft.FSharp.Core.int = tupledArg.Item1 in fun tupledArg -> let arg10: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg11: Microsoft.FSharp.Core.int = tupledArg.Item1 in m.CurriedMethod(arg00,arg01,arg10,arg11) (9,10) (11,12)) @ (110,8--110,9)"; "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (arg0_0,arg1_0),x,y) @ (122,70--122,75)"; - "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress, false, ILArrayShape [(Some 0, None)], !0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.array = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress, false, ILArrayShape [(Some 0, None)], !0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = Operators.op_Subtraction (fun arg0_0 -> fun arg1_0 -> DateTime.op_Subtraction (arg0_0,arg1_0),dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = Operators.op_Subtraction (fun arg0_0 -> fun arg1_0 -> DateTime.op_Subtraction (arg0_0,arg1_0),dt6,dt4) in dt7 @ (142,7--142,10)"; "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,1) done; x) @ (152,15--152,16)"; @@ -926,7 +926,7 @@ let ``Test Optimized Declarations Project1`` () = "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),m.Method(7,8),let arg00: Microsoft.FSharp.Core.int = 9 in let arg01: Microsoft.FSharp.Core.int = 10 in let arg10: Microsoft.FSharp.Core.int = 11 in let arg11: Microsoft.FSharp.Core.int = 12 in m.CurriedMethod(arg00,arg01,arg10,arg11)) @ (110,8--110,9)"; "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (arg0_0,arg1_0),x,y) @ (122,70--122,75)"; - "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress, false, ILArrayShape [(Some 0, None)], !0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.array = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress, false, ILArrayShape [(Some 0, None)], !0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = DateTime.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = DateTime.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (fun arg0_0 -> fun arg1_0 -> LanguagePrimitives.AdditionDynamic (arg0_0,arg1_0),x,1) done; x) @ (152,15--152,16)"; @@ -3555,9 +3555,9 @@ let ``Test ProjectForWitnesses4 GetWitnessPassingInfo`` () = let expected = ["type M"; - "let isEmptyArray(x) = (if (if Operators.op_Inequality<'a Microsoft.FSharp.Core.[]> (x,dflt) then Operators.op_Equality (ArrayModule.Length<'a> (x),0) else False) then x else x) @ (5,10--5,11)"; - "let isNull(ts) = (if Operators.op_Equality<'t Microsoft.FSharp.Core.[]> (ts,dflt) then True else False) @ (10,10--10,12)"; - "let isNullQuoted(ts) = quote((if Operators.op_Equality<'t Microsoft.FSharp.Core.[]> (ts,dflt) then True else False)) @ (15,4--19,6)"] + "let isEmptyArray(x) = (if (if Operators.op_Inequality<'a Microsoft.FSharp.Core.array> (x,dflt) then Operators.op_Equality (ArrayModule.Length<'a> (x),0) else False) then x else x) @ (5,10--5,11)"; + "let isNull(ts) = (if Operators.op_Equality<'t Microsoft.FSharp.Core.array> (ts,dflt) then True else False) @ (10,10--10,12)"; + "let isNullQuoted(ts) = quote((if Operators.op_Equality<'t Microsoft.FSharp.Core.array> (ts,dflt) then True else False)) @ (15,4--19,6)"] let actual = printDeclarations None (List.ofSeq file1.Declarations) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index 846b401b227..eca70a6bd89 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -297,8 +297,8 @@ let x = Known type of argument: 'a0 when 'a0: null Candidates: - - System.Console.WriteLine(buffer: char[]) : unit - - System.Console.WriteLine(format: string, [] arg: obj[]) : unit + - System.Console.WriteLine(buffer: char array) : unit + - System.Console.WriteLine(format: string, [] arg: obj array) : unit - System.Console.WriteLine(value: obj) : unit - System.Console.WriteLine(value: string) : unit""" ] CheckErrorList content (assertExpectedErrorMessages expectedMessages) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs index 0d9d9b875d4..f9c8d050d49 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs @@ -1944,7 +1944,7 @@ We really need to rewrite some code paths here to use the real parse tree rather let a1 = System.Reflection.Assembly.Load("mscorlib") let m = a1.GetType("System.Decimal").GetConstructor((*Mark*)null)""" - this.VerifyParameterInfoOverloadMethodIndex(fileContents,"(*Mark*)",0,["System.Type[]"]) + this.VerifyParameterInfoOverloadMethodIndex(fileContents,"(*Mark*)",0,["System.Type array"]) [] member public this.``Regression.MehtodSortedByArgumentCount.Bug4495.Case2``() = @@ -1955,8 +1955,8 @@ We really need to rewrite some code paths here to use the real parse tree rather let m = a1.GetType("System.Decimal").GetConstructor((*Mark*)null)""" this.VerifyParameterInfoOverloadMethodIndex(fileContents,"(*Mark*)",1,["System.Reflection.BindingFlags"; "System.Reflection.Binder"; - "System.Type[]"; - "System.Reflection.ParameterModifier[]"]) + "System.Type array"; + "System.Reflection.ParameterModifier array"]) [] [] @@ -1983,7 +1983,7 @@ We really need to rewrite some code paths here to use the real parse tree rather [] member public this.``BasicBehavior.DotNet.Static``() = let fileContents = """System.String.Format((*Mark*)""" - this.VerifyParameterInfoContainedAtStartOfMarker(fileContents,"(*Mark*)",["string";"obj[]"]) + this.VerifyParameterInfoContainedAtStartOfMarker(fileContents,"(*Mark*)",["string";"obj array"]) (*------------------------------------------IDE Query automation start -------------------------------------------------*) [] @@ -2004,7 +2004,7 @@ We really need to rewrite some code paths here to use the real parse tree rather select r }) }""" this.VerifyParameterInfoContainedAtStartOfMarker(fileContents,"(*Marker1*)",["obj"],queryAssemblyRefs) - this.VerifyParameterInfoContainedAtStartOfMarker(fileContents,"(*Marker2*)",["string";"obj[]"],queryAssemblyRefs) + this.VerifyParameterInfoContainedAtStartOfMarker(fileContents,"(*Marker2*)",["string";"obj array"],queryAssemblyRefs) [] [] diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs index fa0064792d5..d6e96ede231 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs @@ -310,7 +310,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let y(*MInt[]*) : int [] = [| 1; 2; 3 |] """ this.AssertQuickInfoContainsAtStartOfMarker(fileContents, "x(*MIntArray1*)", "int array") - this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "y(*MInt[]*)", "int[]") + this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "y(*MInt[]*)", "int array") //Verify no quickinfo -- link name string have [] @@ -588,7 +588,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let t = new N.T.M(*Marker*)()""" this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", - "N.T.M() : int[]", + "N.T.M() : int array", addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] @@ -601,7 +601,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let t = new N.T.M(*Marker*)()""" this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", - "N.T.M() : int[]", + "N.T.M() : int array", addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) @@ -2070,7 +2070,7 @@ query." ["type Random ="; " new: unit -> unit + 1 overload" " member Next: unit -> int + 2 overloads"; - " member NextBytes: buffer: byte[] -> unit"; + " member NextBytes: buffer: byte array -> unit"; " member NextDouble: unit -> float"] ) diff --git a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index 7d5aa2613fd..0a889d6d19b 100644 --- a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -100,7 +100,7 @@ let ShouldShowQuickInfoForGenericParameters() = "(extension) System.Collections.Generic.IEnumerable.GroupBy<'TSource,'TKey>(keySelector: System.Func<'TSource,'TKey>) : System.Collections.Generic.IEnumerable> 'TSource is int * string 'TKey is int"); - ("Sort", Some "System.Array.Sort<'T>(array: 'T[]) : unit + ("Sort", Some "System.Array.Sort<'T>(array: 'T array) : unit 'T is int"); ("let test4 x = C().FSharpGenericMethodExplitTypeParams", Some From 5c3f987a0a2ecdffacdf1f7be9f66006af331f2e Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Thu, 15 Sep 2022 12:01:56 +0200 Subject: [PATCH 174/226] Print properties of attribute in signatures. (#13891) Co-authored-by: Don Syme --- src/Compiler/Checking/NicePrint.fs | 21 ++++--- .../Signatures/RecordTests.fs | 62 +++++++++++++++++++ 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 63b927f0800..f9e3ead0978 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -562,19 +562,22 @@ module PrintTypes = | _ -> comment "(* unsupported attribute argument *)" /// Layout arguments of an attribute 'arg1, ..., argN' - and layoutAttribArgs denv args = + and layoutAttribArgs denv args props = let argsL = args |> List.map (fun (AttribExpr(e1, _)) -> layoutAttribArg denv e1) - sepListL (rightL (tagPunctuation ",")) argsL + let propsL = + props + |> List.map (fun (AttribNamedArg(name,_, _, AttribExpr(e1, _))) -> + wordL (tagProperty name) ^^ WordL.equals ^^ layoutAttribArg denv e1) + sepListL (rightL (tagPunctuation ",")) (argsL @ propsL) /// Layout an attribute 'Type(arg1, ..., argN)' - // - // REVIEW: we are ignoring "props" here - and layoutAttrib denv (Attrib(tcref, _, args, _props, _, _, _)) = + and layoutAttrib denv (Attrib(tcref, _, args, props, _, _, _)) = let tcrefL = layoutTyconRefImpl true denv tcref - let argsL = bracketL (layoutAttribArgs denv args) - match args with - | [] -> tcrefL - | _ -> tcrefL ++ argsL + let argsL = bracketL (layoutAttribArgs denv args props) + if List.isEmpty args && List.isEmpty props then + tcrefL + else + tcrefL ++ argsL and layoutILAttribElement denv arg = match arg with diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs index e51da662155..4f1d6f86d75 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/RecordTests.fs @@ -31,3 +31,65 @@ type PullActions = /// Any repo which doesn't have a master branch will have one created for it. Log: int }""" + +[] +let ``Attribute on record field with argument`` () = + FSharp + """ +namespace MyApp.Types + +open System + +type SomeEnum = + | ValueOne = 1 + | ValueTwo = 2 + | ValueThree = 3 + +[] +type MyAttribute() = + inherit System.Attribute() + member val SomeValue: SomeEnum = SomeEnum.ValueOne with get, set + +type SomeTypeName = + { + /// Some Xml doc + FieldOne : string + [] + FieldTwo : string list + /// Some other Xml doc + [] + FieldThree : string + } +""" + |> printSignatures + |> prependNewline + |> should equal + """ +namespace MyApp.Types + + [] + type SomeEnum = + | ValueOne = 1 + | ValueTwo = 2 + | ValueThree = 3 + + [ (32767))>] + type MyAttribute = + inherit System.Attribute + + new: unit -> MyAttribute + + member SomeValue: SomeEnum + + type SomeTypeName = + { + + /// Some Xml doc + FieldOne: string + [ (2))>] + FieldTwo: string list + + /// Some other Xml doc + [ (3))>] + FieldThree: string + }""" From b4ef9944d43114cb813af47d4d9e29ea16dc9a19 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Thu, 15 Sep 2022 12:02:10 +0200 Subject: [PATCH 175/226] Print attributes of nested modules in signatures. (#13890) Co-authored-by: Don Syme --- src/Compiler/Checking/NicePrint.fs | 4 +++- .../Signatures/ModuleOrNamespaceTests.fs | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index f9e3ead0978..dbbe333b9cd 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -2404,7 +2404,9 @@ module InferredSigPrinting = let nmL = layoutAccessibility denv mspec.Accessibility nmL let denv = denv.AddAccessibility mspec.Accessibility let basic = imdefL denv def - let modNameL = wordL (tagKeyword "module") ^^ nmL + let modNameL = + wordL (tagKeyword "module") ^^ nmL + |> layoutAttribs denv None false mspec.TypeOrMeasureKind mspec.Attribs let modNameEqualsL = modNameL ^^ WordL.equals let isNamespace = function | Namespace _ -> true | _ -> false let modIsOuter = (outerPath |> List.forall (fun (_, istype) -> isNamespace istype) ) diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs index b01f99c4bf4..0e2f838cf0b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ModuleOrNamespaceTests.fs @@ -197,3 +197,25 @@ do () """ |> printSignatures |> should equal "namespace Foobar" + +[] +let ``Attribute on nested module`` () = + FSharp + """ +namespace MyApp.Types + +[] +[] +module Area = + type Meh = class end +""" + |> printSignatures + |> prependNewline + |> should equal """ +namespace MyApp.Types + + [ (4))>] + module Area = + + type Meh = + class end""" From c706dcc522c65aae19d36c0901352e3ae3954f88 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 15 Sep 2022 05:34:52 -0700 Subject: [PATCH 176/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1994213 (#13908) --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 60 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.ru.xlf | 60 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- src/Compiler/xlf/FSStrings.pt-BR.xlf | 2 +- src/Compiler/xlf/FSStrings.ru.xlf | 2 +- 15 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index f7ca5a364e8..8a1853a380f 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index d3bbe7b5812..e96c8e1d3b2 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 27eecc1cea5..8c034062331 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 7aded9c6213..ab6345e8e0c 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 218756d3dbd..85a4a4cd333 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 8fb9f4199d1..1a49a44350e 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 517ab655d41..1a4cb6964d8 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 06bd965bdc7..1cc8dfb88f1 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 668c9cbdb49..8b1a949bfba 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + membros de interface abstrata estática support for consuming init properties - support for consuming init properties + suporte para consumir propriedades de inicialização @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Permitir DU em minúsculas quando o atributo RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + suporte para propriedades necessárias @@ -279,7 +279,7 @@ self type constraints - self type constraints + restrições de auto-tipo @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + O especificador de formato '%A' não pode ser usado em um assembly que está sendo compilado com a opção '--reflectionfree'. Esse constructo usa implicitamente reflexão. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Usado para verificar se um objeto é do tipo fornecido em um padrão ou associação. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Compactar arquivos de dados de otimização e interface Display the allowed values for language version. - Display the allowed values for language version. + Exiba os valores permitidos para a versão do idioma. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Especifique as informações de otimização incluídas, o padrão é o file. Importante para bibliotecas distribuídas. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + O nome do arquivo de saída pdb não pode corresponder ao nome do arquivo de saída do build. Use --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Desabilitar a geração implícita de constructos usando reflexão Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Especifique a versão do idioma, como 'última versão' ou 'versão prévia'. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Inclua informações da interface F#, o padrão é file. Essencial para distribuir bibliotecas. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Valor inválido '{0}' para --optimizationdata, o valor válido é: none, file, compact. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Valor inválido '{0}' para --interfacedata, o valor válido é: none, file, compact. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Literal de caractere incompleto (exemplo: 'Q') ou invocação de tipo qualificado (exemplo: 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Expressão de operador incompleta (exemplo a^b) ou invocação de tipo qualificado (exemplo: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + A propriedade somente inicialização '{0}' não pode ser definida fora do código de inicialização. Confira https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Restrição inválida. Os formulários de restrição válidos incluem \"'T :> ISomeInterface\" para restrições de interface e \"SomeConstrainingType<'T>\" para auto-restrições. Confira https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + As seguintes propriedades necessárias precisam ser inicializadas:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Não é possível chamar '{0}' – um setter da propriedade somente inicialização, use a inicialização de objeto. Confira https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + A característica '{0}' invocada por essa chamada tem vários tipos de suporte. Essa sintaxe de invocação não é permitida para essas características. Confira https://aka.ms/fsharp-srtp para obter as diretrizes. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + A invocação de uma restrição estática deve usar \"'T.Ident\" e não \"^T.Ident\", mesmo para parâmetros de tipo resolvidos estaticamente. Trait '{0}' is not static - Trait '{0}' is not static + A característica '{0}' não é estática Trait '{0}' is static - Trait '{0}' is static + A característica '{0}' é estática A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Uma característica não pode especificar os argumentos optional, in, out, ParamArray, CallerInfo ou Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' normalmente é usado como uma restrição de tipo em código genérico, por exemplo, \"'T when ISomeInterface<'T>\" ou \"let f (x: #ISomeInterface<_>)\". Confira https://aka.ms/fsharp-iwsams para obter as diretrizes. Você pode desabilitar este aviso usando '#nowarn \"3536\"' ou '--nowarn:3536'. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declarando \"interfaces com métodos abstratos estáticos\" é um recurso avançado. Consulte https://aka.ms/fsharp-iwsams para obter diretrizes. Você pode desabilitar esse aviso usando '#nowarn \"3535\"' ou '--nowarn:3535'. @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 53c05f79d84..577563a8b62 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + статические абстрактные элементы интерфейса support for consuming init properties - support for consuming init properties + поддержка использования свойств инициализации @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Разрешить du в нижнем регистре, если атрибут RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + поддержка обязательных свойств @@ -279,7 +279,7 @@ self type constraints - self type constraints + ограничения самостоятельного типа @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + Определитель формата "%A" нельзя использовать в сборке, компилируемой с параметром "--reflectionfree". Эта конструкция неявно использует отражение. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Используется для проверки принадлежности объекта заданному типу в шаблоне или привязке. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Сжатие файлов данных интерфейса и оптимизации Display the allowed values for language version. - Display the allowed values for language version. + Отображение допустимых значений для версии языка. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Укажите включенные сведения об оптимизации, по умолчанию это файл. Необходимо для распределенных библиотек. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Имя выходного файла pdb не может совпадать с именем выходного файла сборки. Используйте --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Отключить неявное создание конструкций с помощью отражения Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Укажите версию языка, например "новейшая" или "предварительная версия". Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Включить сведения об интерфейсе F#, по умолчанию используется файл. Необходимо для распространения библиотек. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Недопустимое значение "{0}" для --optimizationdata. Допустимые значения: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Недопустимое значение "{0}" для --interfacedata. Допустимые значения: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Неполный символьный литерал (например: "Q") или вызов квалифицированного типа (например: "T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Неполное выражение оператора (например, a^b) или вызов квалифицированного типа (например, ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Свойство только для инициализации "{0}" невозможно установить за пределами кода инициализации. См. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Недопустимое ограничение. Допустимые формы ограничения включают \"'T:> ISomeInterface\" для ограничений интерфейса и \"SomeConstrainingType<'T>\" для собственных ограничений. См. https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Необходимо инициализировать следующие обязательные свойства:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Не удается вызвать '{0}' — установщик для свойства только для инициализации, вместо этого используйте инициализацию объекта. См. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization. @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Признак "{0}", вызываемый этим звонком, имеет несколько типов поддержки. Этот синтаксис вызова не разрешен для таких признаков. См. руководство на https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Вызов статического ограничения должен использовать \"'T.Ident\", а не \"^T.Ident\", даже для статически разрешенных параметров типа. Trait '{0}' is not static - Trait '{0}' is not static + Признак "{0}" не является статическим Trait '{0}' is static - Trait '{0}' is static + Признак "{0}" является статическим A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Признак не может указывать необязательные аргументы in, out, ParamArray, CallerInfo или Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + "{0}" обычно используется в качестве ограничения типа в универсальном коде, например \"'T when ISomeInterface<"T>\" или \"let f (x: #ISomeInterface<_>)\". См. руководство на https://aka.ms/fsharp-iwsams. Это предупреждение можно отключить с помощью "#nowarn \"3536\"" или "--nowarn:3536". Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Объявление \"интерфейсов со статическими абстрактными методами\" является расширенной функцией. См. руководство на https://aka.ms/fsharp-iwsams. Это предупреждение можно отключить с помощью используя "#nowarn \"3535\"" or "--nowarn:3535". @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index f7fc865a3a6..7ee5a8cb3bc 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index a5f32d17a90..2659f03165a 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 20a8448c73b..f7f06f543fc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -7544,7 +7544,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 1929c486cda..a2f3f37cb39 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Os casos de união discriminados em letras minúsculas só são permitidos ao usar o atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 1e91c13cd4c..a728823d325 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Размеченные в нижнем регистре случаи объединения разрешены только при использовании атрибута RequireQualifiedAccess From 9623dcbc9b91f584ea136185cc41a92728b0cf40 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 15 Sep 2022 05:45:40 -0700 Subject: [PATCH 177/226] Allow vsfsi to display output as partial lines. (#13904) Co-authored-by: Vlad Zarytovskii --- .../src/FSharp.VS.FSI/fsiSessionToolWindow.fs | 20 +++---- vsintegration/src/FSharp.VS.FSI/sessions.fs | 52 ++++++++++++------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs b/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs index 927690ce79f..b4a7397b868 100644 --- a/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs +++ b/vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs @@ -19,6 +19,8 @@ open Microsoft.VisualStudio.Editor open Microsoft.VisualStudio.Text.Editor open Microsoft.VisualStudio.Utilities +open Microsoft.VisualStudio.FSharp.Interactive.Session + type VSStd2KCmdID = VSConstants.VSStd2KCmdID // nested type type VSStd97CmdID = VSConstants.VSStd97CmdID // nested type type IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider @@ -36,15 +38,13 @@ module internal Locals = let defaultVSRegistryRoot = @"Software\Microsoft\VisualStudio\15.0" let settingsRegistrySubKey = @"General" let debugPromptRegistryValue = "FSharpHideScriptDebugWarning" - // Prompts come through as "SERVER-PROMPT>\n" (when in "server mode"). + // Prompts come through as "SERVER-PROMPT>" (when in "server mode"). // In fsi.exe, the newline is needed to get the output send through to VS. // Here the reverse mapping is applied. - let prompt = "SERVER-PROMPT>" - let fixServerPrompt (str:string) = (* Replace 'prompt' by ">" throughout string, add newline, unless ending in prompt *) - let str = if str.EndsWith(prompt) then str + " " else str + Environment.NewLine - let str = str.Replace(prompt,">") + let str = if str.EndsWith(SessionsProperties.ServerPrompt) then str + " " else str + let str = str.Replace(SessionsProperties.ServerPrompt,">") str @@ -212,20 +212,20 @@ type internal FsiToolWindow() as this = // Buffer the output and error events. This makes text updates *MUCH* faster (since they are done as a block). // Also, the buffering invokes to the GUI thread. - let bufferMS = 50 + let bufferMS = 50 let flushResponseBuffer,responseBufferE = Session.bufferEvent bufferMS responseE // Wire up session outputs to write to textLines. // Recover the chunks (consecutive runs of stderr or stdout) and write as a single item. // responseEventE always triggers on Gui thread, so calling writeTextAndScroll is safe let writeKeyChunk = function - | StdOut,strs -> writeTextAndScroll (String.concat Environment.NewLine strs) // later: stdout and stderr may color differently - | StdErr,strs -> writeTextAndScroll (String.concat Environment.NewLine strs) // later: hence keep them split. + | StdOut,strs -> writeTextAndScroll (String.concat "" strs) // later: stdout and stderr may color differently + | StdErr,strs -> writeTextAndScroll (String.concat "" strs) // later: hence keep them split. do responseBufferE.Add(fun keyStrings -> let keyChunks : (Response * string list) list = chunkKeyValues keyStrings List.iter writeKeyChunk keyChunks) let showInitialMessageNetCore scroll = if Session.SessionsProperties.fsiUseNetCore then - writeText scroll ((VFSIstrings.SR.sessionInitialMessageNetCore()+Environment.NewLine+prompt)) + writeText scroll ((VFSIstrings.SR.sessionInitialMessageNetCore() + Environment.NewLine + SessionsProperties.ServerPrompt)) // Write message on a session termination. Should be called on Gui thread. let recordTermination () = @@ -233,7 +233,7 @@ type internal FsiToolWindow() as this = synchronizationContext.Post( System.Threading.SendOrPostCallback( fun _ -> - writeTextAndScroll ((VFSIstrings.SR.sessionTerminationDetected())+Environment.NewLine) + writeTextAndScroll ((VFSIstrings.SR.sessionTerminationDetected()) + Environment.NewLine) showInitialMessageNetCore true ), null) diff --git a/vsintegration/src/FSharp.VS.FSI/sessions.fs b/vsintegration/src/FSharp.VS.FSI/sessions.fs index c0cfb72422c..fbd1b43c363 100644 --- a/vsintegration/src/FSharp.VS.FSI/sessions.fs +++ b/vsintegration/src/FSharp.VS.FSI/sessions.fs @@ -69,6 +69,7 @@ module SessionsProperties = let mutable fsiShadowCopy = true let mutable fsiDebugMode = false let mutable fsiPreview = false + let ServerPrompt="SERVER-PROMPT>" + Environment.NewLine // This code pre-dates the events/object system. // Later: Tidy up. @@ -129,7 +130,7 @@ let catchAll trigger x = with err -> System.Windows.Forms.MessageBox.Show(err.ToString()) |> ignore let determineFsiPath () = - if SessionsProperties.fsiUseNetCore then + if SessionsProperties.fsiUseNetCore then let pf = Environment.GetEnvironmentVariable("ProgramW6432") let pf = if String.IsNullOrEmpty(pf) then Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) else pf let exe = Path.Combine(pf,"dotnet","dotnet.exe") @@ -176,34 +177,45 @@ let determineFsiPath () = raise (SessionError (VFSIstrings.SR.couldNotFindFsiExe fsiRegistryPath)) fsiExe, "", true, true -let readLinesAsync (reader: StreamReader) trigger = +let readOutputAsync (reader: StreamReader) trigger = let buffer = StringBuilder(1024) let byteBuffer = Array.zeroCreate 128 let encoding = Encoding.UTF8 let decoder = encoding.GetDecoder() let async0 = async.Return 0 - let charBuffer = + let charBuffer = let maxCharsInBuffer = encoding.GetMaxCharCount byteBuffer.Length Array.zeroCreate maxCharsInBuffer let rec findLinesInBuffer pos = - if pos >= buffer.Length then max (buffer.Length - 1) 0 // exit and point to the last char + if pos >= buffer.Length then + max (buffer.Length - 1) 0 // exit and point to the last char else - let c = buffer.[pos] - let deletePos = match c with - | '\r' when (pos + 1) < buffer.Length && buffer.[pos + 1] = '\n' -> Some(pos + 2) + let deletePos = + let rec loop pos = + if pos < buffer.Length then + match buffer.[pos] with + | '\r' when (pos + 1) < buffer.Length && buffer.[pos + 1] = '\n' -> Some(pos, pos + 2) | '\r' when (pos + 1) = buffer.Length -> None - | '\r' -> Some(pos + 1) - | '\n' -> Some(pos + 1) - | _ -> None - - match deletePos with - | Some deletePos -> - let line = buffer.ToString(0, pos) - trigger line - buffer.Remove(0, deletePos) |> ignore - findLinesInBuffer 0 - | None -> findLinesInBuffer (pos + 1) + | '\r' -> Some(pos, pos + 1) + | '\n' -> Some(pos, pos + 1) + | _ -> loop (pos + 1) + else + None + loop pos + + match deletePos with + | Some (pos, deletePos) -> + let line = buffer.ToString(0, pos) + Environment.NewLine + trigger line + buffer.Remove(0, deletePos) |> ignore + findLinesInBuffer 0 + + | None -> + let text = buffer.ToString(0, buffer.Length) + buffer.Remove(0, buffer.Length) |> ignore + trigger text + findLinesInBuffer 0 let rec read pos = async { @@ -298,7 +310,7 @@ type FsiSession(sourceFile: string) = let mutable skipLines = 0 // hook up stdout\stderr data events - do readLinesAsync cmdProcess.StandardOutput (fun line -> + do readOutputAsync cmdProcess.StandardOutput (fun line -> // For .NET Core, the "dotnet fsi ..." starts a second process "dotnet ..../fsi.dll ..." // So the first thing we ask a .NET Core F# Interactive to do is report its true process ID. // @@ -316,7 +328,7 @@ type FsiSession(sourceFile: string) = else catchAll fsiOutput.Trigger line) - do readLinesAsync cmdProcess.StandardError (catchAll fsiError.Trigger) + do readOutputAsync cmdProcess.StandardError (catchAll fsiError.Trigger) let inputQueue = // Write the input asynchronously, freeing up the IDE thread to contrinue doing work From da72a9871e918ba404618fd7bc73131777becfdb Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 15 Sep 2022 16:46:07 +0200 Subject: [PATCH 178/226] add a guard that checks if the lenght of fittedArgs is accesible by index (#13894) Co-authored-by: Vlad Zarytovskii --- src/Compiler/Checking/CheckExpressions.fs | 5 +++-- .../Conformance/UnionTypes/E_UnionConstructorBadFieldName.fs | 4 +++- .../Conformance/UnionTypes/UnionTypes.fs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 104d1df5eac..6aade43c55f 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -8262,8 +8262,9 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env // first: put all positional arguments let mutable currentIndex = 0 for arg in unnamedArgs do - fittedArgs[currentIndex] <- arg - currentIndex <- currentIndex + 1 + if currentIndex < fittedArgs.Length then + fittedArgs[currentIndex] <- arg + currentIndex <- currentIndex + 1 let SEEN_NAMED_ARGUMENT = -1 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_UnionConstructorBadFieldName.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_UnionConstructorBadFieldName.fs index f9ebb74b26f..01a238ecd76 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_UnionConstructorBadFieldName.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/E_UnionConstructorBadFieldName.fs @@ -14,4 +14,6 @@ match y with | Case1(V3 = "") -> () | _ -> () -let (Case1(V4 = z)) = y \ No newline at end of file +let (Case1(V4 = z)) = y + +let z a = Some ("", "", a = "") \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs index b4c14f7b201..bd0382befeb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnionTypes/UnionTypes.fs @@ -261,6 +261,7 @@ module UnionTypes = (Error 3174, Line 14, Col 9, Line 14, Col 11, "The union case 'Case1' does not have a field named 'V3'.") (Warning 26, Line 15, Col 3, Line 15, Col 10, "This rule will never be matched") (Error 3174, Line 17, Col 12, Line 17, Col 14, "The union case 'Case1' does not have a field named 'V4'.") + (Error 3174, Line 19, Col 25, Line 19, Col 26, "The union case 'Some' does not have a field named 'a'.") ] //SOURCE=E_UnionFieldConflictingName.fs SCFLAGS="--test:ErrorRanges" # E_UnionFieldConflictingName.fs From 03714a0dd69dc810445a94856afbdc11d2d6b7cd Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:38:48 +0200 Subject: [PATCH 179/226] [main] Update dependencies from dotnet/arcade (#13771) * Update dependencies from https://github.com/dotnet/arcade build 20220823.2 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22423.2 * Update global.json * Update Version.Details.xml * Update dependencies from https://github.com/dotnet/arcade build 20220824.3 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22424.3 * Update global.json * Update Version.Details.xml * Update dependencies from https://github.com/dotnet/arcade build 20220825.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22425.1 * Update dependencies from https://github.com/dotnet/arcade build 20220826.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22426.1 * Update dependencies from https://github.com/dotnet/arcade build 20220826.8 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22426.8 * Update Version.Details.xml * Update global.json * Try fix Microsoft.CodeAnalysis * Update dependencies from https://github.com/dotnet/arcade build 20220826.8 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 7.0.0-beta.22426.8 * Update dependencies from https://github.com/dotnet/arcade build 20220830.3 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22430.3 * Update dependencies from https://github.com/dotnet/arcade build 20220831.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22431.1 * Update global.json * Update Version.Details.xml * Update dependencies from https://github.com/dotnet/arcade build 20220902.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22452.1 * fix? * Update dependencies from https://github.com/dotnet/arcade build 20220905.1 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22455.1 * Update dependencies from https://github.com/dotnet/arcade build 20220906.4 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22456.4 * wip * wip * Update dependencies from https://github.com/dotnet/arcade build 20220906.4 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22456.4 * wip * wip * Update dependencies from https://github.com/dotnet/arcade build 20220912.4 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22462.4 * Update dependencies from https://github.com/dotnet/arcade build 20220913.5 Microsoft.DotNet.Arcade.Sdk From Version 7.0.0-beta.22419.1 -> To Version 8.0.0-beta.22463.5 * Update to rc1 * Updates to peverify? * Perl Co-authored-by: dotnet-maestro[bot] Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- FSharp.sln | 44 --- Microsoft.FSharp.Compiler.sln | 2 +- VisualFSharp.sln | 48 --- eng/Version.Details.xml | 8 +- eng/Versions.props | 1 + eng/common/cross/arm/sources.list.focal | 11 + eng/common/cross/arm/sources.list.jammy | 11 + eng/common/cross/arm64/sources.list.focal | 11 + eng/common/cross/arm64/sources.list.jammy | 11 + eng/common/cross/build-rootfs.sh | 41 ++- eng/common/cross/x86/sources.list.focal | 11 + eng/common/cross/x86/sources.list.jammy | 11 + eng/common/generate-locproject.ps1 | 6 +- eng/common/sdl/NuGet.config | 5 + eng/common/sdl/sdl.ps1 | 1 + eng/common/templates/job/execute-sdl.yml | 4 +- .../templates/job/source-index-stage1.yml | 2 +- eng/common/templates/steps/execute-sdl.yml | 6 +- global.json | 14 +- ...sproj => Microsoft.FSharp.Compiler.fsproj} | 4 + src/Microsoft.FSharp.Compiler/Program.cs | 2 - src/Microsoft.FSharp.Compiler/Program.fs | 2 + .../DeclarationElements/Events/Basic/Basic.fs | 2 +- .../EmittedIL/Structure/Structure.fs | 2 +- .../FSharp.Test.Utilities.fsproj | 1 - tests/FSharp.Test.Utilities/TestFramework.fs | 12 +- tests/PEVerify/CLRHelpers.cs | 344 ------------------ tests/PEVerify/MonoHelpers.cs | 14 - tests/PEVerify/PEVerify.csproj | 32 -- tests/PEVerify/Program.cs | 61 ---- .../MicroPerf/CS/MicroPerfCSharp.csproj | 2 +- .../MicroPerf/MicroPerf.fsproj | 3 +- .../TaskPerf/TaskPerf/TaskPerf.fsproj | 2 +- .../TaskPerfPreviousCompiler.fsproj | 2 +- .../HistoricalBenchmark.Runner.fsproj | 2 +- .../HistoricalBenchmark.fsproj | 4 +- .../BenchmarkComparison/runner.ipynb | 2 +- .../FSharp.Compiler.Benchmarks.fsproj | 2 +- .../benchmarks.ipynb | 136 +++---- .../FCSSourceFiles/FCSSourceFiles.fsproj | 2 +- tests/fsharp/single-test.fs | 6 +- tests/fsharp/tests.fs | 2 +- tests/fsharpqa/Source/run.pl | 5 + .../Sample_ConsoleApp_net7.fsproj | 6 +- .../SelfContained_Trimming_Test/check.ps1 | 4 +- 45 files changed, 233 insertions(+), 671 deletions(-) create mode 100644 eng/common/cross/arm/sources.list.focal create mode 100644 eng/common/cross/arm/sources.list.jammy create mode 100644 eng/common/cross/arm64/sources.list.focal create mode 100644 eng/common/cross/arm64/sources.list.jammy create mode 100644 eng/common/cross/x86/sources.list.focal create mode 100644 eng/common/cross/x86/sources.list.jammy rename src/Microsoft.FSharp.Compiler/{Microsoft.FSharp.Compiler.csproj => Microsoft.FSharp.Compiler.fsproj} (98%) delete mode 100644 src/Microsoft.FSharp.Compiler/Program.cs create mode 100644 src/Microsoft.FSharp.Compiler/Program.fs delete mode 100644 tests/PEVerify/CLRHelpers.cs delete mode 100644 tests/PEVerify/MonoHelpers.cs delete mode 100644 tests/PEVerify/PEVerify.csproj delete mode 100644 tests/PEVerify/Program.cs diff --git a/FSharp.sln b/FSharp.sln index dec2db5afbc..9744d3283ef 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -44,10 +44,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", tests\benchmarks\README.md = tests\benchmarks\README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{348DCC13-DD3E-4214-B040-5A74E8C6B782}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj", "{9735B522-37F7-478C-A0C6-6C60BCC53390}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TaskPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\TaskPerf\TaskPerfCSharp\TaskPerfCSharp.csproj", "{CF9F3F98-7BFB-4945-A4A5-668DF0AC65AB}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TaskPerf", "tests\benchmarks\CompiledCodeBenchmarks\TaskPerf\TaskPerf\TaskPerf.fsproj", "{51B569A8-17C5-4EBD-8AAC-240E0B3AD8C4}" @@ -90,8 +86,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fcs", "fcs", "{B86EBFF1-E03 docs\fcs\untypedtree.fsx = docs\fcs\untypedtree.fsx EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\PEVerify\PEVerify.csproj", "{358821CB-4D63-4157-9EFF-65C06EBD4E36}" -EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsc", "src\fsc\fscProject\fsc.fsproj", "{10D15DBB-EFF0-428C-BA83-41600A93EEC4}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fscAnyCpu", "src\fsc\fscAnyCpuProject\fscAnyCpu.fsproj", "{B9EFC4FB-E702-45C8-A885-A05A25C5BCAA}" @@ -290,30 +284,6 @@ Global {9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|Any CPU.Build.0 = Release|Any CPU {9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|x86.ActiveCfg = Release|Any CPU {9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|x86.Build.0 = Release|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Debug|Any CPU.Build.0 = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Debug|x86.ActiveCfg = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Debug|x86.Build.0 = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Proto|Any CPU.Build.0 = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Proto|x86.ActiveCfg = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Proto|x86.Build.0 = Debug|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Release|Any CPU.ActiveCfg = Release|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Release|Any CPU.Build.0 = Release|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Release|x86.ActiveCfg = Release|Any CPU - {348DCC13-DD3E-4214-B040-5A74E8C6B782}.Release|x86.Build.0 = Release|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Debug|x86.ActiveCfg = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Debug|x86.Build.0 = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Proto|Any CPU.Build.0 = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Proto|x86.ActiveCfg = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Proto|x86.Build.0 = Debug|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Release|Any CPU.Build.0 = Release|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Release|x86.ActiveCfg = Release|Any CPU - {9735B522-37F7-478C-A0C6-6C60BCC53390}.Release|x86.Build.0 = Release|Any CPU {CF9F3F98-7BFB-4945-A4A5-668DF0AC65AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF9F3F98-7BFB-4945-A4A5-668DF0AC65AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF9F3F98-7BFB-4945-A4A5-668DF0AC65AB}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -362,18 +332,6 @@ Global {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|Any CPU.Build.0 = Release|Any CPU {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.ActiveCfg = Release|Any CPU {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.Build.0 = Release|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Debug|x86.ActiveCfg = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Debug|x86.Build.0 = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Proto|Any CPU.Build.0 = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Proto|x86.ActiveCfg = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Proto|x86.Build.0 = Debug|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Release|Any CPU.Build.0 = Release|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Release|x86.ActiveCfg = Release|Any CPU - {358821CB-4D63-4157-9EFF-65C06EBD4E36}.Release|x86.Build.0 = Release|Any CPU {10D15DBB-EFF0-428C-BA83-41600A93EEC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10D15DBB-EFF0-428C-BA83-41600A93EEC4}.Debug|Any CPU.Build.0 = Debug|Any CPU {10D15DBB-EFF0-428C-BA83-41600A93EEC4}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -489,8 +447,6 @@ Global {FAC5A3BF-C0D6-437A-868A-E962AA00B418} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {DDFD06DC-D7F2-417F-9177-107764EEBCD8} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {9B4CF83C-C215-4EA0-9F8B-B5A77090F634} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} - {348DCC13-DD3E-4214-B040-5A74E8C6B782} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} - {9735B522-37F7-478C-A0C6-6C60BCC53390} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} {CF9F3F98-7BFB-4945-A4A5-668DF0AC65AB} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} {51B569A8-17C5-4EBD-8AAC-240E0B3AD8C4} = {CE70D631-C5DC-417E-9CDA-B16097BEF1AC} {452EED3C-AA87-471F-B9AC-0F4479C5820C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} diff --git a/Microsoft.FSharp.Compiler.sln b/Microsoft.FSharp.Compiler.sln index d3dea41cfb6..7de4ee9f519 100644 --- a/Microsoft.FSharp.Compiler.sln +++ b/Microsoft.FSharp.Compiler.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32113.165 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.csproj", "{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.fsproj", "{BBEDE3FA-6E2C-4C53-8B61-FBB545CD4FFC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 55862186b22..4f4947d3491 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -170,16 +170,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{208E36EE-665C-42D2-B767-C6DB03C4FEB2}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj", "{EE08E954-AE91-4EFA-8595-10931D29E628}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroPerf", "MicroPerf", "{47112E07-9FF1-43E7-8021-F2A21D6A19A0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "shims", "vsintegration\shims\shims.csproj", "{B1E30F2C-894F-47A9-9C8A-3324831E7D26}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\PEVerify\PEVerify.csproj", "{035CF639-9704-44C0-96AA-BCB132AA881A}" -EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fscAnyCpu", "src\fsc\fscAnyCpuProject\fscAnyCpu.fsproj", "{597D9896-4B90-4E9E-9C99-445C2CB9FF60}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fscArm64", "src\fsc\fscArm64Project\fscArm64.fsproj", "{0973C362-585C-4838-9459-D7E45C6B784B}" @@ -931,30 +923,6 @@ Global {564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61}.Release|Any CPU.Build.0 = Release|Any CPU {564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61}.Release|x86.ActiveCfg = Release|Any CPU {564E7DC5-11CB-4FCF-ABDD-23AD93AF3A61}.Release|x86.Build.0 = Release|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Debug|x86.ActiveCfg = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Debug|x86.Build.0 = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Proto|Any CPU.Build.0 = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Proto|x86.ActiveCfg = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Proto|x86.Build.0 = Debug|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Release|Any CPU.Build.0 = Release|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Release|x86.ActiveCfg = Release|Any CPU - {208E36EE-665C-42D2-B767-C6DB03C4FEB2}.Release|x86.Build.0 = Release|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Debug|x86.ActiveCfg = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Debug|x86.Build.0 = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Proto|Any CPU.Build.0 = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Proto|x86.ActiveCfg = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Proto|x86.Build.0 = Debug|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Release|Any CPU.Build.0 = Release|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Release|x86.ActiveCfg = Release|Any CPU - {EE08E954-AE91-4EFA-8595-10931D29E628}.Release|x86.Build.0 = Release|Any CPU {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Debug|Any CPU.Build.0 = Debug|Any CPU {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -967,18 +935,6 @@ Global {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Release|Any CPU.Build.0 = Release|Any CPU {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Release|x86.ActiveCfg = Release|Any CPU {B1E30F2C-894F-47A9-9C8A-3324831E7D26}.Release|x86.Build.0 = Release|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Debug|x86.ActiveCfg = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Debug|x86.Build.0 = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Proto|Any CPU.Build.0 = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Proto|x86.ActiveCfg = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Proto|x86.Build.0 = Debug|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Release|Any CPU.Build.0 = Release|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Release|x86.ActiveCfg = Release|Any CPU - {035CF639-9704-44C0-96AA-BCB132AA881A}.Release|x86.Build.0 = Release|Any CPU {597D9896-4B90-4E9E-9C99-445C2CB9FF60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {597D9896-4B90-4E9E-9C99-445C2CB9FF60}.Debug|Any CPU.Build.0 = Debug|Any CPU {597D9896-4B90-4E9E-9C99-445C2CB9FF60}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -1133,11 +1089,7 @@ Global {B5A9BBD9-2F45-4722-A6CA-BAE3C64CD4E2} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} {14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {A422D673-8E3B-4924-821B-DD3174173426} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} - {208E36EE-665C-42D2-B767-C6DB03C4FEB2} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0} - {EE08E954-AE91-4EFA-8595-10931D29E628} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0} - {47112E07-9FF1-43E7-8021-F2A21D6A19A0} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} {B1E30F2C-894F-47A9-9C8A-3324831E7D26} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} - {035CF639-9704-44C0-96AA-BCB132AA881A} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {597D9896-4B90-4E9E-9C99-445C2CB9FF60} = {B8DDA694-7939-42E3-95E5-265C2217C142} {0973C362-585C-4838-9459-D7E45C6B784B} = {B8DDA694-7939-42E3-95E5-265C2217C142} {E54456F4-D51A-4334-B225-92EBBED92B40} = {B8DDA694-7939-42E3-95E5-265C2217C142} diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b047ecdae7f..5f516beb82f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,10 +8,14 @@ - + https://github.com/dotnet/arcade - 34dff939b4a91e4693f78a856e0e055c1a3f3fba + c670c5bf5cff7c5c2ca086fd41cc1ace90761576 + + https://github.com/dotnet/arcade + c670c5bf5cff7c5c2ca086fd41cc1ace90761576 + diff --git a/eng/Versions.props b/eng/Versions.props index 3808fa872cb..10050348b66 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -129,6 +129,7 @@ $(RoslynVersion) $(RoslynVersion) 2.0.28 + $(RoslynVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) diff --git a/eng/common/cross/arm/sources.list.focal b/eng/common/cross/arm/sources.list.focal new file mode 100644 index 00000000000..4de2600c174 --- /dev/null +++ b/eng/common/cross/arm/sources.list.focal @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jammy b/eng/common/cross/arm/sources.list.jammy new file mode 100644 index 00000000000..6bb0453029c --- /dev/null +++ b/eng/common/cross/arm/sources.list.jammy @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.focal b/eng/common/cross/arm64/sources.list.focal new file mode 100644 index 00000000000..4de2600c174 --- /dev/null +++ b/eng/common/cross/arm64/sources.list.focal @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.jammy b/eng/common/cross/arm64/sources.list.jammy new file mode 100644 index 00000000000..6bb0453029c --- /dev/null +++ b/eng/common/cross/arm64/sources.list.jammy @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 032f5f19373..5680980fa29 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -186,32 +186,27 @@ while :; do __UbuntuArch=i386 __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" ;; - lldb3.6) - __LLDB_Package="lldb-3.6-dev" - ;; - lldb3.8) - __LLDB_Package="lldb-3.8-dev" - ;; - lldb3.9) - __LLDB_Package="liblldb-3.9-dev" - ;; - lldb4.0) - __LLDB_Package="liblldb-4.0-dev" - ;; - lldb5.0) - __LLDB_Package="liblldb-5.0-dev" - ;; - lldb6.0) - __LLDB_Package="liblldb-6.0-dev" + lldb*) + version="${lowerI/lldb/}" + parts=(${version//./ }) + + # for versions > 6.0, lldb has dropped the minor version + if [[ "${parts[0]}" -gt 6 ]]; then + version="${parts[0]}" + fi + + __LLDB_Package="liblldb-${version}-dev" ;; no-lldb) unset __LLDB_Package ;; llvm*) - version="$(echo "$lowerI" | tr -d '[:alpha:]-=')" + version="${lowerI/llvm/}" parts=(${version//./ }) __LLVM_MajorVersion="${parts[0]}" __LLVM_MinorVersion="${parts[1]}" + + # for versions > 6.0, llvm has dropped the minor version if [[ -z "$__LLVM_MinorVersion" && "$__LLVM_MajorVersion" -le 6 ]]; then __LLVM_MinorVersion=0; fi @@ -231,6 +226,16 @@ while :; do __CodeName=bionic fi ;; + focal) # Ubuntu 20.04 + if [[ "$__CodeName" != "jessie" ]]; then + __CodeName=focal + fi + ;; + jammy) # Ubuntu 22.04 + if [[ "$__CodeName" != "jessie" ]]; then + __CodeName=jammy + fi + ;; jessie) # Debian 8 __CodeName=jessie __UbuntuRepo="http://ftp.debian.org/debian/" diff --git a/eng/common/cross/x86/sources.list.focal b/eng/common/cross/x86/sources.list.focal new file mode 100644 index 00000000000..99d5731330e --- /dev/null +++ b/eng/common/cross/x86/sources.list.focal @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.jammy b/eng/common/cross/x86/sources.list.jammy new file mode 100644 index 00000000000..af1c1feaeac --- /dev/null +++ b/eng/common/cross/x86/sources.list.jammy @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse diff --git a/eng/common/generate-locproject.ps1 b/eng/common/generate-locproject.ps1 index 846e7950ce9..dbf2ab4ee7d 100644 --- a/eng/common/generate-locproject.ps1 +++ b/eng/common/generate-locproject.ps1 @@ -62,7 +62,7 @@ $locJson = @{ $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { - if ($outputPath.Contains($exclusion)) + if ($_.FullName.Contains($exclusion)) { $continue = $false } @@ -91,6 +91,7 @@ $locJson = @{ ) }, @{ + LanguageSet = $LanguageSet CloneLanguageSet = "WiX_CloneLanguages" LssFiles = @( "wxl_loc.lss" ) LocItems = @( @@ -98,7 +99,7 @@ $locJson = @{ $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { - if ($outputPath.Contains($exclusion)) + if ($_.FullName.Contains($exclusion)) { $continue = $false } @@ -110,7 +111,6 @@ $locJson = @{ SourceFile = $sourceFile CopyOption = "LangIDOnPath" OutputPath = $outputPath - Languages = "cs-CZ;de-DE;es-ES;fr-FR;it-IT;ja-JP;ko-KR;pl-PL;pt-BR;ru-RU;tr-TR;zh-CN;zh-TW" } } } diff --git a/eng/common/sdl/NuGet.config b/eng/common/sdl/NuGet.config index 0c5451c1141..3849bdb3cf5 100644 --- a/eng/common/sdl/NuGet.config +++ b/eng/common/sdl/NuGet.config @@ -7,6 +7,11 @@ + + + + + diff --git a/eng/common/sdl/sdl.ps1 b/eng/common/sdl/sdl.ps1 index ac196e164a4..648c5068d7d 100644 --- a/eng/common/sdl/sdl.ps1 +++ b/eng/common/sdl/sdl.ps1 @@ -1,6 +1,7 @@ function Install-Gdn { param( + [Parameter(Mandatory=$true)] [string]$Path, # If omitted, install the latest version of Guardian, otherwise install that specific version. diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index 9ff6a10a682..781a41c9404 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -59,7 +59,9 @@ jobs: - checkout: self clean: true - - template: /eng/common/templates/post-build/setup-maestro-vars.yml + # If the template caller didn't provide an AzDO parameter, set them all up as Maestro vars. + - ${{ if not(and(parameters.AzDOProjectName, parameters.AzDOPipelineId, parameters.AzDOBuildId)) }}: + - template: /eng/common/templates/post-build/setup-maestro-vars.yml - ${{ if ne(parameters.downloadArtifacts, 'false')}}: - ${{ if ne(parameters.artifactNames, '') }}: diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 9ae196c0bfe..21fd12276b6 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -29,7 +29,7 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: NetCore-Public - demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open + demands: ImageOverride -equals windows.vs2019.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals windows.vs2019.amd64 diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 86cf578c431..9dd5709f66d 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -17,14 +17,16 @@ steps: - ${{ if ne(parameters.overrideGuardianVersion, '') }}: - pwsh: | - . $(Build.SourcesDirectory)\eng\common\sdl\sdl.ps1 + Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl + . .\sdl.ps1 $guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts -Version ${{ parameters.overrideGuardianVersion }} Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation" displayName: Install Guardian (Overridden) - ${{ if eq(parameters.overrideGuardianVersion, '') }}: - pwsh: | - . $(Build.SourcesDirectory)\eng\common\sdl\sdl.ps1 + Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl + . .\sdl.ps1 $guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation" displayName: Install Guardian diff --git a/global.json b/global.json index 3790ed6b19c..034d7abab10 100644 --- a/global.json +++ b/global.json @@ -1,24 +1,24 @@ { "sdk": { - "version": "7.0.100-preview.6.22352.1", + "version": "7.0.100-rc.1.22431.12", "allowPrerelease": true, - "rollForward": "latestMajor" + "rollForward": "latestPatch" }, "tools": { - "dotnet": "7.0.100-preview.6.22352.1", + "dotnet": "7.0.100-rc.1.22431.12", "vs": { - "version": "17.0", + "version": "17.2", "components": [ "Microsoft.VisualStudio.Component.FSharp" ] }, - "xcopy-msbuild": "17.1.0" + "xcopy-msbuild": "17.2.1" }, "native-tools": { "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22411.2", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22411.2" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22463.5", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22463.5" } } diff --git a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj similarity index 98% rename from src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj rename to src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj index e4e272d4f48..f3c8aba808a 100644 --- a/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.csproj +++ b/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj @@ -56,6 +56,10 @@ + + + + diff --git a/src/Microsoft.FSharp.Compiler/Program.cs b/src/Microsoft.FSharp.Compiler/Program.cs deleted file mode 100644 index 0be8ed50b0e..00000000000 --- a/src/Microsoft.FSharp.Compiler/Program.cs +++ /dev/null @@ -1,2 +0,0 @@ -// See https://aka.ms/new-console-template for more information -return 0; \ No newline at end of file diff --git a/src/Microsoft.FSharp.Compiler/Program.fs b/src/Microsoft.FSharp.Compiler/Program.fs new file mode 100644 index 00000000000..0a254518203 --- /dev/null +++ b/src/Microsoft.FSharp.Compiler/Program.fs @@ -0,0 +1,2 @@ +[] +let main _ = 0 \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/Events/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/Events/Basic/Basic.fs index 7a8f6a55454..cd36fc9fdaf 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/Events/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/DeclarationElements/Events/Basic/Basic.fs @@ -86,7 +86,7 @@ module Basic = |> verifyCompileAndRun |> shouldSucceed -#if !NETCOREAPP && !NETSTANDARD +#if false && !NETCOREAPP && !NETSTANDARD // SOURCE=SanityCheck02.fs PEVER=/MD # SanityCheck02.fs - /MD [] let ``SanityCheck02_fs_peverify`` compilation = diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs index a60119cc92d..328e8d8ab5c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/Structure.fs @@ -161,7 +161,7 @@ module Structure = compilation |> verifyExecution -#if !NETCOREAPP && !NETSTANDARD +#if false && !NETCOREAPP && !NETSTANDARD // SOURCE=NativePtr01.fs PEVER=/Exp_Fail SCFLAGS="-r:CodeGenHelper.dll" # NativePtr01.fs [] let ``NativePtr01_fs`` compilation = diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 4f88cb393bb..3ec85742f6d 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -38,7 +38,6 @@ Make sure they are getting built with the Utilities. --> - diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index ffaf1a5f925..4958eae21c9 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -303,11 +303,11 @@ let config configurationName envVars = #if NET472 let fscArchitecture = "net472" let fsiArchitecture = "net472" - let peverifyArchitecture = "net472" + //let peverifyArchitecture = "net472" #else let fscArchitecture = dotnetArchitecture let fsiArchitecture = dotnetArchitecture - let peverifyArchitecture = dotnetArchitecture + //let peverifyArchitecture = dotnetArchitecture #endif let repoRoot = SCRIPT_ROOT ++ ".." ++ ".." let artifactsPath = repoRoot ++ "artifacts" @@ -329,8 +329,8 @@ let config configurationName envVars = let ILDASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILDASM_EXE) let ILASM_EXE = if operatingSystem = "win" then "ilasm.exe" else "ilasm" let ILASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILASM_EXE) - let PEVERIFY_EXE = if operatingSystem = "win" then "PEVerify.exe" elif operatingSystem = "osx" then "PEVerify.dll" else "PEVerify" - let PEVERIFY = requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) + //let PEVERIFY_EXE = if operatingSystem = "win" then "PEVerify.exe" elif operatingSystem = "osx" then "PEVerify.dll" else "PEVerify" + let PEVERIFY = "dummy" //requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) // let FSI_FOR_SCRIPTS = artifactsBinPath ++ "fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe" let FSharpBuild = requireArtifact ("FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") let FSharpCompilerInteractiveSettings = requireArtifact ("FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") @@ -618,8 +618,8 @@ let csc cfg arg = Printf.ksprintf (Commands.csc (exec cfg) cfg.CSC) arg let vbc cfg arg = Printf.ksprintf (Commands.vbc (exec cfg) cfg.VBC) arg let ildasm cfg arg = Printf.ksprintf (Commands.ildasm (exec cfg) cfg.ILDASM) arg let ilasm cfg arg = Printf.ksprintf (Commands.ilasm (exec cfg) cfg.ILASM) arg -let peverify cfg = Commands.peverify (exec cfg) cfg.PEVERIFY "/nologo" -let peverifyWithArgs cfg args = Commands.peverify (exec cfg) cfg.PEVERIFY args +let peverify _cfg _test = printfn "PEVerify is disabled, need to migrate to ILVerify instead, see https://github.com/dotnet/fsharp/issues/13854" //Commands.peverify (exec cfg) cfg.PEVERIFY "/nologo" +let peverifyWithArgs _cfg _args _test = printfn "PEVerify is disabled, need to migrate to ILVerify instead, see https://github.com/dotnet/fsharp/issues/13854" //Commands.peverify (exec cfg) cfg.PEVERIFY args let fsi cfg = Printf.ksprintf (Commands.fsi (exec cfg) cfg.FSI) #if !NETCOREAPP let fsiAnyCpu cfg = Printf.ksprintf (Commands.fsi (exec cfg) cfg.FSIANYCPU) diff --git a/tests/PEVerify/CLRHelpers.cs b/tests/PEVerify/CLRHelpers.cs deleted file mode 100644 index be1d8346efb..00000000000 --- a/tests/PEVerify/CLRHelpers.cs +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -// ported from https://github.com/dotnet/roslyn/blob/aaee215045c03c4f4b38a66b56d35261ee7f0ddc/src/Test/Utilities/Portable/Platform/Desktop/CLRHelpers.cs - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Text; -using PEVerify; -using Roslyn.Test.Utilities.Desktop.ComTypes; - -namespace Roslyn.Test.Utilities.Desktop -{ - public static class CLRHelpers - { - private static readonly Guid s_clsIdClrRuntimeHost = new Guid("90F1A06E-7712-4762-86B5-7A5EBA6BDB02"); - private static readonly Guid s_clsIdCorMetaDataDispenser = new Guid("E5CB7A31-7512-11d2-89CE-0080C792E5D8"); - - public static event ResolveEventHandler ReflectionOnlyAssemblyResolve; - - static CLRHelpers() - { - // Work around CLR bug: - // PE Verifier adds a handler to ReflectionOnlyAssemblyResolve event in AppDomain.EnableResolveAssembliesForIntrospection - // (called from ValidateWorker in Validator.cpp) in which it directly calls Assembly.ReflectionOnlyLoad. - // If that happens before we get a chance to resolve the assembly the resolution fails. - // - // The handlers are invoked in the order they were added until one of them returns non-null assembly. - // Therefore once we call Validate we can't add any more handlers -- they would all follow the CLR one, which fails. - // - // As A workaround we add a single forwarding handler before any calls to Validate and then subscribe all of our true handlers - // to this event. - AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += ReflectionOnlyAssemblyResolveHandler; - } - - private static Assembly ReflectionOnlyAssemblyResolveHandler(object sender, ResolveEventArgs args) - { - var handler = ReflectionOnlyAssemblyResolve; - if (handler != null) - { - return handler(sender, args); - } - - return null; - } - - public static object GetRuntimeInterfaceAsObject(Guid clsid, Guid riid) - { - // This API isn't available on Mono hence we must use reflection to access it. - Debug.Assert(!MonoHelpers.IsRunningOnMono()); - - var getRuntimeInterfaceAsObject = typeof(RuntimeEnvironment).GetMethod("GetRuntimeInterfaceAsObject", BindingFlags.Public | BindingFlags.Static); - return getRuntimeInterfaceAsObject.Invoke(null, new object[] { clsid, riid }); - } - - /// - /// Verifies the specified image. Subscribe to to provide a loader for dependent assemblies. - /// - public static string[] PeVerify(byte[] peImage, bool metadataOnly) - { - // fileName must be null, otherwise AssemblyResolve events won't fire - return PeVerify(peImage, AppDomain.CurrentDomain.Id, assemblyPath: null, metadataOnly: metadataOnly); - } - - /// - /// Verifies the specified file. All dependencies must be on disk next to the file. - /// - public static string[] PeVerify(string filePath, bool metadataOnly) - { - return PeVerify(File.ReadAllBytes(filePath), AppDomain.CurrentDomain.Id, filePath, metadataOnly: metadataOnly); - } - - private static readonly object s_guard = new object(); - - private static string[] PeVerify(byte[] peImage, int domainId, string assemblyPath, bool metadataOnly) - { - if (MonoHelpers.IsRunningOnMono()) - { - // PEverify is currently unsupported on Mono hence return an empty - // set of messages - return new string[0]; - } - - lock (s_guard) - { - GCHandle pinned = GCHandle.Alloc(peImage, GCHandleType.Pinned); - try - { - IntPtr buffer = pinned.AddrOfPinnedObject(); - - ICLRValidator validator = (ICLRValidator)GetRuntimeInterfaceAsObject(s_clsIdClrRuntimeHost, typeof(ICLRRuntimeHost).GUID); - ValidationErrorHandler errorHandler = new ValidationErrorHandler(validator); - - IMetaDataDispenser dispenser = (IMetaDataDispenser)GetRuntimeInterfaceAsObject(s_clsIdCorMetaDataDispenser, typeof(IMetaDataDispenser).GUID); - - // the buffer needs to be pinned during validation - Guid riid = typeof(IMetaDataImport).GUID; - object metaDataImport = null; - if (assemblyPath != null) - { - dispenser.OpenScope(assemblyPath, CorOpenFlags.ofRead, ref riid, out metaDataImport); - } - else - { - dispenser.OpenScopeOnMemory(buffer, (uint)peImage.Length, CorOpenFlags.ofRead, ref riid, out metaDataImport); - } - - IMetaDataValidate metaDataValidate = (IMetaDataValidate)metaDataImport; - metaDataValidate.ValidatorInit(CorValidatorModuleType.ValidatorModuleTypePE, errorHandler); - metaDataValidate.ValidateMetaData(); - - if (!metadataOnly) - { - validator.Validate(errorHandler, (uint)domainId, ValidatorFlags.VALIDATOR_EXTRA_VERBOSE, - ulMaxError: 10, token: 0, fileName: assemblyPath, pe: buffer, ulSize: (uint)peImage.Length); - } - - return errorHandler.GetOutput(); - } - finally - { - pinned.Free(); - } - } - } - - private class ValidationErrorHandler : IVEHandler - { - private readonly ICLRValidator _validator; - private readonly List _output; - private const int MessageLength = 256; - - public ValidationErrorHandler(ICLRValidator validator) - { - _validator = validator; - _output = new List(); - } - - public void SetReporterFtn(long lFnPtr) - { - throw new NotImplementedException(); - } - - public void VEHandler(int VECode, tag_VerError Context, Array psa) - { - StringBuilder sb = new StringBuilder(MessageLength); - string message = null; - - if (Context.Flags == (uint)ValidatorFlags.VALIDATOR_CHECK_PEFORMAT_ONLY) - { - GetErrorResourceString(VECode, sb); - string formatString = ReplaceFormatItems(sb.ToString(), "%08x", ":x8"); - formatString = ReplaceFormatItems(formatString, "%d", ""); - if (psa == null) - { - psa = new object[0]; - } - - message = string.Format(formatString, (object[])psa); - } - else - { - _validator.FormatEventInfo(VECode, Context, sb, (uint)MessageLength - 1, psa); - message = sb.ToString(); - } - - // retail version of peverify.exe filters out CLS warnings... - if (!message.Contains("[CLS]")) - { - _output.Add(message); - } - } - - public string[] GetOutput() - { - return _output.ToArray(); - } - - private static readonly string s_resourceFilePath = Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "mscorrc.dll"); - private const uint LOAD_LIBRARY_AS_DATAFILE = 0x00000002; - private static readonly IntPtr s_hMod = LoadLibraryEx(s_resourceFilePath, IntPtr.Zero, LOAD_LIBRARY_AS_DATAFILE); - - private static void GetErrorResourceString(int code, StringBuilder message) - { - LoadString(s_hMod, (uint)(code & 0x0000FFFF), message, MessageLength - 1); - } - - [DllImport("kernel32.dll", SetLastError = true)] - private static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, uint dwFlags); - - [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] - private static extern int LoadString(IntPtr hInstance, uint uID, StringBuilder lpBuffer, int nBufferMax); - - private static string ReplaceFormatItems(string input, string oldFormat, string newFormat) - { - // not foolproof/efficient, but easy to write/understand... - var parts = input.Replace(oldFormat, "|").Split('|'); - - var formatString = new StringBuilder(); - for (int i = 0; i < parts.Length; i++) - { - formatString.Append(parts[i]); - if (i < (parts.Length - 1)) - { - formatString.Append('{'); - formatString.Append(i); - formatString.Append(newFormat); - formatString.Append('}'); - } - } - - return formatString.ToString(); - } - } - } - - namespace ComTypes - { - [ComImport, CoClass(typeof(object)), Guid("90F1A06C-7712-4762-86B5-7A5EBA6BDB02"), TypeIdentifier] - public interface CLRRuntimeHost : ICLRRuntimeHost - { - } - - [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("90F1A06C-7712-4762-86B5-7A5EBA6BDB02"), TypeIdentifier] - public interface ICLRRuntimeHost - { - } - - [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("63DF8730-DC81-4062-84A2-1FF943F59FDD"), TypeIdentifier] - public interface ICLRValidator - { - void Validate( - [In, MarshalAs(UnmanagedType.Interface)] IVEHandler veh, - [In] uint ulAppDomainId, - [In] ValidatorFlags ulFlags, - [In] uint ulMaxError, - [In] uint token, - [In, MarshalAs(UnmanagedType.LPWStr)] string fileName, - [In] IntPtr pe, - [In] uint ulSize); - - void FormatEventInfo( - [In, MarshalAs(UnmanagedType.Error)] int hVECode, - [In] tag_VerError Context, - [In, Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder msg, - [In] uint ulMaxLength, - [In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] Array psa); - } - - [ComImport, Guid("856CA1B2-7DAB-11D3-ACEC-00C04F86C309"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), TypeIdentifier] - public interface IVEHandler - { - void VEHandler([In, MarshalAs(UnmanagedType.Error)] int VECode, [In] tag_VerError Context, [In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] Array psa); - void SetReporterFtn([In] long lFnPtr); - } - - [ComImport, Guid("809C652E-7396-11D2-9771-00A0C9B4D50C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), TypeIdentifier] - public interface IMetaDataDispenser - { - void DefineScope( - [In] ref Guid rclsid, - [In] uint dwCreateFlags, - [In] ref Guid riid, - [Out, MarshalAs(UnmanagedType.IUnknown)] out object ppIUnk); - - void OpenScope( - [In, MarshalAs(UnmanagedType.LPWStr)] string szScope, - [In] CorOpenFlags dwOpenFlags, - [In] ref Guid riid, - [Out, MarshalAs(UnmanagedType.IUnknown)] out object ppIUnk); - - void OpenScopeOnMemory( - [In] IntPtr pData, - [In] uint cbData, - [In] CorOpenFlags dwOpenFlags, - [In] ref Guid riid, - [Out, MarshalAs(UnmanagedType.IUnknown)] out object ppIUnk); - } - - [ComImport, Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), TypeIdentifier] - public interface IMetaDataImport - { - } - - [ComImport, Guid("4709C9C6-81FF-11D3-9FC7-00C04F79A0A3"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), TypeIdentifier] - public interface IMetaDataValidate - { - void ValidatorInit([In] CorValidatorModuleType dwModuleType, [In, MarshalAs(UnmanagedType.IUnknown)] object pUnk); - void ValidateMetaData(); - } - - [StructLayout(LayoutKind.Sequential, Pack = 4), TypeIdentifier("5477469e-83b1-11d2-8b49-00a0c9b7c9c4", "mscoree.tag_VerError")] - public struct tag_VerError - { - public uint Flags; - public uint opcode; - public uint uOffset; - public uint Token; - public uint item1_flags; - public IntPtr item1_data; - public uint item2_flags; - public IntPtr item2_data; - } - - public enum ValidatorFlags : uint - { - VALIDATOR_EXTRA_VERBOSE = 0x00000001, - VALIDATOR_SHOW_SOURCE_LINES = 0x00000002, - VALIDATOR_CHECK_ILONLY = 0x00000004, - VALIDATOR_CHECK_PEFORMAT_ONLY = 0x00000008, - VALIDATOR_NOCHECK_PEFORMAT = 0x00000010 - }; - - public enum CorValidatorModuleType : uint - { - ValidatorModuleTypeInvalid = 0x00000000, - ValidatorModuleTypeMin = 0x00000001, - ValidatorModuleTypePE = 0x00000001, - ValidatorModuleTypeObj = 0x00000002, - ValidatorModuleTypeEnc = 0x00000003, - ValidatorModuleTypeIncr = 0x00000004, - ValidatorModuleTypeMax = 0x00000004 - }; - - public enum CorOpenFlags : uint - { - ofRead = 0x00000000, - ofWrite = 0x00000001, - ofReadWriteMask = 0x00000001, - ofCopyMemory = 0x00000002, - ofCacheImage = 0x00000004, - ofManifestMetadata = 0x00000008, - ofReadOnly = 0x00000010, - ofTakeOwnership = 0x00000020, - ofNoTypeLib = 0x00000080, - ofReserved1 = 0x00000100, - ofReserved2 = 0x00000200, - ofReserved = 0xffffff40, - }; - } -} diff --git a/tests/PEVerify/MonoHelpers.cs b/tests/PEVerify/MonoHelpers.cs deleted file mode 100644 index 385dcacc5bb..00000000000 --- a/tests/PEVerify/MonoHelpers.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; - -namespace PEVerify -{ - public class MonoHelpers - { - public static bool IsRunningOnMono() - { - return Type.GetType("Mono.Runtime") != null; - } - } -} diff --git a/tests/PEVerify/PEVerify.csproj b/tests/PEVerify/PEVerify.csproj deleted file mode 100644 index 1a348a2ef5f..00000000000 --- a/tests/PEVerify/PEVerify.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - Exe - - net472;net7.0 - net7.0 - win-x64;linux-x64;osx-x64 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 - - $(NoWarn);NU1505 - $(NoWarn);1591 - - - - - - - - - - - - - diff --git a/tests/PEVerify/Program.cs b/tests/PEVerify/Program.cs deleted file mode 100644 index f2a9a3f2caf..00000000000 --- a/tests/PEVerify/Program.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -using System; -using System.IO; -using Roslyn.Test.Utilities.Desktop; -using System.Globalization; - -namespace PEVerify -{ - class Program - { - static int Main(string[] args) - { - // this version of PEVerify is only intended to run F# test suit - // force the en-US culture so that tests warning/error message comparision - // is not culture dependent - var culture = new CultureInfo("en-US"); - CultureInfo.CurrentCulture = culture; - CultureInfo.CurrentUICulture = culture; - string assemblyPath = null; - bool metadataOnly = false; - foreach (var arg in args) - { - switch (arg.ToUpperInvariant()) - { - case "/IL": - case "/NOLOGO": - case "/UNIQUE": - // ignore these options - break; - case "/MD": - metadataOnly = true; - break; - default: - if (assemblyPath != null) - { - Console.WriteLine("Assembly already specified or unknown option."); - return -1; - } - - assemblyPath = arg; - break; - } - } - - if (!Path.IsPathRooted(assemblyPath)) - { - var workingDir = Directory.GetCurrentDirectory(); - assemblyPath = Path.Combine(workingDir, assemblyPath); - } - - var errors = CLRHelpers.PeVerify(assemblyPath, metadataOnly); - foreach (var error in errors) - { - Console.WriteLine(error); - } - - return errors.Length; - } - } -} diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj index 2500fd82992..1fce170628e 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/CS/MicroPerfCSharp.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 Library 8.0 diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj index 9b89d243beb..39690196a8e 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj @@ -1,6 +1,6 @@ - net6.0 + net7.0 Exe + 4.5.1 5.0.0 - 4.3.0 - 4.3.0 - 4.0.0 - 4.3.0 - 4.3.0 1.6.0 - 4.3.0 - 4.3.0 - 4.3.0 4.5.5 - 4.3.0 - 4.3.1 - 4.3.0 + 4.7.0 5.0.0 - 4.3.0 - 1.5.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 4.11.1 - 4.3.0 - 4.3.0 6.0.0 4.5.0 @@ -203,6 +184,7 @@ 1.0.0 1.1.33 + 0.13.2 2.16.5 4.3.0.0 1.0.30 diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 86787b11f00..1b30f20529f 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -163,7 +163,7 @@ type TypeBuilder with if logRefEmitCalls then printfn "typeBuilder%d.CreateType()" (abs <| hash typB) - typB.CreateTypeInfo().AsType() + typB.CreateTypeInfo() :> Type member typB.DefineNestedTypeAndLog(name, attrs) = let res = typB.DefineNestedType(name, attrs) @@ -1902,7 +1902,7 @@ let rec buildMethodPass2 cenv tref (typB: TypeBuilder) emEnv (mdef: ILMethodDef) let genArgs = getGenericArgumentsOfMethod methB let emEnv = - envPushTyvars emEnv (Array.append (getGenericArgumentsOfType (typB.AsType())) genArgs) + envPushTyvars emEnv (Array.append (getGenericArgumentsOfType typB) genArgs) buildGenParamsPass1b cenv emEnv genArgs mdef.GenericParams @@ -1965,7 +1965,7 @@ let rec buildMethodPass3 cenv tref modB (typB: TypeBuilder) emEnv (mdef: ILMetho let methB = envGetMethB emEnv mref let emEnv = - envPushTyvars emEnv (Array.append (getGenericArgumentsOfType (typB.AsType())) (getGenericArgumentsOfMethod methB)) + envPushTyvars emEnv (Array.append (getGenericArgumentsOfType typB) (getGenericArgumentsOfMethod methB)) if not (Array.isEmpty (mdef.Return.CustomAttrs.AsArray())) then let retB = methB.DefineParameterAndLog(0, ParameterAttributes.Retval, null) @@ -2091,8 +2091,7 @@ let buildEventPass3 cenv (typB: TypeBuilder) emEnv (eventDef: ILEventDef) = //---------------------------------------------------------------------------- let buildMethodImplsPass3 cenv _tref (typB: TypeBuilder) emEnv (mimpl: ILMethodImplDef) = - let bodyMethInfo = - convMethodRef cenv emEnv (typB.AsType()) mimpl.OverrideBy.MethodRef // doc: must be MethodBuilder + let bodyMethInfo = convMethodRef cenv emEnv typB mimpl.OverrideBy.MethodRef // doc: must be MethodBuilder let (OverridesSpec (mref, dtyp)) = mimpl.Overrides let declMethTI = convType cenv emEnv dtyp @@ -2213,7 +2212,7 @@ and buildTypeTypeDef cenv emEnv modB (typB: TypeBuilder) nesting tdef = let rec buildTypeDefPass1b cenv nesting emEnv (tdef: ILTypeDef) = let tref = mkRefForNestedILTypeDef ILScopeRef.Local (nesting, tdef) let typB = envGetTypB emEnv tref - let genArgs = getGenericArgumentsOfType (typB.AsType()) + let genArgs = getGenericArgumentsOfType typB let emEnv = envPushTyvars emEnv genArgs // Parent may reference types being defined, so has to come after it's Pass1 creation tdef.Extends @@ -2232,7 +2231,7 @@ let rec buildTypeDefPass1b cenv nesting emEnv (tdef: ILTypeDef) = let rec buildTypeDefPass2 cenv nesting emEnv (tdef: ILTypeDef) = let tref = mkRefForNestedILTypeDef ILScopeRef.Local (nesting, tdef) let typB = envGetTypB emEnv tref - let emEnv = envPushTyvars emEnv (getGenericArgumentsOfType (typB.AsType())) + let emEnv = envPushTyvars emEnv (getGenericArgumentsOfType typB) // add interface impls tdef.Implements |> convTypes cenv emEnv @@ -2262,7 +2261,7 @@ let rec buildTypeDefPass2 cenv nesting emEnv (tdef: ILTypeDef) = let rec buildTypeDefPass3 cenv nesting modB emEnv (tdef: ILTypeDef) = let tref = mkRefForNestedILTypeDef ILScopeRef.Local (nesting, tdef) let typB = envGetTypB emEnv tref - let emEnv = envPushTyvars emEnv (getGenericArgumentsOfType (typB.AsType())) + let emEnv = envPushTyvars emEnv (getGenericArgumentsOfType typB) // add method bodies, properties, events tdef.Methods |> Seq.iter (buildMethodPass3 cenv tref modB typB emEnv) tdef.Properties.AsList() |> List.iter (buildPropertyPass3 cenv tref typB emEnv) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index b76cfa836a0..ea73cd1ad77 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -1,4 +1,4 @@ - + @@ -56,25 +56,9 @@ - - - - - - - - - - - - - - - - @@ -432,8 +416,8 @@ - - + + @@ -501,25 +485,9 @@ - - - - - - - - - - - - - - - - diff --git a/src/Compiler/FSharp.Compiler.Service.nuspec b/src/Compiler/FSharp.Compiler.Service.nuspec index 14b5b08926a..c7b55ebb613 100644 --- a/src/Compiler/FSharp.Compiler.Service.nuspec +++ b/src/Compiler/FSharp.Compiler.Service.nuspec @@ -11,25 +11,9 @@ - - - - - - - - - - - - - - - - diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index f4b0c73ffd5..c08df3ef8f9 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -32,8 +32,4 @@ - - - - diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index d114fe9ae33..cc742ad17bc 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -48,26 +48,10 @@ - - - - - - - - - - - - - - - - diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets index cd0d98ec64a..af1998e9bbe 100644 --- a/src/fsc/fsc.targets +++ b/src/fsc/fsc.targets @@ -43,13 +43,9 @@ - - - - diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index 9280dcc36f4..dcd34a0ee86 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -57,15 +57,4 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 30e2e9c933c..fae9537443b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -174,6 +174,8 @@ + + diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 78c3f4c820b..bbb2856344d 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -11,7 +11,9 @@ open FSharp.Compiler.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Diagnostics open FSharp.Compiler.Text +#if NETCOREAPP open System.Runtime.Loader +#endif open FSharp.Test.Utilities open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.CSharp diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 3ec85742f6d..18112cbc161 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -58,7 +58,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj index 9ba7d1306ce..7885ef99ad2 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj @@ -32,7 +32,7 @@ - + diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj index 7f30aa71776..299bf973853 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj @@ -21,7 +21,7 @@ - + diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 6ac922cb029..b8e453bb1a5 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -119,7 +119,6 @@ - diff --git a/tests/fsharp/core/math/numbers/test.fsx b/tests/fsharp/core/math/numbers/test.fsx index dfdc2b005a3..d9b8eb2edd7 100644 --- a/tests/fsharp/core/math/numbers/test.fsx +++ b/tests/fsharp/core/math/numbers/test.fsx @@ -3,10 +3,6 @@ module Core_math_numbers #endif -#if NETCOREAPP -open CoreClrUtilities -#endif - #light #nowarn "49";; #nowarn "44";; diff --git a/tests/fsharp/core/printing/testLoadFile2.fsx b/tests/fsharp/core/printing/testLoadFile2.fsx index 0135662d80b..d5ea4e8af36 100644 --- a/tests/fsharp/core/printing/testLoadFile2.fsx +++ b/tests/fsharp/core/printing/testLoadFile2.fsx @@ -1,7 +1,3 @@ -#if NETCOREAPP -open CoreClrUtilities -#endif - #light let x1 = 1 let x2 = "hello" diff --git a/tests/fsharp/core/unicode/kanji-unicode-utf16.fs b/tests/fsharp/core/unicode/kanji-unicode-utf16.fs index 5e0256ad2e53a1dbed3222b9e8df34b4ce332994..22d1258c32ae2d04600437eedb2ab281366f1326 100644 GIT binary patch delta 9 QcmaFH*upqLWnx i$aZGP0n(uiB|x1yKn$W&8H&NGmBDILKxR&q&IAC7s}dmq diff --git a/tests/fsharp/coreclr_utilities.fs b/tests/fsharp/coreclr_utilities.fs deleted file mode 100644 index d49310ca4ac..00000000000 --- a/tests/fsharp/coreclr_utilities.fs +++ /dev/null @@ -1,163 +0,0 @@ -[] -module CoreClrUtilities - - open System - open System.Reflection - open System.Runtime.InteropServices - - type System.Delegate with - static member CreateDelegate(delegateType, methodInfo : System.Reflection.MethodInfo) = methodInfo.CreateDelegate(delegateType) - static member CreateDelegate(delegateType, obj : obj, methodInfo : System.Reflection.MethodInfo) = methodInfo.CreateDelegate(delegateType, obj) - -#if !INTERACTIVE - module internal UnsafeNativeMethods = - [] - extern System.IntPtr GetCommandLine(); -#endif - -#if !INTERACTIVE - type System.Environment with - static member GetCommandLineArgs() = - let cl = - let c = UnsafeNativeMethods.GetCommandLine() - if c = IntPtr.Zero then "" - else Marshal.PtrToStringUni(c) - cl.Split(' ') -#endif - - let commit (results : _[]) = - match results with - | [||] -> null - | [| m |] -> m - | _ -> raise (AmbiguousMatchException()) - - [] - type BindingFlags = - | DeclaredOnly = 2 - | Instance = 4 - | Static = 8 - | Public = 16 - | NonPublic = 32 - - [] - type MemberType = - | None = 0x00 - | Constructor = 0x01 - | Event = 0x02 - | Field = 0x04 - | Method = 0x08 - | Property = 0x10 - | TypeInfo = 0x20 - | NestedType = 0x80 - - - let mapMemberType (c:System.Reflection.MemberInfo) = - let mapIsMethodOrConstructor = - match c with - | :? System.Reflection.MethodBase as c -> if c.IsConstructor then MemberType.Constructor else MemberType.Method - |_ -> MemberType.None - - let mapIsEvent = match c with | :? System.Reflection.EventInfo as c -> MemberType.Event |_ -> MemberType.None - let mapIsField = match c with | :? System.Reflection.FieldInfo as c -> MemberType.Field |_ -> MemberType.None - let mapIsProperty = match c with | :? System.Reflection.PropertyInfo as c -> MemberType.Property |_ -> MemberType.None - let mapIsTypeInfoOrNested = - match c with - | :? System.Reflection.TypeInfo as c -> if c.IsNested then MemberType.NestedType else MemberType.TypeInfo - |_ -> MemberType.None - mapIsMethodOrConstructor ||| mapIsEvent ||| mapIsField ||| mapIsProperty ||| mapIsTypeInfoOrNested - - - let inline hasFlag (flag : BindingFlags) f = (f &&& flag) = flag - let isDeclaredFlag f = hasFlag BindingFlags.DeclaredOnly f - let isPublicFlag f = hasFlag BindingFlags.Public f - let isStaticFlag f = hasFlag BindingFlags.Static f - let isInstanceFlag f = hasFlag BindingFlags.Instance f - let isNonPublicFlag f = hasFlag BindingFlags.NonPublic f - - let isAcceptable bindingFlags isStatic isPublic = - // 1. check if member kind (static\instance) was specified in flags - ((isStaticFlag bindingFlags && isStatic) || (isInstanceFlag bindingFlags && not isStatic)) && - // 2. check if member accessibility was specified in flags - ((isPublicFlag bindingFlags && isPublic) || (isNonPublicFlag bindingFlags && not isPublic)) - - let publicFlags = BindingFlags.Public ||| BindingFlags.Instance ||| BindingFlags.Static - - - type System.Reflection.MemberInfo with - member this.GetCustomAttributes(inherits:bool) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, inherits) |> Seq.toArray) - member this.GetCustomAttributes(attrTy:Type) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy) |> Seq.toArray) - member this.GetCustomAttributes(attrTy, inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy, inherits) |> Seq.toArray) - member this.MemberType = mapMemberType this - - type System.Reflection.MethodInfo with - member this.GetCustomAttributes(inherits:bool) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, inherits) |> Seq.toArray) - member this.GetCustomAttributes(attrTy:Type) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy) |> Seq.toArray) - member this.GetCustomAttributes(attrTy, inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy, inherits) |> Seq.toArray) - member this.MemberType = mapMemberType this - - type System.Reflection.PropertyInfo with - member this.GetCustomAttributes(inherits:bool) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, inherits) |> Seq.toArray) - member this.GetCustomAttributes(attrTy:Type) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy) |> Seq.toArray) - member this.GetCustomAttributes(attrTy, inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy, inherits) |> Seq.toArray) - member this.MemberType = mapMemberType this - - type System.Reflection.Assembly with - member this.GetCustomAttributes() : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this) |> Seq.toArray) - member this.GetCustomAttributes(attrTy, _inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this, attrTy) |> Seq.toArray) - member this.GetTypes() = - this.DefinedTypes - |> Seq.map (fun ti -> ti.AsType()) - |> Seq.toArray - - type System.Threading.Thread with - member this.CurrentCulture - with get () = System.Globalization.CultureInfo.CurrentCulture - and set culture = System.Globalization.CultureInfo.CurrentCulture <- culture - - type System.Type with - - member this.Assembly = this.GetTypeInfo().Assembly - // use different sources based on Declared flag - member this.GetConstructor(_bindingFlags, _binder, argsT:Type[], _parameterModifiers) = this.GetConstructor(argsT) - member this.GetConstructor(parameterTypes : Type[]) = - this.GetTypeInfo().DeclaredConstructors - |> Seq.filter (fun ci -> - not ci.IsStatic && //exclude type initializer - ( - let parameters = ci.GetParameters() - (parameters.Length = parameterTypes.Length) && - (parameterTypes, parameters) ||> Array.forall2 (fun ty pi -> pi.ParameterType.Equals ty) - ) - ) - |> Seq.toArray - |> commit - member this.GetCustomAttributes(attrTy, inherits) : obj[] = downcast box(CustomAttributeExtensions.GetCustomAttributes(this.GetTypeInfo(), attrTy, inherits) |> Seq.toArray) - member this.GetGenericParameterConstraints() = this.GetTypeInfo().GetGenericParameterConstraints() - member this.GetMethods(bindingFlags) = - (if isDeclaredFlag bindingFlags then this.GetTypeInfo().DeclaredMethods else this.GetRuntimeMethods()) - |> Seq.filter (fun m -> isAcceptable bindingFlags m.IsStatic m.IsPublic) - |> Seq.toArray - member this.GetMethods() = this.GetMethods(publicFlags) - member this.GetMethod(name, ?bindingFlags) = - let bindingFlags = defaultArg bindingFlags publicFlags - this.GetMethods(bindingFlags) - |> Array.filter(fun m -> m.Name = name) - |> commit - member this.GetMethod(name, _bindingFlags, _binder, argsT:Type[], _parameterModifiers) = - this.GetMethod(name, argsT) - member this.GetProperties(?bindingFlags) = - let bindingFlags = defaultArg bindingFlags publicFlags - (if isDeclaredFlag bindingFlags then this.GetTypeInfo().DeclaredProperties else this.GetRuntimeProperties()) - |> Seq.filter (fun pi-> - let mi = match pi.GetMethod with | null -> pi.SetMethod | _ -> pi.GetMethod - if mi = null then false - else isAcceptable bindingFlags mi.IsStatic mi.IsPublic - ) - |> Seq.toArray - member this.GetProperty(name, ?bindingFlags) = - let bindingFlags = defaultArg bindingFlags publicFlags - this.GetProperties(bindingFlags) - |> Array.filter (fun pi -> pi.Name = name) - |> commit - member this.IsGenericType = this.GetTypeInfo().IsGenericType - member this.IsValueType = this.GetTypeInfo().IsValueType diff --git a/tests/fsharp/readme.md b/tests/fsharp/readme.md index 43ba0b0ad0f..1180f0aac97 100644 --- a/tests/fsharp/readme.md +++ b/tests/fsharp/readme.md @@ -6,7 +6,7 @@ The tests are NUNIT test cases. They test a very wide range of compiler, interac The bulk of the test cases are enumerated in tests.fs, these are the old cambridge test suite. They build on a test-suite ported from windows batch files. They run the compiler and fsi as seperate processes, when built for the coreclr it runs the coreclr versions using dotnet.exe -The framework and utilities can be found in test-framework.fs, single-test.fs, coreclr_utilities.fs. +The framework and utilities can be found in test-framework.fs, single-test.fs. test cases look similar to: ```` diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 699019c2fe5..3e1ab4390bc 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -213,7 +213,7 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion = let loadSources = [] let useSources = [] let extraSources = ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] - let utilitySources = [__SOURCE_DIRECTORY__ ++ "coreclr_utilities.fs"] + let utilitySources = [] let referenceItems = if String.IsNullOrEmpty(copyFiles) then [] else [copyFiles] let framework = "net7.0" diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index 6a81ccae0eb..21ec3caa91f 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -12,7 +12,6 @@ - diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 6af186bb999..9ce0e102479 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -175,7 +175,6 @@ - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/ProjectBase.files b/vsintegration/src/FSharp.ProjectSystem.Base/ProjectBase.files index ca2426e7221..e62f4521719 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/ProjectBase.files +++ b/vsintegration/src/FSharp.ProjectSystem.Base/ProjectBase.files @@ -27,9 +27,6 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCoreVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionVersion)\lib\net46\System.IO.Compression.dll - From 6735c6fea5287a00279c2c560ee8b786c9b54c29 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 16 Sep 2022 07:46:15 -0700 Subject: [PATCH 181/226] Update dependencies from https://github.com/dotnet/arcade build 20220915.7 (#13916) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22463.5 -> To Version 8.0.0-beta.22465.7 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 +++---- eng/common/init-tools-native.ps1 | 5 +++-- eng/common/templates/job/job.yml | 37 +------------------------------- global.json | 4 ++-- 4 files changed, 10 insertions(+), 44 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5f516beb82f..11f829fcc29 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - c670c5bf5cff7c5c2ca086fd41cc1ace90761576 + cbb2c87350567406c46690ff292e5f6397a5daba - + https://github.com/dotnet/arcade - c670c5bf5cff7c5c2ca086fd41cc1ace90761576 + cbb2c87350567406c46690ff292e5f6397a5daba diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index 8d48ec5680f..ac42f04a9d8 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -98,11 +98,12 @@ try { Write-Error "Arcade tools directory '$ArcadeToolsDirectory' was not found; artifacts were not properly installed." exit 1 } - $ToolDirectory = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending)[0] - if ([string]::IsNullOrWhiteSpace($ToolDirectory)) { + $ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending) + if ($ToolDirectories -eq $null) { Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." exit 1 } + $ToolDirectory = $ToolDirectories[0] $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" if (-not (Test-Path -Path "$BinPathFile")) { Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index e3ba9398016..459f3c4fcbb 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -140,6 +140,7 @@ jobs: languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }} environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'production') }} richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin + uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }} continueOnError: true - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }}: @@ -183,24 +184,6 @@ jobs: displayName: Publish logs continueOnError: true condition: always() - - ${{ if or(eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: - - ${{ if and(ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: CopyFiles@2 - displayName: Gather Asset Manifests - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest' - TargetFolder: '$(Build.ArtifactStagingDirectory)/AssetManifests' - continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) - - - task: PublishBuildArtifacts@1 - displayName: Push Asset Manifests - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)/AssetManifests' - PublishLocation: Container - ArtifactName: AssetManifests - continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: - task: PublishBuildArtifacts@1 @@ -234,24 +217,6 @@ jobs: mergeTestResults: ${{ parameters.mergeTestResults }} continueOnError: true condition: always() - - - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: CopyFiles@2 - displayName: Gather Asset Manifests - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest' - TargetFolder: '$(Build.StagingDirectory)/AssetManifests' - continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) - - - task: PublishBuildArtifacts@1 - displayName: Push Asset Manifests - inputs: - PathtoPublish: '$(Build.StagingDirectory)/AssetManifests' - PublishLocation: Container - ArtifactName: AssetManifests - continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: - template: /eng/common/templates/steps/generate-sbom.yml diff --git a/global.json b/global.json index 034d7abab10..bf758980117 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22463.5", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22463.5" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22465.7", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22465.7" } } From db38206962bd897879d7607b3d75ad689a0965d7 Mon Sep 17 00:00:00 2001 From: Petr Date: Sat, 17 Sep 2022 02:00:04 +0200 Subject: [PATCH 182/226] Consolidating code around process exiting (#13784) --- src/Compiler/Driver/CompilerConfig.fs | 4 ++++ src/Compiler/Driver/CompilerConfig.fsi | 4 ++++ src/Compiler/Driver/CompilerOptions.fs | 12 ++++++------ src/Compiler/Driver/ParseAndCheckInputs.fs | 19 +++++++++---------- src/Compiler/Driver/ParseAndCheckInputs.fsi | 1 - src/Compiler/Driver/fsc.fs | 4 +++- src/fsc/fscmain.fs | 15 +-------------- 7 files changed, 27 insertions(+), 32 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index cb0dc5478ee..55ac85b9a3a 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -577,6 +577,8 @@ type TcConfigBuilder = mutable langVersion: LanguageVersion mutable xmlDocInfoLoader: IXmlDocumentationInfoLoader option + + mutable exiter: Exiter } // Directories to start probing in @@ -762,6 +764,7 @@ type TcConfigBuilder = rangeForErrors = rangeForErrors sdkDirOverride = sdkDirOverride xmlDocInfoLoader = None + exiter = QuitProcessExiter } member tcConfigB.FxResolver = @@ -1303,6 +1306,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.noConditionalErasure = data.noConditionalErasure member _.applyLineDirectives = data.applyLineDirectives member _.xmlDocInfoLoader = data.xmlDocInfoLoader + member _.exiter = data.exiter static member Create(builder, validate) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 034e514d3c2..e200fb03e02 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -478,6 +478,8 @@ type TcConfigBuilder = mutable langVersion: LanguageVersion mutable xmlDocInfoLoader: IXmlDocumentationInfoLoader option + + mutable exiter: Exiter } static member CreateNew: @@ -837,6 +839,8 @@ type TcConfig = /// Check if the primary assembly is mscorlib member assumeDotNetFramework: bool + member exiter: Exiter + /// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig, /// but for F# Interactive it may be based on an underlying mutable TcConfigBuilder. [] diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index e5265efe849..2a950193cc1 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1137,7 +1137,7 @@ let languageFlags tcConfigB = tagNone, OptionConsoleOnly(fun _ -> Console.Write(GetLanguageVersions()) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsGetLangVersions ()) ) @@ -2035,7 +2035,7 @@ let miscFlagsBoth tcConfigB = tagNone, OptionConsoleOnly(fun _ -> Console.Write(GetVersion tcConfigB) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsVersion ()) ) @@ -2049,7 +2049,7 @@ let miscFlagsFsc tcConfigB = tagNone, OptionConsoleOnly(fun blocks -> Console.Write(GetHelpFsc tcConfigB blocks) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsHelp ()) ) @@ -2110,7 +2110,7 @@ let abbreviatedFlagsFsc tcConfigB = tagNone, OptionConsoleOnly(fun blocks -> Console.Write(GetHelpFsc tcConfigB blocks) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2120,7 +2120,7 @@ let abbreviatedFlagsFsc tcConfigB = tagNone, OptionConsoleOnly(fun blocks -> Console.Write(GetHelpFsc tcConfigB blocks) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) @@ -2130,7 +2130,7 @@ let abbreviatedFlagsFsc tcConfigB = tagNone, OptionConsoleOnly(fun blocks -> Console.Write(GetHelpFsc tcConfigB blocks) - exit 0), + tcConfigB.exiter.Exit 0), None, Some(FSComp.SR.optsShortFormOf ("--help")) ) diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 95d10e8bf7c..041c13bb493 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -471,27 +471,27 @@ let ParseInput type Tokenizer = unit -> Parser.token // Show all tokens in the stream, for testing purposes -let ShowAllTokensAndExit (shortFilename, tokenizer: Tokenizer, lexbuf: LexBuffer) = +let ShowAllTokensAndExit (shortFilename, tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: Exiter) = while true do printf "tokenize - getting one token from %s\n" shortFilename let t = tokenizer () printf "tokenize - got %s @ %a\n" (Parser.token_to_string t) outputRange lexbuf.LexemeRange match t with - | Parser.EOF _ -> exit 0 + | Parser.EOF _ -> exiter.Exit 0 | _ -> () if lexbuf.IsPastEndOfStream then printf "!!! at end of stream\n" // Test one of the parser entry points, just for testing purposes -let TestInteractionParserAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer) = +let TestInteractionParserAndExit (tokenizer: Tokenizer, lexbuf: LexBuffer, exiter: Exiter) = while true do match (Parser.interaction (fun _ -> tokenizer ()) lexbuf) with | ParsedScriptInteraction.Definitions (l, m) -> printfn "Parsed OK, got %d defs @ %a" l.Length outputRange m | ParsedScriptInteraction.HashDirective (_, m) -> printfn "Parsed OK, got hash @ %a" outputRange m - exit 0 + exiter.Exit 0 // Report the statistics for testing purposes let ReportParsingStatistics res = @@ -606,11 +606,11 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam // If '--tokenize' then show the tokens now and exit if tokenizeOnly then - ShowAllTokensAndExit(shortFilename, tokenizer, lexbuf) + ShowAllTokensAndExit(shortFilename, tokenizer, lexbuf, tcConfig.exiter) // Test hook for one of the parser entry points if tcConfig.testInteractionParser then - TestInteractionParserAndExit(tokenizer, lexbuf) + TestInteractionParserAndExit(tokenizer, lexbuf, tcConfig.exiter) // Parse the input let res = @@ -741,7 +741,6 @@ let ParseInputFiles lexResourceManager, sourceFiles, diagnosticsLogger: DiagnosticsLogger, - exiter: Exiter, createDiagnosticsLogger: Exiter -> CapturingDiagnosticsLogger, retryLocked ) = @@ -764,7 +763,7 @@ let ParseInputFiles sourceFiles |> Array.map (fun (fileName, _) -> checkInputFile tcConfig fileName - createDiagnosticsLogger (delayedExiter)) + createDiagnosticsLogger delayedExiter) let results = try @@ -790,7 +789,7 @@ let ParseInputFiles delayedDiagnosticsLoggers |> Array.iter (fun delayedDiagnosticsLogger -> delayedDiagnosticsLogger.CommitDelayedDiagnostics diagnosticsLogger) with StopProcessing -> - exiter.Exit exitCode + tcConfig.exiter.Exit exitCode results |> List.ofArray else @@ -806,7 +805,7 @@ let ParseInputFiles with e -> errorRecoveryNoRange e - exiter.Exit 1 + tcConfig.exiter.Exit 1 let ProcessMetaCommandsFromInput (nowarnF: 'state -> range * string -> 'state, diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index 2f02882bee1..b0213532030 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -104,7 +104,6 @@ val ParseInputFiles: lexResourceManager: Lexhelp.LexResourceManager * sourceFiles: string list * diagnosticsLogger: DiagnosticsLogger * - exiter: Exiter * createDiagnosticsLogger: (Exiter -> CapturingDiagnosticsLogger) * retryLocked: bool -> (ParsedInput * string) list diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 28174489a61..fcf8578d2a9 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -510,6 +510,8 @@ let main1 rangeForErrors = range0 ) + tcConfigB.exiter <- exiter + // Preset: --optimize+ -g --tailcalls+ (see 4505) SetOptimizeSwitch tcConfigB OptionSwitch.On SetDebugSwitch tcConfigB None OptionSwitch.Off @@ -609,7 +611,7 @@ let main1 (fun exiter -> diagnosticsLoggerProvider.CreateDelayAndForwardLogger(exiter) :> CapturingDiagnosticsLogger) let inputs = - ParseInputFiles(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, exiter, createDiagnosticsLogger, false) + ParseInputFiles(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, createDiagnosticsLogger, false) let inputs, _ = (Map.empty, inputs) diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 15f607b7656..9fc65db7cdc 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -72,19 +72,6 @@ let main (argv) = stats.rawMemoryFileCount stats.weakByteFileCount) - // This object gets invoked when two many errors have been accumulated, or an abort-on-error condition - // has been reached (e.g. type checking failed, so don't proceed to optimization). - let quitProcessExiter = - { new Exiter with - member _.Exit(n) = - try - exit n - with _ -> - () - - failwithf "%s" (FSComp.SR.elSysEnvExitDidntExit ()) - } - // Get the handler for legacy resolution of references via MSBuild. let legacyReferenceResolver = LegacyMSBuildReferenceResolver.getResolver () @@ -101,7 +88,7 @@ let main (argv) = false, ReduceMemoryFlag.No, CopyFSharpCoreFlag.Yes, - quitProcessExiter, + QuitProcessExiter, ConsoleLoggerProvider(), None, None From 43579c03bff5d98374c3d80d374aab53dd61f2c9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 17 Sep 2022 13:57:45 +0000 Subject: [PATCH 183/226] Update dependencies from https://github.com/dotnet/arcade build 20220916.3 (#13918) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22465.7 -> To Version 8.0.0-beta.22466.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- global.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 11f829fcc29..d61aadbec93 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - cbb2c87350567406c46690ff292e5f6397a5daba + bf47db2617320c82f94713d7b538f7bc0fa9d662 - + https://github.com/dotnet/arcade - cbb2c87350567406c46690ff292e5f6397a5daba + bf47db2617320c82f94713d7b538f7bc0fa9d662 diff --git a/global.json b/global.json index bf758980117..43313346974 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22465.7", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22465.7" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22466.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22466.3" } } From 08951d22ede1e6c07fc4179e3a24611b2476ed7a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 17 Sep 2022 14:17:45 -0700 Subject: [PATCH 184/226] Shadowcopyduringdebug (#13912) * Fix shadowcopyduringdebug * tweaks * fantomas --- src/Microsoft.FSharp.Compiler/Program.fs | 2 +- src/fsi/fsimain.fs | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.FSharp.Compiler/Program.fs b/src/Microsoft.FSharp.Compiler/Program.fs index 0a254518203..051a8f6f309 100644 --- a/src/Microsoft.FSharp.Compiler/Program.fs +++ b/src/Microsoft.FSharp.Compiler/Program.fs @@ -1,2 +1,2 @@ [] -let main _ = 0 \ No newline at end of file +let main _ = 0 diff --git a/src/fsi/fsimain.fs b/src/fsi/fsimain.fs index 57aee5ca360..d4394269ff4 100644 --- a/src/fsi/fsimain.fs +++ b/src/fsi/fsimain.fs @@ -394,16 +394,23 @@ let MainMain argv = || x = "/shadowcopyreferences+" || x = "--shadowcopyreferences+") - if + let executeFsi shadowCopyFiles = + if shadowCopyFiles then + let setupInformation = AppDomain.CurrentDomain.SetupInformation + setupInformation.ShadowCopyFiles <- "true" + let helper = AppDomain.CreateDomain("FSI_Domain", null, setupInformation) + helper.ExecuteAssemblyByName(Assembly.GetExecutingAssembly().GetName()) + else + evaluateSession (argv) + + let tryShadowCopy = AppDomain.CurrentDomain.IsDefaultAppDomain() && argv |> Array.exists isShadowCopy - then - let setupInformation = AppDomain.CurrentDomain.SetupInformation - setupInformation.ShadowCopyFiles <- "true" - let helper = AppDomain.CreateDomain("FSI_Domain", null, setupInformation) - helper.ExecuteAssemblyByName(Assembly.GetExecutingAssembly().GetName()) - else - evaluateSession (argv) + + try + executeFsi tryShadowCopy + with :? FileLoadException -> + executeFsi false #else evaluateSession (argv) #endif From 9dc69428c17abae309ee2ec9bf183d2b0ad491d0 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 19 Sep 2022 18:54:46 +0200 Subject: [PATCH 185/226] Fix e2e tests for the combo provider (#13930) --- .../ComboProvider.Tests/ComboProvider.Tests.fsproj | 2 +- .../ComboProvider/ComboProvider/ComboProvider.fsproj | 4 ++-- .../ComboProvider/TestComboProvider.cmd | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index 080aea65994..ca6383066e8 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net7.0 + net6.0 $(TestTargetFramework) false $(FSharpCoreShippedPackageVersionValue) diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj index 7834c472955..9fd278953c4 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj @@ -2,9 +2,9 @@ Library - net7.0;net472 + net6.0;net472 $(FSharpCoreShippedPackageVersionValue) - net7.0;net472 + net6.0;net472 diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index 29ad4ced449..fc72e514487 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success From a60de1b7c54dec0974a70426858acd4a63d2d997 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 20 Sep 2022 03:00:57 +0200 Subject: [PATCH 186/226] Fix e2e tests for the combo provider (#13935) --- .../ComboProvider.Tests/ComboProvider.Tests.fsproj | 2 +- .../ComboProvider/ComboProvider/ComboProvider.fsproj | 4 ++-- .../ComboProvider/TestComboProvider.cmd | 8 ++++---- tests/EndToEndBuildTests/EndToEndBuildTests.cmd | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index ca6383066e8..080aea65994 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net6.0 + net7.0 $(TestTargetFramework) false $(FSharpCoreShippedPackageVersionValue) diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj index 9fd278953c4..7834c472955 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj @@ -2,9 +2,9 @@ Library - net6.0;net472 + net7.0;net472 $(FSharpCoreShippedPackageVersionValue) - net6.0;net472 + net7.0;net472 diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index fc72e514487..29ad4ced449 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success diff --git a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd index 7613f487e35..eba1498af91 100644 --- a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd +++ b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd @@ -27,9 +27,9 @@ echo %__scriptpath%BasicProvider\TestBasicProvider.cmd -c %configuration% call %__scriptpath%BasicProvider\TestBasicProvider.cmd -c %configuration% if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -echo %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% -call %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% -if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure +rem echo %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% +rem call %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% +rem if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success endlocal From 6278c751c0b2fd68ee90c46b1ad631203c824a21 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 21 Sep 2022 06:34:02 -0700 Subject: [PATCH 187/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1998941 (#13941) Co-authored-by: Vlad Zarytovskii --- src/Compiler/xlf/FSComp.txt.cs.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.de.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.es.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.fr.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.it.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.ko.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.pl.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.tr.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 58 ++++++++++++------------- src/Compiler/xlf/FSStrings.cs.xlf | 2 +- src/Compiler/xlf/FSStrings.de.xlf | 2 +- src/Compiler/xlf/FSStrings.es.xlf | 2 +- src/Compiler/xlf/FSStrings.fr.xlf | 2 +- src/Compiler/xlf/FSStrings.it.xlf | 2 +- src/Compiler/xlf/FSStrings.ko.xlf | 2 +- src/Compiler/xlf/FSStrings.pl.xlf | 2 +- src/Compiler/xlf/FSStrings.tr.xlf | 2 +- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 2 +- 18 files changed, 270 insertions(+), 270 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8a1853a380f..cbbbdf04763 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + statičtí abstraktní členové rozhraní support for consuming init properties - support for consuming init properties + podpora využívání vlastností init @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Povolit duplikát malými písmeny při atributu RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + podpora požadovaných vlastností @@ -279,7 +279,7 @@ self type constraints - self type constraints + omezení vlastního typu @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + Specifikátor formátu %A nelze použít v sestavení kompilovaném s možností --reflectionfree. Tento konstruktor implicitně používá reflexi. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Slouží ke kontrole, zda je objekt daného typu ve vzoru nebo vazbě. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Komprimovat datové soubory rozhraní a optimalizace Display the allowed values for language version. - Display the allowed values for language version. + Zobrazí povolené hodnoty pro jazykovou verzi. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Zadejte zahrnuté informace o optimalizaci, výchozí hodnota je soubor. Důležité pro distribuované knihovny. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Název výstupního souboru pdb se nemůže shodovat s výstupním názvem souboru sestavení pomocí --pdb:filename.pdb. @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Zakázat implicitní generování konstruktorů pomocí reflexe Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Upřesněte verzi jazyka, například „latest“ nebo „preview“. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Zahrnout informace o rozhraní F#, výchozí je soubor. Klíčové pro distribuci knihoven. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Neplatná hodnota '{0}' pro --optimizationdata, platná hodnota: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Neplatná hodnota „{0}“ pro --interfacedata, platná hodnota je: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Neúplný znakový literál (příklad: Q) nebo volání kvalifikovaného typu (příklad: T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Neúplný výraz operátoru (například^b) nebo volání kvalifikovaného typu (příklad: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Vlastnost init-only „{0}“ nelze nastavit mimo inicializační kód. Zobrazit https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Neplatné omezení. Platné formuláře omezení zahrnují "T :> ISomeInterface\" pro omezení rozhraní a \"SomeConstrainingType<'T>\" pro vlastní omezení. Viz https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Je třeba inicializovat následující požadované vlastnosti:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Nelze volat „{0}“ - metodu setter pro vlastnost pouze init. Použijte místo toho inicializaci objektu. Viz https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Vlastnost{0}vyvolaná tímto voláním má více typů podpory. Tato syntaxe volání není pro takové vlastnosti povolená. Pokyny najdete v https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Volání statického omezení by mělo používat "T.Ident\" a nikoli \"^T.Ident\", a to i pro staticky přeložené parametry typu. Trait '{0}' is not static - Trait '{0}' is not static + Vlastnost „{0}“ není statická. Trait '{0}' is static - Trait '{0}' is static + Vlastnost „{0}“ je statická. A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Vlastnost nesmí určovat volitelné argumenty, in, out, ParamArray, CallerInfo nebo Quote. @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' se obvykle používá jako omezení typu v obecném kódu, například \"T when ISomeInterface<'T>\" nebo \"let f (x: #ISomeInterface<_>)\". Pokyny najdete v https://aka.ms/fsharp-iwsams. Toto upozornění můžete zakázat pomocí #nowarn \"3536\" nebo '--nowarn:3536'. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Deklarování \"interfaces with static abstract methods\" (rozhraní se statickými abstraktními metodami) je pokročilá funkce. Pokyny najdete v https://aka.ms/fsharp-iwsams. Toto upozornění můžete zakázat pomocí #nowarn \"3535\" nebo '--nowarn:3535'. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index e96c8e1d3b2..373b6a438d9 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + statische abstrakte Schnittstellenmitglieder support for consuming init properties - support for consuming init properties + Unterstützung für die Nutzung von Initialisierungseigenschaften @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + DU in Kleinbuchstaben zulassen, wenn requireQualifiedAccess-Attribut @@ -269,7 +269,7 @@ support for required properties - support for required properties + Unterstützung für erforderliche Eigenschaften @@ -279,7 +279,7 @@ self type constraints - self type constraints + Selbsttypeinschränkungen @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + Der Formatbezeichner „%A“ darf nicht in einer Assembly verwendet werden, die mit der Option „--reflectionfree“ kompiliert wird. Dieses Konstrukt verwendet implizit die Reflektion. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Wird verwendet, um zu überprüfen, ob ein Objekt in einem Muster oder einer Bindung vom angegebenen Typ ist. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Komprimieren von Schnittstellen- und Optimierungsdatendateien Display the allowed values for language version. - Display the allowed values for language version. + Anzeigen der zulässigen Werte für die Sprachversion. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Geben Sie die enthaltenen Optimierungsinformationen an, der Standardwert ist „file“. Wichtig für verteilte Bibliotheken. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Der Name der PDB-Ausgabedatei kann nicht mit dem Ausgabedateinamen für den Build übereinstimmen, verwenden Sie --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Deaktivieren der impliziten Generierung von Konstrukten mithilfe von Reflektion Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Geben Sie eine Sprachversion wie „latest“ oder „preview“ an. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Schließen Sie F#-Schnittstelleninformationen ein, der Standardwert ist „file“. Wesentlich für die Verteilung von Bibliotheken. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Ungültiger Wert „{0}“ für --optimizationdata. Gültige Werte sind: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Ungültiger Wert „{0}“ für --interfacedata. Gültige Werte sind: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Unvollständiges Zeichenliteral (Beispiel: „Q“) oder qualifizierter Typaufruf (Beispiel: „T.Name“) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Unvollständiger Operatorausdruck (Beispiel: a^b) oder qualifizierter Typaufruf (Beispiel: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Die Eigenschaft „{0}“ nur für die Initialisierung kann nicht außerhalb des Initialisierungscodes festgelegt werden. Siehe https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Ungültige Einschränkung. Gültige Einschränkungsformen sind \"'T :> ISomeInterface\" für Schnittstelleneinschränkungen und\"SomeConstrainingType<'T>\" für Selbsteinschränkungen. Siehe https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Die folgenden erforderlichen Eigenschaften müssen initialisiert werden:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + „{0}“ kann nicht aufgerufen werden – ein Setter für die Eigenschaft nur für die Initialisierung. Bitte verwenden Sie stattdessen die Objektinitialisierung. Siehe https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Das Merkmal „{0}“, das von diesem Aufruf aufgerufen wird, weist mehrere Unterstützungstypen auf. Diese Aufrufsyntax ist für solche Merkmale nicht zulässig. Anleitungen finden Sie unter https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Beim Aufruf einer statischen Einschränkung sollte \"'T.Ident\" verwendet werden und nicht \"^T.Ident\", selbst für statisch aufgelöste Typparameter. Trait '{0}' is not static - Trait '{0}' is not static + Das Merkmal „{0}“ ist nicht statisch. Trait '{0}' is static - Trait '{0}' is static + Das Merkmal „{0}“ ist statisch. A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Ein Merkmal darf keine Argumente für „optional“, „in“, „out“, „ParamArray“", „CallerInfo“ oder „Quote“ angeben. @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + „{0}“ wird normalerweise als Typeinschränkung im generischen Code verwendet, z. B. \"'T when ISomeInterface<'T>\" oder \"let f (x: #ISomeInterface<_>)\". Anleitungen finden Sie unter https://aka.ms/fsharp-iwsams. Sie können diese Warnung deaktivieren, indem Sie „#nowarn \"3536\"“ or „--nowarn:3536“ verwenden. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Das Deklarieren von \"Schnittstellen mit statischen abstrakten Methoden\" ist ein erweitertes Feature. Anleitungen finden Sie unter https://aka.ms/fsharp-iwsams. Sie können diese Warnung deaktivieren, indem Sie „#nowarn \"3535\"“ or „--nowarn:3535“ verwenden. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 8c034062331..cd55eda37b9 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + miembros de interfaz abstracta estática support for consuming init properties - support for consuming init properties + compatibilidad con el consumo de propiedades init @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Permitir DU en minúsculas con el atributo RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + compatibilidad con las propiedades necesarias @@ -279,7 +279,7 @@ self type constraints - self type constraints + restricciones de tipo propio @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + El especificador de formato '%A' no se puede usar en un ensamblado que se está compilando con la opción '--reflectionfree'. Esta construcción usa implícitamente la reflexión. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Se usa para comprobar si un objeto es del tipo especificado en un patrón o enlace. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Comprimir archivos de datos de interfaz y optimización Display the allowed values for language version. - Display the allowed values for language version. + Muestra los valores permitidos para la versión del lenguaje. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Especifique la información de optimización incluida, el valor predeterminado es el archivo. Importante para las bibliotecas distribuidas. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + El nombre del archivo de salida pdb no puede coincidir con el nombre de archivo de salida de compilación. Use --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Deshabilitar la generación implícita de construcciones mediante reflexión Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Especifique la versión de idioma, como "latest" o "preview". Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Incluir información de interfaz de F#, el valor predeterminado es file. Esencial para distribuir bibliotecas. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Valor no válido '{0}' para --optimizationdata; los valores válidos son: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Valor no válido '{0}' para --interfacedata; los valores válidos son: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Literal de carácter incompleto (ejemplo: 'Q') o invocación de tipo completo (ejemplo: 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Expresión de operador incompleta (ejemplo, a^b) o invocación de tipo calificada (ejemplo: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + No se puede establecer la propiedad init-only '{0}' fuera del código de inicialización. Ver https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Restricción no válida. Los formularios de restricción válidos incluyen \"'T :> ISomeInterface\" para restricciones de interfaz y \"SomeConstrainingType<'T>\" para restricciones propias. Ver https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Se deben inicializar las siguientes propiedades necesarias:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + No se puede llamar a '{0}': un establecedor para una propiedad de solo inicialización. Use la inicialización del objeto en su lugar. Ver https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + El rasgo '{0}' invocado por esta llamada tiene varios tipos de soporte. No se permite esta sintaxis de invocación para estos rasgos. Consulte https://aka.ms/fsharp-srtp para obtener instrucciones. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + La invocación de una restricción estática debe usar \"'T.Ident\" y no \"^T.Ident\", incluso para parámetros de tipo resueltos estáticamente. Trait '{0}' is not static - Trait '{0}' is not static + El rasgo '{0}' no es estático Trait '{0}' is static - Trait '{0}' is static + El rasgo '{0}' es estático A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Un rasgo no puede especificar argumentos opcionales, in, out, ParamArray, CallerInfo o Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' se usa normalmente como restricción de tipo en código genérico; por ejemplo, \"'T when ISomeInterface<'T>\" o \"let f (x: #ISomeInterface<_>)\". Consulte https://aka.ms/fsharp-iwsams para obtener instrucciones. Puede deshabilitar esta advertencia con "#nowarn \"3536\"" o "--nowarn:3536". Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Declarar \"interfaces con métodos abstractos estáticos\" es una característica avanzada. Consulte https://aka.ms/fsharp-iwsams para obtener instrucciones. Puede deshabilitar esta advertencia con "#nowarn \"3535\"" o "--nowarn:3535". diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index ab6345e8e0c..5c081ec7c61 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + membres d’interface abstraite statiques support for consuming init properties - support for consuming init properties + prise en charge de la consommation des propriétés init @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Autoriser les DU en minuscules pour l'attribut RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + prise en charge des propriétés obligatoires @@ -279,7 +279,7 @@ self type constraints - self type constraints + contraintes d’auto-type @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + Le spécificateur de format '%A' ne peut pas être utilisé dans un assembly compilé avec l’option '--reflectionfree'. Cette construction utilise implicitement la réflexion. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Permet de vérifier si un objet est du type donné dans un modèle ou une liaison. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Compresser les fichiers de données d’interface et d’optimisation Display the allowed values for language version. - Display the allowed values for language version. + Affichez les valeurs autorisées pour la version du langage. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Spécifiez les informations d’optimisation incluses, la valeur par défaut est le fichier. Important pour les bibliothèques distribuées. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Le nom du fichier de sortie pdb ne peut pas correspondre au nom de fichier de sortie de build utilisé --pdb:filename.pdb. @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Désactiver la génération implicite de constructions à l’aide de la réflexion Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Spécifiez une version de langage telle que 'latest' ou 'preview'. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Incluez les informations de l’interface F#, la valeur par défaut est un fichier. Essentiel pour la distribution des bibliothèques. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Valeur non valide '{0}' pour --optimizationdata. Les valeurs valides sont : none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Valeur non valide '{0}' pour --interfacedata. Les valeurs valides sont : none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Littéral de caractère incomplet (exemple : 'Q') ou appel de type qualifié (exemple : 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Expression d’opérateur incomplète (exemple a^b) ou appel de type qualifié (exemple : ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + La propriété init-only '{0}' ne peut pas être définie en dehors du code d’initialisation. Voir https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Contrainte non valide. Les formes de contrainte valides incluent \"'T :> ISomeInterface\" pour les contraintes d’interface et \"SomeConstrainingType<'T>\" pour les contraintes automatiques. Consultez https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Les propriétés requises suivantes doivent être initialisées :{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Nous n’avons pas pu appeler '{0}' - méthode setter pour la propriété init-only. Utilisez plutôt l’initialisation d’objet. Consultez https://aka.ms/fsharp-assigning-values-to-properties-at-initialization. @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + La caractéristique '{0}' invoquée par cet appel a plusieurs types de prise en charge. Cette syntaxe d’appel n’est pas autorisée pour de telles caractéristiques. Consultez https://aka.ms/fsharp-srtp pour obtenir de l’aide. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + L’appel d’une contrainte statique doit utiliser \"'T.Ident\" et non \"^T.Ident\", même pour les paramètres de type résolus statiquement. Trait '{0}' is not static - Trait '{0}' is not static + Le '{0}' de caractéristique n’est pas statique. Trait '{0}' is static - Trait '{0}' is static + Le '{0}' de caractéristique est statique. A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Une caractéristique ne peut pas spécifier d’arguments facultatifs, in, out, ParamArray, CallerInfo ou Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' est généralement utilisée comme contrainte de type dans le code générique, par exemple \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". Consultez https://aka.ms/fsharp-iwsams pour obtenir de l’aide. Vous pouvez désactiver cet avertissement à l’aide de '#nowarn \"3536\"' or '--nowarn:3536'. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + La déclaration de \"interfaces with static abstract methods\" est une fonctionnalité avancée. Consultez https://aka.ms/fsharp-iwsams pour obtenir de l’aide. Vous pouvez désactiver cet avertissement à l’aide de '#nowarn \"3535\"' or '--nowarn:3535'. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 85a4a4cd333..8218e22b49a 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + membri dell'interfaccia astratta statica support for consuming init properties - support for consuming init properties + supporto per l'utilizzo delle proprietà init @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Consentire l’unione discriminata minuscola quando l'attributo RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + supporto per le proprietà obbligatorie @@ -279,7 +279,7 @@ self type constraints - self type constraints + vincoli di tipo automatico @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + L'identificatore di formato '%A' non può essere utilizzato in un assembly compilato con l'opzione '--reflectionfree'. Questo costrutto usa in modo implicito reflection. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Usato per controllare se un oggetto è del tipo specificato in un criterio o in un'associazione. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + File di dati di compressione dell’interfaccia e ottimizzazione Display the allowed values for language version. - Display the allowed values for language version. + Visualizzare i valori consentiti per la versione della lingua. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Specificare le informazioni di ottimizzazione incluse. Il valore predefinito è file. Important per le librerie distribuite. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Il nome del file di output pdb non può corrispondere all’uso del nome file di output della compilazione --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Disabilitare la generazione implicita di costrutti usando reflection Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Specificare la versione della lingua, ad esempio 'latest' o 'preview'. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Includere le informazioni sull'interfaccia F#. Il valore predefinito è file. Essential per la distribuzione di librerie. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Valore non valido '{0}' per --optimizationdata. Valori validi sono: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Valore non valido '{0}' per --interfacedata. Valori validi sono: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Valore letterale carattere incompleto (ad esempio: 'Q') o chiamata di tipo qualificato (ad esempio: 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Espressione operatore incompleta (ad esempio a^b) o chiamata di tipo qualificato (ad esempio: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + La proprietà init-only '{0}' non può essere impostata al di fuori del codice di inizializzazione. Vedere https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Vincolo non valido. Forme di vincoli validi includono \"'T :> ISomeInterface\" per i vincoli di interfaccia e \"SomeConstrainingType<'T>\" per i vincoli automatici. Vedere https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + È necessario inizializzare le proprietà obbligatorie seguenti:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Non è possibile chiamare '{0}', un setter per la proprietà init-only. Usare invece l'inizializzazione dell'oggetto. Vedere https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Il tratto '{0}' chiamato da questa chiamata ha più tipi di supporto. Questa sintassi di chiamata non è consentita per tali tratti. Per indicazioni, vedere https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + La chiamata di un vincolo statico deve usare \"'T.Ident\" e non \"^T.Ident\", anche per i parametri di tipo risolti in modo statico. Trait '{0}' is not static - Trait '{0}' is not static + Il tratto '{0}' non è statico Trait '{0}' is static - Trait '{0}' is static + Il tratto '{0}' è statico A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Un tratto non può specificare argomenti optional, in, out, ParamArray, CallerInfo o Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' viene in genere usato come vincolo di tipo nel codice generico, ad esempio \"'T when ISomeInterface<'T>\" o \"let f (x: #ISomeInterface<_>)\". Per indicazioni, vedere https://aka.ms/fsharp-iwsams. È possibile disabilitare questo avviso usando '#nowarn \"3536\"' o '--nowarn:3536'. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + La dichiarazione di \"interfaces with static abstract methods\" è una funzionalità avanzata. Per indicazioni, vedere https://aka.ms/fsharp-iwsams. È possibile disabilitare questo avviso usando '#nowarn \"3535\"' o '--nowarn:3535'. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 1a4cb6964d8..56617fa2a21 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + 고정적인 추상 인터페이스 멤버 support for consuming init properties - support for consuming init properties + init 속성 사용 지원 @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + RequireQualifiedAccess 특성이 있는 경우 소문자 DU 허용 @@ -269,7 +269,7 @@ support for required properties - support for required properties + 필수 속성 지원 @@ -279,7 +279,7 @@ self type constraints - self type constraints + 자체 형식 제약 조건 @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + '%A' 형식 지정자는 '--reflectionfree' 옵션으로 컴파일되는 어셈블리에서 사용할 수 없습니다. 이 구문은 암시적으로 리플렉션을 사용합니다. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + 개체가 패턴 또는 바인딩에서 지정된 형식인지 확인하는 데 사용됩니다. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + 인터페이스 및 최적화 데이터 파일 압축 Display the allowed values for language version. - Display the allowed values for language version. + 언어 버전에 허용되는 값을 표시합니다. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + 포함된 최적화 정보를 지정합니다. 기본값은 파일입니다. 분산 라이브러리에 중요합니다. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + pdb 출력 파일 이름은 빌드 출력 파일 이름 사용 --pdb:filename.pdb와 일치할 수 없습니다. @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + 리플렉션을 사용하여 구문의 암시적 생성 사용 안 함 Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + 'latest' 또는 'preview'와 같이 언어 버전을 지정합니다. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + F# 인터페이스 정보를 포함합니다. 기본값은 파일입니다. 라이브러리를 배포하는 데 필수적입니다. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + --optimizationdata에 대한 '{0}' 값이 잘못되었습니다. 올바른 값은 none, file, compress입니다. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + --interfacedata에 대한 '{0}' 값이 잘못되었습니다. 올바른 값은 none, file, compress입니다. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + 불완전한 문자 리터럴(예: 'Q') 또는 정규화된 형식 호출(예: 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + 불완전한 연산자 식(예: a^b) 또는 정규화된 형식 호출(예: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + 초기화 코드 외부에서는 '{0}' 초기화 전용 속성을 설정할 수 없습니다. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization을 참조하세요. @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + 제약 조건이 잘못되었습니다. 유효한 제약 조건 양식은 인터페이스 제약 조건의 경우 \"'T :> ISomeInterface\", 자체 제약 조건의 경우 \"SomeConstrainingType<'T>\" 등입니다. https://aka.ms/fsharp-type-constraints를 참조하세요. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + 다음 필수 속성을 초기화해야 합니다. {0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + init 전용 속성의 setter인 '{0}'을(를) 호출할 수 없습니다. 개체 초기화를 대신 사용하세요. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization를 참조하세요. @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + 이 호출에서 호출한 '{0}' 특성에는 여러 지원 유형이 있습니다. 이러한 특성에는 이 호출 구문을 사용할 수 없습니다. 지침은 https://aka.ms/fsharp-srtp를 참조하세요. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + 고정적인 제약 조건 호출은 정적으로 확인된 형식 매개 변수의 경우에도 \"^T.Ident\"가 아니라 \"'T.Ident\"를 사용해야 합니다. Trait '{0}' is not static - Trait '{0}' is not static + '{0}' 특성은 고정적이지 않습니다. Trait '{0}' is static - Trait '{0}' is static + '{0}' 특성은 고정적입니다. A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + 특성은 optional, in, out, ParamArray, CallerInfo, Quote 인수를 지정할 수 없습니다. @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}'은(는) 일반적으로 제네릭 코드에서 형식 제약 조건으로 사용됩니다(예: \"'T when ISomeInterface<'T>\" 또는 \"let f (x: #ISomeInterface<_>)\"). 지침은 https://aka.ms/fsharp-iwsams를 참조하세요. '#nowarn \"3536\"' 또는 '--nowarn:3536'을 사용하여 이 경고를 비활성화할 수 있습니다. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + \"interfaces with static abstract methods\"를 선언하는 것은 고급 기능입니다. 지침은 https://aka.ms/fsharp-iwsams를 참조하세요. '#nowarn \"3535\"' 또는 '--nowarn:3535'를 사용하여 이 경고를 비활성화할 수 있습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 1cc8dfb88f1..d8364453c4b 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + statyczne abstrakcyjne elementy członkowskie interfejsu support for consuming init properties - support for consuming init properties + obsługa używania właściwości init @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + Zezwalaj na małą literę DU, gdy występuje RequireQualifiedAccess @@ -269,7 +269,7 @@ support for required properties - support for required properties + obsługa wymaganych właściwości @@ -279,7 +279,7 @@ self type constraints - self type constraints + ograniczenia typu własnego @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + Specyfikator formatu „%A” nie może być używany w zestawie kompilowanym z opcją „--reflectionfree”. Ta konstrukcja niejawnie używa odbicia. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Służy do sprawdzania, czy obiekt jest danego typu we wzorcu lub powiązaniu. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Kompresuj pliki danych interfejsu i optymalizacji Display the allowed values for language version. - Display the allowed values for language version. + Wyświetl dozwolone wartości dla wersji językowej. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Określ dołączone informacje o optymalizacji. Wartość domyślna to plik. Ważne dla bibliotek rozproszonych. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + Nazwa pliku wyjściowego pdb nie może być zgodna z nazwą pliku wyjściowego kompilacji, użyj parametru --pdb:filename.pdb @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Wyłącz niejawne generowanie konstrukcji przy użyciu odbicia Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + Określ wersję językową, taką jak „najnowsza” lub „wersja zapoznawcza”. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + Uwzględnij informacje o interfejsie języka F#. Wartość domyślna to plik. Niezbędne do rozpowszechniania bibliotek. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Nieprawidłowa wartość „{0}” dla parametru --optimizationdata, prawidłowa wartość to: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + Nieprawidłowa wartość „{0}” dla parametru --interfacedata, prawidłowa wartość to: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Niekompletny literał znaku (przykład: „Q”) lub wywołanie typu kwalifikowanego (przykład: „T.Name”) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Niekompletne wyrażenie operatora (na przykład a^b) lub wywołanie typu kwalifikowanego (przykład: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Właściwość init-only „{0}” nie może być ustawiona poza kodem inicjowania. Zobacz https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Nieprawidłowe ograniczenie. Prawidłowe formularze ograniczeń obejmują \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" dla ograniczeń własnych. Zobacz https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Następujące wymagane właściwości muszą zostać zainicjowane:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Nie można wywołać „{0}” — metody ustawiającej dla właściwości tylko do inicjowania. Zamiast tego użyj inicjowania obiektu. Zobacz https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Cecha „{0}” wywołana przez to wywołanie ma wiele typów obsługi. Ta składnia wywołania nie jest dozwolona dla takich cech. Aby uzyskać wskazówki, zobacz https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Wywołanie ograniczenia statycznego powinno używać elementu \"' T.Ident\" a nie \"^T.Ident\", nawet w przypadku statycznie rozpoznawanych parametrów typu. Trait '{0}' is not static - Trait '{0}' is not static + Cecha „{0}” nie jest statyczna Trait '{0}' is static - Trait '{0}' is static + Cecha „{0}” jest statyczna A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Cecha nie może określać opcjonalnych argumentów in, out, ParamArray, CallerInfo lub Quote @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + Element „{0}” jest zwykle używany jako ograniczenie typu w kodzie ogólnym, np. \"" T, gdy ISomeInterface<' T>\" lub \"let f (x: #ISomeInterface<_>)\". Aby uzyskać wskazówki, zobacz https://aka.ms/fsharp-iwsams. To ostrzeżenie można wyłączyć, używając polecenia „nowarn \"3536\"" lub "--nowarn:3536”. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + Deklarowanie \"interfejsów ze statycznymi metodami abstrakcyjnymi\" jest funkcją zaawansowaną. Aby uzyskać wskazówki, zobacz https://aka.ms/fsharp-iwsams. To ostrzeżenie można wyłączyć przy użyciu polecenia „#nowarn \"3535\"" lub "--nowarn:3535”. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 7ee5a8cb3bc..89411181e8b 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + statik soyut arabirim üyeleri support for consuming init properties - support for consuming init properties + başlatma özelliklerini kullanma desteği @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + RequireQualifiedAccess özniteliğinde küçük harf DU'ya izin ver @@ -269,7 +269,7 @@ support for required properties - support for required properties + gerekli özellikler için destek @@ -279,7 +279,7 @@ self type constraints - self type constraints + kendi kendine tür kısıtlamaları @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + '%A' biçim belirticisi, '--reflectionfree' seçeneğiyle derlenen bir derlemede kullanılamaz. Bu yapı örtük olarak yansımayı kullanır. @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + Bir nesnenin desende veya bağlamada verilen türde olup olmadığını kontrol etmek için kullanılır. @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + Arabirim ve iyileştirme veri dosyalarını sıkıştır Display the allowed values for language version. - Display the allowed values for language version. + Dil sürümü için izin verilen değerleri görüntüleyin. @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + Dahil edilen iyileştirme bilgilerini belirtin; varsayılan değer dosyadır. Dağıtılmış kitaplıklar için önemlidir. The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + pdb çıkış dosyası adı, derleme çıkış dosya adı kullanımı --pdb:filename.pdb ile eşleşmiyor @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + Yansıma kullanarak yapıların örtük oluşturulmasını devre dışı bırak Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + 'latest' veya 'preview' gibi dil sürümünü belirtin. Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + F# arabirim bilgilerini dahil edin; varsayılan değer dosyadır. Kitaplıkları dağıtmak için gereklidir. @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + --optimizationdata için geçersiz '{0}' değeri, geçerli değerler: none, file, compress. Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + --interfacedata için geçersiz '{0}' değeri, geçerli değerler: none, file, compress. @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + Eksik karakter değişmez değeri (örnek: 'Q') veya tam tür çağrısı (örnek: 'T.Name) Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + Eksik işleç ifadesi (örnek a^b) veya tam tür çağrısı (örnek: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + '{0}' yalnızca başlatma özelliği başlatma kodunun dışında ayarlanamaz. Bkz. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + Geçersiz kısıtlama. Geçerli kısıtlama formları arabirim kısıtlamaları için \"'T :> ISomeInterface\" ve kendi kendine kısıtlamalar için \"SomeConstrainingType<'T>\" içerir. Bkz. https://aka.ms/fsharp-type-constraints. @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + Aşağıdaki gerekli özelliklerin başlatılması gerekiyor:{0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + Yalnızca başlatma özelliği için ayarlayıcı olan '{0}' çağrılamaz, lütfen bunun yerine nesne başlatmayı kullanın. bkz. https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + Bu çağrı tarafından çağrılan '{0}' özelliği birden çok destek türüne sahiptir. Bu tür nitelikler için bu çağrı söz dizimine izin verilmez. Rehber için bkz. https://aka.ms/fsharp-srtp. Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + Statik kısıtlamanın çağrılması statik olarak çözümlenmiş tür parametreleri için bile \"^T.Ident\" değil, \"'T.Ident\" kullanmalıdır. Trait '{0}' is not static - Trait '{0}' is not static + '{0}' niteliği statik değildir Trait '{0}' is static - Trait '{0}' is static + '{0}' niteliği statiktir A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + Bir nitelik optional, in, out, ParamArray, CallerInfo veya Quote bağımsız değişkenlerini belirtemiyor @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + '{0}' normalde genel kodda tür kısıtlaması olarak kullanılır, ör. \"'T when ISomeInterface<'T>\" veya \"let f (x: #ISomeInterface<_>)\". Rehber için bkz. https://aka.ms/fsharp-iwsams. '#nowarn \"3536\"' veya '--nowarn:3536' kullanarak bu uyarıyı devre dışı bırakabilirsiniz. Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + \"interfaces with static abstract methods\" bildirimi gelişmiş bir özelliktir. Rehber için bkz. https://aka.ms/fsharp-iwsams. '#nowarn \"3535\"' veya '--nowarn:3535'. kullanarak bu uyarıyı devre dışı bırakabilirsiniz. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 2659f03165a..34be7072109 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -189,12 +189,12 @@ static abstract interface members - static abstract interface members + 静态抽象接口成员 support for consuming init properties - support for consuming init properties + 支持使用 init 属性 @@ -204,7 +204,7 @@ Allow lowercase DU when RequireQualifiedAccess attribute - Allow lowercase DU when RequireQualifiedAccess attribute + 当 RequireQualifiedAccess 属性时允许小写 DU @@ -269,7 +269,7 @@ support for required properties - support for required properties + 对所需属性的支持 @@ -279,7 +279,7 @@ self type constraints - self type constraints + 自类型约束 @@ -329,7 +329,7 @@ The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. - The '%A' format specifier may not be used in an assembly being compiled with option '--reflectionfree'. This construct implicitly uses reflection. + "%A" 格式说明符不能在用选项 "--reflectionfree" 进行编译的程序集中使用。此构造隐式使用反射。 @@ -374,7 +374,7 @@ Used to check if an object is of the given type in a pattern or binding. - Used to check if an object is of the given type in a pattern or binding. + 用于检查对象是否属于模式或绑定中的给定类型。 @@ -474,12 +474,12 @@ Compress interface and optimization data files - Compress interface and optimization data files + 压缩接口和优化数据文件 Display the allowed values for language version. - Display the allowed values for language version. + 显示语言版本的允许值。 @@ -494,12 +494,12 @@ Specify included optimization information, the default is file. Important for distributed libraries. - Specify included optimization information, the default is file. Important for distributed libraries. + 指定包含的优化信息,默认值为文件。对于分发库非常重要。 The pdb output file name cannot match the build output filename use --pdb:filename.pdb - The pdb output file name cannot match the build output filename use --pdb:filename.pdb + pdb 输出文件名不能与生成输出文件名 use --pdb: filename.pdb 匹配 @@ -514,17 +514,17 @@ Disable implicit generation of constructs using reflection - Disable implicit generation of constructs using reflection + 使用反射禁用隐式构造生成 Specify language version such as 'latest' or 'preview'. - Specify language version such as 'latest' or 'preview'. + 指定语言版本,如 "latest" 或 "preview"。 Include F# interface information, the default is file. Essential for distributing libraries. - Include F# interface information, the default is file. Essential for distributing libraries. + 包括 F# 接口信息,默认值为文件。对于分发库必不可少。 @@ -534,12 +534,12 @@ Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. - Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + --optimizationdata 的值 "{0}" 无效,有效值为: none、file、compress。 Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. - Invalid value '{0}' for --interfacedata, valid value are: none, file, compress. + --interfacedata 的值 "{0}" 无效,有效值为: none、file、compress。 @@ -594,12 +594,12 @@ Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) - Incomplete character literal (example: 'Q') or qualified type invocation (example: 'T.Name) + 字符文本不完整(示例: "Q")或限定类型调用(示例: "T.Name") Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) - Incomplete operator expression (example a^b) or qualified type invocation (example: ^T.Name) + 运算符表达式不完整(示例: a^b)或限定类型调用(示例: ^T.Name) @@ -784,7 +784,7 @@ Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Init-only property '{0}' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + 不能在初始化代码外部设置仅限 init 的属性 "{0}"。请参阅 https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -814,7 +814,7 @@ Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. - Invalid constraint. Valid constraint forms include \"'T :> ISomeInterface\" for interface constraints and \"SomeConstrainingType<'T>\" for self-constraints. See https://aka.ms/fsharp-type-constraints. + 约束无效。有效的约束形式包括 \"'T :> ISomeInterface\" (接口约束)和 \"SomeConstrainingType<'T>\" (自我约束)。请参阅 https://aka.ms/fsharp-type-constraints。 @@ -859,7 +859,7 @@ The following required properties have to be initalized:{0} - The following required properties have to be initalized:{0} + 必须初始化以下必需属性: {0} @@ -944,7 +944,7 @@ Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization - Cannot call '{0}' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization + 无法调用 "{0}",它是仅限 init 属性的资源库,请改用对象初始化。请参阅 https://aka.ms/fsharp-assigning-values-to-properties-at-initialization @@ -954,27 +954,27 @@ The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. - The trait '{0}' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance. + 此调用过程调用的特征 "{0}" 具有多种支持类型。此类特征不允许使用此调用语法。有关指南,请参阅 https://aka.ms/fsharp-srtp。 Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. - Invocation of a static constraint should use \"'T.Ident\" and not \"^T.Ident\", even for statically resolved type parameters. + 调用静态约束应使用 \"'T.Ident\" 而不是 \"^T.Ident\",即使对于静态解析的类型参数也是如此。 Trait '{0}' is not static - Trait '{0}' is not static + 特征 "{0}" 不是静态的 Trait '{0}' is static - Trait '{0}' is static + 特征 "{0}" 是静态的 A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments - A trait may not specify optional, in, out, ParamArray, CallerInfo or Quote arguments + 特征不能指定 option、in、out、ParamArray、CallerInfo 或 Quote 参数 @@ -984,12 +984,12 @@ '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. - '{0}' is normally used as a type constraint in generic code, e.g. \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3536\"' or '--nowarn:3536'. + "{0}" 通常用作泛型代码中的类型约束,例如 \"'T when ISomeInterface<'T>\" or \"let f (x: #ISomeInterface<_>)\"。有关指南,请参阅 https://aka.ms/fsharp-iwsams。可以使用 '#nowarn \"3536\"' 或 '--nowarn:3536' 禁用此警告。 Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. - Declaring \"interfaces with static abstract methods\" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn \"3535\"' or '--nowarn:3535'. + 声明“使用静态抽象方法的接口”是一项高级功能。有关指南,请参阅 https://aka.ms/fsharp-iwsams。可以使用 "#nowarn \"3535\"' 或 '--nowarn:3535' 禁用此警告。 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index f80da09f758..bdf7cf1baa1 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Případy sjednocení s malými písmeny jsou povolené jenom při použití atributu RequireQualifiedAccess. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 8978b176751..1662a9afc0f 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Diskriminierte Union-Fälle in Kleinbuchstaben sind nur zulässig, wenn das RequireQualifiedAccess-Attribut verwendet wird. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index bc0ce4ad5a8..4ca6ad72d0f 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Los casos de unión discriminada en minúsculas solo se permiten cuando se usa el atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index f88d8e7182b..0b1d980d8b3 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Les cas d’union discriminée en minuscules sont uniquement autorisés lors de l’utilisation de l’attribut RequireQualifiedAccess. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 90d7b1611ff..bb186e7c64d 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + I casi di unione discriminati minuscoli sono consentiti solo quando si usa l'attributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 95015040f09..a7c0f529c55 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + 소문자로 구분된 공용 구조체 케이스는 RequireQualifiedAccess 특성을 사용하는 경우에만 허용됩니다. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 48a2f8adedc..8de02a886a6 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Przypadki unii z dyskryminatorem z małymi literami są dozwolone tylko w przypadku używania atrybutu RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 31b4cad81af..af51d07edbd 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + Küçük harf ayrımlı birleşim durumlarına yalnızca RequireQualifiedAccess özniteliği kullanılırken izin verilir diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index be3604df4bf..f90ed1f41f2 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -9,7 +9,7 @@ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute - Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute + 仅当使用 RequireQualifiedAccess 属性时才允许区分小写的联合事例 From eaa723db6a80d4fca15cbc70a78f9662363cd007 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 21 Sep 2022 16:24:56 +0100 Subject: [PATCH 188/226] Fix 13944 (#13946) --- src/Compiler/Interactive/fsi.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 316dfd429bb..ddf46360ae7 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -827,8 +827,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, tcConfigB, fsiConsoleOutput: FsiConsoleOutput) = - let mutable enableConsoleKeyProcessing = - not (Environment.OSVersion.Platform = PlatformID.Win32NT) + let mutable enableConsoleKeyProcessing = true let mutable gui = true // override via "--gui" on by default #if DEBUG From 6f78b1c812cbd3ac05c6846edb6e808d97cfe815 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 21:17:41 +0200 Subject: [PATCH 189/226] [main] Update dependencies from dotnet/arcade (#13939) * Update dependencies from https://github.com/dotnet/arcade build 20220919.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22466.3 -> To Version 8.0.0-beta.22469.1 * Update dependencies from https://github.com/dotnet/arcade build 20220920.3 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22466.3 -> To Version 8.0.0-beta.22470.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/common/templates/jobs/source-build.yml | 2 +- eng/common/templates/steps/source-build.yml | 8 +++++++- global.json | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d61aadbec93..3db85fb8b63 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - bf47db2617320c82f94713d7b538f7bc0fa9d662 + 025103bcaefad81506465eeb7bb09b107b20f32d - + https://github.com/dotnet/arcade - bf47db2617320c82f94713d7b538f7bc0fa9d662 + 025103bcaefad81506465eeb7bb09b107b20f32d diff --git a/eng/common/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml index 00aa98eb3bf..8dd2d355f22 100644 --- a/eng/common/templates/jobs/source-build.yml +++ b/eng/common/templates/jobs/source-build.yml @@ -14,7 +14,7 @@ parameters: # This is the default platform provided by Arcade, intended for use by a managed-only repo. defaultManagedPlatform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20220809204800-17a4aab' # Defines the platforms on which to run build jobs. One job is created for each platform, and the # object in this array is sent to the job template as 'platform'. If no platforms are specified, diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml index 12a8ff94d8e..4ec5577d28a 100644 --- a/eng/common/templates/steps/source-build.yml +++ b/eng/common/templates/steps/source-build.yml @@ -68,6 +68,11 @@ steps: publishArgs='--publish' fi + assetManifestFileName=SourceBuild_RidSpecific.xml + if [ '${{ parameters.platform.name }}' != '' ]; then + assetManifestFileName=SourceBuild_${{ parameters.platform.name }}.xml + fi + ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ --restore --build --pack $publishArgs -bl \ @@ -76,7 +81,8 @@ steps: $internalRestoreArgs \ $targetRidArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ - /p:ArcadeBuildFromSource=true + /p:ArcadeBuildFromSource=true \ + /p:AssetManifestFileName=$assetManifestFileName displayName: Build # Upload build logs for diagnosis. diff --git a/global.json b/global.json index 43313346974..281deb7ea7f 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22466.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22466.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22470.3", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22470.3" } } From 51635bbebf36e39a86d06d96730e13cfc40a095f Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 21 Sep 2022 21:20:35 +0200 Subject: [PATCH 190/226] Parallel type checking for impl files with backing sig files (#13737) * revamp parallel checking * simplify names * fix diagnostics * code formatting * update surface area * simplify diagnostic logging and format diagnostics eagerly when processing in parallel * format code * remove SplitRelatedDiagnostic * fix build and cleanup * further cleanup * further cleanup * format code * fix flaterrors * allow error recovery on collisions * fix name generation to be deterministic * fix build * Update RecursiveSafetyAnalysis.fs * Add flag for parallel type checking of files backed by signatures. * Update src/Compiler/Driver/ParseAndCheckInputs.fs Co-authored-by: Petr Pokorny * format code * Update TypeTests.fs * Prefix DiagnosticsLoggerProvider with I * Remove duplicate hadSig binding. * Add basic test for ParallelCheckingWithSignatureFiles flag. * Add additional CI job. * Produce binlog for ParallelCheckingWithSignatureFiles * Update azure-pipelines.yml * Update azure-pipelines.yml * Update TypeTests.fs * Update SyntaxTreeTests * Correct code after rebase * Correct SynModuleSigDecl in SignatureTypeTests.fs * Format ParseAndCheckInputs.fs Co-authored-by: Don Syme Co-authored-by: Don Syme Co-authored-by: Petr Pokorny Co-authored-by: Vlad Zarytovskii --- FSharpBuild.Directory.Build.props | 1 + azure-pipelines.yml | 30 + src/Compiler/Checking/CheckBasics.fs | 3 +- src/Compiler/Checking/CheckBasics.fsi | 1 - src/Compiler/Checking/CheckDeclarations.fs | 31 +- src/Compiler/Checking/CheckDeclarations.fsi | 12 +- src/Compiler/Checking/ConstraintSolver.fs | 10 +- src/Compiler/Checking/ConstraintSolver.fsi | 20 +- src/Compiler/Checking/import.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 7 +- src/Compiler/Driver/CompilerConfig.fs | 17 +- src/Compiler/Driver/CompilerConfig.fsi | 4 + src/Compiler/Driver/CompilerDiagnostics.fs | 1316 ++++++++--------- src/Compiler/Driver/CompilerDiagnostics.fsi | 79 +- src/Compiler/Driver/CompilerImports.fs | 8 +- src/Compiler/Driver/CompilerOptions.fs | 3 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 538 ++++--- src/Compiler/Driver/ParseAndCheckInputs.fsi | 50 +- src/Compiler/Driver/ScriptClosure.fs | 16 +- src/Compiler/Driver/fsc.fs | 176 +-- src/Compiler/Driver/fsc.fsi | 21 +- src/Compiler/Facilities/DiagnosticsLogger.fs | 39 +- src/Compiler/Facilities/DiagnosticsLogger.fsi | 50 +- src/Compiler/Interactive/fsi.fs | 59 +- .../Legacy/LegacyHostedCompilerForTesting.fs | 24 +- src/Compiler/Service/FSharpCheckerResults.fs | 43 +- .../Service/FSharpParseFileResults.fs | 2 +- src/Compiler/Service/IncrementalBuild.fs | 14 +- src/Compiler/Service/IncrementalBuild.fsi | 1 + .../Service/ServiceInterfaceStubGenerator.fs | 4 +- src/Compiler/Service/ServiceLexing.fs | 8 +- src/Compiler/Service/ServiceNavigation.fs | 16 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 4 +- src/Compiler/Service/ServiceParsedInputOps.fs | 12 +- src/Compiler/Service/ServiceStructure.fs | 8 +- src/Compiler/Service/ServiceXmlDocParser.fs | 3 +- src/Compiler/Service/service.fs | 42 +- src/Compiler/Service/service.fsi | 4 +- src/Compiler/Symbols/FSharpDiagnostic.fs | 54 +- src/Compiler/SyntaxTree/LexHelpers.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 64 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 42 +- src/Compiler/TypedTree/CompilerGlobalState.fs | 4 +- src/Compiler/TypedTree/TypedTree.fsi | 2 +- src/Compiler/TypedTree/TypedTreeOps.fs | 92 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 +- src/Compiler/Utilities/lib.fs | 14 +- src/Compiler/Utilities/lib.fsi | 17 +- src/fsc/fscmain.fs | 2 +- .../FSharp.Compiler.ComponentTests.fsproj | 1 + ...ParallelCheckingWithSignatureFilesTests.fs | 61 + ...erService.SurfaceArea.netstandard.expected | 48 +- tests/FSharp.Test.Utilities/Compiler.fs | 12 +- tests/fsharp/typecheck/sigs/neg10.bsl | 2 - tests/service/Common.fs | 2 +- tests/service/InteractiveCheckerTests.fs | 2 +- tests/service/Symbols.fs | 10 +- tests/service/SyntaxTreeTests/BindingTests.fs | 44 +- .../ComputationExpressionTests.fs | 4 +- .../service/SyntaxTreeTests/EnumCaseTests.fs | 6 +- .../service/SyntaxTreeTests/ExceptionTests.fs | 2 +- .../SyntaxTreeTests/ExpressionTests.fs | 46 +- .../SyntaxTreeTests/IfThenElseTests.fs | 16 +- tests/service/SyntaxTreeTests/LambdaTests.fs | 18 +- .../SyntaxTreeTests/MatchClauseTests.fs | 24 +- tests/service/SyntaxTreeTests/MeasureTests.fs | 10 +- .../SyntaxTreeTests/MemberFlagTests.fs | 10 +- .../ModuleOrNamespaceSigTests.fs | 10 +- .../SyntaxTreeTests/ModuleOrNamespaceTests.fs | 14 +- .../SyntaxTreeTests/NestedModuleTests.fs | 10 +- .../SyntaxTreeTests/OperatorNameTests.fs | 40 +- .../ParsedHashDirectiveTests.fs | 8 +- tests/service/SyntaxTreeTests/PatternTests.fs | 10 +- .../SyntaxTreeTests/SignatureTypeTests.fs | 44 +- .../SyntaxTreeTests/SourceIdentifierTests.fs | 6 +- tests/service/SyntaxTreeTests/StringTests.fs | 2 +- tests/service/SyntaxTreeTests/TypeTests.fs | 52 +- .../service/SyntaxTreeTests/UnionCaseTests.fs | 12 +- tests/service/XmlDocTests.fs | 30 +- vsintegration/tests/UnitTests/Tests.Watson.fs | 4 +- 80 files changed, 1947 insertions(+), 1586 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/TypeChecks/ParallelCheckingWithSignatureFilesTests.fs diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 7a349c38471..0c8d9cef75c 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -26,6 +26,7 @@ 1182;0025;$(WarningsAsErrors) $(OtherFlags) --nowarn:3384 $(OtherFlags) --times --nowarn:75 + $(OtherFlags) --test:ParallelCheckingWithSignatureFilesOn diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 65e3e0fa007..d739dc40ac2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -508,6 +508,36 @@ stages: # filePath: eng\tests\UpToDate.ps1 # arguments: -configuration $(_BuildConfig) -ci -binaryLog + # Run Build with --test:ParallelCheckingWithSignatureFilesOn + - job: ParallelCheckingWithSignatureFiles + condition: eq(variables['Build.Reason'], 'PullRequest') + variables: + - name: _SignType + value: Test + pool: + name: NetCore-Public + demands: ImageOverride -equals $(WindowsMachineQueueName) + timeoutInMinutes: 90 + steps: + - checkout: self + clean: true + - task: UseDotNet@2 + displayName: install SDK + inputs: + packageType: sdk + useGlobalJson: true + includePreviewVersions: false + workingDirectory: $(Build.SourcesDirectory) + installationPath: $(Build.SourcesDirectory)/.dotnet + - script: .\build.cmd -c Release -binaryLog /p:ParallelCheckingWithSignatureFilesOn=true + displayName: ParallelCheckingWithSignatureFiles build with Debug configuration + - task: PublishPipelineArtifact@1 + displayName: Publish ParallelCheckingWithSignatureFiles Logs + inputs: + targetPath: '$(Build.SourcesDirectory)/artifacts/log/Release' + artifactName: 'ParallelCheckingWithSignatureFiles Attempt $(System.JobAttempt) Logs' + continueOnError: true + # Plain build Windows - job: Plain_Build_Windows pool: diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index e6fb4014376..18f457ef887 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -328,13 +328,14 @@ type TcFileState = /// Create a new compilation environment static member Create - (g, isScript, niceNameGen, amap, thisCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring, + (g, isScript, amap, thisCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring, tcPat, tcSimplePats, tcSequenceExpressionEntry, tcArrayOrListSequenceExpression, tcComputationExpression) = + let niceNameGen = NiceNameGenerator() let infoReader = InfoReader(g, amap) let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index 0a156d268d1..389b716e1c8 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -311,7 +311,6 @@ type TcFileState = static member Create: g: TcGlobals * isScript: bool * - niceNameGen: NiceNameGenerator * amap: ImportMap * thisCcu: CcuThunk * isSig: bool * diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 0d9b0df134b..0e3b8a7973b 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -688,13 +688,12 @@ let TcOpenDecl (cenv: cenv) mOpenDecl scopem env target = | SynOpenDeclTarget.Type (synType, m) -> TcOpenTypeDecl cenv mOpenDecl scopem env (synType, m) -let MakeSafeInitField (g: TcGlobals) env m isStatic = +let MakeSafeInitField (cenv: cenv) env m isStatic = let id = // Ensure that we have an g.CompilerGlobalState - assert(g.CompilerGlobalState |> Option.isSome) - ident(g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName("init", m), m) + ident(cenv.niceNameGen.FreshCompilerGeneratedName("init", m), m) let taccess = TAccess [env.eAccessPath] - Construct.NewRecdField isStatic None id false g.int_ty true true [] [] XmlDoc.Empty taccess true + Construct.NewRecdField isStatic None id false cenv.g.int_ty true true [] [] XmlDoc.Empty taccess true // Checking of mutually recursive types, members and 'let' bindings in classes // @@ -1268,7 +1267,7 @@ module MutRecBindingChecking = | _ -> false) if needsSafeStaticInit && hasStaticBindings then - let rfield = MakeSafeInitField g envForDecls tcref.Range true + let rfield = MakeSafeInitField cenv envForDecls tcref.Range true SafeInitField(mkRecdFieldRef tcref rfield.LogicalName, rfield) else NoSafeInitInfo @@ -2426,7 +2425,7 @@ module EstablishTypeDefinitionCores = let ComputeInstanceSafeInitInfo (cenv: cenv) env m thisTy = let g = cenv.g if InstanceMembersNeedSafeInitCheck cenv m thisTy then - let rfield = MakeSafeInitField g env m false + let rfield = MakeSafeInitField cenv env m false let tcref = tcrefOfAppTy g thisTy SafeInitField (mkRecdFieldRef tcref rfield.LogicalName, rfield) else @@ -4479,7 +4478,7 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE // Publish the combined module type env.eModuleOrNamespaceTypeAccumulator.Value <- - CombineCcuContentFragments m [env.eModuleOrNamespaceTypeAccumulator.Value; modTyRoot] + CombineCcuContentFragments [env.eModuleOrNamespaceTypeAccumulator.Value; modTyRoot] env return env @@ -4801,7 +4800,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem // Publish the combined module type env.eModuleOrNamespaceTypeAccumulator.Value <- - CombineCcuContentFragments m [env.eModuleOrNamespaceTypeAccumulator.Value; modTyRoot] + CombineCcuContentFragments [env.eModuleOrNamespaceTypeAccumulator.Value; modTyRoot] env, openDecls let moduleContentsRoot = BuildRootModuleContents kind.IsModule enclosingNamespacePath envNS.eCompPath moduleContents @@ -5157,7 +5156,7 @@ let MakeInitialEnv env = /// Typecheck, then close the inference scope and then check the file meets its signature (if any) let CheckOneImplFile // checkForErrors: A function to help us stop reporting cascading errors - (g, niceNameGen, amap, + (g, amap, thisCcu, openDecls0, checkForErrors, @@ -5173,7 +5172,7 @@ let CheckOneImplFile cancellable { let cenv = - cenv.Create (g, isScript, niceNameGen, amap, thisCcu, false, Option.isSome rootSigOpt, + cenv.Create (g, isScript, amap, thisCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring, tcPat=TcPat, tcSimplePats=TcSimplePats, @@ -5291,17 +5290,17 @@ let CheckOneImplFile let implFile = CheckedImplFile (qualNameOfFile, scopedPragmas, implFileTy, implFileContents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) - return (topAttrs, implFile, implFileTypePriorToSig, envAtEnd, cenv.createsGeneratedProvidedTypes) + return (topAttrs, implFile, envAtEnd, cenv.createsGeneratedProvidedTypes) } /// Check an entire signature file -let CheckOneSigFile (g, niceNameGen, amap, thisCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) tcEnv (ParsedSigFileInput (qualifiedNameOfFile = qualNameOfFile; modules = sigFileFrags)) = +let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) tcEnv (sigFile: ParsedSigFileInput) = cancellable { let cenv = cenv.Create - (g, false, niceNameGen, amap, thisCcu, true, false, conditionalDefines, tcSink, + (g, false, amap, thisCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring, tcPat=TcPat, tcSimplePats=TcSimplePats, @@ -5311,8 +5310,8 @@ let CheckOneSigFile (g, niceNameGen, amap, thisCcu, checkForErrors, conditionalD let envinner, moduleTyAcc = MakeInitialEnv tcEnv - let specs = [ for x in sigFileFrags -> SynModuleSigDecl.NamespaceFragment x ] - let! tcEnv = TcSignatureElements cenv ParentNone qualNameOfFile.Range envinner PreXmlDoc.Empty None specs + let specs = [ for x in sigFile.Contents -> SynModuleSigDecl.NamespaceFragment x ] + let! tcEnv = TcSignatureElements cenv ParentNone sigFile.QualifiedName.Range envinner PreXmlDoc.Empty None specs let sigFileType = moduleTyAcc.Value @@ -5320,7 +5319,7 @@ let CheckOneSigFile (g, niceNameGen, amap, thisCcu, checkForErrors, conditionalD try sigFileType |> IterTyconsOfModuleOrNamespaceType (fun tycon -> FinalTypeDefinitionChecksAtEndOfInferenceScope(cenv.infoReader, tcEnv.NameEnv, cenv.tcSink, false, tcEnv.DisplayEnv, tycon)) - with exn -> errorRecovery exn qualNameOfFile.Range + with exn -> errorRecovery exn sigFile.QualifiedName.Range return (tcEnv, sigFileType, cenv.createsGeneratedProvidedTypes) } diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index 8a858bca0c4..00033bfb9d6 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -49,7 +49,6 @@ val AddLocalSubModule: val CheckOneImplFile: TcGlobals * - NiceNameGenerator * ImportMap * CcuThunk * OpenDeclaration list * @@ -60,17 +59,10 @@ val CheckOneImplFile: TcEnv * ModuleOrNamespaceType option * ParsedImplFileInput -> - Cancellable + Cancellable val CheckOneSigFile: - TcGlobals * - NiceNameGenerator * - ImportMap * - CcuThunk * - (unit -> bool) * - ConditionalDefines option * - TcResultsSink * - bool -> + TcGlobals * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines option * TcResultsSink * bool -> TcEnv -> ParsedSigFileInput -> Cancellable diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 8feeb65a6a1..c69db854c24 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -244,15 +244,15 @@ exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Typar * exception ConstraintSolverError of string * range * range -exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * exn * range +exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * error: exn * range: range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * range +exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * error: exn * range: range -exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * ContextInfo * parameterRange: range +exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * error: exn * ctxtInfo: ContextInfo * parameterRange: range -exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range +exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * error: exn * range: range -exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range +exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range: range exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index c45db538fc2..ca6a0bc4c47 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -170,33 +170,39 @@ exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Typar * exception ConstraintSolverError of string * range * range -exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * exn * range +exception ErrorFromApplyingDefault of + tcGlobals: TcGlobals * + displayEnv: DisplayEnv * + Typar * + TType * + error: exn * + range: range exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * - exn * - range + error: exn * + range: range exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * - exn * - ContextInfo * + error: exn * + ctxtInfo: ContextInfo * parameterRange: range -exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range +exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * error: exn * range: range exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * - range + range: range exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index cca134f4d38..03e13801249 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -584,7 +584,7 @@ let ImportILAssemblyTypeDefs (amap, m, auxModLoader, aref, mainmod: ILModuleDef) let scoref = ILScopeRef.Assembly aref let mtypsForExportedTypes = ImportILAssemblyExportedTypes amap m auxModLoader scoref mainmod.ManifestOfAssembly.ExportedTypes let mainmod = ImportILAssemblyMainTypeDefs amap m scoref mainmod - CombineCcuContentFragments m (mainmod :: mtypsForExportedTypes) + CombineCcuContentFragments (mainmod :: mtypsForExportedTypes) /// Import the type forwarder table for an IL assembly let ImportILAssemblyTypeForwarders (amap, m, exportedTypes: ILExportedTypesAndForwarders): CcuTypeForwarderTable = diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 4064cdd1896..829b7e03d20 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -11552,6 +11552,11 @@ let CodegenAssembly cenv eenv mgbuf implFiles = match List.tryFrontAndBack implFiles with | None -> () | Some (firstImplFiles, lastImplFile) -> + + // Generate the assembly sequentially, implementation file by implementation file. + // + // NOTE: In theory this could be done in parallel, except for the presence of linear + // state in the AssemblyBuilder let eenv = List.fold (GenImplFile cenv mgbuf None) eenv firstImplFiles let eenv = GenImplFile cenv mgbuf cenv.options.mainMethodInfo eenv lastImplFile @@ -11626,7 +11631,7 @@ type IlxGenResults = let GenerateCode (cenv, anonTypeTable, eenv, CheckedAssemblyAfterOptimization implFiles, assemAttribs, moduleAttribs) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.IlxGen + use _ = UseBuildPhase BuildPhase.IlxGen let g = cenv.g // Generate the implementations into the mgbuf diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 55ac85b9a3a..774cb954ca9 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -502,6 +502,7 @@ type TcConfigBuilder = mutable emitTailcalls: bool mutable deterministic: bool mutable concurrentBuild: bool + mutable parallelCheckingWithSignatureFiles: bool mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option mutable lcid: int option @@ -725,6 +726,7 @@ type TcConfigBuilder = emitTailcalls = true deterministic = false concurrentBuild = true + parallelCheckingWithSignatureFiles = false emitMetadataAssembly = MetadataAssemblyGeneration.None preferredUiLang = None lcid = None @@ -797,7 +799,7 @@ type TcConfigBuilder = tcConfigB.fxResolver <- None // this needs to be recreated when the primary assembly changes member tcConfigB.ResolveSourceFile(m, nm, pathLoadedFrom) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter let paths = seq { @@ -809,7 +811,7 @@ type TcConfigBuilder = /// Decide names of output file, pdb and assembly member tcConfigB.DecideNames sourceFiles = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter if sourceFiles = [] then errorR (Error(FSComp.SR.buildNoInputsSpecified (), rangeCmdArgs)) @@ -860,7 +862,7 @@ type TcConfigBuilder = outfile, pdbfile, assemblyName member tcConfigB.TurnWarningOff(m, s: string) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter match GetWarningNumber(m, s) with | None -> () @@ -875,7 +877,7 @@ type TcConfigBuilder = } member tcConfigB.TurnWarningOn(m, s: string) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter match GetWarningNumber(m, s) with | None -> () @@ -1276,6 +1278,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.emitTailcalls = data.emitTailcalls member _.deterministic = data.deterministic member _.concurrentBuild = data.concurrentBuild + member _.parallelCheckingWithSignatureFiles = data.parallelCheckingWithSignatureFiles member _.emitMetadataAssembly = data.emitMetadataAssembly member _.pathMap = data.pathMap member _.langVersion = data.langVersion @@ -1309,7 +1312,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.exiter = data.exiter static member Create(builder, validate) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter TcConfig(builder, validate) member _.legacyReferenceResolver = data.legacyReferenceResolver @@ -1326,7 +1329,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.GetTargetFrameworkDirectories() = targetFrameworkDirectories member tcConfig.ComputeIndentationAwareSyntaxInitialStatus fileName = - use _unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _unwindBuildPhase = UseBuildPhase BuildPhase.Parameter let indentationAwareSyntaxOnByDefault = List.exists (FileSystemUtils.checkSuffix fileName) FSharpIndentationAwareSyntaxFileSuffixes @@ -1337,7 +1340,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = (tcConfig.indentationAwareSyntax = Some true) member tcConfig.GetAvailableLoadedSources() = - use _unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _unwindBuildPhase = UseBuildPhase BuildPhase.Parameter let resolveLoadedSource (m, originalPath, path) = try diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index e200fb03e02..342c767bbb2 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -407,6 +407,8 @@ type TcConfigBuilder = mutable concurrentBuild: bool + mutable parallelCheckingWithSignatureFiles: bool + mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option @@ -723,6 +725,8 @@ type TcConfig = member concurrentBuild: bool + member parallelCheckingWithSignatureFiles: bool + member emitMetadataAssembly: MetadataAssemblyGeneration member pathMap: PathMap diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index a6e0450af3a..a2fd68372c7 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -42,9 +42,7 @@ open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps #if DEBUG -[] -module internal CompilerService = - let showAssertForUnexpectedException = ref true +let showAssertForUnexpectedException = ref true #endif /// This exception is an old-style way of reporting a diagnostic @@ -77,12 +75,13 @@ exception DeprecatedCommandLineOptionNoDescription of string * range /// This exception is an old-style way of reporting a diagnostic exception InternalCommandLineOption of string * range -let GetRangeOfDiagnostic (diagnostic: PhasedDiagnostic) = - let rec RangeFromException exn = +type Exception with + + member exn.DiagnosticRange = match exn with - | ErrorFromAddingConstraint (_, exn2, _) -> RangeFromException exn2 + | ErrorFromAddingConstraint (_, exn2, _) -> exn2.DiagnosticRange #if !NO_TYPEPROVIDERS - | TypeProviders.ProvidedTypeResolutionNoRange exn -> RangeFromException exn + | TypeProviders.ProvidedTypeResolutionNoRange exn -> exn.DiagnosticRange | TypeProviders.ProvidedTypeResolution (m, _) #endif | ReservedKeyword (_, m) @@ -203,17 +202,13 @@ let GetRangeOfDiagnostic (diagnostic: PhasedDiagnostic) = | HashLoadedSourceHasIssues (_, _, _, m) | HashLoadedScriptConsideredSource m -> Some m // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> RangeFromException e.InnerException + | :? System.Reflection.TargetInvocationException as e -> e.InnerException.DiagnosticRange #if !NO_TYPEPROVIDERS | :? TypeProviderError as e -> e.Range |> Some #endif - | _ -> None - RangeFromException diagnostic.Exception - -let GetDiagnosticNumber (diagnostic: PhasedDiagnostic) = - let rec GetFromException (exn: exn) = + member exn.DiagnosticNumber = match exn with // DO NOT CHANGE THESE NUMBERS | ErrorFromAddingTypeEquation _ -> 1 @@ -328,13 +323,10 @@ let GetDiagnosticNumber (diagnostic: PhasedDiagnostic) = | TypeProviders.ProvidedTypeResolution _ -> 103 #endif | PatternMatchCompilation.EnumMatchIncomplete _ -> 104 - // DO NOT CHANGE THE NUMBERS // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as e -> GetFromException e.InnerException - - | WrappedError (e, _) -> GetFromException e - + | :? TargetInvocationException as e -> e.InnerException.DiagnosticNumber + | WrappedError (e, _) -> e.DiagnosticNumber | DiagnosticWithText (n, _, _) -> n | DiagnosticWithSuggestions (n, _, _, _, _) -> n | Failure _ -> 192 @@ -346,275 +338,288 @@ let GetDiagnosticNumber (diagnostic: PhasedDiagnostic) = fst (FSComp.SR.considerUpcast ("", "")) | _ -> 193 - GetFromException diagnostic.Exception - -let GetWarningLevel diagnostic = - match diagnostic.Exception with - // Level 5 warnings - | RecursiveUseCheckedAtRuntime _ - | LetRecEvaluatedOutOfOrder _ - | DefensiveCopyWarning _ -> 5 - - | DiagnosticWithText (n, _, _) - | DiagnosticWithSuggestions (n, _, _, _, _) -> - // 1178, tcNoComparisonNeeded1, "The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint..." - // 1178, tcNoComparisonNeeded2, "The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint...." - // 1178, tcNoEqualityNeeded1, "The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint..." - // 1178, tcNoEqualityNeeded2, "The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint...." - if (n = 1178) then 5 else 2 - // Level 2 - | _ -> 2 - -let IsWarningOrInfoEnabled (diagnostic, severity) n level specificWarnOn = - List.contains n specificWarnOn - || - // Some specific warnings/informational are never on by default, i.e. unused variable warnings - match n with - | 1182 -> false // chkUnusedValue - off by default - | 3180 -> false // abImplicitHeapAllocation - off by default - | 3186 -> false // pickleMissingDefinition - off by default - | 3366 -> false //tcIndexNotationDeprecated - currently off by default - | 3517 -> false // optFailedToInlineSuggestedValue - off by default - | 3388 -> false // tcSubsumptionImplicitConversionUsed - off by default - | 3389 -> false // tcBuiltInImplicitConversionUsed - off by default - | 3390 -> false // xmlDocBadlyFormed - off by default - | 3395 -> false // tcImplicitConversionUsedForMethodArg - off by default - | _ -> - (severity = FSharpDiagnosticSeverity.Info) - || (severity = FSharpDiagnosticSeverity.Warning - && level >= GetWarningLevel diagnostic) +type PhasedDiagnostic with + + member x.Range = x.Exception.DiagnosticRange + + member x.Number = x.Exception.DiagnosticNumber + + member x.WarningLevel = + match x.Exception with + // Level 5 warnings + | RecursiveUseCheckedAtRuntime _ + | LetRecEvaluatedOutOfOrder _ + | DefensiveCopyWarning _ -> 5 + + | DiagnosticWithText (n, _, _) + | DiagnosticWithSuggestions (n, _, _, _, _) -> + // 1178, tcNoComparisonNeeded1, "The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint..." + // 1178, tcNoComparisonNeeded2, "The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint...." + // 1178, tcNoEqualityNeeded1, "The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint..." + // 1178, tcNoEqualityNeeded2, "The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint...." + if (n = 1178) then 5 else 2 + // Level 2 + | _ -> 2 + + member x.IsEnabled(severity, options) = + let level = options.WarnLevel + let specificWarnOn = options.WarnOn + let n = x.Number + + List.contains n specificWarnOn + || + // Some specific warnings/informational are never on by default, i.e. unused variable warnings + match n with + | 1182 -> false // chkUnusedValue - off by default + | 3180 -> false // abImplicitHeapAllocation - off by default + | 3186 -> false // pickleMissingDefinition - off by default + | 3366 -> false //tcIndexNotationDeprecated - currently off by default + | 3517 -> false // optFailedToInlineSuggestedValue - off by default + | 3388 -> false // tcSubsumptionImplicitConversionUsed - off by default + | 3389 -> false // tcBuiltInImplicitConversionUsed - off by default + | 3390 -> false // xmlDocBadlyFormed - off by default + | 3395 -> false // tcImplicitConversionUsedForMethodArg - off by default + | _ -> + (severity = FSharpDiagnosticSeverity.Info) + || (severity = FSharpDiagnosticSeverity.Warning && level >= x.WarningLevel) + + /// Indicates if a diagnostic should be reported as an informational + member x.ReportAsInfo(options, severity) = + match severity with + | FSharpDiagnosticSeverity.Error -> false + | FSharpDiagnosticSeverity.Warning -> false + | FSharpDiagnosticSeverity.Info -> x.IsEnabled(severity, options) && not (List.contains x.Number options.WarnOff) + | FSharpDiagnosticSeverity.Hidden -> false + + /// Indicates if a diagnostic should be reported as a warning + member x.ReportAsWarning(options, severity) = + match severity with + | FSharpDiagnosticSeverity.Error -> false + + | FSharpDiagnosticSeverity.Warning -> x.IsEnabled(severity, options) && not (List.contains x.Number options.WarnOff) + + // Informational become warning if explicitly on and not explicitly off + | FSharpDiagnosticSeverity.Info -> + let n = x.Number + List.contains n options.WarnOn && not (List.contains n options.WarnOff) + + | FSharpDiagnosticSeverity.Hidden -> false + + /// Indicates if a diagnostic should be reported as an error + member x.ReportAsError(options, severity) = + + match severity with + | FSharpDiagnosticSeverity.Error -> true + + // Warnings become errors in some situations + | FSharpDiagnosticSeverity.Warning -> + let n = x.Number + + x.IsEnabled(severity, options) + && not (List.contains n options.WarnAsWarn) + && ((options.GlobalWarnAsError && not (List.contains n options.WarnOff)) + || List.contains n options.WarnAsError) + + // Informational become errors if explicitly WarnAsError + | FSharpDiagnosticSeverity.Info -> List.contains x.Number options.WarnAsError + + | FSharpDiagnosticSeverity.Hidden -> false -let SplitRelatedDiagnostics (diagnostic: PhasedDiagnostic) : PhasedDiagnostic * PhasedDiagnostic list = - let ToPhased exn = - { - Exception = exn - Phase = diagnostic.Phase - } - - let rec SplitRelatedException exn = - match exn with - | ErrorFromAddingTypeEquation (g, denv, ty1, ty2, exn2, m) -> - let diag2, related = SplitRelatedException exn2 - ErrorFromAddingTypeEquation(g, denv, ty1, ty2, diag2.Exception, m) |> ToPhased, related - | ErrorFromApplyingDefault (g, denv, tp, defaultType, exn2, m) -> - let diag2, related = SplitRelatedException exn2 - - ErrorFromApplyingDefault(g, denv, tp, defaultType, diag2.Exception, m) - |> ToPhased, - related - | ErrorsFromAddingSubsumptionConstraint (g, denv, ty1, ty2, exn2, contextInfo, m) -> - let diag2, related = SplitRelatedException exn2 - - ErrorsFromAddingSubsumptionConstraint(g, denv, ty1, ty2, diag2.Exception, contextInfo, m) - |> ToPhased, - related - | ErrorFromAddingConstraint (x, exn2, m) -> - let diag2, related = SplitRelatedException exn2 - ErrorFromAddingConstraint(x, diag2.Exception, m) |> ToPhased, related - | WrappedError (exn2, m) -> - let diag2, related = SplitRelatedException exn2 - WrappedError(diag2.Exception, m) |> ToPhased, related - // Strip TargetInvocationException wrappers - | :? TargetInvocationException as exn -> SplitRelatedException exn.InnerException - | _ -> ToPhased exn, [] - - SplitRelatedException diagnostic.Exception - -let Message (name, format) = DeclareResourceString(name, format) - -do FSComp.SR.RunStartupValidation() -let SeeAlsoE () = Message("SeeAlso", "%s") -let ConstraintSolverTupleDiffLengthsE () = Message("ConstraintSolverTupleDiffLengths", "%d%d") -let ConstraintSolverInfiniteTypesE () = Message("ConstraintSolverInfiniteTypes", "%s%s") -let ConstraintSolverMissingConstraintE () = Message("ConstraintSolverMissingConstraint", "%s") -let ConstraintSolverTypesNotInEqualityRelation1E () = Message("ConstraintSolverTypesNotInEqualityRelation1", "%s%s") -let ConstraintSolverTypesNotInEqualityRelation2E () = Message("ConstraintSolverTypesNotInEqualityRelation2", "%s%s") -let ConstraintSolverTypesNotInSubsumptionRelationE () = Message("ConstraintSolverTypesNotInSubsumptionRelation", "%s%s%s") -let ErrorFromAddingTypeEquation1E () = Message("ErrorFromAddingTypeEquation1", "%s%s%s") -let ErrorFromAddingTypeEquation2E () = Message("ErrorFromAddingTypeEquation2", "%s%s%s") -let ErrorFromApplyingDefault1E () = Message("ErrorFromApplyingDefault1", "%s") -let ErrorFromApplyingDefault2E () = Message("ErrorFromApplyingDefault2", "") -let ErrorsFromAddingSubsumptionConstraintE () = Message("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") -let UpperCaseIdentifierInPatternE () = Message("UpperCaseIdentifierInPattern", "") -let NotUpperCaseConstructorE () = Message("NotUpperCaseConstructor", "") -let NotUpperCaseConstructorWithoutRQAE () = Message("NotUpperCaseConstructorWithoutRQA", "") -let FunctionExpectedE () = Message("FunctionExpected", "") -let BakedInMemberConstraintNameE () = Message("BakedInMemberConstraintName", "%s") -let BadEventTransformationE () = Message("BadEventTransformation", "") -let ParameterlessStructCtorE () = Message("ParameterlessStructCtor", "") -let InterfaceNotRevealedE () = Message("InterfaceNotRevealed", "%s") -let TyconBadArgsE () = Message("TyconBadArgs", "%s%d%d") -let IndeterminateTypeE () = Message("IndeterminateType", "") -let NameClash1E () = Message("NameClash1", "%s%s") -let NameClash2E () = Message("NameClash2", "%s%s%s%s%s") -let Duplicate1E () = Message("Duplicate1", "%s") -let Duplicate2E () = Message("Duplicate2", "%s%s") -let UndefinedName2E () = Message("UndefinedName2", "") -let FieldNotMutableE () = Message("FieldNotMutable", "") -let FieldsFromDifferentTypesE () = Message("FieldsFromDifferentTypes", "%s%s") -let VarBoundTwiceE () = Message("VarBoundTwice", "%s") -let RecursionE () = Message("Recursion", "%s%s%s%s") -let InvalidRuntimeCoercionE () = Message("InvalidRuntimeCoercion", "%s%s%s") -let IndeterminateRuntimeCoercionE () = Message("IndeterminateRuntimeCoercion", "%s%s") -let IndeterminateStaticCoercionE () = Message("IndeterminateStaticCoercion", "%s%s") -let StaticCoercionShouldUseBoxE () = Message("StaticCoercionShouldUseBox", "%s%s") -let TypeIsImplicitlyAbstractE () = Message("TypeIsImplicitlyAbstract", "") -let NonRigidTypar1E () = Message("NonRigidTypar1", "%s%s") -let NonRigidTypar2E () = Message("NonRigidTypar2", "%s%s") -let NonRigidTypar3E () = Message("NonRigidTypar3", "%s%s") -let OBlockEndSentenceE () = Message("BlockEndSentence", "") -let UnexpectedEndOfInputE () = Message("UnexpectedEndOfInput", "") -let UnexpectedE () = Message("Unexpected", "%s") -let NONTERM_interactionE () = Message("NONTERM.interaction", "") -let NONTERM_hashDirectiveE () = Message("NONTERM.hashDirective", "") -let NONTERM_fieldDeclE () = Message("NONTERM.fieldDecl", "") -let NONTERM_unionCaseReprE () = Message("NONTERM.unionCaseRepr", "") -let NONTERM_localBindingE () = Message("NONTERM.localBinding", "") -let NONTERM_hardwhiteLetBindingsE () = Message("NONTERM.hardwhiteLetBindings", "") -let NONTERM_classDefnMemberE () = Message("NONTERM.classDefnMember", "") -let NONTERM_defnBindingsE () = Message("NONTERM.defnBindings", "") -let NONTERM_classMemberSpfnE () = Message("NONTERM.classMemberSpfn", "") -let NONTERM_valSpfnE () = Message("NONTERM.valSpfn", "") -let NONTERM_tyconSpfnE () = Message("NONTERM.tyconSpfn", "") -let NONTERM_anonLambdaExprE () = Message("NONTERM.anonLambdaExpr", "") -let NONTERM_attrUnionCaseDeclE () = Message("NONTERM.attrUnionCaseDecl", "") -let NONTERM_cPrototypeE () = Message("NONTERM.cPrototype", "") -let NONTERM_objectImplementationMembersE () = Message("NONTERM.objectImplementationMembers", "") -let NONTERM_ifExprCasesE () = Message("NONTERM.ifExprCases", "") -let NONTERM_openDeclE () = Message("NONTERM.openDecl", "") -let NONTERM_fileModuleSpecE () = Message("NONTERM.fileModuleSpec", "") -let NONTERM_patternClausesE () = Message("NONTERM.patternClauses", "") -let NONTERM_beginEndExprE () = Message("NONTERM.beginEndExpr", "") -let NONTERM_recdExprE () = Message("NONTERM.recdExpr", "") -let NONTERM_tyconDefnE () = Message("NONTERM.tyconDefn", "") -let NONTERM_exconCoreE () = Message("NONTERM.exconCore", "") -let NONTERM_typeNameInfoE () = Message("NONTERM.typeNameInfo", "") -let NONTERM_attributeListE () = Message("NONTERM.attributeList", "") -let NONTERM_quoteExprE () = Message("NONTERM.quoteExpr", "") -let NONTERM_typeConstraintE () = Message("NONTERM.typeConstraint", "") -let NONTERM_Category_ImplementationFileE () = Message("NONTERM.Category.ImplementationFile", "") -let NONTERM_Category_DefinitionE () = Message("NONTERM.Category.Definition", "") -let NONTERM_Category_SignatureFileE () = Message("NONTERM.Category.SignatureFile", "") -let NONTERM_Category_PatternE () = Message("NONTERM.Category.Pattern", "") -let NONTERM_Category_ExprE () = Message("NONTERM.Category.Expr", "") -let NONTERM_Category_TypeE () = Message("NONTERM.Category.Type", "") -let NONTERM_typeArgsActualE () = Message("NONTERM.typeArgsActual", "") -let TokenName1E () = Message("TokenName1", "%s") -let TokenName1TokenName2E () = Message("TokenName1TokenName2", "%s%s") -let TokenName1TokenName2TokenName3E () = Message("TokenName1TokenName2TokenName3", "%s%s%s") -let RuntimeCoercionSourceSealed1E () = Message("RuntimeCoercionSourceSealed1", "%s") -let RuntimeCoercionSourceSealed2E () = Message("RuntimeCoercionSourceSealed2", "%s") -let CoercionTargetSealedE () = Message("CoercionTargetSealed", "%s") -let UpcastUnnecessaryE () = Message("UpcastUnnecessary", "") -let TypeTestUnnecessaryE () = Message("TypeTestUnnecessary", "") -let OverrideDoesntOverride1E () = Message("OverrideDoesntOverride1", "%s") -let OverrideDoesntOverride2E () = Message("OverrideDoesntOverride2", "%s") -let OverrideDoesntOverride3E () = Message("OverrideDoesntOverride3", "%s") -let OverrideDoesntOverride4E () = Message("OverrideDoesntOverride4", "%s") -let UnionCaseWrongArgumentsE () = Message("UnionCaseWrongArguments", "%d%d") -let UnionPatternsBindDifferentNamesE () = Message("UnionPatternsBindDifferentNames", "") -let RequiredButNotSpecifiedE () = Message("RequiredButNotSpecified", "%s%s%s") -let UseOfAddressOfOperatorE () = Message("UseOfAddressOfOperator", "") -let DefensiveCopyWarningE () = Message("DefensiveCopyWarning", "%s") -let DeprecatedThreadStaticBindingWarningE () = Message("DeprecatedThreadStaticBindingWarning", "") -let FunctionValueUnexpectedE () = Message("FunctionValueUnexpected", "%s") -let UnitTypeExpectedE () = Message("UnitTypeExpected", "%s") -let UnitTypeExpectedWithEqualityE () = Message("UnitTypeExpectedWithEquality", "%s") -let UnitTypeExpectedWithPossiblePropertySetterE () = Message("UnitTypeExpectedWithPossiblePropertySetter", "%s%s%s") -let UnitTypeExpectedWithPossibleAssignmentE () = Message("UnitTypeExpectedWithPossibleAssignment", "%s%s") -let UnitTypeExpectedWithPossibleAssignmentToMutableE () = Message("UnitTypeExpectedWithPossibleAssignmentToMutable", "%s%s") -let RecursiveUseCheckedAtRuntimeE () = Message("RecursiveUseCheckedAtRuntime", "") -let LetRecUnsound1E () = Message("LetRecUnsound1", "%s") -let LetRecUnsound2E () = Message("LetRecUnsound2", "%s%s") -let LetRecUnsoundInnerE () = Message("LetRecUnsoundInner", "%s") -let LetRecEvaluatedOutOfOrderE () = Message("LetRecEvaluatedOutOfOrder", "") -let LetRecCheckedAtRuntimeE () = Message("LetRecCheckedAtRuntime", "") -let SelfRefObjCtor1E () = Message("SelfRefObjCtor1", "") -let SelfRefObjCtor2E () = Message("SelfRefObjCtor2", "") -let VirtualAugmentationOnNullValuedTypeE () = Message("VirtualAugmentationOnNullValuedType", "") -let NonVirtualAugmentationOnNullValuedTypeE () = Message("NonVirtualAugmentationOnNullValuedType", "") -let NonUniqueInferredAbstractSlot1E () = Message("NonUniqueInferredAbstractSlot1", "%s") -let NonUniqueInferredAbstractSlot2E () = Message("NonUniqueInferredAbstractSlot2", "") -let NonUniqueInferredAbstractSlot3E () = Message("NonUniqueInferredAbstractSlot3", "%s%s") -let NonUniqueInferredAbstractSlot4E () = Message("NonUniqueInferredAbstractSlot4", "") -let Failure3E () = Message("Failure3", "%s") -let Failure4E () = Message("Failure4", "%s") -let MatchIncomplete1E () = Message("MatchIncomplete1", "") -let MatchIncomplete2E () = Message("MatchIncomplete2", "%s") -let MatchIncomplete3E () = Message("MatchIncomplete3", "%s") -let MatchIncomplete4E () = Message("MatchIncomplete4", "") -let RuleNeverMatchedE () = Message("RuleNeverMatched", "") -let EnumMatchIncomplete1E () = Message("EnumMatchIncomplete1", "") -let ValNotMutableE () = Message("ValNotMutable", "%s") -let ValNotLocalE () = Message("ValNotLocal", "") -let Obsolete1E () = Message("Obsolete1", "") -let Obsolete2E () = Message("Obsolete2", "%s") -let ExperimentalE () = Message("Experimental", "%s") -let PossibleUnverifiableCodeE () = Message("PossibleUnverifiableCode", "") -let DeprecatedE () = Message("Deprecated", "%s") -let LibraryUseOnlyE () = Message("LibraryUseOnly", "") -let MissingFieldsE () = Message("MissingFields", "%s") -let ValueRestriction1E () = Message("ValueRestriction1", "%s%s%s") -let ValueRestriction2E () = Message("ValueRestriction2", "%s%s%s") -let ValueRestriction3E () = Message("ValueRestriction3", "%s") -let ValueRestriction4E () = Message("ValueRestriction4", "%s%s%s") -let ValueRestriction5E () = Message("ValueRestriction5", "%s%s%s") -let RecoverableParseErrorE () = Message("RecoverableParseError", "") -let ReservedKeywordE () = Message("ReservedKeyword", "%s") -let IndentationProblemE () = Message("IndentationProblem", "%s") -let OverrideInIntrinsicAugmentationE () = Message("OverrideInIntrinsicAugmentation", "") -let OverrideInExtrinsicAugmentationE () = Message("OverrideInExtrinsicAugmentation", "") -let IntfImplInIntrinsicAugmentationE () = Message("IntfImplInIntrinsicAugmentation", "") -let IntfImplInExtrinsicAugmentationE () = Message("IntfImplInExtrinsicAugmentation", "") -let UnresolvedReferenceNoRangeE () = Message("UnresolvedReferenceNoRange", "%s") -let UnresolvedPathReferenceNoRangeE () = Message("UnresolvedPathReferenceNoRange", "%s%s") -let HashIncludeNotAllowedInNonScriptE () = Message("HashIncludeNotAllowedInNonScript", "") -let HashReferenceNotAllowedInNonScriptE () = Message("HashReferenceNotAllowedInNonScript", "") -let HashDirectiveNotAllowedInNonScriptE () = Message("HashDirectiveNotAllowedInNonScript", "") -let FileNameNotResolvedE () = Message("FileNameNotResolved", "%s%s") -let AssemblyNotResolvedE () = Message("AssemblyNotResolved", "%s") -let HashLoadedSourceHasIssues0E () = Message("HashLoadedSourceHasIssues0", "") -let HashLoadedSourceHasIssues1E () = Message("HashLoadedSourceHasIssues1", "") -let HashLoadedSourceHasIssues2E () = Message("HashLoadedSourceHasIssues2", "") -let HashLoadedScriptConsideredSourceE () = Message("HashLoadedScriptConsideredSource", "") -let InvalidInternalsVisibleToAssemblyName1E () = Message("InvalidInternalsVisibleToAssemblyName1", "%s%s") -let InvalidInternalsVisibleToAssemblyName2E () = Message("InvalidInternalsVisibleToAssemblyName2", "%s") -let LoadedSourceNotFoundIgnoringE () = Message("LoadedSourceNotFoundIgnoring", "%s") -let MSBuildReferenceResolutionErrorE () = Message("MSBuildReferenceResolutionError", "%s%s") -let TargetInvocationExceptionWrapperE () = Message("TargetInvocationExceptionWrapper", "%s") +[] +module OldStyleMessages = + let Message (name, format) = DeclareResourceString(name, format) + + do FSComp.SR.RunStartupValidation() + let SeeAlsoE () = Message("SeeAlso", "%s") + let ConstraintSolverTupleDiffLengthsE () = Message("ConstraintSolverTupleDiffLengths", "%d%d") + let ConstraintSolverInfiniteTypesE () = Message("ConstraintSolverInfiniteTypes", "%s%s") + let ConstraintSolverMissingConstraintE () = Message("ConstraintSolverMissingConstraint", "%s") + let ConstraintSolverTypesNotInEqualityRelation1E () = Message("ConstraintSolverTypesNotInEqualityRelation1", "%s%s") + let ConstraintSolverTypesNotInEqualityRelation2E () = Message("ConstraintSolverTypesNotInEqualityRelation2", "%s%s") + let ConstraintSolverTypesNotInSubsumptionRelationE () = Message("ConstraintSolverTypesNotInSubsumptionRelation", "%s%s%s") + let ErrorFromAddingTypeEquation1E () = Message("ErrorFromAddingTypeEquation1", "%s%s%s") + let ErrorFromAddingTypeEquation2E () = Message("ErrorFromAddingTypeEquation2", "%s%s%s") + let ErrorFromApplyingDefault1E () = Message("ErrorFromApplyingDefault1", "%s") + let ErrorFromApplyingDefault2E () = Message("ErrorFromApplyingDefault2", "") + let ErrorsFromAddingSubsumptionConstraintE () = Message("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") + let UpperCaseIdentifierInPatternE () = Message("UpperCaseIdentifierInPattern", "") + let NotUpperCaseConstructorE () = Message("NotUpperCaseConstructor", "") + let NotUpperCaseConstructorWithoutRQAE () = Message("NotUpperCaseConstructorWithoutRQA", "") + let FunctionExpectedE () = Message("FunctionExpected", "") + let BakedInMemberConstraintNameE () = Message("BakedInMemberConstraintName", "%s") + let BadEventTransformationE () = Message("BadEventTransformation", "") + let ParameterlessStructCtorE () = Message("ParameterlessStructCtor", "") + let InterfaceNotRevealedE () = Message("InterfaceNotRevealed", "%s") + let TyconBadArgsE () = Message("TyconBadArgs", "%s%d%d") + let IndeterminateTypeE () = Message("IndeterminateType", "") + let NameClash1E () = Message("NameClash1", "%s%s") + let NameClash2E () = Message("NameClash2", "%s%s%s%s%s") + let Duplicate1E () = Message("Duplicate1", "%s") + let Duplicate2E () = Message("Duplicate2", "%s%s") + let UndefinedName2E () = Message("UndefinedName2", "") + let FieldNotMutableE () = Message("FieldNotMutable", "") + let FieldsFromDifferentTypesE () = Message("FieldsFromDifferentTypes", "%s%s") + let VarBoundTwiceE () = Message("VarBoundTwice", "%s") + let RecursionE () = Message("Recursion", "%s%s%s%s") + let InvalidRuntimeCoercionE () = Message("InvalidRuntimeCoercion", "%s%s%s") + let IndeterminateRuntimeCoercionE () = Message("IndeterminateRuntimeCoercion", "%s%s") + let IndeterminateStaticCoercionE () = Message("IndeterminateStaticCoercion", "%s%s") + let StaticCoercionShouldUseBoxE () = Message("StaticCoercionShouldUseBox", "%s%s") + let TypeIsImplicitlyAbstractE () = Message("TypeIsImplicitlyAbstract", "") + let NonRigidTypar1E () = Message("NonRigidTypar1", "%s%s") + let NonRigidTypar2E () = Message("NonRigidTypar2", "%s%s") + let NonRigidTypar3E () = Message("NonRigidTypar3", "%s%s") + let OBlockEndSentenceE () = Message("BlockEndSentence", "") + let UnexpectedEndOfInputE () = Message("UnexpectedEndOfInput", "") + let UnexpectedE () = Message("Unexpected", "%s") + let NONTERM_interactionE () = Message("NONTERM.interaction", "") + let NONTERM_hashDirectiveE () = Message("NONTERM.hashDirective", "") + let NONTERM_fieldDeclE () = Message("NONTERM.fieldDecl", "") + let NONTERM_unionCaseReprE () = Message("NONTERM.unionCaseRepr", "") + let NONTERM_localBindingE () = Message("NONTERM.localBinding", "") + let NONTERM_hardwhiteLetBindingsE () = Message("NONTERM.hardwhiteLetBindings", "") + let NONTERM_classDefnMemberE () = Message("NONTERM.classDefnMember", "") + let NONTERM_defnBindingsE () = Message("NONTERM.defnBindings", "") + let NONTERM_classMemberSpfnE () = Message("NONTERM.classMemberSpfn", "") + let NONTERM_valSpfnE () = Message("NONTERM.valSpfn", "") + let NONTERM_tyconSpfnE () = Message("NONTERM.tyconSpfn", "") + let NONTERM_anonLambdaExprE () = Message("NONTERM.anonLambdaExpr", "") + let NONTERM_attrUnionCaseDeclE () = Message("NONTERM.attrUnionCaseDecl", "") + let NONTERM_cPrototypeE () = Message("NONTERM.cPrototype", "") + let NONTERM_objectImplementationMembersE () = Message("NONTERM.objectImplementationMembers", "") + let NONTERM_ifExprCasesE () = Message("NONTERM.ifExprCases", "") + let NONTERM_openDeclE () = Message("NONTERM.openDecl", "") + let NONTERM_fileModuleSpecE () = Message("NONTERM.fileModuleSpec", "") + let NONTERM_patternClausesE () = Message("NONTERM.patternClauses", "") + let NONTERM_beginEndExprE () = Message("NONTERM.beginEndExpr", "") + let NONTERM_recdExprE () = Message("NONTERM.recdExpr", "") + let NONTERM_tyconDefnE () = Message("NONTERM.tyconDefn", "") + let NONTERM_exconCoreE () = Message("NONTERM.exconCore", "") + let NONTERM_typeNameInfoE () = Message("NONTERM.typeNameInfo", "") + let NONTERM_attributeListE () = Message("NONTERM.attributeList", "") + let NONTERM_quoteExprE () = Message("NONTERM.quoteExpr", "") + let NONTERM_typeConstraintE () = Message("NONTERM.typeConstraint", "") + let NONTERM_Category_ImplementationFileE () = Message("NONTERM.Category.ImplementationFile", "") + let NONTERM_Category_DefinitionE () = Message("NONTERM.Category.Definition", "") + let NONTERM_Category_SignatureFileE () = Message("NONTERM.Category.SignatureFile", "") + let NONTERM_Category_PatternE () = Message("NONTERM.Category.Pattern", "") + let NONTERM_Category_ExprE () = Message("NONTERM.Category.Expr", "") + let NONTERM_Category_TypeE () = Message("NONTERM.Category.Type", "") + let NONTERM_typeArgsActualE () = Message("NONTERM.typeArgsActual", "") + let TokenName1E () = Message("TokenName1", "%s") + let TokenName1TokenName2E () = Message("TokenName1TokenName2", "%s%s") + let TokenName1TokenName2TokenName3E () = Message("TokenName1TokenName2TokenName3", "%s%s%s") + let RuntimeCoercionSourceSealed1E () = Message("RuntimeCoercionSourceSealed1", "%s") + let RuntimeCoercionSourceSealed2E () = Message("RuntimeCoercionSourceSealed2", "%s") + let CoercionTargetSealedE () = Message("CoercionTargetSealed", "%s") + let UpcastUnnecessaryE () = Message("UpcastUnnecessary", "") + let TypeTestUnnecessaryE () = Message("TypeTestUnnecessary", "") + let OverrideDoesntOverride1E () = Message("OverrideDoesntOverride1", "%s") + let OverrideDoesntOverride2E () = Message("OverrideDoesntOverride2", "%s") + let OverrideDoesntOverride3E () = Message("OverrideDoesntOverride3", "%s") + let OverrideDoesntOverride4E () = Message("OverrideDoesntOverride4", "%s") + let UnionCaseWrongArgumentsE () = Message("UnionCaseWrongArguments", "%d%d") + let UnionPatternsBindDifferentNamesE () = Message("UnionPatternsBindDifferentNames", "") + let RequiredButNotSpecifiedE () = Message("RequiredButNotSpecified", "%s%s%s") + let UseOfAddressOfOperatorE () = Message("UseOfAddressOfOperator", "") + let DefensiveCopyWarningE () = Message("DefensiveCopyWarning", "%s") + let DeprecatedThreadStaticBindingWarningE () = Message("DeprecatedThreadStaticBindingWarning", "") + let FunctionValueUnexpectedE () = Message("FunctionValueUnexpected", "%s") + let UnitTypeExpectedE () = Message("UnitTypeExpected", "%s") + let UnitTypeExpectedWithEqualityE () = Message("UnitTypeExpectedWithEquality", "%s") + let UnitTypeExpectedWithPossiblePropertySetterE () = Message("UnitTypeExpectedWithPossiblePropertySetter", "%s%s%s") + let UnitTypeExpectedWithPossibleAssignmentE () = Message("UnitTypeExpectedWithPossibleAssignment", "%s%s") + let UnitTypeExpectedWithPossibleAssignmentToMutableE () = Message("UnitTypeExpectedWithPossibleAssignmentToMutable", "%s%s") + let RecursiveUseCheckedAtRuntimeE () = Message("RecursiveUseCheckedAtRuntime", "") + let LetRecUnsound1E () = Message("LetRecUnsound1", "%s") + let LetRecUnsound2E () = Message("LetRecUnsound2", "%s%s") + let LetRecUnsoundInnerE () = Message("LetRecUnsoundInner", "%s") + let LetRecEvaluatedOutOfOrderE () = Message("LetRecEvaluatedOutOfOrder", "") + let LetRecCheckedAtRuntimeE () = Message("LetRecCheckedAtRuntime", "") + let SelfRefObjCtor1E () = Message("SelfRefObjCtor1", "") + let SelfRefObjCtor2E () = Message("SelfRefObjCtor2", "") + let VirtualAugmentationOnNullValuedTypeE () = Message("VirtualAugmentationOnNullValuedType", "") + let NonVirtualAugmentationOnNullValuedTypeE () = Message("NonVirtualAugmentationOnNullValuedType", "") + let NonUniqueInferredAbstractSlot1E () = Message("NonUniqueInferredAbstractSlot1", "%s") + let NonUniqueInferredAbstractSlot2E () = Message("NonUniqueInferredAbstractSlot2", "") + let NonUniqueInferredAbstractSlot3E () = Message("NonUniqueInferredAbstractSlot3", "%s%s") + let NonUniqueInferredAbstractSlot4E () = Message("NonUniqueInferredAbstractSlot4", "") + let Failure3E () = Message("Failure3", "%s") + let Failure4E () = Message("Failure4", "%s") + let MatchIncomplete1E () = Message("MatchIncomplete1", "") + let MatchIncomplete2E () = Message("MatchIncomplete2", "%s") + let MatchIncomplete3E () = Message("MatchIncomplete3", "%s") + let MatchIncomplete4E () = Message("MatchIncomplete4", "") + let RuleNeverMatchedE () = Message("RuleNeverMatched", "") + let EnumMatchIncomplete1E () = Message("EnumMatchIncomplete1", "") + let ValNotMutableE () = Message("ValNotMutable", "%s") + let ValNotLocalE () = Message("ValNotLocal", "") + let Obsolete1E () = Message("Obsolete1", "") + let Obsolete2E () = Message("Obsolete2", "%s") + let ExperimentalE () = Message("Experimental", "%s") + let PossibleUnverifiableCodeE () = Message("PossibleUnverifiableCode", "") + let DeprecatedE () = Message("Deprecated", "%s") + let LibraryUseOnlyE () = Message("LibraryUseOnly", "") + let MissingFieldsE () = Message("MissingFields", "%s") + let ValueRestriction1E () = Message("ValueRestriction1", "%s%s%s") + let ValueRestriction2E () = Message("ValueRestriction2", "%s%s%s") + let ValueRestriction3E () = Message("ValueRestriction3", "%s") + let ValueRestriction4E () = Message("ValueRestriction4", "%s%s%s") + let ValueRestriction5E () = Message("ValueRestriction5", "%s%s%s") + let RecoverableParseErrorE () = Message("RecoverableParseError", "") + let ReservedKeywordE () = Message("ReservedKeyword", "%s") + let IndentationProblemE () = Message("IndentationProblem", "%s") + let OverrideInIntrinsicAugmentationE () = Message("OverrideInIntrinsicAugmentation", "") + let OverrideInExtrinsicAugmentationE () = Message("OverrideInExtrinsicAugmentation", "") + let IntfImplInIntrinsicAugmentationE () = Message("IntfImplInIntrinsicAugmentation", "") + let IntfImplInExtrinsicAugmentationE () = Message("IntfImplInExtrinsicAugmentation", "") + let UnresolvedReferenceNoRangeE () = Message("UnresolvedReferenceNoRange", "%s") + let UnresolvedPathReferenceNoRangeE () = Message("UnresolvedPathReferenceNoRange", "%s%s") + let HashIncludeNotAllowedInNonScriptE () = Message("HashIncludeNotAllowedInNonScript", "") + let HashReferenceNotAllowedInNonScriptE () = Message("HashReferenceNotAllowedInNonScript", "") + let HashDirectiveNotAllowedInNonScriptE () = Message("HashDirectiveNotAllowedInNonScript", "") + let FileNameNotResolvedE () = Message("FileNameNotResolved", "%s%s") + let AssemblyNotResolvedE () = Message("AssemblyNotResolved", "%s") + let HashLoadedSourceHasIssues0E () = Message("HashLoadedSourceHasIssues0", "") + let HashLoadedSourceHasIssues1E () = Message("HashLoadedSourceHasIssues1", "") + let HashLoadedSourceHasIssues2E () = Message("HashLoadedSourceHasIssues2", "") + let HashLoadedScriptConsideredSourceE () = Message("HashLoadedScriptConsideredSource", "") + let InvalidInternalsVisibleToAssemblyName1E () = Message("InvalidInternalsVisibleToAssemblyName1", "%s%s") + let InvalidInternalsVisibleToAssemblyName2E () = Message("InvalidInternalsVisibleToAssemblyName2", "%s") + let LoadedSourceNotFoundIgnoringE () = Message("LoadedSourceNotFoundIgnoring", "%s") + let MSBuildReferenceResolutionErrorE () = Message("MSBuildReferenceResolutionError", "%s%s") + let TargetInvocationExceptionWrapperE () = Message("TargetInvocationExceptionWrapper", "%s") #if DEBUG let mutable showParserStackOnParseError = false #endif -let getErrorString key = SR.GetString key - let (|InvalidArgument|_|) (exn: exn) = match exn with | :? ArgumentException as e -> Some e.Message | _ -> None -let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSuggestNames: bool) = +let OutputNameSuggestions (os: StringBuilder) suggestNames suggestionsF idText = + if suggestNames then + let buffer = DiagnosticResolutionHints.SuggestionBuffer idText - let suggestNames suggestionsF idText = - if canSuggestNames then - let buffer = DiagnosticResolutionHints.SuggestionBuffer idText + if not buffer.Disabled then + suggestionsF buffer.Add - if not buffer.Disabled then - suggestionsF buffer.Add + if not buffer.IsEmpty then + os.AppendString " " + os.AppendString(FSComp.SR.undefinedNameSuggestionsIntro ()) - if not buffer.IsEmpty then - os.AppendString " " - os.AppendString(FSComp.SR.undefinedNameSuggestionsIntro ()) + for value in buffer do + os.AppendLine() |> ignore + os.AppendString " " + os.AppendString(ConvertValLogicalNameToDisplayNameCore value) - for value in buffer do - os.AppendLine() |> ignore - os.AppendString " " - os.AppendString(ConvertValLogicalNameToDisplayNameCore value) +type Exception with - let rec OutputExceptionR (os: StringBuilder) error = + member exn.Output(os: StringBuilder, suggestNames) = - match error with + match exn with | ConstraintSolverTupleDiffLengths (_, tl1, tl2, m, m2) -> os.AppendString(ConstraintSolverTupleDiffLengthsE().Format tl1.Length tl2.Length) @@ -725,15 +730,11 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | ContextInfo.NoContext -> false | _ -> true) -> - OutputExceptionR os e + e.Output(os, suggestNames) - | ErrorFromAddingTypeEquation (_, - _, - _, - _, - (ConstraintSolverTypesNotInSubsumptionRelation _ - | ConstraintSolverError _ as e), - _) -> OutputExceptionR os e + | ErrorFromAddingTypeEquation(error = ConstraintSolverTypesNotInSubsumptionRelation _ as e) -> e.Output(os, suggestNames) + + | ErrorFromAddingTypeEquation(error = ConstraintSolverError _ as e) -> e.Output(os, suggestNames) | ErrorFromAddingTypeEquation (g, denv, ty1, ty2, e, _) -> if not (typeEquiv g ty1 ty2) then @@ -742,12 +743,12 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu if ty1 <> ty2 + tpcs then os.AppendString(ErrorFromAddingTypeEquation2E().Format ty1 ty2 tpcs) - OutputExceptionR os e + e.Output(os, suggestNames) | ErrorFromApplyingDefault (_, denv, _, defaultType, e, _) -> let defaultType = NicePrint.minimalStringOfType denv defaultType os.AppendString(ErrorFromApplyingDefault1E().Format defaultType) - OutputExceptionR os e + e.Output(os, suggestNames) os.AppendString(ErrorFromApplyingDefault2E().Format) | ErrorsFromAddingSubsumptionConstraint (g, denv, ty1, ty2, e, contextInfo, _) -> @@ -766,9 +767,9 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu if ty1 <> (ty2 + tpcs) then os.AppendString(ErrorsFromAddingSubsumptionConstraintE().Format ty2 ty1 tpcs) else - OutputExceptionR os e + e.Output(os, suggestNames) else - OutputExceptionR os e + e.Output(os, suggestNames) | UpperCaseIdentifierInPattern _ -> os.AppendString(UpperCaseIdentifierInPatternE().Format) @@ -776,12 +777,12 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | NotUpperCaseConstructorWithoutRQA _ -> os.AppendString(NotUpperCaseConstructorWithoutRQAE().Format) - | ErrorFromAddingConstraint (_, e, _) -> OutputExceptionR os e + | ErrorFromAddingConstraint (_, e, _) -> e.Output(os, suggestNames) #if !NO_TYPEPROVIDERS | TypeProviders.ProvidedTypeResolutionNoRange e - | TypeProviders.ProvidedTypeResolution (_, e) -> OutputExceptionR os e + | TypeProviders.ProvidedTypeResolution (_, e) -> e.Output(os, suggestNames) | :? TypeProviderError as e -> os.AppendString(e.ContextualErrorMessage) #endif @@ -944,7 +945,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | UndefinedName (_, k, id, suggestionsF) -> os.AppendString(k (ConvertValLogicalNameToDisplayNameCore id.idText)) - suggestNames suggestionsF id.idText + OutputNameSuggestions os suggestNames suggestionsF id.idText | InternalUndefinedItemRef (f, smr, ccuName, s) -> let _, errs = f (smr, ccuName, s) @@ -1008,7 +1009,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu let tokenIdToText tid = match tid with - | Parser.TOKEN_IDENT -> getErrorString ("Parser.TOKEN.IDENT") + | Parser.TOKEN_IDENT -> SR.GetString("Parser.TOKEN.IDENT") | Parser.TOKEN_BIGNUM | Parser.TOKEN_INT8 | Parser.TOKEN_UINT8 @@ -1019,191 +1020,191 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | Parser.TOKEN_INT64 | Parser.TOKEN_UINT64 | Parser.TOKEN_UNATIVEINT - | Parser.TOKEN_NATIVEINT -> getErrorString ("Parser.TOKEN.INT") + | Parser.TOKEN_NATIVEINT -> SR.GetString("Parser.TOKEN.INT") | Parser.TOKEN_IEEE32 - | Parser.TOKEN_IEEE64 -> getErrorString ("Parser.TOKEN.FLOAT") - | Parser.TOKEN_DECIMAL -> getErrorString ("Parser.TOKEN.DECIMAL") - | Parser.TOKEN_CHAR -> getErrorString ("Parser.TOKEN.CHAR") - - | Parser.TOKEN_BASE -> getErrorString ("Parser.TOKEN.BASE") - | Parser.TOKEN_LPAREN_STAR_RPAREN -> getErrorString ("Parser.TOKEN.LPAREN.STAR.RPAREN") - | Parser.TOKEN_DOLLAR -> getErrorString ("Parser.TOKEN.DOLLAR") - | Parser.TOKEN_INFIX_STAR_STAR_OP -> getErrorString ("Parser.TOKEN.INFIX.STAR.STAR.OP") - | Parser.TOKEN_INFIX_COMPARE_OP -> getErrorString ("Parser.TOKEN.INFIX.COMPARE.OP") - | Parser.TOKEN_COLON_GREATER -> getErrorString ("Parser.TOKEN.COLON.GREATER") - | Parser.TOKEN_COLON_COLON -> getErrorString ("Parser.TOKEN.COLON.COLON") - | Parser.TOKEN_PERCENT_OP -> getErrorString ("Parser.TOKEN.PERCENT.OP") - | Parser.TOKEN_INFIX_AT_HAT_OP -> getErrorString ("Parser.TOKEN.INFIX.AT.HAT.OP") - | Parser.TOKEN_INFIX_BAR_OP -> getErrorString ("Parser.TOKEN.INFIX.BAR.OP") - | Parser.TOKEN_PLUS_MINUS_OP -> getErrorString ("Parser.TOKEN.PLUS.MINUS.OP") - | Parser.TOKEN_PREFIX_OP -> getErrorString ("Parser.TOKEN.PREFIX.OP") - | Parser.TOKEN_COLON_QMARK_GREATER -> getErrorString ("Parser.TOKEN.COLON.QMARK.GREATER") - | Parser.TOKEN_INFIX_STAR_DIV_MOD_OP -> getErrorString ("Parser.TOKEN.INFIX.STAR.DIV.MOD.OP") - | Parser.TOKEN_INFIX_AMP_OP -> getErrorString ("Parser.TOKEN.INFIX.AMP.OP") - | Parser.TOKEN_AMP -> getErrorString ("Parser.TOKEN.AMP") - | Parser.TOKEN_AMP_AMP -> getErrorString ("Parser.TOKEN.AMP.AMP") - | Parser.TOKEN_BAR_BAR -> getErrorString ("Parser.TOKEN.BAR.BAR") - | Parser.TOKEN_LESS -> getErrorString ("Parser.TOKEN.LESS") - | Parser.TOKEN_GREATER -> getErrorString ("Parser.TOKEN.GREATER") - | Parser.TOKEN_QMARK -> getErrorString ("Parser.TOKEN.QMARK") - | Parser.TOKEN_QMARK_QMARK -> getErrorString ("Parser.TOKEN.QMARK.QMARK") - | Parser.TOKEN_COLON_QMARK -> getErrorString ("Parser.TOKEN.COLON.QMARK") - | Parser.TOKEN_INT32_DOT_DOT -> getErrorString ("Parser.TOKEN.INT32.DOT.DOT") - | Parser.TOKEN_DOT_DOT -> getErrorString ("Parser.TOKEN.DOT.DOT") - | Parser.TOKEN_DOT_DOT_HAT -> getErrorString ("Parser.TOKEN.DOT.DOT") - | Parser.TOKEN_QUOTE -> getErrorString ("Parser.TOKEN.QUOTE") - | Parser.TOKEN_STAR -> getErrorString ("Parser.TOKEN.STAR") - | Parser.TOKEN_HIGH_PRECEDENCE_TYAPP -> getErrorString ("Parser.TOKEN.HIGH.PRECEDENCE.TYAPP") - | Parser.TOKEN_COLON -> getErrorString ("Parser.TOKEN.COLON") - | Parser.TOKEN_COLON_EQUALS -> getErrorString ("Parser.TOKEN.COLON.EQUALS") - | Parser.TOKEN_LARROW -> getErrorString ("Parser.TOKEN.LARROW") - | Parser.TOKEN_EQUALS -> getErrorString ("Parser.TOKEN.EQUALS") - | Parser.TOKEN_GREATER_BAR_RBRACK -> getErrorString ("Parser.TOKEN.GREATER.BAR.RBRACK") - | Parser.TOKEN_MINUS -> getErrorString ("Parser.TOKEN.MINUS") - | Parser.TOKEN_ADJACENT_PREFIX_OP -> getErrorString ("Parser.TOKEN.ADJACENT.PREFIX.OP") - | Parser.TOKEN_FUNKY_OPERATOR_NAME -> getErrorString ("Parser.TOKEN.FUNKY.OPERATOR.NAME") - | Parser.TOKEN_COMMA -> getErrorString ("Parser.TOKEN.COMMA") - | Parser.TOKEN_DOT -> getErrorString ("Parser.TOKEN.DOT") - | Parser.TOKEN_BAR -> getErrorString ("Parser.TOKEN.BAR") - | Parser.TOKEN_HASH -> getErrorString ("Parser.TOKEN.HASH") - | Parser.TOKEN_UNDERSCORE -> getErrorString ("Parser.TOKEN.UNDERSCORE") - | Parser.TOKEN_SEMICOLON -> getErrorString ("Parser.TOKEN.SEMICOLON") - | Parser.TOKEN_SEMICOLON_SEMICOLON -> getErrorString ("Parser.TOKEN.SEMICOLON.SEMICOLON") - | Parser.TOKEN_LPAREN -> getErrorString ("Parser.TOKEN.LPAREN") + | Parser.TOKEN_IEEE64 -> SR.GetString("Parser.TOKEN.FLOAT") + | Parser.TOKEN_DECIMAL -> SR.GetString("Parser.TOKEN.DECIMAL") + | Parser.TOKEN_CHAR -> SR.GetString("Parser.TOKEN.CHAR") + + | Parser.TOKEN_BASE -> SR.GetString("Parser.TOKEN.BASE") + | Parser.TOKEN_LPAREN_STAR_RPAREN -> SR.GetString("Parser.TOKEN.LPAREN.STAR.RPAREN") + | Parser.TOKEN_DOLLAR -> SR.GetString("Parser.TOKEN.DOLLAR") + | Parser.TOKEN_INFIX_STAR_STAR_OP -> SR.GetString("Parser.TOKEN.INFIX.STAR.STAR.OP") + | Parser.TOKEN_INFIX_COMPARE_OP -> SR.GetString("Parser.TOKEN.INFIX.COMPARE.OP") + | Parser.TOKEN_COLON_GREATER -> SR.GetString("Parser.TOKEN.COLON.GREATER") + | Parser.TOKEN_COLON_COLON -> SR.GetString("Parser.TOKEN.COLON.COLON") + | Parser.TOKEN_PERCENT_OP -> SR.GetString("Parser.TOKEN.PERCENT.OP") + | Parser.TOKEN_INFIX_AT_HAT_OP -> SR.GetString("Parser.TOKEN.INFIX.AT.HAT.OP") + | Parser.TOKEN_INFIX_BAR_OP -> SR.GetString("Parser.TOKEN.INFIX.BAR.OP") + | Parser.TOKEN_PLUS_MINUS_OP -> SR.GetString("Parser.TOKEN.PLUS.MINUS.OP") + | Parser.TOKEN_PREFIX_OP -> SR.GetString("Parser.TOKEN.PREFIX.OP") + | Parser.TOKEN_COLON_QMARK_GREATER -> SR.GetString("Parser.TOKEN.COLON.QMARK.GREATER") + | Parser.TOKEN_INFIX_STAR_DIV_MOD_OP -> SR.GetString("Parser.TOKEN.INFIX.STAR.DIV.MOD.OP") + | Parser.TOKEN_INFIX_AMP_OP -> SR.GetString("Parser.TOKEN.INFIX.AMP.OP") + | Parser.TOKEN_AMP -> SR.GetString("Parser.TOKEN.AMP") + | Parser.TOKEN_AMP_AMP -> SR.GetString("Parser.TOKEN.AMP.AMP") + | Parser.TOKEN_BAR_BAR -> SR.GetString("Parser.TOKEN.BAR.BAR") + | Parser.TOKEN_LESS -> SR.GetString("Parser.TOKEN.LESS") + | Parser.TOKEN_GREATER -> SR.GetString("Parser.TOKEN.GREATER") + | Parser.TOKEN_QMARK -> SR.GetString("Parser.TOKEN.QMARK") + | Parser.TOKEN_QMARK_QMARK -> SR.GetString("Parser.TOKEN.QMARK.QMARK") + | Parser.TOKEN_COLON_QMARK -> SR.GetString("Parser.TOKEN.COLON.QMARK") + | Parser.TOKEN_INT32_DOT_DOT -> SR.GetString("Parser.TOKEN.INT32.DOT.DOT") + | Parser.TOKEN_DOT_DOT -> SR.GetString("Parser.TOKEN.DOT.DOT") + | Parser.TOKEN_DOT_DOT_HAT -> SR.GetString("Parser.TOKEN.DOT.DOT") + | Parser.TOKEN_QUOTE -> SR.GetString("Parser.TOKEN.QUOTE") + | Parser.TOKEN_STAR -> SR.GetString("Parser.TOKEN.STAR") + | Parser.TOKEN_HIGH_PRECEDENCE_TYAPP -> SR.GetString("Parser.TOKEN.HIGH.PRECEDENCE.TYAPP") + | Parser.TOKEN_COLON -> SR.GetString("Parser.TOKEN.COLON") + | Parser.TOKEN_COLON_EQUALS -> SR.GetString("Parser.TOKEN.COLON.EQUALS") + | Parser.TOKEN_LARROW -> SR.GetString("Parser.TOKEN.LARROW") + | Parser.TOKEN_EQUALS -> SR.GetString("Parser.TOKEN.EQUALS") + | Parser.TOKEN_GREATER_BAR_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACK") + | Parser.TOKEN_MINUS -> SR.GetString("Parser.TOKEN.MINUS") + | Parser.TOKEN_ADJACENT_PREFIX_OP -> SR.GetString("Parser.TOKEN.ADJACENT.PREFIX.OP") + | Parser.TOKEN_FUNKY_OPERATOR_NAME -> SR.GetString("Parser.TOKEN.FUNKY.OPERATOR.NAME") + | Parser.TOKEN_COMMA -> SR.GetString("Parser.TOKEN.COMMA") + | Parser.TOKEN_DOT -> SR.GetString("Parser.TOKEN.DOT") + | Parser.TOKEN_BAR -> SR.GetString("Parser.TOKEN.BAR") + | Parser.TOKEN_HASH -> SR.GetString("Parser.TOKEN.HASH") + | Parser.TOKEN_UNDERSCORE -> SR.GetString("Parser.TOKEN.UNDERSCORE") + | Parser.TOKEN_SEMICOLON -> SR.GetString("Parser.TOKEN.SEMICOLON") + | Parser.TOKEN_SEMICOLON_SEMICOLON -> SR.GetString("Parser.TOKEN.SEMICOLON.SEMICOLON") + | Parser.TOKEN_LPAREN -> SR.GetString("Parser.TOKEN.LPAREN") | Parser.TOKEN_RPAREN | Parser.TOKEN_RPAREN_COMING_SOON - | Parser.TOKEN_RPAREN_IS_HERE -> getErrorString ("Parser.TOKEN.RPAREN") - | Parser.TOKEN_LQUOTE -> getErrorString ("Parser.TOKEN.LQUOTE") - | Parser.TOKEN_LBRACK -> getErrorString ("Parser.TOKEN.LBRACK") - | Parser.TOKEN_LBRACE_BAR -> getErrorString ("Parser.TOKEN.LBRACE.BAR") - | Parser.TOKEN_LBRACK_BAR -> getErrorString ("Parser.TOKEN.LBRACK.BAR") - | Parser.TOKEN_LBRACK_LESS -> getErrorString ("Parser.TOKEN.LBRACK.LESS") - | Parser.TOKEN_LBRACE -> getErrorString ("Parser.TOKEN.LBRACE") - | Parser.TOKEN_BAR_RBRACK -> getErrorString ("Parser.TOKEN.BAR.RBRACK") - | Parser.TOKEN_BAR_RBRACE -> getErrorString ("Parser.TOKEN.BAR.RBRACE") - | Parser.TOKEN_GREATER_RBRACK -> getErrorString ("Parser.TOKEN.GREATER.RBRACK") + | Parser.TOKEN_RPAREN_IS_HERE -> SR.GetString("Parser.TOKEN.RPAREN") + | Parser.TOKEN_LQUOTE -> SR.GetString("Parser.TOKEN.LQUOTE") + | Parser.TOKEN_LBRACK -> SR.GetString("Parser.TOKEN.LBRACK") + | Parser.TOKEN_LBRACE_BAR -> SR.GetString("Parser.TOKEN.LBRACE.BAR") + | Parser.TOKEN_LBRACK_BAR -> SR.GetString("Parser.TOKEN.LBRACK.BAR") + | Parser.TOKEN_LBRACK_LESS -> SR.GetString("Parser.TOKEN.LBRACK.LESS") + | Parser.TOKEN_LBRACE -> SR.GetString("Parser.TOKEN.LBRACE") + | Parser.TOKEN_BAR_RBRACK -> SR.GetString("Parser.TOKEN.BAR.RBRACK") + | Parser.TOKEN_BAR_RBRACE -> SR.GetString("Parser.TOKEN.BAR.RBRACE") + | Parser.TOKEN_GREATER_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.RBRACK") | Parser.TOKEN_RQUOTE_DOT _ - | Parser.TOKEN_RQUOTE -> getErrorString ("Parser.TOKEN.RQUOTE") - | Parser.TOKEN_RBRACK -> getErrorString ("Parser.TOKEN.RBRACK") + | Parser.TOKEN_RQUOTE -> SR.GetString("Parser.TOKEN.RQUOTE") + | Parser.TOKEN_RBRACK -> SR.GetString("Parser.TOKEN.RBRACK") | Parser.TOKEN_RBRACE | Parser.TOKEN_RBRACE_COMING_SOON - | Parser.TOKEN_RBRACE_IS_HERE -> getErrorString ("Parser.TOKEN.RBRACE") - | Parser.TOKEN_PUBLIC -> getErrorString ("Parser.TOKEN.PUBLIC") - | Parser.TOKEN_PRIVATE -> getErrorString ("Parser.TOKEN.PRIVATE") - | Parser.TOKEN_INTERNAL -> getErrorString ("Parser.TOKEN.INTERNAL") - | Parser.TOKEN_CONSTRAINT -> getErrorString ("Parser.TOKEN.CONSTRAINT") - | Parser.TOKEN_INSTANCE -> getErrorString ("Parser.TOKEN.INSTANCE") - | Parser.TOKEN_DELEGATE -> getErrorString ("Parser.TOKEN.DELEGATE") - | Parser.TOKEN_INHERIT -> getErrorString ("Parser.TOKEN.INHERIT") - | Parser.TOKEN_CONSTRUCTOR -> getErrorString ("Parser.TOKEN.CONSTRUCTOR") - | Parser.TOKEN_DEFAULT -> getErrorString ("Parser.TOKEN.DEFAULT") - | Parser.TOKEN_OVERRIDE -> getErrorString ("Parser.TOKEN.OVERRIDE") - | Parser.TOKEN_ABSTRACT -> getErrorString ("Parser.TOKEN.ABSTRACT") - | Parser.TOKEN_CLASS -> getErrorString ("Parser.TOKEN.CLASS") - | Parser.TOKEN_MEMBER -> getErrorString ("Parser.TOKEN.MEMBER") - | Parser.TOKEN_STATIC -> getErrorString ("Parser.TOKEN.STATIC") - | Parser.TOKEN_NAMESPACE -> getErrorString ("Parser.TOKEN.NAMESPACE") - | Parser.TOKEN_OBLOCKBEGIN -> getErrorString ("Parser.TOKEN.OBLOCKBEGIN") - | EndOfStructuredConstructToken -> getErrorString ("Parser.TOKEN.OBLOCKEND") + | Parser.TOKEN_RBRACE_IS_HERE -> SR.GetString("Parser.TOKEN.RBRACE") + | Parser.TOKEN_PUBLIC -> SR.GetString("Parser.TOKEN.PUBLIC") + | Parser.TOKEN_PRIVATE -> SR.GetString("Parser.TOKEN.PRIVATE") + | Parser.TOKEN_INTERNAL -> SR.GetString("Parser.TOKEN.INTERNAL") + | Parser.TOKEN_CONSTRAINT -> SR.GetString("Parser.TOKEN.CONSTRAINT") + | Parser.TOKEN_INSTANCE -> SR.GetString("Parser.TOKEN.INSTANCE") + | Parser.TOKEN_DELEGATE -> SR.GetString("Parser.TOKEN.DELEGATE") + | Parser.TOKEN_INHERIT -> SR.GetString("Parser.TOKEN.INHERIT") + | Parser.TOKEN_CONSTRUCTOR -> SR.GetString("Parser.TOKEN.CONSTRUCTOR") + | Parser.TOKEN_DEFAULT -> SR.GetString("Parser.TOKEN.DEFAULT") + | Parser.TOKEN_OVERRIDE -> SR.GetString("Parser.TOKEN.OVERRIDE") + | Parser.TOKEN_ABSTRACT -> SR.GetString("Parser.TOKEN.ABSTRACT") + | Parser.TOKEN_CLASS -> SR.GetString("Parser.TOKEN.CLASS") + | Parser.TOKEN_MEMBER -> SR.GetString("Parser.TOKEN.MEMBER") + | Parser.TOKEN_STATIC -> SR.GetString("Parser.TOKEN.STATIC") + | Parser.TOKEN_NAMESPACE -> SR.GetString("Parser.TOKEN.NAMESPACE") + | Parser.TOKEN_OBLOCKBEGIN -> SR.GetString("Parser.TOKEN.OBLOCKBEGIN") + | EndOfStructuredConstructToken -> SR.GetString("Parser.TOKEN.OBLOCKEND") | Parser.TOKEN_THEN - | Parser.TOKEN_OTHEN -> getErrorString ("Parser.TOKEN.OTHEN") + | Parser.TOKEN_OTHEN -> SR.GetString("Parser.TOKEN.OTHEN") | Parser.TOKEN_ELSE - | Parser.TOKEN_OELSE -> getErrorString ("Parser.TOKEN.OELSE") + | Parser.TOKEN_OELSE -> SR.GetString("Parser.TOKEN.OELSE") | Parser.TOKEN_LET _ - | Parser.TOKEN_OLET _ -> getErrorString ("Parser.TOKEN.OLET") + | Parser.TOKEN_OLET _ -> SR.GetString("Parser.TOKEN.OLET") | Parser.TOKEN_OBINDER - | Parser.TOKEN_BINDER -> getErrorString ("Parser.TOKEN.BINDER") + | Parser.TOKEN_BINDER -> SR.GetString("Parser.TOKEN.BINDER") | Parser.TOKEN_OAND_BANG - | Parser.TOKEN_AND_BANG -> getErrorString ("Parser.TOKEN.AND.BANG") - | Parser.TOKEN_ODO -> getErrorString ("Parser.TOKEN.ODO") - | Parser.TOKEN_OWITH -> getErrorString ("Parser.TOKEN.OWITH") - | Parser.TOKEN_OFUNCTION -> getErrorString ("Parser.TOKEN.OFUNCTION") - | Parser.TOKEN_OFUN -> getErrorString ("Parser.TOKEN.OFUN") - | Parser.TOKEN_ORESET -> getErrorString ("Parser.TOKEN.ORESET") - | Parser.TOKEN_ODUMMY -> getErrorString ("Parser.TOKEN.ODUMMY") + | Parser.TOKEN_AND_BANG -> SR.GetString("Parser.TOKEN.AND.BANG") + | Parser.TOKEN_ODO -> SR.GetString("Parser.TOKEN.ODO") + | Parser.TOKEN_OWITH -> SR.GetString("Parser.TOKEN.OWITH") + | Parser.TOKEN_OFUNCTION -> SR.GetString("Parser.TOKEN.OFUNCTION") + | Parser.TOKEN_OFUN -> SR.GetString("Parser.TOKEN.OFUN") + | Parser.TOKEN_ORESET -> SR.GetString("Parser.TOKEN.ORESET") + | Parser.TOKEN_ODUMMY -> SR.GetString("Parser.TOKEN.ODUMMY") | Parser.TOKEN_DO_BANG - | Parser.TOKEN_ODO_BANG -> getErrorString ("Parser.TOKEN.ODO.BANG") - | Parser.TOKEN_YIELD -> getErrorString ("Parser.TOKEN.YIELD") - | Parser.TOKEN_YIELD_BANG -> getErrorString ("Parser.TOKEN.YIELD.BANG") - | Parser.TOKEN_OINTERFACE_MEMBER -> getErrorString ("Parser.TOKEN.OINTERFACE.MEMBER") - | Parser.TOKEN_ELIF -> getErrorString ("Parser.TOKEN.ELIF") - | Parser.TOKEN_RARROW -> getErrorString ("Parser.TOKEN.RARROW") - | Parser.TOKEN_SIG -> getErrorString ("Parser.TOKEN.SIG") - | Parser.TOKEN_STRUCT -> getErrorString ("Parser.TOKEN.STRUCT") - | Parser.TOKEN_UPCAST -> getErrorString ("Parser.TOKEN.UPCAST") - | Parser.TOKEN_DOWNCAST -> getErrorString ("Parser.TOKEN.DOWNCAST") - | Parser.TOKEN_NULL -> getErrorString ("Parser.TOKEN.NULL") - | Parser.TOKEN_RESERVED -> getErrorString ("Parser.TOKEN.RESERVED") + | Parser.TOKEN_ODO_BANG -> SR.GetString("Parser.TOKEN.ODO.BANG") + | Parser.TOKEN_YIELD -> SR.GetString("Parser.TOKEN.YIELD") + | Parser.TOKEN_YIELD_BANG -> SR.GetString("Parser.TOKEN.YIELD.BANG") + | Parser.TOKEN_OINTERFACE_MEMBER -> SR.GetString("Parser.TOKEN.OINTERFACE.MEMBER") + | Parser.TOKEN_ELIF -> SR.GetString("Parser.TOKEN.ELIF") + | Parser.TOKEN_RARROW -> SR.GetString("Parser.TOKEN.RARROW") + | Parser.TOKEN_SIG -> SR.GetString("Parser.TOKEN.SIG") + | Parser.TOKEN_STRUCT -> SR.GetString("Parser.TOKEN.STRUCT") + | Parser.TOKEN_UPCAST -> SR.GetString("Parser.TOKEN.UPCAST") + | Parser.TOKEN_DOWNCAST -> SR.GetString("Parser.TOKEN.DOWNCAST") + | Parser.TOKEN_NULL -> SR.GetString("Parser.TOKEN.NULL") + | Parser.TOKEN_RESERVED -> SR.GetString("Parser.TOKEN.RESERVED") | Parser.TOKEN_MODULE | Parser.TOKEN_MODULE_COMING_SOON - | Parser.TOKEN_MODULE_IS_HERE -> getErrorString ("Parser.TOKEN.MODULE") - | Parser.TOKEN_AND -> getErrorString ("Parser.TOKEN.AND") - | Parser.TOKEN_AS -> getErrorString ("Parser.TOKEN.AS") - | Parser.TOKEN_ASSERT -> getErrorString ("Parser.TOKEN.ASSERT") - | Parser.TOKEN_OASSERT -> getErrorString ("Parser.TOKEN.ASSERT") - | Parser.TOKEN_ASR -> getErrorString ("Parser.TOKEN.ASR") - | Parser.TOKEN_DOWNTO -> getErrorString ("Parser.TOKEN.DOWNTO") - | Parser.TOKEN_EXCEPTION -> getErrorString ("Parser.TOKEN.EXCEPTION") - | Parser.TOKEN_FALSE -> getErrorString ("Parser.TOKEN.FALSE") - | Parser.TOKEN_FOR -> getErrorString ("Parser.TOKEN.FOR") - | Parser.TOKEN_FUN -> getErrorString ("Parser.TOKEN.FUN") - | Parser.TOKEN_FUNCTION -> getErrorString ("Parser.TOKEN.FUNCTION") - | Parser.TOKEN_FINALLY -> getErrorString ("Parser.TOKEN.FINALLY") - | Parser.TOKEN_LAZY -> getErrorString ("Parser.TOKEN.LAZY") - | Parser.TOKEN_OLAZY -> getErrorString ("Parser.TOKEN.LAZY") - | Parser.TOKEN_MATCH -> getErrorString ("Parser.TOKEN.MATCH") - | Parser.TOKEN_MATCH_BANG -> getErrorString ("Parser.TOKEN.MATCH.BANG") - | Parser.TOKEN_MUTABLE -> getErrorString ("Parser.TOKEN.MUTABLE") - | Parser.TOKEN_NEW -> getErrorString ("Parser.TOKEN.NEW") - | Parser.TOKEN_OF -> getErrorString ("Parser.TOKEN.OF") - | Parser.TOKEN_OPEN -> getErrorString ("Parser.TOKEN.OPEN") - | Parser.TOKEN_OR -> getErrorString ("Parser.TOKEN.OR") - | Parser.TOKEN_VOID -> getErrorString ("Parser.TOKEN.VOID") - | Parser.TOKEN_EXTERN -> getErrorString ("Parser.TOKEN.EXTERN") - | Parser.TOKEN_INTERFACE -> getErrorString ("Parser.TOKEN.INTERFACE") - | Parser.TOKEN_REC -> getErrorString ("Parser.TOKEN.REC") - | Parser.TOKEN_TO -> getErrorString ("Parser.TOKEN.TO") - | Parser.TOKEN_TRUE -> getErrorString ("Parser.TOKEN.TRUE") - | Parser.TOKEN_TRY -> getErrorString ("Parser.TOKEN.TRY") + | Parser.TOKEN_MODULE_IS_HERE -> SR.GetString("Parser.TOKEN.MODULE") + | Parser.TOKEN_AND -> SR.GetString("Parser.TOKEN.AND") + | Parser.TOKEN_AS -> SR.GetString("Parser.TOKEN.AS") + | Parser.TOKEN_ASSERT -> SR.GetString("Parser.TOKEN.ASSERT") + | Parser.TOKEN_OASSERT -> SR.GetString("Parser.TOKEN.ASSERT") + | Parser.TOKEN_ASR -> SR.GetString("Parser.TOKEN.ASR") + | Parser.TOKEN_DOWNTO -> SR.GetString("Parser.TOKEN.DOWNTO") + | Parser.TOKEN_EXCEPTION -> SR.GetString("Parser.TOKEN.EXCEPTION") + | Parser.TOKEN_FALSE -> SR.GetString("Parser.TOKEN.FALSE") + | Parser.TOKEN_FOR -> SR.GetString("Parser.TOKEN.FOR") + | Parser.TOKEN_FUN -> SR.GetString("Parser.TOKEN.FUN") + | Parser.TOKEN_FUNCTION -> SR.GetString("Parser.TOKEN.FUNCTION") + | Parser.TOKEN_FINALLY -> SR.GetString("Parser.TOKEN.FINALLY") + | Parser.TOKEN_LAZY -> SR.GetString("Parser.TOKEN.LAZY") + | Parser.TOKEN_OLAZY -> SR.GetString("Parser.TOKEN.LAZY") + | Parser.TOKEN_MATCH -> SR.GetString("Parser.TOKEN.MATCH") + | Parser.TOKEN_MATCH_BANG -> SR.GetString("Parser.TOKEN.MATCH.BANG") + | Parser.TOKEN_MUTABLE -> SR.GetString("Parser.TOKEN.MUTABLE") + | Parser.TOKEN_NEW -> SR.GetString("Parser.TOKEN.NEW") + | Parser.TOKEN_OF -> SR.GetString("Parser.TOKEN.OF") + | Parser.TOKEN_OPEN -> SR.GetString("Parser.TOKEN.OPEN") + | Parser.TOKEN_OR -> SR.GetString("Parser.TOKEN.OR") + | Parser.TOKEN_VOID -> SR.GetString("Parser.TOKEN.VOID") + | Parser.TOKEN_EXTERN -> SR.GetString("Parser.TOKEN.EXTERN") + | Parser.TOKEN_INTERFACE -> SR.GetString("Parser.TOKEN.INTERFACE") + | Parser.TOKEN_REC -> SR.GetString("Parser.TOKEN.REC") + | Parser.TOKEN_TO -> SR.GetString("Parser.TOKEN.TO") + | Parser.TOKEN_TRUE -> SR.GetString("Parser.TOKEN.TRUE") + | Parser.TOKEN_TRY -> SR.GetString("Parser.TOKEN.TRY") | Parser.TOKEN_TYPE | Parser.TOKEN_TYPE_COMING_SOON - | Parser.TOKEN_TYPE_IS_HERE -> getErrorString ("Parser.TOKEN.TYPE") - | Parser.TOKEN_VAL -> getErrorString ("Parser.TOKEN.VAL") - | Parser.TOKEN_INLINE -> getErrorString ("Parser.TOKEN.INLINE") - | Parser.TOKEN_WHEN -> getErrorString ("Parser.TOKEN.WHEN") - | Parser.TOKEN_WHILE -> getErrorString ("Parser.TOKEN.WHILE") - | Parser.TOKEN_WITH -> getErrorString ("Parser.TOKEN.WITH") - | Parser.TOKEN_IF -> getErrorString ("Parser.TOKEN.IF") - | Parser.TOKEN_DO -> getErrorString ("Parser.TOKEN.DO") - | Parser.TOKEN_GLOBAL -> getErrorString ("Parser.TOKEN.GLOBAL") - | Parser.TOKEN_DONE -> getErrorString ("Parser.TOKEN.DONE") + | Parser.TOKEN_TYPE_IS_HERE -> SR.GetString("Parser.TOKEN.TYPE") + | Parser.TOKEN_VAL -> SR.GetString("Parser.TOKEN.VAL") + | Parser.TOKEN_INLINE -> SR.GetString("Parser.TOKEN.INLINE") + | Parser.TOKEN_WHEN -> SR.GetString("Parser.TOKEN.WHEN") + | Parser.TOKEN_WHILE -> SR.GetString("Parser.TOKEN.WHILE") + | Parser.TOKEN_WITH -> SR.GetString("Parser.TOKEN.WITH") + | Parser.TOKEN_IF -> SR.GetString("Parser.TOKEN.IF") + | Parser.TOKEN_DO -> SR.GetString("Parser.TOKEN.DO") + | Parser.TOKEN_GLOBAL -> SR.GetString("Parser.TOKEN.GLOBAL") + | Parser.TOKEN_DONE -> SR.GetString("Parser.TOKEN.DONE") | Parser.TOKEN_IN - | Parser.TOKEN_JOIN_IN -> getErrorString ("Parser.TOKEN.IN") - | Parser.TOKEN_HIGH_PRECEDENCE_PAREN_APP -> getErrorString ("Parser.TOKEN.HIGH.PRECEDENCE.PAREN.APP") - | Parser.TOKEN_HIGH_PRECEDENCE_BRACK_APP -> getErrorString ("Parser.TOKEN.HIGH.PRECEDENCE.BRACK.APP") - | Parser.TOKEN_BEGIN -> getErrorString ("Parser.TOKEN.BEGIN") - | Parser.TOKEN_END -> getErrorString ("Parser.TOKEN.END") + | Parser.TOKEN_JOIN_IN -> SR.GetString("Parser.TOKEN.IN") + | Parser.TOKEN_HIGH_PRECEDENCE_PAREN_APP -> SR.GetString("Parser.TOKEN.HIGH.PRECEDENCE.PAREN.APP") + | Parser.TOKEN_HIGH_PRECEDENCE_BRACK_APP -> SR.GetString("Parser.TOKEN.HIGH.PRECEDENCE.BRACK.APP") + | Parser.TOKEN_BEGIN -> SR.GetString("Parser.TOKEN.BEGIN") + | Parser.TOKEN_END -> SR.GetString("Parser.TOKEN.END") | Parser.TOKEN_HASH_LIGHT | Parser.TOKEN_HASH_LINE | Parser.TOKEN_HASH_IF | Parser.TOKEN_HASH_ELSE - | Parser.TOKEN_HASH_ENDIF -> getErrorString ("Parser.TOKEN.HASH.ENDIF") - | Parser.TOKEN_INACTIVECODE -> getErrorString ("Parser.TOKEN.INACTIVECODE") - | Parser.TOKEN_LEX_FAILURE -> getErrorString ("Parser.TOKEN.LEX.FAILURE") - | Parser.TOKEN_WHITESPACE -> getErrorString ("Parser.TOKEN.WHITESPACE") - | Parser.TOKEN_COMMENT -> getErrorString ("Parser.TOKEN.COMMENT") - | Parser.TOKEN_LINE_COMMENT -> getErrorString ("Parser.TOKEN.LINE.COMMENT") - | Parser.TOKEN_STRING_TEXT -> getErrorString ("Parser.TOKEN.STRING.TEXT") - | Parser.TOKEN_BYTEARRAY -> getErrorString ("Parser.TOKEN.BYTEARRAY") - | Parser.TOKEN_STRING -> getErrorString ("Parser.TOKEN.STRING") - | Parser.TOKEN_KEYWORD_STRING -> getErrorString ("Parser.TOKEN.KEYWORD_STRING") - | Parser.TOKEN_EOF -> getErrorString ("Parser.TOKEN.EOF") - | Parser.TOKEN_CONST -> getErrorString ("Parser.TOKEN.CONST") - | Parser.TOKEN_FIXED -> getErrorString ("Parser.TOKEN.FIXED") - | Parser.TOKEN_INTERP_STRING_BEGIN_END -> getErrorString ("Parser.TOKEN.INTERP.STRING.BEGIN.END") - | Parser.TOKEN_INTERP_STRING_BEGIN_PART -> getErrorString ("Parser.TOKEN.INTERP.STRING.BEGIN.PART") - | Parser.TOKEN_INTERP_STRING_PART -> getErrorString ("Parser.TOKEN.INTERP.STRING.PART") - | Parser.TOKEN_INTERP_STRING_END -> getErrorString ("Parser.TOKEN.INTERP.STRING.END") + | Parser.TOKEN_HASH_ENDIF -> SR.GetString("Parser.TOKEN.HASH.ENDIF") + | Parser.TOKEN_INACTIVECODE -> SR.GetString("Parser.TOKEN.INACTIVECODE") + | Parser.TOKEN_LEX_FAILURE -> SR.GetString("Parser.TOKEN.LEX.FAILURE") + | Parser.TOKEN_WHITESPACE -> SR.GetString("Parser.TOKEN.WHITESPACE") + | Parser.TOKEN_COMMENT -> SR.GetString("Parser.TOKEN.COMMENT") + | Parser.TOKEN_LINE_COMMENT -> SR.GetString("Parser.TOKEN.LINE.COMMENT") + | Parser.TOKEN_STRING_TEXT -> SR.GetString("Parser.TOKEN.STRING.TEXT") + | Parser.TOKEN_BYTEARRAY -> SR.GetString("Parser.TOKEN.BYTEARRAY") + | Parser.TOKEN_STRING -> SR.GetString("Parser.TOKEN.STRING") + | Parser.TOKEN_KEYWORD_STRING -> SR.GetString("Parser.TOKEN.KEYWORD_STRING") + | Parser.TOKEN_EOF -> SR.GetString("Parser.TOKEN.EOF") + | Parser.TOKEN_CONST -> SR.GetString("Parser.TOKEN.CONST") + | Parser.TOKEN_FIXED -> SR.GetString("Parser.TOKEN.FIXED") + | Parser.TOKEN_INTERP_STRING_BEGIN_END -> SR.GetString("Parser.TOKEN.INTERP.STRING.BEGIN.END") + | Parser.TOKEN_INTERP_STRING_BEGIN_PART -> SR.GetString("Parser.TOKEN.INTERP.STRING.BEGIN.PART") + | Parser.TOKEN_INTERP_STRING_PART -> SR.GetString("Parser.TOKEN.INTERP.STRING.PART") + | Parser.TOKEN_INTERP_STRING_END -> SR.GetString("Parser.TOKEN.INTERP.STRING.END") | unknown -> Debug.Assert(false, "unknown token tag") let result = sprintf "%+A" unknown @@ -1650,12 +1651,10 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | DiagnosticWithSuggestions (_, s, _, idText, suggestionF) -> os.AppendString(ConvertValLogicalNameToDisplayNameCore s) - suggestNames suggestionF idText + OutputNameSuggestions os suggestNames suggestionF idText | InternalError (s, _) - | InvalidArgument s - | Failure s as exn -> ignore exn // use the argument, even in non DEBUG let f1 = SR.GetString("Failure1") @@ -1670,7 +1669,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu Debug.Assert(false, sprintf "Unexpected exception seen in compiler: %s\n%s" s (exn.ToString())) #endif - | WrappedError (exn, _) -> OutputExceptionR os exn + | WrappedError (e, _) -> e.Output(os, suggestNames) | PatternMatchCompilation.MatchIncomplete (isComp, cexOpt, _) -> os.AppendString(MatchIncomplete1E().Format) @@ -1825,17 +1824,17 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu os.AppendString(FSComp.SR.buildUnexpectedFileNameCharacter (fileName, string invalidChar) |> snd) | HashLoadedSourceHasIssues (infos, warnings, errors, _) -> - let Emit (l: exn list) = OutputExceptionR os (List.head l) - if isNil warnings && isNil errors then - os.AppendString(HashLoadedSourceHasIssues0E().Format) - Emit infos - elif isNil errors then - os.AppendString(HashLoadedSourceHasIssues1E().Format) - Emit warnings - else + match warnings, errors with + | _, e :: _ -> os.AppendString(HashLoadedSourceHasIssues2E().Format) - Emit errors + e.Output(os, suggestNames) + | e :: _, _ -> + os.AppendString(HashLoadedSourceHasIssues1E().Format) + e.Output(os, suggestNames) + | [], [] -> + os.AppendString(HashLoadedSourceHasIssues0E().Format) + infos.Head.Output(os, suggestNames) | HashLoadedScriptConsideredSource _ -> os.AppendString(HashLoadedScriptConsideredSourceE().Format) @@ -1851,7 +1850,7 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu | MSBuildReferenceResolutionError (code, message, _) -> os.AppendString(MSBuildReferenceResolutionErrorE().Format message code) // Strip TargetInvocationException wrappers - | :? System.Reflection.TargetInvocationException as exn -> OutputExceptionR os exn.InnerException + | :? TargetInvocationException as exn -> exn.InnerException.Output(os, suggestNames) | :? FileNotFoundException as exn -> Printf.bprintf os "%s" exn.Message @@ -1874,21 +1873,37 @@ let OutputPhasedErrorR (os: StringBuilder) (diagnostic: PhasedDiagnostic) (canSu Debug.Assert(false, sprintf "Unknown exception seen in compiler: %s" (exn.ToString())) #endif - OutputExceptionR os diagnostic.Exception +/// Eagerly format a PhasedDiagnostic to a DiagnosticWithText +type PhasedDiagnostic with -// remove any newlines and tabs -let OutputPhasedDiagnostic (os: StringBuilder) (diagnostic: PhasedDiagnostic) (flattenErrors: bool) (suggestNames: bool) = - let buf = StringBuilder() + // remove any newlines and tabs + member x.OutputCore(os: StringBuilder, flattenErrors: bool, suggestNames: bool) = + let buf = StringBuilder() - OutputPhasedErrorR buf diagnostic suggestNames + x.Exception.Output(buf, suggestNames) - let text = - if flattenErrors then - NormalizeErrorString(buf.ToString()) - else - buf.ToString() + let text = + if flattenErrors then + NormalizeErrorString(buf.ToString()) + else + buf.ToString() + + os.AppendString text + + member x.FormatCore(flattenErrors: bool, suggestNames: bool) = + let os = StringBuilder() + x.OutputCore(os, flattenErrors, suggestNames) + os.ToString() - os.AppendString text + member x.EagerlyFormatCore(suggestNames: bool) = + match x.Range with + | Some m -> + let buf = StringBuilder() + x.Exception.Output(buf, suggestNames) + let message = buf.ToString() + let exn = DiagnosticWithText(x.Number, message, m) + { Exception = exn; Phase = x.Phase } + | None -> x let SanitizeFileName fileName implicitIncludeDir = // The assert below is almost ok, but it fires in two cases: @@ -1939,87 +1954,79 @@ type FormattedDiagnostic = | Short of FSharpDiagnosticSeverity * string | Long of FSharpDiagnosticSeverity * FormattedDiagnosticDetailedInfo -/// returns sequence that contains Diagnostic for the given error + Diagnostic for all related errors -let CollectFormattedDiagnostics - ( - implicitIncludeDir, - showFullPaths, - flattenErrors, - diagnosticStyle, - severity: FSharpDiagnosticSeverity, - diagnostic: PhasedDiagnostic, - suggestNames: bool - ) = - let outputWhere (showFullPaths, diagnosticStyle) m : FormattedDiagnosticLocation = - if equals m rangeStartup || equals m rangeCmdArgs then - { - Range = m - TextRepresentation = "" - IsEmpty = true - File = "" - } - else - let file = m.FileName +let FormatDiagnosticLocation (tcConfig: TcConfig) m : FormattedDiagnosticLocation = + if equals m rangeStartup || equals m rangeCmdArgs then + { + Range = m + TextRepresentation = "" + IsEmpty = true + File = "" + } + else + let file = m.FileName - let file = - if showFullPaths then - FileSystem.GetFullFilePathInDirectoryShim implicitIncludeDir file - else - SanitizeFileName file implicitIncludeDir - - let text, m, file = - match diagnosticStyle with - | DiagnosticStyle.Emacs -> - let file = file.Replace("\\", "/") - (sprintf "File \"%s\", line %d, characters %d-%d: " file m.StartLine m.StartColumn m.EndColumn), m, file - - // We're adjusting the columns here to be 1-based - both for parity with C# and for MSBuild, which assumes 1-based columns for error output - | DiagnosticStyle.Default -> - let file = file.Replace('/', Path.DirectorySeparatorChar) - let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) m.End - (sprintf "%s(%d,%d): " file m.StartLine m.StartColumn), m, file - - // We may also want to change Test to be 1-based - | DiagnosticStyle.Test -> + let file = + if tcConfig.showFullPaths then + FileSystem.GetFullFilePathInDirectoryShim tcConfig.implicitIncludeDir file + else + SanitizeFileName file tcConfig.implicitIncludeDir + + let text, m, file = + match tcConfig.diagnosticStyle with + | DiagnosticStyle.Emacs -> + let file = file.Replace("\\", "/") + (sprintf "File \"%s\", line %d, characters %d-%d: " file m.StartLine m.StartColumn m.EndColumn), m, file + + // We're adjusting the columns here to be 1-based - both for parity with C# and for MSBuild, which assumes 1-based columns for error output + | DiagnosticStyle.Default -> + let file = file.Replace('/', Path.DirectorySeparatorChar) + let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) m.End + (sprintf "%s(%d,%d): " file m.StartLine m.StartColumn), m, file + + // We may also want to change Test to be 1-based + | DiagnosticStyle.Test -> + let file = file.Replace("/", "\\") + + let m = + mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1)) + + sprintf "%s(%d,%d-%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file + + | DiagnosticStyle.Gcc -> + let file = file.Replace('/', Path.DirectorySeparatorChar) + + let m = + mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1)) + + sprintf "%s:%d:%d: " file m.StartLine m.StartColumn, m, file + + // Here, we want the complete range information so Project Systems can generate proper squiggles + | DiagnosticStyle.VisualStudio -> + // Show prefix only for real files. Otherwise, we just want a truncated error like: + // parse error FS0031: blah blah + if + not (equals m range0) + && not (equals m rangeStartup) + && not (equals m rangeCmdArgs) + then let file = file.Replace("/", "\\") let m = mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1)) - sprintf "%s(%d,%d-%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file - - | DiagnosticStyle.Gcc -> - let file = file.Replace('/', Path.DirectorySeparatorChar) - - let m = - mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1)) - - sprintf "%s:%d:%d: " file m.StartLine m.StartColumn, m, file - - // Here, we want the complete range information so Project Systems can generate proper squiggles - | DiagnosticStyle.VisualStudio -> - // Show prefix only for real files. Otherwise, we just want a truncated error like: - // parse error FS0031: blah blah - if - not (equals m range0) - && not (equals m rangeStartup) - && not (equals m rangeCmdArgs) - then - let file = file.Replace("/", "\\") - - let m = - mkRange m.FileName (mkPos m.StartLine (m.StartColumn + 1)) (mkPos m.EndLine (m.EndColumn + 1)) + sprintf "%s(%d,%d,%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file + else + "", m, file - sprintf "%s(%d,%d,%d,%d): " file m.StartLine m.StartColumn m.EndLine m.EndColumn, m, file - else - "", m, file + { + Range = m + TextRepresentation = text + IsEmpty = false + File = file + } - { - Range = m - TextRepresentation = text - IsEmpty = false - File = file - } +/// returns sequence that contains Diagnostic for the given error + Diagnostic for all related errors +let CollectFormattedDiagnostics (tcConfig: TcConfig, severity: FSharpDiagnosticSeverity, diagnostic: PhasedDiagnostic, suggestNames: bool) = match diagnostic.Exception with | ReportedError _ -> @@ -2031,42 +2038,36 @@ let CollectFormattedDiagnostics | _ -> let errors = ResizeArray() - let report diagnostic = - let OutputWhere diagnostic = - match GetRangeOfDiagnostic diagnostic with - | Some m -> Some(outputWhere (showFullPaths, diagnosticStyle) m) + let report (diagnostic: PhasedDiagnostic) = + let where = + match diagnostic.Range with + | Some m -> FormatDiagnosticLocation tcConfig m |> Some | None -> None - let OutputCanonicalInformation (subcategory, errorNumber) : FormattedDiagnosticCanonicalInformation = - let message = - match severity with - | FSharpDiagnosticSeverity.Error -> "error" - | FSharpDiagnosticSeverity.Warning -> "warning" - | FSharpDiagnosticSeverity.Info - | FSharpDiagnosticSeverity.Hidden -> "info" - - let text = - match diagnosticStyle with - // Show the subcategory for --vserrors so that we can fish it out in Visual Studio and use it to determine error stickiness. - | DiagnosticStyle.VisualStudio -> sprintf "%s %s FS%04d: " subcategory message errorNumber - | _ -> sprintf "%s FS%04d: " message errorNumber + let subcategory = diagnostic.Subcategory() + let errorNumber = diagnostic.Number + let message = + match severity with + | FSharpDiagnosticSeverity.Error -> "error" + | FSharpDiagnosticSeverity.Warning -> "warning" + | FSharpDiagnosticSeverity.Info + | FSharpDiagnosticSeverity.Hidden -> "info" + + let text = + match tcConfig.diagnosticStyle with + // Show the subcategory for --vserrors so that we can fish it out in Visual Studio and use it to determine error stickiness. + | DiagnosticStyle.VisualStudio -> sprintf "%s %s FS%04d: " subcategory message errorNumber + | _ -> sprintf "%s FS%04d: " message errorNumber + + let canonical: FormattedDiagnosticCanonicalInformation = { ErrorNumber = errorNumber Subcategory = subcategory TextRepresentation = text } - let mainError, relatedErrors = SplitRelatedDiagnostics diagnostic - let where = OutputWhere mainError - - let canonical = - OutputCanonicalInformation(diagnostic.Subcategory(), GetDiagnosticNumber mainError) - - let message = - let os = StringBuilder() - OutputPhasedDiagnostic os mainError flattenErrors suggestNames - os.ToString() + let message = diagnostic.FormatCore(tcConfig.flatErrors, suggestNames) let entry: FormattedDiagnosticDetailedInfo = { @@ -2077,127 +2078,56 @@ let CollectFormattedDiagnostics errors.Add(FormattedDiagnostic.Long(severity, entry)) - let OutputRelatedError (diagnostic: PhasedDiagnostic) = - match diagnosticStyle with - // Give a canonical string when --vserror. - | DiagnosticStyle.VisualStudio -> - let relWhere = OutputWhere mainError // mainError? - - let relCanonical = - OutputCanonicalInformation(diagnostic.Subcategory(), GetDiagnosticNumber mainError) // Use main error for code - - let relMessage = - let os = StringBuilder() - OutputPhasedDiagnostic os diagnostic flattenErrors suggestNames - os.ToString() - - let entry: FormattedDiagnosticDetailedInfo = - { - Location = relWhere - Canonical = relCanonical - Message = relMessage - } - - errors.Add(FormattedDiagnostic.Long(severity, entry)) - - | _ -> - let os = StringBuilder() - OutputPhasedDiagnostic os diagnostic flattenErrors suggestNames - errors.Add(FormattedDiagnostic.Short(severity, os.ToString())) - - relatedErrors |> List.iter OutputRelatedError - - match diagnostic with + match diagnostic.Exception with #if !NO_TYPEPROVIDERS - | { - Exception = :? TypeProviderError as tpe - } -> - tpe.Iter(fun exn -> - let newErr = { diagnostic with Exception = exn } - report newErr) + | :? TypeProviderError as tpe -> tpe.Iter(fun exn -> report { diagnostic with Exception = exn }) #endif - | x -> report x + | _ -> report diagnostic errors.ToArray() -/// used by fsc.exe and fsi.exe, but not by VS -/// prints error and related errors to the specified StringBuilder -let rec OutputDiagnostic (implicitIncludeDir, showFullPaths, flattenErrors, diagnosticStyle, severity) os (diagnostic: PhasedDiagnostic) = +type PhasedDiagnostic with - // 'true' for "canSuggestNames" is passed last here because we want to report suggestions in fsc.exe and fsi.exe, just not in regular IDE usage. - let errors = - CollectFormattedDiagnostics(implicitIncludeDir, showFullPaths, flattenErrors, diagnosticStyle, severity, diagnostic, true) + /// used by fsc.exe and fsi.exe, but not by VS + /// prints error and related errors to the specified StringBuilder + member diagnostic.Output(buf, tcConfig: TcConfig, severity) = - for e in errors do - Printf.bprintf os "\n" + // 'true' for "canSuggestNames" is passed last here because we want to report suggestions in fsc.exe and fsi.exe, just not in regular IDE usage. + let diagnostics = CollectFormattedDiagnostics(tcConfig, severity, diagnostic, true) - match e with - | FormattedDiagnostic.Short (_, txt) -> os.AppendString txt |> ignore - | FormattedDiagnostic.Long (_, details) -> - match details.Location with - | Some l when not l.IsEmpty -> os.AppendString l.TextRepresentation - | _ -> () + for e in diagnostics do + Printf.bprintf buf "\n" + + match e with + | FormattedDiagnostic.Short (_, txt) -> buf.AppendString txt |> ignore + | FormattedDiagnostic.Long (_, details) -> + match details.Location with + | Some l when not l.IsEmpty -> buf.AppendString l.TextRepresentation + | _ -> () - os.AppendString details.Canonical.TextRepresentation - os.AppendString details.Message - -let OutputDiagnosticContext prefix fileLineFunction os diagnostic = - match GetRangeOfDiagnostic diagnostic with - | None -> () - | Some m -> - let fileName = m.FileName - let lineA = m.StartLine - let lineB = m.EndLine - let line = fileLineFunction fileName lineA - - if line <> "" then - let iA = m.StartColumn - let iB = m.EndColumn - let iLen = if lineA = lineB then max (iB - iA) 1 else 1 - Printf.bprintf os "%s%s\n" prefix line - Printf.bprintf os "%s%s%s\n" prefix (String.make iA '-') (String.make iLen '^') - -let ReportDiagnosticAsInfo options (diagnostic, severity) = - match severity with - | FSharpDiagnosticSeverity.Error -> false - | FSharpDiagnosticSeverity.Warning -> false - | FSharpDiagnosticSeverity.Info -> - let n = GetDiagnosticNumber diagnostic - - IsWarningOrInfoEnabled (diagnostic, severity) n options.WarnLevel options.WarnOn - && not (List.contains n options.WarnOff) - | FSharpDiagnosticSeverity.Hidden -> false - -let ReportDiagnosticAsWarning options (diagnostic, severity) = - match severity with - | FSharpDiagnosticSeverity.Error -> false - | FSharpDiagnosticSeverity.Warning -> - let n = GetDiagnosticNumber diagnostic - - IsWarningOrInfoEnabled (diagnostic, severity) n options.WarnLevel options.WarnOn - && not (List.contains n options.WarnOff) - // Informational become warning if explicitly on and not explicitly off - | FSharpDiagnosticSeverity.Info -> - let n = GetDiagnosticNumber diagnostic - List.contains n options.WarnOn && not (List.contains n options.WarnOff) - | FSharpDiagnosticSeverity.Hidden -> false - -let ReportDiagnosticAsError options (diagnostic, severity) = - match severity with - | FSharpDiagnosticSeverity.Error -> true - // Warnings become errors in some situations - | FSharpDiagnosticSeverity.Warning -> - let n = GetDiagnosticNumber diagnostic - - IsWarningOrInfoEnabled (diagnostic, severity) n options.WarnLevel options.WarnOn - && not (List.contains n options.WarnAsWarn) - && ((options.GlobalWarnAsError && not (List.contains n options.WarnOff)) - || List.contains n options.WarnAsError) - // Informational become errors if explicitly WarnAsError - | FSharpDiagnosticSeverity.Info -> - let n = GetDiagnosticNumber diagnostic - List.contains n options.WarnAsError - | FSharpDiagnosticSeverity.Hidden -> false + buf.AppendString details.Canonical.TextRepresentation + buf.AppendString details.Message + + member diagnostic.OutputContext(buf, prefix, fileLineFunction) = + match diagnostic.Range with + | None -> () + | Some m -> + let fileName = m.FileName + let lineA = m.StartLine + let lineB = m.EndLine + let line = fileLineFunction fileName lineA + + if line <> "" then + let iA = m.StartColumn + let iB = m.EndColumn + let iLen = if lineA = lineB then max (iB - iA) 1 else 1 + Printf.bprintf buf "%s%s\n" prefix line + Printf.bprintf buf "%s%s%s\n" prefix (String.make iA '-') (String.make iLen '^') + + member diagnostic.WriteWithContext(os, prefix, fileLineFunction, tcConfig, severity) = + writeViaBuffer os (fun buf -> + diagnostic.OutputContext(buf, prefix, fileLineFunction) + diagnostic.Output(buf, tcConfig, severity)) //---------------------------------------------------------------------------- // Scoped #nowarn pragmas @@ -2219,14 +2149,14 @@ type DiagnosticsLoggerFilteringByScopedPragmas ) = inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedPragmas") - override _.DiagnosticSink(diagnostic, severity) = + override _.DiagnosticSink(diagnostic: PhasedDiagnostic, severity) = if severity = FSharpDiagnosticSeverity.Error then diagnosticsLogger.DiagnosticSink(diagnostic, severity) else let report = - let warningNum = GetDiagnosticNumber diagnostic + let warningNum = diagnostic.Number - match GetRangeOfDiagnostic diagnostic with + match diagnostic.Range with | Some m -> scopedPragmas |> List.exists (fun pragma -> @@ -2239,11 +2169,11 @@ type DiagnosticsLoggerFilteringByScopedPragmas | None -> true if report then - if ReportDiagnosticAsError diagnosticOptions (diagnostic, severity) then + if diagnostic.ReportAsError(diagnosticOptions, severity) then diagnosticsLogger.DiagnosticSink(diagnostic, FSharpDiagnosticSeverity.Error) - elif ReportDiagnosticAsWarning diagnosticOptions (diagnostic, severity) then + elif diagnostic.ReportAsWarning(diagnosticOptions, severity) then diagnosticsLogger.DiagnosticSink(diagnostic, FSharpDiagnosticSeverity.Warning) - elif ReportDiagnosticAsInfo diagnosticOptions (diagnostic, severity) then + elif diagnostic.ReportAsInfo(diagnosticOptions, severity) then diagnosticsLogger.DiagnosticSink(diagnostic, severity) override _.ErrorCount = diagnosticsLogger.ErrorCount diff --git a/src/Compiler/Driver/CompilerDiagnostics.fsi b/src/Compiler/Driver/CompilerDiagnostics.fsi index 8f76210f91f..8e0890d4418 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fsi +++ b/src/Compiler/Driver/CompilerDiagnostics.fsi @@ -4,14 +4,14 @@ module internal FSharp.Compiler.CompilerDiagnostics 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 -module internal CompilerService = - val showAssertForUnexpectedException: bool ref +val showAssertForUnexpectedException: bool ref /// For extra diagnostics val mutable showParserStackOnParseError: bool @@ -47,48 +47,51 @@ exception DeprecatedCommandLineOptionNoDescription of string * range /// This exception is an old-style way of reporting a diagnostic exception InternalCommandLineOption of string * range -/// Get the location associated with an error -val GetRangeOfDiagnostic: diagnostic: PhasedDiagnostic -> range option +type PhasedDiagnostic with -/// Get the number associated with an error -val GetDiagnosticNumber: diagnostic: PhasedDiagnostic -> int + /// Get the location associated with a diagnostic + member Range: range option -/// Split errors into a "main" error and a set of associated errors -val SplitRelatedDiagnostics: diagnostic: PhasedDiagnostic -> PhasedDiagnostic * PhasedDiagnostic list + /// Get the number associated with a diagnostic + member Number: int -/// Output an error to a buffer -val OutputPhasedDiagnostic: - os: StringBuilder -> diagnostic: PhasedDiagnostic -> flattenErrors: bool -> suggestNames: bool -> unit + /// Eagerly format a PhasedDiagnostic return as a new PhasedDiagnostic requiring no formatting of types. + member EagerlyFormatCore: suggestNames: bool -> PhasedDiagnostic -/// Output an error or warning to a buffer -val OutputDiagnostic: - implicitIncludeDir: string * - showFullPaths: bool * - flattenErrors: bool * - diagnosticStyle: DiagnosticStyle * - severity: FSharpDiagnosticSeverity -> - StringBuilder -> - PhasedDiagnostic -> - unit + /// Format the core of the diagnostic as a string. Doesn't include the range information. + member FormatCore: flattenErrors: bool * suggestNames: bool -> string -/// Output extra context information for an error or warning to a buffer -val OutputDiagnosticContext: - prefix: string -> fileLineFunction: (string -> int -> string) -> StringBuilder -> PhasedDiagnostic -> unit + /// Indicates if a diagnostic should be reported as an informational + member ReportAsInfo: FSharpDiagnosticOptions * FSharpDiagnosticSeverity -> bool -/// Get an error logger that filters the reporting of warnings based on scoped pragma information -val GetDiagnosticsLoggerFilteringByScopedPragmas: - checkFile: bool * ScopedPragma list * FSharpDiagnosticOptions * DiagnosticsLogger -> DiagnosticsLogger + /// Indicates if a diagnostic should be reported as a warning + member ReportAsWarning: FSharpDiagnosticOptions * FSharpDiagnosticSeverity -> bool -val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string + /// Indicates if a diagnostic should be reported as an error + member ReportAsError: FSharpDiagnosticOptions * FSharpDiagnosticSeverity -> bool -/// Indicates if we should report a diagnostic as a warning -val ReportDiagnosticAsInfo: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool + /// Output all of a diagnostic to a buffer, including range + member Output: buf: StringBuilder * tcConfig: TcConfig * severity: FSharpDiagnosticSeverity -> unit -/// Indicates if we should report a diagnostic as a warning -val ReportDiagnosticAsWarning: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool + /// Write extra context information for a diagnostic + member WriteWithContext: + os: System.IO.TextWriter * + prefix: string * + fileLineFunction: (string -> int -> string) * + tcConfig: TcConfig * + severity: FSharpDiagnosticSeverity -> + unit -/// Indicates if we should report a warning as an error -val ReportDiagnosticAsError: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool +/// Get a diagnostics logger that filters the reporting of warnings based on scoped pragma information +val GetDiagnosticsLoggerFilteringByScopedPragmas: + checkFile: bool * + scopedPragmas: ScopedPragma list * + diagnosticOptions: FSharpDiagnosticOptions * + diagnosticsLogger: DiagnosticsLogger -> + DiagnosticsLogger + +/// Remove 'implicitIncludeDir' from a file name before output +val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string /// Used internally and in LegacyHostedCompilerForTesting [] @@ -120,11 +123,5 @@ type FormattedDiagnostic = /// Used internally and in LegacyHostedCompilerForTesting val CollectFormattedDiagnostics: - implicitIncludeDir: string * - showFullPaths: bool * - flattenErrors: bool * - diagnosticStyle: DiagnosticStyle * - severity: FSharpDiagnosticSeverity * - PhasedDiagnostic * - suggestNames: bool -> + tcConfig: TcConfig * severity: FSharpDiagnosticSeverity * PhasedDiagnostic * suggestNames: bool -> FormattedDiagnostic[] diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 0958224400d..538ccd0817b 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -382,7 +382,7 @@ type TcConfig with member tcConfig.TryResolveLibWithDirectories(r: AssemblyReference) = let m, nm = r.Range, r.Text - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter // See if the language service has already produced the contents of the assembly for us, virtually match r.ProjectReference with @@ -436,7 +436,7 @@ type TcConfig with member tcConfig.ResolveLibWithDirectories(ccuLoadFailureAction, r: AssemblyReference) = let m, nm = r.Range, r.Text - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter let rs = if IsExe nm || IsDLL nm || IsNetModule nm then @@ -504,7 +504,7 @@ type TcConfig with mode: ResolveAssemblyReferenceMode ) : AssemblyResolution list * UnresolvedAssemblyReference list = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter if tcConfig.useSimpleResolution then failwith "MSBuild resolution is not supported." @@ -801,7 +801,7 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, TcAssemblyResolutions.ResolveAssemblyReferences(tcConfig, references, knownUnresolved) static member GetAssemblyResolutionInformation(tcConfig: TcConfig) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter let assemblyList = TcAssemblyResolutions.GetAllDllReferences tcConfig let resolutions = diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 2a950193cc1..090131c2e3c 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -257,7 +257,7 @@ module ResponseFile = Choice2Of2 e let ParseCompilerOptions (collectOtherArgument: string -> unit, blocks: CompilerOptionBlock list, args) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter let specs = List.collect GetOptionsOfBlock blocks @@ -1387,6 +1387,7 @@ let testFlag tcConfigB = | "ShowLoadedAssemblies" -> tcConfigB.showLoadedAssemblies <- true | "ContinueAfterParseFailure" -> tcConfigB.continueAfterParseFailure <- true | "ParallelOff" -> tcConfigB.concurrentBuild <- false + | "ParallelCheckingWithSignatureFilesOn" -> tcConfigB.parallelCheckingWithSignatureFiles <- true #if DEBUG | "ShowParserStackOnParseError" -> showParserStackOnParseError <- true #endif diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 041c13bb493..703e3483f10 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -215,11 +215,6 @@ let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, fileName, intf) SynModuleOrNamespaceSig(lid, isRecursive, kind, decls, xmlDoc, attributes, None, range, trivia) -let GetScopedPragmasForInput input = - match input with - | ParsedInput.SigFile (ParsedSigFileInput (scopedPragmas = pragmas)) -> pragmas - | ParsedInput.ImplFile (ParsedImplFileInput (scopedPragmas = pragmas)) -> pragmas - let GetScopedPragmasForHashDirective hd = [ match hd with @@ -426,8 +421,8 @@ let ParseInput // Delay sending errors and warnings until after the file is parsed. This gives us a chance to scrape the // #nowarn declarations for the file let delayLogger = CapturingDiagnosticsLogger("Parsing") - use unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> delayLogger) - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseDiagnosticsLogger delayLogger + use _ = UseBuildPhase BuildPhase.Parse let mutable scopedPragmas = [] @@ -459,7 +454,7 @@ let ParseInput else error (Error(FSComp.SR.buildInvalidSourceFileExtension fileName, rangeStartup)) - scopedPragmas <- GetScopedPragmasForInput input + scopedPragmas <- input.ScopedPragmas input finally // OK, now commit the errors, since the ScopedPragmas will (hopefully) have been scraped @@ -511,10 +506,8 @@ let ReportParsingStatistics res = let flattenModImpl (SynModuleOrNamespace (decls = decls)) = flattenDefns decls match res with - | ParsedInput.SigFile (ParsedSigFileInput (modules = specs)) -> - printfn "parsing yielded %d specs" (List.collect flattenModSpec specs).Length - | ParsedInput.ImplFile (ParsedImplFileInput (modules = impls)) -> - printfn "parsing yielded %d definitions" (List.collect flattenModImpl impls).Length + | ParsedInput.SigFile sigFile -> printfn "parsing yielded %d specs" (List.collect flattenModSpec sigFile.Contents).Length + | ParsedInput.ImplFile implFile -> printfn "parsing yielded %d definitions" (List.collect flattenModImpl implFile.Contents).Length let EmptyParsedInput (fileName, isLastCompiland) = if FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then @@ -550,7 +543,7 @@ let EmptyParsedInput (fileName, isLastCompiland) = /// Parse an input, drawing tokens from the LexBuffer let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger) = - use unwindbuildphase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use unwindbuildphase = UseBuildPhase BuildPhase.Parse try @@ -734,74 +727,71 @@ let ParseOneInputFile (tcConfig: TcConfig, lexResourceManager, fileName, isLastC errorRecovery exn rangeStartup EmptyParsedInput(fileName, isLastCompiland) -/// Parse multiple input files from disk -let ParseInputFiles - ( - tcConfig: TcConfig, - lexResourceManager, - sourceFiles, - diagnosticsLogger: DiagnosticsLogger, - createDiagnosticsLogger: Exiter -> CapturingDiagnosticsLogger, - retryLocked - ) = +/// Prepare to process inputs independently, e.g. partially in parallel. +/// +/// To do this we create one CapturingDiagnosticLogger for each input and +/// then ensure the diagnostics are presented in deterministic order after processing completes. +/// On completion all diagnostics are forwarded to the DiagnosticLogger given as input. +/// +/// NOTE: Max errors is currently counted separately for each logger. When max errors is reached on one compilation +/// the given Exiter will be called. +/// +/// NOTE: this needs to be improved to commit diagnotics as soon as possible +/// +/// NOTE: If StopProcessing is raised by any piece of work then the overall function raises StopProcessing. +let UseMultipleDiagnosticLoggers (inputs, diagnosticsLogger, eagerFormat) f = + + // Check input files and create delayed error loggers before we try to parallel parse. + let delayLoggers = + inputs + |> List.map (fun _ -> CapturingDiagnosticsLogger("TcDiagnosticsLogger", ?eagerFormat = eagerFormat)) + try - let isLastCompiland, isExe = sourceFiles |> tcConfig.ComputeCanContainEntryPoint - let sourceFiles = isLastCompiland |> List.zip sourceFiles |> Array.ofList + f (List.zip inputs delayLoggers) + finally + for logger in delayLoggers do + logger.CommitDelayedDiagnostics diagnosticsLogger - if tcConfig.concurrentBuild then - let mutable exitCode = 0 +let ParseInputFilesInParallel (tcConfig: TcConfig, lexResourceManager, sourceFiles, delayLogger: DiagnosticsLogger, retryLocked) = - let delayedExiter = - { new Exiter with - member _.Exit n = - exitCode <- n - raise StopProcessing - } + let isLastCompiland, isExe = sourceFiles |> tcConfig.ComputeCanContainEntryPoint - // Check input files and create delayed error loggers before we try to parallel parse. - let delayedDiagnosticsLoggers = - sourceFiles - |> Array.map (fun (fileName, _) -> - checkInputFile tcConfig fileName - createDiagnosticsLogger delayedExiter) - - let results = - try - try - sourceFiles - |> ArrayParallel.mapi (fun i (fileName, isLastCompiland) -> - let delayedDiagnosticsLogger = delayedDiagnosticsLoggers[i] - - let directoryName = Path.GetDirectoryName fileName - - let input = - parseInputFileAux ( - tcConfig, - lexResourceManager, - fileName, - (isLastCompiland, isExe), - delayedDiagnosticsLogger, - retryLocked - ) - - (input, directoryName)) - finally - delayedDiagnosticsLoggers - |> Array.iter (fun delayedDiagnosticsLogger -> delayedDiagnosticsLogger.CommitDelayedDiagnostics diagnosticsLogger) - with StopProcessing -> - tcConfig.exiter.Exit exitCode - - results |> List.ofArray - else - sourceFiles - |> Array.map (fun (fileName, isLastCompiland) -> - let directoryName = Path.GetDirectoryName fileName + for fileName in sourceFiles do + checkInputFile tcConfig fileName + + let sourceFiles = List.zip sourceFiles isLastCompiland + + UseMultipleDiagnosticLoggers (sourceFiles, delayLogger, None) (fun sourceFilesWithDelayLoggers -> + sourceFilesWithDelayLoggers + |> ListParallel.map (fun ((fileName, isLastCompiland), delayLogger) -> + let directoryName = Path.GetDirectoryName fileName - let input = - ParseOneInputFile(tcConfig, lexResourceManager, fileName, (isLastCompiland, isExe), diagnosticsLogger, retryLocked) + let input = + parseInputFileAux (tcConfig, lexResourceManager, fileName, (isLastCompiland, isExe), delayLogger, retryLocked) - (input, directoryName)) - |> List.ofArray + (input, directoryName))) + +let ParseInputFilesSequential (tcConfig: TcConfig, lexResourceManager, sourceFiles, diagnosticsLogger: DiagnosticsLogger, retryLocked) = + let isLastCompiland, isExe = sourceFiles |> tcConfig.ComputeCanContainEntryPoint + let sourceFiles = isLastCompiland |> List.zip sourceFiles |> Array.ofList + + sourceFiles + |> Array.map (fun (fileName, isLastCompiland) -> + let directoryName = Path.GetDirectoryName fileName + + let input = + ParseOneInputFile(tcConfig, lexResourceManager, fileName, (isLastCompiland, isExe), diagnosticsLogger, retryLocked) + + (input, directoryName)) + |> List.ofArray + +/// Parse multiple input files from disk +let ParseInputFiles (tcConfig: TcConfig, lexResourceManager, sourceFiles, diagnosticsLogger: DiagnosticsLogger, retryLocked) = + try + if tcConfig.concurrentBuild then + ParseInputFilesInParallel(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, retryLocked) + else + ParseInputFilesSequential(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, retryLocked) with e -> errorRecoveryNoRange e @@ -814,12 +804,12 @@ let ProcessMetaCommandsFromInput (tcConfig: TcConfigBuilder, inp: ParsedInput, pathOfMetaCommandSource, state0) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseBuildPhase BuildPhase.Parse let canHaveScriptMetaCommands = match inp with | ParsedInput.SigFile _ -> false - | ParsedInput.ImplFile (ParsedImplFileInput (isScript = isScript)) -> isScript + | ParsedInput.ImplFile file -> file.IsScript let ProcessDependencyManagerDirective directive args m state = if not canHaveScriptMetaCommands then @@ -937,13 +927,13 @@ let ProcessMetaCommandsFromInput decls match inp with - | ParsedInput.SigFile (ParsedSigFileInput (hashDirectives = hashDirectives; modules = specs)) -> - let state = List.fold ProcessMetaCommand state0 hashDirectives - let state = List.fold ProcessMetaCommandsFromModuleSpec state specs + | ParsedInput.SigFile sigFile -> + let state = List.fold ProcessMetaCommand state0 sigFile.HashDirectives + let state = List.fold ProcessMetaCommandsFromModuleSpec state sigFile.Contents state - | ParsedInput.ImplFile (ParsedImplFileInput (hashDirectives = hashDirectives; modules = impls)) -> - let state = List.fold ProcessMetaCommand state0 hashDirectives - let state = List.fold ProcessMetaCommandsFromModuleImpl state impls + | ParsedInput.ImplFile implFile -> + let state = List.fold ProcessMetaCommand state0 implFile.HashDirectives + let state = List.fold ProcessMetaCommandsFromModuleImpl state implFile.Contents state let ApplyNoWarnsToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource) = @@ -1033,22 +1023,34 @@ let qnameOrder = Order.orderBy (fun (q: QualifiedNameOfFile) -> q.Text) type TcState = { + /// The assembly thunk for the assembly being compiled. tcsCcu: CcuThunk - tcsCcuType: ModuleOrNamespace - tcsNiceNameGen: NiceNameGenerator + + /// The typing environment implied by the set of signature files and/or inferred signatures of implementation files checked so far tcsTcSigEnv: TcEnv + + /// The typing environment implied by the set of implementation files checked so far tcsTcImplEnv: TcEnv + + /// Indicates if any implementation file so far includes use of generative provided types tcsCreatesGeneratedProvidedTypes: bool + + /// A table of signature files processed so far, indexed by QualifiedNameOfFile, to help give better diagnostics + /// if there are mismatches in module names between signature and implementation files with the same name. tcsRootSigs: RootSigs + + /// A table of implementation files processed so far, indexed by QualifiedNameOfFile, to help give better diagnostics + /// if there are mismatches in module names between signature and implementation files with the same name. tcsRootImpls: RootImpls + + /// The combined partial assembly signature resulting from all the signatures and/or inferred signatures of implementation files + /// so far. tcsCcuSig: ModuleOrNamespaceType - /// The collected open declarations implied by '/checked' flag and processing F# interactive fragments that have an implied module. + /// The collected implicit open declarations implied by '/checked' flag and processing F# interactive fragments that have an implied module. tcsImplicitOpenDeclarations: OpenDeclaration list } - member x.NiceNameGenerator = x.tcsNiceNameGen - member x.TcEnvFromSignatures = x.tcsTcSigEnv member x.TcEnvFromImpls = x.tcsTcImplEnv @@ -1057,9 +1059,6 @@ type TcState = member x.CreatesGeneratedProvidedTypes = x.tcsCreatesGeneratedProvidedTypes - // Assem(a.fsi + b.fsi + c.fsi) (after checking implementation file ) - member x.CcuType = x.tcsCcuType - // a.fsi + b.fsi + c.fsi (after checking implementation file for c.fs) member x.CcuSig = x.tcsCcuSig @@ -1070,7 +1069,7 @@ type TcState = } /// Create the initial type checking state for compiling an assembly -let GetInitialTcState (m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcImports, niceNameGen, tcEnv0, openDecls0) = +let GetInitialTcState (m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcImports, tcEnv0, openDecls0) = ignore tcImports // Create a ccu to hold all the results of compilation @@ -1106,8 +1105,6 @@ let GetInitialTcState (m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcI { tcsCcu = ccu - tcsCcuType = ccuContents - tcsNiceNameGen = niceNameGen tcsTcSigEnv = tcEnv0 tcsTcImplEnv = tcEnv0 tcsCreatesGeneratedProvidedTypes = false @@ -1119,10 +1116,77 @@ let GetInitialTcState (m, ccuName, tcConfig: TcConfig, tcGlobals, tcImports: TcI /// Dummy typed impl file that contains no definitions and is not used for emitting any kind of assembly. let CreateEmptyDummyImplFile qualNameOfFile sigTy = - CheckedImplFile.CheckedImplFile(qualNameOfFile, [], sigTy, ModuleOrNamespaceContents.TMDefs [], false, false, StampMap [], Map.empty) + CheckedImplFile(qualNameOfFile, [], sigTy, ModuleOrNamespaceContents.TMDefs [], false, false, StampMap [], Map.empty) + +let AddCheckResultsToTcState + (tcGlobals, amap, hadSig, prefixPathOpt, tcSink, tcImplEnv, qualNameOfFile, implFileSigType) + (tcState: TcState) + = + + let rootImpls = Zset.add qualNameOfFile tcState.tcsRootImpls + + // Only add it to the environment if it didn't have a signature + let m = qualNameOfFile.Range + + // Add the implementation as to the implementation env + let tcImplEnv = + AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcImplEnv implFileSigType + + // Add the implementation as to the signature env (unless it had an explicit signature) + let tcSigEnv = + if hadSig then + tcState.tcsTcSigEnv + else + AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv implFileSigType + + // Open the prefixPath for fsi.exe (tcImplEnv) + let tcImplEnv, openDecls = + match prefixPathOpt with + | Some prefixPath -> TcOpenModuleOrNamespaceDecl tcSink tcGlobals amap m tcImplEnv (prefixPath, m) + | _ -> tcImplEnv, [] + + // Open the prefixPath for fsi.exe (tcSigEnv) + let tcSigEnv, _ = + match prefixPathOpt with + | Some prefixPath when not hadSig -> TcOpenModuleOrNamespaceDecl tcSink tcGlobals amap m tcSigEnv (prefixPath, m) + | _ -> tcSigEnv, [] + + let ccuSigForFile = + CombineCcuContentFragments [ implFileSigType; tcState.tcsCcuSig ] + + let tcState = + { tcState with + tcsTcSigEnv = tcSigEnv + tcsTcImplEnv = tcImplEnv + tcsRootImpls = rootImpls + tcsCcuSig = ccuSigForFile + tcsImplicitOpenDeclarations = tcState.tcsImplicitOpenDeclarations @ openDecls + } + + ccuSigForFile, tcState + +let AddDummyCheckResultsToTcState + ( + tcGlobals, + amap, + qualName: QualifiedNameOfFile, + prefixPathOpt, + tcSink, + tcState: TcState, + tcStateForImplFile: TcState, + rootSig + ) = + let hadSig = true + let emptyImplFile = CreateEmptyDummyImplFile qualName rootSig + let tcEnvAtEnd = tcStateForImplFile.TcEnvFromImpls + + let ccuSigForFile, tcState = + AddCheckResultsToTcState (tcGlobals, amap, hadSig, prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualName, rootSig) tcState + + (tcEnvAtEnd, EmptyTopAttrs, Some emptyImplFile, ccuSigForFile), tcState /// Typecheck a single file (or interactive entry into F# Interactive) -let CheckOneInput +let CheckOneInputAux ( checkForErrors, tcConfig: TcConfig, @@ -1143,7 +1207,9 @@ let CheckOneInput let amap = tcImports.GetImportMap() match inp with - | ParsedInput.SigFile (ParsedSigFileInput (qualifiedNameOfFile = qualNameOfFile) as file) -> + | ParsedInput.SigFile file -> + + let qualNameOfFile = file.QualifiedName // Check if we've seen this top module signature before. if Zmap.mem qualNameOfFile tcState.tcsRootSigs then @@ -1163,7 +1229,6 @@ let CheckOneInput let! tcEnv, sigFileType, createsGeneratedProvidedTypes = CheckOneSigFile (tcGlobals, - tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, @@ -1176,7 +1241,7 @@ let CheckOneInput let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs // Add the signature to the signature env (unless it had an explicit signature) - let ccuSigForFile = CombineCcuContentFragments m [ sigFileType; tcState.tcsCcuSig ] + let ccuSigForFile = CombineCcuContentFragments [ sigFileType; tcState.tcsCcuSig ] // Open the prefixPath for fsi.exe let tcEnv, _openDecls1 = @@ -1194,9 +1259,10 @@ let CheckOneInput tcsCreatesGeneratedProvidedTypes = tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes } - return (tcEnv, EmptyTopAttrs, None, ccuSigForFile), tcState + return Choice1Of2(tcEnv, EmptyTopAttrs, None, ccuSigForFile), tcState - | ParsedInput.ImplFile (ParsedImplFileInput (qualifiedNameOfFile = qualNameOfFile) as file) -> + | ParsedInput.ImplFile file -> + let qualNameOfFile = file.QualifiedName // Check if we've got an interface for this fragment let rootSigOpt = tcState.tcsRootSigs.TryFind qualNameOfFile @@ -1205,8 +1271,6 @@ let CheckOneInput if Zset.contains qualNameOfFile tcState.tcsRootImpls then errorR (Error(FSComp.SR.buildImplementationAlreadyGiven (qualNameOfFile.Text), m)) - let tcImplEnv = tcState.tcsTcImplEnv - let conditionalDefines = if tcConfig.noConditionalErasure then None @@ -1215,15 +1279,30 @@ let CheckOneInput let hadSig = rootSigOpt.IsSome - // Typecheck the implementation file - let typeCheckOne = - if skipImplIfSigExists && hadSig then - (EmptyTopAttrs, CreateEmptyDummyImplFile qualNameOfFile rootSigOpt.Value, Unchecked.defaultof<_>, tcImplEnv, false) - |> cancellable.Return - else + match rootSigOpt with + | Some rootSig when skipImplIfSigExists -> + // Delay the typecheck the implementation file until the second phase of parallel processing. + // Adjust the TcState as if it has been checked, which makes the signature for the file available later + // in the compilation order. + let tcStateForImplFile = tcState + let qualNameOfFile = file.QualifiedName + let priorErrors = checkForErrors () + + let ccuSigForFile, tcState = + AddCheckResultsToTcState + (tcGlobals, amap, hadSig, prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualNameOfFile, rootSig) + tcState + + let partialResult = + (amap, conditionalDefines, rootSig, priorErrors, file, tcStateForImplFile, ccuSigForFile) + + return Choice2Of2 partialResult, tcState + + | _ -> + // Typecheck the implementation file + let! topAttrs, implFile, tcEnvAtEnd, createsGeneratedProvidedTypes = CheckOneImplFile( tcGlobals, - tcState.tcsNiceNameGen, amap, tcState.tcsCcu, tcState.tcsImplicitOpenDeclarations, @@ -1231,75 +1310,78 @@ let CheckOneInput conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring, - tcImplEnv, + tcState.tcsTcImplEnv, rootSigOpt, file ) - let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = typeCheckOne - - let implFileSigType = implFile.Signature - - let rootImpls = Zset.add qualNameOfFile tcState.tcsRootImpls - - // Only add it to the environment if it didn't have a signature - let m = qualNameOfFile.Range - - // Add the implementation as to the implementation env - let tcImplEnv = - AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcImplEnv implFileSigType - - // Add the implementation as to the signature env (unless it had an explicit signature) - let tcSigEnv = - if hadSig then - tcState.tcsTcSigEnv - else - AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv implFileSigType - - // Open the prefixPath for fsi.exe (tcImplEnv) - let tcImplEnv, openDecls = - match prefixPathOpt with - | Some prefixPath -> TcOpenModuleOrNamespaceDecl tcSink tcGlobals amap m tcImplEnv (prefixPath, m) - | _ -> tcImplEnv, [] + let tcState = + { tcState with + tcsCreatesGeneratedProvidedTypes = tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes + } - // Open the prefixPath for fsi.exe (tcSigEnv) - let tcSigEnv, _ = - match prefixPathOpt with - | Some prefixPath when not hadSig -> TcOpenModuleOrNamespaceDecl tcSink tcGlobals amap m tcSigEnv (prefixPath, m) - | _ -> tcSigEnv, [] + let ccuSigForFile, tcState = + AddCheckResultsToTcState + (tcGlobals, amap, hadSig, prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualNameOfFile, implFile.Signature) + tcState - let ccuSigForFile = - CombineCcuContentFragments m [ implFileSigType; tcState.tcsCcuSig ] - - let tcState = - { tcState with - tcsTcSigEnv = tcSigEnv - tcsTcImplEnv = tcImplEnv - tcsRootImpls = rootImpls - tcsCcuSig = ccuSigForFile - tcsCreatesGeneratedProvidedTypes = tcState.tcsCreatesGeneratedProvidedTypes || createsGeneratedProvidedTypes - tcsImplicitOpenDeclarations = tcState.tcsImplicitOpenDeclarations @ openDecls - } - - return (tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile), tcState + let result = (tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile) + return Choice1Of2 result, tcState with e -> errorRecovery e range0 - return (tcState.TcEnvFromSignatures, EmptyTopAttrs, None, tcState.tcsCcuSig), tcState + return Choice1Of2(tcState.TcEnvFromSignatures, EmptyTopAttrs, None, tcState.tcsCcuSig), tcState } +/// Typecheck a single file (or interactive entry into F# Interactive). If skipImplIfSigExists is set to true +/// then implementations with signature files give empty results. +let CheckOneInput + ( + checkForErrors, + tcConfig: TcConfig, + tcImports: TcImports, + tcGlobals, + prefixPathOpt, + tcSink, + tcState: TcState, + input: ParsedInput, + skipImplIfSigExists: bool + ) = + cancellable { + let! partialResult, tcState = + CheckOneInputAux(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input, skipImplIfSigExists) + + match partialResult with + | Choice1Of2 result -> return result, tcState + | Choice2Of2 (amap, _conditionalDefines, rootSig, _priorErrors, file, tcStateForImplFile, _ccuSigForFile) -> + return + AddDummyCheckResultsToTcState( + tcGlobals, + amap, + file.QualifiedName, + prefixPathOpt, + tcSink, + tcState, + tcStateForImplFile, + rootSig + ) + } + +// Within a file, equip loggers to locally filter w.r.t. scope pragmas in each input +let DiagnosticsLoggerForInput (tcConfig: TcConfig, input: ParsedInput, oldLogger) = + GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, oldLogger) + /// Typecheck a single file (or interactive entry into F# Interactive) -let TypeCheckOneInputEntry (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt) tcState inp = - // 'use' ensures that the warning handler is restored at the end - use unwindEL = - PushDiagnosticsLoggerPhaseUntilUnwind(fun oldLogger -> - GetDiagnosticsLoggerFilteringByScopedPragmas(false, GetScopedPragmasForInput inp, tcConfig.diagnosticsOptions, oldLogger)) +let CheckOneInputEntry (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, skipImplIfSigExists) tcState input = + // Equip loggers to locally filter w.r.t. scope pragmas in each input + use _ = + UseTransformedDiagnosticsLogger(fun oldLogger -> DiagnosticsLoggerForInput(tcConfig, input, oldLogger)) - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + use _ = UseBuildPhase BuildPhase.TypeCheck RequireCompilationThread ctok - CheckOneInput(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, TcResultsSink.NoSink, tcState, inp, false) + CheckOneInput(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, TcResultsSink.NoSink, tcState, input, skipImplIfSigExists) |> Cancellable.runWithoutCancellation /// Finish checking multiple files (or one interactive entry into F# Interactive) @@ -1318,10 +1400,10 @@ let CheckMultipleInputsFinish (results, tcState: TcState) = let CheckOneInputAndFinish (checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input) = cancellable { Logger.LogBlockStart LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually - let! results, tcState = CheckOneInput(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input, false) - let result = CheckMultipleInputsFinish([ results ], tcState) + let! result, tcState = CheckOneInput(checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcSink, tcState, input, false) + let finishedResult = CheckMultipleInputsFinish([ result ], tcState) Logger.LogBlockStop LogCompilerFunctionId.CompileOps_TypeCheckOneInputAndFinishEventually - return result + return finishedResult } let CheckClosedInputSetFinish (declaredImpls: CheckedImplFile list, tcState) = @@ -1337,11 +1419,129 @@ let CheckClosedInputSetFinish (declaredImpls: CheckedImplFile list, tcState) = tcState, declaredImpls, ccuContents -let CheckClosedInputSet (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs) = +let CheckMultipleInputsSequential (ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs) = + (tcState, inputs) + ||> List.mapFold (CheckOneInputEntry(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, false)) + +/// Use parallel checking of implementation files that have signature files +let CheckMultipleInputsInParallel + ( + ctok, + checkForErrors, + tcConfig: TcConfig, + tcImports, + tcGlobals, + prefixPathOpt, + tcState, + eagerFormat, + inputs + ) = + + let diagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger + + // We create one CapturingDiagnosticLogger for each file we are processing and + // ensure the diagnostics are presented in deterministic order. + // + // eagerFormat is used to format diagnostics as they are emitted, just as they would be in the command-line + // compiler. This is necessary because some formatting of diagnostics is dependent on the + // type inference state at precisely the time the diagnostic is emitted. + UseMultipleDiagnosticLoggers (inputs, diagnosticsLogger, Some eagerFormat) (fun inputsWithLoggers -> + + // Equip loggers to locally filter w.r.t. scope pragmas in each input + let inputsWithLoggers = + inputsWithLoggers + |> List.map (fun (input, oldLogger) -> + let logger = DiagnosticsLoggerForInput(tcConfig, input, oldLogger) + input, logger) + + // In the first linear part of parallel checking, we use a 'checkForErrors' that checks either for errors + // somewhere in the files processed prior to each one, or in the processing of this particular file. + let priorErrors = checkForErrors () + + // Do the first linear phase, checking all signatures and any implementation files that don't have a signature. + // Implementation files that do have a signature will result in a Choice2Of2 indicating to next do some of the + // checking in parallel. + let partialResults, (tcState, _) = + ((tcState, priorErrors), inputsWithLoggers) + ||> List.mapFold (fun (tcState, priorErrors) (input, logger) -> + use _ = UseDiagnosticsLogger logger + + let checkForErrors2 () = priorErrors || (logger.ErrorCount > 0) + + let partialResult, tcState = + CheckOneInputAux( + checkForErrors2, + tcConfig, + tcImports, + tcGlobals, + prefixPathOpt, + TcResultsSink.NoSink, + tcState, + input, + true + ) + |> Cancellable.runWithoutCancellation + + let priorErrors = checkForErrors2 () + partialResult, (tcState, priorErrors)) + + // Do the parallel phase, checking all implementation files that did have a signature, in parallel. + let results, createsGeneratedProvidedTypesFlags = + + List.zip partialResults inputsWithLoggers + |> List.toArray + |> ArrayParallel.map (fun (partialResult, (_, logger)) -> + use _ = UseDiagnosticsLogger logger + use _ = UseBuildPhase BuildPhase.TypeCheck + + RequireCompilationThread ctok + + match partialResult with + | Choice1Of2 result -> result, false + | Choice2Of2 (amap, conditionalDefines, rootSig, priorErrors, file, tcStateForImplFile, ccuSigForFile) -> + + // In the first linear part of parallel checking, we use a 'checkForErrors' that checks either for errors + // somewhere in the files processed prior to this one, including from the first phase, or in the processing + // of this particular file. + let checkForErrors2 () = priorErrors || (logger.ErrorCount > 0) + + let topAttrs, implFile, tcEnvAtEnd, createsGeneratedProvidedTypes = + CheckOneImplFile( + tcGlobals, + amap, + tcStateForImplFile.tcsCcu, + tcStateForImplFile.tcsImplicitOpenDeclarations, + checkForErrors2, + conditionalDefines, + TcResultsSink.NoSink, + tcConfig.internalTestSpanStackReferring, + tcStateForImplFile.tcsTcImplEnv, + Some rootSig, + file + ) + |> Cancellable.runWithoutCancellation + + let result = (tcEnvAtEnd, topAttrs, Some implFile, ccuSigForFile) + result, createsGeneratedProvidedTypes) + |> Array.toList + |> List.unzip + + let tcState = + { tcState with + tcsCreatesGeneratedProvidedTypes = + tcState.tcsCreatesGeneratedProvidedTypes + || (createsGeneratedProvidedTypesFlags |> List.exists id) + } + + results, tcState) + +let CheckClosedInputSet (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs) = // tcEnvAtEndOfLastFile is the environment required by fsi.exe when incrementally adding definitions let results, tcState = - (tcState, inputs) - ||> List.mapFold (TypeCheckOneInputEntry(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt)) + if tcConfig.parallelCheckingWithSignatureFiles then + CheckMultipleInputsInParallel(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs) + else + CheckMultipleInputsSequential(ctok, checkForErrors, tcConfig, tcImports, tcGlobals, prefixPathOpt, tcState, inputs) let (tcEnvAtEndOfLastFile, topAttrs, implFiles, _), tcState = CheckMultipleInputsFinish(results, tcState) diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index b0213532030..166191d363e 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -54,8 +54,6 @@ val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * Depe /// Process the #nowarn in an input and integrate them into the TcConfig val ApplyNoWarnsToTcConfig: TcConfig * ParsedInput * string -> TcConfig -val GetScopedPragmasForInput: input: ParsedInput -> ScopedPragma list - /// Parse one input stream val ParseOneInputStream: tcConfig: TcConfig * @@ -104,7 +102,6 @@ val ParseInputFiles: lexResourceManager: Lexhelp.LexResourceManager * sourceFiles: string list * diagnosticsLogger: DiagnosticsLogger * - createDiagnosticsLogger: (Exiter -> CapturingDiagnosticsLogger) * retryLocked: bool -> (ParsedInput * string) list @@ -115,7 +112,6 @@ val GetInitialTcEnv: assemblyName: string * range * TcConfig * TcImports * TcGlo /// Represents the incremental type checking state for a set of inputs [] type TcState = - member NiceNameGenerator: NiceNameGenerator /// The CcuThunk for the current assembly being checked member Ccu: CcuThunk @@ -135,19 +131,18 @@ type TcState = member CreatesGeneratedProvidedTypes: bool /// Get the initial type checking state for a set of inputs -val GetInitialTcState: - range * string * TcConfig * TcGlobals * TcImports * NiceNameGenerator * TcEnv * OpenDeclaration list -> TcState +val GetInitialTcState: range * string * TcConfig * TcGlobals * TcImports * TcEnv * OpenDeclaration list -> TcState /// Check one input, returned as an Eventually computation val CheckOneInput: checkForErrors: (unit -> bool) * - TcConfig * - TcImports * - TcGlobals * - LongIdent option * - NameResolution.TcResultsSink * - TcState * - ParsedInput * + tcConfig: TcConfig * + tcImports: TcImports * + tcGlobals: TcGlobals * + prefixPathOpt: LongIdent option * + tcSink: NameResolution.TcResultsSink * + tcState: TcState * + input: ParsedInput * skipImplIfSigExists: bool -> Cancellable<(TcEnv * TopAttribs * CheckedImplFile option * ModuleOrNamespaceType) * TcState> @@ -160,24 +155,25 @@ val CheckClosedInputSetFinish: CheckedImplFile list * TcState -> TcState * Check /// Check a closed set of inputs val CheckClosedInputSet: - CompilationThreadToken * + ctok: CompilationThreadToken * checkForErrors: (unit -> bool) * - TcConfig * - TcImports * - TcGlobals * - LongIdent option * - TcState * - ParsedInput list -> + tcConfig: TcConfig * + tcImports: TcImports * + tcGlobals: TcGlobals * + prefixPathOpt: LongIdent option * + tcState: TcState * + eagerFormat: (PhasedDiagnostic -> PhasedDiagnostic) * + inputs: ParsedInput list -> TcState * TopAttribs * CheckedImplFile list * TcEnv /// Check a single input and finish the checking val CheckOneInputAndFinish: checkForErrors: (unit -> bool) * - TcConfig * - TcImports * - TcGlobals * - LongIdent option * - NameResolution.TcResultsSink * - TcState * - ParsedInput -> + tcConfig: TcConfig * + tcImports: TcImports * + tcGlobals: TcGlobals * + prefixPathOpt: LongIdent option * + tcSink: NameResolution.TcResultsSink * + tcState: TcState * + input: ParsedInput -> Cancellable<(TcEnv * TopAttribs * CheckedImplFile list * ModuleOrNamespaceType list) * TcState> diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 868a9f80cae..74a4c083a7d 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -196,7 +196,7 @@ module ScriptPreprocessClosure = match basicReferences with | None -> let diagnosticsLogger = CapturingDiagnosticsLogger("ScriptDefaultReferences") - use unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseDiagnosticsLogger diagnosticsLogger let references, useDotNetFramework = tcConfigB.FxResolver.GetDefaultReferences useFsiAuxLib @@ -451,7 +451,7 @@ module ScriptPreprocessClosure = if IsScript fileName || parseRequired then let parseResult, parseDiagnostics = let diagnosticsLogger = CapturingDiagnosticsLogger("FindClosureParse") - use _unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseDiagnosticsLogger diagnosticsLogger let result = ParseScriptClosureInput(fileName, sourceText, tcConfig, codeContext, lexResourceManager, diagnosticsLogger) @@ -459,7 +459,7 @@ module ScriptPreprocessClosure = result, diagnosticsLogger.Diagnostics let diagnosticsLogger = CapturingDiagnosticsLogger("FindClosureMetaCommands") - use _unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseDiagnosticsLogger diagnosticsLogger let pathOfMetaCommandSource = Path.GetDirectoryName fileName let preSources = tcConfig.GetAvailableLoadedSources() @@ -569,7 +569,7 @@ module ScriptPreprocessClosure = let references, unresolvedReferences, resolutionDiagnostics = let diagnosticsLogger = CapturingDiagnosticsLogger("GetLoadClosure") - use unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseDiagnosticsLogger diagnosticsLogger let references, unresolvedReferences = TcAssemblyResolutions.GetAssemblyResolutionInformation(tcConfig) @@ -585,8 +585,8 @@ module ScriptPreprocessClosure = (parseDiagnostics @ earlierDiagnostics @ metaDiagnostics @ resolutionDiagnostics) | _ -> [], [] // When no file existed. - let isRootRange exn = - match GetRangeOfDiagnostic exn with + let isRootRange (diagnostic: PhasedDiagnostic) = + match diagnostic.Range with | Some m -> // Return true if the error was *not* from a #load-ed file. let isArgParameterWhileNotEditing = @@ -745,7 +745,7 @@ type LoadClosure with dependencyProvider ) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseBuildPhase BuildPhase.Parse ScriptPreprocessClosure.GetFullClosureOfScriptText( legacyReferenceResolver, @@ -775,5 +775,5 @@ type LoadClosure with dependencyProvider ) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseBuildPhase BuildPhase.Parse ScriptPreprocessClosure.GetFullClosureOfScriptFiles(tcConfig, files, implicitDefines, lexResourceManager, dependencyProvider) diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index fcf8578d2a9..7b8e968814f 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -68,7 +68,7 @@ type DiagnosticsLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, let mutable errors = 0 /// Called when an error or warning occurs - abstract HandleIssue: tcConfigB: TcConfigBuilder * diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit + abstract HandleIssue: tcConfig: TcConfig * diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit /// Called when 'too many errors' has occurred abstract HandleTooManyErrors: text: string -> unit @@ -76,12 +76,14 @@ type DiagnosticsLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, override _.ErrorCount = errors override x.DiagnosticSink(diagnostic, severity) = - if ReportDiagnosticAsError tcConfigB.diagnosticsOptions (diagnostic, severity) then - if errors >= tcConfigB.maxErrors then + let tcConfig = TcConfig.Create(tcConfigB, validate = false) + + if diagnostic.ReportAsError(tcConfig.diagnosticsOptions, severity) then + if errors >= tcConfig.maxErrors then x.HandleTooManyErrors(FSComp.SR.fscTooManyErrors ()) exiter.Exit 1 - x.HandleIssue(tcConfigB, diagnostic, FSharpDiagnosticSeverity.Error) + x.HandleIssue(tcConfig, diagnostic, FSharpDiagnosticSeverity.Error) errors <- errors + 1 @@ -92,60 +94,47 @@ type DiagnosticsLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, Debug.Assert(false, sprintf "Lookup exception in compiler: %s" (diagnostic.Exception.ToString())) | _ -> () - elif ReportDiagnosticAsWarning tcConfigB.diagnosticsOptions (diagnostic, severity) then - x.HandleIssue(tcConfigB, diagnostic, FSharpDiagnosticSeverity.Warning) + elif diagnostic.ReportAsWarning(tcConfig.diagnosticsOptions, severity) then + x.HandleIssue(tcConfig, diagnostic, FSharpDiagnosticSeverity.Warning) - elif ReportDiagnosticAsInfo tcConfigB.diagnosticsOptions (diagnostic, severity) then - x.HandleIssue(tcConfigB, diagnostic, severity) + elif diagnostic.ReportAsInfo(tcConfig.diagnosticsOptions, severity) then + x.HandleIssue(tcConfig, diagnostic, severity) /// Create an error logger that counts and prints errors -let ConsoleDiagnosticsLoggerUpToMaxErrors (tcConfigB: TcConfigBuilder, exiter: Exiter) = - { new DiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter, "ConsoleDiagnosticsLoggerUpToMaxErrors") with +let ConsoleDiagnosticsLogger (tcConfigB: TcConfigBuilder, exiter: Exiter) = + { new DiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter, "ConsoleDiagnosticsLogger") with member _.HandleTooManyErrors(text: string) = DoWithDiagnosticColor FSharpDiagnosticSeverity.Warning (fun () -> Printf.eprintfn "%s" text) - member _.HandleIssue(tcConfigB, err, severity) = + member _.HandleIssue(tcConfig, diagnostic, severity) = DoWithDiagnosticColor severity (fun () -> - let diagnostic = - OutputDiagnostic( - tcConfigB.implicitIncludeDir, - tcConfigB.showFullPaths, - tcConfigB.flatErrors, - tcConfigB.diagnosticStyle, - severity - ) - - writeViaBuffer stderr diagnostic err + writeViaBuffer stderr (fun buf -> diagnostic.Output(buf, tcConfig, severity)) stderr.WriteLine()) } :> DiagnosticsLogger -/// This error logger delays the messages it receives. At the end, call ForwardDelayedDiagnostics -/// to send the held messages. -type DelayAndForwardDiagnosticsLogger(exiter: Exiter, diagnosticsLoggerProvider: DiagnosticsLoggerProvider) = - inherit CapturingDiagnosticsLogger("DelayAndForwardDiagnosticsLogger") - - member x.ForwardDelayedDiagnostics(tcConfigB: TcConfigBuilder) = - let diagnosticsLogger = - diagnosticsLoggerProvider.CreateDiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter) - - x.CommitDelayedDiagnostics diagnosticsLogger +/// DiagnosticLoggers can be sensitive to the TcConfig flags. During the checking +/// of the flags themselves we have to create temporary loggers, until the full configuration is +/// available. +type IDiagnosticsLoggerProvider = -and [] DiagnosticsLoggerProvider() = + abstract CreateLogger: tcConfigB: TcConfigBuilder * exiter: Exiter -> DiagnosticsLogger - member this.CreateDelayAndForwardLogger exiter = - DelayAndForwardDiagnosticsLogger(exiter, this) +type CapturingDiagnosticsLogger with - abstract CreateDiagnosticsLoggerUpToMaxErrors: tcConfigBuilder: TcConfigBuilder * exiter: Exiter -> DiagnosticsLogger + /// Commit the delayed diagnostics via a fresh temporary logger of the right kind. + member x.CommitDelayedDiagnostics(diagnosticsLoggerProvider: IDiagnosticsLoggerProvider, tcConfigB, exiter) = + let diagnosticsLogger = diagnosticsLoggerProvider.CreateLogger(tcConfigB, exiter) + x.CommitDelayedDiagnostics diagnosticsLogger /// The default DiagnosticsLogger implementation, reporting messages to the Console up to the maxerrors maximum type ConsoleLoggerProvider() = - inherit DiagnosticsLoggerProvider() + interface IDiagnosticsLoggerProvider with - override _.CreateDiagnosticsLoggerUpToMaxErrors(tcConfigBuilder, exiter) = - ConsoleDiagnosticsLoggerUpToMaxErrors(tcConfigBuilder, exiter) + member _.CreateLogger(tcConfigB, exiter) = + ConsoleDiagnosticsLogger(tcConfigB, exiter) /// Notify the exiter if any error has occurred let AbortOnError (diagnosticsLogger: DiagnosticsLogger, exiter: Exiter) = @@ -160,7 +149,6 @@ let TypeCheck tcGlobals, diagnosticsLogger: DiagnosticsLogger, assemblyName, - niceNameGen, tcEnv0, openDecls0, inputs, @@ -173,16 +161,19 @@ let TypeCheck let ccuName = assemblyName let tcInitialState = - GetInitialTcState(rangeStartup, ccuName, tcConfig, tcGlobals, tcImports, niceNameGen, tcEnv0, openDecls0) + GetInitialTcState(rangeStartup, ccuName, tcConfig, tcGlobals, tcImports, tcEnv0, openDecls0) + + let eagerFormat (diag: PhasedDiagnostic) = diag.EagerlyFormatCore true CheckClosedInputSet( ctok, - (fun () -> diagnosticsLogger.ErrorCount > 0), + diagnosticsLogger.CheckForErrors, tcConfig, tcImports, tcGlobals, None, tcInitialState, + eagerFormat, inputs ) with exn -> @@ -339,12 +330,12 @@ module InterfaceFileWriter = } let writeToFile os (CheckedImplFile (contents = mexpr)) = - writeViaBuffer - os - (fun os s -> Printf.bprintf os "%s\n\n" s) - (NicePrint.layoutImpliedSignatureOfModuleOrNamespace true denv infoReader AccessibleFromSomewhere range0 mexpr - |> Display.squashTo 80 - |> LayoutRender.showL) + let text = + NicePrint.layoutImpliedSignatureOfModuleOrNamespace true denv infoReader AccessibleFromSomewhere range0 mexpr + |> Display.squashTo 80 + |> LayoutRender.showL + + Printf.fprintf os "%s\n\n" text let writeHeader filePath os = if @@ -471,7 +462,7 @@ let main1 reduceMemoryUsage: ReduceMemoryFlag, defaultCopyFSharpCore: CopyFSharpCoreFlag, exiter: Exiter, - diagnosticsLoggerProvider: DiagnosticsLoggerProvider, + diagnosticsLoggerProvider: IDiagnosticsLoggerProvider, disposables: DisposablesTracker ) = @@ -518,11 +509,9 @@ let main1 SetTailcallSwitch tcConfigB OptionSwitch.On // Now install a delayed logger to hold all errors from flags until after all flags have been parsed (for example, --vserrors) - let delayForFlagsLogger = - diagnosticsLoggerProvider.CreateDelayAndForwardLogger exiter + let delayForFlagsLogger = CapturingDiagnosticsLogger("DelayFlagsLogger") - let _unwindEL_1 = - PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> delayForFlagsLogger) + let _holder = UseDiagnosticsLogger delayForFlagsLogger // Share intern'd strings across all lexing/parsing let lexResourceManager = Lexhelp.LexResourceManager() @@ -539,7 +528,7 @@ let main1 AdjustForScriptCompile(tcConfigB, files, lexResourceManager, dependencyProvider) with e -> errorRecovery e rangeStartup - delayForFlagsLogger.ForwardDelayedDiagnostics tcConfigB + delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines @@ -554,12 +543,12 @@ let main1 tcConfigB.DecideNames sourceFiles with e -> errorRecovery e rangeStartup - delayForFlagsLogger.ForwardDelayedDiagnostics tcConfigB + delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 // DecideNames may give "no inputs" error. Abort on error at this point. bug://3911 if not tcConfigB.continueAfterParseFailure && delayForFlagsLogger.ErrorCount > 0 then - delayForFlagsLogger.ForwardDelayedDiagnostics tcConfigB + delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 // If there's a problem building TcConfig, abort @@ -568,14 +557,13 @@ let main1 TcConfig.Create(tcConfigB, validate = false) with e -> errorRecovery e rangeStartup - delayForFlagsLogger.ForwardDelayedDiagnostics tcConfigB + delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 - let diagnosticsLogger = - diagnosticsLoggerProvider.CreateDiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter) + let diagnosticsLogger = diagnosticsLoggerProvider.CreateLogger(tcConfigB, exiter) // Install the global error logger and never remove it. This logger does have all command-line flags considered. - let _unwindEL_2 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + let _holder = UseDiagnosticsLogger diagnosticsLogger // Forward all errors from flags delayForFlagsLogger.CommitDelayedDiagnostics diagnosticsLogger @@ -605,13 +593,10 @@ let main1 // Parse sourceFiles ReportTime tcConfig "Parse inputs" - use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - - let createDiagnosticsLogger = - (fun exiter -> diagnosticsLoggerProvider.CreateDelayAndForwardLogger(exiter) :> CapturingDiagnosticsLogger) + use unwindParsePhase = UseBuildPhase BuildPhase.Parse let inputs = - ParseInputFiles(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, createDiagnosticsLogger, false) + ParseInputFiles(tcConfig, lexResourceManager, sourceFiles, diagnosticsLogger, false) let inputs, _ = (Map.empty, inputs) @@ -659,7 +644,7 @@ let main1 // Build the initial type checking environment ReportTime tcConfig "Typecheck" - use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + use unwindParsePhase = UseBuildPhase BuildPhase.TypeCheck let tcEnv0, openDecls0 = GetInitialTcEnv(assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) @@ -668,19 +653,7 @@ let main1 let inputs = inputs |> List.map fst let tcState, topAttrs, typedAssembly, _tcEnvAtEnd = - TypeCheck( - ctok, - tcConfig, - tcImports, - tcGlobals, - diagnosticsLogger, - assemblyName, - NiceNameGenerator(), - tcEnv0, - openDecls0, - inputs, - exiter - ) + TypeCheck(ctok, tcConfig, tcImports, tcGlobals, diagnosticsLogger, assemblyName, tcEnv0, openDecls0, inputs, exiter) AbortOnError(diagnosticsLogger, exiter) ReportTime tcConfig "Typechecked" @@ -717,7 +690,7 @@ let main1OfAst dllReferences, noframework, exiter: Exiter, - diagnosticsLoggerProvider: DiagnosticsLoggerProvider, + diagnosticsLoggerProvider: IDiagnosticsLoggerProvider, disposables: DisposablesTracker, inputs: ParsedInput list ) = @@ -779,11 +752,9 @@ let main1OfAst SetTailcallSwitch tcConfigB OptionSwitch.On // Now install a delayed logger to hold all errors from flags until after all flags have been parsed (for example, --vserrors) - let delayForFlagsLogger = - diagnosticsLoggerProvider.CreateDelayAndForwardLogger exiter + let delayForFlagsLogger = CapturingDiagnosticsLogger("DelayForFlagsLogger") - let _unwindEL_1 = - PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> delayForFlagsLogger) + let _holder = UseDiagnosticsLogger delayForFlagsLogger tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines @@ -796,16 +767,15 @@ let main1OfAst try TcConfig.Create(tcConfigB, validate = false) with e -> - delayForFlagsLogger.ForwardDelayedDiagnostics tcConfigB + delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 let dependencyProvider = new DependencyProvider() - let diagnosticsLogger = - diagnosticsLoggerProvider.CreateDiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter) + let diagnosticsLogger = diagnosticsLoggerProvider.CreateLogger(tcConfigB, exiter) // Install the global error logger and never remove it. This logger does have all command-line flags considered. - let _unwindEL_2 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + let _holder = UseDiagnosticsLogger diagnosticsLogger // Forward all errors from flags delayForFlagsLogger.CommitDelayedDiagnostics diagnosticsLogger @@ -825,7 +795,7 @@ let main1OfAst // Register framework tcImports to be disposed in future disposables.Register frameworkTcImports - use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use unwindParsePhase = UseBuildPhase BuildPhase.Parse let meta = Directory.GetCurrentDirectory() @@ -847,26 +817,14 @@ let main1OfAst // Build the initial type checking environment ReportTime tcConfig "Typecheck" - use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + use unwindParsePhase = UseBuildPhase BuildPhase.TypeCheck let tcEnv0, openDecls0 = GetInitialTcEnv(assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) // Type check the inputs let tcState, topAttrs, typedAssembly, _tcEnvAtEnd = - TypeCheck( - ctok, - tcConfig, - tcImports, - tcGlobals, - diagnosticsLogger, - assemblyName, - NiceNameGenerator(), - tcEnv0, - openDecls0, - inputs, - exiter - ) + TypeCheck(ctok, tcConfig, tcImports, tcGlobals, diagnosticsLogger, assemblyName, tcEnv0, openDecls0, inputs, exiter) AbortOnError(diagnosticsLogger, exiter) ReportTime tcConfig "Typechecked" @@ -912,7 +870,7 @@ let main2 generatedCcu.Contents.SetAttribs(generatedCcu.Contents.Attribs @ topAttrs.assemblyAttrs) - use unwindPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.CodeGen + use unwindPhase = UseBuildPhase BuildPhase.CodeGen let signingInfo = ValidateKeySigningAttributes(tcConfig, tcGlobals, topAttrs) AbortOnError(diagnosticsLogger, exiter) @@ -930,7 +888,7 @@ let main2 GetDiagnosticsLoggerFilteringByScopedPragmas(true, scopedPragmas, tcConfig.diagnosticsOptions, oldLogger) - let _unwindEL_3 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + let _holder = UseDiagnosticsLogger diagnosticsLogger // Try to find an AssemblyVersion attribute let assemVerFromAttrib = @@ -955,7 +913,7 @@ let main2 // write interface, xmldoc ReportTime tcConfig "Write Interface File" - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Output + use _ = UseBuildPhase BuildPhase.Output if tcConfig.printSignature || tcConfig.printAllSignatureFiles then InterfaceFileWriter.WriteInterfaceFile(tcGlobals, tcConfig, InfoReader(tcGlobals, tcImports.GetImportMap()), typedImplFiles) @@ -1036,7 +994,7 @@ let main3 let optimizedImpls, optDataResources = // Perform optimization - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Optimize + use _ = UseBuildPhase BuildPhase.Optimize let optEnv0 = GetInitialOptimizationEnv(tcImports, tcGlobals) @@ -1124,7 +1082,7 @@ let main4 let staticLinker = StaticLink(ctok, tcConfig, tcImports, ilGlobals) ReportTime tcConfig "TAST -> IL" - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.IlxGen + use _ = UseBuildPhase BuildPhase.IlxGen // Create the Abstract IL generator let ilxGenerator = @@ -1214,7 +1172,7 @@ let main5 ilSourceDocs)) = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Output + use _ = UseBuildPhase BuildPhase.Output // Static linking, if any let ilxMainModule = @@ -1248,7 +1206,7 @@ let main6 ReportTime tcConfig "Write .NET Binary" - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Output + use _ = UseBuildPhase BuildPhase.Output let outfile = tcConfig.MakePathAbsolute outfile DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok diff --git a/src/Compiler/Driver/fsc.fsi b/src/Compiler/Driver/fsc.fsi index 12ed13273da..bb060095d98 100644 --- a/src/Compiler/Driver/fsc.fsi +++ b/src/Compiler/Driver/fsc.fsi @@ -13,18 +13,18 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals -[] -type DiagnosticsLoggerProvider = - new: unit -> DiagnosticsLoggerProvider - abstract CreateDiagnosticsLoggerUpToMaxErrors: - tcConfigBuilder: TcConfigBuilder * exiter: Exiter -> DiagnosticsLogger +/// DiagnosticLoggers can be sensitive to the TcConfig flags. During the checking +/// of the flags themselves we have to create temporary loggers, until the full configuration is +/// available. +type IDiagnosticsLoggerProvider = + abstract CreateLogger: tcConfigB: TcConfigBuilder * exiter: Exiter -> DiagnosticsLogger /// The default DiagnosticsLoggerProvider implementation, reporting messages to the Console up to the maxerrors maximum type ConsoleLoggerProvider = new: unit -> ConsoleLoggerProvider - inherit DiagnosticsLoggerProvider + interface IDiagnosticsLoggerProvider -/// An error logger that reports errors up to some maximum, notifying the exiter when that maximum is reached +/// An diagnostic logger that reports errors up to some maximum, notifying the exiter when that maximum is reached /// /// Used only in LegacyHostedCompilerForTesting [] @@ -33,8 +33,7 @@ type DiagnosticsLoggerUpToMaxErrors = new: tcConfigB: TcConfigBuilder * exiter: Exiter * nameForDebugging: string -> DiagnosticsLoggerUpToMaxErrors /// Called when a diagnostic occurs - abstract HandleIssue: - tcConfigB: TcConfigBuilder * diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit + abstract HandleIssue: tcConfig: TcConfig * diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit /// Called when 'too many errors' has occurred abstract HandleTooManyErrors: text: string -> unit @@ -52,7 +51,7 @@ val CompileFromCommandLineArguments: reduceMemoryUsage: ReduceMemoryFlag * defaultCopyFSharpCore: CopyFSharpCoreFlag * exiter: Exiter * - loggerProvider: DiagnosticsLoggerProvider * + loggerProvider: IDiagnosticsLoggerProvider * tcImportsCapture: (TcImports -> unit) option * dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> unit @@ -69,7 +68,7 @@ val CompileFromSyntaxTrees: dependencies: string list * noframework: bool * exiter: Exiter * - loggerProvider: DiagnosticsLoggerProvider * + loggerProvider: IDiagnosticsLoggerProvider * inputs: ParsedInput list * tcImportsCapture: (TcImports -> unit) option * dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 4c82c5f445a..8bf00bef80f 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -159,7 +159,7 @@ let rec AttachRange m (exn: exn) = | UnresolvedPathReferenceNoRange (a, p) -> UnresolvedPathReference(a, p, m) | Failure msg -> InternalError(msg + " (Failure)", m) | :? ArgumentException as exn -> InternalError(exn.Message + " (ArgumentException)", m) - | notARangeDual -> notARangeDual + | _ -> exn type Exiter = abstract Exit: int -> 'T @@ -172,9 +172,18 @@ let QuitProcessExiter = with _ -> () - FSComp.SR.elSysEnvExitDidntExit () |> failwith + failwith (FSComp.SR.elSysEnvExitDidntExit ()) } +type StopProcessingExiter() = + + member val ExitCode = 0 with get, set + + interface Exiter with + member exiter.Exit n = + exiter.ExitCode <- n + raise StopProcessing + /// Closed enumeration of build phases. [] type BuildPhase = @@ -304,6 +313,8 @@ type DiagnosticsLogger(nameForDebugging: string) = // code just below and get a breakpoint for all error logger implementations. abstract DiagnosticSink: diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit + member x.CheckForErrors() = (x.ErrorCount > 0) + member _.DebugDisplay() = sprintf "DiagnosticsLogger(%s)" nameForDebugging @@ -320,12 +331,17 @@ let AssertFalseDiagnosticsLogger = member _.ErrorCount = (* assert false; *) 0 } -type CapturingDiagnosticsLogger(nm) = +type CapturingDiagnosticsLogger(nm, ?eagerFormat) = inherit DiagnosticsLogger(nm) let mutable errorCount = 0 let diagnostics = ResizeArray() override _.DiagnosticSink(diagnostic, severity) = + let diagnostic = + match eagerFormat with + | None -> diagnostic + | Some f -> f diagnostic + if severity = FSharpDiagnosticSeverity.Error then errorCount <- errorCount + 1 @@ -476,7 +492,7 @@ module DiagnosticsLoggerExtensions = member x.ErrorRecoveryNoRange(exn: exn) = x.ErrorRecovery exn range0 /// NOTE: The change will be undone when the returned "unwind" object disposes -let PushThreadBuildPhaseUntilUnwind (phase: BuildPhase) = +let UseBuildPhase (phase: BuildPhase) = let oldBuildPhase = DiagnosticsThreadStatics.BuildPhaseUnchecked DiagnosticsThreadStatics.BuildPhase <- phase @@ -486,15 +502,18 @@ let PushThreadBuildPhaseUntilUnwind (phase: BuildPhase) = } /// NOTE: The change will be undone when the returned "unwind" object disposes -let PushDiagnosticsLoggerPhaseUntilUnwind (diagnosticsLoggerTransformer: DiagnosticsLogger -> #DiagnosticsLogger) = - let oldDiagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger - DiagnosticsThreadStatics.DiagnosticsLogger <- diagnosticsLoggerTransformer oldDiagnosticsLogger +let UseTransformedDiagnosticsLogger (transformer: DiagnosticsLogger -> #DiagnosticsLogger) = + let oldLogger = DiagnosticsThreadStatics.DiagnosticsLogger + DiagnosticsThreadStatics.DiagnosticsLogger <- transformer oldLogger { new IDisposable with member _.Dispose() = - DiagnosticsThreadStatics.DiagnosticsLogger <- oldDiagnosticsLogger + DiagnosticsThreadStatics.DiagnosticsLogger <- oldLogger } +let UseDiagnosticsLogger newLogger = + UseTransformedDiagnosticsLogger (fun _ -> newLogger) + let SetThreadBuildPhaseNoUnwind (phase: BuildPhase) = DiagnosticsThreadStatics.BuildPhase <- phase @@ -505,8 +524,8 @@ let SetThreadDiagnosticsLoggerNoUnwind diagnosticsLogger = /// /// Use to reset error and warning handlers. type CompilationGlobalsScope(diagnosticsLogger: DiagnosticsLogger, buildPhase: BuildPhase) = - let unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) - let unwindBP = PushThreadBuildPhaseUntilUnwind buildPhase + let unwindEL = UseDiagnosticsLogger diagnosticsLogger + let unwindBP = UseBuildPhase buildPhase member _.DiagnosticsLogger = diagnosticsLogger member _.BuildPhase = buildPhase diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index c3af3a7da9d..0ac4c90583e 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -85,11 +85,21 @@ val inline protectAssemblyExplorationNoReraise: dflt1: 'T -> dflt2: 'T -> f: (un val AttachRange: m: range -> exn: exn -> exn +/// Represnts an early exit from parsing, checking etc, for example because 'maxerrors' has been reached. type Exiter = - abstract member Exit: int -> 'T + abstract Exit: int -> 'T +/// An exiter that quits the process if Exit is called. val QuitProcessExiter: Exiter +/// An exiter that raises StopProcessingException if Exit is called, saving the exit code in ExitCode. +type StopProcessingExiter = + interface Exiter + + new: unit -> StopProcessingExiter + + member ExitCode: int with get, set + /// Closed enumeration of build phases. [] type BuildPhase = @@ -166,6 +176,7 @@ type PhasedDiagnostic = /// member Subcategory: unit -> string +/// Represents a capability to log diagnostics [] type DiagnosticsLogger = @@ -173,18 +184,27 @@ type DiagnosticsLogger = member DebugDisplay: unit -> string - abstract member DiagnosticSink: diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit + /// Emit a diagnostic to the logger + abstract DiagnosticSink: diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit - abstract member ErrorCount: int + /// Get the number of error diagnostics reported + abstract ErrorCount: int + /// Checks if ErrorCount > 0 + member CheckForErrors: unit -> bool + +/// Represents a DiagnosticsLogger that discards diagnostics val DiscardErrorsLogger: DiagnosticsLogger +/// Represents a DiagnosticsLogger that ignores diagnostics and asserts val AssertFalseDiagnosticsLogger: DiagnosticsLogger +/// Represents a DiagnosticsLogger that captures all diagnostics, optionally formatting them +/// eagerly. type CapturingDiagnosticsLogger = inherit DiagnosticsLogger - new: nm: string -> CapturingDiagnosticsLogger + new: nm: string * ?eagerFormat: (PhasedDiagnostic -> PhasedDiagnostic) -> CapturingDiagnosticsLogger member CommitDelayedDiagnostics: diagnosticsLogger: DiagnosticsLogger -> unit @@ -194,6 +214,7 @@ type CapturingDiagnosticsLogger = override ErrorCount: int +/// Thread statics for the installed diagnostic logger [] type DiagnosticsThreadStatics = @@ -216,26 +237,41 @@ module DiagnosticsLoggerExtensions = type DiagnosticsLogger with + /// Report a diagnostic as an error and recover member ErrorR: exn: exn -> unit + /// Report a diagnostic as a warning and recover member Warning: exn: exn -> unit + /// Report a diagnostic as an error and raise `ReportedError` member Error: exn: exn -> 'T + /// Simulates a diagnostic. For test purposes only. member SimulateError: diagnostic: PhasedDiagnostic -> 'T + /// Perform error recovery from an exception if possible. + /// - StopProcessingExn is not caught. + /// - ReportedError is caught and ignored. + /// - TargetInvocationException is unwrapped + /// - If precisely a System.Exception or ArgumentException then the range is attached as InternalError. + /// - Other exceptions are unchanged + /// + /// All are reported via the installed diagnostics logger member ErrorRecovery: exn: exn -> m: range -> unit + /// Perform error recovery from an exception if possible, including catching StopProcessingExn member StopProcessingRecovery: exn: exn -> m: range -> unit + /// Like ErrorRecover by no range is attached to System.Exception and ArgumentException. member ErrorRecoveryNoRange: exn: exn -> unit /// NOTE: The change will be undone when the returned "unwind" object disposes -val PushThreadBuildPhaseUntilUnwind: phase: BuildPhase -> IDisposable +val UseBuildPhase: phase: BuildPhase -> IDisposable /// NOTE: The change will be undone when the returned "unwind" object disposes -val PushDiagnosticsLoggerPhaseUntilUnwind: - diagnosticsLoggerTransformer: (DiagnosticsLogger -> #DiagnosticsLogger) -> IDisposable +val UseTransformedDiagnosticsLogger: transformer: (DiagnosticsLogger -> #DiagnosticsLogger) -> IDisposable + +val UseDiagnosticsLogger: newLogger: DiagnosticsLogger -> IDisposable val SetThreadBuildPhaseNoUnwind: phase: BuildPhase -> unit diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index ddf46360ae7..9ad441ddc2a 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -726,13 +726,12 @@ type internal FsiStdinSyphon(errorWriter: TextWriter) = if 0 < i && i <= lines.Length then lines[i-1] else "" /// Display the given error. - member syphon.PrintError (tcConfig:TcConfigBuilder, err) = + member syphon.PrintDiagnostic (tcConfig:TcConfig, diagnostic: PhasedDiagnostic) = ignoreAllErrors (fun () -> let severity = FSharpDiagnosticSeverity.Error DoWithDiagnosticColor severity (fun () -> errorWriter.WriteLine() - writeViaBuffer errorWriter (OutputDiagnosticContext " " syphon.GetLine) err - writeViaBuffer errorWriter (OutputDiagnostic (tcConfig.implicitIncludeDir,tcConfig.showFullPaths,tcConfig.flatErrors,tcConfig.diagnosticStyle,severity)) err + diagnostic.WriteWithContext(errorWriter, " ", syphon.GetLine, tcConfig, severity) errorWriter.WriteLine() errorWriter.WriteLine() errorWriter.Flush())) @@ -773,34 +772,33 @@ type internal DiagnosticsLoggerThatStopsOnFirstError(tcConfigB:TcConfigBuilder, member _.ResetErrorCount() = errorCount <- 0 - override x.DiagnosticSink(err, severity) = - if ReportDiagnosticAsError tcConfigB.diagnosticsOptions (err, severity) then - fsiStdinSyphon.PrintError(tcConfigB,err) + override _.DiagnosticSink(diagnostic, severity) = + let tcConfig = TcConfig.Create(tcConfigB,validate=false) + if diagnostic.ReportAsError (tcConfig.diagnosticsOptions, severity) then + fsiStdinSyphon.PrintDiagnostic(tcConfig,diagnostic) errorCount <- errorCount + 1 if tcConfigB.abortOnError then exit 1 (* non-zero exit code *) // STOP ON FIRST ERROR (AVOIDS PARSER ERROR RECOVERY) raise StopProcessing - elif ReportDiagnosticAsWarning tcConfigB.diagnosticsOptions (err, severity) then + elif diagnostic.ReportAsWarning (tcConfig.diagnosticsOptions, severity) then DoWithDiagnosticColor FSharpDiagnosticSeverity.Warning (fun () -> fsiConsoleOutput.Error.WriteLine() - writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err - writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.diagnosticStyle,severity)) err + diagnostic.WriteWithContext(fsiConsoleOutput.Error, " ", fsiStdinSyphon.GetLine, tcConfig, severity) fsiConsoleOutput.Error.WriteLine() fsiConsoleOutput.Error.WriteLine() fsiConsoleOutput.Error.Flush()) - elif ReportDiagnosticAsInfo tcConfigB.diagnosticsOptions (err, severity) then + elif diagnostic.ReportAsInfo (tcConfig.diagnosticsOptions, severity) then DoWithDiagnosticColor FSharpDiagnosticSeverity.Info (fun () -> fsiConsoleOutput.Error.WriteLine() - writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err - writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.diagnosticStyle,severity)) err + diagnostic.WriteWithContext(fsiConsoleOutput.Error, " ", fsiStdinSyphon.GetLine, tcConfig, severity) fsiConsoleOutput.Error.WriteLine() fsiConsoleOutput.Error.WriteLine() fsiConsoleOutput.Error.Flush()) - override x.ErrorCount = errorCount + override _.ErrorCount = errorCount type DiagnosticsLogger with - member x.CheckForErrors() = (x.ErrorCount > 0) + /// A helper function to check if its time to abort member x.AbortOnError(fsiConsoleOutput:FsiConsoleOutput) = if x.ErrorCount > 0 then @@ -1330,7 +1328,6 @@ type internal FsiDynamicCompiler( fsiOptions : FsiCommandLineOptions, fsiConsoleOutput : FsiConsoleOutput, fsiCollectible: bool, - niceNameGen, resolveAssemblyRef ) = @@ -1672,10 +1669,24 @@ type internal FsiDynamicCompiler( let ilxGenerator = istate.ilxGenerator let tcConfig = TcConfig.Create(tcConfigB,validate=false) + let eagerFormat (diag: PhasedDiagnostic) = + diag.EagerlyFormatCore true + // Typecheck. The lock stops the type checker running at the same time as the // server intellisense implementation (which is currently incomplete and #if disabled) let tcState, topCustomAttrs, declaredImpls, tcEnvAtEndOfLastInput = - lock tcLockObject (fun _ -> CheckClosedInputSet(ctok, diagnosticsLogger.CheckForErrors, tcConfig, tcImports, tcGlobals, Some prefixPath, tcState, inputs)) + lock tcLockObject (fun _ -> + CheckClosedInputSet( + ctok, + diagnosticsLogger.CheckForErrors, + tcConfig, + tcImports, + tcGlobals, + Some prefixPath, + tcState, + eagerFormat, + inputs) + ) let codegenResults, optEnv, fragName = ProcessTypedImpl(diagnosticsLogger, optEnv, tcState, tcConfig, isInteractiveItExpr, topCustomAttrs, prefixPath, isIncrementalFragment, declaredImpls, ilxGenerator) @@ -2155,7 +2166,7 @@ type internal FsiDynamicCompiler( let tcEnv, openDecls0 = GetInitialTcEnv (dynamicCcuName, rangeStdin0, tcConfig, tcImports, tcGlobals) let ccuName = dynamicCcuName - let tcState = GetInitialTcState (rangeStdin0, ccuName, tcConfig, tcGlobals, tcImports, niceNameGen, tcEnv, openDecls0) + let tcState = GetInitialTcState (rangeStdin0, ccuName, tcConfig, tcGlobals, tcImports, tcEnv, openDecls0) let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), tcState.Ccu) @@ -3037,8 +3048,8 @@ type FsiInteractionProcessor member _.EvalInteraction(ctok, sourceText, scriptFileName, diagnosticsLogger, ?cancellationToken) = let cancellationToken = defaultArg cancellationToken CancellationToken.None - use _unwind1 = PushThreadBuildPhaseUntilUnwind(BuildPhase.Interactive) - use _unwind2 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseBuildPhase BuildPhase.Interactive + use _ = UseDiagnosticsLogger diagnosticsLogger use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID let lexbuf = UnicodeLexing.StringAsLexbuf(true, tcConfigB.langVersion, sourceText) let tokenizer = fsiStdinLexerProvider.CreateBufferLexer(scriptFileName, lexbuf, diagnosticsLogger) @@ -3054,8 +3065,8 @@ type FsiInteractionProcessor this.EvalInteraction (ctok, sourceText, scriptPath, diagnosticsLogger) member _.EvalExpression (ctok, sourceText, scriptFileName, diagnosticsLogger) = - use _unwind1 = PushThreadBuildPhaseUntilUnwind(BuildPhase.Interactive) - use _unwind2 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _unwind1 = UseBuildPhase BuildPhase.Interactive + use _unwind2 = UseDiagnosticsLogger diagnosticsLogger use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID let lexbuf = UnicodeLexing.StringAsLexbuf(true, tcConfigB.langVersion, sourceText) let tokenizer = fsiStdinLexerProvider.CreateBufferLexer(scriptFileName, lexbuf, diagnosticsLogger) @@ -3360,8 +3371,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i with e -> stopProcessingRecovery e range0; failwithf "Error creating evaluation session: %A" e - let niceNameGen = NiceNameGenerator() - // Share intern'd strings across all lexing/parsing let lexResourceManager = LexResourceManager() @@ -3381,7 +3390,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i | Some resolvedPath -> Some (Choice1Of2 resolvedPath) | None -> None - let fsiDynamicCompiler = FsiDynamicCompiler(fsi, timeReporter, tcConfigB, tcLockObject, outWriter, tcImports, tcGlobals, fsiOptions, fsiConsoleOutput, fsiCollectible, niceNameGen, resolveAssemblyRef) + let fsiDynamicCompiler = FsiDynamicCompiler(fsi, timeReporter, tcConfigB, tcLockObject, outWriter, tcImports, tcGlobals, fsiOptions, fsiConsoleOutput, fsiCollectible, resolveAssemblyRef) let controlledExecution = ControlledExecution() @@ -3635,7 +3644,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i if fsiOptions.IsInteractiveServer then SpawnInteractiveServer (fsi, fsiOptions, fsiConsoleOutput) - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Interactive + use _ = UseBuildPhase BuildPhase.Interactive if fsiOptions.Interact then // page in the type check env diff --git a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs index 26b43155830..b4af719fa39 100644 --- a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs +++ b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs @@ -24,24 +24,21 @@ type internal InProcDiagnosticsLoggerProvider() = let warnings = ResizeArray() member _.Provider = - { new DiagnosticsLoggerProvider() with + { new IDiagnosticsLoggerProvider with - member _.CreateDiagnosticsLoggerUpToMaxErrors(tcConfigBuilder, exiter) = + member _.CreateLogger(tcConfigB, exiter) = - { new DiagnosticsLoggerUpToMaxErrors(tcConfigBuilder, exiter, "InProcCompilerDiagnosticsLoggerUpToMaxErrors") with + { new DiagnosticsLoggerUpToMaxErrors(tcConfigB, exiter, "InProcCompilerDiagnosticsLoggerUpToMaxErrors") with member _.HandleTooManyErrors text = warnings.Add(FormattedDiagnostic.Short(FSharpDiagnosticSeverity.Warning, text)) - member _.HandleIssue(tcConfigBuilder, err, severity) = + member _.HandleIssue(tcConfig, err, severity) = // 'true' is passed for "suggestNames", since we want to suggest names with fsc.exe runs and this doesn't affect IDE perf - let diagnostics = - CollectFormattedDiagnostics - (tcConfigBuilder.implicitIncludeDir, tcConfigBuilder.showFullPaths, - tcConfigBuilder.flatErrors, tcConfigBuilder.diagnosticStyle, severity, err, true) + let diagnostics = CollectFormattedDiagnostics (tcConfig, severity, err, true) match severity with | FSharpDiagnosticSeverity.Error -> - errors.AddRange(diagnostics) + errors.AddRange(diagnostics) | FSharpDiagnosticSeverity.Warning -> warnings.AddRange(diagnostics) | _ -> ()} @@ -96,10 +93,7 @@ type internal InProcCompiler(legacyReferenceResolver) = let ctok = AssumeCompilationThreadWithoutEvidence () let loggerProvider = InProcDiagnosticsLoggerProvider() - let mutable exitCode = 0 - let exiter = - { new Exiter with - member _.Exit n = exitCode <- n; raise StopProcessing } + let exiter = StopProcessingExiter() try CompileFromCommandLineArguments ( ctok, argv, legacyReferenceResolver, @@ -111,14 +105,14 @@ type internal InProcCompiler(legacyReferenceResolver) = | StopProcessing -> () | ReportedError _ | WrappedError(ReportedError _,_) -> - exitCode <- 1 + exiter.ExitCode <- 1 () let output: CompilationOutput = { Warnings = loggerProvider.CapturedWarnings Errors = loggerProvider.CapturedErrors } - exitCode = 0, output + (exiter.ExitCode = 0), output /// in-proc version of fsc.exe type internal FscCompiler(legacyReferenceResolver) = diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index b01819fc2b7..276027bb3d9 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -2127,8 +2127,8 @@ type FSharpParsingOptions = module internal ParseAndCheckFile = - /// Error handler for parsing & type checking while processing a single file - type ErrorHandler + /// Diagnostics handler for parsing & type checking while processing a single file + type DiagnosticsHandler ( reportErrors, mainInputFileName, @@ -2180,7 +2180,7 @@ module internal ParseAndCheckFile = | _ -> collectOne severity diagnostic let diagnosticsLogger = - { new DiagnosticsLogger("ErrorHandler") with + { new DiagnosticsLogger("DiagnosticsHandler") with member _.DiagnosticSink(exn, severity) = diagnosticSink severity exn member _.ErrorCount = errorCount } @@ -2209,7 +2209,7 @@ module internal ParseAndCheckFile = IndentationAwareSyntaxStatus(indentationSyntaxStatus, true) - let createLexerFunction fileName options lexbuf (errHandler: ErrorHandler) = + let createLexerFunction fileName options lexbuf (errHandler: DiagnosticsHandler) = let indentationSyntaxStatus = getLightSyntaxStatus fileName options // If we're editing a script then we define INTERACTIVE otherwise COMPILED. @@ -2243,22 +2243,18 @@ module internal ParseAndCheckFile = UnicodeLexing.SourceTextAsLexbuf(true, LanguageVersion(langVersion), sourceText) let matchBraces (sourceText: ISourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = + // Make sure there is an DiagnosticsLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors let delayedLogger = CapturingDiagnosticsLogger("matchBraces") - use _unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> delayedLogger) - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseDiagnosticsLogger delayedLogger + use _ = UseBuildPhase BuildPhase.Parse Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "matchBraces", fileName) - // Make sure there is an DiagnosticsLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors - let delayedLogger = CapturingDiagnosticsLogger("matchBraces") - use _unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> delayedLogger) - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - let matchingBraces = ResizeArray<_>() usingLexbufForParsing (createLexbuf options.LangVersionText sourceText, fileName) (fun lexbuf -> let errHandler = - ErrorHandler(false, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler(false, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) let lexfun = createLexerFunction fileName options lexbuf errHandler @@ -2349,12 +2345,11 @@ module internal ParseAndCheckFile = Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "parseFile", fileName) let errHandler = - ErrorHandler(true, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler(true, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) - use unwindEL = - PushDiagnosticsLoggerPhaseUntilUnwind(fun _oldLogger -> errHandler.DiagnosticsLogger) + use _ = UseDiagnosticsLogger errHandler.DiagnosticsLogger - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseBuildPhase BuildPhase.Parse let parseResult = usingLexbufForParsing (createLexbuf options.LangVersionText sourceText, fileName) (fun lexbuf -> @@ -2402,8 +2397,8 @@ module internal ParseAndCheckFile = // If there was a loadClosure, replay the errors and warnings from resolution, excluding parsing loadClosure.LoadClosureRootFileDiagnostics |> List.iter diagnosticSink - let fileOfBackgroundError err = - match GetRangeOfDiagnostic(fst err) with + let fileOfBackgroundError (diagnostic: PhasedDiagnostic, _) = + match diagnostic.Range with | Some m -> Some m.FileName | None -> None @@ -2509,12 +2504,11 @@ module internal ParseAndCheckFile = // Initialize the error handler let errHandler = - ErrorHandler(true, mainInputFileName, tcConfig.diagnosticsOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler(true, mainInputFileName, tcConfig.diagnosticsOptions, sourceText, suggestNamesForErrors) - use _unwindEL = - PushDiagnosticsLoggerPhaseUntilUnwind(fun _oldLogger -> errHandler.DiagnosticsLogger) + use _ = UseDiagnosticsLogger errHandler.DiagnosticsLogger - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + use _unwindBP = UseBuildPhase BuildPhase.TypeCheck // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) let tcConfig = @@ -2531,11 +2525,6 @@ module internal ParseAndCheckFile = // If additional references were brought in by the preprocessor then we need to process them ApplyLoadClosure(tcConfig, parsedMainInput, mainInputFileName, loadClosure, tcImports, backgroundDiagnostics) - // A problem arises with nice name generation, which really should only - // be done in the backend, but is also done in the typechecker for better or worse. - // If we don't do this the NNG accumulates data and we get a memory leak. - tcState.NiceNameGenerator.Reset() - // Typecheck the real input. let sink = TcResultsSinkImpl(tcGlobals, sourceText = sourceText) diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index fe5afbfc4ab..de8d6ae60da 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -937,7 +937,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, let walkImplFile (modules: SynModuleOrNamespace list) = List.collect walkModule modules match input with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> walkImplFile modules + | ParsedInput.ImplFile file -> walkImplFile file.Contents | _ -> [] DiagnosticsScope.Protect diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 45e50d441bf..a1673102dc2 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -475,7 +475,7 @@ type BoundModel private (tcConfig: TcConfig, IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBETypechecked fileName) let capturingDiagnosticsLogger = CapturingDiagnosticsLogger("TypeCheck") - let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, GetScopedPragmasForInput input, tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) + let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) beforeFileChecked.Trigger fileName @@ -519,8 +519,8 @@ type BoundModel private (tcConfig: TcConfig, tcDependencyFiles = fileName :: prevTcDependencyFiles sigNameOpt = match input with - | ParsedInput.SigFile(ParsedSigFileInput(fileName=fileName;qualifiedNameOfFile=qualName)) -> - Some(fileName, qualName) + | ParsedInput.SigFile sigFile -> + Some(sigFile.FileName, sigFile.QualifiedName) | _ -> None } @@ -745,7 +745,6 @@ module IncrementalBuilderHelpers = unresolvedReferences, dependencyProvider, loadClosureOpt: LoadClosure option, - niceNameGen, basicDependencies, keepAssemblyContents, keepAllBackgroundResolutions, @@ -794,7 +793,7 @@ module IncrementalBuilderHelpers = } let tcInitial, openDecls0 = GetInitialTcEnv (assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) - let tcState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, niceNameGen, tcInitial, openDecls0) + let tcState = GetInitialTcState (rangeStartup, assemblyName, tcConfig, tcGlobals, tcImports, tcInitial, openDecls0) let loadClosureErrors = [ match loadClosureOpt with | None -> () @@ -1432,6 +1431,7 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking: bool, + enableParallelCheckingWithSignatureFiles: bool, dependencyProvider ) = @@ -1513,6 +1513,8 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc } |> Some + tcConfigB.parallelCheckingWithSignatureFiles <- enableParallelCheckingWithSignatureFiles + tcConfigB, sourceFilesNew // If this is a builder for a script, re-apply the settings inferred from the @@ -1541,7 +1543,6 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc setupConfigFromLoadClosure() let tcConfig = TcConfig.Create(tcConfigB, validate=true) - let niceNameGen = NiceNameGenerator() let outfile, _, assemblyName = tcConfigB.DecideNames sourceFiles // Resolve assemblies and create the framework TcImports. This is done when constructing the @@ -1625,7 +1626,6 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc unresolvedReferences, dependencyProvider, loadClosureOpt, - niceNameGen, basicDependencies, keepAssemblyContents, keepAllBackgroundResolutions, diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index cca65bcace1..4843a5061e7 100755 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -263,6 +263,7 @@ type internal IncrementalBuilder = keepAllBackgroundSymbolUses: bool * enableBackgroundItemKeyStoreAndSemanticClassification: bool * enablePartialTypeChecking: bool * + enableParallelCheckingWithSignatureFiles: bool * dependencyProvider: DependencyProvider option -> NodeCode diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs index 410d02dc786..bf28a121d43 100644 --- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs +++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs @@ -780,8 +780,8 @@ module InterfaceStubGenerator = /// Find corresponding interface declaration at a given position let TryFindInterfaceDeclaration (pos: pos) (parsedInput: ParsedInput) = - let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = - List.tryPick walkSynModuleOrNamespace moduleOrNamespaceList + let rec walkImplFileInput (file: ParsedImplFileInput) = + List.tryPick walkSynModuleOrNamespace file.Contents and walkSynModuleOrNamespace (SynModuleOrNamespace (decls = decls; range = range)) = if not <| rangeContainsPos range pos then diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 884afb3901a..cb9eacd954e 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1049,8 +1049,8 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, maxLength: int option, fi // Scan a token starting with the given lexer state member x.ScanToken(lexState: FSharpTokenizerLexState) : FSharpTokenInfo option * FSharpTokenizerLexState = - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - use unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> DiscardErrorsLogger) + use _ = UseBuildPhase BuildPhase.Parse + use _ = UseDiagnosticsLogger DiscardErrorsLogger let indentationSyntaxStatus, lexcont = LexerStateEncoding.decodeLexInt lexState @@ -1835,8 +1835,8 @@ module FSharpLexerImpl = else lexer - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - use _unwindEL = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> DiscardErrorsLogger) + use _ = UseBuildPhase BuildPhase.Parse + use _ = UseDiagnosticsLogger DiscardErrorsLogger resetLexbufPos "" lexbuf diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 11ebea8a668..c38ce9793e2 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -662,8 +662,8 @@ module NavigationImpl = module Navigation = let getNavigation (parsedInput: ParsedInput) = match parsedInput with - | ParsedInput.SigFile (ParsedSigFileInput (modules = modules)) -> NavigationImpl.getNavigationFromSigFile modules - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> NavigationImpl.getNavigationFromImplFile modules + | ParsedInput.SigFile file -> NavigationImpl.getNavigationFromSigFile file.Contents + | ParsedInput.ImplFile file -> NavigationImpl.getNavigationFromImplFile file.Contents let empty = NavigationItems([||]) @@ -819,15 +819,14 @@ module NavigateTo = let ctor = mapMemberKind memberFlags.MemberKind addValSig ctor valSig isSig container - let rec walkSigFileInput (inp: ParsedSigFileInput) = - let (ParsedSigFileInput (fileName = fileName; modules = moduleOrNamespaceList)) = inp + let rec walkSigFileInput (file: ParsedSigFileInput) = - for item in moduleOrNamespaceList do + for item in file.Contents do walkSynModuleOrNamespaceSig item { Type = NavigableContainerType.File - LogicalName = fileName + LogicalName = file.FileName } and walkSynModuleOrNamespaceSig (inp: SynModuleOrNamespaceSig) container = @@ -890,15 +889,14 @@ module NavigateTo = | SynMemberSig.Interface _ -> () and walkImplFileInput (inp: ParsedImplFileInput) = - let (ParsedImplFileInput (fileName = fileName; modules = moduleOrNamespaceList)) = inp let container = { Type = NavigableContainerType.File - LogicalName = fileName + LogicalName = inp.FileName } - for item in moduleOrNamespaceList do + for item in inp.Contents do walkSynModuleOrNamespace item container and walkSynModuleOrNamespace inp container = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 9a4263d4975..08c89d969f9 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -973,7 +973,9 @@ module SyntaxTraversal = visitor.VisitBinding(origPath, defaultTraverse, b) match parseTree with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = l)) -> + | ParsedInput.ImplFile file -> + let l = file.Contents + let fileRange = #if DEBUG match l with diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 7b1fc766c1d..6b6a1c906f0 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -570,8 +570,8 @@ module ParsedInput = let inline ifPosInRange range f = if isPosInRange range then f () else None - let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = - List.tryPick (walkSynModuleOrNamespace true) moduleOrNamespaceList + let rec walkImplFileInput (file: ParsedImplFileInput) = + List.tryPick (walkSynModuleOrNamespace true) file.Contents and walkSynModuleOrNamespace isTopLevel inp = let (SynModuleOrNamespace (decls = decls; attribs = Attributes attrs; range = r)) = @@ -1589,8 +1589,8 @@ module ParsedInput = let addIdent (ident: Ident) = identsByEndPos[ident.idRange.End] <- [ ident ] - let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = - List.iter walkSynModuleOrNamespace moduleOrNamespaceList + let rec walkImplFileInput (file: ParsedImplFileInput) = + List.iter walkSynModuleOrNamespace file.Contents and walkSynModuleOrNamespace (SynModuleOrNamespace (decls = decls; attribs = Attributes attrs)) = List.iter walkAttribute attrs @@ -2069,8 +2069,8 @@ module ParsedInput = | _ -> None |> Option.map (fun r -> r.StartColumn) - let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = - List.iter (walkSynModuleOrNamespace []) moduleOrNamespaceList + let rec walkImplFileInput (file: ParsedImplFileInput) = + List.iter (walkSynModuleOrNamespace []) file.Contents and walkSynModuleOrNamespace (parent: LongIdent) modul = let (SynModuleOrNamespace (longId = ident; kind = kind; decls = decls; range = range)) = diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index cbc625f709b..210f3f4f9e8 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -1045,11 +1045,11 @@ module Structure = List.iter parseModuleSigDeclaration decls match parsedInput with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> - modules |> List.iter parseModuleOrNamespace + | ParsedInput.ImplFile file -> + file.Contents |> List.iter parseModuleOrNamespace getCommentRanges sourceLines - | ParsedInput.SigFile (ParsedSigFileInput (modules = moduleSigs)) -> - List.iter parseModuleOrNamespaceSigs moduleSigs + | ParsedInput.SigFile file -> + file.Contents |> List.iter parseModuleOrNamespaceSigs getCommentRanges sourceLines acc :> seq<_> diff --git a/src/Compiler/Service/ServiceXmlDocParser.fs b/src/Compiler/Service/ServiceXmlDocParser.fs index f0b137b4bb8..ae9217e8a02 100644 --- a/src/Compiler/Service/ServiceXmlDocParser.fs +++ b/src/Compiler/Service/ServiceXmlDocParser.fs @@ -210,8 +210,7 @@ module XmlDocParsing = and getXmlDocablesInput input = match input with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = symModules)) -> - symModules |> List.collect getXmlDocablesSynModuleOrNamespace + | ParsedInput.ImplFile file -> file.Contents |> List.collect getXmlDocablesSynModuleOrNamespace | ParsedInput.SigFile _ -> [] // Get compiler options for the 'project' implied by a single script file diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index e58b5be8261..d9906121964 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -85,19 +85,11 @@ module CompileHelpers = let mkCompilationDiagnosticsHandlers () = let diagnostics = ResizeArray<_>() - let diagnosticSink isError exn = - let main, related = SplitRelatedDiagnostics exn - - let oneDiagnostic e = - diagnostics.Add(FSharpDiagnostic.CreateFromException(e, isError, range0, true)) // Suggest names for errors - - oneDiagnostic main - List.iter oneDiagnostic related - let diagnosticsLogger = { new DiagnosticsLogger("CompileAPI") with - member _.DiagnosticSink(exn, isError) = diagnosticSink isError exn + member _.DiagnosticSink(diag, isError) = + diagnostics.Add(FSharpDiagnostic.CreateFromException(diag, isError, range0, true)) // Suggest names for errors member _.ErrorCount = diagnostics @@ -106,20 +98,17 @@ module CompileHelpers = } let loggerProvider = - { new DiagnosticsLoggerProvider() with - member _.CreateDiagnosticsLoggerUpToMaxErrors(_tcConfigBuilder, _exiter) = diagnosticsLogger + { new IDiagnosticsLoggerProvider with + member _.CreateLogger(_tcConfigB, _exiter) = diagnosticsLogger } diagnostics, diagnosticsLogger, loggerProvider let tryCompile diagnosticsLogger f = - use unwindParsePhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - use unwindEL_2 = PushDiagnosticsLoggerPhaseUntilUnwind(fun _ -> diagnosticsLogger) + use _ = UseBuildPhase BuildPhase.Parse + use _ = UseDiagnosticsLogger diagnosticsLogger - let exiter = - { new Exiter with - member x.Exit n = raise StopProcessing - } + let exiter = StopProcessingExiter() try f exiter @@ -292,7 +281,8 @@ type BackgroundCompiler suggestNamesForErrors, keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, - enablePartialTypeChecking + enablePartialTypeChecking, + enableParallelCheckingWithSignatureFiles ) as self = let beforeFileChecked = Event() @@ -419,6 +409,7 @@ type BackgroundCompiler keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, + enableParallelCheckingWithSignatureFiles, dependencyProvider ) @@ -1211,7 +1202,8 @@ type FSharpChecker suggestNamesForErrors, keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, - enablePartialTypeChecking + enablePartialTypeChecking, + enableParallelCheckingWithSignatureFiles ) = let backgroundCompiler = @@ -1224,7 +1216,8 @@ type FSharpChecker suggestNamesForErrors, keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, - enablePartialTypeChecking + enablePartialTypeChecking, + enableParallelCheckingWithSignatureFiles ) static let globalInstance = lazy FSharpChecker.Create() @@ -1247,7 +1240,8 @@ type FSharpChecker ?suggestNamesForErrors, ?keepAllBackgroundSymbolUses, ?enableBackgroundItemKeyStoreAndSemanticClassification, - ?enablePartialTypeChecking + ?enablePartialTypeChecking, + ?enableParallelCheckingWithSignatureFiles ) = let legacyReferenceResolver = @@ -1266,6 +1260,7 @@ type FSharpChecker defaultArg enableBackgroundItemKeyStoreAndSemanticClassification false let enablePartialTypeChecking = defaultArg enablePartialTypeChecking false + let enableParallelCheckingWithSignatureFiles = defaultArg enableParallelCheckingWithSignatureFiles false if keepAssemblyContents && enablePartialTypeChecking then invalidArg "enablePartialTypeChecking" "'keepAssemblyContents' and 'enablePartialTypeChecking' cannot be both enabled." @@ -1279,7 +1274,8 @@ type FSharpChecker suggestNamesForErrors, keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, - enablePartialTypeChecking + enablePartialTypeChecking, + enableParallelCheckingWithSignatureFiles ) member _.ReferenceResolver = legacyReferenceResolver diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 25a5a2b412e..cec0eb2d2f2 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -31,6 +31,7 @@ type public FSharpChecker = /// Indicate whether all symbol uses should be kept in background checking /// Indicates whether a table of symbol keys should be kept for background compilation /// Indicates whether to perform partial type checking. Cannot be set to true if keepAssmeblyContents is true. If set to true, can cause duplicate type-checks when richer information on a file is needed, but can skip background type-checking entirely on implementation files with signature files. + /// Type check implementation files that are backed by a signature file in parallel. static member Create: ?projectCacheSize: int * ?keepAssemblyContents: bool * @@ -40,7 +41,8 @@ type public FSharpChecker = ?suggestNamesForErrors: bool * ?keepAllBackgroundSymbolUses: bool * ?enableBackgroundItemKeyStoreAndSemanticClassification: bool * - ?enablePartialTypeChecking: bool -> + ?enablePartialTypeChecking: bool * + ?enableParallelCheckingWithSignatureFiles: bool -> FSharpChecker /// diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index a99f02dbc44..a0c9a47fa88 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -71,10 +71,10 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str sprintf "%s (%d,%d)-(%d,%d) %s %s %s" fileName s.Line (s.Column + 1) e.Line (e.Column + 1) subcategory severity message /// Decompose a warning or error into parts: position, severity, message, error number - static member CreateFromException(diagnostic, severity, fallbackRange: range, suggestNames: bool) = - let m = match GetRangeOfDiagnostic diagnostic with Some m -> m | None -> fallbackRange - let msg = buildString (fun buf -> OutputPhasedDiagnostic buf diagnostic false suggestNames) - let errorNum = GetDiagnosticNumber diagnostic + static member CreateFromException(diagnostic: PhasedDiagnostic, severity, fallbackRange: range, suggestNames: bool) = + let m = match diagnostic.Range with Some m -> m | None -> fallbackRange + let msg = diagnostic.FormatCore(false, suggestNames) + let errorNum = diagnostic.Number FSharpDiagnostic(m, severity, msg, diagnostic.Subcategory(), errorNum, "FS") /// Decompose a warning or error into parts: position, severity, message, error number @@ -104,16 +104,16 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str [] type DiagnosticsScope() = let mutable diags = [] - let unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + let unwindBP = UseBuildPhase BuildPhase.TypeCheck let unwindEL = - PushDiagnosticsLoggerPhaseUntilUnwind (fun _oldLogger -> + UseDiagnosticsLogger { new DiagnosticsLogger("DiagnosticsScope") with member _.DiagnosticSink(diagnostic, severity) = let diagnostic = FSharpDiagnostic.CreateFromException(diagnostic, severity, range.Zero, false) diags <- diagnostic :: diags - member _.ErrorCount = diags.Length }) + member _.ErrorCount = diags.Length } member _.Errors = diags |> List.filter (fun error -> error.Severity = FSharpDiagnosticSeverity.Error) @@ -126,7 +126,7 @@ type DiagnosticsScope() = interface IDisposable with member _.Dispose() = - unwindEL.Dispose() (* unwind pushes when DiagnosticsScope disposes *) + unwindEL.Dispose() unwindBP.Dispose() /// Used at entry points to FSharp.Compiler.Service (service.fsi) which manipulate symbols and @@ -165,12 +165,12 @@ type internal CompilationDiagnosticLogger (debugName: string, options: FSharpDia let diagnostics = ResizeArray<_>() override _.DiagnosticSink(diagnostic, severity) = - if ReportDiagnosticAsError options (diagnostic, severity) then + if diagnostic.ReportAsError (options, severity) then diagnostics.Add(diagnostic, FSharpDiagnosticSeverity.Error) errorCount <- errorCount + 1 - elif ReportDiagnosticAsWarning options (diagnostic, severity) then + elif diagnostic.ReportAsWarning (options, severity) then diagnostics.Add(diagnostic, FSharpDiagnosticSeverity.Warning) - elif ReportDiagnosticAsInfo options (diagnostic, severity) then + elif diagnostic.ReportAsInfo (options, severity) then diagnostics.Add(diagnostic, severity) override _.ErrorCount = errorCount @@ -179,32 +179,24 @@ type internal CompilationDiagnosticLogger (debugName: string, options: FSharpDia module DiagnosticHelpers = - let ReportDiagnostic (options: FSharpDiagnosticOptions, allErrors, mainInputFileName, fileInfo, diagnostic, severity, suggestNames) = + let ReportDiagnostic (options: FSharpDiagnosticOptions, allErrors, mainInputFileName, fileInfo, diagnostic: PhasedDiagnostic, severity, suggestNames) = [ let severity = - if ReportDiagnosticAsError options (diagnostic, severity) then + if diagnostic.ReportAsError (options, severity) then FSharpDiagnosticSeverity.Error else severity if severity = FSharpDiagnosticSeverity.Error || - ReportDiagnosticAsWarning options (diagnostic, severity) || - ReportDiagnosticAsInfo options (diagnostic, severity) then - - let oneDiagnostic diagnostic = - [ // We use the first line of the file as a fallbackRange for reporting unexpected errors. - // Not ideal, but it's hard to see what else to do. - let fallbackRange = rangeN mainInputFileName 1 - let diagnostic = FSharpDiagnostic.CreateFromExceptionAndAdjustEof (diagnostic, severity, fallbackRange, fileInfo, suggestNames) - let fileName = diagnostic.Range.FileName - if allErrors || fileName = mainInputFileName || fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation then - yield diagnostic ] - - let mainDiagnostic, relatedDiagnostics = SplitRelatedDiagnostics diagnostic - - yield! oneDiagnostic mainDiagnostic - - for e in relatedDiagnostics do - yield! oneDiagnostic e ] + diagnostic.ReportAsWarning (options, severity) || + diagnostic.ReportAsInfo (options, severity) then + + // We use the first line of the file as a fallbackRange for reporting unexpected errors. + // Not ideal, but it's hard to see what else to do. + let fallbackRange = rangeN mainInputFileName 1 + let diagnostic = FSharpDiagnostic.CreateFromExceptionAndAdjustEof (diagnostic, severity, fallbackRange, fileInfo, suggestNames) + let fileName = diagnostic.Range.FileName + if allErrors || fileName = mainInputFileName || fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation then + yield diagnostic ] let CreateDiagnostics (options, allErrors, mainInputFileName, diagnostics, suggestNames) = let fileInfo = (Int32.MaxValue, Int32.MaxValue) diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index 80fc0c21246..ee6b39a5a93 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -97,7 +97,7 @@ let mkLexargs /// Register the lexbuf and call the given function let reusingLexbufForParsing lexbuf f = - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + use _ = UseBuildPhase BuildPhase.Parse LexbufLocalXmlDocStore.ClearXmlDoc lexbuf LexbufCommentStore.ClearComments lexbuf diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index ce5571ab4d9..40fc5852cf7 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1676,10 +1676,32 @@ type ParsedImplFileInput = qualifiedNameOfFile: QualifiedNameOfFile * scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * - modules: SynModuleOrNamespace list * - isLastCompiland: (bool * bool) * + contents: SynModuleOrNamespace list * + flags: (bool * bool) * trivia: ParsedImplFileInputTrivia + member x.QualifiedName = + (let (ParsedImplFileInput (qualifiedNameOfFile = qualNameOfFile)) = x in qualNameOfFile) + + member x.ScopedPragmas = + (let (ParsedImplFileInput (scopedPragmas = scopedPragmas)) = x in scopedPragmas) + + member x.HashDirectives = + (let (ParsedImplFileInput (hashDirectives = hashDirectives)) = x in hashDirectives) + + member x.FileName = (let (ParsedImplFileInput (fileName = fileName)) = x in fileName) + + member x.Contents = (let (ParsedImplFileInput (contents = contents)) = x in contents) + + member x.IsScript = (let (ParsedImplFileInput (isScript = isScript)) = x in isScript) + + member x.IsLastCompiland = + (let (ParsedImplFileInput (flags = (isLastCompiland, _))) = x in isLastCompiland) + + member x.IsExe = (let (ParsedImplFileInput (flags = (_, isExe))) = x in isExe) + + member x.Trivia = (let (ParsedImplFileInput (trivia = trivia)) = x in trivia) + [] type ParsedSigFileInput = | ParsedSigFileInput of @@ -1687,9 +1709,24 @@ type ParsedSigFileInput = qualifiedNameOfFile: QualifiedNameOfFile * scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * - modules: SynModuleOrNamespaceSig list * + contents: SynModuleOrNamespaceSig list * trivia: ParsedSigFileInputTrivia + member x.QualifiedName = + (let (ParsedSigFileInput (qualifiedNameOfFile = qualNameOfFile)) = x in qualNameOfFile) + + member x.ScopedPragmas = + (let (ParsedSigFileInput (scopedPragmas = scopedPragmas)) = x in scopedPragmas) + + member x.HashDirectives = + (let (ParsedSigFileInput (hashDirectives = hashDirectives)) = x in hashDirectives) + + member x.FileName = (let (ParsedSigFileInput (fileName = fileName)) = x in fileName) + + member x.Contents = (let (ParsedSigFileInput (contents = contents)) = x in contents) + + member x.Trivia = (let (ParsedSigFileInput (trivia = trivia)) = x in trivia) + [] type ParsedInput = | ImplFile of ParsedImplFileInput @@ -1698,12 +1735,21 @@ type ParsedInput = member inp.FileName = match inp with - | ParsedInput.ImplFile (ParsedImplFileInput (fileName = fileName)) - | ParsedInput.SigFile (ParsedSigFileInput (fileName = fileName)) -> fileName + | ParsedInput.ImplFile file -> file.FileName + | ParsedInput.SigFile file -> file.FileName + + member inp.ScopedPragmas = + match inp with + | ParsedInput.ImplFile file -> file.ScopedPragmas + | ParsedInput.SigFile file -> file.ScopedPragmas + + member inp.QualifiedName = + match inp with + | ParsedInput.ImplFile file -> file.QualifiedName + | ParsedInput.SigFile file -> file.QualifiedName member inp.Range = match inp with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = SynModuleOrNamespace (range = m) :: _)) - | ParsedInput.SigFile (ParsedSigFileInput(modules = SynModuleOrNamespaceSig (range = m) :: _)) -> m - | ParsedInput.ImplFile (ParsedImplFileInput (fileName = fileName)) - | ParsedInput.SigFile (ParsedSigFileInput (fileName = fileName)) -> rangeN fileName 0 + | ParsedInput.ImplFile (ParsedImplFileInput(contents = SynModuleOrNamespace (range = m) :: _)) + | ParsedInput.SigFile (ParsedSigFileInput(contents = SynModuleOrNamespaceSig (range = m) :: _)) -> m + | _ -> rangeN inp.FileName 0 diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 2af399af0e4..b1538eaa489 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1882,10 +1882,28 @@ type ParsedImplFileInput = qualifiedNameOfFile: QualifiedNameOfFile * scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * - modules: SynModuleOrNamespace list * - isLastCompiland: (bool * bool) * + contents: SynModuleOrNamespace list * + flags: (bool * bool) * trivia: ParsedImplFileInputTrivia + member FileName: string + + member IsScript: bool + + member QualifiedName: QualifiedNameOfFile + + member ScopedPragmas: ScopedPragma list + + member HashDirectives: ParsedHashDirective list + + member Contents: SynModuleOrNamespace list + + member Trivia: ParsedImplFileInputTrivia + + member IsLastCompiland: bool + + member IsExe: bool + /// Represents the full syntax tree, file name and other parsing information for a signature file [] type ParsedSigFileInput = @@ -1894,9 +1912,21 @@ type ParsedSigFileInput = qualifiedNameOfFile: QualifiedNameOfFile * scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * - modules: SynModuleOrNamespaceSig list * + contents: SynModuleOrNamespaceSig list * trivia: ParsedSigFileInputTrivia + member FileName: string + + member QualifiedName: QualifiedNameOfFile + + member ScopedPragmas: ScopedPragma list + + member HashDirectives: ParsedHashDirective list + + member Contents: SynModuleOrNamespaceSig list + + member Trivia: ParsedSigFileInputTrivia + /// Represents the syntax tree for a parsed implementation or signature file [] type ParsedInput = @@ -1911,3 +1941,9 @@ type ParsedInput = /// Gets the syntax range of this construct member Range: range + + /// Gets the qualified name used to help match signature and implementation files + member QualifiedName: QualifiedNameOfFile + + /// Gets the #nowarn and other scoped pragmas + member ScopedPragmas: ScopedPragma list diff --git a/src/Compiler/TypedTree/CompilerGlobalState.fs b/src/Compiler/TypedTree/CompilerGlobalState.fs index e419be25d00..b7eea4fb718 100644 --- a/src/Compiler/TypedTree/CompilerGlobalState.fs +++ b/src/Compiler/TypedTree/CompilerGlobalState.fs @@ -20,7 +20,7 @@ type NiceNameGenerator() = let lockObj = obj() let basicNameCounts = Dictionary(100) - member x.FreshCompilerGeneratedName (name, m: range) = + member _.FreshCompilerGeneratedName (name, m: range) = lock lockObj (fun () -> let basicName = GetBasicNameOfPossibleCompilerGeneratedName name let n = @@ -31,7 +31,7 @@ type NiceNameGenerator() = basicNameCounts[basicName] <- n + 1 nm) - member x.Reset () = + member _.Reset () = lock lockObj (fun () -> basicNameCounts.Clear() ) diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index d55e5e40706..b63942d2c8c 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -3923,7 +3923,7 @@ type CheckedImplFile = member Signature: ModuleOrNamespaceType -/// Represents a complete typechecked assembly, made up of multiple implementation files. +/// Represents checked file, after optimization, equipped with the ability to do further optimization of expressions. [] type CheckedImplFileAfterOptimization = { ImplFile: CheckedImplFile diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 6678298f4b8..bc037c8af7e 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10040,60 +10040,64 @@ let (|IfUseResumableStateMachinesExpr|_|) g expr = /// Combine a list of ModuleOrNamespaceType's making up the description of a CCU. checking there are now /// duplicate modules etc. -let CombineCcuContentFragments m l = +let CombineCcuContentFragments l = /// Combine module types when multiple namespace fragments contribute to the /// same namespace, making new module specs as we go. - let rec CombineModuleOrNamespaceTypes path m (mty1: ModuleOrNamespaceType) (mty2: ModuleOrNamespaceType) = - match mty1.ModuleOrNamespaceKind, mty2.ModuleOrNamespaceKind with - | Namespace _, Namespace _ -> - let kind = mty1.ModuleOrNamespaceKind - let tab1 = mty1.AllEntitiesByLogicalMangledName - let tab2 = mty2.AllEntitiesByLogicalMangledName - let entities = - [ for e1 in mty1.AllEntities do - match tab2.TryGetValue e1.LogicalName with - | true, e2 -> yield CombineEntities path e1 e2 - | _ -> yield e1 - for e2 in mty2.AllEntities do - match tab1.TryGetValue e2.LogicalName with - | true, _ -> () - | _ -> yield e2 ] - - let vals = QueueList.append mty1.AllValsAndMembers mty2.AllValsAndMembers - - ModuleOrNamespaceType(kind, vals, QueueList.ofList entities) - - | Namespace _, _ | _, Namespace _ -> - error(Error(FSComp.SR.tastNamespaceAndModuleWithSameNameInAssembly(textOfPath path), m)) - - | _-> - error(Error(FSComp.SR.tastTwoModulesWithSameNameInAssembly(textOfPath path), m)) + let rec CombineModuleOrNamespaceTypes path (mty1: ModuleOrNamespaceType) (mty2: ModuleOrNamespaceType) = + let kind = mty1.ModuleOrNamespaceKind + let tab1 = mty1.AllEntitiesByLogicalMangledName + let tab2 = mty2.AllEntitiesByLogicalMangledName + let entities = + [ + for e1 in mty1.AllEntities do + match tab2.TryGetValue e1.LogicalName with + | true, e2 -> yield CombineEntities path e1 e2 + | _ -> yield e1 + + for e2 in mty2.AllEntities do + match tab1.TryGetValue e2.LogicalName with + | true, _ -> () + | _ -> yield e2 + ] + + let vals = QueueList.append mty1.AllValsAndMembers mty2.AllValsAndMembers + + ModuleOrNamespaceType(kind, vals, QueueList.ofList entities) and CombineEntities path (entity1: Entity) (entity2: Entity) = - match entity1.IsModuleOrNamespace, entity2.IsModuleOrNamespace with - | true, true -> - entity1 |> Construct.NewModifiedTycon (fun data1 -> - let xml = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc - { data1 with - entity_attribs = entity1.Attribs @ entity2.Attribs - entity_modul_type = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes (path@[entity2.DemangledModuleOrNamespaceName]) entity2.Range entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) - entity_opt_data = - match data1.entity_opt_data with - | Some optData -> Some { optData with entity_xmldoc = xml } - | _ -> Some { Entity.NewEmptyEntityOptData() with entity_xmldoc = xml } }) - | false, false -> - error(Error(FSComp.SR.tastDuplicateTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path), entity2.Range)) - | _, _ -> - error(Error(FSComp.SR.tastConflictingModuleAndTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path), entity2.Range)) + let path2 = path@[entity2.DemangledModuleOrNamespaceName] + + match entity1.IsNamespace, entity2.IsNamespace, entity1.IsModule, entity2.IsModule with + | true, true, _, _ -> + () + | true, _, _, _ + | _, true, _, _ -> + errorR(Error(FSComp.SR.tastNamespaceAndModuleWithSameNameInAssembly(textOfPath path2), entity2.Range)) + | false, false, false, false -> + errorR(Error(FSComp.SR.tastDuplicateTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path), entity2.Range)) + | false, false, true, true -> + errorR(Error(FSComp.SR.tastTwoModulesWithSameNameInAssembly(textOfPath path2), entity2.Range)) + | _ -> + errorR(Error(FSComp.SR.tastConflictingModuleAndTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path), entity2.Range)) + + entity1 |> Construct.NewModifiedTycon (fun data1 -> + let xml = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc + { data1 with + entity_attribs = entity1.Attribs @ entity2.Attribs + entity_modul_type = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes path2 entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) + entity_opt_data = + match data1.entity_opt_data with + | Some optData -> Some { optData with entity_xmldoc = xml } + | _ -> Some { Entity.NewEmptyEntityOptData() with entity_xmldoc = xml } }) - and CombineModuleOrNamespaceTypeList path m l = + and CombineModuleOrNamespaceTypeList path l = match l with - | h :: t -> List.fold (CombineModuleOrNamespaceTypes path m) h t + | h :: t -> List.fold (CombineModuleOrNamespaceTypes path) h t | _ -> failwith "CombineModuleOrNamespaceTypeList" - CombineModuleOrNamespaceTypeList [] m l + CombineModuleOrNamespaceTypeList [] l /// An immutable mappping from witnesses to some data. /// diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index c4afc142086..403498c5417 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2565,7 +2565,7 @@ val (|DelegateInvokeExpr|_|): TcGlobals -> Expr -> (Expr * TType * Expr * Expr * /// Match 'if __useResumableCode then ... else ...' expressions val (|IfUseResumableStateMachinesExpr|_|): TcGlobals -> Expr -> (Expr * Expr) option -val CombineCcuContentFragments: range -> ModuleOrNamespaceType list -> ModuleOrNamespaceType +val CombineCcuContentFragments: ModuleOrNamespaceType list -> ModuleOrNamespaceType /// Recognise a 'match __resumableEntry() with ...' expression val (|ResumableEntryMatchExpr|_|): g: TcGlobals -> Expr -> (Expr * Val * Expr * (Expr * Expr -> Expr)) option diff --git a/src/Compiler/Utilities/lib.fs b/src/Compiler/Utilities/lib.fs index b0e75623531..95a20226a2d 100755 --- a/src/Compiler/Utilities/lib.fs +++ b/src/Compiler/Utilities/lib.fs @@ -321,9 +321,9 @@ let buildString f = buf.ToString() /// Writing to output stream via a string buffer. -let writeViaBuffer (os: TextWriter) f x = +let writeViaBuffer (os: TextWriter) f = let buf = StringBuilder 100 - f buf x + f buf os.Write(buf.ToString()) type StringBuilder with @@ -608,4 +608,14 @@ module ArrayParallel = let inline map f (arr: 'T []) = arr |> mapi (fun _ item -> f item) + +[] +module ListParallel = + + let map f (xs: 'T list) = + xs + |> List.toArray + |> ArrayParallel.map f + |> Array.toList + \ No newline at end of file diff --git a/src/Compiler/Utilities/lib.fsi b/src/Compiler/Utilities/lib.fsi index 585d4a5911f..bab85ccd414 100644 --- a/src/Compiler/Utilities/lib.fsi +++ b/src/Compiler/Utilities/lib.fsi @@ -230,7 +230,7 @@ val equalOn: f: ('a -> 'b) -> x: 'a -> y: 'a -> bool when 'b: equality val buildString: f: (StringBuilder -> unit) -> string /// Writing to output stream via a string buffer. -val writeViaBuffer: os: TextWriter -> f: (StringBuilder -> 'a -> unit) -> x: 'a -> unit +val writeViaBuffer: os: TextWriter -> f: (StringBuilder -> unit) -> unit type StringBuilder with @@ -315,6 +315,21 @@ type DisposablesTracker = [] module ArrayParallel = + val inline iter: ('T -> unit) -> 'T[] -> unit + + val inline iteri: (int -> 'T -> unit) -> 'T[] -> unit + val inline map: ('T -> 'U) -> 'T[] -> 'U[] val inline mapi: (int -> 'T -> 'U) -> 'T[] -> 'U[] + +[] +module ListParallel = + + //val inline iter: ('T -> unit) -> 'T list -> unit + + //val inline iteri: (int -> 'T -> unit) -> 'T list -> unit + + val map: ('T -> 'U) -> 'T list -> 'U list + +//val inline mapi: (int -> 'T -> 'U) -> 'T list -> 'U list diff --git a/src/fsc/fscmain.fs b/src/fsc/fscmain.fs index 9fc65db7cdc..1f1d7109304 100644 --- a/src/fsc/fscmain.fs +++ b/src/fsc/fscmain.fs @@ -37,7 +37,7 @@ let main (argv) = Thread.CurrentThread.Name <- "F# Main Thread" // Set the initial phase to garbage collector to batch mode, which improves overall performance. - use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + use _ = UseBuildPhase BuildPhase.Parameter // An SDL recommendation UnmanagedProcessExecutionOptions.EnableHeapTerminationOnCorruption() diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index e6e08b27af7..105a6acff8e 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -183,6 +183,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/ParallelCheckingWithSignatureFilesTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/ParallelCheckingWithSignatureFilesTests.fs new file mode 100644 index 00000000000..9e187de1388 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/ParallelCheckingWithSignatureFilesTests.fs @@ -0,0 +1,61 @@ +module FSharp.Compiler.ComponentTests.TypeChecks.ParallelCheckingWithSignatureFilesTests + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +[] +let ``Parallel type checking when signature files are available`` () = + // File structure: + // Encode.fsi + // Encode.fs + // Decode.fsi + // Decode.fs + // Program.fs + + let encodeFsi = + Fsi + """ +module Encode + +val encode: obj -> string +""" + + let encodeFs = + SourceCodeFileKind.Create( + "Encode.fs", + """ +module Encode + +let encode (v: obj) : string = failwith "todo" +""" + ) + + let decodeFsi = + SourceCodeFileKind.Create( + "Decode.fsi", + """ +module Decode + +val decode: string -> obj +""" + ) + + let decodeFs = + SourceCodeFileKind.Create( + "Decode.fs", + """ +module Decode + +let decode (v: string) : obj = failwith "todo" +""" + ) + + let programFs = SourceCodeFileKind.Create("Program.fs", "printfn \"Hello from F#\"") + + encodeFsi + |> withAdditionalSourceFiles [ encodeFs; decodeFsi; decodeFs; programFs ] + |> withOptions [ "--test:ParallelCheckingWithSignatureFilesOn" ] + |> asExe + |> compile + |> shouldSucceed diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 083c2ea9310..6f38d493913 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2008,7 +2008,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String ToString() FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] DependencyFiles FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles() FSharp.Compiler.CodeAnalysis.FSharpChecker -FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance() FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions GetProjectOptionsFromCommandLineArgs(System.String, System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) @@ -5528,26 +5528,44 @@ FSharp.Compiler.Syntax.ParsedImplFileFragment: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedImplFileFragment: System.String ToString() FSharp.Compiler.Syntax.ParsedImplFileInput +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsExe +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsLastCompiland +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsScript +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsExe() +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsLastCompiland() +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_isScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean isScript FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.ParsedImplFileInput NewParsedImplFileInput(System.String, Boolean, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace], System.Tuple`2[System.Boolean,System.Boolean], FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia) +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_Trivia() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_trivia() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia trivia FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 get_Tag() +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] get_modules() -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] modules +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] Contents +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] contents +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] get_Contents() +FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] get_contents() +FSharp.Compiler.Syntax.ParsedImplFileInput: System.String FileName FSharp.Compiler.Syntax.ParsedImplFileInput: System.String ToString() FSharp.Compiler.Syntax.ParsedImplFileInput: System.String fileName +FSharp.Compiler.Syntax.ParsedImplFileInput: System.String get_FileName() FSharp.Compiler.Syntax.ParsedImplFileInput: System.String get_fileName() -FSharp.Compiler.Syntax.ParsedImplFileInput: System.Tuple`2[System.Boolean,System.Boolean] get_isLastCompiland() -FSharp.Compiler.Syntax.ParsedImplFileInput: System.Tuple`2[System.Boolean,System.Boolean] isLastCompiland +FSharp.Compiler.Syntax.ParsedImplFileInput: System.Tuple`2[System.Boolean,System.Boolean] flags +FSharp.Compiler.Syntax.ParsedImplFileInput: System.Tuple`2[System.Boolean,System.Boolean] get_flags() FSharp.Compiler.Syntax.ParsedInput FSharp.Compiler.Syntax.ParsedInput+ImplFile: FSharp.Compiler.Syntax.ParsedImplFileInput Item FSharp.Compiler.Syntax.ParsedInput+ImplFile: FSharp.Compiler.Syntax.ParsedImplFileInput get_Item() @@ -5564,10 +5582,14 @@ FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.ParsedInput NewSigFil FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.ParsedInput+ImplFile FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.ParsedInput+SigFile FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.ParsedInput+Tags +FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName +FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.ParsedInput: Int32 Tag FSharp.Compiler.Syntax.ParsedInput: Int32 get_Tag() +FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas +FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() FSharp.Compiler.Syntax.ParsedInput: System.String FileName FSharp.Compiler.Syntax.ParsedInput: System.String ToString() FSharp.Compiler.Syntax.ParsedInput: System.String get_FileName() @@ -5647,20 +5669,32 @@ FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileFragment: System.String ToString() FSharp.Compiler.Syntax.ParsedSigFileInput FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia) +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_Trivia() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_trivia() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia trivia FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 get_Tag() +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] get_modules() -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] modules +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] Contents +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] contents +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] get_Contents() +FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] get_contents() +FSharp.Compiler.Syntax.ParsedSigFileInput: System.String FileName FSharp.Compiler.Syntax.ParsedSigFileInput: System.String ToString() FSharp.Compiler.Syntax.ParsedSigFileInput: System.String fileName +FSharp.Compiler.Syntax.ParsedSigFileInput: System.String get_FileName() FSharp.Compiler.Syntax.ParsedSigFileInput: System.String get_fileName() FSharp.Compiler.Syntax.ParserDetail FSharp.Compiler.Syntax.ParserDetail+Tags: Int32 ErrorRecovery diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 2d24d2f678a..b871032a23b 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1128,7 +1128,7 @@ module rec Compiler = (sourceErrors, expectedErrors) ||> List.iter2 (fun actual expected -> - Assert.AreEqual(actual, expected, $"Mismatched error message:\nExpecting: {expected}\nActual: {actual}\n")) + Assert.AreEqual(expected, actual, $"Mismatched error message:\nExpecting: {expected}\nActual: {actual}\n")) let adjust (adjust: int) (result: CompilationResult) : CompilationResult = match result with @@ -1167,18 +1167,16 @@ module rec Compiler = withResults [expectedResult] result let withDiagnostics (expected: (ErrorType * Line * Col * Line * Col * string) list) (result: CompilationResult) : CompilationResult = - let (expectedResults: ErrorInfo list) = - expected |> - List.map( - fun e -> - let (error, (Line startLine), (Col startCol), (Line endLine), (Col endCol), message) = e + let expectedResults: ErrorInfo list = + [ for e in expected do + let (error, Line startLine, Col startCol, Line endLine, Col endCol, message) = e { Error = error Range = { StartLine = startLine StartColumn = startCol EndLine = endLine EndColumn = endCol } - Message = message }) + Message = message } ] withResults expectedResults result let withSingleDiagnostic (expected: (ErrorType * Line * Col * Line * Col * string)) (result: CompilationResult) : CompilationResult = diff --git a/tests/fsharp/typecheck/sigs/neg10.bsl b/tests/fsharp/typecheck/sigs/neg10.bsl index 40a58bfb096..ca47dbf94d0 100644 --- a/tests/fsharp/typecheck/sigs/neg10.bsl +++ b/tests/fsharp/typecheck/sigs/neg10.bsl @@ -245,5 +245,3 @@ neg10.fs(455,25,455,26): typecheck error FS0001: The type 'C' does not support a neg10.fs(456,24,456,25): typecheck error FS0001: The type 'C' does not support a conversion to the type 'int64' neg10.fs(457,26,457,27): typecheck error FS0001: The type 'C' does not support a conversion to the type 'decimal' - -neg10.fsi(1,1,1,1): typecheck error FS0240: The signature file 'Neg10' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. diff --git a/tests/service/Common.fs b/tests/service/Common.fs index fe50b7b5a8e..7f2a8e56813 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -210,7 +210,7 @@ let matchBraces (name: string, code: string) = let getSingleModuleLikeDecl (input: ParsedInput) = match input with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ decl ])) -> decl + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ decl ])) -> decl | _ -> failwith "Could not get module decls" let getSingleModuleMemberDecls (input: ParsedInput) = diff --git a/tests/service/InteractiveCheckerTests.fs b/tests/service/InteractiveCheckerTests.fs index ac208f8f6a3..d8494d490ed 100644 --- a/tests/service/InteractiveCheckerTests.fs +++ b/tests/service/InteractiveCheckerTests.fs @@ -54,7 +54,7 @@ let internal identsAndRanges (input: ParsedInput) = (identAndRange (longIdentToString longIdent) (longIdent |> List.map (fun id -> id.idRange) |> List.reduce unionRanges)) :: xs match input with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = modulesOrNamespaces)) -> + | ParsedInput.ImplFile(ParsedImplFileInput(contents = modulesOrNamespaces)) -> modulesOrNamespaces |> List.collect extractFromModuleOrNamespace | ParsedInput.SigFile _ -> [] diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index b6af2161a86..d9cb28398b9 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -98,7 +98,7 @@ extern int private c() extern int AccessibleChildren()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(false, [ SynBinding(range = mb) ] , ml) ]) ])) -> assertRange (2, 0) (3, 31) ml @@ -113,7 +113,7 @@ extern void setCallbridgeSupportTarget(IntPtr newTarget) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(false, [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = @@ -133,7 +133,7 @@ extern int AccessibleChildren(int* x) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(false, [ SynBinding(headPat = SynPat.LongIdent(argPats = SynArgPats.Pats [ @@ -157,7 +157,7 @@ extern int AccessibleChildren(obj& x) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(false, [ SynBinding(headPat = SynPat.LongIdent(argPats = SynArgPats.Pats [ @@ -181,7 +181,7 @@ extern int AccessibleChildren(void* x) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(false, [ SynBinding(headPat = SynPat.LongIdent(argPats = SynArgPats.Pats [ diff --git a/tests/service/SyntaxTreeTests/BindingTests.fs b/tests/service/SyntaxTreeTests/BindingTests.fs index c132b306ecd..95ea6685947 100644 --- a/tests/service/SyntaxTreeTests/BindingTests.fs +++ b/tests/service/SyntaxTreeTests/BindingTests.fs @@ -13,7 +13,7 @@ let ``Range of attribute should be included in SynModuleDecl.Let`` () = let a = 0""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt ]) ])) -> assertRange (2, 0) (3, 5) mb @@ -28,7 +28,7 @@ let ``Range of attribute between let keyword and pattern should be included in S let [] (A x) = 1""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(range = mb)]) as lt ]) ])) -> assertRange (2, 4) (2, 21) mb @@ -45,7 +45,7 @@ type Bar = let x = 8""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.LetBindings(bindings = [SynBinding(range = mb)]) as m]))]) ]) ])) -> assertRange (3, 4) (4, 9) mb @@ -62,7 +62,7 @@ type Bar = member this.Something () = ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) ]) ])) -> assertRange (3, 4) (4, 28) mb @@ -79,7 +79,7 @@ let ``Range of attribute should be included in binding of SynExpr.ObjExpr`` () = member x.ToString() = "F#" }""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [SynMemberDefn.Member(memberDefn=SynBinding(range = mb))])) ]) ])) -> assertRange (3, 4) (4, 23) mb @@ -95,7 +95,7 @@ type Tiger = new () = ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) ]) ])) -> assertRange (3, 4) (4, 10) mb @@ -112,7 +112,7 @@ type Tiger = new () as tony = ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.Member(memberDefn = SynBinding(range = mb)) as m]))]) ]) ])) -> assertRange (3, 4) (4, 18) mb @@ -136,7 +136,7 @@ type T() = T ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ SynMemberDefn.ImplicitCtor _ SynMemberDefn.Member(memberDefn = SynBinding(range = mb1)) as m1 @@ -162,7 +162,7 @@ type Crane = member this.MyWriteOnlyProperty with set (value) = myInternalValue <- value""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [SynMemberDefn.GetSetMember(memberDefnForSet = Some (SynBinding(range = mb))) as m]))]) ]) ])) -> @@ -182,7 +182,7 @@ type Bird = and set (value) = myInternalValue <- value""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ SynMemberDefn.GetSetMember(Some (SynBinding(range = mb1)), Some (SynBinding(range = mb2)), m, _) ]))]) @@ -198,7 +198,7 @@ let ``Range of equal sign should be present in SynModuleDecl.Let binding`` () = getParseResults "let v = 12" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) ]) ])) -> assertRange (1, 6) (1, 7) mEquals @@ -210,7 +210,7 @@ let ``Range of equal sign should be present in SynModuleDecl.Let binding, typed` getParseResults "let v : int = 12" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]) ]) ])) -> assertRange (1, 12) (1, 13) mEquals @@ -227,7 +227,7 @@ do """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) ]) ])) -> assertRange (3, 10) (3, 11) mEquals @@ -244,7 +244,7 @@ do """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings = [SynBinding(trivia={ EqualsRange = Some mEquals })]))) ]) ])) -> assertRange (3, 15) (3, 16) mEquals @@ -260,7 +260,7 @@ type X() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) ]) ])) -> assertRange (3, 18) (3, 19) mEquals @@ -276,7 +276,7 @@ type X() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) ]) ])) -> assertRange (3, 21) (3, 22) mEquals @@ -292,7 +292,7 @@ type X() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _; SynMemberDefn.Member(memberDefn = SynBinding(trivia={ EqualsRange = Some mEquals }))]))]) ]) ])) -> assertRange (3, 30) (3, 31) mEquals @@ -310,7 +310,7 @@ type Y() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ _ SynMemberDefn.GetSetMember( @@ -328,7 +328,7 @@ let ``Range of let keyword should be present in SynModuleDecl.Let binding`` () = getParseResults "let v = 12" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) ]) ])) -> assertRange (1, 0) (1, 3) mLet @@ -345,7 +345,7 @@ let v = 12 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(trivia={ LetKeyword = Some mLet })]) ]) ])) -> assertRange (5, 0) (5, 3) mLet @@ -361,7 +361,7 @@ let a = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(expr=SynExpr.LetOrUse(bindings=[SynBinding(trivia={ LetKeyword = Some mLet })]))]) ]) ])) -> assertRange (3, 4) (3, 7) mLet @@ -376,7 +376,7 @@ let b : int * string * bool = 1, "", false """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = SynType.Tuple(path = [ diff --git a/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs b/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs index 5a1de7621bd..243a06165c8 100644 --- a/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs +++ b/tests/service/SyntaxTreeTests/ComputationExpressionTests.fs @@ -18,7 +18,7 @@ async { """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ SynExprAndBang(range = mAndBang) @@ -42,7 +42,7 @@ async { """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr (expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = SynExpr.LetOrUseBang(andBangs = [ SynExprAndBang(range = mAndBang1; trivia={ InKeyword = Some mIn }) diff --git a/tests/service/SyntaxTreeTests/EnumCaseTests.fs b/tests/service/SyntaxTreeTests/EnumCaseTests.fs index 60dd4a1e6eb..1363ab095ac 100644 --- a/tests/service/SyntaxTreeTests/EnumCaseTests.fs +++ b/tests/service/SyntaxTreeTests/EnumCaseTests.fs @@ -12,7 +12,7 @@ type Foo = | Bar = 1 |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ @@ -36,7 +36,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ @@ -61,7 +61,7 @@ type Foo = Bar = 1 |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ diff --git a/tests/service/SyntaxTreeTests/ExceptionTests.fs b/tests/service/SyntaxTreeTests/ExceptionTests.fs index cd0ccef1cd1..a712eba5e6f 100644 --- a/tests/service/SyntaxTreeTests/ExceptionTests.fs +++ b/tests/service/SyntaxTreeTests/ExceptionTests.fs @@ -16,7 +16,7 @@ exception Foo with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace(decls = [ SynModuleDecl.Exception( exnDefn=SynExceptionDefn(withKeyword = Some mWithKeyword) ) diff --git a/tests/service/SyntaxTreeTests/ExpressionTests.fs b/tests/service/SyntaxTreeTests/ExpressionTests.fs index eb18d053d6a..a7f1dcbb8df 100644 --- a/tests/service/SyntaxTreeTests/ExpressionTests.fs +++ b/tests/service/SyntaxTreeTests/ExpressionTests.fs @@ -16,7 +16,7 @@ let ``SynExpr.Do contains the range of the do keyword`` () = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(expr = SynExpr.Sequential(expr1 = SynExpr.Do(_, doRange) ; expr2 = SynExpr.DoBang(_, doBangRange))) @@ -41,7 +41,7 @@ comp { |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(argExpr = SynExpr.ComputationExpr(expr = @@ -67,7 +67,7 @@ let ``SynExpr.Record contains the range of the equals sign in SynExprRecordField |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Record(recordFields = [ @@ -89,7 +89,7 @@ let ``inherit SynExpr.Record contains the range of the equals sign in SynExprRec |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Record(baseInfo = Some _ ; recordFields = [ @@ -112,7 +112,7 @@ let ``copy SynExpr.Record contains the range of the equals sign in SynExprRecord |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Record(copyInfo = Some _ ; recordFields = [ @@ -134,7 +134,7 @@ let ``SynExpr.AnonRecord contains the range of the equals sign in the fields`` ( |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.AnonRecd(recordFields = [ @@ -159,7 +159,7 @@ printf "%d " i |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.For(equalsRange = Some mEquals)) @@ -180,7 +180,7 @@ with |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(trivia={ TryKeyword = mTry; WithKeyword = mWith })) @@ -202,7 +202,7 @@ finally |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryFinally(trivia={ TryKeyword = mTry; FinallyKeyword = mFinally })) @@ -222,7 +222,7 @@ match x with |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Match(trivia = { MatchKeyword = mMatch; WithKeyword = mWith })) @@ -242,7 +242,7 @@ match! x with |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.MatchBang(trivia = { MatchBangKeyword = mMatch; WithKeyword = mWith })) @@ -265,7 +265,7 @@ let ``SynExpr.ObjExpr contains the range of with keyword`` () = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.ObjExpr(withKeyword=Some mWithObjExpr; extraImpls=[ SynInterfaceImpl(withKeyword=None); SynInterfaceImpl(withKeyword=Some mWithSynInterfaceImpl) ])) @@ -281,7 +281,7 @@ let ``SynExpr.LetOrUse contains the range of in keyword`` () = getParseResults "let x = 1 in ()" match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.LetOrUse(trivia={ InKeyword = Some mIn })) @@ -301,7 +301,7 @@ do """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(bindings=[_;_]; trivia={ InKeyword = Some mIn }))) @@ -321,7 +321,7 @@ let f () = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(expr = @@ -343,7 +343,7 @@ let x = 1 """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) @@ -362,7 +362,7 @@ e1.Key, e1.Value """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Do(expr = SynExpr.LetOrUse(trivia={ InKeyword = None }))) @@ -379,7 +379,7 @@ global """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.LongIdent(longDotId = SynLongIdent([mangledGlobal], [], [Some (IdentTrivia.OriginalNotation "global")])) @@ -400,7 +400,7 @@ let ``SynExprRecordFields contain correct amount of trivia`` () = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Record(recordFields = [ @@ -420,7 +420,7 @@ let ``SynExpr.Dynamic does contain ident`` () = getParseResults "x?k" match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Dynamic (_, _, SynExpr.Ident(idK) ,mDynamicExpr)) ]) @@ -435,7 +435,7 @@ let ``SynExpr.Dynamic does contain parentheses`` () = getParseResults "x?(g)" match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Dynamic (_, _, SynExpr.Paren(SynExpr.Ident(idG), lpr, Some rpr, mParen) ,mDynamicExpr)) @@ -454,7 +454,7 @@ let ``SynExpr.Set with SynExpr.Dynamic`` () = getParseResults "x?v <- 2" match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Set( SynExpr.Dynamic (_, _, SynExpr.Ident(idV) ,mDynamicExpr), @@ -481,7 +481,7 @@ type CFoo() = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types _ SynModuleDecl.Expr(expr = SynExpr.ObjExpr(members = [ diff --git a/tests/service/SyntaxTreeTests/IfThenElseTests.fs b/tests/service/SyntaxTreeTests/IfThenElseTests.fs index 7db54e4dfef..66cf9a82849 100644 --- a/tests/service/SyntaxTreeTests/IfThenElseTests.fs +++ b/tests/service/SyntaxTreeTests/IfThenElseTests.fs @@ -11,7 +11,7 @@ let ``If keyword in IfThenElse`` () = "if a then b" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = None }) ) @@ -27,7 +27,7 @@ let ``Else keyword in simple IfThenElse`` () = "if a then b else c" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr =SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) ) @@ -47,7 +47,7 @@ then b else c""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse }) ) @@ -67,7 +67,7 @@ b elif c then d""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = None } elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true }))) @@ -89,7 +89,7 @@ else if c then d""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif = false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) @@ -112,7 +112,7 @@ else if c then d""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIfKw; IsElif=false; ThenKeyword = mThenKw; ElseKeyword = Some mElse } elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElseIf; IsElif = false }))) @@ -140,7 +140,7 @@ else g""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = None } elseExpr = Some (SynExpr.IfThenElse(trivia={ IfKeyword = mElif; IsElif = true; ElseKeyword = Some mElse1 } @@ -165,7 +165,7 @@ else (* some long comment here *) if c then d""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.IfThenElse(trivia={ IfKeyword = mIf1; IsElif = false; ElseKeyword = Some mElse } elseExpr = Some (SynExpr.IfThenElse(trivia = { IfKeyword = mIf2; IsElif = false })))) diff --git a/tests/service/SyntaxTreeTests/LambdaTests.fs b/tests/service/SyntaxTreeTests/LambdaTests.fs index 788279f8e76..ebc343507ab 100644 --- a/tests/service/SyntaxTreeTests/LambdaTests.fs +++ b/tests/service/SyntaxTreeTests/LambdaTests.fs @@ -11,7 +11,7 @@ let ``Lambda with two parameters gives correct body`` () = "fun a b -> x" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Named _], SynExpr.Ident ident)) ) @@ -26,7 +26,7 @@ let ``Lambda with wild card parameter gives correct body`` () = "fun a _ b -> x" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Wild _; SynPat.Named _], SynExpr.Ident ident)) ) @@ -41,7 +41,7 @@ let ``Lambda with tuple parameter with wild card gives correct body`` () = "fun a (b, _) c -> x" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(parsedData = Some([SynPat.Named _; SynPat.Paren(SynPat.Tuple _,_); SynPat.Named _], SynExpr.Ident ident)) ) @@ -56,7 +56,7 @@ let ``Lambda with wild card that returns a lambda gives correct body`` () = "fun _ -> fun _ -> x" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Lambda(parsedData = Some([SynPat.Wild _], SynExpr.Ident ident)))) ) @@ -71,7 +71,7 @@ let ``Simple lambda has arrow range`` () = "fun x -> x" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) ) @@ -88,7 +88,7 @@ let ``Multiline lambda has arrow range`` () = x * y * z" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) ) @@ -103,7 +103,7 @@ let ``Destructed lambda has arrow range`` () = "fun { X = x } -> x * 2" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) ) @@ -118,7 +118,7 @@ let ``Tuple in lambda has arrow range`` () = "fun (x, _) -> x * 3" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) ) @@ -137,7 +137,7 @@ let ``Complex arguments lambda has arrow range`` () = x * y + z" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Lambda(trivia={ ArrowRange = Some mArrow }) ) diff --git a/tests/service/SyntaxTreeTests/MatchClauseTests.fs b/tests/service/SyntaxTreeTests/MatchClauseTests.fs index caa6c5d6da5..5c68abb598a 100644 --- a/tests/service/SyntaxTreeTests/MatchClauseTests.fs +++ b/tests/service/SyntaxTreeTests/MatchClauseTests.fs @@ -17,7 +17,7 @@ with ex -> None""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) ]) ])) -> assertRange (5, 5) (7, 8) range @@ -40,7 +40,7 @@ with None""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = r1) as clause1 SynMatchClause(range = r2) as clause2 ])) ]) ])) -> @@ -65,7 +65,7 @@ with | """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) ]) ])) -> assertRange (6, 2) (7, 6) range @@ -84,7 +84,7 @@ with | ex ->""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) ]) ])) -> assertRange (6, 2) (6, 4) range @@ -103,7 +103,7 @@ with | ex when (isNull ex) ->""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(range = range) as clause ])) ]) ])) -> assertRange (6, 2) (6, 21) range @@ -119,7 +119,7 @@ match foo with | Bar bar -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) ]) ])) -> assertRange (3, 10) (3, 12) mArrow @@ -134,7 +134,7 @@ match foo with | Bar bar when (someCheck bar) -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ ArrowRange = Some mArrow }) ])) ]) ])) -> assertRange (3, 31) (3, 33) mArrow @@ -149,7 +149,7 @@ match foo with | Bar bar when (someCheck bar) -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) ]) ])) -> assertRange (3, 0) (3, 1) mBar @@ -165,7 +165,7 @@ match foo with | Far too -> near ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Match(clauses = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) ]) ])) -> @@ -184,7 +184,7 @@ with | exn -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar }) ])) ]) ])) -> assertRange (5, 0) (5, 1) mBar @@ -202,7 +202,7 @@ with exn -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = None }) ])) ]) ])) -> Assert.Pass() @@ -222,7 +222,7 @@ with | ex -> ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.TryWith(withCases = [ SynMatchClause(trivia={ BarRange = Some mBar1 }) SynMatchClause(trivia={ BarRange = Some mBar2 }) ])) ]) ])) -> diff --git a/tests/service/SyntaxTreeTests/MeasureTests.fs b/tests/service/SyntaxTreeTests/MeasureTests.fs index 0e618693df9..f8c9f29271a 100644 --- a/tests/service/SyntaxTreeTests/MeasureTests.fs +++ b/tests/service/SyntaxTreeTests/MeasureTests.fs @@ -14,7 +14,7 @@ let m = 7.000 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r1), _)) ]) SynModuleDecl.Let(bindings = [ SynBinding.SynBinding(expr = SynExpr.Const(SynConst.Measure(constantRange = r2), _)) ]) ]) ])) -> @@ -31,7 +31,7 @@ let ``SynMeasure.Paren has correct range`` () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Const(SynConst.Measure(SynConst.UInt32 _, _, SynMeasure.Divide( SynMeasure.Seq([ SynMeasure.Named([ hrIdent ], _) ], _), @@ -62,7 +62,7 @@ let ``SynType.Tuple in measure type with no slashes`` () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = @@ -85,7 +85,7 @@ let ``SynType.Tuple in measure type with leading slash`` () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = @@ -107,7 +107,7 @@ let ``SynType.Tuple in measure type with start and slash`` () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = diff --git a/tests/service/SyntaxTreeTests/MemberFlagTests.fs b/tests/service/SyntaxTreeTests/MemberFlagTests.fs index b95d91bae9d..c29aad29300 100644 --- a/tests/service/SyntaxTreeTests/MemberFlagTests.fs +++ b/tests/service/SyntaxTreeTests/MemberFlagTests.fs @@ -22,7 +22,7 @@ type Y = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types(types =[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[ SynMemberSig.Member(flags={ Trivia= { AbstractRange = Some mAbstract1 } }) @@ -56,7 +56,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ @@ -85,7 +85,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ @@ -124,7 +124,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.ObjectModel (members=[ @@ -158,7 +158,7 @@ let meh = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let (bindings = [ SynBinding(expr=SynExpr.ObjExpr( diff --git a/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs b/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs index bf9c025c36a..ec215cb41be 100644 --- a/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs +++ b/tests/service/SyntaxTreeTests/ModuleOrNamespaceSigTests.fs @@ -15,7 +15,7 @@ type Bar = | Bar of string * int """ match parseResults with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace) as singleModule ])) -> assertRange (2,0) (4,32) singleModule.Range @@ -33,7 +33,7 @@ type Bar = | Bar of string * int """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> assertRange (3, 0) (5, 32) r | _ -> Assert.Fail "Could not get valid AST" @@ -50,7 +50,7 @@ val s : string """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> assertRange (2, 1) (5, 14) r | _ -> Assert.Fail "Could not get valid AST" @@ -66,7 +66,7 @@ val a: int """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> assertRange (2, 0) (2, 6) mModule | _ -> Assert.Fail "Could not get valid AST" @@ -82,7 +82,7 @@ val a: int """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> assertRange (2, 0) (2, 9) mNamespace | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file diff --git a/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs index 8091c0942d6..fcba2811028 100644 --- a/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs +++ b/tests/service/SyntaxTreeTests/ModuleOrNamespaceTests.fs @@ -16,7 +16,7 @@ type Teq<'a, 'b> """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r) ])) -> + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r) ])) -> assertRange (1, 0) (4, 8) r | _ -> Assert.Fail "Could not get valid AST" @@ -35,7 +35,7 @@ let x = 42 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r1) SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; range = r2) ])) -> assertRange (1, 0) (4, 20) r1 @@ -54,7 +54,7 @@ type X = int """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.GlobalNamespace; range = r) ])) -> assertRange (3, 0) (5, 12) r | _ -> Assert.Fail "Could not get valid AST" @@ -71,7 +71,7 @@ let s : string = "s" """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; range = r) ])) -> assertRange (2, 0) (5, 20) r | _ -> Assert.Fail "Could not get valid AST" @@ -96,7 +96,7 @@ let a = 42 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.NamedModule; trivia = { ModuleKeyword = Some mModule; NamespaceKeyword = None }) ])) -> assertRange (5, 0) (5, 6) mModule | _ -> Assert.Fail "Could not get valid AST" @@ -112,7 +112,7 @@ let a = 42 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(kind = SynModuleOrNamespaceKind.DeclaredNamespace; trivia = { ModuleKeyword = None; NamespaceKeyword = Some mNamespace }) ])) -> assertRange (2, 0) (2, 9) mNamespace | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" @@ -128,7 +128,7 @@ open global.Node """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Open(target = SynOpenDeclTarget.ModuleOrNamespace(longId = SynLongIdent(trivia = [ Some (IdentTrivia.OriginalNotation("global")); None ]))) ]) ])) -> diff --git a/tests/service/SyntaxTreeTests/NestedModuleTests.fs b/tests/service/SyntaxTreeTests/NestedModuleTests.fs index d6dcac70f76..fcdde98008a 100644 --- a/tests/service/SyntaxTreeTests/NestedModuleTests.fs +++ b/tests/service/SyntaxTreeTests/NestedModuleTests.fs @@ -18,7 +18,7 @@ module Nested = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.NestedModule _ as nm ]) as sigModule ])) -> assertRange (4, 0) (6, 15) nm.Range @@ -37,7 +37,7 @@ module Nested = ()""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.NestedModule _ as nm ]) ])) -> assertRange (4, 0) (6, 6) nm.Range @@ -53,7 +53,7 @@ module X = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) ]) ])) -> assertRange (2, 0) (2, 6) mModule @@ -72,7 +72,7 @@ val bar : int """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.NestedModule(trivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals }) ]) ])) -> assertRange (4, 0) (4, 6) mModule @@ -146,7 +146,7 @@ module Operators = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Open _ SynModuleSigDecl.Open _ SynModuleSigDecl.Open _ diff --git a/tests/service/SyntaxTreeTests/OperatorNameTests.fs b/tests/service/SyntaxTreeTests/OperatorNameTests.fs index ce64e19b85e..9efbb4dc972 100644 --- a/tests/service/SyntaxTreeTests/OperatorNameTests.fs +++ b/tests/service/SyntaxTreeTests/OperatorNameTests.fs @@ -13,7 +13,7 @@ let ``operator as function`` () = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = SynExpr.App(funcExpr = SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr))]))))) @@ -33,7 +33,7 @@ let ``active pattern as function `` () = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = SynExpr.LongIdent(false, SynLongIdent([ ident ], _, [ Some(IdentTrivia.HasParenthesis(lpr, rpr)) ]), None, pr))) @@ -54,7 +54,7 @@ let ``partial active pattern as function `` () = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr (expr = SynExpr.App(funcExpr = SynExpr.LongIdent(false, SynLongIdent([ ident ], _, [ Some(IdentTrivia.HasParenthesis(lpr, rpr)) ]), None, pr))) @@ -75,7 +75,7 @@ let (+) a b = a + b |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(headPat= SynPat.LongIdent(longDotId = SynLongIdent([ ident ],_, [ Some (IdentTrivia.OriginalNotationWithParen(lpr, "+", rpr)) ]))) @@ -95,7 +95,7 @@ let (|Odd|Even|) (a: int) = if a % 2 = 0 then Even else Odd |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(headPat= SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) @@ -115,7 +115,7 @@ let (|Int32Const|_|) (a: SynConst) = match a with SynConst.Int32 _ -> Some a | _ |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(headPat= SynPat.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.HasParenthesis(lpr, rpr))]))) @@ -135,7 +135,7 @@ let (|Boolean|_|) = Boolean.parse |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(headPat= SynPat.Named(ident = SynIdent(ident, Some (IdentTrivia.HasParenthesis(lpr, rpr))))) @@ -157,7 +157,7 @@ val (&): e1: bool -> e2: bool -> bool |> getParseResultsOfSignatureFile match ast with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Val(valSig = SynValSig(ident = SynIdent(ident, Some (IdentTrivia.OriginalNotationWithParen(lpr, "&", rpr))) ))]) @@ -186,7 +186,7 @@ let ``operator name in val constraint`` () = """ match ast with - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Val(valSig = SynValSig(synType=SynType.WithGlobalConstraints(constraints=[ SynTypeConstraint.WhereTyparSupportsMember(memberSig=SynMemberSig.Member(memberSig=SynValSig(ident = @@ -208,7 +208,7 @@ f(x=4) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(argExpr = SynExpr.Paren(expr = SynExpr.App(funcExpr= SynExpr.App(funcExpr= SynExpr.LongIdent(longDotId = SynLongIdent([ident], _, [Some (IdentTrivia.OriginalNotation "=")]))))))) @@ -226,7 +226,7 @@ let ``infix operation`` () = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(funcExpr = SynExpr.App(isInfix = true @@ -247,7 +247,7 @@ let ``prefix operation`` () = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(isInfix = false @@ -267,7 +267,7 @@ let ``prefix operation with two characters`` () = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(isInfix = false @@ -289,7 +289,7 @@ op_Addition a b """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(funcExpr = SynExpr.App(isInfix = false @@ -324,7 +324,7 @@ type X with """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(members = [ @@ -350,7 +350,7 @@ nameof(+) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(isInfix = false @@ -375,7 +375,7 @@ f(?x = 7) """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.App(isInfix = false @@ -408,7 +408,7 @@ type X() = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn.SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members =[ @@ -437,7 +437,7 @@ let PowByte (x:byte) n = Checked.( * ) x """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(expr = SynExpr.App(funcExpr = @@ -465,7 +465,7 @@ type A() = """ match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ diff --git a/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs b/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs index d59587c6b36..f834680fdff 100644 --- a/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs +++ b/tests/service/SyntaxTreeTests/ParsedHashDirectiveTests.fs @@ -11,7 +11,7 @@ let ``SourceIdentifier as ParsedHashDirectiveArgument`` () = "#I __SOURCE_DIRECTORY__" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.SourceIdentifier(c,_,m) ] , _), _) ]) ])) -> Assert.AreEqual("__SOURCE_DIRECTORY__", c) @@ -25,7 +25,7 @@ let ``Regular String as ParsedHashDirectiveArgument`` () = "#I \"/tmp\"" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Regular, m) ] , _), _) ]) ])) -> Assert.AreEqual("/tmp", v) @@ -39,7 +39,7 @@ let ``Verbatim String as ParsedHashDirectiveArgument`` () = "#I @\"C:\\Temp\"" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.HashDirective(ParsedHashDirective("I", [ ParsedHashDirectiveArgument.String(v, SynStringKind.Verbatim, m) ] , _), _) ]) ])) -> Assert.AreEqual("C:\\Temp", v) @@ -53,7 +53,7 @@ let ``Triple quote String as ParsedHashDirectiveArgument`` () = "#nowarn \"\"\"40\"\"\"" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.HashDirective(ParsedHashDirective("nowarn", [ ParsedHashDirectiveArgument.String(v, SynStringKind.TripleQuote, m) ] , _), _) ]) ])) -> Assert.AreEqual("40", v) diff --git a/tests/service/SyntaxTreeTests/PatternTests.fs b/tests/service/SyntaxTreeTests/PatternTests.fs index 42905ec976f..61a511dc88a 100644 --- a/tests/service/SyntaxTreeTests/PatternTests.fs +++ b/tests/service/SyntaxTreeTests/PatternTests.fs @@ -16,7 +16,7 @@ match x with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Record(fieldPats = [ (_, mEquals, _) ])) ; _ ]) ) @@ -34,7 +34,7 @@ match x with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.LongIdent(argPats = SynArgPats.NamePatPairs(pats = [ _, mEquals ,_ ])))]) ) @@ -54,7 +54,7 @@ match x with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.Or(trivia={ BarRange = mBar })) ; _ ]) ) @@ -71,7 +71,7 @@ let (head::tail) = [ 1;2;4] """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let( bindings = [ SynBinding(headPat = SynPat.Paren(SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ])), _)) ] ) @@ -89,7 +89,7 @@ match x with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr( expr = SynExpr.Match(clauses = [ SynMatchClause(pat = SynPat.LongIdent(longDotId = SynLongIdent([ opColonColonIdent ], _, [ Some (IdentTrivia.OriginalNotation "::") ]))) diff --git a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs index e7f8055fee9..7532e835ca2 100644 --- a/tests/service/SyntaxTreeTests/SignatureTypeTests.fs +++ b/tests/service/SyntaxTreeTests/SignatureTypeTests.fs @@ -18,7 +18,7 @@ type Meh = // foo""" match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(range = r)]) ])) -> assertRange (3, 0) (5,11) r | _ -> Assert.Fail "Could not get valid AST" @@ -33,7 +33,7 @@ type MyRecord = member Score : unit -> int""" match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> assertRange (2, 0) (4, 30) mTypes assertRange (2, 5) (4, 30) mSynTypeDefnSig @@ -50,7 +50,7 @@ type MyRecord = member Score : unit -> int""" match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> assertRange (2, 0) (5, 30) mTypes assertRange (2, 5) (5, 30) mSynTypeDefnSig @@ -65,7 +65,7 @@ type MyFunction = delegate of int -> string""" match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes) ]) ])) -> assertRange (2, 0) (3, 29) mTypes assertRange (2, 5) (3, 29) mSynTypeDefnSig @@ -81,7 +81,7 @@ type SomeCollection with val SomeThingElse : int -> string""" match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([SynTypeDefnSig.SynTypeDefnSig(range=mSynTypeDefnSig)], mTypes)]) ])) -> assertRange (2, 0) (4, 37) mTypes assertRange (2, 5) (4, 37) mSynTypeDefnSig @@ -101,7 +101,7 @@ type MyType = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types(types = [SynTypeDefnSig.SynTypeDefnSig(range = r)]) as t]) ])) -> assertRange (4, 0) (7, 7) r assertRange (4, 0) (7, 7) t.Range @@ -126,7 +126,7 @@ and [] Bang = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Types([ SynTypeDefnSig.SynTypeDefnSig(range = r1) SynTypeDefnSig.SynTypeDefnSig(range = r2) @@ -149,7 +149,7 @@ type FooType = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types(types = [ SynTypeDefnSig.SynTypeDefnSig(typeRepr = @@ -171,7 +171,7 @@ type X = delegate of string -> string """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _)) ] @@ -193,7 +193,7 @@ type Foobar = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.ObjectModel(kind = SynTypeDefnKind.Class)) ] @@ -215,7 +215,7 @@ type Bear = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.Simple(repr = @@ -243,7 +243,7 @@ type Shape = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( types = [ SynTypeDefnSig(trivia = { EqualsRange = Some mEquals } typeRepr = SynTypeDefnSigRepr.Simple(repr = SynTypeDefnSimpleRepr.Union _)) ] @@ -264,7 +264,7 @@ member Meh : unit -> unit """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules =[ SynModuleOrNamespaceSig(decls =[ + | ParsedInput.SigFile (ParsedSigFileInput (contents =[ SynModuleOrNamespaceSig(decls =[ SynModuleSigDecl.Types( types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.Simple _ trivia = { WithKeyword = Some mWithKeyword }) ] @@ -285,7 +285,7 @@ member Meh : unit -> unit """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Exception( exnSig=SynExceptionSig(withKeyword = Some mWithKeyword) ) @@ -305,7 +305,7 @@ type Foo = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules = [ SynModuleOrNamespaceSig(decls = [ + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types( types=[ SynTypeDefnSig(typeRepr=SynTypeDefnSigRepr.ObjectModel(memberSigs=[SynMemberSig.Member(memberSig=SynValSig(trivia = { WithKeyword = Some mWithKeyword }))])) ] ) @@ -328,7 +328,7 @@ exception SyntaxError of obj * range: range """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Exception( SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) @@ -352,7 +352,7 @@ open Foo """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Exception( SynExceptionSig(exnRepr=SynExceptionDefnRepr(range=mSynExceptionDefnRepr); range=mSynExceptionSig), mException) @@ -376,7 +376,7 @@ val a : int """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Val(valSig = SynValSig(trivia = { ValKeyword = Some mVal })) ] ) ])) -> @@ -394,7 +394,7 @@ val a : int = 9 """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Val(valSig = SynValSig(trivia = { EqualsRange = Some mEquals }); range = mVal) ] ) ])) -> @@ -414,7 +414,7 @@ type X = """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Types(types = [ SynTypeDefnSig(typeRepr = SynTypeDefnSigRepr.ObjectModel(memberSigs = [ @@ -448,7 +448,7 @@ type Z with """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Types(types = [ SynTypeDefnSig(trivia = { TypeKeyword = Some mType1 @@ -485,7 +485,7 @@ val InferSynValData: """ match parseResults with - | ParsedInput.SigFile (ParsedSigFileInput (modules=[ + | ParsedInput.SigFile (ParsedSigFileInput (contents=[ SynModuleOrNamespaceSig(decls=[ SynModuleSigDecl.Val(valSig = SynValSig(synType = SynType.Fun( diff --git a/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs b/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs index 190f2664574..f7d96c3a7ea 100644 --- a/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs +++ b/tests/service/SyntaxTreeTests/SourceIdentifierTests.fs @@ -13,7 +13,7 @@ let ``__LINE__`` () = __LINE__""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__LINE__", "2", range), _)) ]) ])) -> assertRange (2, 0) (2, 8) range @@ -27,7 +27,7 @@ let ``__SOURCE_DIRECTORY__`` () = __SOURCE_DIRECTORY__""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_DIRECTORY__", _, range), _)) ]) ])) -> assertRange (2, 0) (2, 20) range @@ -41,7 +41,7 @@ let ``__SOURCE_FILE__`` () = __SOURCE_FILE__""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_FILE__", _, range), _)) ]) ])) -> assertRange (2, 0) (2, 15) range diff --git a/tests/service/SyntaxTreeTests/StringTests.fs b/tests/service/SyntaxTreeTests/StringTests.fs index d75384d8f60..c562b2450a6 100644 --- a/tests/service/SyntaxTreeTests/StringTests.fs +++ b/tests/service/SyntaxTreeTests/StringTests.fs @@ -7,7 +7,7 @@ open FsUnit let private getBindingExpressionValue (parseResults: ParsedInput) = match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> + | ParsedInput.ImplFile (ParsedImplFileInput (contents = modules)) -> modules |> List.tryPick (fun (SynModuleOrNamespace (decls = decls)) -> decls |> List.tryPick (fun decl -> match decl with diff --git a/tests/service/SyntaxTreeTests/TypeTests.fs b/tests/service/SyntaxTreeTests/TypeTests.fs index 0c822ea94dc..874c1f41dac 100644 --- a/tests/service/SyntaxTreeTests/TypeTests.fs +++ b/tests/service/SyntaxTreeTests/TypeTests.fs @@ -14,7 +14,7 @@ type Foo = One = 0x00000001 """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn.SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r) ])))]) @@ -33,7 +33,7 @@ type Foo = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn.SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ SynEnumCase.SynEnumCase(valueRange = r1) @@ -54,7 +54,7 @@ type Bar = end""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [t]) as types ]) ])) -> assertRange (2, 0) (5, 7) types.Range @@ -77,7 +77,7 @@ and [] Bar<'context, 'a> = }""" match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [t1;t2]) as types ]) ])) -> assertRange (2, 0) (10, 5) types.Range @@ -94,7 +94,7 @@ type X = delegate of string -> string """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Delegate _) trivia={ EqualsRange = Some mEquals }) ] @@ -114,7 +114,7 @@ type Foobar () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = SynTypeDefnKind.Class) trivia={ EqualsRange = Some mEquals }) ] @@ -134,7 +134,7 @@ type Bear = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Enum(cases = [ @@ -160,7 +160,7 @@ type Shape = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = SynTypeDefnSimpleRepr.Union _) trivia={ EqualsRange = Some mEquals }) ] @@ -181,7 +181,7 @@ type Person(name : string, age : int) = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ ; SynMemberDefn.AutoProperty(equalsRange = mEquals)])) ] ) @@ -201,7 +201,7 @@ type Foo = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr=SynTypeDefnRepr.Simple(simpleRepr= SynTypeDefnSimpleRepr.Record _) trivia={ WithKeyword = Some mWithKeyword }) ] @@ -220,7 +220,7 @@ type Int32 with """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation mWithKeyword)) ] ) @@ -240,7 +240,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ SynMemberDefn.ImplicitCtor _ SynMemberDefn.Interface(withKeyword=Some mWithKeyword) @@ -261,7 +261,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ SynMemberDefn.AutoProperty(withKeyword=Some mWith) @@ -281,7 +281,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [_ SynMemberDefn.AbstractSlot(slotSig=SynValSig(trivia = { WithKeyword = Some mWith }))])) ] @@ -301,7 +301,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ @@ -323,7 +323,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ @@ -347,7 +347,7 @@ type Foo() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members=[ @@ -371,7 +371,7 @@ and C = D """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) SynTypeDefn(trivia={ TypeKeyword = None }) ] @@ -391,7 +391,7 @@ type A = B """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(trivia={ TypeKeyword = Some mType }) ] ) @@ -411,7 +411,7 @@ type Foo = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ SynMemberDefn.GetSetMember(Some _, Some _, m, { WithKeyword = mWith @@ -438,7 +438,7 @@ type A() = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types( typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ SynMemberDefn.ImplicitCtor _ @@ -473,7 +473,7 @@ let ``SynType.Fun has range of arrow`` () = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = @@ -494,7 +494,7 @@ let _: struct (int * int) = () """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = SynType.Tuple(true, [ SynTupleTypeSegment.Type _ ; SynTupleTypeSegment.Star _ ; SynTupleTypeSegment.Type _ ], mTuple)))) ]) @@ -514,7 +514,7 @@ let _: struct (int * int = () """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [ SynBinding(returnInfo = Some (SynBindingReturnInfo(typeName = SynType.Tuple(true, [ SynTupleTypeSegment.Type _ ; SynTupleTypeSegment.Star _ ; SynTupleTypeSegment.Type _ ], mTuple)))) ]) @@ -534,7 +534,7 @@ type Foo = delegate of a: A * b: B -> c:C -> D """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(kind = @@ -569,7 +569,7 @@ type X = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel( diff --git a/tests/service/SyntaxTreeTests/UnionCaseTests.fs b/tests/service/SyntaxTreeTests/UnionCaseTests.fs index c9c480cc16e..c40a3ecc232 100644 --- a/tests/service/SyntaxTreeTests/UnionCaseTests.fs +++ b/tests/service/SyntaxTreeTests/UnionCaseTests.fs @@ -19,7 +19,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ @@ -50,7 +50,7 @@ type Foo = | Bar of string |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ @@ -73,7 +73,7 @@ type Foo = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ @@ -96,7 +96,7 @@ type Foo = Bar of string |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union(unionCases = [ @@ -124,7 +124,7 @@ type Currency = |> getParseResults match ast with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types ([ SynTypeDefn.SynTypeDefn (typeRepr = SynTypeDefnRepr.Simple (simpleRepr = SynTypeDefnSimpleRepr.Union( @@ -147,7 +147,7 @@ type X = """ match parseResults with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.Simple(simpleRepr = diff --git a/tests/service/XmlDocTests.fs b/tests/service/XmlDocTests.fs index 76bce785065..cb0266e55ff 100644 --- a/tests/service/XmlDocTests.fs +++ b/tests/service/XmlDocTests.fs @@ -17,12 +17,12 @@ open FsUnit open NUnit.Framework let (|Types|TypeSigs|) = function - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Types(range = range; typeDefns = types)])])) -> Types(range, types) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Types(range = range; types = types)])])) -> TypeSigs(range, types) @@ -38,34 +38,34 @@ let (|TypeSigRange|) = function typeRange, componentInfoRange let (|Module|NestedModules|NestedModulesSigs|) = function - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.NestedModule(range = range1) SynModuleDecl.NestedModule(range = range2)])])) -> NestedModules(range1, range2) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.NestedModule(range = range1) SynModuleSigDecl.NestedModule(range = range2)])])) -> NestedModulesSigs(range1, range2) - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(range = range)])) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(range = range)])) -> Module(range) | x -> failwith $"Unexpected ParsedInput %A{x}" let (|Exception|) = function - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Exception(range = range; exnDefn = SynExceptionDefn(range = exnDefnRange; exnRepr = SynExceptionDefnRepr(range = exnDefnReprRange)))])])) -> Exception(range, exnDefnRange, exnDefnReprRange) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Exception(range = range; exnSig = SynExceptionSig(range = exnSpfnRange; exnRepr = @@ -99,26 +99,26 @@ let (|Members|MemberSigs|) = function | x -> failwith $"Unexpected ParsedInput %A{x}" let (|Decls|LetBindings|ValSig|LetOrUse|) = function - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(bindings = [SynBinding(expr = SynExpr.LetOrUse(range = range; bindings = bindings))])])])) -> LetOrUse(range, bindings) - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Let(range = range; bindings = bindings)])])) -> LetBindings(range, bindings) - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.LetOrUse(range = range; bindings = bindings))])])) -> LetBindings(range, bindings) - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [ + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = decls)])) -> Decls(decls) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [ + | ParsedInput.SigFile(ParsedSigFileInput(contents = [ SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(decls = [ SynModuleSigDecl.Val(valSig = SynValSig(range = valSigRange); range = range)])])) -> ValSig(range, valSigRange) @@ -1374,8 +1374,8 @@ namespace N checkParsingErrors [|Information 3520, Line 2, Col 0, Line 2, Col 4, "XML comment is not placed on a valid language element."|] match parseResults.ParseTree with - | ParsedInput.ImplFile(ParsedImplFileInput(modules = [SynModuleOrNamespace.SynModuleOrNamespace(range = range)])) - | ParsedInput.SigFile(ParsedSigFileInput(modules = [SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(range = range)])) -> + | ParsedInput.ImplFile(ParsedImplFileInput(contents = [SynModuleOrNamespace.SynModuleOrNamespace(range = range)])) + | ParsedInput.SigFile(ParsedSigFileInput(contents = [SynModuleOrNamespaceSig.SynModuleOrNamespaceSig(range = range)])) -> assertRange (3, 0) (3, 11) range | x -> failwith $"Unexpected ParsedInput %A{x}") diff --git a/vsintegration/tests/UnitTests/Tests.Watson.fs b/vsintegration/tests/UnitTests/Tests.Watson.fs index 54122e4ff71..35ccf0f4d03 100644 --- a/vsintegration/tests/UnitTests/Tests.Watson.fs +++ b/vsintegration/tests/UnitTests/Tests.Watson.fs @@ -19,7 +19,7 @@ type Check = try try #if DEBUG - FSharp.Compiler.CompilerDiagnostics.CompilerService.showAssertForUnexpectedException := false + FSharp.Compiler.CompilerDiagnostics.showAssertForUnexpectedException := false #endif if (FileSystem.FileExistsShim("watson-test.fs")) then FileSystem.FileDeleteShim("watson-test.fs") @@ -46,7 +46,7 @@ type Check = Assert.Fail("An InternalError exception occurred.") finally #if DEBUG - FSharp.Compiler.CompilerDiagnostics.CompilerService.showAssertForUnexpectedException := true + FSharp.Compiler.CompilerDiagnostics.showAssertForUnexpectedException := true #endif FileSystem.FileDeleteShim("watson-test.fs") From 342a6d2564d4718acfdfadce7130b3fd1510d732 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 21 Sep 2022 21:38:37 +0200 Subject: [PATCH 191/226] Fix FSharp.Core references in FCS solution (#13827) * Allow using FSharp.Core package in new service solution projects * Remove inner rules * Another FSharp.Core reference * Fix relative path Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- Directory.Build.props | 9 +++++++++ src/Directory.Build.props | 9 --------- .../FSharp.Compiler.ComponentTests.fsproj | 9 ++++++++- .../BenchmarkComparison/HistoricalBenchmark.fsproj | 9 ++++++++- .../FSharp.Compiler.Benchmarks.fsproj | 9 ++++++++- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index de4eb4723e5..0d93c757059 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,6 +3,15 @@ + + + true + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5950a28ad0f..68eba530bc9 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,15 +2,6 @@ - - - true - - true false diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 105a6acff8e..4acda7d0cd7 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -213,8 +213,15 @@ - + + + + + + + + diff --git a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj index 7885ef99ad2..089b6a546c6 100644 --- a/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj +++ b/tests/benchmarks/FCSBenchmarks/BenchmarkComparison/HistoricalBenchmark.fsproj @@ -40,7 +40,6 @@ - + + + + + + + + diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj index 299bf973853..4bdb142e62b 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj @@ -27,8 +27,15 @@ - + + + + + + + + From 3a3b812414a57aa9f6e00e08282eee2bb03e6818 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 22 Sep 2022 15:09:16 +0100 Subject: [PATCH 192/226] fix 13533 (#13950) --- src/Compiler/Checking/PostInferenceChecks.fs | 13 +------------ src/Compiler/FSComp.txt | 2 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.de.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.es.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.it.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ----- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ----- .../General/E_ObjectConstructorAndTry01.fs | 2 +- .../General/E_ObjectConstructorAndTry02.fs | 2 +- 17 files changed, 4 insertions(+), 80 deletions(-) diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 41b4922a7d0..b4d9acf83f9 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -85,9 +85,6 @@ type env = /// "module remap info", i.e. hiding information down the signature chain, used to compute what's hidden by a signature sigToImplRemapInfo: (Remap * SignatureHidingInfo) list - /// Constructor limited - are we in the prelude of a constructor, prior to object initialization - ctorLimitedZone: bool - /// Are we in a quotation? quote : bool @@ -1143,7 +1140,7 @@ and CheckExpr (cenv: cenv) (env: env) origExpr (ctxt: PermitByRefExpr) : Limit = | Expr.Sequential (e1, e2, ThenDoSeq, _) -> CheckExprNoByrefs cenv env e1 - CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 + CheckExprNoByrefs cenv env e2 NoLimit | Expr.Const (_, m, ty) -> @@ -1425,9 +1422,6 @@ and CheckNoResumableStmtConstructs cenv _env expr = and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = let g = cenv.g - let ctorLimitedZoneCheck() = - if env.ctorLimitedZone then errorR(Error(FSComp.SR.chkObjCtorsCantUseExceptionHandling(), m)) - // Ensure anonymous record type requirements are recorded match op with | TOp.AnonRecdGet (anonInfo, _) @@ -1444,7 +1438,6 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = | TOp.TryFinally _, [_], [Expr.Lambda (_, _, _, [_], e1, _, _); Expr.Lambda (_, _, _, [_], e2, _, _)] -> CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/finally can be a byref - ctorLimitedZoneCheck() let limit = CheckExpr cenv env e1 ctxt // result of a try/finally can be a byref if in a position where the overall expression is can be a byref CheckExprNoByrefs cenv env e2 limit @@ -1455,7 +1448,6 @@ and CheckExprOp cenv env (op, tyargs, args, m) ctxt expr = | TOp.TryWith _, [_], [Expr.Lambda (_, _, _, [_], e1, _, _); Expr.Lambda (_, _, _, [_], _e2, _, _); Expr.Lambda (_, _, _, [_], e3, _, _)] -> CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/catch can be a byref - ctorLimitedZoneCheck() let limit1 = CheckExpr cenv env e1 ctxt // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] let limit2 = CheckExpr cenv env e3 ctxt // result of a try/catch can be a byref if in a position where the overall expression is can be a byref @@ -2010,8 +2002,6 @@ and CheckBinding cenv env alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bin let access = AdjustAccess (IsHiddenVal env.sigToImplRemapInfo v) (fun () -> v.DeclaringEntity.CompilationPath) v.Accessibility CheckTypeForAccess cenv env (fun () -> NicePrint.stringOfQualifiedValOrMember cenv.denv cenv.infoReader vref) access v.Range v.Type - let env = if v.IsConstructor && not v.IsIncrClassConstructor then { env with ctorLimitedZone=true } else env - if cenv.reportErrors then // Check top-level let-bound values @@ -2643,7 +2633,6 @@ let CheckImplFile (g, amap, reportErrors, infoReader, internalsVisibleToPaths, v let env = { sigToImplRemapInfo=[] quote=false - ctorLimitedZone=false boundTyparNames=[] argVals = ValMap.Empty boundTypars= TyparMap.Empty diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 64f0876b61d..086d5279488 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -252,7 +252,7 @@ chkVariableUsedInInvalidWay,"The variable '%s' is used in an invalid way" 417,chkNoFirstClassRethrow,"First-class uses of the 'reraise' function is not permitted" 418,chkNoByrefAtThisPoint,"The byref typed value '%s' cannot be used at this point" 419,chkLimitationsOfBaseKeyword,"'base' values may only be used to make direct calls to the base implementations of overridden members" -420,chkObjCtorsCantUseExceptionHandling,"Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL." +#420,chkObjCtorsCantUseExceptionHandling,"Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL." 421,chkNoAddressOfAtThisPoint,"The address of the variable '%s' cannot be used at this point" 422,chkNoAddressStaticFieldAtThisPoint,"The address of the static field '%s' cannot be used at this point" 423,chkNoAddressFieldAtThisPoint,"The address of the field '%s' cannot be used at this point" diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8a1853a380f..a9e1c015194 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -2257,11 +2257,6 @@ Hodnoty base se dají použít jenom k přímému volání implementací base přepsaných členů. - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Konstruktory objektu nemůžou použít try/with a try/finally přímo, dokud se objekt neinicializuje. To zahrnuje i konstrukce, jako je třeba for x in ..., které se dají na použití těchto konstruktorů rozpracovat. Toto je omezení mezijazyka Common IL. - - The address of the variable '{0}' cannot be used at this point Adresa proměnné {0} se na tomto místě použít nedá. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index e96c8e1d3b2..98d3cec79d8 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -2257,11 +2257,6 @@ base-Werte dürfen nur für direkte Aufrufe der Basisimplementierungen von überschriebenen Membern verwendet werden. - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Objektkonstruktoren dürfen "try/with" und "try/finally" vor der Initialisierung des Objekts nicht direkt verwenden. Dies umfasst Konstrukte wie "for x in ...", bei denen diese Konstrukte u.U. verwendet werden. Dies ist eine Einschränkung der Common IL. - - The address of the variable '{0}' cannot be used at this point Die Adresse der Variablen "{0}" kann an diesem Punkt nicht verwendet werden. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 8c034062331..9ea5c76f74c 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -2257,11 +2257,6 @@ Los valores 'base' se pueden usar solo para realizar llamadas directas a las implementaciones base de miembros invalidados. - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Los constructores de objetos no pueden usar directamente try/with y try/finally antes de la inicialización del objeto. Esto incluye constructores como 'for x in ...' que pueden dar lugar a usos de estos constructores. Esta es una limitación impuesta por Common IL. - - The address of the variable '{0}' cannot be used at this point La dirección de la variable '{0}' no se puede usar en este punto. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index ab6345e8e0c..608877dac83 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -2257,11 +2257,6 @@ Les valeurs 'base' ne peuvent être utilisées que pour effectuer des appels directs aux implémentations de base des membres substitués - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Les constructeurs d'objets ne peuvent pas utiliser directement try/with et try/finally avant l'initialisation de l'objet. Cela inclut les constructions telles que 'for x in ...' qui peuvent conduire aux utilisations de ces constructions. Il s'agit d'une limitation imposée par le langage CIL (Common Intermediate Language). - - The address of the variable '{0}' cannot be used at this point Impossible d'utiliser l'adresse de la variable '{0}' actuellement diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 85a4a4cd333..c616f13a22a 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -2257,11 +2257,6 @@ I valori 'base' possono essere utilizzati esclusivamente per effettuare chiamate dirette alle implementazioni di base dei membri sottoposti a override - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - I costruttori di oggetti non possono utilizzare direttamente try/with e try/finally prima dell'inizializzazione dell'oggetto. Ciò include costrutti quali 'for x in ...' che potrebbero essere elaborati negli utilizzi di tali costrutti. Si tratta di una limitazione imposta dall'IL comune. - - The address of the variable '{0}' cannot be used at this point Non è possibile usare l'indirizzo della variabile '{0}' in questo punto diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 1a49a44350e..18b818fea07 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -2257,11 +2257,6 @@ 'base' 値を使用できるのは、オーバーライドされたメンバーの基本実装に対して直接呼び出しを行う場合のみです。 - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - オブジェクト コンストラクターでは、オブジェクトの初期化前に try/with および try/finally を直接使用できません。'for x in ...' などのコストラクトを呼び出す可能性があるようなコンストラクトがこれに含まれます。これは Common IL での制限事項です。 - - The address of the variable '{0}' cannot be used at this point この時点で変数 '{0}' のアドレスは使用できません diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 1a4cb6964d8..b361fa40679 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -2257,11 +2257,6 @@ 'base' 값은 재정의된 멤버의 기본 구현에 대한 직접 호출을 수행하는 데에만 사용할 수 있습니다. - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - 개체 생성자는 개체 초기화 전에 try/with 및 try/finally를 직접 사용할 수 없습니다. 여기에는 이러한 구문의 사용을 자세히 설명할 수 있는 'for x in ...'과 같은 구문이 포함됩니다. 이는 공통 IL의 제한입니다. - - The address of the variable '{0}' cannot be used at this point '{0}' 변수의 주소를 현재 사용할 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 1cc8dfb88f1..e746b8f8732 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -2257,11 +2257,6 @@ Wartości „base” mogą być używane tylko w celu bezpośrednich wywołań, które dotyczą podstawowych implementacji przesłoniętych elementów członkowskich - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Konstruktory obiektów nie mogą bezpośrednio używać instrukcji try/with i try/finally przed zainicjowaniem obiektu. Obejmuje to takie konstrukcje, jak „for x in ...”, które mogą skutkować użyciem takich konstrukcji. Jest to ograniczenie nałożone przez język Common IL. - - The address of the variable '{0}' cannot be used at this point Nie można użyć adresu zmiennej „{0}” w tym momencie diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1c898a6234e..00ab6117c7a 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -2257,11 +2257,6 @@ Valores 'base' só podem ser usados para fazer chamadas diretas às implementações de base de membros substituídos - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Construtores de objeto não podem usar try/with nem try/finally antes da inicialização do objeto. O que inclui construções como ' x in... ' que podem elaborar usos dessas construções. Esta é uma limitação imposta pelo IL Comum. - - The address of the variable '{0}' cannot be used at this point O endereço da variável '{0}' não pode ser usado neste ponto diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index b9094d89e3f..8d68379843e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -2257,11 +2257,6 @@ Значения "base" можно использовать только для выполнения прямых вызовов реализаций класса base для переопределенных элементов - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - В конструкторе объекта нельзя прямо использовать блоки try/with и try/finally до инициализации объекта. К таким вариантам использования также относятся и конструкции вида "for x in ...", применение которых может привести к использованию указанных конструкций. Это ограничение связано с требованиями общего промежуточного языка. - - The address of the variable '{0}' cannot be used at this point В этой точке нельзя использовать адрес переменной "{0}" diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 7ee5a8cb3bc..25de80c1025 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -2257,11 +2257,6 @@ 'base' değerleri yalnızca geçersiz kılınmış üyelerin taban uygulamalarına doğrudan çağrı yapmak için kullanılabilir - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - Nesne oluşturucular, nesnenin başlatılmasından önce try/with ve try/finally ifadelerini doğrudan kullanamazlar. Buna bu yapıların kullanımını çeşitlendirebilen 'for x in ...' gibi yapılar da dahildir. Bu, Ortak Ara Dilin getirdiği bir kısıtlamadır. - - The address of the variable '{0}' cannot be used at this point '{0}' değişkeninin adresi bu noktada kullanılamaz diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 2659f03165a..ab75c3f45f0 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -2257,11 +2257,6 @@ "base" 值只能用于直接调用重写成员的基实现 - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - 在初始化对象之前,对象构造函数不能直接使用 try/with 和 try/finally。这包括像 "for x in ..." 这样详细说明其构造使用方式的构造。这是由通用 IL 设定的限制。 - - The address of the variable '{0}' cannot be used at this point 此时无法使用变量“{0}”的地址 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index f7f06f543fc..781002375e3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -2257,11 +2257,6 @@ 'base' 值只能用來直接呼叫覆寫成員的基底實作 - - Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - 物件建構函式不能在物件初始化之前直接使用 try/with 和 try/finally。這包括 'for x in ...' 這類可以詳述這些建構用途的建構函式。這是 Common IL 的限制。 - - The address of the variable '{0}' cannot be used at this point 目前無法使用變數 '{0}' 的位址 diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry01.fs index d78d7ba06da..bebbbf4bbc5 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry01.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:1980 -//Object constructors cannot directly use try/with and try/finally prior to the initialization of the object\. This includes constructs such as 'for x in \.\.\.' that may elaborate to uses of these constructs\. This is a limitation imposed by Common IL\.$ +// #light type X = class diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry02.fs b/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry02.fs index 1baff095c07..b1510fbf1a6 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry02.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_ObjectConstructorAndTry02.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:1980 -//Object constructors cannot directly use try/with and try/finally prior to the initialization of the object\. This includes constructs such as 'for x in \.\.\.' that may elaborate to uses of these constructs\. This is a limitation imposed by Common IL\.$ +// #light type X = struct From eccd14e004184f785077c4030bb1a1c9bd1a1a8c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:37:45 +0000 Subject: [PATCH 193/226] [main] Update dependencies from dotnet/arcade (#13955) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/common/build.ps1 | 5 +++++ global.json | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3db85fb8b63..d9213a61292 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - 025103bcaefad81506465eeb7bb09b107b20f32d + d179a8bfc4f295329bbbed456d088a0dfbc61a56 - + https://github.com/dotnet/arcade - 025103bcaefad81506465eeb7bb09b107b20f32d + d179a8bfc4f295329bbbed456d088a0dfbc61a56 diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 8943da242f6..33a6f2d0e24 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -26,6 +26,7 @@ Param( [string] $runtimeSourceFeed = '', [string] $runtimeSourceFeedKey = '', [switch] $excludePrereleaseVS, + [switch] $nativeToolsOnMachine, [switch] $help, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) @@ -67,6 +68,7 @@ function Print-Usage() { Write-Host " -warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -excludePrereleaseVS Set to exclude build engines in prerelease versions of Visual Studio" + Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)" Write-Host "" Write-Host "Command line arguments not listed above are passed thru to msbuild." @@ -146,6 +148,9 @@ try { $nodeReuse = $false } + if ($nativeToolsOnMachine) { + $env:NativeToolsOnMachine = $true + } if ($restore) { InitializeNativeTools } diff --git a/global.json b/global.json index 281deb7ea7f..e977ed73b81 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22470.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22470.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22471.2", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22471.2" } } From 02918e4b2119564464303cb4b33bd94f7e5b4c46 Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Thu, 22 Sep 2022 18:35:15 +0200 Subject: [PATCH 194/226] Add docs section about labeling issues (#13962) Co-authored-by: Adam Boniecki --- INTERNAL.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/INTERNAL.md b/INTERNAL.md index 9d8ae1ced46..4993301cb36 100644 --- a/INTERNAL.md +++ b/INTERNAL.md @@ -77,6 +77,17 @@ Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in 7. Note, the help in the `darc` tool is really good. E.g., you can simply run `darc` to see a list of all commands available, and if you run `darc ` with no arguments, you'll be given a list of arguments you can use. 8. Ensure that version numbers are bumped for a new branch. +## Labeling issues on GitHub + +Assign appropriate `Area-*` label to bugs, feature improvements and feature requests issues alike. List of `Area` labels with descriptions can be found [here](https://github.com/dotnet/fsharp/labels?q=Area). These areas are laid out to follow the logical organization of the code. + +To find all existing open issues without assigned `Area` label, use [this query](https://github.com/dotnet/fsharp/issues?q=is%3Aissue+is%3Aopen+-label%3AArea-AOT+-label%3AArea-Async+-label%3AArea-Build+-label%3AArea-Compiler+-label%3AArea-Compiler-Checking+-label%3AArea-Compiler-CodeGen+-label%3AArea-Compiler-HashCompare+-label%3AArea-Compiler-ImportAndInterop+-label%3AArea-Compiler-Optimization+-label%3AArea-Compiler-Options+-label%3AArea-Compiler-PatternMatching+-label%3AArea-Compiler-Service+-label%3AArea-Compiler-SigFileGen+-label%3AArea-Compiler-SRTP+-label%3AArea-Compiler-StateMachines+-label%3AArea-Compiler-Syntax+-label%3AArea-ComputationExpressions+-label%3AArea-Debug+-label%3AArea-DependencyManager+-label%3AArea-Diagnostics+-label%3AArea-FCS+-label%3AArea-FSC+-label%3AArea-FSI+-label%3AArea-Infrastructure+-label%3AArea-LangService-API+-label%3AArea-LangService-AutoComplete+-label%3AArea-LangService-BlockStructure+-label%3AArea-LangService-CodeLens+-label%3AArea-LangService-Colorization+-label%3AArea-LangService-Diagnostics+-label%3AArea-LangService-FindAllReferences+-label%3AArea-LangService-Navigation+-label%3AArea-LangService-QuickFixes+-label%3AArea-LangService-RenameSymbol+-label%3AArea-LangService-ToolTips+-label%3AArea-LangService-UnusedDeclarations+-label%3AArea-LangService-UnusedOpens+-label%3AArea-Library+-label%3AArea-ProjectsAndBuild+-label%3AArea-Queries+-label%3AArea-Quotations+-label%3AArea-SetupAndDelivery+-label%3AArea-Testing+-label%3AArea-TypeProviders+-label%3AArea-UoM+-label%3AArea-VS+-label%3AArea-VS-Editor+-label%3AArea-VS-FSI+-label%3AArea-XmlDocs) + +Since github issue filtering is currently not flexible enough, that query was generated by pasting output of this PowerShell command to the search box (might need to be rerun if new kinds of `Area` labels are added): +```ps1 +Invoke-WebRequest -Uri "https://api.github.com/repos/dotnet/fsharp/labels?per_page=100" | ConvertFrom-Json | % { $_.name } | ? { $_.StartsWith("Area-") } | % { Write-Host -NoNewLine ('-label:"' + $_ + '" ') } +``` + ## Less interesting links [FSharp.Core (Official NuGet Release)](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=72). From 0ee2932c31529841db13e5dd2dfb082a44cb9581 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 22 Sep 2022 20:33:12 +0200 Subject: [PATCH 195/226] Implement mouseover tooltips for keywords (#13956) * Upgrade packages * Upgrade baselines for Newtonsoft.Json hash * Visual Studio integration: show a keyword's description in tooltip on mouseover Co-authored-by: Vlad Zarytovskii --- NuGet.config | 4 +- eng/Versions.props | 34 +- src/Compiler/Service/FSharpCheckerResults.fs | 16 + src/Compiler/Service/FSharpCheckerResults.fsi | 5 + .../Service/ServiceDeclarationLists.fsi | 2 + src/Compiler/Service/ServiceLexing.fs | 2 + src/Compiler/Service/ServiceLexing.fsi | 3 + .../BasicProvider.Tests.fsproj | 6 +- .../ComboProvider.Tests.fsproj | 8 +- .../ComboProvider/ComboProvider.fsproj | 4 +- .../ComboProvider/TestComboProvider.cmd | 8 +- ...erService.SurfaceArea.netstandard.expected | 4 + .../FSharp.Test.Utilities.fsproj | 1 - tests/fsharp/FSharpSuite.Tests.fsproj | 4 +- .../core/printing/output.1000.stdout.bsl | 2 +- .../core/printing/output.200.stdout.bsl | 2 +- .../core/printing/output.multiemit.stdout.bsl | 2 +- .../core/printing/output.off.stdout.bsl | 2 +- tests/fsharp/core/printing/output.stdout.bsl | 2 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 2 - .../LanguageService/MetadataAsSource.fs | 9 +- .../LanguageService/Tokenizer.fs | 10 +- .../Navigation/GoToDefinition.fs | 8 +- .../QuickInfo/QuickInfoProvider.fs | 20 +- .../FSharp.LanguageService.fsproj | 2 - .../FSharp.PatternMatcher/BKTree.Builder.cs | 1 + .../CaseSensitiveComparison.cs | 311 ------------------ .../FSharp.PatternMatcher.csproj | 4 + .../src/FSharp.PatternMatcher/VersionStamp.cs | 253 -------------- .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 5 +- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 1 - .../tests/UnitTests/QuickInfoProviderTests.fs | 157 +++++---- .../UnitTests/VisualFSharp.UnitTests.fsproj | 2 - 33 files changed, 199 insertions(+), 697 deletions(-) delete mode 100644 vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs delete mode 100644 vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs diff --git a/NuGet.config b/NuGet.config index c6b6cb09dd7..5b0a8ef0a09 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,9 @@ - + + + diff --git a/eng/Versions.props b/eng/Versions.props index a572c96d6ad..9ba01386a5e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -86,26 +86,27 @@ 4.5.1 - 5.0.0 + 6.0.0 1.6.0 4.5.5 4.7.0 - 5.0.0 + 6.0.0 4.11.1 6.0.0 4.5.0 - 4.4.0-1.22368.2 - 17.3.133-preview - 17.3.0-preview-1-32407-044 - 17.0.77-pre-g62a6cb5699 - 17.3.1-alpha - 17.1.0 + 4.4.0-3.22470.1 + 17.4.196-preview + 17.4.0-preview-3-32916-145 + 17.4.342-pre + 17.4.23-alpha + 17.4.0-preview-22469-04 $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) + $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) @@ -114,7 +115,7 @@ $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + 17.4.0-preview-3-32916-053 $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) @@ -131,8 +132,8 @@ $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + 17.4.0-preview-3-32916-053 + 17.4.0-preview-3-32916-053 $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) @@ -169,9 +170,9 @@ 2.3.6152103 17.1.4054 - 17.3.3-alpha + 17.4.7-alpha 17.0.0 - 17.0.53 + 17.0.64 9.0.30729 6.0.0 12.0.4 @@ -187,7 +188,8 @@ 0.13.2 2.16.5 4.3.0.0 - 1.0.30 + 1.0.31 + 6.0.0 8.0.0 4.3.0-1.22220.8 3.1.0 @@ -201,8 +203,8 @@ 3.11.0 2.1.80 1.0.0-beta2-dev3 - 2.12.7-alpha - 2.8.57 + 2.13.23-alpha + 2.9.87-alpha 2.4.1 2.4.2 5.10.3 diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 276027bb3d9..2abbb49b4d2 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -2648,6 +2648,22 @@ type FSharpCheckFileResults | None -> [] | Some (scope, _builderOpt) -> scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities) + member _.GetKeywordTooltip(names: string list) = + ToolTipText.ToolTipText + [ + for kw in names do + match Tokenization.FSharpKeywords.KeywordsDescriptionLookup.TryGetValue kw with + | false, _ -> () + | true, kwDescription -> + let kwText = kw |> TaggedText.tagKeyword |> wordL |> LayoutRender.toArray + let kwTip = ToolTipElementData.Create(kwText, FSharpXmlDoc.None) + + let descText = kwDescription |> TaggedText.tagText |> wordL |> LayoutRender.toArray + let descTip = ToolTipElementData.Create(descText, FSharpXmlDoc.None) + + yield ToolTipElement.Group [ kwTip; descTip ] + ] + /// Resolve the names at the given location to give a data tip member _.GetToolTip(line, colAtEndOfNames, lineText, names, tokenTag) = match tokenTagToTokenId tokenTag with diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index fc39764ff8c..6d60a75cc5b 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -313,6 +313,11 @@ type public FSharpCheckFileResults = ?getAllEntities: (unit -> AssemblySymbol list) -> FSharpSymbolUse list list + /// Compute a formatted tooltip for the given keywords + /// + /// The keywords at the location where the information is being requested. + member GetKeywordTooltip: names: string list -> ToolTipText + /// Compute a formatted tooltip for the given location /// /// The line number where the information is being requested. diff --git a/src/Compiler/Service/ServiceDeclarationLists.fsi b/src/Compiler/Service/ServiceDeclarationLists.fsi index db07edf66ba..b67f53da34b 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fsi +++ b/src/Compiler/Service/ServiceDeclarationLists.fsi @@ -31,6 +31,8 @@ type public ToolTipElementData = ParamName: string option } + static member Create: layout: TaggedText[] * xml: FSharpXmlDoc * ?typeMapping: TaggedText[] list * ?paramName: string * ?remarks: TaggedText[] -> ToolTipElementData + /// A single tool tip display element // // Note: instances of this type do not hold any references to any compiler resources. diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index cb9eacd954e..6ee75eab602 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1216,6 +1216,8 @@ module FSharpKeywords = let KeywordsWithDescription = PrettyNaming.keywordsWithDescription + let KeywordsDescriptionLookup = KeywordsWithDescription |> dict + let KeywordNames = Lexhelp.Keywords.keywordNames [] diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index 2c2b928febb..a53bba2669f 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -344,6 +344,9 @@ module FSharpKeywords = /// Keywords paired with their descriptions. Used in completion and quick info. val KeywordsWithDescription: (string * string) list + /// A lookup from keywords to their descriptions + val KeywordsDescriptionLookup: System.Collections.Generic.IDictionary + /// All the keywords in the F# language val KeywordNames: string list diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 0217a4c96cc..c157669ba0a 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -20,9 +20,9 @@ content\myfiles\ - - - + + + diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index 080aea65994..b884948e8b8 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -2,7 +2,7 @@ Library - net7.0 + net6.0 $(TestTargetFramework) false $(FSharpCoreShippedPackageVersionValue) @@ -17,9 +17,9 @@ - - - + + + diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj index 7834c472955..9fd278953c4 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider/ComboProvider.fsproj @@ -2,9 +2,9 @@ Library - net7.0;net472 + net6.0;net472 $(FSharpCoreShippedPackageVersionValue) - net7.0;net472 + net6.0;net472 diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index 29ad4ced449..fc72e514487 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -42,8 +42,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure rem @@ -60,8 +60,8 @@ echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuratio dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net472 -p:FSharpTestCompilerVersion=net40 if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure -echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr - dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net7.0 -p:FSharpTestCompilerVersion=coreclr +echo dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -v %configuration% -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr + dotnet test ComboProvider.Tests\ComboProvider.Tests.fsproj -c %configuration% -v minimal -p:TestTargetFramework=net6.0 -p:FSharpTestCompilerVersion=coreclr if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 6f38d493913..81b2c443ffa 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -1971,6 +1971,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServi FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.MethodGroup GetMethods(Int32, Int32, System.String, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.SemanticClassificationItem[] GetSemanticClassification(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.ToolTipText GetDescription(FSharp.Compiler.Symbols.FSharpSymbol, Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[FSharp.Compiler.Symbols.FSharpGenericParameter,FSharp.Compiler.Symbols.FSharpType]], Boolean, FSharp.Compiler.Text.Range) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.ToolTipText GetKeywordTooltip(Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.ToolTipText GetToolTip(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Int32) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSharpAssemblySignature PartialAssemblySignature FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSharpAssemblySignature get_PartialAssemblySignature() @@ -3993,6 +3994,7 @@ FSharp.Compiler.EditorServices.ToolTipElementData: Microsoft.FSharp.Core.FSharpO FSharp.Compiler.EditorServices.ToolTipElementData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_ParamName() FSharp.Compiler.EditorServices.ToolTipElementData: System.String ToString() FSharp.Compiler.EditorServices.ToolTipElementData: Void .ctor(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.EditorServices.ToolTipElementData Create(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]]) FSharp.Compiler.EditorServices.ToolTipText FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipText) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object) @@ -9902,6 +9904,8 @@ FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharp FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_KeywordNames() FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] KeywordsWithDescription FSharp.Compiler.Tokenization.FSharpKeywords: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_KeywordsWithDescription() +FSharp.Compiler.Tokenization.FSharpKeywords: System.Collections.Generic.IDictionary`2[System.String,System.String] KeywordsDescriptionLookup +FSharp.Compiler.Tokenization.FSharpKeywords: System.Collections.Generic.IDictionary`2[System.String,System.String] get_KeywordsDescriptionLookup() FSharp.Compiler.Tokenization.FSharpKeywords: System.String NormalizeIdentifierBackticks(System.String) FSharp.Compiler.Tokenization.FSharpLexer FSharp.Compiler.Tokenization.FSharpLexer: Void Tokenize(FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.Tokenization.FSharpToken,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Tokenization.FSharpLexerFlags], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpMap`2[System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 18112cbc161..5410b2abb15 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -58,7 +58,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index b8e453bb1a5..1192e7e856e 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -106,8 +106,7 @@ - + false @@ -119,7 +118,6 @@ - diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index 00b60931d99..71b706800bb 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -2765,7 +2765,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0317. - D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + C6f6ae524efb4d95b2b2eaa363022f9d4a28c777f788498ca81a55b9ec1aad1a {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 2c12e25b197..ad24f0b8ff0 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -2010,7 +2010,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0317. - D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + C6f6ae524efb4d95b2b2eaa363022f9d4a28c777f788498ca81a55b9ec1aad1a {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 4b00548df81..ef51dfc4078 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -6312,7 +6312,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0316. - D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + C6f6ae524efb4d95b2b2eaa363022f9d4a28c777f788498ca81a55b9ec1aad1a {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index f9c6d893f87..234cfc2e4fd 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1779,7 +1779,7 @@ val ShortName: string = "hi" > val list2: int list module FSI_0317. - D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + C6f6ae524efb4d95b2b2eaa363022f9d4a28c777f788498ca81a55b9ec1aad1a {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 4b00548df81..ef51dfc4078 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -6312,7 +6312,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0316. - D27805741a339047ef3ed7a2ca8faae3c17e6ef2371984011e49a6c9c3286641 + C6f6ae524efb4d95b2b2eaa363022f9d4a28c777f788498ca81a55b9ec1aad1a {"ImmutableField0":6} type R1 = diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 9ce0e102479..156c187769d 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -152,11 +152,9 @@ - - diff --git a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs index 0fe209093d0..6ac4e754c1f 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/MetadataAsSource.fs @@ -99,11 +99,11 @@ type internal FSharpMetadataAsSourceService() = let serviceProvider = ServiceProvider.GlobalProvider let projs = System.Collections.Concurrent.ConcurrentDictionary() - let createMetadataProjectContext (projInfo: ProjectInfo) (docInfo: DocumentInfo) = + let createMetadataProjectContext (projFilePath: string) (projInfo: ProjectInfo) (docInfo: DocumentInfo) = let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel - let projectContextFactory = componentModel.GetService() + let projectContextFactory = componentModel.GetService() - let projectContext = projectContextFactory.CreateProjectContext(projInfo.FilePath, projInfo.Id.ToString()) + let projectContext = projectContextFactory.CreateProjectContext(projFilePath, projInfo.Id.ToString()) projectContext.DisplayName <- projInfo.Name projectContext.AddSourceFile(docInfo.FilePath, SourceCodeKind.Regular) @@ -142,7 +142,8 @@ type internal FSharpMetadataAsSourceService() = use writer = new StreamWriter(fileStream) text.Write(writer) - let projectContext = createMetadataProjectContext projInfo document + let projectFile = Path.ChangeExtension(filePath, "fsproj") + let projectContext = createMetadataProjectContext projectFile projInfo document projs.[filePath] <- projectContext diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 4d2159f7c3b..800f05729d3 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -38,6 +38,7 @@ type internal LexerSymbolKind = | ActivePattern = 5 | String = 6 | Other = 7 + | Keyword = 8 type internal LexerSymbol = { Kind: LexerSymbolKind @@ -149,9 +150,10 @@ module internal Tokenizer = | FSharpGlyph.Error -> Glyph.Error | FSharpGlyph.TypeParameter -> Glyph.TypeParameter - let GetImageIdForSymbol(symbolOpt:FSharpSymbol option, kind:LexerSymbolKind) = + let GetImageIdForSymbol(symbolOpt:FSharpSymbol option, kind:LexerSymbolKind) = let imageId = match kind with + | LexerSymbolKind.Keyword -> KnownImageIds.IntellisenseKeyword | LexerSymbolKind.Operator -> KnownImageIds.Operator | _ -> match symbolOpt with @@ -387,6 +389,7 @@ module internal Tokenizer = elif token.IsIdentifier then LexerSymbolKind.Ident elif token.IsPunctuation then LexerSymbolKind.Punctuation elif token.IsString then LexerSymbolKind.String + elif token.ColorClass = FSharpTokenColorKind.Keyword then LexerSymbolKind.Keyword else LexerSymbolKind.Other Debug.Assert(uint32 token.Tag < 0xFFFFu) Debug.Assert(uint32 kind < 0xFFu) @@ -709,11 +712,12 @@ module internal Tokenizer = // Select IDENT token. If failed, select OPERATOR token. tokensUnderCursor - |> List.tryFind (fun token -> + |> List.tryFind (fun token -> match token.Kind with | LexerSymbolKind.Ident + | LexerSymbolKind.Keyword | LexerSymbolKind.ActivePattern - | LexerSymbolKind.GenericTypeParameter + | LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter -> true | _ -> false) |> Option.orElseWith (fun _ -> tokensUnderCursor |> List.tryFind (fun token -> token.Kind = LexerSymbolKind.Operator)) diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 9ac8f778354..4bdfec0bf11 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -567,8 +567,11 @@ module internal FSharpQuickInfo = let getTargetSymbolQuickInfo (symbol, tag) = asyncMaybe { let targetQuickInfo = - checkFileResults.GetToolTip - (fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland,tag) + match lexerSymbol.Kind with + | LexerSymbolKind.Keyword -> checkFileResults.GetKeywordTooltip(lexerSymbol.FullIsland) + | _ -> + checkFileResults.GetToolTip + (fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland,tag) match targetQuickInfo with | ToolTipText [] @@ -582,6 +585,7 @@ module internal FSharpQuickInfo = } match lexerSymbol.Kind with + | LexerSymbolKind.Keyword | LexerSymbolKind.String -> let! targetQuickInfo = getTargetSymbolQuickInfo (None, FSharpTokenTag.STRING) return lexerSymbol.Range, None, Some targetQuickInfo diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index cc2997f552e..fc90c793bf7 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -36,24 +36,8 @@ type internal FSharpAsyncQuickInfoSource // test helper static member ProvideQuickInfo(document: Document, position:int) = asyncMaybe { - let! sourceText = document.GetTextAsync() - let textLine = sourceText.Lines.GetLineFromPosition position - let textLineNumber = textLine.LineNumber + 1 // Roslyn line numbers are zero-based - let textLineString = textLine.ToString() - let! symbol = document.TryFindFSharpLexerSymbolAsync(position, SymbolLookupKind.Precise, true, true, nameof(FSharpAsyncQuickInfoSource)) - - let! _, checkFileResults = document.GetFSharpParseAndCheckResultsAsync(nameof(FSharpAsyncQuickInfoSource)) |> liftAsync - let res = checkFileResults.GetToolTip (textLineNumber, symbol.Ident.idRange.EndColumn, textLineString, symbol.FullIsland, FSharpTokenTag.IDENT) - match res with - | ToolTipText [] - | ToolTipText [ToolTipElement.None] -> return! None - | _ -> - let! symbolUse = checkFileResults.GetSymbolUseAtLocation (textLineNumber, symbol.Ident.idRange.EndColumn, textLineString, symbol.FullIsland) - let! symbolSpan = RoslynHelpers.TryFSharpRangeToTextSpan (sourceText, symbol.Range) - return { StructuredText = res - Span = symbolSpan - Symbol = Some symbolUse.Symbol - SymbolKind = symbol.Kind } + let! _, sigQuickInfo, targetQuickInfo = FSharpQuickInfo.getQuickInfo(document, position, CancellationToken.None) + return! sigQuickInfo |> Option.orElse targetQuickInfo } static member BuildSingleQuickInfoItem (documentationBuilder:IDocumentationBuilder) (quickInfo:QuickInfo) = diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 49c902d7704..d247d927341 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -58,9 +58,7 @@ - - diff --git a/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs b/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs index 42926a67ac5..b05c1bc3453 100644 --- a/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs +++ b/vsintegration/src/FSharp.PatternMatcher/BKTree.Builder.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Utilities; using System; using System.Collections.Generic; diff --git a/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs b/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs deleted file mode 100644 index cfbfabd718f..00000000000 --- a/vsintegration/src/FSharp.PatternMatcher/CaseSensitiveComparison.cs +++ /dev/null @@ -1,311 +0,0 @@ -using Roslyn.Utilities; -using System; -using System.Diagnostics; -using System.Globalization; -using System.Reflection.Internal; -using System.Text; - -namespace Microsoft.CodeAnalysis.Utilities -{ - internal static class CaseInsensitiveComparison - { - // PERF: Cache a TextInfo for Unicode ToLower since this will be accessed very frequently - private static readonly TextInfo s_unicodeCultureTextInfo = GetUnicodeCulture().TextInfo; - - private static CultureInfo GetUnicodeCulture() - { - try - { - // We use the "en" culture to get the Unicode ToLower mapping, as it implements - // a much more recent Unicode version (6.0+) than the invariant culture (1.0), - // and it matches the Unicode version used for character categorization. - return new CultureInfo("en"); - } - catch (ArgumentException) // System.Globalization.CultureNotFoundException not on all platforms - { - // If "en" is not available, fall back to the invariant culture. Although it has bugs - // specific to the invariant culture (e.g. being version-locked to Unicode 1.0), at least - // we can rely on it being present on all platforms. - return CultureInfo.InvariantCulture; - } - } - - /// - /// ToLower implements the Unicode lowercase mapping - /// as described in ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt. - /// VB uses these mappings for case-insensitive comparison. - /// - /// - /// If is upper case, then this returns its Unicode lower case equivalent. Otherwise, is returned unmodified. - public static char ToLower(char c) - { - // PERF: This is a very hot code path in VB, optimize for ASCII - - // Perform a range check with a single compare by using unsigned arithmetic - if (unchecked((uint)(c - 'A')) <= ('Z' - 'A')) - { - return (char)(c | 0x20); - } - - if (c < 0xC0) // Covers ASCII (U+0000 - U+007F) and up to the next upper-case codepoint (Latin Capital Letter A with Grave) - { - return c; - } - - return ToLowerNonAscii(c); - } - - private static char ToLowerNonAscii(char c) - { - if (c == '\u0130') - { - // Special case Turkish I (LATIN CAPITAL LETTER I WITH DOT ABOVE) - // This corrects for the fact that the invariant culture only supports Unicode 1.0 - // and therefore does not "know about" this character. - return 'i'; - } - - return s_unicodeCultureTextInfo.ToLower(c); - } - - /// - /// This class seeks to perform the lowercase Unicode case mapping. - /// - private sealed class OneToOneUnicodeComparer : StringComparer - { - private static int CompareLowerUnicode(char c1, char c2) - { - return (c1 == c2) ? 0 : ToLower(c1) - ToLower(c2); - } - - public override int Compare(string str1, string str2) - { - if ((object)str1 == str2) - { - return 0; - } - - if ((object)str1 == null) - { - return -1; - } - - if ((object)str2 == null) - { - return 1; - } - - int len = Math.Min(str1.Length, str2.Length); - for (int i = 0; i < len; i++) - { - int ordDiff = CompareLowerUnicode(str1[i], str2[i]); - if (ordDiff != 0) - { - return ordDiff; - } - } - - // return the smaller string, or 0 if they are equal in length - return str1.Length - str2.Length; - } - - private static bool AreEqualLowerUnicode(char c1, char c2) - { - return c1 == c2 || ToLower(c1) == ToLower(c2); - } - - public override bool Equals(string str1, string str2) - { - if ((object)str1 == str2) - { - return true; - } - - if ((object)str1 == null || (object)str2 == null) - { - return false; - } - - if (str1.Length != str2.Length) - { - return false; - } - - for (int i = 0; i < str1.Length; i++) - { - if (!AreEqualLowerUnicode(str1[i], str2[i])) - { - return false; - } - } - - return true; - } - - public static bool EndsWith(string value, string possibleEnd) - { - if ((object)value == possibleEnd) - { - return true; - } - - if ((object)value == null || (object)possibleEnd == null) - { - return false; - } - - int i = value.Length - 1; - int j = possibleEnd.Length - 1; - - if (i < j) - { - return false; - } - - while (j >= 0) - { - if (!AreEqualLowerUnicode(value[i], possibleEnd[j])) - { - return false; - } - - i--; - j--; - } - - return true; - } - - public static bool StartsWith(string value, string possibleStart) - { - if ((object)value == possibleStart) - { - return true; - } - - if ((object)value == null || (object)possibleStart == null) - { - return false; - } - - if (value.Length < possibleStart.Length) - { - return false; - } - - for (int i = 0; i < possibleStart.Length; i++) - { - if (!AreEqualLowerUnicode(value[i], possibleStart[i])) - { - return false; - } - } - - return true; - } - - public override int GetHashCode(string str) - { - int hashCode = Hash.FnvOffsetBias; - - for (int i = 0; i < str.Length; i++) - { - hashCode = Hash.CombineFNVHash(hashCode, ToLower(str[i])); - } - - return hashCode; - } - } - - /// - /// Returns a StringComparer that compares strings according the VB identifier comparison rules. - /// - private static readonly OneToOneUnicodeComparer s_comparer = new OneToOneUnicodeComparer(); - - /// - /// Returns a StringComparer that compares strings according the VB identifier comparison rules. - /// - public static StringComparer Comparer => s_comparer; - - /// - /// Determines if two VB identifiers are equal according to the VB identifier comparison rules. - /// - /// First identifier to compare - /// Second identifier to compare - /// true if the identifiers should be considered the same. - public static bool Equals(string left, string right) => s_comparer.Equals(left, right); - - /// - /// Determines if the string 'value' end with string 'possibleEnd'. - /// - /// - /// - /// - public static bool EndsWith(string value, string possibleEnd) => OneToOneUnicodeComparer.EndsWith(value, possibleEnd); - - /// - /// Determines if the string 'value' starts with string 'possibleStart'. - /// - /// - /// - /// - public static bool StartsWith(string value, string possibleStart) => OneToOneUnicodeComparer.StartsWith(value, possibleStart); - - /// - /// Compares two VB identifiers according to the VB identifier comparison rules. - /// - /// First identifier to compare - /// Second identifier to compare - /// -1 if < , 1 if > , 0 if they are equal. - public static int Compare(string left, string right) => s_comparer.Compare(left, right); - - /// - /// Gets a case-insensitive hash code for VB identifiers. - /// - /// identifier to get the hash code for - /// The hash code for the given identifier - public static int GetHashCode(string value) - { - Debug.Assert(value != null); - - return s_comparer.GetHashCode(value); - } - - /// - /// Convert a string to lower case per Unicode - /// - /// - /// - public static string ToLower(string value) - { - if ((object)value == null) - return null; - - if (value.Length == 0) - return value; - - var pooledStrbuilder = PooledStringBuilder.GetInstance(); - StringBuilder builder = pooledStrbuilder.Builder; - - builder.Append(value); - ToLower(builder); - - return pooledStrbuilder.ToStringAndFree(); - } - - /// - /// In-place convert string in StringBuilder to lower case per Unicode rules - /// - /// - public static void ToLower(StringBuilder builder) - { - if (builder == null) - return; - - for (int i = 0; i < builder.Length; i++) - { - builder[i] = ToLower(builder[i]); - } - } - } -} diff --git a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj index 5005944c7fa..20617fd7527 100644 --- a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj +++ b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj @@ -17,4 +17,8 @@ + + + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs b/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs deleted file mode 100644 index 5f27e306a0d..00000000000 --- a/vsintegration/src/FSharp.PatternMatcher/VersionStamp.cs +++ /dev/null @@ -1,253 +0,0 @@ -using Roslyn.Utilities; -using System; -using System.Diagnostics.Contracts; -using System.Threading; - -namespace Microsoft.CodeAnalysis -{ - /// - /// VersionStamp should be only used to compare versions returned by same API. - /// - internal struct VersionStamp : IEquatable, IObjectWritable - { - public static VersionStamp Default => default(VersionStamp); - - private const int GlobalVersionMarker = -1; - private const int InitialGlobalVersion = 10000; - - /// - /// global counter to avoid collision within same session. - /// it starts with a big initial number just for a clarity in debugging - /// - private static int s_globalVersion = InitialGlobalVersion; - - /// - /// time stamp - /// - private readonly DateTime _utcLastModified; - - /// - /// indicate whether there was a collision on same item - /// - private readonly int _localIncrement; - - /// - /// unique version in same session - /// - private readonly int _globalIncrement; - - private VersionStamp(DateTime utcLastModified) - : this(utcLastModified, 0) - { - } - - private VersionStamp(DateTime utcLastModified, int localIncrement) - { - _utcLastModified = utcLastModified; - _localIncrement = localIncrement; - _globalIncrement = GetNextGlobalVersion(); - } - - private VersionStamp(DateTime utcLastModified, int localIncrement, int globalIncrement) - { - _utcLastModified = utcLastModified; - _localIncrement = localIncrement; - _globalIncrement = globalIncrement; - } - - /// - /// Creates a new instance of a VersionStamp. - /// - public static VersionStamp Create() - { - return new VersionStamp(DateTime.UtcNow); - } - - /// - /// Creates a new instance of a version stamp based on the specified DateTime. - /// - public static VersionStamp Create(DateTime utcTimeLastModified) - { - return new VersionStamp(utcTimeLastModified); - } - - /// - /// compare two different versions and return either one of the versions if there is no collision, otherwise, create a new version - /// that can be used later to compare versions between different items - /// - public VersionStamp GetNewerVersion(VersionStamp version) - { - // * NOTE * - // in current design/implementation, there are 4 possible ways for a version to be created. - // - // 1. created from a file stamp (most likely by starting a new session). "increment" will have 0 as value - // 2. created by modifying existing item (text changes, project changes etc). - // "increment" will have either 0 or previous increment + 1 if there was a collision. - // 3. created from deserialization (probably by using persistent service). - // 4. created by accumulating versions of multiple items. - // - // and this method is the one that is responsible for #4 case. - - if (_utcLastModified > version._utcLastModified) - { - return this; - } - - if (_utcLastModified == version._utcLastModified) - { - var thisGlobalVersion = GetGlobalVersion(this); - var thatGlobalVersion = GetGlobalVersion(version); - - if (thisGlobalVersion == thatGlobalVersion) - { - // given versions are same one - return this; - } - - // mark it as global version - // global version can't be moved to newer version. - return new VersionStamp(_utcLastModified, (thisGlobalVersion > thatGlobalVersion) ? thisGlobalVersion : thatGlobalVersion, GlobalVersionMarker); - } - - return version; - } - - /// - /// Gets a new VersionStamp that is guaranteed to be newer than its base one - /// this should only be used for same item to move it to newer version - /// - public VersionStamp GetNewerVersion() - { - // global version can't be moved to newer version - Contract.Requires(_globalIncrement != GlobalVersionMarker); - - var now = DateTime.UtcNow; - var incr = (now == _utcLastModified) ? _localIncrement + 1 : 0; - - return new VersionStamp(now, incr); - } - - /// - /// Returns the serialized text form of the VersionStamp. - /// - public override string ToString() - { - // 'o' is the roundtrip format that captures the most detail. - return _utcLastModified.ToString("o") + "-" + _globalIncrement + "-" + _localIncrement; - } - - public override int GetHashCode() - { - return Hash.Combine(_utcLastModified.GetHashCode(), _localIncrement); - } - - public override bool Equals(object obj) - { - if (obj is VersionStamp) - { - return this.Equals((VersionStamp)obj); - } - - return false; - } - - public bool Equals(VersionStamp version) - { - if (_utcLastModified == version._utcLastModified) - { - return GetGlobalVersion(this) == GetGlobalVersion(version); - } - - return false; - } - - public static bool operator ==(VersionStamp left, VersionStamp right) - { - return left.Equals(right); - } - - public static bool operator !=(VersionStamp left, VersionStamp right) - { - return !left.Equals(right); - } - - /// - /// check whether given persisted version is re-usable - /// - internal static bool CanReusePersistedVersion(VersionStamp baseVersion, VersionStamp persistedVersion) - { - if (baseVersion == persistedVersion) - { - return true; - } - - // there was a collision, we can't use these - if (baseVersion._localIncrement != 0 || persistedVersion._localIncrement != 0) - { - return false; - } - - return baseVersion._utcLastModified == persistedVersion._utcLastModified; - } - - void IObjectWritable.WriteTo(ObjectWriter writer) - { - WriteTo(writer); - } - - internal void WriteTo(ObjectWriter writer) - { - writer.WriteInt64(_utcLastModified.ToBinary()); - writer.WriteInt32(_localIncrement); - writer.WriteInt32(_globalIncrement); - } - - internal static VersionStamp ReadFrom(ObjectReader reader) - { - var raw = reader.ReadInt64(); - var localIncrement = reader.ReadInt32(); - var globalIncrement = reader.ReadInt32(); - - return new VersionStamp(DateTime.FromBinary(raw), localIncrement, globalIncrement); - } - - private static int GetGlobalVersion(VersionStamp version) - { - // global increment < 0 means it is a global version which has its global increment in local increment - return version._globalIncrement >= 0 ? version._globalIncrement : version._localIncrement; - } - - private static int GetNextGlobalVersion() - { - // REVIEW: not sure what is best way to wrap it when it overflows. should I just throw or don't care. - // with 50ms (typing) as an interval for a new version, it gives more than 1 year before int32 to overflow. - // with 5ms as an interval, it gives more than 120 days before it overflows. - // since global version is only for per VS session, I think we don't need to worry about overflow. - // or we could use Int64 which will give more than a million years turn around even on 1ms interval. - - // this will let versions to be compared safely between multiple items - // without worrying about collision within same session - var globalVersion = Interlocked.Increment(ref VersionStamp.s_globalVersion); - - return globalVersion; - } - - /// - /// True if this VersionStamp is newer than the specified one. - /// - internal bool TestOnly_IsNewerThan(VersionStamp version) - { - if (_utcLastModified > version._utcLastModified) - { - return true; - } - - if (_utcLastModified == version._utcLastModified) - { - return GetGlobalVersion(this) > GetGlobalVersion(version); - } - - return false; - } - } -} \ No newline at end of file diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 513e0e7207d..b7819fb3611 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -57,6 +57,8 @@ + + @@ -64,7 +66,8 @@ - + + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 4b7ef972b0d..58862ce6747 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -48,7 +48,6 @@ - diff --git a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index 0a889d6d19b..9575d2b1e06 100644 --- a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -43,7 +43,7 @@ let internal projectOptions = { let private normalizeLineEnds (s: string) = s.Replace("\r\n", "\n").Replace("\n\n", "\n") -let private getQuickInfoText (ToolTipText elements) : string = +let private tooltipTextToRawString (ToolTipText elements) : string = let rec parseElement = function | ToolTipElement.None -> "" | ToolTipElement.Group(xs) -> @@ -63,36 +63,114 @@ let private getQuickInfoText (ToolTipText elements) : string = | ToolTipElement.CompositionError(error) -> error elements |> List.map parseElement |> String.concat "\n" |> normalizeLineEnds +let executeQuickInfoTest (programText:string) testCases = + let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, programText) + Assert.Multiple(fun _ -> + for (symbol: string, expected: string option) in testCases do + let expected = expected |> Option.map normalizeLineEnds |> Option.map (fun s -> s.Replace("___","")) + let caretPosition = programText.IndexOf(symbol) + symbol.Length - 1 + + let quickInfo = + FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) + |> Async.RunSynchronously + + let actual = quickInfo |> Option.map (fun qi -> tooltipTextToRawString qi.StructuredText) + Assert.AreEqual(expected, actual,"Symbol: " + symbol) + ) + [] let ShouldShowQuickInfoAtCorrectPositions() = + let fileContents = """ +let x = 1 +let y = 2 +System.Console.WriteLine(x + y) + """ + let testCases = - [ "x", Some "val x: int\nFull name: Test.x" + [ "let", Some "let___Used to associate, or bind, a name to a value or function." + "x", Some "val x: int\nFull name: Test.x" "y", Some "val y: int\nFull name: Test.y" "1", None "2", None - "x +", Some "val x: int\nFull name: Test.x" + "x +", Some """val (+) : x: 'T1 -> y: 'T2 -> 'T3 (requires member (+)) +Full name: Microsoft.FSharp.Core.Operators.(+) +'T1 is int +'T2 is int +'T3 is int""" "System", Some "namespace System" - "WriteLine", Some "System.Console.WriteLine(value: int) : unit" ] - - for (symbol: string, expected: string option) in testCases do - let expected = expected |> Option.map normalizeLineEnds - let fileContents = """ - let x = 1 - let y = 2 - System.Console.WriteLine(x + y) + "WriteLine", Some "System.Console.WriteLine(value: int) : unit" + ] + + executeQuickInfoTest fileContents testCases + + +[] +let ShouldShowQuickKeywordInfoAtCorrectPositionsForSignatureFiles() = + let fileContents = """ +namespace TestNs +module internal MyModule = + val MyVal: isDecl:bool -> string + """ + let testCases = + [ "namespace", Some "namespace___Used to associate a name with a group of related types and modules, to logically separate it from other code." + "module", Some "module___Used to associate a name with a group of related types, values, and functions, to logically separate it from other code." + "internal", Some "internal___Used to specify that a member is visible inside an assembly but not outside it." + "val", Some "val___Used in a signature to indicate a value, or in a type to declare a member, in limited situations." + "->", Some "->___In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions" + ] + executeQuickInfoTest fileContents testCases + +[] +let ShouldShowQuickKeywordInfoAtCorrectPositionsWithinComputationExpressions() = + let fileContents = """ +type MyOptionBuilder() = + member __.Zero() = None + member __.Return(x: 'T) = Some x + member __.Bind(m: 'T option, f) = Option.bind f m + +let myOpt = MyOptionBuilder() +let x = + myOpt{ + let! x = Some 5 + let! y = Some 11 + return x + y + } """ - let caretPosition = fileContents.IndexOf(symbol) - let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) - let quickInfo = - FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) - |> Async.RunSynchronously - - let actual = quickInfo |> Option.map (fun qi -> getQuickInfoText qi.StructuredText) - Assert.AreEqual(expected, actual) + let testCases = + [ "let!", Some "let!___Used in computation expressions to bind a name to the result of another computation expression." + "return", Some "return___Used to provide a value for the result of the containing computation expression." + ] + + executeQuickInfoTest fileContents testCases [] let ShouldShowQuickInfoForGenericParameters() = + let fileContents = """ + +type C() = + member x.FSharpGenericMethodExplitTypeParams<'T>(a:'T, y:'T) = (a,y) + + member x.FSharpGenericMethodInferredTypeParams(a, y) = (a,y) + +open System.Linq +let coll = [ for i in 1 .. 100 -> (i, string i) ] +let res1 = coll.GroupBy (fun (a, b) -> a) +let res2 = System.Array.Sort [| 1 |] +let test4 x = C().FSharpGenericMethodExplitTypeParams([x], [x]) +let test5<'U> (x: 'U) = C().FSharpGenericMethodExplitTypeParams([x], [x]) +let test6 = C().FSharpGenericMethodExplitTypeParams(1, 1) +let test7 x = C().FSharpGenericMethodInferredTypeParams([x], [x]) +let test8 = C().FSharpGenericMethodInferredTypeParams(1, 1) +let test9<'U> (x: 'U) = C().FSharpGenericMethodInferredTypeParams([x], [x]) +let res3 = [1] |> List.map id +let res4 = (1.0,[1]) ||> List.fold (fun s x -> string s + string x) // note there is a type error here, still cehck quickinfo any way +let res5 = 1 + 2 +let res6 = System.DateTime.Now + System.TimeSpan.Zero +let res7 = sin 5.0 +let res8 = abs 5.0 + """ + let testCases = [("GroupBy", @@ -184,44 +262,5 @@ Full name: Microsoft.FSharp.Core.Operators.sin "val abs: value: 'T -> 'T (requires member Abs) Full name: Microsoft.FSharp.Core.Operators.abs 'T is int")] - let actualForAllTests = - [ for (symbol: string, expected: string option) in testCases do - let expected = expected |> Option.map normalizeLineEnds - let fileContents = """ - -type C() = - member x.FSharpGenericMethodExplitTypeParams<'T>(a:'T, y:'T) = (a,y) - - member x.FSharpGenericMethodInferredTypeParams(a, y) = (a,y) - -open System.Linq -let coll = [ for i in 1 .. 100 -> (i, string i) ] -let res1 = coll.GroupBy (fun (a, b) -> a) -let res2 = System.Array.Sort [| 1 |] -let test4 x = C().FSharpGenericMethodExplitTypeParams([x], [x]) -let test5<'U> (x: 'U) = C().FSharpGenericMethodExplitTypeParams([x], [x]) -let test6 = C().FSharpGenericMethodExplitTypeParams(1, 1) -let test7 x = C().FSharpGenericMethodInferredTypeParams([x], [x]) -let test8 = C().FSharpGenericMethodInferredTypeParams(1, 1) -let test9<'U> (x: 'U) = C().FSharpGenericMethodInferredTypeParams([x], [x]) -let res3 = [1] |> List.map id -let res4 = (1.0,[1]) ||> List.fold (fun s x -> string s + string x) // note there is a type error here, still cehck quickinfo any way -let res5 = 1 + 2 -let res6 = System.DateTime.Now + System.TimeSpan.Zero -let res7 = sin 5.0 -let res8 = abs 5.0 - """ - let caretPosition = fileContents.IndexOf(symbol) + symbol.Length - 1 - let document, _ = RoslynTestHelpers.CreateSingleDocumentSolution(filePath, fileContents) - - let quickInfo = - FSharpAsyncQuickInfoSource.ProvideQuickInfo(document, caretPosition) - |> Async.RunSynchronously - - let actual = quickInfo |> Option.map (fun qi -> getQuickInfoText qi.StructuredText) - yield symbol, actual ] - for ((_, expected),(_,actual)) in List.zip testCases actualForAllTests do - let normalizedExpected = Option.map normalizeLineEnds expected - let normalizedActual = Option.map normalizeLineEnds actual - Assert.AreEqual(normalizedExpected, normalizedActual) + executeQuickInfoTest fileContents testCases \ No newline at end of file diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index abcae6d9074..542ec626ebd 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -165,9 +165,7 @@ - - From 8cd8973fce304c36d88467ed96bf91c0041adf6a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 22 Sep 2022 21:19:04 -0700 Subject: [PATCH 196/226] Fix referenceassemblygeneration for .exe files (#13963) * Fix referenceassemblygeneration for .exe files * Tests --- src/Compiler/AbstractIL/ilwrite.fs | 2 +- .../EmittedIL/ReferenceAssemblyTests.fs | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 983159604c2..80bb791c25f 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -1154,7 +1154,7 @@ let canGenMethodDef (tdef: ILTypeDef) cenv (mdef: ILMethodDef) = | ILMemberAccess.Public -> true // When emitting a reference assembly, do not emit methods that are private/protected/internal unless they are virtual/abstract or provide an explicit interface implementation. | ILMemberAccess.Private | ILMemberAccess.Family | ILMemberAccess.Assembly | ILMemberAccess.FamilyOrAssembly - when mdef.IsVirtual || mdef.IsAbstract || mdef.IsNewSlot || mdef.IsFinal -> true + when mdef.IsVirtual || mdef.IsAbstract || mdef.IsNewSlot || mdef.IsFinal || mdef.IsEntryPoint -> true // When emitting a reference assembly, only generate internal methods if the assembly contains a System.Runtime.CompilerServices.InternalsVisibleToAttribute. | ILMemberAccess.FamilyOrAssembly | ILMemberAccess.Assembly when cenv.hasInternalsVisibleToAttrib -> true diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 8ed8ef5cb9c..9020c5d85e3 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -982,4 +982,35 @@ extends [runtime]System.Object } } """ ] + + [] + let ``Build .exe with --refonly ensure it produces a main in the ref assembly`` () = + FSharp """module ReferenceAssembly +open System + +Console.WriteLine("Hello World!")""" + |> withOptions ["--refonly"] + |> withName "HasMainCheck" + |> asExe + |> compile + |> shouldSucceed + |> verifyIL [ + referenceAssemblyAttributeExpectedIL + """.class private abstract auto ansi sealed ''.$ReferenceAssembly + extends [mscorlib]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + // Code size 2 (0x2) + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } // end of method $ReferenceAssembly::main@ + +} // end of class ''.$ReferenceAssembly +""" + ] + |> ignore + // TODO: Add tests for internal functions, types, interfaces, abstract types (with and without IVTs), (private, internal, public) fields, properties (+ different visibility for getters and setters), events. From 7511b937c818fbb4e602f55bd545ed6c6c0207f2 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Fri, 23 Sep 2022 06:52:48 -0500 Subject: [PATCH 197/226] Enable binlog in source-build bootstrap run. (#13931) --- eng/SourceBuild.props | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 949c084ed77..0be49467823 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -23,8 +23,15 @@ DependsOnTargets="PrepareInnerSourceBuildRepoRoot" BeforeTargets="RunInnerSourceBuildCommand"> + From 5ce72e43fa066e4db007ab5363e328be416a1d84 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:45:31 +0000 Subject: [PATCH 198/226] [main] Update dependencies from dotnet/arcade (#13967) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- global.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d9213a61292..0fb1b4efdc7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - d179a8bfc4f295329bbbed456d088a0dfbc61a56 + 00d7e107ffaa9613733e390a282bd1e13c1d8d17 - + https://github.com/dotnet/arcade - d179a8bfc4f295329bbbed456d088a0dfbc61a56 + 00d7e107ffaa9613733e390a282bd1e13c1d8d17 diff --git a/global.json b/global.json index e977ed73b81..25ec44e006b 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22471.2", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22471.2" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22472.1", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22472.1" } } From e050246e75786f8f3ac99e4747fb4b73c54a9c47 Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Fri, 23 Sep 2022 16:09:52 +0200 Subject: [PATCH 199/226] Return None when Trivia is missing for Ident in SynLongIdent. (#13847) Co-authored-by: Don Syme --- src/Compiler/SyntaxTree/SyntaxTree.fs | 10 ++++-- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 2 +- .../FSharp.Compiler.Service.Tests.fsproj | 3 ++ .../service/SyntaxTreeTests/SynIdentTests.fs | 31 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/service/SyntaxTreeTests/SynIdentTests.fs diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 40fc5852cf7..1845f463540 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -47,10 +47,14 @@ type SynLongIdent = member this.IdentsWithTrivia = let (SynLongIdent (lid, _, trivia)) = this - if lid.Length <> trivia.Length then - failwith "difference between idents and trivia" - else + if lid.Length = trivia.Length then + List.zip lid trivia |> List.map SynIdent + elif lid.Length > trivia.Length then + let delta = lid.Length - trivia.Length + let trivia = [ yield! trivia; yield! List.replicate delta None ] List.zip lid trivia |> List.map SynIdent + else + failwith "difference between idents and trivia" member this.ThereIsAnExtraDotAtTheEnd = match this with diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index b36ec372a78..ef3673fa44f 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -468,7 +468,7 @@ let mkSynDotMissing mDot m l = | SynExpr.LongIdent (isOpt, SynLongIdent (lid, dots, trivia), None, _) -> // REVIEW: MEMORY PERFORMANCE: This list operation is memory intensive (we create a lot of these list nodes) SynExpr.LongIdent(isOpt, SynLongIdent(lid, dots @ [ mDot ], trivia), None, m) - | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ mDot ], []), None, m) + | SynExpr.Ident id -> SynExpr.LongIdent(false, SynLongIdent([ id ], [ mDot ], [ None ]), None, m) | SynExpr.DotGet (e, dm, SynLongIdent (lid, dots, trivia), _) -> SynExpr.DotGet(e, dm, SynLongIdent(lid, dots @ [ mDot ], trivia), m) // REVIEW: MEMORY PERFORMANCE: This is memory intensive (we create a lot of these list nodes) | expr -> SynExpr.DiscardAfterMissingQualificationAfterDot(expr, m) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index fae9537443b..19175fd7f05 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -113,6 +113,9 @@ SyntaxTree\OperatorNameTests.fs + + SyntaxTree\SynIdentTests.fs + FileSystemTests.fs diff --git a/tests/service/SyntaxTreeTests/SynIdentTests.fs b/tests/service/SyntaxTreeTests/SynIdentTests.fs new file mode 100644 index 00000000000..887910e1448 --- /dev/null +++ b/tests/service/SyntaxTreeTests/SynIdentTests.fs @@ -0,0 +1,31 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.SynIdentTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.Text +open NUnit.Framework + +[] +let ``Incomplete long ident`` () = + let ast = + """ +module Module + +A. +""" + |> getParseResults + + match ast with + | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = + [ SynModuleDecl.Expr(expr = SynExpr.LongIdent (longDotId = lid)) ]) ])) -> + Assert.AreEqual(1, lid.IdentsWithTrivia.Length) + | _ -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``IdentsWithTrivia with unbalance collection should not throw`` () = + let synLongIdent = + SynLongIdent([ Ident("A", Range.Zero); Ident("B", Range.Zero) ], [ Range.Zero ], [ None ]) + + match synLongIdent.IdentsWithTrivia with + | [ SynIdent (_, None); SynIdent (_, None) ] -> Assert.Pass() + | identsWithTrivia -> Assert.Fail $"Unexpected identsWithTrivia, got {identsWithTrivia}" From 273bb4b97f7d771a53a6f5316361c02eea8ac2e4 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 23 Sep 2022 17:00:13 +0200 Subject: [PATCH 200/226] Create bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000000..2d2dfd32de5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,69 @@ +name: 🐞 Bug +description: File a bug/issue +title: "Issue: Bug report" +labels: [Needs Triage] +body: +- type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true +- type: textarea + attributes: + label: Issue description + description: Please provide a succinct description of the issue you're experiencing. + validations: + required: true +- type: textarea + attributes: + label: Steps To Reproduce + description: Provide the steps required to reproduce the problem. + placeholder: | + 1. Step A + 2. Step B... + validations: + required: false +- type: textarea + attributes: + label: Expected Behavior + description: Provide a description of the expected behavior. + validations: + required: true +- type: textarea + attributes: + label: Actual Behavior + description: Provide a description of the actual behaviour observed. + validations: + required: true +- type: textarea + attributes: + label: Known workarounds + description: Provide a description of the actual behaviour observed. + validations: + required: true +- type: textarea + attributes: + label: Related information + description: | + Provide any related information (optional), examples: + - **OS**: Windows 11 + - **.NET Runtime Kind and version**: .NET Framework 4.8 and .NET 7 + - **Tooling**: Visual Studio 2022 + value: | + - OS: + - .NET Runtime Kind and version: + - Tooling: + render: markdown + validations: + required: false +- type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + + Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. + validations: + required: false From f4f08c211249cd22e1562052c2a99054c97549ca Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 23 Sep 2022 17:02:17 +0200 Subject: [PATCH 201/226] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2d2dfd32de5..065e47bb195 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,7 @@ -name: 🐞 Bug -description: File a bug/issue -title: "Issue: Bug report" +name: Create a report to help us improve F# +description: Create a report to help us improve F# +title: "Create a report to help us improve F# +" labels: [Needs Triage] body: - type: checkboxes @@ -42,7 +43,7 @@ body: label: Known workarounds description: Provide a description of the actual behaviour observed. validations: - required: true + required: false - type: textarea attributes: label: Related information From 454c3483bdc9480285cd20836379f2a2723c5b7e Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 23 Sep 2022 17:03:28 +0200 Subject: [PATCH 202/226] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 065e47bb195..f10d1a55e5a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,6 @@ -name: Create a report to help us improve F# +name: Bug report description: Create a report to help us improve F# -title: "Create a report to help us improve F# -" +title: "`Bug`: " labels: [Needs Triage] body: - type: checkboxes From 4877fd78f38e981cd7effa8aab8687edfa68c99f Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 23 Sep 2022 17:09:58 +0200 Subject: [PATCH 203/226] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..2af3faa3c0c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: F# Discussions + url: https://github.com/dotnet/fsharp/discussions + about: Please ask and answer questions here. + - name: F# Language Suggestions + url: https://github.com/fsharp/fslang-suggestions + about: Language features discussions here. + - name: F# Language Design + url: https://github.com/fsharp/fslang-design + about: Language design RFCs here. From 2526bec9d13a03ae51167e3213994eb51af7f477 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Sep 2022 16:25:25 +0100 Subject: [PATCH 204/226] Fix to suppress debug point (#13229) * fix suppress of debug poin * Update test.fsx Co-authored-by: Vlad Zarytovskii --- src/Compiler/Checking/CheckExpressions.fs | 3 +++ tests/fsharp/regression/13219/test.fsx | 22 ++++++++++++++++++++++ tests/fsharp/tests.fs | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 tests/fsharp/regression/13219/test.fsx diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 6aade43c55f..0ef6963c527 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4773,6 +4773,9 @@ and CrackStaticConstantArgs (cenv: cenv) env tpenv (staticParameters: Tainted info.ProvidedType diff --git a/tests/fsharp/regression/13219/test.fsx b/tests/fsharp/regression/13219/test.fsx new file mode 100644 index 00000000000..c6ff7817805 --- /dev/null +++ b/tests/fsharp/regression/13219/test.fsx @@ -0,0 +1,22 @@ +#r "nuget: FSharp.Data, 4.2.10" + +open FSharp.Data + +[] +let url = "https://en.wikipedia.org/wiki/F_Sharp_(programming_language)" + +// Works +let html = new HtmlProvider() + +type System.Object with + + // Works + member x.Html1 = new HtmlProvider<"https://en.wikipedia.org/wiki/F_Sharp_(programming_language)">() + + // Error: FS0267 This is not a valid constant expression or custom attribute value + member x.Html2 = new HtmlProvider() + +// This is a compilation test, not a lot actually happens in the test +do (System.Console.Out.WriteLine "Test Passed"; + System.IO.File.WriteAllText("test.ok", "ok"); + exit 0) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index c40d9f756e6..44cf37b3268 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2157,6 +2157,9 @@ module RegressionTests = [] let ``12383-FSC_OPTIMIZED`` () = singleTestBuildAndRun "regression/12383" FSC_OPTIMIZED + [] + let ``13219-bug-FSI`` () = singleTestBuildAndRun "regression/13219" FSI + [] let ``4715-optimized`` () = let cfg = testConfig "regression/4715" From 39cbe982937ac6e486bb62f5c936801362b9776a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 23 Sep 2022 18:23:32 +0200 Subject: [PATCH 205/226] Remove unused fcs support for compiling from asts (#13966) * Research of features to be removed * Tests marked for removal * Removing code related to AST compilation and Dynamic assembly generation * Fantomas formatting applied --- src/Compiler/Driver/fsc.fs | 213 ---------------- src/Compiler/Driver/fsc.fsi | 18 -- src/Compiler/Service/service.fs | 234 ------------------ src/Compiler/Service/service.fsi | 64 ----- ...erService.SurfaceArea.netstandard.expected | 5 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 53 +--- .../Compiler/Infrastructure/AstCompiler.fs | 41 --- tests/fsharp/FSharpSuite.Tests.fsproj | 1 - 8 files changed, 2 insertions(+), 627 deletions(-) delete mode 100644 tests/fsharp/Compiler/Infrastructure/AstCompiler.fs diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 7b8e968814f..fce47af281e 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -675,177 +675,6 @@ let main1 ilSourceDocs ) -/// Alternative first phase of compilation. This is for the compile-from-AST feature of FCS. -/// - Import assemblies -/// - Check the inputs -let main1OfAst - ( - ctok, - legacyReferenceResolver, - reduceMemoryUsage, - assemblyName, - target, - outfile, - pdbFile, - dllReferences, - noframework, - exiter: Exiter, - diagnosticsLoggerProvider: IDiagnosticsLoggerProvider, - disposables: DisposablesTracker, - inputs: ParsedInput list - ) = - - let tryGetMetadataSnapshot = (fun _ -> None) - - let directoryBuildingFrom = Directory.GetCurrentDirectory() - - let defaultFSharpBinariesDir = - FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value - - let tcConfigB = - TcConfigBuilder.CreateNew( - legacyReferenceResolver, - defaultFSharpBinariesDir, - reduceMemoryUsage = reduceMemoryUsage, - implicitIncludeDir = directoryBuildingFrom, - isInteractive = false, - isInvalidationSupported = false, - defaultCopyFSharpCore = CopyFSharpCoreFlag.No, - tryGetMetadataSnapshot = tryGetMetadataSnapshot, - sdkDirOverride = None, - rangeForErrors = range0 - ) - - let primaryAssembly = - // temporary workaround until https://github.com/dotnet/fsharp/pull/8043 is merged: - // pick a primary assembly based on whether the developer included System>Runtime in the list of reference assemblies. - // It's an ugly compromise used to avoid exposing primaryAssembly in the public api for this function. - let includesSystem_Runtime = - dllReferences - |> Seq.exists (fun f -> - Path - .GetFileName(f) - .Equals("system.runtime.dll", StringComparison.InvariantCultureIgnoreCase)) - - if includesSystem_Runtime then - PrimaryAssembly.System_Runtime - else - PrimaryAssembly.Mscorlib - - tcConfigB.target <- target - tcConfigB.SetPrimaryAssembly primaryAssembly - - if noframework then - tcConfigB.implicitlyReferenceDotNetAssemblies <- false - tcConfigB.implicitlyResolveAssemblies <- false - - // Preset: --optimize+ -g --tailcalls+ (see 4505) - SetOptimizeSwitch tcConfigB OptionSwitch.On - - SetDebugSwitch - tcConfigB - None - (match pdbFile with - | Some _ -> OptionSwitch.On - | None -> OptionSwitch.Off) - - SetTailcallSwitch tcConfigB OptionSwitch.On - - // Now install a delayed logger to hold all errors from flags until after all flags have been parsed (for example, --vserrors) - let delayForFlagsLogger = CapturingDiagnosticsLogger("DelayForFlagsLogger") - - let _holder = UseDiagnosticsLogger delayForFlagsLogger - - tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines - - // append assembly dependencies - dllReferences - |> List.iter (fun ref -> tcConfigB.AddReferencedAssemblyByPath(rangeStartup, ref)) - - // If there's a problem building TcConfig, abort - let tcConfig = - try - TcConfig.Create(tcConfigB, validate = false) - with e -> - delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) - exiter.Exit 1 - - let dependencyProvider = new DependencyProvider() - - let diagnosticsLogger = diagnosticsLoggerProvider.CreateLogger(tcConfigB, exiter) - - // Install the global error logger and never remove it. This logger does have all command-line flags considered. - let _holder = UseDiagnosticsLogger diagnosticsLogger - - // Forward all errors from flags - delayForFlagsLogger.CommitDelayedDiagnostics diagnosticsLogger - - // Resolve assemblies - ReportTime tcConfig "Import mscorlib and FSharp.Core.dll" - let foundationalTcConfigP = TcConfigProvider.Constant tcConfig - - let sysRes, otherRes, knownUnresolved = - TcAssemblyResolutions.SplitNonFoundationalResolutions(tcConfig) - - // Import basic assemblies - let tcGlobals, frameworkTcImports = - TcImports.BuildFrameworkTcImports(foundationalTcConfigP, sysRes, otherRes) - |> NodeCode.RunImmediateWithoutCancellation - - // Register framework tcImports to be disposed in future - disposables.Register frameworkTcImports - - use unwindParsePhase = UseBuildPhase BuildPhase.Parse - - let meta = Directory.GetCurrentDirectory() - - let tcConfig = - (tcConfig, inputs) - ||> List.fold (fun tcc inp -> ApplyMetaCommandsFromInputToTcConfig(tcc, inp, meta, dependencyProvider)) - - let tcConfigP = TcConfigProvider.Constant tcConfig - - // Import other assemblies - ReportTime tcConfig "Import non-system references" - - let tcImports = - TcImports.BuildNonFrameworkTcImports(tcConfigP, frameworkTcImports, otherRes, knownUnresolved, dependencyProvider) - |> NodeCode.RunImmediateWithoutCancellation - - // register tcImports to be disposed in future - disposables.Register tcImports - - // Build the initial type checking environment - ReportTime tcConfig "Typecheck" - use unwindParsePhase = UseBuildPhase BuildPhase.TypeCheck - - let tcEnv0, openDecls0 = - GetInitialTcEnv(assemblyName, rangeStartup, tcConfig, tcImports, tcGlobals) - - // Type check the inputs - let tcState, topAttrs, typedAssembly, _tcEnvAtEnd = - TypeCheck(ctok, tcConfig, tcImports, tcGlobals, diagnosticsLogger, assemblyName, tcEnv0, openDecls0, inputs, exiter) - - AbortOnError(diagnosticsLogger, exiter) - ReportTime tcConfig "Typechecked" - - Args( - ctok, - tcGlobals, - tcImports, - frameworkTcImports, - tcState.Ccu, - typedAssembly, - topAttrs, - tcConfig, - outfile, - pdbFile, - assemblyName, - diagnosticsLogger, - exiter, - [] - ) - /// Second phase of compilation. /// - Write the signature file, check some attributes let main2 @@ -1356,45 +1185,3 @@ let CompileFromCommandLineArguments |> main4 (tcImportsCapture, dynamicAssemblyCreator) |> main5 |> main6 dynamicAssemblyCreator - -/// An additional compilation entry point used by FSharp.Compiler.Service taking syntax trees as input -let CompileFromSyntaxTrees - ( - ctok, - legacyReferenceResolver, - reduceMemoryUsage, - assemblyName, - target, - targetDll, - targetPdb, - dependencies, - noframework, - exiter, - loggerProvider, - inputs, - tcImportsCapture, - dynamicAssemblyCreator - ) = - - use disposables = new DisposablesTracker() - - main1OfAst ( - ctok, - legacyReferenceResolver, - reduceMemoryUsage, - assemblyName, - target, - targetDll, - targetPdb, - dependencies, - noframework, - exiter, - loggerProvider, - disposables, - inputs - ) - |> main2 - |> main3 - |> main4 (tcImportsCapture, dynamicAssemblyCreator) - |> main5 - |> main6 dynamicAssemblyCreator diff --git a/src/Compiler/Driver/fsc.fsi b/src/Compiler/Driver/fsc.fsi index bb060095d98..5b37ace9224 100644 --- a/src/Compiler/Driver/fsc.fsi +++ b/src/Compiler/Driver/fsc.fsi @@ -55,21 +55,3 @@ val CompileFromCommandLineArguments: tcImportsCapture: (TcImports -> unit) option * dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> unit - -/// An additional compilation entry point used by FSharp.Compiler.Service taking syntax trees as input -val CompileFromSyntaxTrees: - ctok: CompilationThreadToken * - legacyReferenceResolver: LegacyReferenceResolver * - reduceMemoryUsage: ReduceMemoryFlag * - assemblyName: string * - target: CompilerTarget * - targetDll: string * - targetPdb: string option * - dependencies: string list * - noframework: bool * - exiter: Exiter * - loggerProvider: IDiagnosticsLoggerProvider * - inputs: ParsedInput list * - tcImportsCapture: (TcImports -> unit) option * - dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> - unit diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index d9906121964..42f0be91ea0 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -139,113 +139,6 @@ module CompileHelpers = diagnostics.ToArray(), result - let compileFromAsts - ( - ctok, - legacyReferenceResolver, - asts, - assemblyName, - outFile, - dependencies, - noframework, - pdbFile, - executable, - tcImportsCapture, - dynamicAssemblyCreator - ) = - - let diagnostics, diagnosticsLogger, loggerProvider = mkCompilationDiagnosticsHandlers () - - let executable = defaultArg executable true - - let target = - if executable then - CompilerTarget.ConsoleExe - else - CompilerTarget.Dll - - let result = - tryCompile diagnosticsLogger (fun exiter -> - CompileFromSyntaxTrees( - ctok, - legacyReferenceResolver, - ReduceMemoryFlag.Yes, - assemblyName, - target, - outFile, - pdbFile, - dependencies, - noframework, - exiter, - loggerProvider, - asts, - tcImportsCapture, - dynamicAssemblyCreator - )) - - diagnostics.ToArray(), result - - let createDynamicAssembly - (debugInfo: bool, tcImportsRef: TcImports option ref, execute: bool, assemblyBuilderRef: _ option ref) - (tcConfig: TcConfig, tcGlobals: TcGlobals, outfile, ilxMainModule) - = - - // Create an assembly builder - let assemblyName = AssemblyName(Path.GetFileNameWithoutExtension outfile) - let flags = AssemblyBuilderAccess.Run - let assemblyBuilder = System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly(assemblyName, flags) - let moduleBuilder = assemblyBuilder.DefineDynamicModule("IncrementalModule") - - // Omit resources in dynamic assemblies, because the module builder is constructed without a file name the module - // is tagged as transient and as such DefineManifestResource will throw an invalid operation if resources are present. - // - // Also, the dynamic assembly creator can't currently handle types called "" from statically linked assemblies. - let ilxMainModule = - { ilxMainModule with - TypeDefs = - ilxMainModule.TypeDefs.AsList() - |> List.filter (fun td -> not (isTypeNameForGlobalFunctions td.Name)) - |> mkILTypeDefs - Resources = mkILResources [] - } - - // The function used to resolve types while emitting the code - let assemblyResolver s = - match tcImportsRef.Value.Value.TryFindExistingFullyQualifiedPathByExactAssemblyRef s with - | Some res -> Some(Choice1Of2 res) - | None -> None - - // Emit the code - let _emEnv, execs = - EmitDynamicAssemblyFragment( - tcGlobals.ilg, - tcConfig.emitTailcalls, - emEnv0, - assemblyBuilder, - moduleBuilder, - ilxMainModule, - debugInfo, - assemblyResolver, - tcGlobals.TryFindSysILTypeRef - ) - - // Execute the top-level initialization, if requested - if execute then - for exec in execs do - match exec () with - | None -> () - | Some exn -> - PreserveStackTrace exn - raise exn - - // Register the reflected definitions for the dynamically generated assembly - for resource in ilxMainModule.Resources.AsList() do - if IsReflectedDefinitionsResource resource then - Quotations.Expr.RegisterReflectedDefinitions(assemblyBuilder, moduleBuilder.Name, resource.GetBytes().ToArray()) - - // Save the result - assemblyBuilderRef.Value <- Some assemblyBuilder - let setOutputStreams execute = // Set the output streams, if requested match execute with @@ -1339,133 +1232,6 @@ type FSharpChecker return CompileHelpers.compileFromArgs (ctok, argv, legacyReferenceResolver, None, None) } - member _.Compile - ( - ast: ParsedInput list, - assemblyName: string, - outFile: string, - dependencies: string list, - ?pdbFile: string, - ?executable: bool, - ?noframework: bool, - ?userOpName: string - ) = - let _userOpName = defaultArg userOpName "Unknown" - - async { - let ctok = CompilationThreadToken() - let noframework = defaultArg noframework false - - return - CompileHelpers.compileFromAsts ( - ctok, - legacyReferenceResolver, - ast, - assemblyName, - outFile, - dependencies, - noframework, - pdbFile, - executable, - None, - None - ) - } - - member _.CompileToDynamicAssembly(otherFlags: string[], execute: (TextWriter * TextWriter) option, ?userOpName: string) = - let _userOpName = defaultArg userOpName "Unknown" - - async { - let ctok = CompilationThreadToken() - CompileHelpers.setOutputStreams execute - - // References used to capture the results of compilation - let tcImportsRef = ref None - let assemblyBuilderRef = ref None - let tcImportsCapture = Some(fun tcImports -> tcImportsRef.Value <- Some tcImports) - - // Function to generate and store the results of compilation - let debugInfo = - otherFlags - |> Array.exists (fun arg -> arg = "-g" || arg = "--debug:+" || arg = "/debug:+") - - let dynamicAssemblyCreator = - Some(CompileHelpers.createDynamicAssembly (debugInfo, tcImportsRef, execute.IsSome, assemblyBuilderRef)) - - // Perform the compilation, given the above capturing function. - let diagnostics, result = - CompileHelpers.compileFromArgs (ctok, otherFlags, legacyReferenceResolver, tcImportsCapture, dynamicAssemblyCreator) - - // Retrieve and return the results - let assemblyOpt = - match assemblyBuilderRef.Value with - | None -> None - | Some a -> Some(a :> Assembly) - - return diagnostics, result, assemblyOpt - } - - member _.CompileToDynamicAssembly - ( - ast: ParsedInput list, - assemblyName: string, - dependencies: string list, - execute: (TextWriter * TextWriter) option, - ?debug: bool, - ?noframework: bool, - ?userOpName: string - ) = - let _userOpName = defaultArg userOpName "Unknown" - - async { - let ctok = CompilationThreadToken() - CompileHelpers.setOutputStreams execute - - // References used to capture the results of compilation - let tcImportsRef = ref (None: TcImports option) - let assemblyBuilderRef = ref None - let tcImportsCapture = Some(fun tcImports -> tcImportsRef.Value <- Some tcImports) - - let debugInfo = defaultArg debug false - let noframework = defaultArg noframework false - let location = Path.Combine(FileSystem.GetTempPathShim(), "test" + string (hash assemblyName)) - - try - Directory.CreateDirectory(location) |> ignore - with _ -> - () - - let outFile = Path.Combine(location, assemblyName + ".dll") - - // Function to generate and store the results of compilation - let dynamicAssemblyCreator = - Some(CompileHelpers.createDynamicAssembly (debugInfo, tcImportsRef, execute.IsSome, assemblyBuilderRef)) - - // Perform the compilation, given the above capturing function. - let diagnostics, result = - CompileHelpers.compileFromAsts ( - ctok, - legacyReferenceResolver, - ast, - assemblyName, - outFile, - dependencies, - noframework, - None, - Some execute.IsSome, - tcImportsCapture, - dynamicAssemblyCreator - ) - - // Retrieve and return the results - let assemblyOpt = - match assemblyBuilderRef.Value with - | None -> None - | Some a -> Some(a :> Assembly) - - return diagnostics, result, assemblyOpt - } - /// This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation. /// For example, the type provider approvals file may have changed. member ic.InvalidateAll() = ic.ClearCaches() diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index cec0eb2d2f2..50b0a89eb11 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -329,70 +329,6 @@ type public FSharpChecker = /// An optional string used for tracing compiler operations associated with this request. member Compile: argv: string[] * ?userOpName: string -> Async - /// - /// TypeCheck and compile provided AST - /// - /// - /// The syntax tree for the build. - /// The assembly name for the compiled output. - /// The output file for the compialtion. - /// The list of dependencies for the compialtion. - /// The output PDB file, if any. - /// Indicates if an executable is being produced. - /// Enables the /noframework flag. - /// An optional string used for tracing compiler operations associated with this request. - member Compile: - ast: ParsedInput list * - assemblyName: string * - outFile: string * - dependencies: string list * - ?pdbFile: string * - ?executable: bool * - ?noframework: bool * - ?userOpName: string -> - Async - - /// - /// Compiles to a dynamic assembly using the given flags. - /// - /// The first argument is ignored and can just be "fsc.exe". - /// - /// Any source files names are resolved via the FileSystem API. An output file name must be given by a -o flag, but this will not - /// be written - instead a dynamic assembly will be created and loaded. - /// - /// If the 'execute' parameter is given the entry points for the code are executed and - /// the given TextWriters are used for the stdout and stderr streams respectively. In this - /// case, a global setting is modified during the execution. - /// - /// - /// Other flags for compilation. - /// An optional pair of output streams, enabling execution of the result. - /// An optional string used for tracing compiler operations associated with this request. - member CompileToDynamicAssembly: - otherFlags: string[] * execute: (TextWriter * TextWriter) option * ?userOpName: string -> - Async - - /// - /// TypeCheck and compile provided AST - /// - /// - /// The syntax tree for the build. - /// The assembly name for the compiled output. - /// The list of dependencies for the compialtion. - /// An optional pair of output streams, enabling execution of the result. - /// Enabled debug symbols - /// Enables the /noframework flag. - /// An optional string used for tracing compiler operations associated with this request. - member CompileToDynamicAssembly: - ast: ParsedInput list * - assemblyName: string * - dependencies: string list * - execute: (TextWriter * TextWriter) option * - ?debug: bool * - ?noframework: bool * - ?userOpName: string -> - Async - /// /// Try to get type check results for a file. This looks up the results of recent type checks of the /// same file, regardless of contents. The version tag specified in the original check of the file is returned. diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 81b2c443ffa..96da7c4c474 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2030,12 +2030,9 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedInput], System.String, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`3[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32,Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.Assembly]]] CompileToDynamicAssembly(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedInput], System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.IO.TextWriter,System.IO.TextWriter]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`3[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],System.Int32,Microsoft.FSharp.Core.FSharpOption`1[System.Reflection.Assembly]]] CompileToDynamicAssembly(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[System.IO.TextWriter,System.IO.TextWriter]], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions],FSharp.Compiler.CodeAnalysis.FSharpProjectOptions] ProjectChecked FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions],FSharp.Compiler.CodeAnalysis.FSharpProjectOptions] get_ProjectChecked() FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.IEvent`2[Microsoft.FSharp.Control.FSharpHandler`1[System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]],System.Tuple`2[System.String,FSharp.Compiler.CodeAnalysis.FSharpProjectOptions]] BeforeBackgroundFileCheck @@ -3980,6 +3977,7 @@ FSharp.Compiler.EditorServices.ToolTipElementData FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipElementData) FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(System.Object) FSharp.Compiler.EditorServices.ToolTipElementData: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.EditorServices.ToolTipElementData Create(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]]) FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Symbols.FSharpXmlDoc XmlDoc FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Symbols.FSharpXmlDoc get_XmlDoc() FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.Text.TaggedText[] MainDescription @@ -3994,7 +3992,6 @@ FSharp.Compiler.EditorServices.ToolTipElementData: Microsoft.FSharp.Core.FSharpO FSharp.Compiler.EditorServices.ToolTipElementData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_ParamName() FSharp.Compiler.EditorServices.ToolTipElementData: System.String ToString() FSharp.Compiler.EditorServices.ToolTipElementData: Void .ctor(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]], Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.EditorServices.ToolTipElementData: FSharp.Compiler.EditorServices.ToolTipElementData Create(FSharp.Compiler.Text.TaggedText[], FSharp.Compiler.Symbols.FSharpXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.TaggedText[]]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.TaggedText[]]) FSharp.Compiler.EditorServices.ToolTipText FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipText) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object) diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index bbb2856344d..1679a74a336 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -683,58 +683,7 @@ Updated automatically, please check diffs in your pull request, changes must be exn |> Option.iter raise) static member ExecutionHasOutput(cmpl: Compilation, expectedOutput: string) = - CompilerAssert.Execute(cmpl, newProcess = true, onOutput = (fun output -> Assert.AreEqual(expectedOutput, output, sprintf "'%s' = '%s'" expectedOutput output))) - - /// Assert that the given source code compiles with the `defaultProjectOptions`, with no errors or warnings - static member CompileOfAst isExe source = - let outputFilePath = Path.ChangeExtension (tryCreateTemporaryFileName (), if isExe then "exe" else ".dll") - let parseOptions = { FSharpParsingOptions.Default with SourceFiles = [|"test.fs"|] } - - let parseResults = - checker.ParseFile("test.fs", SourceText.ofString source, parseOptions) - |> Async.RunImmediate - - Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics) - - let dependencies = - #if NETCOREAPP - Array.toList TargetFrameworkUtil.currentReferences - #else - [] - #endif - - let compileErrors, statusCode = - checker.Compile([parseResults.ParseTree], "test", outputFilePath, dependencies, executable = isExe, noframework = true) - |> Async.RunImmediate - - Assert.IsEmpty(compileErrors, sprintf "Compile errors: %A" compileErrors) - Assert.AreEqual(0, statusCode, sprintf "Nonzero status code: %d" statusCode) - outputFilePath - - static member CompileOfAstToDynamicAssembly source = - let assemblyName = sprintf "test-%O" (Guid.NewGuid()) - let parseOptions = { FSharpParsingOptions.Default with SourceFiles = [|"test.fs"|] } - let parseResults = - checker.ParseFile("test.fs", SourceText.ofString source, parseOptions) - |> Async.RunImmediate - - Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics) - - let dependencies = - #if NETCOREAPP - Array.toList TargetFrameworkUtil.currentReferences - #else - [] - #endif - - let compileErrors, statusCode, assembly = - checker.CompileToDynamicAssembly([parseResults.ParseTree], assemblyName, dependencies, None, noframework = true) - |> Async.RunImmediate - - Assert.IsEmpty(compileErrors, sprintf "Compile errors: %A" compileErrors) - Assert.AreEqual(0, statusCode, sprintf "Nonzero status code: %d" statusCode) - Assert.IsTrue(assembly.IsSome, "no assembly returned") - Option.get assembly + CompilerAssert.Execute(cmpl, newProcess = true, onOutput = (fun output -> Assert.AreEqual(expectedOutput, output, sprintf "'%s' = '%s'" expectedOutput output))) static member Pass (source: string) = let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, defaultProjectOptions) |> Async.RunImmediate diff --git a/tests/fsharp/Compiler/Infrastructure/AstCompiler.fs b/tests/fsharp/Compiler/Infrastructure/AstCompiler.fs deleted file mode 100644 index 8f254fa03d5..00000000000 --- a/tests/fsharp/Compiler/Infrastructure/AstCompiler.fs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.UnitTests.AstCompiler - -open FSharp.Test -open NUnit.Framework -open System.Reflection - -[] -module ``AST Compiler Smoke Tests`` = - - [] - let ``Simple E2E module compilation``() = - let assembly = - CompilerAssert.CompileOfAstToDynamicAssembly - """ -module TestModule - - let rec fib n = if n <= 1 then n else fib (n - 2) + fib (n - 1) -""" - - let method = assembly.GetType("TestModule").GetMethod("fib", BindingFlags.Static ||| BindingFlags.Public) - Assert.NotNull(method) - Assert.AreEqual(55, method.Invoke(null, [|10|])) - - [] - let ``Compile to Assembly``() = - let assembly = - CompilerAssert.CompileOfAst false - """ -module LiteralValue - -[] -let x = 7 -""" - - (ILVerifier assembly).VerifyIL [ - """ -.field public static literal int32 x = int32(0x00000007) - """ - ] \ No newline at end of file diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 1192e7e856e..e58ba939e76 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -95,7 +95,6 @@ - From ff0f89217c9d99f80d5fbecad49dc0409e2a7e68 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Sep 2022 17:53:04 +0100 Subject: [PATCH 206/226] fix build break (#13971) --- tests/service/SyntaxTreeTests/SynIdentTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/service/SyntaxTreeTests/SynIdentTests.fs b/tests/service/SyntaxTreeTests/SynIdentTests.fs index 887910e1448..aa16871a609 100644 --- a/tests/service/SyntaxTreeTests/SynIdentTests.fs +++ b/tests/service/SyntaxTreeTests/SynIdentTests.fs @@ -16,7 +16,7 @@ A. |> getParseResults match ast with - | ParsedInput.ImplFile (ParsedImplFileInput(modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = + | ParsedInput.ImplFile (ParsedImplFileInput(contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ SynModuleDecl.Expr(expr = SynExpr.LongIdent (longDotId = lid)) ]) ])) -> Assert.AreEqual(1, lid.IdentsWithTrivia.Length) | _ -> Assert.Fail $"Could not get valid AST, got {ast}" From 2f471ded9a61b08299b6c5b63dc8ba6278107903 Mon Sep 17 00:00:00 2001 From: Alex Berezhnykh Date: Fri, 23 Sep 2022 21:47:37 +0300 Subject: [PATCH 207/226] Don't allow union case unnamed fields in xmldoc (#13914) * Don't allow union case unnamed fields in xmldoc * . * fix doc * fix * fix * fix --- src/Compiler/Checking/CheckDeclarations.fs | 6 ++++- src/FSharp.Core/prim-types.fs | 2 +- src/FSharp.Core/prim-types.fsi | 2 +- .../Language/XmlComments.fs | 26 ++++++++++++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 0e3b8a7973b..1081998708b 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -531,7 +531,11 @@ module TcRecdUnionAndEnumDeclarations = error(Error(FSComp.SR.tcReturnTypesForUnionMustBeSameAsType(), m)) rfields, recordTy - let names = rfields |> List.map (fun f -> f.DisplayNameCore) + let names = rfields + |> Seq.filter (fun f -> not f.rfield_name_generated) + |> Seq.map (fun f -> f.DisplayNameCore) + |> Seq.toList + let xmlDoc = xmldoc.ToXmlDoc(true, Some names) Construct.NewUnionCase id rfields recordTy attrs xmlDoc vis diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 1178620d63b..eb92de29cba 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -3854,7 +3854,7 @@ namespace Microsoft.FSharp.Core [] type ValueOption<'T> = | ValueNone : 'T voption - | ValueSome : 'T -> 'T voption + | ValueSome : Item: 'T -> 'T voption member x.Value = match x with ValueSome x -> x | ValueNone -> raise (new InvalidOperationException("ValueOption.Value")) diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index ccac892f8fc..e639f3cb85e 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -2441,7 +2441,7 @@ namespace Microsoft.FSharp.Core /// The input value. /// /// An option representing the value. - | ValueSome: 'T -> 'T voption + | ValueSome: Item:'T -> 'T voption /// Get the value of a 'ValueSome' option. An InvalidOperationException is raised if the option is 'ValueNone'. member Value: 'T diff --git a/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs b/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs index fc554d1fcc9..c0378ae4208 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs @@ -206,4 +206,28 @@ module M = |> ignoreWarnings |> compile |> shouldSucceed - |> withDiagnostics [ ] \ No newline at end of file + |> withDiagnostics [ ] + + [] + let ``Union field - unnamed 01`` () = + Fsx""" + type A = + /// A + /// Item + | A of int + """ + |> withXmlCommentChecking + |> compile + |> withDiagnostics [ Warning 3390, Line 3, Col 13, Line 4, Col 48, "This XML comment is invalid: unknown parameter 'Item'" ] + + [] + let ``Union field - unnamed 02`` () = + Fsx""" + type A = + /// A + /// a + | A of int * a: int + """ + |> withXmlCommentChecking + |> compile + |> withDiagnostics [ ] From 179db4edd53e8bbe87f7a3dd15e68cf370caae99 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Fri, 23 Sep 2022 20:55:34 +0200 Subject: [PATCH 208/226] IL: optimize attribute cluster reading (#13821) * IL: optimize attribute cluster reading * Set endRid when there's a single attribute * formatter * More fixes Co-authored-by: Vlad Zarytovskii Co-authored-by: Don Syme --- src/Compiler/AbstractIL/ilread.fs | 51 +++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index c323a9eb939..06c50483a2e 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1220,9 +1220,12 @@ type ISeekReadIndexedRowReader<'RowT, 'KeyT, 'T when 'RowT: struct> = abstract CompareKey: 'KeyT -> int abstract ConvertRow: byref<'RowT> -> 'T -let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) = +let seekReadIndexedRowsRange numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) = let mutable row = Unchecked.defaultof<'RowT> + let mutable startRid = -1 + let mutable endRid = -1 + if binaryChop then let mutable low = 0 let mutable high = numRows + 1 @@ -1241,12 +1244,12 @@ let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedR elif c < 0 then high <- mid else fin <- true - let res = ImmutableArray.CreateBuilder() - if high - low > 1 then // now read off rows, forward and backwards let mid = (low + high) / 2 + startRid <- mid + // read backwards let mutable fin = false let mutable curr = mid - 1 @@ -1258,14 +1261,12 @@ let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedR reader.GetRow(curr, &row) if reader.CompareKey(reader.GetKey(&row)) = 0 then - res.Add(reader.ConvertRow(&row)) + startRid <- curr else fin <- true curr <- curr - 1 - res.Reverse() - // read forward let mutable fin = false let mutable curr = mid @@ -1277,23 +1278,47 @@ let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedR reader.GetRow(curr, &row) if reader.CompareKey(reader.GetKey(&row)) = 0 then - res.Add(reader.ConvertRow(&row)) + endRid <- curr else fin <- true curr <- curr + 1 - res.ToArray() else - let res = ImmutableArray.CreateBuilder() + let mutable rid = 1 - for i = 1 to numRows do - reader.GetRow(i, &row) + while rid <= numRows && startRid = -1 do + reader.GetRow(rid, &row) if reader.CompareKey(reader.GetKey(&row)) = 0 then - res.Add(reader.ConvertRow(&row)) + startRid <- rid + endRid <- rid + + rid <- rid + 1 + + let mutable fin = false + + while rid <= numRows && not fin do + reader.GetRow(rid, &row) + + if reader.CompareKey(reader.GetKey(&row)) = 0 then + endRid <- rid + else + fin <- true + + startRid, endRid + +let seekReadIndexedRowsByInterface numRows binaryChop (reader: ISeekReadIndexedRowReader<'RowT, _, _>) = + let startRid, endRid = seekReadIndexedRowsRange numRows binaryChop reader + + if startRid <= 0 || endRid < startRid then + [||] + else - res.ToArray() + Array.init (endRid - startRid + 1) (fun i -> + let mutable row = Unchecked.defaultof<'RowT> + reader.GetRow(startRid + i, &row) + reader.ConvertRow(&row)) [] type CustomAttributeRow = From bdde70d567f9911ace1a2ff1dd37a30c1436e22f Mon Sep 17 00:00:00 2001 From: Justin Wick Date: Fri, 23 Sep 2022 21:25:26 -0400 Subject: [PATCH 209/226] Some examples for the Async module. (#12477) * Initial set of examples for PR. * PR feedback from @dsyme, 1 * Update async.fsi Co-authored-by: Don Syme --- src/FSharp.Core/async.fsi | 574 ++++++++++++++++++++++++++++++++------ 1 file changed, 484 insertions(+), 90 deletions(-) diff --git a/src/FSharp.Core/async.fsi b/src/FSharp.Core/async.fsi index a26c09b2156..3aa0403bb19 100644 --- a/src/FSharp.Core/async.fsi +++ b/src/FSharp.Core/async.fsi @@ -51,7 +51,7 @@ namespace Microsoft.FSharp.Control /// /// If an exception occurs in the asynchronous computation then an exception is re-raised by this /// function. - /// + /// /// If no cancellation token is provided then the default cancellation token is used. /// /// The computation is started on the current thread if is null, @@ -73,8 +73,22 @@ namespace Microsoft.FSharp.Control /// The result of the computation. /// /// Starting Async Computations - /// - /// + /// + /// + /// + /// printfn "A" + /// + /// let result = async { + /// printfn "B" + /// do! Async.Sleep(1000) + /// printfn "C" + /// 17 + /// } |> Async.RunSynchronously + /// + /// printfn "D" + /// + /// Prints "A", "B" immediately, then "C", "D" in 1 second. result is set to 17. + /// static member RunSynchronously : computation:Async<'T> * ?timeout : int * ?cancellationToken:CancellationToken-> 'T /// Starts the asynchronous computation in the thread pool. Do not await its result. @@ -86,7 +100,21 @@ namespace Microsoft.FSharp.Control /// If one is not supplied, the default cancellation token is used. /// /// Starting Async Computations - /// + /// + /// + /// + /// printfn "A" + /// + /// async { + /// printfn "B" + /// do! Async.Sleep(1000) + /// printfn "C" + /// } |> Async.Start + /// + /// printfn "D" + /// + /// Prints "A", then "D", "B" quickly in any order, and then "C" in 1 second. + /// /// static member Start : computation:Async * ?cancellationToken:CancellationToken -> unit @@ -98,14 +126,30 @@ namespace Microsoft.FSharp.Control /// in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) /// /// Starting Async Computations - /// - /// + /// + /// + /// + /// printfn "A" + /// + /// let t = + /// async { + /// printfn "B" + /// do! Async.Sleep(1000) + /// printfn "C" + /// } |> Async.StartAsTask + /// + /// printfn "D" + /// t.Wait() + /// printfn "E" + /// + /// Prints "A", then "D", "B" quickly in any order, then "C", "E" in 1 second. + /// static member StartAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions * ?cancellationToken:CancellationToken -> Task<'T> /// Creates an asynchronous computation which starts the given computation as a /// /// Starting Async Computations - /// + /// /// static member StartChildAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions -> Async> @@ -119,8 +163,23 @@ namespace Microsoft.FSharp.Control /// A computation that returns a choice of type T or exception. /// /// Cancellation and Exceptions + /// + /// + /// + /// let someRiskyBusiness() = + /// match DateTime.Today with + /// | dt when dt.DayOfWeek = DayOfWeek.Monday -> failwith "Not compatible with Mondays" + /// | dt -> dt /// - /// + /// async { return someRiskyBusiness() } + /// |> Async.Catch + /// |> Async.RunSynchronously + /// |> function + /// | Choice1Of2 result -> printfn $"Result: {result}" + /// | Choice2Of2 e -> printfn $"Exception: {e}" + /// + /// Prints the returned value of someRiskyBusiness() or the exception if there is one. + /// static member Catch : computation:Async<'T> -> Async> /// Creates an asynchronous computation that executes computation. @@ -134,8 +193,26 @@ namespace Microsoft.FSharp.Control /// is cancelled. /// /// Cancellation and Exceptions - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 11 ] + /// for i in primes do + /// Async.TryCancelled( + /// async { + /// do! Async.Sleep(i * 1000) + /// printfn $"{i}" + /// }, + /// fun oce -> printfn $"Computation Cancelled: {i}") + /// |> Async.Start + /// + /// Thread.Sleep(6000) + /// Async.CancelDefaultToken() + /// printfn "Tasks Finished" + /// + /// 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 TryCancelled : computation:Async<'T> * compensation:(OperationCanceledException -> unit) -> Async<'T> /// Generates a scoped, cooperative cancellation handler for use within an asynchronous workflow. @@ -155,8 +232,25 @@ namespace Microsoft.FSharp.Control /// before being disposed. /// /// Cancellation and Exceptions - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 11 ] + /// for i in primes do + /// async { + /// use! holder = Async.OnCancel(fun () -> printfn $"Computation Cancelled: {i}") + /// do! Async.Sleep(i * 1000) + /// printfn $"{i}" + /// } + /// |> Async.Start + /// + /// Thread.Sleep(6000) + /// Async.CancelDefaultToken() + /// printfn "Tasks Finished" + /// + /// 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 /// Creates an asynchronous computation that returns the CancellationToken governing the execution @@ -169,7 +263,7 @@ namespace Microsoft.FSharp.Control /// expression. /// /// Cancellation and Exceptions - /// + /// /// static member CancellationToken : Async @@ -179,8 +273,32 @@ namespace Microsoft.FSharp.Control /// specific CancellationToken. /// /// Cancellation and Exceptions - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 11 ] + /// + /// let computations = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(i * 1000) + /// printfn $"{i}" + /// } + /// ] + /// + /// try + /// let t = + /// Async.Parallel(computations, 3) |> Async.StartAsTask + /// + /// Thread.Sleep(6000) + /// Async.CancelDefaultToken() + /// printfn $"Tasks Finished: %A{t.Result}" + /// with + /// | :? System.AggregateException as ae -> printfn $"Tasks Not Finished: {ae.Message}" + /// + /// This will print "2" 2 seconds from start, "3" 3 seconds from start, "5" 5 seconds from start, cease computation and + /// then print "Tasks Not Finished: One or more errors occurred. (A task was canceled.)". + /// static member CancelDefaultToken : unit -> unit /// Gets the default cancellation token for executing asynchronous computations. @@ -188,27 +306,45 @@ namespace Microsoft.FSharp.Control /// The default CancellationToken. /// /// Cancellation and Exceptions - /// - /// + /// + /// + /// + /// Async.DefaultCancellationToken.Register(fun () -> printfn "Computation Cancelled") |> ignore + /// let primes = [ 2; 3; 5; 7; 11 ] + /// + /// for i in primes do + /// async { + /// do! Async.Sleep(i * 1000) + /// printfn $"{i}" + /// } + /// |> Async.Start + /// + /// Thread.Sleep(6000) + /// Async.CancelDefaultToken() + /// printfn "Tasks Finished" + /// + /// 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", followed by "Tasks Finished". + /// static member DefaultCancellationToken : CancellationToken //---------- Parallelism /// Starts a child computation within an asynchronous workflow. /// This allows multiple asynchronous computations to be executed simultaneously. - /// + /// /// This method should normally be used as the immediate /// right-hand-side of a let! binding in an F# asynchronous workflow, that is, /// - /// async { ... - /// let! completor1 = childComputation1 |> Async.StartChild - /// let! completor2 = childComputation2 |> Async.StartChild - /// ... - /// let! result1 = completor1 - /// let! result2 = completor2 - /// ... } + /// async { ... + /// let! completor1 = childComputation1 |> Async.StartChild + /// let! completor2 = childComputation2 |> Async.StartChild + /// ... + /// let! result1 = completor1 + /// let! result2 = completor2 + /// ... } /// - /// + /// /// When used in this way, each use of StartChild starts an instance of childComputation /// and returns a completor object representing a computation to wait for the completion of the operation. /// When executed, the completor awaits the completion of childComputation. @@ -220,15 +356,42 @@ namespace Microsoft.FSharp.Control /// A new computation that waits for the input computation to finish. /// /// Cancellation and Exceptions - /// - /// + /// + /// + /// + /// + /// let computeWithTimeout timeout = + /// async { + /// let! completor1 = + /// Async.StartChild( + /// (async { + /// do! Async.Sleep(1000) + /// return 1 + /// }), + /// millisecondsTimeout = timeout) + /// + /// let! completor2 = + /// Async.StartChild( + /// (async { + /// do! Async.Sleep(2000) + /// return 2 + /// }), + /// millisecondsTimeout = timeout) + /// + /// let! v1 = completor1 + /// let! v2 = completor2 + /// printfn $"Result: {v1 + v2}" + /// } |> Async.RunSynchronously + /// + /// Will throw a System.TimeoutException if called with a timeout less than 2000, otherwise will print "Result: 3". + /// static member StartChild : computation:Async<'T> * ?millisecondsTimeout : int -> Async> /// Creates an asynchronous computation that executes all the given asynchronous computations, /// initially queueing each as work items and using a fork/join pattern. /// /// If all child computations succeed, an array of results is passed to the success continuation. - /// + /// /// If any child computation raises an exception, then the overall computation will trigger an /// exception, and cancel the others. /// @@ -241,8 +404,30 @@ namespace Microsoft.FSharp.Control /// A computation that returns an array of values from the sequence of input computations. /// /// Composing Async Computations - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 10; 11 ] + /// let t = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(System.Random().Next(1000, 2000)) + /// + /// if i % 2 > 0 then + /// printfn $"{i}" + /// return true + /// else + /// return false + /// } + /// ] + /// |> Async.Parallel + /// |> Async.StartAsTask + /// + /// t.Wait() + /// printfn $"%A{t.Result}" + /// + /// This will print "3", "5", "7", "11" (in any order) in 1-2 seconds and then [| false; true; true; true; false; true |]. + /// static member Parallel : computations:seq> -> Async<'T[]> /// Creates an asynchronous computation that executes all the given asynchronous computations, @@ -263,8 +448,33 @@ namespace Microsoft.FSharp.Control /// A computation that returns an array of values from the sequence of input computations. /// /// Composing Async Computations - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 10; 11 ] + /// let computations = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(System.Random().Next(1000, 2000)) + /// + /// return + /// if i % 2 > 0 then + /// printfn $"{i}" + /// true + /// else + /// false + /// } ] + /// + /// let t = + /// Async.Parallel(computations, maxDegreeOfParallelism=3) + /// |> Async.StartAsTask + /// + /// t.Wait() + /// printfn $"%A{t.Result}" + /// + /// This will print "3", "5" (in any order) in 1-2 seconds, and then "7", "11" (in any order) in 1-2 more seconds and then + /// [| false; true; true; true; false; true |]. + /// static member Parallel : computations:seq> * ?maxDegreeOfParallelism : int -> Async<'T[]> /// Creates an asynchronous computation that executes all the given asynchronous computations sequentially. @@ -283,13 +493,40 @@ namespace Microsoft.FSharp.Control /// A computation that returns an array of values from the sequence of input computations. /// /// Composing Async Computations - /// - /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7; 10; 11 ] + /// let computations = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(System.Random().Next(1000, 2000)) + /// + /// if i % 2 > 0 then + /// printfn $"{i}" + /// return true + /// else + /// return false + /// } + /// ] + /// + /// let t = + /// Async.Sequential(computations) + /// |> Async.StartAsTask + /// + /// t.Wait() + /// printfn $"%A{t.Result}" + /// + /// This will print "3", "5", "7", "11" with ~1-2 seconds between them except for pauses where even numbers would be and then + /// prints [| false; true; true; true; false; true |]. + /// static member Sequential : computations:seq> -> Async<'T[]> - /// Creates an asynchronous computation that executes all given asynchronous computations in parallel, + /// + /// Creates an asynchronous computation that executes all given asynchronous computations in parallel, /// returning the result of the first succeeding computation (one whose result is 'Some x'). - /// If all child computations complete with None, the parent computation also returns None. + /// If all child computations complete with None, the parent computation also returns None. + /// /// /// /// If any child computation raises an exception, then the overall computation will trigger an @@ -297,15 +534,63 @@ namespace Microsoft.FSharp.Control /// /// The overall computation will respond to cancellation while executing the child computations. /// If cancelled, the computation will cancel any remaining child computations but will still wait - /// for the other child computations to complete. + /// for the other child computations to complete. + /// /// /// A sequence of computations to be parallelized. /// /// A computation that returns the first succeeding computation. /// /// Composing Async Computations - /// - /// + /// + /// + /// + /// printfn "Starting" + /// let primes = [ 2; 3; 5; 7 ] + /// let computations = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(System.Random().Next(1000, 2000)) + /// return if i % 2 > 0 then Some(i) else None + /// } + /// ] + /// + /// computations + /// |> Async.Choice + /// |> Async.RunSynchronously + /// |> function + /// | Some (i) -> printfn $"{i}" + /// | None -> printfn "No Result" + /// + /// Prints one randomly selected odd number in 1-2 seconds. If the list is changed to all even numbers, it will + /// instead print "No Result". + /// + /// + /// + /// + /// let primes = [ 2; 3; 5; 7 ] + /// let computations = + /// [ for i in primes do + /// async { + /// do! Async.Sleep(System.Random().Next(1000, 2000)) + /// + /// return + /// if i % 2 > 0 then + /// Some(i) + /// else + /// failwith $"Even numbers not supported: {i}" + /// } + /// ] + /// + /// computations + /// |> Async.Choice + /// |> Async.RunSynchronously + /// |> function + /// | Some (i) -> printfn $"{i}" + /// | None -> printfn "No Result" + /// + /// Will sometimes print one randomly selected odd number, sometimes throw System.Exception("Even numbers not supported: 2"). + /// static member Choice : computations:seq> -> Async<'T option> //---------- Thread Control @@ -316,8 +601,16 @@ namespace Microsoft.FSharp.Control /// A computation that will execute on a new thread. /// /// Threads and Contexts - /// - /// + /// + /// + /// + /// async { + /// do! Async.SwitchToNewThread() + /// do! someLongRunningComputation() + /// } |> Async.StartImmediate + /// + /// This will run someLongRunningComputation() without blocking the threads in the threadpool. + /// static member SwitchToNewThread : unit -> Async /// Creates an asynchronous computation that queues a work item that runs @@ -326,8 +619,21 @@ namespace Microsoft.FSharp.Control /// A computation that generates a new work item in the thread pool. /// /// Threads and Contexts - /// - /// + /// + /// + /// + /// async { + /// do! Async.SwitchToNewThread() + /// do! someLongRunningComputation() + /// do! Async.SwitchToThreadPool() + /// + /// for i in 1 .. 10 do + /// do! someShortRunningComputation() + /// } |> Async.StartImmediate + /// + /// This will run someLongRunningComputation() without blocking the threads in the threadpool, and then switch to the + /// threadpool for shorter computations. + /// static member SwitchToThreadPool : unit -> Async /// Creates an asynchronous computation that runs @@ -339,7 +645,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that uses the syncContext context to execute. /// /// Threads and Contexts - /// + /// /// static member SwitchToContext : syncContext:System.Threading.SynchronizationContext -> Async @@ -353,8 +659,33 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that provides the callback with the current continuations. /// /// Composing Async Computations + /// + /// + /// + /// let someRiskyBusiness() = + /// match DateTime.Today with + /// | dt when dt.DayOfWeek = DayOfWeek.Monday -> failwith "Not compatible with Mondays" + /// | dt -> dt /// - /// + /// let computation = + /// (fun (successCont, exceptionCont, cancellationCont) -> + /// try + /// someRiskyBusiness () |> successCont + /// with + /// | :? OperationCanceledException as oce -> cancellationCont oce + /// | e -> exceptionCont e) + /// |> Async.FromContinuations + /// + /// Async.StartWithContinuations( + /// computation, + /// (fun result -> printfn $"Result: {result}"), + /// (fun e -> printfn $"Exception: {e}"), + /// (fun oce -> printfn $"Cancelled: {oce}") + /// ) + /// + /// This anonymous function will call someRiskyBusiness() and properly use the provided continuations + /// defined to report the outcome. + /// static member FromContinuations : callback:(('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> /// Creates an asynchronous computation that waits for a single invocation of a CLI @@ -364,7 +695,7 @@ namespace Microsoft.FSharp.Control /// The computation will respond to cancellation while waiting for the event. If a /// cancellation occurs, and cancelAction is specified, then it is executed, and /// the computation continues to wait for the event. - /// + /// /// If cancelAction is not specified, then cancellation causes the computation /// to cancel immediately. /// @@ -375,7 +706,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that waits for the event to be invoked. /// /// Awaiting Results - /// + /// /// static member AwaitEvent: event:IEvent<'Del,'T> * ?cancelAction : (unit -> unit) -> Async<'T> when 'Del : delegate<'T,unit> and 'Del :> System.Delegate @@ -390,7 +721,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that waits on the given WaitHandle. /// /// Awaiting Results - /// + /// /// static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout:int -> Async @@ -405,7 +736,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation that waits on the given IAsyncResult. /// /// Awaiting Results - /// + /// /// static member AwaitIAsyncResult: iar: System.IAsyncResult * ?millisecondsTimeout:int -> Async @@ -416,7 +747,7 @@ namespace Microsoft.FSharp.Control /// /// If an exception occurs in the asynchronous computation then an exception is re-raised by this /// function. - /// + /// /// If the task is cancelled then is raised. Note /// that the task may be governed by a different cancellation token to the overall async computation /// where the AwaitTask occurs. In practice you should normally start the task with the @@ -426,7 +757,7 @@ namespace Microsoft.FSharp.Control /// /// /// Awaiting Results - /// + /// /// static member AwaitTask: task: Task<'T> -> Async<'T> @@ -437,7 +768,7 @@ namespace Microsoft.FSharp.Control /// /// If an exception occurs in the asynchronous computation then an exception is re-raised by this /// function. - /// + /// /// If the task is cancelled then is raised. Note /// that the task may be governed by a different cancellation token to the overall async computation /// where the AwaitTask occurs. In practice you should normally start the task with the @@ -447,7 +778,7 @@ namespace Microsoft.FSharp.Control /// /// /// Awaiting Results - /// + /// /// static member AwaitTask: task: Task -> Async @@ -465,8 +796,19 @@ namespace Microsoft.FSharp.Control /// and not infinite. /// /// Awaiting Results - /// - /// + /// + /// + /// + /// async { + /// printfn "A" + /// do! Async.Sleep(1000) + /// printfn "B" + /// } |> Async.Start + /// + /// printfn "C" + /// + /// Prints "C", then "A" quickly, and then "B" 1 second later + /// static member Sleep: millisecondsDueTime:int -> Async /// @@ -482,8 +824,18 @@ namespace Microsoft.FSharp.Control /// Thrown when the due time is negative. /// /// Awaiting Results - /// - /// + /// + /// + /// + /// async { + /// printfn "A" + /// do! Async.Sleep(TimeSpan(0, 0, 1)) + /// printfn "B" + /// } |> Async.Start + /// printfn "C" + /// + /// Prints "C", then "A" quickly, and then "B" 1 second later. + /// static member Sleep: dueTime:TimeSpan -> Async /// @@ -495,7 +847,7 @@ namespace Microsoft.FSharp.Control /// The computation will respond to cancellation while waiting for the completion /// of the operation. If a cancellation occurs, and cancelAction is specified, then it is /// executed, and the computation continues to wait for the completion of the operation. - /// + /// /// If cancelAction is not specified, then cancellation causes the computation /// to stop immediately, and subsequent invocations of the callback are ignored. /// @@ -506,7 +858,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation wrapping the given Begin/End functions. /// /// Legacy .NET Async Interoperability - /// + /// /// static member FromBeginEnd : beginAction:(System.AsyncCallback * obj -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> @@ -531,7 +883,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation wrapping the given Begin/End functions. /// /// Legacy .NET Async Interoperability - /// + /// /// static member FromBeginEnd : arg:'Arg1 * beginAction:('Arg1 * System.AsyncCallback * obj -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> @@ -542,7 +894,7 @@ namespace Microsoft.FSharp.Control /// The computation will respond to cancellation while waiting for the completion /// of the operation. If a cancellation occurs, and cancelAction is specified, then it is /// executed, and the computation continues to wait for the completion of the operation. - /// + /// /// If cancelAction is not specified, then cancellation causes the computation /// to stop immediately, and subsequent invocations of the callback are ignored. /// @@ -555,7 +907,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation wrapping the given Begin/End functions. /// /// Legacy .NET Async Interoperability - /// + /// /// static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * beginAction:('Arg1 * 'Arg2 * System.AsyncCallback * obj -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> @@ -565,7 +917,7 @@ namespace Microsoft.FSharp.Control /// The computation will respond to cancellation while waiting for the completion /// of the operation. If a cancellation occurs, and cancelAction is specified, then it is /// executed, and the computation continues to wait for the completion of the operation. - /// + /// /// If cancelAction is not specified, then cancellation causes the computation /// to stop immediately, and subsequent invocations of the callback are ignored. /// @@ -579,7 +931,7 @@ namespace Microsoft.FSharp.Control /// An asynchronous computation wrapping the given Begin/End functions. /// /// Legacy .NET Async Interoperability - /// + /// /// static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * arg3:'Arg3 * beginAction:('Arg1 * 'Arg2 * 'Arg3 * System.AsyncCallback * obj -> System.IAsyncResult) * endAction:(System.IAsyncResult -> 'T) * ?cancelAction : (unit -> unit) -> Async<'T> @@ -592,7 +944,7 @@ namespace Microsoft.FSharp.Control /// A tuple of the begin, end, and cancel members. /// /// Legacy .NET Async Interoperability - /// + /// /// static member AsBeginEnd : computation:('Arg -> Async<'T>) -> // The 'Begin' member @@ -610,8 +962,21 @@ namespace Microsoft.FSharp.Control /// A computation that is equivalent to the input computation, but disregards the result. /// /// Composing Async Computations - /// - /// + /// + /// + /// + /// let readFile filename numBytes = + /// async { + /// use file = System.IO.File.OpenRead(filename) + /// printfn "Reading from file %s." filename + /// // Throw away the data being read. + /// do! file.AsyncRead(numBytes) |> Async.Ignore + /// } + /// readFile "example.txt" 42 |> Async.Start + /// + /// Reads bytes from a given file asynchronously and then ignores the result, allowing the do! to be used with functions + /// that return an unwanted value. + /// static member Ignore : computation: Async<'T> -> Async /// Runs an asynchronous computation, starting immediately on the current operating system @@ -628,14 +993,14 @@ namespace Microsoft.FSharp.Control /// The default is used if this parameter is not provided. /// /// Starting Async Computations - /// + /// /// static member StartWithContinuations: computation:Async<'T> * continuation:('T -> unit) * exceptionContinuation:(exn -> unit) * cancellationContinuation:(OperationCanceledException -> unit) * ?cancellationToken:CancellationToken-> unit - /// + /// /// static member internal StartWithContinuationsUsingDispatchInfo: computation:Async<'T> * @@ -652,8 +1017,21 @@ namespace Microsoft.FSharp.Control /// The default is used if this parameter is not provided. /// /// Starting Async Computations - /// - /// + /// + /// + /// + /// printfn "A" + /// + /// async { + /// printfn "B" + /// do! Async.Sleep(1000) + /// printfn "C" + /// } |> Async.StartImmediate + /// + /// printfn "D" + /// + /// Prints "A", "B", "D" immediately, then "C" in 1 second + /// static member StartImmediate: computation:Async * ?cancellationToken:CancellationToken-> unit @@ -674,8 +1052,24 @@ namespace Microsoft.FSharp.Control /// in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) /// /// Starting Async Computations - /// - /// + /// + /// + /// + /// printfn "A" + /// + /// let t = + /// async { + /// printfn "B" + /// do! Async.Sleep(1000) + /// printfn "C" + /// } |> Async.StartImmediateAsTask + /// + /// printfn "D" + /// t.Wait() + /// printfn "E" + /// + /// Prints "A", "B", "D" immediately, then "C", "E" in 1 second. + /// static member StartImmediateAsTask: computation:Async<'T> * ?cancellationToken:CancellationToken-> Task<'T> @@ -694,33 +1088,33 @@ namespace Microsoft.FSharp.Control /// The F# compiler emits calls to this function to implement F# async expressions. /// /// A value indicating asynchronous execution. - /// + /// /// member IsCancellationRequested: bool /// The F# compiler emits calls to this function to implement F# async expressions. /// /// A value indicating asynchronous execution. - /// + /// /// static member Success: AsyncActivation<'T> -> result: 'T -> AsyncReturn /// The F# compiler emits calls to this function to implement F# async expressions. /// /// A value indicating asynchronous execution. - /// + /// /// member OnSuccess: result: 'T -> AsyncReturn /// The F# compiler emits calls to this function to implement F# async expressions. - /// + /// /// member OnExceptionRaised: unit -> unit /// The F# compiler emits calls to this function to implement F# async expressions. /// /// A value indicating asynchronous execution. - /// + /// /// member OnCancellation: unit -> AsyncReturn @@ -830,7 +1224,7 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that will enumerate the sequence and run body /// for each element. - /// + /// /// member For: sequence:seq<'T> * body:('T -> Async) -> Async @@ -841,7 +1235,7 @@ namespace Microsoft.FSharp.Control /// The existence of this method permits the use of empty else branches in the /// async { ... } computation expression syntax. /// An asynchronous computation that returns (). - /// + /// /// member Zero : unit -> Async @@ -857,7 +1251,7 @@ namespace Microsoft.FSharp.Control /// The second part of the sequenced computation. /// /// An asynchronous computation that runs both of the computations sequentially. - /// + /// /// member inline Combine : computation1:Async * computation2:Async<'T> -> Async<'T> @@ -874,7 +1268,7 @@ namespace Microsoft.FSharp.Control /// of a while expression. /// /// An asynchronous computation that behaves similarly to a while loop when run. - /// + /// /// member While : guard:(unit -> bool) * computation:Async -> Async @@ -888,7 +1282,7 @@ namespace Microsoft.FSharp.Control /// The value to return from the computation. /// /// An asynchronous computation that returns value when executed. - /// + /// /// member inline Return : value:'T -> Async<'T> @@ -900,7 +1294,7 @@ namespace Microsoft.FSharp.Control /// The input computation. /// /// The input computation. - /// + /// /// member inline ReturnFrom : computation:Async<'T> -> Async<'T> @@ -911,7 +1305,7 @@ namespace Microsoft.FSharp.Control /// The function to run. /// /// An asynchronous computation that runs generator. - /// + /// /// member Delay : generator:(unit -> Async<'T>) -> Async<'T> @@ -929,7 +1323,7 @@ namespace Microsoft.FSharp.Control /// computation. /// /// An asynchronous computation that binds and eventually disposes resource. - /// + /// /// member Using: resource:'T * binder:('T -> Async<'U>) -> Async<'U> when 'T :> System.IDisposable @@ -946,7 +1340,7 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that performs a monadic bind on the result /// of computation. - /// + /// /// member inline Bind: computation: Async<'T> * binder: ('T -> Async<'U>) -> Async<'U> @@ -965,7 +1359,7 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that executes computation and compensation afterwards or /// when an exception is raised. - /// + /// /// member inline TryFinally : computation:Async<'T> * compensation:(unit -> unit) -> Async<'T> @@ -982,7 +1376,7 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that executes computation and calls catchHandler if an /// exception is thrown. - /// + /// /// member inline TryWith : computation:Async<'T> * catchHandler:(exn -> Async<'T>) -> Async<'T> From 97c7b9a621d3be21e876cd59fb7d17ecf28ee40a Mon Sep 17 00:00:00 2001 From: Janusz Wrobel Date: Sat, 24 Sep 2022 02:55:33 +0100 Subject: [PATCH 210/226] Parallel project analysis behind a feature flag (#13521) * Allow parallel project analysis with an environment variable * reformat CompilerImports.fs * Wire in the flag from top-level, add an internal option to the FSC, add a constructor arg to the FSharpChecker. * Fantomas formatting * Update surface baseline * Cleanup * Dummy commit to trigger PR checks * Update surface baseline after merge * Empty commit to trigger PR check rerun * Empty commit to trigger PR check rerun * Restore tests/fsharp/regression/13219/test.fsx --- src/Compiler/Driver/CompilerConfig.fs | 9 +++++ src/Compiler/Driver/CompilerConfig.fsi | 9 +++++ src/Compiler/Driver/CompilerImports.fs | 8 +++- src/Compiler/Driver/CompilerOptions.fs | 8 ++++ src/Compiler/Driver/fsc.fs | 17 +++++++++ src/Compiler/Driver/fsc.fsi | 3 ++ src/Compiler/Facilities/BuildGraph.fs | 8 +++- src/Compiler/Facilities/BuildGraph.fsi | 2 + src/Compiler/Service/IncrementalBuild.fs | 4 +- src/Compiler/Service/IncrementalBuild.fsi | 3 +- src/Compiler/Service/service.fs | 38 ++++++++++++++++--- src/Compiler/Service/service.fsi | 5 ++- ...erService.SurfaceArea.netstandard.expected | 2 +- 13 files changed, 104 insertions(+), 12 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 774cb954ca9..08946b84f63 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -388,6 +388,11 @@ type MetadataAssemblyGeneration = | ReferenceOut of outputPath: string | ReferenceOnly +[] +type ParallelReferenceResolution = + | On + | Off + [] type TcConfigBuilder = { @@ -580,6 +585,8 @@ type TcConfigBuilder = mutable xmlDocInfoLoader: IXmlDocumentationInfoLoader option mutable exiter: Exiter + + mutable parallelReferenceResolution: ParallelReferenceResolution } // Directories to start probing in @@ -767,6 +774,7 @@ type TcConfigBuilder = sdkDirOverride = sdkDirOverride xmlDocInfoLoader = None exiter = QuitProcessExiter + parallelReferenceResolution = ParallelReferenceResolution.Off } member tcConfigB.FxResolver = @@ -1310,6 +1318,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.applyLineDirectives = data.applyLineDirectives member _.xmlDocInfoLoader = data.xmlDocInfoLoader member _.exiter = data.exiter + member _.parallelReferenceResolution = data.parallelReferenceResolution static member Create(builder, validate) = use _ = UseBuildPhase BuildPhase.Parameter diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 342c767bbb2..70abf7beb63 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -198,6 +198,11 @@ type MetadataAssemblyGeneration = /// Only emits the assembly as a reference assembly. | ReferenceOnly +[] +type ParallelReferenceResolution = + | On + | Off + [] type TcConfigBuilder = { @@ -482,6 +487,8 @@ type TcConfigBuilder = mutable xmlDocInfoLoader: IXmlDocumentationInfoLoader option mutable exiter: Exiter + + mutable parallelReferenceResolution: ParallelReferenceResolution } static member CreateNew: @@ -845,6 +852,8 @@ type TcConfig = member exiter: Exiter + member parallelReferenceResolution: ParallelReferenceResolution + /// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig, /// but for F# Interactive it may be based on an underlying mutable TcConfigBuilder. [] diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 538ccd0817b..56513446bd3 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -2141,6 +2141,12 @@ and [] TcImports node { CheckDisposed() + let tcConfig = tcConfigP.Get ctok + let runMethod = + match tcConfig.parallelReferenceResolution with + | ParallelReferenceResolution.On -> NodeCode.Parallel + | ParallelReferenceResolution.Off -> NodeCode.Sequential + let! results = nms |> List.map (fun nm -> @@ -2151,7 +2157,7 @@ and [] TcImports errorR (Error(FSComp.SR.buildProblemReadingAssembly (nm.resolvedPath, e.Message), nm.originalReference.Range)) return None }) - |> NodeCode.Sequential + |> runMethod let dllinfos, phase2s = results |> Array.choose id |> List.ofArray |> List.unzip fixupOrphanCcus () diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 090131c2e3c..15abdfb5106 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -1680,6 +1680,14 @@ let internalFlags (tcConfigB: TcConfigBuilder) = None ) + CompilerOption( + "parallelreferenceresolution", + tagNone, + OptionUnit(fun () -> tcConfigB.parallelReferenceResolution <- ParallelReferenceResolution.On), + Some(InternalCommandLineOption("--parallelreferenceresolution", rangeCmdArgs)), + None + ) + testFlag tcConfigB ] @ diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index fce47af281e..270f6e948b9 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -446,6 +446,18 @@ let TryFindVersionAttribute g attrib attribName attribs deterministic = [] type Args<'T> = Args of 'T +let getParallelReferenceResolutionFromEnvironment () = + Environment.GetEnvironmentVariable("FCS_ParallelReferenceResolution") + |> Option.ofObj + |> Option.bind (fun flag -> + match bool.TryParse flag with + | true, runInParallel -> + if runInParallel then + Some ParallelReferenceResolution.On + else + Some ParallelReferenceResolution.Off + | false, _ -> None) + /// First phase of compilation. /// - Set up console encoding and code page settings /// - Process command line, flags and collect filenames @@ -533,6 +545,11 @@ let main1 tcConfigB.conditionalDefines <- "COMPILED" :: tcConfigB.conditionalDefines + // Override ParallelReferenceResolution set on the CLI with an environment setting if present. + match getParallelReferenceResolutionFromEnvironment () with + | Some parallelReferenceResolution -> tcConfigB.parallelReferenceResolution <- parallelReferenceResolution + | None -> () + // Display the banner text, if necessary if not bannerAlreadyPrinted then Console.Write(GetBannerText tcConfigB) diff --git a/src/Compiler/Driver/fsc.fsi b/src/Compiler/Driver/fsc.fsi index 5b37ace9224..8731b5fae0c 100644 --- a/src/Compiler/Driver/fsc.fsi +++ b/src/Compiler/Driver/fsc.fsi @@ -55,3 +55,6 @@ val CompileFromCommandLineArguments: tcImportsCapture: (TcImports -> unit) option * dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> unit + +/// Read the parallelReferenceResolution flag from environment variables +val internal getParallelReferenceResolutionFromEnvironment: unit -> ParallelReferenceResolution option diff --git a/src/Compiler/Facilities/BuildGraph.fs b/src/Compiler/Facilities/BuildGraph.fs index 8227b96043f..6170d726d75 100644 --- a/src/Compiler/Facilities/BuildGraph.fs +++ b/src/Compiler/Facilities/BuildGraph.fs @@ -182,6 +182,12 @@ type NodeCode private () = return results.ToArray() } + + static member Parallel (computations: NodeCode<'T> seq) = + computations + |> Seq.map (fun (Node x) -> x) + |> Async.Parallel + |> Node type private AgentMessage<'T> = GetValue of AsyncReplyChannel> * callerCancellationToken: CancellationToken @@ -331,7 +337,7 @@ type GraphNode<'T>(retryCompute: bool, computation: NodeCode<'T>) = // occur, making sure we are under the protection of the 'try'. // For example, NodeCode's 'try/finally' (TryFinally) uses async.TryFinally which does // implicit cancellation checks even before the try is entered, as do the - // de-sugaring of 'do!' and other CodeCode constructs. + // de-sugaring of 'do!' and other NodeCode constructs. let mutable taken = false try diff --git a/src/Compiler/Facilities/BuildGraph.fsi b/src/Compiler/Facilities/BuildGraph.fsi index 798653f5f4b..76001d940da 100644 --- a/src/Compiler/Facilities/BuildGraph.fsi +++ b/src/Compiler/Facilities/BuildGraph.fsi @@ -65,6 +65,8 @@ type NodeCode = static member Sequential: computations: NodeCode<'T> seq -> NodeCode<'T[]> + static member Parallel: computations: (NodeCode<'T> seq) -> NodeCode<'T[]> + /// Execute the cancellable computation synchronously using the ambient cancellation token of /// the NodeCode. static member FromCancellable: computation: Cancellable<'T> -> NodeCode<'T> diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index a1673102dc2..f3655c4cab3 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -1432,7 +1432,8 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking: bool, enableParallelCheckingWithSignatureFiles: bool, - dependencyProvider + dependencyProvider, + parallelReferenceResolution ) = let useSimpleResolutionSwitch = "--simpleresolution" @@ -1514,6 +1515,7 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc |> Some tcConfigB.parallelCheckingWithSignatureFiles <- enableParallelCheckingWithSignatureFiles + tcConfigB.parallelReferenceResolution <- parallelReferenceResolution tcConfigB, sourceFilesNew diff --git a/src/Compiler/Service/IncrementalBuild.fsi b/src/Compiler/Service/IncrementalBuild.fsi index 4843a5061e7..481ed50689e 100755 --- a/src/Compiler/Service/IncrementalBuild.fsi +++ b/src/Compiler/Service/IncrementalBuild.fsi @@ -264,7 +264,8 @@ type internal IncrementalBuilder = enableBackgroundItemKeyStoreAndSemanticClassification: bool * enablePartialTypeChecking: bool * enableParallelCheckingWithSignatureFiles: bool * - dependencyProvider: DependencyProvider option -> + dependencyProvider: DependencyProvider option * + parallelReferenceResolution: ParallelReferenceResolution -> NodeCode /// Generalized Incremental Builder. This is exposed only for unit testing purposes. diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 42f0be91ea0..9328b513aa5 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -175,7 +175,8 @@ type BackgroundCompiler keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, - enableParallelCheckingWithSignatureFiles + enableParallelCheckingWithSignatureFiles, + parallelReferenceResolution ) as self = let beforeFileChecked = Event() @@ -303,7 +304,8 @@ type BackgroundCompiler enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, enableParallelCheckingWithSignatureFiles, - dependencyProvider + dependencyProvider, + parallelReferenceResolution ) match builderOpt with @@ -1096,7 +1098,8 @@ type FSharpChecker keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, - enableParallelCheckingWithSignatureFiles + enableParallelCheckingWithSignatureFiles, + parallelReferenceResolution ) = let backgroundCompiler = @@ -1110,7 +1113,8 @@ type FSharpChecker keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, - enableParallelCheckingWithSignatureFiles + enableParallelCheckingWithSignatureFiles, + parallelReferenceResolution ) static let globalInstance = lazy FSharpChecker.Create() @@ -1122,6 +1126,24 @@ type FSharpChecker let braceMatchCache = MruCache(braceMatchCacheSize, areSimilar = AreSimilarForParsing, areSame = AreSameForParsing) + static let inferParallelReferenceResolution (parallelReferenceResolution: bool option) = + let explicitValue = + parallelReferenceResolution + |> Option.defaultValue false + |> function + | true -> ParallelReferenceResolution.On + | false -> ParallelReferenceResolution.Off + + let withEnvOverride = + // Override ParallelReferenceResolution set on the constructor with an environment setting if present. + getParallelReferenceResolutionFromEnvironment () + |> Option.defaultValue explicitValue + + withEnvOverride + + static member getParallelReferenceResolutionFromEnvironment() = + getParallelReferenceResolutionFromEnvironment () + /// Instantiate an interactive checker. static member Create ( @@ -1134,7 +1156,8 @@ type FSharpChecker ?keepAllBackgroundSymbolUses, ?enableBackgroundItemKeyStoreAndSemanticClassification, ?enablePartialTypeChecking, - ?enableParallelCheckingWithSignatureFiles + ?enableParallelCheckingWithSignatureFiles, + ?parallelReferenceResolution ) = let legacyReferenceResolver = @@ -1158,6 +1181,8 @@ type FSharpChecker if keepAssemblyContents && enablePartialTypeChecking then invalidArg "enablePartialTypeChecking" "'keepAssemblyContents' and 'enablePartialTypeChecking' cannot be both enabled." + let parallelReferenceResolution = inferParallelReferenceResolution parallelReferenceResolution + FSharpChecker( legacyReferenceResolver, projectCacheSizeReal, @@ -1168,7 +1193,8 @@ type FSharpChecker keepAllBackgroundSymbolUses, enableBackgroundItemKeyStoreAndSemanticClassification, enablePartialTypeChecking, - enableParallelCheckingWithSignatureFiles + enableParallelCheckingWithSignatureFiles, + parallelReferenceResolution ) member _.ReferenceResolver = legacyReferenceResolver diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 50b0a89eb11..31801bfbf46 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -8,6 +8,7 @@ open System open System.IO open FSharp.Compiler.AbstractIL.ILBinaryReader open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.CompilerConfig open FSharp.Compiler.Diagnostics open FSharp.Compiler.EditorServices open FSharp.Compiler.Symbols @@ -32,6 +33,7 @@ type public FSharpChecker = /// Indicates whether a table of symbol keys should be kept for background compilation /// Indicates whether to perform partial type checking. Cannot be set to true if keepAssmeblyContents is true. If set to true, can cause duplicate type-checks when richer information on a file is needed, but can skip background type-checking entirely on implementation files with signature files. /// Type check implementation files that are backed by a signature file in parallel. + /// Indicates whether to resolve references in parallel. static member Create: ?projectCacheSize: int * ?keepAssemblyContents: bool * @@ -42,7 +44,8 @@ type public FSharpChecker = ?keepAllBackgroundSymbolUses: bool * ?enableBackgroundItemKeyStoreAndSemanticClassification: bool * ?enablePartialTypeChecking: bool * - ?enableParallelCheckingWithSignatureFiles: bool -> + ?enableParallelCheckingWithSignatureFiles: bool * + ?parallelReferenceResolution: bool -> FSharpChecker /// diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 96da7c4c474..736193358e7 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2009,7 +2009,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String ToString() FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] DependencyFiles FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles() FSharp.Compiler.CodeAnalysis.FSharpChecker -FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance() FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions GetProjectOptionsFromCommandLineArgs(System.String, System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) From c7bae31c4477812f269c04babac0afc5ec879af5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 24 Sep 2022 13:37:29 +0000 Subject: [PATCH 211/226] Update dependencies from https://github.com/dotnet/arcade build 20220923.1 (#13977) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk From Version 8.0.0-beta.22472.1 -> To Version 8.0.0-beta.22473.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- global.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0fb1b4efdc7..80e7ef74b8e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - 00d7e107ffaa9613733e390a282bd1e13c1d8d17 + ba4d2568dd2e3e7538feeaba60215f7bcb99e89c - + https://github.com/dotnet/arcade - 00d7e107ffaa9613733e390a282bd1e13c1d8d17 + ba4d2568dd2e3e7538feeaba60215f7bcb99e89c diff --git a/global.json b/global.json index 25ec44e006b..ed1a0361528 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22472.1", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22472.1" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22473.1", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22473.1" } } From 8244fe492357fa57bca001760b0234213d82078a Mon Sep 17 00:00:00 2001 From: Thomas Boby Date: Sat, 24 Sep 2022 15:49:06 +0100 Subject: [PATCH 212/226] Prevent infering type parameters on getset props (#13978) --- src/Compiler/Checking/CheckExpressions.fs | 4 +- tests/fsharp/typecheck/sigs/neg32.bsl | 46 +++++++++++++---------- tests/fsharp/typecheck/sigs/neg32.fs | 9 ++++- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 0ef6963c527..1b65421daba 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -2185,7 +2185,9 @@ module GeneralizationHelpers = | Some memberFlags -> match memberFlags.MemberKind with // can't infer extra polymorphism for properties - | SynMemberKind.PropertyGet | SynMemberKind.PropertySet -> false + | SynMemberKind.PropertyGet + | SynMemberKind.PropertySet + | SynMemberKind.PropertyGetSet -> false // can't infer extra polymorphism for class constructors | SynMemberKind.ClassConstructor -> false // can't infer extra polymorphism for constructors diff --git a/tests/fsharp/typecheck/sigs/neg32.bsl b/tests/fsharp/typecheck/sigs/neg32.bsl index bb849961393..6afdd7ae5a7 100644 --- a/tests/fsharp/typecheck/sigs/neg32.bsl +++ b/tests/fsharp/typecheck/sigs/neg32.bsl @@ -3,42 +3,48 @@ neg32.fs(17,21,17,49): typecheck error FS0842: This attribute is not valid for u neg32.fs(24,15,24,16): typecheck error FS0043: The member or object constructor 'TryParse' does not take 1 argument(s). An overload was found taking 2 arguments. -neg32.fs(39,17,39,19): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(43,17,43,19): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(40,4,40,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead. +neg32.fs(44,4,44,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead. -neg32.fs(40,21,40,23): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(44,21,44,23): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(41,21,41,23): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(45,21,45,23): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(41,27,41,29): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(45,27,45,29): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(42,18,42,20): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(46,18,46,20): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(42,24,42,26): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(46,24,46,26): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(46,17,46,19): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(50,17,50,19): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(47,4,47,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead. +neg32.fs(51,4,51,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead. -neg32.fs(47,21,47,23): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(51,21,51,23): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(48,21,48,23): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(52,21,52,23): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(48,27,48,29): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(52,27,52,29): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(49,18,49,20): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(53,18,53,20): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(49,24,49,26): typecheck error FS0039: The type parameter 'U is not defined. +neg32.fs(53,24,53,26): typecheck error FS0039: The type parameter 'U is not defined. -neg32.fs(52,10,52,12): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(54,18,54,20): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(52,10,52,12): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(55,18,55,20): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(55,11,55,13): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(56,18,56,20): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(55,11,55,13): typecheck error FS0039: The type parameter 'T is not defined. +neg32.fs(59,10,59,12): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(59,65,59,86): typecheck error FS0033: The non-generic type 'System.EventArgs' does not expect any type arguments, but here is given 1 type argument(s) +neg32.fs(59,10,59,12): typecheck error FS0039: The type parameter 'T is not defined. -neg32.fs(59,21,59,27): typecheck error FS1091: The event 'Event1' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit add_Event1 and remove_Event1 methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. +neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined. + +neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined. + +neg32.fs(66,65,66,86): typecheck error FS0033: The non-generic type 'System.EventArgs' does not expect any type arguments, but here is given 1 type argument(s) + +neg32.fs(66,21,66,27): typecheck error FS1091: The event 'Event1' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit add_Event1 and remove_Event1 methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. diff --git a/tests/fsharp/typecheck/sigs/neg32.fs b/tests/fsharp/typecheck/sigs/neg32.fs index 4ff91d11dcf..a8893b86bbe 100644 --- a/tests/fsharp/typecheck/sigs/neg32.fs +++ b/tests/fsharp/typecheck/sigs/neg32.fs @@ -34,7 +34,11 @@ type PositiveClass<'A>() = abstract M<'T> : 'T -> 'T abstract M2<'T> : 'T -> 'A abstract M : 'U -> 'U - + abstract M3 : 'A with get, set + abstract M4 : 'A with set + abstract M5 : 'A with get + + type NegativeInterface = abstract v : 'T abstract M<'T> : 'U @@ -47,6 +51,9 @@ type NegativeClass() = abstract M<'T> : 'U abstract M<'T> : 'U -> 'U abstract M : ('U -> 'U) + abstract M2 : 'T with get, set + abstract M3 : 'T with set + abstract M4 : 'T with get type NegativeRecord = { v : 'T } From 4c4c3894bb118332e036ad99fcff1de89d6af307 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 26 Sep 2022 09:03:12 -0700 Subject: [PATCH 213/226] Merge main to release/dev17.4 (#13980) Co-authored-by: Edgar Gonzalez Co-authored-by: Vlad Zarytovskii --- src/Compiler/Checking/NicePrint.fs | 14 ------------- src/Compiler/TypedTree/TypedTreeOps.fs | 16 +------------- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 --- .../Signatures/ArrayTests.fs | 21 +++++++++---------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index dbbe333b9cd..b7b4cce955f 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -875,16 +875,6 @@ module PrintTypes = | [] -> tcL | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) - - and layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level = - let innerLayout = layoutTypeWithInfoAndPrec denv env prec innerT - - let arrayLayout = - tagEntityRefName denv tcref $"array{level}d" - |> mkNav tcref.DefinitionRange - |> wordL - - innerLayout ^^ arrayLayout /// Layout a type, taking precedence into account to insert brackets where needed and layoutTypeWithInfoAndPrec denv env prec ty = @@ -906,10 +896,6 @@ module PrintTypes = // Always prefer 'float' to 'float<1>' | TType_app (tc, args, _) when tc.IsMeasureableReprTycon && List.forall (isDimensionless g) args -> layoutTypeWithInfoAndPrec denv env prec (reduceTyconRefMeasureableOrProvided g tc args) - - // Special case for nested array> shape - | TTypeMultiDimensionalArrayAsGeneric (tcref, innerT, level) -> - layoutTypeForGenericMultidimensionalArrays denv env prec tcref innerT level // Layout a type application | TType_ucase (UnionCaseRef(tc, _), args) diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index bc037c8af7e..c166230e718 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -10410,18 +10410,4 @@ let (|EmptyModuleOrNamespaces|_|) (moduleOrNamespaceContents: ModuleOrNamespaceC Some emptyModuleOrNamespaces else None - | _ -> None - -let (|TTypeMultiDimensionalArrayAsGeneric|_|) (t: TType) = - let rec (|Impl|_|) t = - match t with - | TType_app(tc, [Impl(outerTc, innerT, currentLevel)], _) when tc.DisplayNameCore = "array" -> - Some (outerTc, innerT, currentLevel + 1) - | TType_app(tc, [arg], _) when tc.DisplayNameCore = "array" -> - Some (tc, arg, 1) - | _ -> None - - match t with - | Impl (tc, arg, level) -> - if level > 2 then Some (tc, arg, level) else None - | _ -> None + | _ -> None \ No newline at end of file diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 403498c5417..00d838e04d4 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2687,6 +2687,3 @@ type TraitConstraintInfo with /// This will match anything that does not have any types or bindings. val (|EmptyModuleOrNamespaces|_|): moduleOrNamespaceContents: ModuleOrNamespaceContents -> (ModuleOrNamespace list) option - -/// Captures an application type with a multi-dimensional array as postfix. -val (|TTypeMultiDimensionalArrayAsGeneric|_|): t: TType -> (TyconRef * TType * int) option diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs index 2317005032f..da6c65b1c82 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/ArrayTests.fs @@ -32,17 +32,16 @@ let ``4 dimensional array`` () = "val a: int array4d" [] -let ``5 till 32 dimensional array`` () = - [ 5 .. 32 ] - |> List.iter (fun idx -> - let arrayType = - [ 1 .. idx ] - |> List.fold (fun acc _ -> $"array<{acc}>") "int" - - assertSingleSignatureBinding - $"let a : {arrayType} = failwith \"todo\"" - $"val a: int array{idx}d" - ) +let ``jagged array 1`` () = + assertSingleSignatureBinding + "let a : array>>>> = failwith \"todo\"" + "val a: int array array array array array" + +[] +let ``jagged array 2`` () = + assertSingleSignatureBinding + "let a: int[][][][][] = failwith \"todo\"" + "val a: int array array array array array" [] let ``Use array2d syntax in implementation`` () = From 7669e0a6dbeb872512c073c49c7661a71cfb6e07 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 27 Sep 2022 11:05:24 +0100 Subject: [PATCH 214/226] Cherry pick #13987 to 17.4 (#13988) --- src/Compiler/Utilities/illib.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 6eab1b08508..49cef8a36a9 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -610,7 +610,7 @@ module ResizeArray = // * doing a block copy using `List.CopyTo(index, array, index, count)` (requires more copies to do the mapping) // none are significantly better. for i in 0 .. takeCount - 1 do - holder[i] <- f items[i] + holder[i] <- f items[startIndex + i] yield holder |] From f07ccb1bc4325861cb4306733f59b23f6d4344f7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 6 Oct 2022 18:47:59 +0100 Subject: [PATCH 215/226] fix regression in editing .NET Core scripts in devenv.exe (#13994) * fix regression in editing scripts in devenv.exe * fix regression in editing scripts in devenv.exe * fix regression in editing scripts in devenv.exe * fix regression in editing scripts in devenv.exe * add tests --- src/Compiler/Driver/CompilerImports.fs | 1 + src/Compiler/Driver/FxResolver.fs | 61 ++++++++++++++++--- tests/service/ScriptOptionsTests.fs | 29 ++++++++- .../FSharpProjectOptionsManager.fs | 2 +- .../src/FSharp.VS.FSI/fsiLanguageService.fs | 10 +-- 5 files changed, 87 insertions(+), 16 deletions(-) diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 56513446bd3..a329635b609 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -2142,6 +2142,7 @@ and [] TcImports CheckDisposed() let tcConfig = tcConfigP.Get ctok + let runMethod = match tcConfig.parallelReferenceResolution with | ParallelReferenceResolution.On -> NodeCode.Parallel diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index 2fa595ee15b..ae69346d689 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -382,16 +382,16 @@ type internal FxResolver let tryGetNetCoreRefsPackDirectoryRoot () = tryNetCoreRefsPackDirectoryRoot.Force() + let getTfmNumber (v: string) = + let arr = v.Split([| '.' |], 3) + arr[0] + "." + arr[1] + // Tries to figure out the tfm for the compiler instance. // On coreclr it uses the deps.json file // // On-demand because (a) some FxResolver are ephemeral (b) we want to avoid recomputation - let tryGetRunningTfm = + let tryGetRunningTfm () = let runningTfmOpt = - let getTfmNumber (v: string) = - let arr = v.Split([| '.' |], 3) - arr[0] + "." + arr[1] - // Compute TFM from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription // System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;; // val it: string = ".NET 6.0.7" @@ -548,6 +548,24 @@ type internal FxResolver assemblyReferences |> List.iter traverseDependencies assemblies + let tryGetTfmFromSdkDir (sdkDir: string) = + let dotnetConfigFile = Path.Combine(sdkDir, "dotnet.runtimeconfig.json") + + try + use stream = FileSystem.OpenFileForReadShim(dotnetConfigFile) + let dotnetConfig = stream.ReadAllText() + let pattern = "\"tfm\": \"" + + let startPos = + dotnetConfig.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) + + pattern.Length + + let endPos = dotnetConfig.IndexOf("\"", startPos) + let tfm = dotnetConfig[startPos .. endPos - 1] + tfm + with _ -> + tryGetRunningTfm () + // This list is the default set of references for "non-project" files. // // These DLLs are @@ -806,12 +824,37 @@ type internal FxResolver RequireFxResolverLock(fxtok, "assuming all member require lock") tryGetSdkDir () |> replayWarnings) - /// Gets the selected target framework moniker, e.g netcore3.0, net472, and the running rid of the current machine + /// Gets + /// 1. The Target Framework Moniker (TFM) used for scripting (e.g netcore3.0, net472) + /// 2. The running RID of the current machine (e.g. win-x64) + /// + /// When analyzing scripts for editing, this is **not** necessarily the running TFM. Rather, it is the TFM to use for analysing + /// a script. + /// + /// Summary: + /// - When running scripts (isInteractive = true) this is identical to the running TFM. + /// + /// - When analyzing .NET Core scripts (isInteractive = false, tryGetSdkDir is Some), + /// the scripting TFM is determined from dotnet.runtimeconfig.json in the SDK directory + /// + /// - Otherwise, the running TFM is used. That is, if editing with .NET Framework/Core-based tooling a script is assumed + /// to be .NET Framework/Core respectively. + /// + /// The RID returned is always the RID of the running machine. member _.GetTfmAndRid() = fxlock.AcquireLock(fun fxtok -> RequireFxResolverLock(fxtok, "assuming all member require lock") - let runningTfm = tryGetRunningTfm + // Interactive processes read their own configuration to find the running tfm + let targetTfm = + if isInteractive then + tryGetRunningTfm () + else + let sdkDir = tryGetSdkDir () |> replayWarnings + + match sdkDir with + | Some dir -> tryGetTfmFromSdkDir dir + | None -> tryGetRunningTfm () // Coreclr has mechanism for getting rid // System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier @@ -862,7 +905,7 @@ type internal FxResolver | Architecture.Arm64 -> baseRid + "-arm64" | _ -> baseRid + "-arm" - runningTfm, runningRid) + targetTfm, runningRid) static member ClearStaticCaches() = desiredDotNetSdkVersionForDirectoryCache.Clear() @@ -885,7 +928,7 @@ type internal FxResolver let defaultReferences = if assumeDotNetFramework then getDotNetFrameworkDefaultReferences useFsiAuxLib, assumeDotNetFramework - else if useSdkRefs then + elif useSdkRefs then // Go fetch references let sdkDir = tryGetSdkRefsPackDirectory () |> replayWarnings diff --git a/tests/service/ScriptOptionsTests.fs b/tests/service/ScriptOptionsTests.fs index a533d7ac4c8..998120a81d4 100644 --- a/tests/service/ScriptOptionsTests.fs +++ b/tests/service/ScriptOptionsTests.fs @@ -24,11 +24,12 @@ let pi = Math.PI """ [] +[] [] [] let ``can generate options for different frameworks regardless of execution environment``(assumeNetFx, useSdk, flags) = let path = Path.GetTempPath() - let file = tryCreateTemporaryFileName () + let file = tryCreateTemporaryFileName () + ".fsx" let tempFile = Path.Combine(path, file) let _, errors = checker.GetProjectOptionsFromScript(tempFile, SourceText.ofString scriptSource, assumeDotNetFramework = assumeNetFx, useSdkRefs = useSdk, otherFlags = flags) @@ -37,6 +38,32 @@ let ``can generate options for different frameworks regardless of execution envi | [] -> () | errors -> failwithf "Error while parsing script with assumeDotNetFramework:%b, useSdkRefs:%b, and otherFlags:%A:\n%A" assumeNetFx useSdk flags errors +#if NETFRAMEWORK +// See https://github.com/dotnet/fsharp/pull/13994#issuecomment-1259663865 +// +// .NET Core-based tooling can't resolve nuget packages to .NET Framework references +[] +#endif +[] +[] +let ``can resolve nuget packages to right target framework for different frameworks regardless of execution environment``(assumeNetFx, useSdk, flags) = + let path = Path.GetTempPath() + let file = tryCreateTemporaryFileName () + ".fsx" + let tempFile = Path.Combine(path, file) + let scriptSource = """ +#r "nuget: FSharp.Data, 3.3.3" +open System +let pi = Math.PI +""" + let options, errors = + checker.GetProjectOptionsFromScript(tempFile, SourceText.ofString scriptSource, assumeDotNetFramework = assumeNetFx, useSdkRefs = useSdk, otherFlags = flags) + |> Async.RunImmediate + match errors with + | [] -> () + | errors -> failwithf "Error while parsing script with assumeDotNetFramework:%b, useSdkRefs:%b, and otherFlags:%A:\n%A" assumeNetFx useSdk flags errors + let expectedReferenceText = (if assumeNetFx then "net45" else "netstandard2.0") + let found = options.OtherOptions |> Array.exists (fun s -> s.Contains(expectedReferenceText) && s.Contains("FSharp.Data.dll")) + Assert.IsTrue(found) // This test atempts to use a bad SDK number 666.666.666 // diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 815fab5e904..92d2cefaae5 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -182,7 +182,7 @@ type private FSharpProjectOptionsReactor (checker: FSharpChecker) = let! scriptProjectOptions, _ = checker.GetProjectOptionsFromScript(document.FilePath, sourceText.ToFSharpSourceText(), - SessionsProperties.fsiPreview, + previewEnabled=SessionsProperties.fsiPreview, assumeDotNetFramework=not SessionsProperties.fsiUseNetCore, userOpName=userOpName) diff --git a/vsintegration/src/FSharp.VS.FSI/fsiLanguageService.fs b/vsintegration/src/FSharp.VS.FSI/fsiLanguageService.fs index 8de6290a979..b943d3cca13 100644 --- a/vsintegration/src/FSharp.VS.FSI/fsiLanguageService.fs +++ b/vsintegration/src/FSharp.VS.FSI/fsiLanguageService.fs @@ -46,6 +46,11 @@ type FsiPropertyPage() = [] member this.FsiShadowCopy with get() = SessionsProperties.fsiShadowCopy and set (x:bool) = SessionsProperties.fsiShadowCopy <- x + [] + [] + [] + member this.FsiUseNetCore with get() = SessionsProperties.fsiUseNetCore and set (x:bool) = SessionsProperties.fsiUseNetCore <- x + [] [] [] @@ -56,11 +61,6 @@ type FsiPropertyPage() = [] member this.FsiPreview with get() = SessionsProperties.fsiPreview and set (x:bool) = SessionsProperties.fsiPreview <- x - [] - [] - [] - member this.FsiUseNetCore with get() = SessionsProperties.fsiUseNetCore and set (x:bool) = SessionsProperties.fsiUseNetCore <- x - // CompletionSet type internal FsiCompletionSet(imageList,source:Source) = inherit CompletionSet(imageList, source) From 04fa10a77431d9235c8a92ef2ae63ca6fd958a20 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 7 Oct 2022 12:12:20 +0200 Subject: [PATCH 216/226] Update target branch for 17.4 to rel/d17.4 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d7a5ca159a7..2b2fcca507c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -728,7 +728,7 @@ stages: - template: eng/release/insert-into-vs.yml parameters: componentBranchName: refs/heads/release/dev17.4 - insertTargetBranch: main + insertTargetBranch: rel/d17.4 insertTeamEmail: fsharpteam@microsoft.com insertTeamName: 'F#' From 532a074f9b304325d8bcd554ac73a1183b74a8f0 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 7 Oct 2022 07:59:47 -0700 Subject: [PATCH 217/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 1997730 (#13925) (#14041) Co-authored-by: Vlad Zarytovskii --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 2 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 822297d4ff9..9dbc32b4b15 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index afb89b3f305..fcfdbb8afb0 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 7bff656b19d..b11d915ab39 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 9e4bb29ee0c..cb36f32b1f0 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 6e56bbe7ee8..766e0e30348 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 18b818fea07..433aa7af0f5 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 052d424f56f..2e326e9ecf1 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index eb4a2819499..7fc1f4bbf36 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 04e91c3089b..292cef9ae5d 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 29bdaf2512e..995169db4e7 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 4b1b2804206..865ff430c4a 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 653c27378ca..66ca6254000 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 781002375e3..aee1dd1ed12 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 + Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. From 5bdd01cf158a4b214f11025fdd45ac7e4774509f Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 10 Oct 2022 13:51:35 -0700 Subject: [PATCH 218/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2014480 (#14049) --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 2 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 9dbc32b4b15..822297d4ff9 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index fcfdbb8afb0..afb89b3f305 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index b11d915ab39..7bff656b19d 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index cb36f32b1f0..9e4bb29ee0c 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 766e0e30348..6e56bbe7ee8 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 433aa7af0f5..18b818fea07 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 2e326e9ecf1..052d424f56f 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 7fc1f4bbf36..eb4a2819499 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 292cef9ae5d..04e91c3089b 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 995169db4e7..29bdaf2512e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 865ff430c4a..4b1b2804206 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 66ca6254000..653c27378ca 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index aee1dd1ed12..781002375e3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 From c014e59d3b18574cc9c7f72b9034a13030f1ad3d Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 11 Oct 2022 00:53:10 -0700 Subject: [PATCH 219/226] XLF --- src/Compiler/xlf/FSComp.txt.cs.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.de.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.es.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.fr.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.it.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.ja.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.ko.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.pl.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.ru.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.tr.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 45 ------------------------- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 45 ------------------------- 13 files changed, 585 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 13fff445b54..9dbc32b4b15 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -492,11 +492,6 @@ Neplatná cesta k referenčnímu sestavení - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Zadejte zahrnuté informace o optimalizaci, výchozí hodnota je soubor. Důležité pro distribuované knihovny. @@ -3262,11 +3257,6 @@ Neočekávaný celočíselný literál ve výrazu měrné jednotky - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Neshoda v názvu operátoru citace (začíná na {0}) @@ -5212,16 +5202,6 @@ Informační soubor zdrojového odkazu, který se má vložit do souboru PDB typu Portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Zdrojový soubor je příliš velký pro vložený do souboru PDB typu Portable. @@ -6277,21 +6257,6 @@ Členové rozšíření nemůžou poskytovat přetížení operátorů. Zvažte možnost definovat místo toho operátor v definici typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Případ typu union s názvem {0} koliduje s generovaným typem {1}. @@ -6567,11 +6532,6 @@ Zadaná verze {0} je {1}, ale tato hodnota představuje zástupný znak a vy jste požádali o deterministické sestavení, což je v konfliktu. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Znak {0} není v názvu poskytnutého oboru názvů {1} povolený. @@ -8197,11 +8157,6 @@ Mapuje fyzické cesty na názvy zdrojových cest z výstupu kompilátoru. - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Neplatná mapa cest. Mapování musí být oddělená čárkami a používat formát cesta=zdrojováCesta. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 1fb5dd43924..fcfdbb8afb0 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -492,11 +492,6 @@ Ungültiger Referenzassemblypfad" - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Geben Sie die enthaltenen Optimierungsinformationen an, der Standardwert ist „file“. Wichtig für verteilte Bibliotheken. @@ -3262,11 +3257,6 @@ Unerwartetes Integer-Literal in Maßeinheitenausdruck. - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Anführungszeichen-Operatorname stimmt nicht überein, beginnt mit "{0}". @@ -5212,16 +5202,6 @@ Die Datei mit Informationen zur Quellverknüpfung, die in die portierbare PDB-Datei eingebettet werden soll - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Die Quelldatei ist zu groß, um in eine portierbare PDB eingebettet zu werden. @@ -6277,21 +6257,6 @@ Erweiterungsmember können keine Operatorüberladungen bereitstellen. Definieren Sie den Operator stattdessen als Teil der Typdefinition. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Der Union-Fall mit dem Namen '{0}' befindet sich in einem Konflikt mit dem generierten Typ '{1}'. @@ -6567,11 +6532,6 @@ {0} hat Version "{1}" angegeben, dieser Wert ist jedoch ein Platzhalter, und Sie haben einen deterministischen Build angefordert. Zwischen diesen besteht ein Konflikt. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Das Zeichen '{0}' ist im angegebenen Namespacenamen '{1}' nicht zulässig. @@ -8197,11 +8157,6 @@ Ordnet der Ausgabe von Quellpfadnamen des Compilers physische Pfade zu - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Ungültige Pfadzuordnung. Zuordnungen müssen durch Kommas getrennt werden und das Format 'path=sourcePath' aufweisen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 8a03225e53d..b11d915ab39 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -492,11 +492,6 @@ Ruta de acceso de ensamblado de referencia no válida - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Especifique la información de optimización incluida, el valor predeterminado es el archivo. Importante para las bibliotecas distribuidas. @@ -3262,11 +3257,6 @@ Literal entero inesperado en una expresión de unidad de medida. - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Falta el elemento de clausura en un nombre de operador de expresión de código delimitada que comienza con '{0}'. @@ -5212,16 +5202,6 @@ Archivo de información de vínculos de origen para insertar en el archivo PDB portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB El archivo de código fuente es demasiado grande para insertarlo en un archivo PDB portable @@ -6277,21 +6257,6 @@ Los miembros de extensión no pueden proporcionar sobrecargas de operador. En su lugar, considere definir el operador como parte de la definición de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' El caso de unión denominado '{0}' entra en conflicto con el tipo generado '{1}'. @@ -6567,11 +6532,6 @@ Un objeto {0} especificó la versión "{1}", pero este valor es un carácter comodín y ha solicitado una compilación determinista. Estas opciones están en conflicto. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' No se permite el carácter '{0}' en el nombre de espacio de nombres '{1}' proporcionado. @@ -8197,11 +8157,6 @@ Asigna rutas físicas de acceso a nombres de ruta de origen resultantes del compilador - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapa de ruta no válido. Las asignaciones deben estar separadas por comas y tener el formato "path=rutaOrigen" diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index f8d6c7fa462..cb36f32b1f0 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -492,11 +492,6 @@ Chemin d'assemblage de référence non valide' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Spécifiez les informations d’optimisation incluses, la valeur par défaut est le fichier. Important pour les bibliothèques distribuées. @@ -3262,11 +3257,6 @@ Littéral d'entier inattendu dans l'expression de l'unité de mesure - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Incompatibilité du nom d'opérateur de quotation, qui commence par '{0}' @@ -5212,16 +5202,6 @@ Fichier d'informations Source Link à incorporer dans le fichier PDB portable - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Le fichier source est trop grand pour être incorporé dans un fichier PDB portable @@ -6277,21 +6257,6 @@ Les membres d'extension ne peuvent pas fournir de surcharges d'opérateur. Définissez l'opérateur comme faisant partie de la définition de type. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Le cas d'union nommé '{0}' est en conflit avec le type généré '{1}' @@ -6567,11 +6532,6 @@ {0} a spécifié la version '{1}', mais cette valeur est un caractère générique, et comme vous avez demandé une build déterministe, il existe un conflit. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Le caractère '{0}' n'est pas autorisé dans le nom d'espace de noms fourni '{1}' @@ -8197,11 +8157,6 @@ Mappe les chemins physiques aux noms de chemin source générés par le compilateur - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mappage de chemin non valide. Les mappages doivent être séparés par des virgules et au format 'path=sourcePath' diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 28700690838..766e0e30348 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -492,11 +492,6 @@ Percorso assembly di riferimento non valido' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Specificare le informazioni di ottimizzazione incluse. Il valore predefinito è file. Important per le librerie distribuite. @@ -3262,11 +3257,6 @@ Valore letterale Integer non previsto in espressione di unità di misura - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Nome operatore di quotation non corrispondente con '{0}' iniziale @@ -5212,16 +5202,6 @@ File di informazioni sul collegamento all'origine da incorporare nel file PDB portabile - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Le dimensioni del file di origine sono eccessive per consentirne l'incorporamento in un PDB portabile @@ -6277,21 +6257,6 @@ I membri di estensione non possono fornire overload di operatori. Provare a definire l'operatore come parte della definizione del tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Il case di unione denominato '{0}' è in conflitto con il tipo generato '{1}' @@ -6567,11 +6532,6 @@ In un attributo {0} è stata specificata la versione '{1}', ma questo valore è un carattere jolly ed è stata richiesta una compilazione deterministica. Tali opzioni sono in conflitto. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Il carattere '{0}' non è consentito nel nome dello spazio dei nomi fornito '{1}' @@ -8197,11 +8157,6 @@ Esegue il mapping dei percorsi fisici ai nomi di percorso di origine restituiti dal compilatore - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapping di percorso non valido. I mapping devono essere delimitati da virgole e specificati in formato 'percorso=percorsoOrigine' diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 31ab9348108..433aa7af0f5 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -492,11 +492,6 @@ 参照アセンブリ パスが無効です' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -3262,11 +3257,6 @@ 単位式に予期しない整数リテラルが見つかりました - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' '{0}' で始まる演算子名の引用符が対応しません @@ -5212,16 +5202,6 @@ 移植可能な PDB ファイルに埋め込むソース リンク情報ファイル - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB ソース ファイルが大きすぎるので、移植可能な PDB 内に埋め込めません @@ -6277,21 +6257,6 @@ 拡張メンバーでは演算子のオーバーロードを実行できません。代わりに型定義の一部として演算子を定義してください。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' {0}' という名前の共用体ケースが、生成された型 '{1}' と競合します @@ -6567,11 +6532,6 @@ {0} によりバージョン '{1}' が指定されましたが、この値はワイルドカードです。決定論的なビルドを要求しているため、これらの指定は矛盾しています。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 指定された名前空間名 '{1}' には、文字 '{0}' を使用することはできません @@ -8197,11 +8157,6 @@ 物理パスをコンパイラ出力のソース パス名にマップします - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 無効なパス マップです。マッピングはコンマ区切りの 'path=sourcePath' 形式である必要があります diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 3e4d0dca5ce..2e326e9ecf1 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -492,11 +492,6 @@ 잘못된 참조 어셈블리 경로' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. 포함된 최적화 정보를 지정합니다. 기본값은 파일입니다. 분산 라이브러리에 중요합니다. @@ -3262,11 +3257,6 @@ 측정 단위 식에 예기치 않은 정수 리터럴이 있습니다. - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' 짝이 맞지 않는 인용구 연산자 이름('{0}'(으)로 시작)입니다. @@ -5212,16 +5202,6 @@ 이식 가능한 PDB 파일에 포함할 소스 링크 정보 파일 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB 소스 파일이 너무 커서 이식 가능한 PDB에 포함할 수 없습니다. @@ -6277,21 +6257,6 @@ 확장 멤버가 연산자 오버로드를 제공할 수 없습니다. 대신 연산자를 형식 정의의 일부분으로 정의하세요. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' 이름이 '{0}'인 공용 구조체가 생성된 형식 '{1}'과(와) 충돌합니다. @@ -6567,11 +6532,6 @@ {0}이(가) '{1}' 버전을 지정했지만, 이 값은 와일드카드인데 사용자가 결정적 빌드를 요청하여 문제가 발생했습니다. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 제공된 네임스페이스 이름 '{1}'에는 '{0}' 문자를 사용할 수 없습니다. @@ -8197,11 +8157,6 @@ 컴파일러에서 실제 경로를 소스 경로 이름 출력에 매핑합니다. - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 잘못된 경로 맵입니다. 매핑은 쉼표로 구분되어야 하며 'path=sourcePath' 형식이어야 합니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index bc84c14ddc9..7fc1f4bbf36 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -492,11 +492,6 @@ Nieprawidłowa ścieżka zestawu odwołania“ - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Określ dołączone informacje o optymalizacji. Wartość domyślna to plik. Ważne dla bibliotek rozproszonych. @@ -3262,11 +3257,6 @@ Nieoczekiwany literał całkowity w wyrażeniu jednostki miary - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Niezgodna nazwa operatora cytatu, począwszy od „{0}” @@ -5212,16 +5202,6 @@ Plik informacji o linku do źródła do osadzenia w przenośnym pliku PDB - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Plik źródłowy jest za duży, aby osadzić go w przenośnym pliku PDB @@ -6277,21 +6257,6 @@ Elementy członkowskie rozszerzeń nie mogą udostępniać przeciążeń operatorów. Zamiast tego rozważ zdefiniowanie operatora jako części definicji typu. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Przypadek unii o nazwie „{0}” powoduje konflikt z wygenerowanym typem „{1}” @@ -6567,11 +6532,6 @@ Element {0} określił wersję „{1}”, ale wartość jest symbolem wieloznacznym. Żądano kompilacji deterministycznej. Te wartości powodują konflikt. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Znak „{0}” jest niedozwolony w podanej nazwie przestrzeni nazw „{1}” @@ -8197,11 +8157,6 @@ Mapuje ścieżki fizyczne na wyjściowe nazwy ścieżek źródłowych z kompilatora - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Nieprawidłowe mapowanie ścieżek. Mapowania muszą być rozdzielone przecinkami i mieć format „path=sourcePath” diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index e8b0bd1ca97..292cef9ae5d 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -492,11 +492,6 @@ Caminho de assembly de referência inválido' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Especifique as informações de otimização incluídas, o padrão é o file. Importante para bibliotecas distribuídas. @@ -3262,11 +3257,6 @@ Literal de inteiro inesperado na expressão de unidade de medida - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Nome de operador de cotação incompatível, começando com '{0}' @@ -5212,16 +5202,6 @@ O arquivo de informações do Source Link para inserir em um arquivo PDB portátil - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB O arquivo de origem é muito grande para ser inserido em um PDB portátil @@ -6277,21 +6257,6 @@ Membros de extensão não podem fornecer sobrecargas de operadores. Considere definir o operador como parte da definição de tipo. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' O caso união chamado '{0}' conflita com o tipo gerado '{1}' @@ -6567,11 +6532,6 @@ Uma versão especificada {0} '{1}', mas esse valor é um curinga, e você solicitou uma compilação determinística. Eles estão em conflito. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' O caractere '{0}' não é permitido no nome de namespace fornecido '{1}'. @@ -8197,11 +8157,6 @@ Mapeia caminhos físicos para nomes de caminho de origem gerados pelo compilador - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Mapa de caminho inválido. Os mapeamentos devem ser separados por vírgulas e do formato 'path=sourcePath' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index f3b160dc62c..995169db4e7 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -492,11 +492,6 @@ Неверный путь к базовой сборке' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Укажите включенные сведения об оптимизации, по умолчанию это файл. Необходимо для распределенных библиотек. @@ -3262,11 +3257,6 @@ Недопустимый целочисленный литерал в выражении единицы измерения - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' Несоответствующее имя оператора кавычки, начиная с "{0}" @@ -5212,16 +5202,6 @@ Файл со сведениями об исходной ссылке, внедряемой в переносимый PDB-файл - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Исходный файл слишком велик для внедрения в переносимый PDB-файл. @@ -6277,21 +6257,6 @@ Элементы расширения не могут предоставлять перегрузку операторов. Вместо этого рекомендуется определить оператор как часть определения типа. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' Ветвь объединения с именем "{0}" вступает в конфликт с созданным типом "{1}" @@ -6567,11 +6532,6 @@ Пользователь {0} указал версию "{1}", но это значение является подстановочным знаком, а вы запросили детерминированную сборку: возник конфликт. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' Не допускается использовать символ "{0}" в указанном имени пространства имен "{1}" @@ -8197,11 +8157,6 @@ Сопоставляет физические пути с исходными путями в выходных данных компилятора - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Недействительная карта путей. Сопоставления должны быть разделены запятыми и должны иметь формат "path=исходный_путь" diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 22b2bda409b..865ff430c4a 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -492,11 +492,6 @@ Geçersiz başvuru bütünleştirilmiş kodu yolu' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Dahil edilen iyileştirme bilgilerini belirtin; varsayılan değer dosyadır. Dağıtılmış kitaplıklar için önemlidir. @@ -3262,11 +3257,6 @@ Ölçü birimi ifadesinde beklenmeyen tamsayı sabit değeri - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' '{0}' ile başlayan, eşleşmeyen alıntı işleci adı @@ -5212,16 +5202,6 @@ Taşınabilir PDB dosyasına eklenecek kaynak bağlantısı bilgileri dosyası - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB Kaynak dosya, taşınabilir PDB dosyasına eklemek için çok büyük @@ -6277,21 +6257,6 @@ Uzantı üyeleri işleç aşırı yüklemeleri sağlayamaz. Bunun yerine işleci tür tanımının parçası olarak tanımlamayı düşünün. - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' {0}' adlı birleşim durumu oluşturulan '{1}' türüyle çakışıyor @@ -6567,11 +6532,6 @@ Bir {0} tarafından '{1}' sürümü belirtildi. Ancak siz belirleyici bir derleme istediniz, bu ise bir joker karakter ve bunlar çakışıyor. - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' {1}' sağlanan ad alanı adında '{0}' karakterine izin verilmez @@ -8197,11 +8157,6 @@ Fiziksel yolları derleyiciye göre kaynak yol adları çıkışıyla eşler - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' Geçersiz yol eşlemesi. Eşlemeler virgülle ayrılmış ve 'path=sourcePath' biçiminde olmalıdır diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 5194522c70f..66ca6254000 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -492,11 +492,6 @@ 引用程序集路径无效 - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. 指定包含的优化信息,默认值为文件。对于分发库非常重要。 @@ -3262,11 +3257,6 @@ 度量单位表达式中意外的整数文本 - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' 不匹配的引用运算符名称(以“{0}”开头) @@ -5212,16 +5202,6 @@ 要嵌入可移植 PDB 文件中的源链接信息文件 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB 源文件太大,无法嵌入可移植 PDB @@ -6277,21 +6257,6 @@ 扩展成员无法提供运算符重载。 请考虑改为将运算符定义为类型定义的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' 名为“{0}”的联合用例与生成的类型“{1}”冲突 @@ -6567,11 +6532,6 @@ {0} 指定了版本“{1}”,但该值为通配符,并且你已请求确定的版本,因此存在冲突。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 所提供的命名空间名称“{1}”中不允许出现字符“{0}” @@ -8197,11 +8157,6 @@ 将物理路径映射到编译器输出的源路径名 - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 路径映射无效。映射必须以逗号分隔,且采用 "path=sourcePath" 格式 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 0d93129d4be..aee1dd1ed12 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -492,11 +492,6 @@ 無效的參考組件路徑' - - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - Display the allowed values for language version, specify language version such as 'latest' or 'preview' - - Specify included optimization information, the default is file. Important for distributed libraries. Specify included optimization information, the default is file. Important for distributed libraries. @@ -3262,11 +3257,6 @@ 測量單位運算式中未預期的整數常值 - - Syntax error: unexpected type parameter specification - Syntax error: unexpected type parameter specification - - Mismatched quotation operator name, beginning with '{0}' 不相符的引號運算子名稱,以 '{0}' 開頭 @@ -5212,16 +5202,6 @@ 要內嵌於可攜式 PDB 檔案中的來源連結資訊檔案 - - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - - - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - - Source file is too large to embed in a portable PDB 來源檔案過大,無法內嵌於可攜式 PDB 中 @@ -6277,21 +6257,6 @@ 擴充成員無法提供運算子多載。請考慮將運算子改成定義為類型定義的一部分。 - - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - The name of the MDB file must be <assembly-file-name>.mdb. The --pdb option will be ignored. - - - - MDB generation failed. Could not find compatible member {0} - MDB generation failed. Could not find compatible member {0} - - - - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - - The union case named '{0}' conflicts with the generated type '{1}' 名為 '{0}' 的聯集與產生的類型 '{1}' 衝突 @@ -6567,11 +6532,6 @@ {0} 已指定版本 '{1}',但這個值為萬用字元,且您已要求確定性組建,所以發生衝突。 - - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - - Character '{0}' is not allowed in provided namespace name '{1}' 提供的命名空間名稱 '{1}' 中不允許使用字元 '{0}' @@ -8197,11 +8157,6 @@ 將實體路徑對應至來源路徑名稱,由編譯器輸出 - - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' 路徑對應無效。對應必須以逗號分隔,且格式應為 'path=sourcePath' From 62e85fffa992211da6a3a567af980fb187691475 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 11 Oct 2022 03:07:11 -0700 Subject: [PATCH 220/226] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2017073 --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 2 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 9dbc32b4b15..822297d4ff9 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Používá se ve vzájemně rekurzivních vazbách, v deklaracích vlastností a s několika omezeními u generických parametrů. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index fcfdbb8afb0..afb89b3f305 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Wird in gegenseitig rekursiven Bindungen, in Eigenschaftendeklarationen und bei mehreren Beschränkungen in Bezug auf generische Parameter verwendet. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index b11d915ab39..7bff656b19d 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Se usa en enlaces mutuamente recursivos, en declaraciones de propiedad y con varias restricciones en parámetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index cb36f32b1f0..9e4bb29ee0c 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Utilisé dans les liaisons mutuellement récursives, dans les déclarations de propriété et avec plusieurs contraintes sur des paramètres génériques. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 766e0e30348..6e56bbe7ee8 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usata in binding ricorsivi reciproci, dichiarazioni di proprietà e con più vincoli su parametri generici. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 433aa7af0f5..18b818fea07 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 相互に再帰的なバインディング、プロパティの宣言、およびジェネリック パラメーターの複数の制約に使用します。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 2e326e9ecf1..052d424f56f 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 상호 재귀적 바인딩과 속성 선언에 사용되며 제네릭 매개 변수의 여러 제약 조건과 함께 사용됩니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 7fc1f4bbf36..eb4a2819499 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Używane w powiązaniach wzajemnie cyklicznych, deklaracjach właściwości oraz z wieloma ograniczeniami parametrów ogólnych. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 292cef9ae5d..04e91c3089b 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Usado em associações mutualmente recursivas, em declarações de propriedade e em múltiplas restrições em parâmetros genéricos. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 995169db4e7..29bdaf2512e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Используется во взаимно рекурсивных привязках, объявлениях свойств и с несколькими ограничениями для универсальных параметров. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 865ff430c4a..4b1b2804206 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + Karşılıklı yinelemeli bağlamalarda, özellik bildirimlerinde ve genel parametreler üzerinde birden çok kısıtlamayla kullanılır. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 66ca6254000..653c27378ca 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用于互相递归绑定、属性声明,并用于对泛型参数的多个约束。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index aee1dd1ed12..781002375e3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -7539,7 +7539,7 @@ Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. + 用於互相遞迴的繫結、屬性宣告,以及搭配泛型參數的多個條件約束。 From 525d5109e389341bb90b144c24e2ad1ceec91e7b Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 12 Oct 2022 16:33:10 +0200 Subject: [PATCH 221/226] Bugfix: Ref assemblies contained .property definitions at the wrong type in generated IL (#14093) * Bugfix: Ref assemblies contained property definitions at the wrong type * Better comment --- src/Compiler/AbstractIL/ilwrite.fs | 9 +- .../EmittedIL/ReferenceAssemblyTests.fs | 127 ++++++++++++++++-- 2 files changed, 124 insertions(+), 12 deletions(-) diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 80bb791c25f..fb024b63f06 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -1192,7 +1192,7 @@ let canGenPropertyDef cenv (prop: ILPropertyDef) = // If we have GetMethod or SetMethod set (i.e. not None), try and see if we have MethodDefs for them. // NOTE: They can be not-None and missing MethodDefs if we skip generating them for reference assembly in the earlier pass. // Only generate property if we have at least getter or setter, otherwise, we skip. - [| prop.GetMethod; prop.SetMethod |] + [| prop.GetMethod; prop.SetMethod |] |> Array.choose id |> Array.map (TryGetMethodRefAsMethodDefIdx cenv) |> Array.exists (function | Ok _ -> true | _ -> false) @@ -1304,11 +1304,14 @@ and GenTypeDefPass2 pidx enc cenv (tdef: ILTypeDef) = // Now generate or assign index numbers for tables referenced by the maps. // Don't yet generate contents of these tables - leave that to pass3, as // code may need to embed these entries. - tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx) - props |> List.iter (GenPropertyDefPass2 cenv tidx) + tdef.Implements |> List.iter (GenImplementsPass2 cenv env tidx) events |> List.iter (GenEventDefPass2 cenv tidx) tdef.Fields.AsList() |> List.iter (GenFieldDefPass2 tdef cenv tidx) tdef.Methods |> Seq.iter (GenMethodDefPass2 tdef cenv tidx) + // Generation of property definitions for **ref assemblies** is checking existence of generated method definitions. + // Therefore, due to mutable state within "cenv", order of operations matters. + // Who could have thought that using shared mutable state can bring unexpected bugs...? + props |> List.iter (GenPropertyDefPass2 cenv tidx) tdef.NestedTypes.AsList() |> GenTypeDefsPass2 tidx (enc@[tdef.Name]) cenv with exn -> failwith ("Error in pass2 for type "+tdef.Name+", error: " + exn.Message) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 9020c5d85e3..8f9a21364e1 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -501,6 +501,115 @@ extends [runtime]System.Object }"""] + [] + let ``Properties are emitted for CliMutable records`` () = + FSharp """ +namespace ReferenceAssembly +type [] MyRecord = { MyId: int }""" + |> withOptions ["--refonly"] + |> compile + |> shouldSucceed + |> verifyIL [ + referenceAssemblyAttributeExpectedIL + " .property instance int32 MyId()"] + + [] + let ``Properties are emitted even for CliMutable records which are not last in a file`` () = + FSharp """ +namespace ReferenceAssembly +type [] MyRecord = { MyId: int } +type [] MySecondRecord = { MySecondId: string } +""" + |> withOptions ["--refonly"] + |> compile + |> shouldSucceed + |> verifyIL [ + referenceAssemblyAttributeExpectedIL + " .property instance int32 MyId()" + " .property instance string MySecondId()"] + + [] // Regression https://github.com/dotnet/fsharp/issues/14088 . + // Generated IL was assigning properties to the last record in file instead of where they are supposed to be + let ``Properties are emitted for equal records in the same file`` () = + FSharp """ +namespace Net7FSharpSnafu.Library + +open System + +type [] MyRecord = + { Name: string } + +type [] MySecondRecord = { Name: string } +""" + |> withOptions ["--refonly"] + |> compile + |> shouldSucceed + |> verifyIL [""" .class public auto ansi serializable sealed Net7FSharpSnafu.Library.MyRecord + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CLIMutableAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.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 ) + .method public hidebysig specialname instance string + get_Name() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname instance void + set_Name(string 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor(string name) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .property instance string Name() + { + .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 ) + .set instance void Net7FSharpSnafu.Library.MyRecord::set_Name(string) + .get instance string Net7FSharpSnafu.Library.MyRecord::get_Name() + } +} """] + [] let ``Properties, getters, setters are emitted for internal properties`` () = FSharp """ @@ -558,6 +667,11 @@ type MySecondaryAttribute() = IL_0001: throw } + .property instance int32 Prop1() + { + .set instance void ReferenceAssembly/MyAttribute::set_Prop1(int32) + .get instance int32 ReferenceAssembly/MyAttribute::get_Prop1() + } } .class auto ansi serializable nested public MySecondaryAttribute @@ -597,11 +711,6 @@ type MySecondaryAttribute() = IL_0001: throw } - .property instance int32 Prop1() - { - .set instance void ReferenceAssembly/MyAttribute::set_Prop1(int32) - .get instance int32 ReferenceAssembly/MyAttribute::get_Prop1() - } .property instance int32 Prop1() { .set instance void ReferenceAssembly/MySecondaryAttribute::set_Prop1(int32) @@ -805,6 +914,10 @@ type Person(name : string, age : int) = IL_0001: throw } + .property instance bool Something() + { + .get instance bool ReferenceAssembly/CustomAttribute::get_Something() + } } .class auto ansi serializable nested public Person @@ -865,10 +978,6 @@ type Person(name : string, age : int) = IL_0001: throw } - .property instance bool Something() - { - .get instance bool ReferenceAssembly/CustomAttribute::get_Something() - } .property instance string Name() { .custom instance void ReferenceAssembly/CustomAttribute::.ctor(bool) = ( 01 00 01 00 00 ) From e142005b5b992da4c04f56bdb287d685da55989c Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 13 Oct 2022 01:52:49 -0700 Subject: [PATCH 222/226] Update versions for dev17.4 (#14102) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 544cc475da3..b021498b6bb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 12 - 0 - 5 + 4 + 0 $(FSRevisionVersion) $(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion) $(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion) From 04c3620c2cac2f4ce3d41638c134671670c9325c Mon Sep 17 00:00:00 2001 From: Matt Galbraith Date: Thu, 27 Oct 2022 04:54:02 -0700 Subject: [PATCH 223/226] Update Arcade & Put automated pool provider usage functionality into Dev17.4 branch (similar to PR in main now but will not be backported here) (#14177) --- azure-pipelines.yml | 20 ++++---- eng/Version.Details.xml | 8 +-- eng/Versions.props | 2 - eng/common/cross/arm/tizen-fetch.sh | 6 +-- eng/common/cross/arm64/tizen-fetch.sh | 8 +-- eng/common/cross/armel/tizen-fetch.sh | 8 +-- eng/common/cross/armel/tizen/tizen-dotnet.ks | 50 ------------------- eng/common/cross/build-android-rootfs.sh | 4 +- eng/common/cross/build-rootfs.sh | 7 +-- eng/common/cross/x86/tizen-fetch.sh | 6 +-- eng/common/init-tools-native.ps1 | 1 + eng/common/templates/job/execute-sdl.yml | 5 +- eng/common/templates/job/job.yml | 4 ++ eng/common/templates/job/onelocbuild.yml | 29 +++++------ .../templates/job/publish-build-assets.yml | 13 ++++- eng/common/templates/job/source-build.yml | 15 +++++- .../templates/job/source-index-stage1.yml | 5 +- eng/common/templates/jobs/jobs.yml | 9 ---- eng/common/templates/jobs/source-build.yml | 2 +- .../templates/post-build/post-build.yml | 14 +++--- eng/common/templates/steps/generate-sbom.yml | 4 ++ eng/common/templates/steps/source-build.yml | 6 +++ .../templates/variables/pool-providers.yml | 48 ++++++++++++++++++ eng/common/tools.sh | 22 +++++--- global.json | 4 +- 25 files changed, 170 insertions(+), 130 deletions(-) delete mode 100644 eng/common/cross/armel/tizen/tizen-dotnet.ks create mode 100644 eng/common/templates/variables/pool-providers.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2b2fcca507c..1f53eb633ed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,6 +68,8 @@ variables: - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - name: RunningAsPullRequest value: true + # Pick up pool provider name behavior from shared yaml template + - template: /eng/common/templates/variables/pool-providers.yml # Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI. # Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129 @@ -104,7 +106,7 @@ stages: jobs: - job: Full_Signed pool: - name: NetCore1ESPool-Svc-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2022.amd64 timeoutInMinutes: 300 variables: @@ -210,7 +212,7 @@ stages: - name: _SignType value: Test pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 90 steps: @@ -283,7 +285,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: @@ -341,7 +343,7 @@ stages: # WindowsMachineQueueName=Windows.vs2022.amd64.open # and there is an alternate build definition that sets this to a queue that is always scouting the # next preview of Visual Studio. - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: @@ -395,7 +397,7 @@ stages: # Mock official build - job: MockOfficial pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -486,7 +488,7 @@ stages: # End to end build - job: EndToEndBuildTests pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) steps: - checkout: self @@ -515,7 +517,7 @@ stages: - name: _SignType value: Test pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 90 steps: @@ -541,7 +543,7 @@ stages: # Plain build Windows - job: Plain_Build_Windows pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) variables: - name: _BuildConfig @@ -638,7 +640,7 @@ stages: # Test trimming on Windows - job: Build_And_Test_Trimming_Windows pool: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) strategy: maxParallel: 2 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 80e7ef74b8e..4dbba158d78 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -8,14 +8,14 @@ - + https://github.com/dotnet/arcade - ba4d2568dd2e3e7538feeaba60215f7bcb99e89c + c5dd6a1da2e6d9b3423ab809fcda8af2927a408b - + https://github.com/dotnet/arcade - ba4d2568dd2e3e7538feeaba60215f7bcb99e89c + c5dd6a1da2e6d9b3423ab809fcda8af2927a408b diff --git a/eng/Versions.props b/eng/Versions.props index 4c5fb4a0a85..bcaecdd34a7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -56,9 +56,7 @@ 17 - 4 - $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 diff --git a/eng/common/cross/arm/tizen-fetch.sh b/eng/common/cross/arm/tizen-fetch.sh index eabd06c4afe..0adb0f11ec3 100644 --- a/eng/common/cross/arm/tizen-fetch.sh +++ b/eng/common/cross/arm/tizen-fetch.sh @@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then mkdir -p $TMPDIR fi -TIZEN_URL=http://download.tizen.org/snapshots/tizen +TIZEN_URL=http://download.tizen.org/snapshots/TIZEN/Tizen BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml @@ -155,7 +155,7 @@ fetch_tizen_pkgs() } Inform "Initialize arm base" -fetch_tizen_pkgs_init standard base +fetch_tizen_pkgs_init standard Tizen-Base Inform "fetch common packages" fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" @@ -164,7 +164,7 @@ Inform "fetch corefx packages" fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" -fetch_tizen_pkgs_init standard unified +fetch_tizen_pkgs_init standard Tizen-Unified Inform "fetch corefx packages" fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release diff --git a/eng/common/cross/arm64/tizen-fetch.sh b/eng/common/cross/arm64/tizen-fetch.sh index 16d1301f21e..785bd85484e 100644 --- a/eng/common/cross/arm64/tizen-fetch.sh +++ b/eng/common/cross/arm64/tizen-fetch.sh @@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then mkdir -p $TMPDIR fi -TIZEN_URL=http://download.tizen.org/snapshots/tizen/ +TIZEN_URL=http://download.tizen.org/snapshots/TIZEN/Tizen BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml @@ -154,8 +154,8 @@ fetch_tizen_pkgs() done } -Inform "Initialize arm base" -fetch_tizen_pkgs_init standard base +Inform "Initialize arm64 base" +fetch_tizen_pkgs_init standard Tizen-Base Inform "fetch common packages" fetch_tizen_pkgs aarch64 gcc glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" @@ -164,7 +164,7 @@ Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" -fetch_tizen_pkgs_init standard unified +fetch_tizen_pkgs_init standard Tizen-Unified Inform "fetch corefx packages" fetch_tizen_pkgs aarch64 gssdp gssdp-devel tizen-release diff --git a/eng/common/cross/armel/tizen-fetch.sh b/eng/common/cross/armel/tizen-fetch.sh index 64f0187e5aa..3d8f177a344 100755 --- a/eng/common/cross/armel/tizen-fetch.sh +++ b/eng/common/cross/armel/tizen-fetch.sh @@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then mkdir -p $TMPDIR fi -TIZEN_URL=http://download.tizen.org/snapshots/tizen +TIZEN_URL=http://download.tizen.org/snapshots/TIZEN/Tizen BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml @@ -154,8 +154,8 @@ fetch_tizen_pkgs() done } -Inform "Initialize arm base" -fetch_tizen_pkgs_init standard base +Inform "Initialize armel base" +fetch_tizen_pkgs_init standard Tizen-Base Inform "fetch common packages" fetch_tizen_pkgs armv7l gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" @@ -164,7 +164,7 @@ Inform "fetch corefx packages" fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" -fetch_tizen_pkgs_init standard unified +fetch_tizen_pkgs_init standard Tizen-Unified Inform "fetch corefx packages" fetch_tizen_pkgs armv7l gssdp gssdp-devel tizen-release diff --git a/eng/common/cross/armel/tizen/tizen-dotnet.ks b/eng/common/cross/armel/tizen/tizen-dotnet.ks deleted file mode 100644 index 506d455bd4f..00000000000 --- a/eng/common/cross/armel/tizen/tizen-dotnet.ks +++ /dev/null @@ -1,50 +0,0 @@ -lang en_US.UTF-8 -keyboard us -timezone --utc Asia/Seoul - -part / --fstype="ext4" --size=3500 --ondisk=mmcblk0 --label rootfs --fsoptions=defaults,noatime - -rootpw tizen -desktop --autologinuser=root -user --name root --groups audio,video --password 'tizen' - -repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no -repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no - -%packages -tar -gzip - -sed -grep -gawk -perl - -binutils -findutils -util-linux -lttng-ust -userspace-rcu -procps-ng -tzdata -ca-certificates - - -### Core FX -libicu -libunwind -iputils -zlib -krb5 -libcurl -libopenssl - -%end - -%post - -### Update /tmp privilege -chmod 777 /tmp -#################################### - -%end diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh index 42516bbeebc..f163fb9dae9 100755 --- a/eng/common/cross/build-android-rootfs.sh +++ b/eng/common/cross/build-android-rootfs.sh @@ -107,12 +107,12 @@ __AndroidPackages+=" liblzma" __AndroidPackages+=" krb5" __AndroidPackages+=" openssl" -for path in $(wget -qO- http://termux.net/dists/stable/main/binary-$__AndroidArch/Packages |\ +for path in $(wget -qO- https://packages.termux.dev/termux-main-21/dists/stable/main/binary-$__AndroidArch/Packages |\ grep -A15 "Package: \(${__AndroidPackages// /\\|}\)" | grep -v "static\|tool" | grep Filename); do if [[ "$path" != "Filename:" ]]; then echo "Working on: $path" - wget -qO- http://termux.net/$path | dpkg -x - "$__TmpDir" + wget -qO- https://packages.termux.dev/termux-main-21/$path | dpkg -x - "$__TmpDir" fi done diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 5680980fa29..eddb4c380af 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -391,9 +391,9 @@ elif [[ "$__CodeName" == "illumos" ]]; then --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. - BaseUrl=https://pkgsrc.joyent.com + BaseUrl=https://pkgsrc.smartos.org if [[ "$__UseMirror" == 1 ]]; then - BaseUrl=http://pkgsrc.smartos.skylime.net + BaseUrl=https://pkgsrc.smartos.skylime.net fi BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All" echo "Downloading manifest" @@ -402,7 +402,8 @@ elif [[ "$__CodeName" == "illumos" ]]; then read -ra array <<<"$__IllumosPackages" for package in "${array[@]}"; do echo "Installing '$package'" - package="$(grep ">$package-[0-9]" All | sed -En 's/.*href="(.*)\.tgz".*/\1/p')" + # find last occurrence of package in listing and extract its name + package="$(sed -En '/.*href="('"$package"'-[0-9].*).tgz".*/h;$!d;g;s//\1/p' All)" echo "Resolved name '$package'" wget "$BaseUrl"/"$package".tgz ar -x "$package".tgz diff --git a/eng/common/cross/x86/tizen-fetch.sh b/eng/common/cross/x86/tizen-fetch.sh index fa5f88b7d6c..cf8d1ce4a8e 100644 --- a/eng/common/cross/x86/tizen-fetch.sh +++ b/eng/common/cross/x86/tizen-fetch.sh @@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then mkdir -p $TMPDIR fi -TIZEN_URL=http://download.tizen.org/snapshots/tizen +TIZEN_URL=http://download.tizen.org/snapshots/TIZEN/Tizen BUILD_XML=build.xml REPOMD_XML=repomd.xml PRIMARY_XML=primary.xml @@ -155,7 +155,7 @@ fetch_tizen_pkgs() } Inform "Initialize i686 base" -fetch_tizen_pkgs_init standard base +fetch_tizen_pkgs_init standard Tizen-Base Inform "fetch common packages" fetch_tizen_pkgs i686 gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils Inform "fetch coreclr packages" @@ -164,7 +164,7 @@ Inform "fetch corefx packages" fetch_tizen_pkgs i686 libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" -fetch_tizen_pkgs_init standard unified +fetch_tizen_pkgs_init standard Tizen-Unified Inform "fetch corefx packages" fetch_tizen_pkgs i686 gssdp gssdp-devel tizen-release diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index ac42f04a9d8..fbc67effc36 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -113,6 +113,7 @@ try { $ToolPath = Convert-Path -Path $BinPath Write-Host "Adding $ToolName to the path ($ToolPath)..." Write-Host "##vso[task.prependpath]$ToolPath" + $env:PATH = "$ToolPath;$env:PATH" $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } } } diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index 781a41c9404..7aabaa18017 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -34,7 +34,7 @@ jobs: - job: Run_SDL dependsOn: ${{ parameters.dependsOn }} displayName: Run SDL tool - condition: eq( ${{ parameters.enable }}, 'true') + condition: and(succeededOrFailed(), eq( ${{ parameters.enable }}, 'true')) variables: - group: DotNet-VSTS-Bot - name: AzDOProjectName @@ -46,6 +46,7 @@ jobs: - template: /eng/common/templates/variables/sdl-variables.yml - name: GuardianVersion value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} + - template: /eng/common/templates/variables/pool-providers.yml pool: # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: @@ -53,7 +54,7 @@ jobs: demands: Cmd # If it's not devdiv, it's dnceng ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: - checkout: self diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 459f3c4fcbb..9f55d3f4666 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -25,6 +25,7 @@ parameters: enablePublishTestResults: false enablePublishUsingPipelines: false disableComponentGovernance: false + componentGovernanceIgnoreDirectories: '' mergeTestResults: false testRunTitle: '' testResultsFormat: '' @@ -146,6 +147,8 @@ jobs: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }}: - task: ComponentGovernanceComponentDetection@0 continueOnError: true + inputs: + ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -223,4 +226,5 @@ jobs: parameters: PackageVersion: ${{ parameters.packageVersion}} BuildDropPath: ${{ parameters.buildDropPath }} + IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} diff --git a/eng/common/templates/job/onelocbuild.yml b/eng/common/templates/job/onelocbuild.yml index 6c523b714f4..c2cabcf9e06 100644 --- a/eng/common/templates/job/onelocbuild.yml +++ b/eng/common/templates/job/onelocbuild.yml @@ -22,13 +22,25 @@ parameters: MirrorRepo: '' MirrorBranch: main condition: '' + JobNameSuffix: '' jobs: -- job: OneLocBuild +- job: OneLocBuild${{ parameters.JobNameSuffix }} dependsOn: ${{ parameters.dependsOn }} - displayName: OneLocBuild + displayName: OneLocBuild${{ parameters.JobNameSuffix }} + + variables: + - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat + - name: _GenerateLocProjectArguments + value: -SourcesDirectory ${{ parameters.SourcesDirectory }} + -LanguageSet "${{ parameters.LanguageSet }}" + -CreateNeutralXlfs + - ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}: + - name: _GenerateLocProjectArguments + value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson + - template: /eng/common/templates/variables/pool-providers.yml ${{ if ne(parameters.pool, '') }}: pool: ${{ parameters.pool }} @@ -40,20 +52,9 @@ jobs: demands: Cmd # If it's not devdiv, it's dnceng ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 - variables: - - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat - - name: _GenerateLocProjectArguments - value: -SourcesDirectory ${{ parameters.SourcesDirectory }} - -LanguageSet "${{ parameters.LanguageSet }}" - -CreateNeutralXlfs - - ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}: - - name: _GenerateLocProjectArguments - value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson - - steps: - task: Powershell@2 inputs: diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 1cbb6a0c560..1f1b78f2d45 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -40,9 +40,8 @@ jobs: ${{ else }}: displayName: Publish to Build Asset Registry - pool: ${{ parameters.pool }} - variables: + - template: /eng/common/templates/variables/pool-providers.yml - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats @@ -51,6 +50,16 @@ jobs: - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - template: /eng/common/templates/post-build/common-variables.yml + pool: + # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + name: VSEngSS-MicroBuild2022-1ES + demands: Cmd + # If it's not devdiv, it's dnceng + ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + name: $(DncEngInternalBuildPool) + demands: ImageOverride -equals windows.vs2019.amd64 + steps: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: DownloadBuildArtifacts@0 diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 88f6f75a622..e40bf35203b 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -44,13 +44,24 @@ jobs: ${{ if eq(parameters.platform.pool, '') }}: # The default VM host AzDO pool. This should be capable of running Docker containers: almost all # source-build builds run in Docker, including the default managed platform. + # /eng/common/templates/variables/pool-providers.yml can't be used here (some customers declare variables already), so duplicate its logic pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: + # Main environments + ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}: name: NetCore-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), true)) }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + + # Servicing build environments + ${{ if and(eq(variables['System.TeamProject'], 'public'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}: + name: NetCore-Svc-Public + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + ${{ if and(eq(variables['System.TeamProject'], 'internal'), contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release')) }}: + name: NetCore1ESPool-Svc-Internal + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 + ${{ if ne(parameters.platform.pool, '') }}: pool: ${{ parameters.platform.pool }} diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index 21fd12276b6..09c506d1185 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -22,16 +22,17 @@ jobs: value: ${{ parameters.binlogPath }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - group: source-dot-net stage1 variables + - template: /eng/common/templates/variables/pool-providers.yml ${{ if ne(parameters.pool, '') }}: pool: ${{ parameters.pool }} ${{ if eq(parameters.pool, '') }}: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore-Public + name: $(DncEngPublicBuildPool) demands: ImageOverride -equals windows.vs2019.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 64e5929f221..289bb2396ce 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -88,15 +88,6 @@ jobs: - ${{ job.job }} - ${{ if eq(parameters.enableSourceBuild, true) }}: - Source_Build_Complete - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Internal - demands: ImageOverride -equals windows.vs2019.amd64 runAsPublic: ${{ parameters.runAsPublic }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} diff --git a/eng/common/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml index 8dd2d355f22..a15b07eb51d 100644 --- a/eng/common/templates/jobs/source-build.yml +++ b/eng/common/templates/jobs/source-build.yml @@ -14,7 +14,7 @@ parameters: # This is the default platform provided by Arcade, intended for use by a managed-only repo. defaultManagedPlatform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20220809204800-17a4aab' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8' # Defines the platforms on which to run build jobs. One job is created for each platform, and the # object in this array is sent to the job template as 'platform'. If no platforms are specified, diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 87fcae940cf..91251d08973 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -95,10 +95,11 @@ stages: displayName: Validate Build Assets variables: - template: common-variables.yml + - template: /eng/common/templates/variables/pool-providers.yml jobs: - job: displayName: NuGet Validation - condition: eq( ${{ parameters.enableNugetValidation }}, 'true') + condition: and(succeededOrFailed(), eq( ${{ parameters.enableNugetValidation }}, 'true')) pool: # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: @@ -106,7 +107,7 @@ stages: demands: Cmd # If it's not devdiv, it's dnceng ${{ else }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: @@ -143,7 +144,7 @@ stages: demands: Cmd # If it's not devdiv, it's dnceng ${{ else }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml @@ -203,7 +204,7 @@ stages: demands: Cmd # If it's not devdiv, it's dnceng ${{ else }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml @@ -251,6 +252,7 @@ stages: displayName: Publish using Darc variables: - template: common-variables.yml + - template: /eng/common/templates/variables/pool-providers.yml jobs: - job: displayName: Publish Using Darc @@ -262,7 +264,7 @@ stages: demands: Cmd # If it's not devdiv, it's dnceng ${{ else }}: - name: NetCore1ESPool-Internal + name: $(DncEngInternalBuildPool) demands: ImageOverride -equals windows.vs2019.amd64 steps: - template: setup-maestro-vars.yml @@ -282,4 +284,4 @@ stages: -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' \ No newline at end of file + -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/steps/generate-sbom.yml b/eng/common/templates/steps/generate-sbom.yml index 4cea8c33187..a06373f38fa 100644 --- a/eng/common/templates/steps/generate-sbom.yml +++ b/eng/common/templates/steps/generate-sbom.yml @@ -2,12 +2,14 @@ # PackageName - The name of the package this SBOM represents. # PackageVersion - The version of the package this SBOM represents. # ManifestDirPath - The path of the directory where the generated manifest files will be placed +# IgnoreDirectories - Directories to ignore for SBOM generation. This will be passed through to the CG component detector. parameters: PackageVersion: 7.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' PackageName: '.NET' ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom + IgnoreDirectories: '' sbomContinueOnError: true steps: @@ -34,6 +36,8 @@ steps: BuildDropPath: ${{ parameters.buildDropPath }} PackageVersion: ${{ parameters.packageVersion }} ManifestDirPath: ${{ parameters.manifestDirPath }} + ${{ if ne(parameters.IgnoreDirectories, '') }}: + AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}' - task: PublishPipelineArtifact@1 displayName: Publish SBOM manifest diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml index 4ec5577d28a..a97a185a367 100644 --- a/eng/common/templates/steps/source-build.yml +++ b/eng/common/templates/steps/source-build.yml @@ -63,6 +63,11 @@ steps: targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi + runtimeOsArgs= + if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then + runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' + fi + publishArgs= if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then publishArgs='--publish' @@ -80,6 +85,7 @@ steps: $internalRuntimeDownloadArgs \ $internalRestoreArgs \ $targetRidArgs \ + $runtimeOsArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ /p:ArcadeBuildFromSource=true \ /p:AssetManifestFileName=$assetManifestFileName diff --git a/eng/common/templates/variables/pool-providers.yml b/eng/common/templates/variables/pool-providers.yml new file mode 100644 index 00000000000..a7b943c2fa4 --- /dev/null +++ b/eng/common/templates/variables/pool-providers.yml @@ -0,0 +1,48 @@ +# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, +# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. + +# Motivation: +# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS +# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing +# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. +# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services +# team needs to move resources around and create new and potentially differently-named pools. Using this template +# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. + +# How to use: +# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). +# If we find alternate naming conventions in broad usage it can be added to the condition below. +# +# First, import the template in an arcade-ified repo to pick up the variables, e.g.: +# +# variables: +# - template: eng/common/templates/variables/pool-providers.yml +# +# ... then anywhere specifying the pool provider use the runtime variables, +# $(DncEngInternalBuildPool) and $ (DncEngPublicBuildPool), e.g.: +# +# pool: +# name: $(DncEngInternalBuildPool) +# demands: ImageOverride -equals windows.vs2019.amd64 + +variables: +# Coalesce the target and source branches so we know when a PR targets a release branch +# If these variables are somehow missing, fall back to main (tends to have more capacity) +- name: BranchNameForPoolSelection + value: ${{ coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main') }} + +# Any new -Svc alternative pools should have variables added here to allow for splitting work + +# Main branch pools +- ${{ if ne(contains(variables['BranchNameForPoolSelection'], 'release'), true) }}: + - name: DncEngPublicBuildPool + value: NetCore-Public + - name: DncEngInternalBuildPool + value: NetCore1ESPool-Internal + +# Release branch pools +- ${{ if contains(variables['BranchNameForPoolSelection'], 'release') }}: + - name: DncEngPublicBuildPool + value: NetCore-Svc-Public + - name: DncEngInternalBuildPool + value: NetCore1ESPool-Svc-Internal \ No newline at end of file diff --git a/eng/common/tools.sh b/eng/common/tools.sh index c110d0ed410..6586eab458e 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -417,12 +417,11 @@ function MSBuild { Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20" Write-PipelineSetVariable -name "NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS" -value "20" - export NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY=true - export NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT=6 - export NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS=1000 - Write-PipelineSetVariable -name "NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY" -value "true" - Write-PipelineSetVariable -name "NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT" -value "6" - Write-PipelineSetVariable -name "NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS" -value "1000" + # https://github.com/dotnet/arcade/issues/11369 - disable new MSBuild server feature on linux + # This feature is new and can result in build failures from connection timeout errors. + export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 + Write-PipelineSetVariable -name "DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER" -value "1" + fi local toolset_dir="${_InitializeToolset%/*}" @@ -493,6 +492,17 @@ function MSBuild-Core { RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" } +function GetDarc { + darc_path="$temp_dir/darc" + version="$1" + + if [[ -n "$version" ]]; then + version="--darcversion $version" + fi + + "$eng_root/common/darc-init.sh" --toolpath "$darc_path" $version +} + ResolvePath "${BASH_SOURCE[0]}" _script_dir=`dirname "$_ResolvePath"` diff --git a/global.json b/global.json index ed1a0361528..7ce330c1f47 100644 --- a/global.json +++ b/global.json @@ -18,7 +18,7 @@ "perl": "5.32.1.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22473.1", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22473.1" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22524.5", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.22524.5" } } From 27c5d892b67da443eb5d24b94718f251f0a1001b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 12:56:55 +0200 Subject: [PATCH 224/226] [release/dev17.4] fix metadata failure due to double integration of signature (#14190) * fix metadata failure due to double duplication * fix metadata failure due to double duplication Co-authored-by: Don Syme --- src/Compiler/Driver/ParseAndCheckInputs.fs | 36 +++------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 703e3483f10..7470ee396c0 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -1165,26 +1165,6 @@ let AddCheckResultsToTcState ccuSigForFile, tcState -let AddDummyCheckResultsToTcState - ( - tcGlobals, - amap, - qualName: QualifiedNameOfFile, - prefixPathOpt, - tcSink, - tcState: TcState, - tcStateForImplFile: TcState, - rootSig - ) = - let hadSig = true - let emptyImplFile = CreateEmptyDummyImplFile qualName rootSig - let tcEnvAtEnd = tcStateForImplFile.TcEnvFromImpls - - let ccuSigForFile, tcState = - AddCheckResultsToTcState (tcGlobals, amap, hadSig, prefixPathOpt, tcSink, tcState.tcsTcImplEnv, qualName, rootSig) tcState - - (tcEnvAtEnd, EmptyTopAttrs, Some emptyImplFile, ccuSigForFile), tcState - /// Typecheck a single file (or interactive entry into F# Interactive) let CheckOneInputAux ( @@ -1353,18 +1333,10 @@ let CheckOneInput match partialResult with | Choice1Of2 result -> return result, tcState - | Choice2Of2 (amap, _conditionalDefines, rootSig, _priorErrors, file, tcStateForImplFile, _ccuSigForFile) -> - return - AddDummyCheckResultsToTcState( - tcGlobals, - amap, - file.QualifiedName, - prefixPathOpt, - tcSink, - tcState, - tcStateForImplFile, - rootSig - ) + | Choice2Of2 (_amap, _conditionalDefines, rootSig, _priorErrors, file, tcStateForImplFile, ccuSigForFile) -> + let emptyImplFile = CreateEmptyDummyImplFile file.QualifiedName rootSig + let tcEnvAtEnd = tcStateForImplFile.TcEnvFromImpls + return (tcEnvAtEnd, EmptyTopAttrs, Some emptyImplFile, ccuSigForFile), tcState } // Within a file, equip loggers to locally filter w.r.t. scope pragmas in each input From a2c40cc9f76aba2d35ddb39d6aa44090f9e67200 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 19:10:50 +0000 Subject: [PATCH 225/226] [release/dev17.4] Don't emit IsReadOnlyAttribute if not available. (#14281) Co-authored-by: nojaf --- src/Compiler/CodeGen/IlxGen.fs | 17 ++++++++++++++--- src/Compiler/TypedTree/TcGlobals.fs | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 829b7e03d20..05a2f0ac1be 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -611,7 +611,10 @@ let GenReadOnlyAttribute (g: TcGlobals) = mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = - let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref + let add = + g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable + && isInByrefTy g ty + && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref if add then let attr = GenReadOnlyAttribute g @@ -2120,7 +2123,11 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu let ilMethods = [ for propName, fldName, fldTy in flds -> - let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] + let attrs = + if g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable && isStruct then + [ GenReadOnlyAttribute g ] + else + [] mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) |> g.AddMethodGeneratedAttributes @@ -10894,7 +10901,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let isStruct = isStructTyconRef tcref let attrs = - if isStruct && not isStatic then + if + g.isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable + && isStruct + && not isStatic + then [ GenReadOnlyAttribute g ] else [] diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 9ab7cf2f723..1e79c9d3ee6 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1718,6 +1718,9 @@ type TcGlobals( /// Indicates if we can use System.Array.Empty when emitting IL for empty array literals member val isArrayEmptyAvailable = v_Array_tcref.ILTyconRawMetadata.Methods.FindByName "Empty" |> List.isEmpty |> not + /// Indicates if we can emit the System.Runtime.CompilerServices.IsReadOnlyAttribute + member val isSystem_Runtime_CompilerServices_IsReadOnlyAttributeAvailable = tryFindSysTypeCcu sysCompilerServices "IsReadOnlyAttribute" |> Option.isSome + member _.FindSysTyconRef path nm = findSysTyconRef path nm member _.TryFindSysTyconRef path nm = tryFindSysTyconRef path nm From 51b87692496d1571d2aa56d4b5c836bfe06e60a1 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Sun, 13 Nov 2022 19:09:59 +0100 Subject: [PATCH 226/226] Fixed package versions to publicly available (#14291) * Fixed package versions to publicly available * Update Versions.props Microsoft.Build.* to 17.4.0 Co-authored-by: Kevin Ransom (msft) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index bcaecdd34a7..7fae2c68948 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -33,7 +33,7 @@ 42 7 - 100 + 101 $(FSRevisionVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion) @@ -100,7 +100,7 @@ 17.4.0-preview-3-32916-145 17.4.342-pre 17.4.23-alpha - 17.4.0-preview-22469-04 + 17.4.0 $(RoslynVersion) $(RoslynVersion)