From 86b543c19d048d90bd2a5a9979ce5ff7c53c88c9 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 12:59:11 -0400 Subject: [PATCH 1/8] =?UTF-8?q?Don't=20rebind=20`=5F`=20in=20`[|for=20=5F?= =?UTF-8?q?=20in=20=E2=80=A6=20->=20=E2=80=A6|]`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Optimize/LowerComputedCollections.fs | 8 +- .../ForXInArray_ToArray.fs | 6 + .../ForXInArray_ToArray.fs.il.bsl | 223 +++++++++++++++++- 3 files changed, 225 insertions(+), 12 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 98b01086cc6..01e4a7f4452 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -373,7 +373,7 @@ module Array = else any ilTy /// Makes the equivalent of an inlined call to Array.map. - let mkMap g m (mBody, _spFor, _spIn, mFor, mIn, spInWhile) srcArray srcIlTy destIlTy overallElemTy loopVal body = + let mkMap g m (mBody, _spFor, _spIn, mFor, mIn, spInWhile) srcArray srcIlTy destIlTy overallElemTy (loopVal: Val) body = let len = mkLdlen g mIn srcArray let arrayTy = mkArrayType g overallElemTy @@ -396,7 +396,11 @@ module Array = mkCompGenLetMutableIn mFor "i" g.int32_ty (mkTypedZero g mIn g.int32_ty) (fun (iVal, i) -> let body = // Rebind the loop val to pull directly from the source array. - let body = mkInvisibleLet mBody loopVal (mkAsmExpr ([ldelem], [], [srcArray; i], [loopVal.val_type], mBody)) body + let body = + // If the loop val is marked as compiler-generated here, + // it is the wildcard _ and is unused in the loop body. + if loopVal.IsCompilerGenerated then body + else mkInvisibleLet mBody loopVal (mkAsmExpr ([ldelem], [], [srcArray; i], [loopVal.val_type], mBody)) body // destArray[i] <- body srcArray[i] let setArrSubI = mkAsmExpr ([stelem], [], [array; i; body], [], mIn) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs index 6b074654e45..39d4fc5cca6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs @@ -21,3 +21,9 @@ let f8 f g (array: int array) = [|let y = f () in let z = g () in for x in array let f9 f g (array: int array) = [|let y = f () in g (); for x in array -> x + y|] let f10 f g (array: int array) = [|f (); g (); for x in array -> x|] let f11 f g (array: int array) = [|f (); let y = g () in for x in array -> x + y|] + +// https://github.com/dotnet/fsharp/issues/17708 +// Don't read or rebind the loop variable when it is not in scope in the body. +let ``for _ in Array.groupBy id [||] do …`` () = [| for _ in Array.groupBy id [||] do 0 |] +let ``for _ | _ in Array.groupBy id [||] do …`` () = [| for _ | _ in Array.groupBy id [||] do 0 |] +let ``for _ & _ in Array.groupBy id [||] do …`` () = [| for _ & _ in Array.groupBy id [||] do 0 |] \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl index 4839243ebdb..10973c87d2c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -43,6 +33,108 @@ 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 auto ansi serializable sealed nested assembly beforefieldinit 'for _ in Array-groupBy id -||- do …@27' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ in Array-groupBy id -||- do …@27' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ in Array-groupBy id -||- do …@27'::.ctor() + IL_0005: stsfld class assembly/'for _ in Array-groupBy id -||- do …@27' assembly/'for _ in Array-groupBy id -||- do …@27'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in Array-groupBy id -||- do …@28' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ | _ in Array-groupBy id -||- do …@28' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ | _ in Array-groupBy id -||- do …@28'::.ctor() + IL_0005: stsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@28' assembly/'for _ | _ in Array-groupBy id -||- do …@28'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in Array-groupBy id -||- do …@29' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ - _ in Array-groupBy id -||- do …@29' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ - _ in Array-groupBy id -||- do …@29'::.ctor() + IL_0005: stsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@29' assembly/'for _ - _ in Array-groupBy id -||- do …@29'::@_instance + IL_000a: ret + } + + } + .method public static int32[] f0(int32[] 'array') cil managed { @@ -1112,6 +1204,117 @@ IL_0034: ret } + .method public static int32[] 'for _ in Array.groupBy id [||] do …'() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ in Array-groupBy id -||- do …@27' assembly/'for _ in Array-groupBy id -||- do …@27'::@_instance + IL_0006: call !!0[] [runtime]System.Array::Empty() + IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + !!0[]) + IL_0010: ldlen + IL_0011: conv.i4 + IL_0012: newarr [runtime]System.Int32 + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: stloc.1 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.0 + IL_001d: ldloc.1 + IL_001e: ldc.i4.0 + IL_001f: stelem.i4 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_001c + + IL_002a: ldloc.0 + IL_002b: ret + } + + .method public static int32[] 'for _ | _ in Array.groupBy id [||] do …'() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@28' assembly/'for _ | _ in Array-groupBy id -||- do …@28'::@_instance + IL_0006: call !!0[] [runtime]System.Array::Empty() + IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + !!0[]) + IL_0010: ldlen + IL_0011: conv.i4 + IL_0012: newarr [runtime]System.Int32 + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: stloc.1 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.0 + IL_001d: ldloc.1 + IL_001e: ldc.i4.0 + IL_001f: stelem.i4 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_001c + + IL_002a: ldloc.0 + IL_002b: ret + } + + .method public static int32[] 'for _ & _ in Array.groupBy id [||] do …'() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@29' assembly/'for _ - _ in Array-groupBy id -||- do …@29'::@_instance + IL_0006: call !!0[] [runtime]System.Array::Empty() + IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + !!0[]) + IL_0010: ldlen + IL_0011: conv.i4 + IL_0012: newarr [runtime]System.Int32 + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: stloc.1 + IL_001a: br.s IL_0024 + + IL_001c: ldloc.0 + IL_001d: ldloc.1 + IL_001e: ldc.i4.0 + IL_001f: stelem.i4 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: ldlen + IL_0027: conv.i4 + IL_0028: blt.s IL_001c + + IL_002a: ldloc.0 + IL_002b: ret + } + } .class private abstract auto ansi sealed ''.$assembly From 836e5f84b8c51ef96218e03f642ad0d460882499 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 13:09:57 -0400 Subject: [PATCH 2/8] \n --- .../EmittedIL/ComputedCollections/ForXInArray_ToArray.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs index 39d4fc5cca6..e32fed928d6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs @@ -26,4 +26,4 @@ let f11 f g (array: int array) = [|f (); let y = g () in for x in array -> x + y // Don't read or rebind the loop variable when it is not in scope in the body. let ``for _ in Array.groupBy id [||] do …`` () = [| for _ in Array.groupBy id [||] do 0 |] let ``for _ | _ in Array.groupBy id [||] do …`` () = [| for _ | _ in Array.groupBy id [||] do 0 |] -let ``for _ & _ in Array.groupBy id [||] do …`` () = [| for _ & _ in Array.groupBy id [||] do 0 |] \ No newline at end of file +let ``for _ & _ in Array.groupBy id [||] do …`` () = [| for _ & _ in Array.groupBy id [||] do 0 |] From 8e519f3828e850f692d61fec891eae19fd59ad8c Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 13:18:13 -0400 Subject: [PATCH 3/8] Update release notes --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 24ce8c5a07b..203e8627cef 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -18,6 +18,7 @@ * Fix IsUnionCaseTester throwing for non-methods/properties [#17301](https://github.com/dotnet/fsharp/pull/17634) * Consider `open type` used when the type is an enum and any of the enum cases is used unqualified. ([PR #17628](https://github.com/dotnet/fsharp/pull/17628)) * Guard for possible StackOverflowException when typechecking non recursive modules and namespaces ([PR #17654](https://github.com/dotnet/fsharp/pull/17654)) +* Don't rebind the compiler-generated loop variable for `_` in `[|for _ in xs -> …|]` when `xs` is an array. ([Issue #17708](https://github.com/dotnet/fsharp/issues/17708), [PR #17711](https://github.com/dotnet/fsharp/pull/17711)) ### Added From 1d1ef413722509529d46325a66e60ce61f364c38 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 13:21:40 -0400 Subject: [PATCH 4/8] Probably need to keep that --- .../ComputedCollections/ForXInArray_ToArray.fs.il.bsl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl index 10973c87d2c..5f8c485890c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl @@ -16,6 +16,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 +} +.mresource public FSharpSignatureCompressedData.assembly +{ + + +} +.mresource public FSharpOptimizationCompressedData.assembly +{ + + } .module assembly.exe From 8f1f9d7e6c0dbc62f9dc46c230311efae38cdcab Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 13:22:16 -0400 Subject: [PATCH 5/8] Minimize diff --- .../ComputedCollections/ForXInArray_ToArray.fs.il.bsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl index 5f8c485890c..4c80efaf1a9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl @@ -19,13 +19,13 @@ } .mresource public FSharpSignatureCompressedData.assembly { - - + + } .mresource public FSharpOptimizationCompressedData.assembly { - - + + } .module assembly.exe From 9e239a4eb2b3d5af6ec642f8729164eec6f1b901 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 17:42:38 -0400 Subject: [PATCH 6/8] Simple mapping optimization fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Evaluate `xs` exactly once in `[|for … in xs -> …|]` when `xs` is an array. * Don't rebind the loop variable or read from the source array when the loop variable is unused in the loop body in, e.g., `[|for _ in xs -> …|]` when `xs` is an array. * Handle more complex patterns for `pat` in `[|for pat in … -> …|]`, `[for pat in … -> …]`. --- .../Optimize/LowerComputedCollections.fs | 113 +- .../ForXInArray_ToArray.fs | 14 +- .../ForXInArray_ToArray.fs.il.bsl | 2087 ++++++++++------- .../ComputedCollections/ForXInList_ToList.fs | 14 + .../ForXInList_ToList.fs.il.bsl | 626 ++++- 5 files changed, 1983 insertions(+), 871 deletions(-) diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 01e4a7f4452..98101af36fe 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -374,63 +374,69 @@ module Array = /// Makes the equivalent of an inlined call to Array.map. let mkMap g m (mBody, _spFor, _spIn, mFor, mIn, spInWhile) srcArray srcIlTy destIlTy overallElemTy (loopVal: Val) body = - let len = mkLdlen g mIn srcArray - let arrayTy = mkArrayType g overallElemTy - - /// (# "newarr !0" type ('T) count : 'T array #) - let array = - mkAsmExpr - ( - [I_newarr (ILArrayShape.SingleDimensional, destIlTy)], - [], - [len], - [arrayTy], - m - ) + mkCompGenLetIn m (nameof srcArray) (tyOfExpr g srcArray) srcArray (fun (_, srcArray) -> + let len = mkLdlen g mIn srcArray + let arrayTy = mkArrayType g overallElemTy + + /// (# "newarr !0" type ('T) count : 'T array #) + let array = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, destIlTy)], + [], + [len], + [arrayTy], + m + ) - let ldelem = mkIlInstr g I_ldelem (fun ilTy -> I_ldelem_any (ILArrayShape.SingleDimensional, ilTy)) srcIlTy - let stelem = mkIlInstr g I_stelem (fun ilTy -> I_stelem_any (ILArrayShape.SingleDimensional, ilTy)) destIlTy + let ldelem = mkIlInstr g I_ldelem (fun ilTy -> I_ldelem_any (ILArrayShape.SingleDimensional, ilTy)) srcIlTy + let stelem = mkIlInstr g I_stelem (fun ilTy -> I_stelem_any (ILArrayShape.SingleDimensional, ilTy)) destIlTy - let mapping = - mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> - mkCompGenLetMutableIn mFor "i" g.int32_ty (mkTypedZero g mIn g.int32_ty) (fun (iVal, i) -> - let body = - // Rebind the loop val to pull directly from the source array. + let mapping = + mkCompGenLetIn m (nameof array) arrayTy array (fun (_, array) -> + mkCompGenLetMutableIn mFor "i" g.int32_ty (mkTypedZero g mIn g.int32_ty) (fun (iVal, i) -> let body = - // If the loop val is marked as compiler-generated here, - // it is the wildcard _ and is unused in the loop body. - if loopVal.IsCompilerGenerated then body - else mkInvisibleLet mBody loopVal (mkAsmExpr ([ldelem], [], [srcArray; i], [loopVal.val_type], mBody)) body - - // destArray[i] <- body srcArray[i] - let setArrSubI = mkAsmExpr ([stelem], [], [array; i; body], [], mIn) - - // i <- i + 1 - let incrI = mkValSet mIn (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkTypedOne g mIn g.int32_ty], [g.int32_ty], mIn)) - - mkSequential mIn setArrSubI incrI - - let guard = mkILAsmClt g mFor i (mkLdlen g mFor array) - - let loop = - mkWhile - g - ( - spInWhile, - NoSpecialWhileLoopMarker, - guard, - body, - mIn - ) - - // while i < array.Length do done - // array - mkSequential m loop array + // If the loop val is used in the loop body, + // rebind it to pull directly from the source array. + // Otherwise, don't bother reading from the source array at all. + let body = + let freeLocals = (freeInExpr CollectLocals body).FreeLocals + + if freeLocals.Contains loopVal then + mkInvisibleLet mBody loopVal (mkAsmExpr ([ldelem], [], [srcArray; i], [loopVal.val_type], mBody)) body + else + body + + // destArray[i] <- body srcArray[i] + let setArrSubI = mkAsmExpr ([stelem], [], [array; i; body], [], mIn) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef iVal) (mkAsmExpr ([AI_add], [], [i; mkTypedOne g mIn g.int32_ty], [g.int32_ty], mIn)) + + mkSequential mIn setArrSubI incrI + + let guard = mkILAsmClt g mFor i (mkLdlen g mFor array) + + let loop = + mkWhile + g + ( + spInWhile, + NoSpecialWhileLoopMarker, + guard, + body, + mIn + ) + + // while i < array.Length do done + // array + mkSequential m loop array + ) ) - ) - // Add a debug point at the `for`, before anything gets evaluated. - Expr.DebugPoint (DebugPointAtLeafExpr.Yes mFor, mapping) + // Add a debug point at the `for`, before anything gets evaluated. + Expr.DebugPoint (DebugPointAtLeafExpr.Yes mFor, mapping) + ) /// Whether to check for overflow when converting a value to a native int. [] @@ -562,6 +568,9 @@ let (|SingleYield|_|) g expr : Expr voption = | Expr.Sequential (expr1, DebugPoints (body, debug), kind, m) -> loop body (cont << fun body -> Expr.Sequential (expr1, debug body, kind, m)) + | Expr.Match (debugPoint, mInput, decision, [|TTarget (boundVals, DebugPoints (SeqSingleton g body, debug), isStateVarFlags)|], mFull, exprType) -> + ValueSome (cont (Expr.Match (debugPoint, mInput, decision, [|TTarget (boundVals, debug body, isStateVarFlags)|], mFull, exprType))) + | SeqSingleton g body -> ValueSome (cont body) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs index e32fed928d6..2a989cbc025 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs @@ -21,9 +21,17 @@ let f8 f g (array: int array) = [|let y = f () in let z = g () in for x in array let f9 f g (array: int array) = [|let y = f () in g (); for x in array -> x + y|] let f10 f g (array: int array) = [|f (); g (); for x in array -> x|] let f11 f g (array: int array) = [|f (); let y = g () in for x in array -> x + y|] +let f12 (f: unit -> int array) y = [|for x in f () -> x + y|] // https://github.com/dotnet/fsharp/issues/17708 // Don't read or rebind the loop variable when it is not in scope in the body. -let ``for _ in Array.groupBy id [||] do …`` () = [| for _ in Array.groupBy id [||] do 0 |] -let ``for _ | _ in Array.groupBy id [||] do …`` () = [| for _ | _ in Array.groupBy id [||] do 0 |] -let ``for _ & _ in Array.groupBy id [||] do …`` () = [| for _ & _ in Array.groupBy id [||] do 0 |] +let ``for _ in Array.groupBy id [||] do …`` () = [|for _ in Array.groupBy id [||] do 0|] +let ``for _ | _ in Array.groupBy id [||] do …`` () = [|for _ | _ in Array.groupBy id [||] do 0|] +let ``for _ & _ in Array.groupBy id [||] do …`` () = [|for _ & _ in Array.groupBy id [||] do 0|] +let ``for _, _group in Array.groupBy id [||] do …`` () = [|for _, _group in Array.groupBy id [||] do 0|] +let ``for _, group in Array.groupBy id [||] do …`` () = [|for _, group in Array.groupBy id [||] do group.Length|] +let ``for 1 | 2 | _ in …`` () = [|for 1 | 2 | _ in [||] do 0|] +let ``for Failure _ | _ in …`` () = [|for Failure _ | _ in [||] do 0|] +let ``for true | false in …`` () = [|for true | false in [||] do 0|] +let ``for true | _ in …`` () = [|for true | _ in [||] do 0|] +let ``for _ | true in …`` () = [|for _ | true in [||] do 0|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl index 10973c87d2c..e109c7b2b24 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl @@ -33,10 +33,10 @@ 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 auto ansi serializable sealed nested assembly beforefieldinit 'for _ in Array-groupBy id -||- do …@27' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ in Array-groupBy id -||- do …@28' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ in Array-groupBy id -||- do …@27' @_instance + .field static assembly initonly class assembly/'for _ in Array-groupBy id -||- do …@28' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -60,17 +60,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ in Array-groupBy id -||- do …@27'::.ctor() - IL_0005: stsfld class assembly/'for _ in Array-groupBy id -||- do …@27' assembly/'for _ in Array-groupBy id -||- do …@27'::@_instance + IL_0000: newobj instance void assembly/'for _ in Array-groupBy id -||- do …@28'::.ctor() + IL_0005: stsfld class assembly/'for _ in Array-groupBy id -||- do …@28' assembly/'for _ in Array-groupBy id -||- do …@28'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in Array-groupBy id -||- do …@28' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in Array-groupBy id -||- do …@29' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ | _ in Array-groupBy id -||- do …@28' @_instance + .field static assembly initonly class assembly/'for _ | _ in Array-groupBy id -||- do …@29' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -94,17 +94,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ | _ in Array-groupBy id -||- do …@28'::.ctor() - IL_0005: stsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@28' assembly/'for _ | _ in Array-groupBy id -||- do …@28'::@_instance + IL_0000: newobj instance void assembly/'for _ | _ in Array-groupBy id -||- do …@29'::.ctor() + IL_0005: stsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@29' assembly/'for _ | _ in Array-groupBy id -||- do …@29'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in Array-groupBy id -||- do …@29' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in Array-groupBy id -||- do …@30' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ - _ in Array-groupBy id -||- do …@29' @_instance + .field static assembly initonly class assembly/'for _ - _ in Array-groupBy id -||- do …@30' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -128,171 +128,247 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ - _ in Array-groupBy id -||- do …@29'::.ctor() - IL_0005: stsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@29' assembly/'for _ - _ in Array-groupBy id -||- do …@29'::@_instance + IL_0000: newobj instance void assembly/'for _ - _ in Array-groupBy id -||- do …@30'::.ctor() + IL_0005: stsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@30' assembly/'for _ - _ in Array-groupBy id -||- do …@30'::@_instance IL_000a: ret } } - .method public static int32[] f0(int32[] 'array') cil managed + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in Array-groupBy id -||- do …@31' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - - .maxstack 6 - .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001a - - IL_000e: ldloc.0 - IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: stelem.i4 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: add - IL_0019: stloc.1 - IL_001a: ldloc.1 - IL_001b: ldloc.0 - IL_001c: ldlen - IL_001d: conv.i4 - IL_001e: blt.s IL_000e - - IL_0020: ldloc.0 - IL_0021: ret + .field static assembly initonly class assembly/'for _, _group in Array-groupBy id -||- do …@31' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _, _group in Array-groupBy id -||- do …@31'::.ctor() + IL_0005: stsfld class assembly/'for _, _group in Array-groupBy id -||- do …@31' assembly/'for _, _group in Array-groupBy id -||- do …@31'::@_instance + IL_000a: ret + } + } - .method public static int32[] f00(int32[] 'array') cil managed + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in Array-groupBy id -||- do …@32' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - - .maxstack 6 - .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001a - - IL_000e: ldloc.0 - IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: stelem.i4 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: add - IL_0019: stloc.1 - IL_001a: ldloc.1 - IL_001b: ldloc.0 - IL_001c: ldlen - IL_001d: conv.i4 - IL_001e: blt.s IL_000e - - IL_0020: ldloc.0 - IL_0021: ret + .field static assembly initonly class assembly/'for _, group in Array-groupBy id -||- do …@32' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _, group in Array-groupBy id -||- do …@32'::.ctor() + IL_0005: stsfld class assembly/'for _, group in Array-groupBy id -||- do …@32' assembly/'for _, group in Array-groupBy id -||- do …@32'::@_instance + IL_000a: ret + } + } - .method public static int32[] f000(int32[] 'array') cil managed + .method public static int32[] f0(int32[] 'array') cil managed { .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001b - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001b + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: nop - IL_0015: ldloc.2 + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 IL_0016: stelem.i4 - IL_0017: ldloc.1 + IL_0017: ldloc.2 IL_0018: ldc.i4.1 IL_0019: add - IL_001a: stloc.1 - IL_001b: ldloc.1 - IL_001c: ldloc.0 + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.1 IL_001d: ldlen IL_001e: conv.i4 - IL_001f: blt.s IL_000e + IL_001f: blt.s IL_000f - IL_0021: ldloc.0 + IL_0021: ldloc.1 IL_0022: ret } - .method public static int32[] f0000(int32[] 'array') cil managed + .method public static int32[] f00(int32[] 'array') cil managed { .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001b - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001b + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: nop - IL_0015: ldloc.2 + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 IL_0016: stelem.i4 - IL_0017: ldloc.1 + IL_0017: ldloc.2 IL_0018: ldc.i4.1 IL_0019: add - IL_001a: stloc.1 - IL_001b: ldloc.1 - IL_001c: ldloc.0 + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.1 IL_001d: ldlen IL_001e: conv.i4 - IL_001f: blt.s IL_000e + IL_001f: blt.s IL_000f - IL_0021: ldloc.0 + IL_0021: ldloc.1 IL_0022: ret } + .method public static int32[] f000(int32[] 'array') cil managed + { + + .maxstack 6 + .locals init (int32[] V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001c + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: nop + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldloc.1 + IL_001e: ldlen + IL_001f: conv.i4 + IL_0020: blt.s IL_000f + + IL_0022: ldloc.1 + IL_0023: ret + } + + .method public static int32[] f0000(int32[] 'array') cil managed + { + + .maxstack 6 + .locals init (int32[] V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001c + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: nop + IL_0016: ldloc.3 + IL_0017: stelem.i4 + IL_0018: ldloc.2 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldloc.1 + IL_001e: ldlen + IL_001f: conv.i4 + IL_0020: blt.s IL_000f + + IL_0022: ldloc.1 + IL_0023: ret + } + .method public static int32[] f00000(int32[] 'array', int32 x, int32 y) cil managed @@ -302,52 +378,54 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, + int32[] V_1, int32 V_2, int32 V_3, - int32 V_4) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0028 - - IL_000e: ldloc.0 + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_002b + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: ldarg.1 - IL_0016: add - IL_0017: stloc.3 - IL_0018: ldloc.2 - IL_0019: ldarg.2 - IL_001a: add - IL_001b: stloc.s V_4 - IL_001d: ldloc.2 - IL_001e: ldloc.3 - IL_001f: add + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: ldarg.1 + IL_0017: add + IL_0018: stloc.s V_4 + IL_001a: ldloc.3 + IL_001b: ldarg.2 + IL_001c: add + IL_001d: stloc.s V_5 + IL_001f: ldloc.3 IL_0020: ldloc.s V_4 IL_0022: add - IL_0023: stelem.i4 - IL_0024: ldloc.1 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.1 - IL_0028: ldloc.1 - IL_0029: ldloc.0 - IL_002a: ldlen - IL_002b: conv.i4 - IL_002c: blt.s IL_000e + IL_0023: ldloc.s V_5 + IL_0025: add + IL_0026: stelem.i4 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.2 + IL_002c: ldloc.1 + IL_002d: ldlen + IL_002e: conv.i4 + IL_002f: blt.s IL_000f - IL_002e: ldloc.0 - IL_002f: ret + IL_0031: ldloc.1 + IL_0032: ret } .method public static int32[] f000000(int32[] 'array', @@ -359,52 +437,54 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, + int32[] V_1, int32 V_2, int32 V_3, - int32 V_4) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0028 - - IL_000e: ldloc.0 + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_002b + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: ldarg.1 - IL_0016: add - IL_0017: stloc.3 - IL_0018: ldloc.2 - IL_0019: ldarg.2 - IL_001a: add - IL_001b: stloc.s V_4 - IL_001d: ldloc.2 - IL_001e: ldloc.3 - IL_001f: add + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: ldarg.1 + IL_0017: add + IL_0018: stloc.s V_4 + IL_001a: ldloc.3 + IL_001b: ldarg.2 + IL_001c: add + IL_001d: stloc.s V_5 + IL_001f: ldloc.3 IL_0020: ldloc.s V_4 IL_0022: add - IL_0023: stelem.i4 - IL_0024: ldloc.1 - IL_0025: ldc.i4.1 - IL_0026: add - IL_0027: stloc.1 - IL_0028: ldloc.1 - IL_0029: ldloc.0 - IL_002a: ldlen - IL_002b: conv.i4 - IL_002c: blt.s IL_000e + IL_0023: ldloc.s V_5 + IL_0025: add + IL_0026: stelem.i4 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.2 + IL_002c: ldloc.1 + IL_002d: ldlen + IL_002e: conv.i4 + IL_002f: blt.s IL_000f - IL_002e: ldloc.0 - IL_002f: ret + IL_0031: ldloc.1 + IL_0032: ret } .method public static int32[] f0000000(int32[] 'array', @@ -417,56 +497,58 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, + int32[] V_1, int32 V_2, int32 V_3, - int32 V_4) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0030 - - IL_000e: ldloc.0 + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0033 + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.1 - IL_0015: ldnull - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: pop - IL_001c: ldloc.2 - IL_001d: ldarg.2 - IL_001e: add - IL_001f: stloc.3 - IL_0020: ldloc.2 - IL_0021: ldarg.3 - IL_0022: add - IL_0023: stloc.s V_4 - IL_0025: ldloc.2 - IL_0026: ldloc.3 - IL_0027: add + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.1 + IL_0016: ldnull + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: pop + IL_001d: ldloc.3 + IL_001e: ldarg.2 + IL_001f: add + IL_0020: stloc.s V_4 + IL_0022: ldloc.3 + IL_0023: ldarg.3 + IL_0024: add + IL_0025: stloc.s V_5 + IL_0027: ldloc.3 IL_0028: ldloc.s V_4 IL_002a: add - IL_002b: stelem.i4 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: ldlen - IL_0033: conv.i4 - IL_0034: blt.s IL_000e - - IL_0036: ldloc.0 - IL_0037: ret + IL_002b: ldloc.s V_5 + IL_002d: add + IL_002e: stelem.i4 + IL_002f: ldloc.2 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: ldlen + IL_0036: conv.i4 + IL_0037: blt.s IL_000f + + IL_0039: ldloc.1 + IL_003a: ret } .method public static int32[] f00000000(int32[] 'array', @@ -479,56 +561,58 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, + int32[] V_1, int32 V_2, int32 V_3, - int32 V_4) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0030 - - IL_000e: ldloc.0 + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0033 + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: ldarg.2 - IL_0016: add - IL_0017: stloc.3 - IL_0018: ldarg.1 - IL_0019: ldnull - IL_001a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001f: pop - IL_0020: ldloc.2 - IL_0021: ldarg.3 - IL_0022: add - IL_0023: stloc.s V_4 - IL_0025: ldloc.2 - IL_0026: ldloc.3 - IL_0027: add + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: ldarg.2 + IL_0017: add + IL_0018: stloc.s V_4 + IL_001a: ldarg.1 + IL_001b: ldnull + IL_001c: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0021: pop + IL_0022: ldloc.3 + IL_0023: ldarg.3 + IL_0024: add + IL_0025: stloc.s V_5 + IL_0027: ldloc.3 IL_0028: ldloc.s V_4 IL_002a: add - IL_002b: stelem.i4 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: ldlen - IL_0033: conv.i4 - IL_0034: blt.s IL_000e - - IL_0036: ldloc.0 - IL_0037: ret + IL_002b: ldloc.s V_5 + IL_002d: add + IL_002e: stelem.i4 + IL_002f: ldloc.2 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: ldlen + IL_0036: conv.i4 + IL_0037: blt.s IL_000f + + IL_0039: ldloc.1 + IL_003a: ret } .method public static int32[] f000000000(int32[] 'array', @@ -541,56 +625,58 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, + int32[] V_1, int32 V_2, int32 V_3, - int32 V_4) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0030 - - IL_000e: ldloc.0 + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0033 + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: ldarg.2 - IL_0016: add - IL_0017: stloc.3 - IL_0018: ldloc.2 - IL_0019: ldarg.3 - IL_001a: add - IL_001b: stloc.s V_4 - IL_001d: ldarg.1 - IL_001e: ldnull - IL_001f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0024: pop - IL_0025: ldloc.2 - IL_0026: ldloc.3 - IL_0027: add + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: ldarg.2 + IL_0017: add + IL_0018: stloc.s V_4 + IL_001a: ldloc.3 + IL_001b: ldarg.3 + IL_001c: add + IL_001d: stloc.s V_5 + IL_001f: ldarg.1 + IL_0020: ldnull + IL_0021: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0026: pop + IL_0027: ldloc.3 IL_0028: ldloc.s V_4 IL_002a: add - IL_002b: stelem.i4 - IL_002c: ldloc.1 - IL_002d: ldc.i4.1 - IL_002e: add - IL_002f: stloc.1 - IL_0030: ldloc.1 - IL_0031: ldloc.0 - IL_0032: ldlen - IL_0033: conv.i4 - IL_0034: blt.s IL_000e - - IL_0036: ldloc.0 - IL_0037: ret + IL_002b: ldloc.s V_5 + IL_002d: add + IL_002e: stelem.i4 + IL_002f: ldloc.2 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: ldlen + IL_0036: conv.i4 + IL_0037: blt.s IL_000f + + IL_0039: ldloc.1 + IL_003a: ret } .method public static int32[] f0000000000(int32[] 'array', @@ -676,39 +762,41 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001a - - IL_000e: ldloc.0 - IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: stelem.i4 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: add - IL_0019: stloc.1 - IL_001a: ldloc.1 - IL_001b: ldloc.0 - IL_001c: ldlen - IL_001d: conv.i4 - IL_001e: blt.s IL_000e - - IL_0020: ldloc.0 - IL_0021: ret - } + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001b + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.1 + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: blt.s IL_000f + + IL_0021: ldloc.1 + IL_0022: ret + } .method public static !!a[] f2(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, int32[] 'array') cil managed @@ -716,41 +804,43 @@ .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 ) .maxstack 6 - .locals init (!!a[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr !!a - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0024 - - IL_000e: ldloc.0 + .locals init (int32[] V_0, + !!a[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr !!a + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0025 + IL_000f: ldloc.1 - IL_0010: ldarg.1 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: ldloc.2 - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: stelem !!a - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldloc.0 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_000e + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.0 + IL_0016: ldloc.3 + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: stelem !!a + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.1 + IL_0027: ldlen + IL_0028: conv.i4 + IL_0029: blt.s IL_000f - IL_002a: ldloc.0 - IL_002b: ret + IL_002b: ldloc.1 + IL_002c: ret } .method public static int32[] f3(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -760,42 +850,44 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0022 - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0023 + IL_000f: ldloc.1 - IL_0010: ldarg.1 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: ldnull - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: pop - IL_001c: ldloc.2 - IL_001d: stelem.i4 - IL_001e: ldloc.1 - IL_001f: ldc.i4.1 - IL_0020: add - IL_0021: stloc.1 - IL_0022: ldloc.1 - IL_0023: ldloc.0 - IL_0024: ldlen - IL_0025: conv.i4 - IL_0026: blt.s IL_000e + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.0 + IL_0016: ldnull + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: pop + IL_001d: ldloc.3 + IL_001e: stelem.i4 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldloc.1 + IL_0025: ldlen + IL_0026: conv.i4 + IL_0027: blt.s IL_000f - IL_0028: ldloc.0 - IL_0029: ret + IL_0029: ldloc.1 + IL_002a: ret } .method public static int32[] f4(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -807,46 +899,48 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.2 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_002a - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.2 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_002b + IL_000f: ldloc.1 - IL_0010: ldarg.2 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: ldnull - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: pop - IL_001c: ldarg.1 - IL_001d: ldnull - IL_001e: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0023: pop - IL_0024: ldloc.2 - IL_0025: stelem.i4 - IL_0026: ldloc.1 - IL_0027: ldc.i4.1 - IL_0028: add - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldloc.0 - IL_002c: ldlen - IL_002d: conv.i4 - IL_002e: blt.s IL_000e - - IL_0030: ldloc.0 - IL_0031: ret + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.0 + IL_0016: ldnull + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: pop + IL_001d: ldarg.1 + IL_001e: ldnull + IL_001f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0024: pop + IL_0025: ldloc.3 + IL_0026: stelem.i4 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.2 + IL_002c: ldloc.1 + IL_002d: ldlen + IL_002e: conv.i4 + IL_002f: blt.s IL_000f + + IL_0031: ldloc.1 + IL_0032: ret } .method public static int32[] f5(int32[] 'array') cil managed @@ -854,38 +948,40 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.0 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_001a - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_001b + IL_000f: ldloc.1 - IL_0010: ldarg.0 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldloc.2 - IL_0015: stelem.i4 - IL_0016: ldloc.1 - IL_0017: ldc.i4.1 - IL_0018: add - IL_0019: stloc.1 - IL_001a: ldloc.1 - IL_001b: ldloc.0 - IL_001c: ldlen - IL_001d: conv.i4 - IL_001e: blt.s IL_000e - - IL_0020: ldloc.0 - IL_0021: ret + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldloc.3 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.1 + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: blt.s IL_000f + + IL_0021: ldloc.1 + IL_0022: ret } .method public static int32[] f6(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -895,42 +991,44 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.1 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_0022 - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_0023 + IL_000f: ldloc.1 - IL_0010: ldarg.1 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: ldnull - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: pop - IL_001c: ldloc.2 - IL_001d: stelem.i4 - IL_001e: ldloc.1 - IL_001f: ldc.i4.1 - IL_0020: add - IL_0021: stloc.1 - IL_0022: ldloc.1 - IL_0023: ldloc.0 - IL_0024: ldlen - IL_0025: conv.i4 - IL_0026: blt.s IL_000e + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.0 + IL_0016: ldnull + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: pop + IL_001d: ldloc.3 + IL_001e: stelem.i4 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldloc.1 + IL_0025: ldlen + IL_0026: conv.i4 + IL_0027: blt.s IL_000f - IL_0028: ldloc.0 - IL_0029: ret + IL_0029: ldloc.1 + IL_002a: ret } .method public static int32[] f7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -942,46 +1040,48 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) - IL_0000: nop - IL_0001: ldarg.2 - IL_0002: ldlen - IL_0003: conv.i4 - IL_0004: newarr [runtime]System.Int32 - IL_0009: stloc.0 - IL_000a: ldc.i4.0 - IL_000b: stloc.1 - IL_000c: br.s IL_002a - - IL_000e: ldloc.0 + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.2 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldlen + IL_0004: conv.i4 + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: stloc.2 + IL_000d: br.s IL_002b + IL_000f: ldloc.1 - IL_0010: ldarg.2 - IL_0011: ldloc.1 - IL_0012: ldelem.i4 - IL_0013: stloc.2 - IL_0014: ldarg.0 - IL_0015: ldnull - IL_0016: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_001b: pop - IL_001c: ldarg.1 - IL_001d: ldnull - IL_001e: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0023: pop - IL_0024: ldloc.2 - IL_0025: stelem.i4 - IL_0026: ldloc.1 - IL_0027: ldc.i4.1 - IL_0028: add - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldloc.0 - IL_002c: ldlen - IL_002d: conv.i4 - IL_002e: blt.s IL_000e - - IL_0030: ldloc.0 - IL_0031: ret + IL_0010: ldloc.2 + IL_0011: ldloc.0 + IL_0012: ldloc.2 + IL_0013: ldelem.i4 + IL_0014: stloc.3 + IL_0015: ldarg.0 + IL_0016: ldnull + IL_0017: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001c: pop + IL_001d: ldarg.1 + IL_001e: ldnull + IL_001f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0024: pop + IL_0025: ldloc.3 + IL_0026: stelem.i4 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.2 + IL_002c: ldloc.1 + IL_002d: ldlen + IL_002e: conv.i4 + IL_002f: blt.s IL_000f + + IL_0031: ldloc.1 + IL_0032: ret } .method public static int32[] f8(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -995,8 +1095,9 @@ .locals init (int32 V_0, int32 V_1, int32[] V_2, - int32 V_3, - int32 V_4) + int32[] V_3, + int32 V_4, + int32 V_5) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldnull @@ -1006,40 +1107,41 @@ IL_000a: ldnull IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) IL_0010: stloc.1 - IL_0011: nop - IL_0012: ldarg.2 - IL_0013: ldlen - IL_0014: conv.i4 - IL_0015: newarr [runtime]System.Int32 - IL_001a: stloc.2 - IL_001b: ldc.i4.0 - IL_001c: stloc.3 - IL_001d: br.s IL_0031 - - IL_001f: ldloc.2 - IL_0020: ldloc.3 - IL_0021: ldarg.2 - IL_0022: ldloc.3 - IL_0023: ldelem.i4 - IL_0024: stloc.s V_4 - IL_0026: ldloc.s V_4 - IL_0028: ldloc.0 - IL_0029: add - IL_002a: ldloc.1 - IL_002b: add - IL_002c: stelem.i4 - IL_002d: ldloc.3 - IL_002e: ldc.i4.1 + IL_0011: ldarg.2 + IL_0012: stloc.2 + IL_0013: ldloc.2 + IL_0014: ldlen + IL_0015: conv.i4 + IL_0016: newarr [runtime]System.Int32 + IL_001b: stloc.3 + IL_001c: ldc.i4.0 + IL_001d: stloc.s V_4 + IL_001f: br.s IL_0037 + + IL_0021: ldloc.3 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.2 + IL_0025: ldloc.s V_4 + IL_0027: ldelem.i4 + IL_0028: stloc.s V_5 + IL_002a: ldloc.s V_5 + IL_002c: ldloc.0 + IL_002d: add + IL_002e: ldloc.1 IL_002f: add - IL_0030: stloc.3 - IL_0031: ldloc.3 - IL_0032: ldloc.2 - IL_0033: ldlen - IL_0034: conv.i4 - IL_0035: blt.s IL_001f - - IL_0037: ldloc.2 - IL_0038: ret + IL_0030: stelem.i4 + IL_0031: ldloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.s V_4 + IL_0037: ldloc.s V_4 + IL_0039: ldloc.3 + IL_003a: ldlen + IL_003b: conv.i4 + IL_003c: blt.s IL_0021 + + IL_003e: ldloc.3 + IL_003f: ret } .method public static int32[] f9(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1052,8 +1154,9 @@ .maxstack 6 .locals init (int32 V_0, int32[] V_1, - int32 V_2, - int32 V_3) + int32[] V_2, + int32 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldnull @@ -1063,38 +1166,39 @@ IL_000a: ldnull IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) IL_0010: pop - IL_0011: nop - IL_0012: ldarg.2 - IL_0013: ldlen - IL_0014: conv.i4 - IL_0015: newarr [runtime]System.Int32 - IL_001a: stloc.1 - IL_001b: ldc.i4.0 - IL_001c: stloc.2 - IL_001d: br.s IL_002d - - IL_001f: ldloc.1 + IL_0011: ldarg.2 + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldlen + IL_0015: conv.i4 + IL_0016: newarr [runtime]System.Int32 + IL_001b: stloc.2 + IL_001c: ldc.i4.0 + IL_001d: stloc.3 + IL_001e: br.s IL_0030 + IL_0020: ldloc.2 - IL_0021: ldarg.2 - IL_0022: ldloc.2 - IL_0023: ldelem.i4 - IL_0024: stloc.3 - IL_0025: ldloc.3 - IL_0026: ldloc.0 - IL_0027: add - IL_0028: stelem.i4 - IL_0029: ldloc.2 - IL_002a: ldc.i4.1 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.1 - IL_002f: ldlen - IL_0030: conv.i4 - IL_0031: blt.s IL_001f + IL_0021: ldloc.3 + IL_0022: ldloc.1 + IL_0023: ldloc.3 + IL_0024: ldelem.i4 + IL_0025: stloc.s V_4 + IL_0027: ldloc.s V_4 + IL_0029: ldloc.0 + IL_002a: add + IL_002b: stelem.i4 + IL_002c: ldloc.3 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.3 + IL_0030: ldloc.3 + IL_0031: ldloc.2 + IL_0032: ldlen + IL_0033: conv.i4 + IL_0034: blt.s IL_0020 - IL_0033: ldloc.1 - IL_0034: ret + IL_0036: ldloc.2 + IL_0037: ret } .method public static int32[] f10(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1106,8 +1210,9 @@ .maxstack 6 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) + int32[] V_1, + int32 V_2, + int32 V_3) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldnull @@ -1117,36 +1222,37 @@ IL_000a: ldnull IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) IL_0010: pop - IL_0011: nop - IL_0012: ldarg.2 - IL_0013: ldlen - IL_0014: conv.i4 - IL_0015: newarr [runtime]System.Int32 - IL_001a: stloc.0 - IL_001b: ldc.i4.0 - IL_001c: stloc.1 - IL_001d: br.s IL_002b + IL_0011: ldarg.2 + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: ldlen + IL_0015: conv.i4 + IL_0016: newarr [runtime]System.Int32 + IL_001b: stloc.1 + IL_001c: ldc.i4.0 + IL_001d: stloc.2 + IL_001e: br.s IL_002c - IL_001f: ldloc.0 IL_0020: ldloc.1 - IL_0021: ldarg.2 - IL_0022: ldloc.1 - IL_0023: ldelem.i4 - IL_0024: stloc.2 - IL_0025: ldloc.2 - IL_0026: stelem.i4 - IL_0027: ldloc.1 - IL_0028: ldc.i4.1 - IL_0029: add - IL_002a: stloc.1 - IL_002b: ldloc.1 - IL_002c: ldloc.0 - IL_002d: ldlen - IL_002e: conv.i4 - IL_002f: blt.s IL_001f - - IL_0031: ldloc.0 - IL_0032: ret + IL_0021: ldloc.2 + IL_0022: ldloc.0 + IL_0023: ldloc.2 + IL_0024: ldelem.i4 + IL_0025: stloc.3 + IL_0026: ldloc.3 + IL_0027: stelem.i4 + IL_0028: ldloc.2 + IL_0029: ldc.i4.1 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldloc.1 + IL_002e: ldlen + IL_002f: conv.i4 + IL_0030: blt.s IL_0020 + + IL_0032: ldloc.1 + IL_0033: ret } .method public static int32[] f11(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, @@ -1159,8 +1265,9 @@ .maxstack 6 .locals init (int32 V_0, int32[] V_1, - int32 V_2, - int32 V_3) + int32[] V_2, + int32 V_3, + int32 V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldnull @@ -1170,149 +1277,515 @@ IL_000a: ldnull IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) IL_0010: stloc.0 - IL_0011: nop - IL_0012: ldarg.2 - IL_0013: ldlen - IL_0014: conv.i4 - IL_0015: newarr [runtime]System.Int32 - IL_001a: stloc.1 - IL_001b: ldc.i4.0 - IL_001c: stloc.2 - IL_001d: br.s IL_002d - - IL_001f: ldloc.1 + IL_0011: ldarg.2 + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldlen + IL_0015: conv.i4 + IL_0016: newarr [runtime]System.Int32 + IL_001b: stloc.2 + IL_001c: ldc.i4.0 + IL_001d: stloc.3 + IL_001e: br.s IL_0030 + IL_0020: ldloc.2 - IL_0021: ldarg.2 - IL_0022: ldloc.2 - IL_0023: ldelem.i4 - IL_0024: stloc.3 - IL_0025: ldloc.3 - IL_0026: ldloc.0 - IL_0027: add - IL_0028: stelem.i4 - IL_0029: ldloc.2 - IL_002a: ldc.i4.1 - IL_002b: add - IL_002c: stloc.2 - IL_002d: ldloc.2 - IL_002e: ldloc.1 - IL_002f: ldlen - IL_0030: conv.i4 - IL_0031: blt.s IL_001f + IL_0021: ldloc.3 + IL_0022: ldloc.1 + IL_0023: ldloc.3 + IL_0024: ldelem.i4 + IL_0025: stloc.s V_4 + IL_0027: ldloc.s V_4 + IL_0029: ldloc.0 + IL_002a: add + IL_002b: stelem.i4 + IL_002c: ldloc.3 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.3 + IL_0030: ldloc.3 + IL_0031: ldloc.2 + IL_0032: ldlen + IL_0033: conv.i4 + IL_0034: blt.s IL_0020 + + IL_0036: ldloc.2 + IL_0037: ret + } + + .method public static int32[] f12(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + 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 ) + + .maxstack 6 + .locals init (int32[] V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldlen + IL_000a: conv.i4 + IL_000b: newarr [runtime]System.Int32 + IL_0010: stloc.1 + IL_0011: ldc.i4.0 + IL_0012: stloc.2 + IL_0013: br.s IL_0023 - IL_0033: ldloc.1 - IL_0034: ret + IL_0015: ldloc.1 + IL_0016: ldloc.2 + IL_0017: ldloc.0 + IL_0018: ldloc.2 + IL_0019: ldelem.i4 + IL_001a: stloc.3 + IL_001b: ldloc.3 + IL_001c: ldarg.1 + IL_001d: add + IL_001e: stelem.i4 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldloc.1 + IL_0025: ldlen + IL_0026: conv.i4 + IL_0027: blt.s IL_0015 + + IL_0029: ldloc.1 + IL_002a: ret } .method public static int32[] 'for _ in Array.groupBy id [||] do …'() cil managed { .maxstack 5 - .locals init (int32[] V_0, - int32 V_1) - IL_0000: nop - IL_0001: ldsfld class assembly/'for _ in Array-groupBy id -||- do …@27' assembly/'for _ in Array-groupBy id -||- do …@27'::@_instance - IL_0006: call !!0[] [runtime]System.Array::Empty() - IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + .locals init (class [runtime]System.Tuple`2[] V_0, + int32[] V_1, + int32 V_2) + IL_0000: ldsfld class assembly/'for _ in Array-groupBy id -||- do …@28' assembly/'for _ in Array-groupBy id -||- do …@28'::@_instance + IL_0005: call !!0[] [runtime]System.Array::Empty() + IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) - IL_0010: ldlen - IL_0011: conv.i4 - IL_0012: newarr [runtime]System.Int32 - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: stloc.1 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.0 + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: newarr [runtime]System.Int32 + IL_0018: stloc.1 + IL_0019: ldc.i4.0 + IL_001a: stloc.2 + IL_001b: br.s IL_0025 + IL_001d: ldloc.1 - IL_001e: ldc.i4.0 - IL_001f: stelem.i4 - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldloc.0 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_001c + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: stelem.i4 + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.1 + IL_0027: ldlen + IL_0028: conv.i4 + IL_0029: blt.s IL_001d - IL_002a: ldloc.0 - IL_002b: ret + IL_002b: ldloc.1 + IL_002c: ret } .method public static int32[] 'for _ | _ in Array.groupBy id [||] do …'() cil managed { .maxstack 5 - .locals init (int32[] V_0, - int32 V_1) - IL_0000: nop - IL_0001: ldsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@28' assembly/'for _ | _ in Array-groupBy id -||- do …@28'::@_instance - IL_0006: call !!0[] [runtime]System.Array::Empty() - IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + .locals init (class [runtime]System.Tuple`2[] V_0, + int32[] V_1, + int32 V_2) + IL_0000: ldsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@29' assembly/'for _ | _ in Array-groupBy id -||- do …@29'::@_instance + IL_0005: call !!0[] [runtime]System.Array::Empty() + IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) - IL_0010: ldlen - IL_0011: conv.i4 - IL_0012: newarr [runtime]System.Int32 - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: stloc.1 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.0 + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: newarr [runtime]System.Int32 + IL_0018: stloc.1 + IL_0019: ldc.i4.0 + IL_001a: stloc.2 + IL_001b: br.s IL_0025 + IL_001d: ldloc.1 - IL_001e: ldc.i4.0 - IL_001f: stelem.i4 - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldloc.0 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_001c + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: stelem.i4 + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.1 + IL_0027: ldlen + IL_0028: conv.i4 + IL_0029: blt.s IL_001d - IL_002a: ldloc.0 - IL_002b: ret + IL_002b: ldloc.1 + IL_002c: ret } .method public static int32[] 'for _ & _ in Array.groupBy id [||] do …'() cil managed { .maxstack 5 - .locals init (int32[] V_0, - int32 V_1) - IL_0000: nop - IL_0001: ldsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@29' assembly/'for _ - _ in Array-groupBy id -||- do …@29'::@_instance - IL_0006: call !!0[] [runtime]System.Array::Empty() - IL_000b: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + .locals init (class [runtime]System.Tuple`2[] V_0, + int32[] V_1, + int32 V_2) + IL_0000: ldsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@30' assembly/'for _ - _ in Array-groupBy id -||- do …@30'::@_instance + IL_0005: call !!0[] [runtime]System.Array::Empty() + IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) - IL_0010: ldlen - IL_0011: conv.i4 - IL_0012: newarr [runtime]System.Int32 - IL_0017: stloc.0 - IL_0018: ldc.i4.0 - IL_0019: stloc.1 - IL_001a: br.s IL_0024 - - IL_001c: ldloc.0 + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: newarr [runtime]System.Int32 + IL_0018: stloc.1 + IL_0019: ldc.i4.0 + IL_001a: stloc.2 + IL_001b: br.s IL_0025 + IL_001d: ldloc.1 - IL_001e: ldc.i4.0 - IL_001f: stelem.i4 - IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldloc.0 - IL_0026: ldlen - IL_0027: conv.i4 - IL_0028: blt.s IL_001c + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: stelem.i4 + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.1 + IL_0027: ldlen + IL_0028: conv.i4 + IL_0029: blt.s IL_001d + + IL_002b: ldloc.1 + IL_002c: ret + } - IL_002a: ldloc.0 - IL_002b: ret + .method public static int32[] 'for _, _group in Array.groupBy id [||] do …'() cil managed + { + + .maxstack 5 + .locals init (class [runtime]System.Tuple`2[] V_0, + int32[] V_1, + int32 V_2) + IL_0000: ldsfld class assembly/'for _, _group in Array-groupBy id -||- do …@31' assembly/'for _, _group in Array-groupBy id -||- do …@31'::@_instance + IL_0005: call !!0[] [runtime]System.Array::Empty() + IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + !!0[]) + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: newarr [runtime]System.Int32 + IL_0018: stloc.1 + IL_0019: ldc.i4.0 + IL_001a: stloc.2 + IL_001b: br.s IL_0025 + + IL_001d: ldloc.1 + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: stelem.i4 + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: ldloc.1 + IL_0027: ldlen + IL_0028: conv.i4 + IL_0029: blt.s IL_001d + + IL_002b: ldloc.1 + IL_002c: ret + } + + .method public static int32[] 'for _, group in Array.groupBy id [||] do …'() cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Tuple`2[] V_0, + int32[] V_1, + int32 V_2, + class [runtime]System.Tuple`2 V_3, + object[] V_4) + IL_0000: ldsfld class assembly/'for _, group in Array-groupBy id -||- do …@32' assembly/'for _, group in Array-groupBy id -||- do …@32'::@_instance + IL_0005: call !!0[] [runtime]System.Array::Empty() + IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + !!0[]) + IL_000f: stloc.0 + IL_0010: ldloc.0 + IL_0011: ldlen + IL_0012: conv.i4 + IL_0013: newarr [runtime]System.Int32 + IL_0018: stloc.1 + IL_0019: ldc.i4.0 + IL_001a: stloc.2 + IL_001b: br.s IL_0038 + + IL_001d: ldloc.1 + IL_001e: ldloc.2 + IL_001f: ldloc.0 + IL_0020: ldloc.2 + IL_0021: ldelem class [runtime]System.Tuple`2 + IL_0026: stloc.3 + IL_0027: ldloc.3 + IL_0028: call instance !1 class [runtime]System.Tuple`2::get_Item2() + IL_002d: stloc.s V_4 + IL_002f: ldloc.s V_4 + IL_0031: ldlen + IL_0032: conv.i4 + IL_0033: stelem.i4 + IL_0034: ldloc.2 + IL_0035: ldc.i4.1 + IL_0036: add + IL_0037: stloc.2 + IL_0038: ldloc.2 + IL_0039: ldloc.1 + IL_003a: ldlen + IL_003b: conv.i4 + IL_003c: blt.s IL_001d + + IL_003e: ldloc.1 + IL_003f: ret + } + + .method public static int32[] 'for 1 | 2 | _ in …'() cil managed + { + + .maxstack 6 + .locals init (int32[] V_0, + int32[] V_1, + int32 V_2, + int32 V_3) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: newarr [runtime]System.Int32 + IL_000e: stloc.1 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: br.s IL_0030 + + IL_0013: ldloc.1 + IL_0014: ldloc.2 + IL_0015: ldloc.0 + IL_0016: ldloc.2 + IL_0017: ldelem.i4 + IL_0018: stloc.3 + IL_0019: ldloc.3 + IL_001a: ldc.i4.1 + IL_001b: sub + IL_001c: switch ( + IL_0029, + IL_0029) + IL_0029: ldc.i4.0 + IL_002a: nop + IL_002b: stelem.i4 + IL_002c: ldloc.2 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.1 + IL_0032: ldlen + IL_0033: conv.i4 + IL_0034: blt.s IL_0013 + + IL_0036: ldloc.1 + IL_0037: ret + } + + .method public static int32[] 'for Failure _ | _ in …'() cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Exception[] V_0, + int32[] V_1, + int32 V_2, + class [runtime]System.Exception V_3, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_4) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: newarr [runtime]System.Int32 + IL_000e: stloc.1 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: br.s IL_0030 + + IL_0013: ldloc.1 + IL_0014: ldloc.2 + IL_0015: ldloc.0 + IL_0016: ldloc.2 + IL_0017: ldelem [runtime]System.Exception + IL_001c: stloc.3 + IL_001d: ldloc.3 + IL_001e: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_0023: stloc.s V_4 + IL_0025: ldloc.s V_4 + IL_0027: brfalse.s IL_0029 + + IL_0029: ldc.i4.0 + IL_002a: nop + IL_002b: stelem.i4 + IL_002c: ldloc.2 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.1 + IL_0032: ldlen + IL_0033: conv.i4 + IL_0034: blt.s IL_0013 + + IL_0036: ldloc.1 + IL_0037: ret + } + + .method public static int32[] 'for true | false in …'() cil managed + { + + .maxstack 6 + .locals init (bool[] V_0, + int32[] V_1, + int32 V_2, + bool V_3) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: newarr [runtime]System.Int32 + IL_000e: stloc.1 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: br.s IL_0027 + + IL_0013: ldloc.1 + IL_0014: ldloc.2 + IL_0015: ldloc.0 + IL_0016: ldloc.2 + IL_0017: ldelem [runtime]System.Boolean + IL_001c: stloc.3 + IL_001d: ldloc.3 + IL_001e: brfalse.s IL_0020 + + IL_0020: ldc.i4.0 + IL_0021: nop + IL_0022: stelem.i4 + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.2 + IL_0028: ldloc.1 + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: blt.s IL_0013 + + IL_002d: ldloc.1 + IL_002e: ret + } + + .method public static int32[] 'for true | _ in …'() cil managed + { + + .maxstack 6 + .locals init (bool[] V_0, + int32[] V_1, + int32 V_2, + bool V_3) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: newarr [runtime]System.Int32 + IL_000e: stloc.1 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: br.s IL_0027 + + IL_0013: ldloc.1 + IL_0014: ldloc.2 + IL_0015: ldloc.0 + IL_0016: ldloc.2 + IL_0017: ldelem [runtime]System.Boolean + IL_001c: stloc.3 + IL_001d: ldloc.3 + IL_001e: brfalse.s IL_0020 + + IL_0020: ldc.i4.0 + IL_0021: nop + IL_0022: stelem.i4 + IL_0023: ldloc.2 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.2 + IL_0028: ldloc.1 + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: blt.s IL_0013 + + IL_002d: ldloc.1 + IL_002e: ret + } + + .method public static int32[] 'for _ | true in …'() cil managed + { + + .maxstack 5 + .locals init (bool[] V_0, + int32[] V_1, + int32 V_2) + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldlen + IL_0008: conv.i4 + IL_0009: newarr [runtime]System.Int32 + IL_000e: stloc.1 + IL_000f: ldc.i4.0 + IL_0010: stloc.2 + IL_0011: br.s IL_001b + + IL_0013: ldloc.1 + IL_0014: ldloc.2 + IL_0015: ldc.i4.0 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.1 + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: blt.s IL_0013 + + IL_0021: ldloc.1 + IL_0022: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs index 6174b901ff0..174aa941c22 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs @@ -21,3 +21,17 @@ let f8 f g (list: int list) = [let y = f () in let z = g () in for x in list -> let f9 f g (list: int list) = [let y = f () in g (); for x in list -> x + y] let f10 f g (list: int list) = [f (); g (); for x in list -> x] let f11 f g (list: int list) = [f (); let y = g () in for x in list -> x + y] +let f12 (f: unit -> int list) y = [for x in f () -> x + y] + +// https://github.com/dotnet/fsharp/issues/17708 +// Don't read or rebind the loop variable when it is not in scope in the body. +let ``for _ in List.groupBy id [] do …`` () = [for _ in List.groupBy id [] do 0] +let ``for _ | _ in List.groupBy id [] do …`` () = [for _ | _ in List.groupBy id [] do 0] +let ``for _ & _ in List.groupBy id [] do …`` () = [for _ & _ in List.groupBy id [] do 0] +let ``for _, _group in List.groupBy id [] do …`` () = [for _, _group in List.groupBy id [] do 0] +let ``for _, group in List.groupBy id [] do …`` () = [for _, group in List.groupBy id [] do group.Length] +let ``for 1 | 2 | _ in …`` () = [for 1 | 2 | _ in [] do 0] +let ``for Failure _ | _ in …`` () = [for Failure _ | _ in [] do 0] +let ``for true | false in …`` () = [for true | false in [] do 0] +let ``for true | _ in …`` () = [for true | _ in [] do 0] +let ``for _ | true in …`` () = [for _ | true in [] do 0] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl index f70400c2792..ea1b8c3cd0b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl @@ -43,6 +43,176 @@ 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 auto ansi serializable sealed nested assembly beforefieldinit 'for _ in List-groupBy id -- do …@28' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ in List-groupBy id -- do …@28' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ in List-groupBy id -- do …@28'::.ctor() + IL_0005: stsfld class assembly/'for _ in List-groupBy id -- do …@28' assembly/'for _ in List-groupBy id -- do …@28'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in List-groupBy id -- do …@29' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ | _ in List-groupBy id -- do …@29' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ | _ in List-groupBy id -- do …@29'::.ctor() + IL_0005: stsfld class assembly/'for _ | _ in List-groupBy id -- do …@29' assembly/'for _ | _ in List-groupBy id -- do …@29'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in List-groupBy id -- do …@30' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _ - _ in List-groupBy id -- do …@30' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _ - _ in List-groupBy id -- do …@30'::.ctor() + IL_0005: stsfld class assembly/'for _ - _ in List-groupBy id -- do …@30' assembly/'for _ - _ in List-groupBy id -- do …@30'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in List-groupBy id -- do …@31' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _, _group in List-groupBy id -- do …@31' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _, _group in List-groupBy id -- do …@31'::.ctor() + IL_0005: stsfld class assembly/'for _, _group in List-groupBy id -- do …@31' assembly/'for _, _group in List-groupBy id -- do …@31'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in List-groupBy id -- do …@32' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/'for _, group in List-groupBy id -- do …@32' @_instance + .method assembly specialname rtspecialname instance void .ctor() 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: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance object Invoke(object x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/'for _, group in List-groupBy id -- do …@32'::.ctor() + IL_0005: stsfld class assembly/'for _, group in List-groupBy id -- do …@32' assembly/'for _, group in List-groupBy id -- do …@32'::@_instance + IL_000a: ret + } + + } + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f0(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed { @@ -594,9 +764,7 @@ IL_002f: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f2(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f2(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) 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 ) @@ -635,9 +803,7 @@ IL_0035: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f3(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f3(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) 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 ) @@ -763,9 +929,7 @@ IL_002f: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f6(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f6(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) 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 ) @@ -1067,6 +1231,450 @@ IL_0044: ret } + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f12(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> f, 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 ) + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldnull + IL_0003: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_0008: stloc.1 + IL_0009: ldloc.1 + IL_000a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000f: stloc.2 + IL_0010: br.s IL_002d + + IL_0012: ldloc.1 + IL_0013: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0018: stloc.3 + IL_0019: ldloca.s V_0 + IL_001b: ldloc.3 + IL_001c: ldarg.1 + IL_001d: add + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.2 + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: brtrue.s IL_0012 + + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ in List.groupBy id [] do …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, + class [runtime]System.Tuple`2> V_3) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ in List-groupBy id -- do …@28' assembly/'for _ in List-groupBy id -- do …@28'::@_instance + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0010: stloc.1 + IL_0011: ldloc.1 + IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0017: stloc.2 + IL_0018: br.s IL_0033 + + IL_001a: ldloc.1 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_HeadOrDefault() + IL_0020: stloc.3 + IL_0021: ldloca.s V_0 + IL_0023: ldc.i4.0 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: brtrue.s IL_001a + + IL_0036: ldloca.s V_0 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | _ in List.groupBy id [] do …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, + class [runtime]System.Tuple`2> V_3) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ | _ in List-groupBy id -- do …@29' assembly/'for _ | _ in List-groupBy id -- do …@29'::@_instance + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0010: stloc.1 + IL_0011: ldloc.1 + IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0017: stloc.2 + IL_0018: br.s IL_0033 + + IL_001a: ldloc.1 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_HeadOrDefault() + IL_0020: stloc.3 + IL_0021: ldloca.s V_0 + IL_0023: ldc.i4.0 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: brtrue.s IL_001a + + IL_0036: ldloca.s V_0 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ & _ in List.groupBy id [] do …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, + class [runtime]System.Tuple`2> V_3) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _ - _ in List-groupBy id -- do …@30' assembly/'for _ - _ in List-groupBy id -- do …@30'::@_instance + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0010: stloc.1 + IL_0011: ldloc.1 + IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0017: stloc.2 + IL_0018: br.s IL_0033 + + IL_001a: ldloc.1 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_HeadOrDefault() + IL_0020: stloc.3 + IL_0021: ldloca.s V_0 + IL_0023: ldc.i4.0 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: brtrue.s IL_001a + + IL_0036: ldloca.s V_0 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, _group in List.groupBy id [] do …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, + class [runtime]System.Tuple`2> V_3) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _, _group in List-groupBy id -- do …@31' assembly/'for _, _group in List-groupBy id -- do …@31'::@_instance + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0010: stloc.1 + IL_0011: ldloc.1 + IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0017: stloc.2 + IL_0018: br.s IL_0033 + + IL_001a: ldloc.1 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_HeadOrDefault() + IL_0020: stloc.3 + IL_0021: ldloca.s V_0 + IL_0023: ldc.i4.0 + IL_0024: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0029: nop + IL_002a: ldloc.2 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0032: stloc.2 + IL_0033: ldloc.2 + IL_0034: brtrue.s IL_001a + + IL_0036: ldloca.s V_0 + IL_0038: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, group in List.groupBy id [] do …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, + class [runtime]System.Tuple`2> V_3, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_4) + IL_0000: nop + IL_0001: ldsfld class assembly/'for _, group in List-groupBy id -- do …@32' assembly/'for _, group in List-groupBy id -- do …@32'::@_instance + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0010: stloc.1 + IL_0011: ldloc.1 + IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0017: stloc.2 + IL_0018: br.s IL_0041 + + IL_001a: ldloc.1 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_HeadOrDefault() + IL_0020: stloc.3 + IL_0021: ldloca.s V_0 + IL_0023: ldloc.3 + IL_0024: call instance !1 class [runtime]System.Tuple`2>::get_Item2() + IL_0029: stloc.s V_4 + IL_002b: ldloc.s V_4 + IL_002d: callvirt instance int32 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Length() + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: nop + IL_0038: ldloc.2 + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() + IL_0040: stloc.2 + IL_0041: ldloc.2 + IL_0042: brtrue.s IL_001a + + IL_0044: ldloca.s V_0 + IL_0046: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for 1 | 2 | _ in …'() cil managed + { + + .maxstack 5 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + int32 V_3) + IL_0000: nop + IL_0001: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000d: stloc.2 + IL_000e: br.s IL_003a + + IL_0010: ldloc.1 + IL_0011: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0016: stloc.3 + IL_0017: ldloca.s V_0 + IL_0019: ldloc.3 + IL_001a: ldc.i4.1 + IL_001b: sub + IL_001c: switch ( + IL_0029, + IL_0029) + IL_0029: ldc.i4.0 + IL_002a: nop + IL_002b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0030: nop + IL_0031: ldloc.2 + IL_0032: stloc.1 + IL_0033: ldloc.1 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0039: stloc.2 + IL_003a: ldloc.2 + IL_003b: brtrue.s IL_0010 + + IL_003d: ldloca.s V_0 + IL_003f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0044: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for Failure _ | _ in …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + class [runtime]System.Exception V_3, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_4) + IL_0000: nop + IL_0001: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000d: stloc.2 + IL_000e: br.s IL_0036 + + IL_0010: ldloc.1 + IL_0011: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0016: stloc.3 + IL_0017: ldloca.s V_0 + IL_0019: ldloc.3 + IL_001a: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_001f: stloc.s V_4 + IL_0021: ldloc.s V_4 + IL_0023: brfalse.s IL_0025 + + IL_0025: ldc.i4.0 + IL_0026: nop + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.2 + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0035: stloc.2 + IL_0036: ldloc.2 + IL_0037: brtrue.s IL_0010 + + IL_0039: ldloca.s V_0 + IL_003b: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0040: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | false in …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + bool V_3) + IL_0000: nop + IL_0001: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000d: stloc.2 + IL_000e: br.s IL_002d + + IL_0010: ldloc.1 + IL_0011: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0016: stloc.3 + IL_0017: ldloca.s V_0 + IL_0019: ldloc.3 + IL_001a: brfalse.s IL_001c + + IL_001c: ldc.i4.0 + IL_001d: nop + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.2 + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: brtrue.s IL_0010 + + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | _ in …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + bool V_3) + IL_0000: nop + IL_0001: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000d: stloc.2 + IL_000e: br.s IL_002d + + IL_0010: ldloc.1 + IL_0011: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0016: stloc.3 + IL_0017: ldloca.s V_0 + IL_0019: ldloc.3 + IL_001a: brfalse.s IL_001c + + IL_001c: ldc.i4.0 + IL_001d: nop + IL_001e: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0023: nop + IL_0024: ldloc.2 + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: brtrue.s IL_0010 + + IL_0030: ldloca.s V_0 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | true in …'() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, + bool V_3) + IL_0000: nop + IL_0001: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_000d: stloc.2 + IL_000e: br.s IL_0029 + + IL_0010: ldloc.1 + IL_0011: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0016: stloc.3 + IL_0017: ldloca.s V_0 + IL_0019: ldc.i4.0 + IL_001a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_001f: nop + IL_0020: ldloc.2 + IL_0021: stloc.1 + IL_0022: ldloc.1 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0028: stloc.2 + IL_0029: ldloc.2 + IL_002a: brtrue.s IL_0010 + + IL_002c: ldloca.s V_0 + IL_002e: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0033: ret + } + } .class private abstract auto ansi sealed ''.$assembly From 7dc85ac8c9e6854273deb3d797a7c9aa17ac8145 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 17:51:30 -0400 Subject: [PATCH 7/8] Update release notes --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 203e8627cef..d8658f4ce49 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -18,7 +18,7 @@ * Fix IsUnionCaseTester throwing for non-methods/properties [#17301](https://github.com/dotnet/fsharp/pull/17634) * Consider `open type` used when the type is an enum and any of the enum cases is used unqualified. ([PR #17628](https://github.com/dotnet/fsharp/pull/17628)) * Guard for possible StackOverflowException when typechecking non recursive modules and namespaces ([PR #17654](https://github.com/dotnet/fsharp/pull/17654)) -* Don't rebind the compiler-generated loop variable for `_` in `[|for _ in xs -> …|]` when `xs` is an array. ([Issue #17708](https://github.com/dotnet/fsharp/issues/17708), [PR #17711](https://github.com/dotnet/fsharp/pull/17711)) +* Fixes for the optimization of simple mappings in array and list comprehensions. ([Issue #17708](https://github.com/dotnet/fsharp/issues/17708), [PR #17711](https://github.com/dotnet/fsharp/pull/17711)) ### Added From 86d43c95948643cdb51abd6e7473fb091b940e1c Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 12 Sep 2024 18:45:14 -0400 Subject: [PATCH 8/8] =?UTF-8?q?=E2=80=A6=20=E2=86=92=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ForXInArray_ToArray.fs | 20 +++--- .../ForXInArray_ToArray.fs.il.bsl | 70 +++++++++---------- .../ComputedCollections/ForXInList_ToList.fs | 20 +++--- .../ForXInList_ToList.fs.il.bsl | 70 +++++++++---------- 4 files changed, 90 insertions(+), 90 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs index 2a989cbc025..1f55bc40d91 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs @@ -25,13 +25,13 @@ let f12 (f: unit -> int array) y = [|for x in f () -> x + y|] // https://github.com/dotnet/fsharp/issues/17708 // Don't read or rebind the loop variable when it is not in scope in the body. -let ``for _ in Array.groupBy id [||] do …`` () = [|for _ in Array.groupBy id [||] do 0|] -let ``for _ | _ in Array.groupBy id [||] do …`` () = [|for _ | _ in Array.groupBy id [||] do 0|] -let ``for _ & _ in Array.groupBy id [||] do …`` () = [|for _ & _ in Array.groupBy id [||] do 0|] -let ``for _, _group in Array.groupBy id [||] do …`` () = [|for _, _group in Array.groupBy id [||] do 0|] -let ``for _, group in Array.groupBy id [||] do …`` () = [|for _, group in Array.groupBy id [||] do group.Length|] -let ``for 1 | 2 | _ in …`` () = [|for 1 | 2 | _ in [||] do 0|] -let ``for Failure _ | _ in …`` () = [|for Failure _ | _ in [||] do 0|] -let ``for true | false in …`` () = [|for true | false in [||] do 0|] -let ``for true | _ in …`` () = [|for true | _ in [||] do 0|] -let ``for _ | true in …`` () = [|for _ | true in [||] do 0|] +let ``for _ in Array.groupBy id [||] do ...`` () = [|for _ in Array.groupBy id [||] do 0|] +let ``for _ | _ in Array.groupBy id [||] do ...`` () = [|for _ | _ in Array.groupBy id [||] do 0|] +let ``for _ & _ in Array.groupBy id [||] do ...`` () = [|for _ & _ in Array.groupBy id [||] do 0|] +let ``for _, _group in Array.groupBy id [||] do ...`` () = [|for _, _group in Array.groupBy id [||] do 0|] +let ``for _, group in Array.groupBy id [||] do ...`` () = [|for _, group in Array.groupBy id [||] do group.Length|] +let ``for 1 | 2 | _ in ...`` () = [|for 1 | 2 | _ in [||] do 0|] +let ``for Failure _ | _ in ...`` () = [|for Failure _ | _ in [||] do 0|] +let ``for true | false in ...`` () = [|for true | false in [||] do 0|] +let ``for true | _ in ...`` () = [|for true | _ in [||] do 0|] +let ``for _ | true in ...`` () = [|for _ | true in [||] do 0|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl index 5d94d74c9cf..2e1eeb67e45 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInArray_ToArray.fs.il.bsl @@ -43,10 +43,10 @@ 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 auto ansi serializable sealed nested assembly beforefieldinit 'for _ in Array-groupBy id -||- do …@28' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ in Array-groupBy id -||- do ---@28' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ in Array-groupBy id -||- do …@28' @_instance + .field static assembly initonly class assembly/'for _ in Array-groupBy id -||- do ---@28' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -70,17 +70,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ in Array-groupBy id -||- do …@28'::.ctor() - IL_0005: stsfld class assembly/'for _ in Array-groupBy id -||- do …@28' assembly/'for _ in Array-groupBy id -||- do …@28'::@_instance + IL_0000: newobj instance void assembly/'for _ in Array-groupBy id -||- do ---@28'::.ctor() + IL_0005: stsfld class assembly/'for _ in Array-groupBy id -||- do ---@28' assembly/'for _ in Array-groupBy id -||- do ---@28'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in Array-groupBy id -||- do …@29' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in Array-groupBy id -||- do ---@29' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ | _ in Array-groupBy id -||- do …@29' @_instance + .field static assembly initonly class assembly/'for _ | _ in Array-groupBy id -||- do ---@29' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -104,17 +104,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ | _ in Array-groupBy id -||- do …@29'::.ctor() - IL_0005: stsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@29' assembly/'for _ | _ in Array-groupBy id -||- do …@29'::@_instance + IL_0000: newobj instance void assembly/'for _ | _ in Array-groupBy id -||- do ---@29'::.ctor() + IL_0005: stsfld class assembly/'for _ | _ in Array-groupBy id -||- do ---@29' assembly/'for _ | _ in Array-groupBy id -||- do ---@29'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in Array-groupBy id -||- do …@30' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in Array-groupBy id -||- do ---@30' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ - _ in Array-groupBy id -||- do …@30' @_instance + .field static assembly initonly class assembly/'for _ - _ in Array-groupBy id -||- do ---@30' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -138,17 +138,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ - _ in Array-groupBy id -||- do …@30'::.ctor() - IL_0005: stsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@30' assembly/'for _ - _ in Array-groupBy id -||- do …@30'::@_instance + IL_0000: newobj instance void assembly/'for _ - _ in Array-groupBy id -||- do ---@30'::.ctor() + IL_0005: stsfld class assembly/'for _ - _ in Array-groupBy id -||- do ---@30' assembly/'for _ - _ in Array-groupBy id -||- do ---@30'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in Array-groupBy id -||- do …@31' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in Array-groupBy id -||- do ---@31' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _, _group in Array-groupBy id -||- do …@31' @_instance + .field static assembly initonly class assembly/'for _, _group in Array-groupBy id -||- do ---@31' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -172,17 +172,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _, _group in Array-groupBy id -||- do …@31'::.ctor() - IL_0005: stsfld class assembly/'for _, _group in Array-groupBy id -||- do …@31' assembly/'for _, _group in Array-groupBy id -||- do …@31'::@_instance + IL_0000: newobj instance void assembly/'for _, _group in Array-groupBy id -||- do ---@31'::.ctor() + IL_0005: stsfld class assembly/'for _, _group in Array-groupBy id -||- do ---@31' assembly/'for _, _group in Array-groupBy id -||- do ---@31'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in Array-groupBy id -||- do …@32' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in Array-groupBy id -||- do ---@32' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _, group in Array-groupBy id -||- do …@32' @_instance + .field static assembly initonly class assembly/'for _, group in Array-groupBy id -||- do ---@32' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -206,8 +206,8 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _, group in Array-groupBy id -||- do …@32'::.ctor() - IL_0005: stsfld class assembly/'for _, group in Array-groupBy id -||- do …@32' assembly/'for _, group in Array-groupBy id -||- do …@32'::@_instance + IL_0000: newobj instance void assembly/'for _, group in Array-groupBy id -||- do ---@32'::.ctor() + IL_0005: stsfld class assembly/'for _, group in Array-groupBy id -||- do ---@32' assembly/'for _, group in Array-groupBy id -||- do ---@32'::@_instance IL_000a: ret } @@ -1369,14 +1369,14 @@ IL_002a: ret } - .method public static int32[] 'for _ in Array.groupBy id [||] do …'() cil managed + .method public static int32[] 'for _ in Array.groupBy id [||] do ...'() cil managed { .maxstack 5 .locals init (class [runtime]System.Tuple`2[] V_0, int32[] V_1, int32 V_2) - IL_0000: ldsfld class assembly/'for _ in Array-groupBy id -||- do …@28' assembly/'for _ in Array-groupBy id -||- do …@28'::@_instance + IL_0000: ldsfld class assembly/'for _ in Array-groupBy id -||- do ---@28' assembly/'for _ in Array-groupBy id -||- do ---@28'::@_instance IL_0005: call !!0[] [runtime]System.Array::Empty() IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) @@ -1408,14 +1408,14 @@ IL_002c: ret } - .method public static int32[] 'for _ | _ in Array.groupBy id [||] do …'() cil managed + .method public static int32[] 'for _ | _ in Array.groupBy id [||] do ...'() cil managed { .maxstack 5 .locals init (class [runtime]System.Tuple`2[] V_0, int32[] V_1, int32 V_2) - IL_0000: ldsfld class assembly/'for _ | _ in Array-groupBy id -||- do …@29' assembly/'for _ | _ in Array-groupBy id -||- do …@29'::@_instance + IL_0000: ldsfld class assembly/'for _ | _ in Array-groupBy id -||- do ---@29' assembly/'for _ | _ in Array-groupBy id -||- do ---@29'::@_instance IL_0005: call !!0[] [runtime]System.Array::Empty() IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) @@ -1447,14 +1447,14 @@ IL_002c: ret } - .method public static int32[] 'for _ & _ in Array.groupBy id [||] do …'() cil managed + .method public static int32[] 'for _ & _ in Array.groupBy id [||] do ...'() cil managed { .maxstack 5 .locals init (class [runtime]System.Tuple`2[] V_0, int32[] V_1, int32 V_2) - IL_0000: ldsfld class assembly/'for _ - _ in Array-groupBy id -||- do …@30' assembly/'for _ - _ in Array-groupBy id -||- do …@30'::@_instance + IL_0000: ldsfld class assembly/'for _ - _ in Array-groupBy id -||- do ---@30' assembly/'for _ - _ in Array-groupBy id -||- do ---@30'::@_instance IL_0005: call !!0[] [runtime]System.Array::Empty() IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) @@ -1486,14 +1486,14 @@ IL_002c: ret } - .method public static int32[] 'for _, _group in Array.groupBy id [||] do …'() cil managed + .method public static int32[] 'for _, _group in Array.groupBy id [||] do ...'() cil managed { .maxstack 5 .locals init (class [runtime]System.Tuple`2[] V_0, int32[] V_1, int32 V_2) - IL_0000: ldsfld class assembly/'for _, _group in Array-groupBy id -||- do …@31' assembly/'for _, _group in Array-groupBy id -||- do …@31'::@_instance + IL_0000: ldsfld class assembly/'for _, _group in Array-groupBy id -||- do ---@31' assembly/'for _, _group in Array-groupBy id -||- do ---@31'::@_instance IL_0005: call !!0[] [runtime]System.Array::Empty() IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) @@ -1525,7 +1525,7 @@ IL_002c: ret } - .method public static int32[] 'for _, group in Array.groupBy id [||] do …'() cil managed + .method public static int32[] 'for _, group in Array.groupBy id [||] do ...'() cil managed { .maxstack 6 @@ -1534,7 +1534,7 @@ int32 V_2, class [runtime]System.Tuple`2 V_3, object[] V_4) - IL_0000: ldsfld class assembly/'for _, group in Array-groupBy id -||- do …@32' assembly/'for _, group in Array-groupBy id -||- do …@32'::@_instance + IL_0000: ldsfld class assembly/'for _, group in Array-groupBy id -||- do ---@32' assembly/'for _, group in Array-groupBy id -||- do ---@32'::@_instance IL_0005: call !!0[] [runtime]System.Array::Empty() IL_000a: call class [runtime]System.Tuple`2[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[]) @@ -1575,7 +1575,7 @@ IL_003f: ret } - .method public static int32[] 'for 1 | 2 | _ in …'() cil managed + .method public static int32[] 'for 1 | 2 | _ in ...'() cil managed { .maxstack 6 @@ -1623,7 +1623,7 @@ IL_0037: ret } - .method public static int32[] 'for Failure _ | _ in …'() cil managed + .method public static int32[] 'for Failure _ | _ in ...'() cil managed { .maxstack 6 @@ -1672,7 +1672,7 @@ IL_0037: ret } - .method public static int32[] 'for true | false in …'() cil managed + .method public static int32[] 'for true | false in ...'() cil managed { .maxstack 6 @@ -1717,7 +1717,7 @@ IL_002e: ret } - .method public static int32[] 'for true | _ in …'() cil managed + .method public static int32[] 'for true | _ in ...'() cil managed { .maxstack 6 @@ -1762,7 +1762,7 @@ IL_002e: ret } - .method public static int32[] 'for _ | true in …'() cil managed + .method public static int32[] 'for _ | true in ...'() cil managed { .maxstack 5 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs index 174aa941c22..33be454f9c4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs @@ -25,13 +25,13 @@ let f12 (f: unit -> int list) y = [for x in f () -> x + y] // https://github.com/dotnet/fsharp/issues/17708 // Don't read or rebind the loop variable when it is not in scope in the body. -let ``for _ in List.groupBy id [] do …`` () = [for _ in List.groupBy id [] do 0] -let ``for _ | _ in List.groupBy id [] do …`` () = [for _ | _ in List.groupBy id [] do 0] -let ``for _ & _ in List.groupBy id [] do …`` () = [for _ & _ in List.groupBy id [] do 0] -let ``for _, _group in List.groupBy id [] do …`` () = [for _, _group in List.groupBy id [] do 0] -let ``for _, group in List.groupBy id [] do …`` () = [for _, group in List.groupBy id [] do group.Length] -let ``for 1 | 2 | _ in …`` () = [for 1 | 2 | _ in [] do 0] -let ``for Failure _ | _ in …`` () = [for Failure _ | _ in [] do 0] -let ``for true | false in …`` () = [for true | false in [] do 0] -let ``for true | _ in …`` () = [for true | _ in [] do 0] -let ``for _ | true in …`` () = [for _ | true in [] do 0] +let ``for _ in List.groupBy id [] do ...`` () = [for _ in List.groupBy id [] do 0] +let ``for _ | _ in List.groupBy id [] do ...`` () = [for _ | _ in List.groupBy id [] do 0] +let ``for _ & _ in List.groupBy id [] do ...`` () = [for _ & _ in List.groupBy id [] do 0] +let ``for _, _group in List.groupBy id [] do ...`` () = [for _, _group in List.groupBy id [] do 0] +let ``for _, group in List.groupBy id [] do ...`` () = [for _, group in List.groupBy id [] do group.Length] +let ``for 1 | 2 | _ in ...`` () = [for 1 | 2 | _ in [] do 0] +let ``for Failure _ | _ in ...`` () = [for Failure _ | _ in [] do 0] +let ``for true | false in ...`` () = [for true | false in [] do 0] +let ``for true | _ in ...`` () = [for true | _ in [] do 0] +let ``for _ | true in ...`` () = [for _ | true in [] do 0] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl index ea1b8c3cd0b..32f34802bd5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl @@ -43,10 +43,10 @@ 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 auto ansi serializable sealed nested assembly beforefieldinit 'for _ in List-groupBy id -- do …@28' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ in List-groupBy id -- do ---@28' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ in List-groupBy id -- do …@28' @_instance + .field static assembly initonly class assembly/'for _ in List-groupBy id -- do ---@28' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -70,17 +70,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ in List-groupBy id -- do …@28'::.ctor() - IL_0005: stsfld class assembly/'for _ in List-groupBy id -- do …@28' assembly/'for _ in List-groupBy id -- do …@28'::@_instance + IL_0000: newobj instance void assembly/'for _ in List-groupBy id -- do ---@28'::.ctor() + IL_0005: stsfld class assembly/'for _ in List-groupBy id -- do ---@28' assembly/'for _ in List-groupBy id -- do ---@28'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in List-groupBy id -- do …@29' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ | _ in List-groupBy id -- do ---@29' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ | _ in List-groupBy id -- do …@29' @_instance + .field static assembly initonly class assembly/'for _ | _ in List-groupBy id -- do ---@29' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -104,17 +104,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ | _ in List-groupBy id -- do …@29'::.ctor() - IL_0005: stsfld class assembly/'for _ | _ in List-groupBy id -- do …@29' assembly/'for _ | _ in List-groupBy id -- do …@29'::@_instance + IL_0000: newobj instance void assembly/'for _ | _ in List-groupBy id -- do ---@29'::.ctor() + IL_0005: stsfld class assembly/'for _ | _ in List-groupBy id -- do ---@29' assembly/'for _ | _ in List-groupBy id -- do ---@29'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in List-groupBy id -- do …@30' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _ - _ in List-groupBy id -- do ---@30' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _ - _ in List-groupBy id -- do …@30' @_instance + .field static assembly initonly class assembly/'for _ - _ in List-groupBy id -- do ---@30' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -138,17 +138,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _ - _ in List-groupBy id -- do …@30'::.ctor() - IL_0005: stsfld class assembly/'for _ - _ in List-groupBy id -- do …@30' assembly/'for _ - _ in List-groupBy id -- do …@30'::@_instance + IL_0000: newobj instance void assembly/'for _ - _ in List-groupBy id -- do ---@30'::.ctor() + IL_0005: stsfld class assembly/'for _ - _ in List-groupBy id -- do ---@30' assembly/'for _ - _ in List-groupBy id -- do ---@30'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in List-groupBy id -- do …@31' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, _group in List-groupBy id -- do ---@31' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _, _group in List-groupBy id -- do …@31' @_instance + .field static assembly initonly class assembly/'for _, _group in List-groupBy id -- do ---@31' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -172,17 +172,17 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _, _group in List-groupBy id -- do …@31'::.ctor() - IL_0005: stsfld class assembly/'for _, _group in List-groupBy id -- do …@31' assembly/'for _, _group in List-groupBy id -- do …@31'::@_instance + IL_0000: newobj instance void assembly/'for _, _group in List-groupBy id -- do ---@31'::.ctor() + IL_0005: stsfld class assembly/'for _, _group in List-groupBy id -- do ---@31' assembly/'for _, _group in List-groupBy id -- do ---@31'::@_instance IL_000a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in List-groupBy id -- do …@32' + .class auto ansi serializable sealed nested assembly beforefieldinit 'for _, group in List-groupBy id -- do ---@32' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { - .field static assembly initonly class assembly/'for _, group in List-groupBy id -- do …@32' @_instance + .field static assembly initonly class assembly/'for _, group in List-groupBy id -- do ---@32' @_instance .method assembly specialname rtspecialname instance void .ctor() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -206,8 +206,8 @@ { .maxstack 10 - IL_0000: newobj instance void assembly/'for _, group in List-groupBy id -- do …@32'::.ctor() - IL_0005: stsfld class assembly/'for _, group in List-groupBy id -- do …@32' assembly/'for _, group in List-groupBy id -- do …@32'::@_instance + IL_0000: newobj instance void assembly/'for _, group in List-groupBy id -- do ---@32'::.ctor() + IL_0005: stsfld class assembly/'for _, group in List-groupBy id -- do ---@32' assembly/'for _, group in List-groupBy id -- do ---@32'::@_instance IL_000a: ret } @@ -1272,7 +1272,7 @@ IL_0037: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ in List.groupBy id [] do …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ in List.groupBy id [] do ...'() cil managed { .maxstack 4 @@ -1281,7 +1281,7 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, class [runtime]System.Tuple`2> V_3) IL_0000: nop - IL_0001: ldsfld class assembly/'for _ in List-groupBy id -- do …@28' assembly/'for _ in List-groupBy id -- do …@28'::@_instance + IL_0001: ldsfld class assembly/'for _ in List-groupBy id -- do ---@28' assembly/'for _ in List-groupBy id -- do ---@28'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) @@ -1311,7 +1311,7 @@ IL_003d: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | _ in List.groupBy id [] do …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | _ in List.groupBy id [] do ...'() cil managed { .maxstack 4 @@ -1320,7 +1320,7 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, class [runtime]System.Tuple`2> V_3) IL_0000: nop - IL_0001: ldsfld class assembly/'for _ | _ in List-groupBy id -- do …@29' assembly/'for _ | _ in List-groupBy id -- do …@29'::@_instance + IL_0001: ldsfld class assembly/'for _ | _ in List-groupBy id -- do ---@29' assembly/'for _ | _ in List-groupBy id -- do ---@29'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) @@ -1350,7 +1350,7 @@ IL_003d: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ & _ in List.groupBy id [] do …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ & _ in List.groupBy id [] do ...'() cil managed { .maxstack 4 @@ -1359,7 +1359,7 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, class [runtime]System.Tuple`2> V_3) IL_0000: nop - IL_0001: ldsfld class assembly/'for _ - _ in List-groupBy id -- do …@30' assembly/'for _ - _ in List-groupBy id -- do …@30'::@_instance + IL_0001: ldsfld class assembly/'for _ - _ in List-groupBy id -- do ---@30' assembly/'for _ - _ in List-groupBy id -- do ---@30'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) @@ -1389,7 +1389,7 @@ IL_003d: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, _group in List.groupBy id [] do …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, _group in List.groupBy id [] do ...'() cil managed { .maxstack 4 @@ -1398,7 +1398,7 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> V_2, class [runtime]System.Tuple`2> V_3) IL_0000: nop - IL_0001: ldsfld class assembly/'for _, _group in List-groupBy id -- do …@31' assembly/'for _, _group in List-groupBy id -- do …@31'::@_instance + IL_0001: ldsfld class assembly/'for _, _group in List-groupBy id -- do ---@31' assembly/'for _, _group in List-groupBy id -- do ---@31'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) @@ -1428,7 +1428,7 @@ IL_003d: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, group in List.groupBy id [] do …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _, group in List.groupBy id [] do ...'() cil managed { .maxstack 4 @@ -1438,7 +1438,7 @@ class [runtime]System.Tuple`2> V_3, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_4) IL_0000: nop - IL_0001: ldsfld class assembly/'for _, group in List-groupBy id -- do …@32' assembly/'for _, group in List-groupBy id -- do …@32'::@_instance + IL_0001: ldsfld class assembly/'for _, group in List-groupBy id -- do ---@32' assembly/'for _, group in List-groupBy id -- do ---@32'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) @@ -1472,7 +1472,7 @@ IL_004b: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for 1 | 2 | _ in …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for 1 | 2 | _ in ...'() cil managed { .maxstack 5 @@ -1515,7 +1515,7 @@ IL_0044: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for Failure _ | _ in …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for Failure _ | _ in ...'() cil managed { .maxstack 4 @@ -1559,7 +1559,7 @@ IL_0040: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | false in …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | false in ...'() cil managed { .maxstack 4 @@ -1599,7 +1599,7 @@ IL_0037: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | _ in …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for true | _ in ...'() cil managed { .maxstack 4 @@ -1639,7 +1639,7 @@ IL_0037: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | true in …'() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'for _ | true in ...'() cil managed { .maxstack 4