Skip to content

Commit 5596d1a

Browse files
T-GroCopilot
andcommitted
Fix CI: replace LINQ extension test case with instance method; format IlxGen.fs
- Replace List<int>.First() (LINQ extension, fails on net472) with List<int>.Contains(1) (instance method, works on all TFMs) - Run fantomas on IlxGen.fs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 68fab52 commit 5596d1a

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/Compiler/CodeGen/IlxGen.fs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8676,11 +8676,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt =
86768676
CommitStartScope cgbuf startMarkOpt
86778677

86788678
// The initialization code for static 'let' and 'do' bindings gets compiled into the initialization .cctor for the whole file
8679-
| _ when
8680-
vspec.IsClassConstructor
8681-
&& isNil vspec.DeclaringEntity.Typars
8682-
&& not isStateVar
8683-
->
8679+
| _ when vspec.IsClassConstructor && isNil vspec.DeclaringEntity.Typars && not isStateVar ->
86848680
let tps, _, _, _, cctorBody, _ =
86858681
IteratedAdjustLambdaToMatchValReprInfo g cenv.amap vspec.ValReprInfo.Value rhsExpr
86868682

tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,8 +2384,8 @@ let main _ = 0
23842384
2, 28, 29, "Trim", "x", "string | null")>]
23852385
[<InlineData("module MyLib\nlet f (x: string | null) = x.Split(',')",
23862386
2, 28, 29, "Split", "x", "string | null")>]
2387-
[<InlineData("module MyLib\nopen System.Linq\nlet f (xs: System.Collections.Generic.List<int> | null) = xs.First()",
2388-
3, 59, 61, "First", "xs", "int seq | null")>]
2387+
[<InlineData("module MyLib\nlet f (xs: System.Collections.Generic.List<int> | null) = xs.Contains(1)",
2388+
2, 59, 61, "Contains", "xs", "System.Collections.Generic.List<int> | null")>]
23892389
[<InlineData("module MyLib\nlet f (xs: System.Collections.Generic.IEnumerable<int> | null) = xs.GetEnumerator()",
23902390
2, 66, 68, "GetEnumerator", "xs", "System.Collections.Generic.IEnumerable<int> | null")>]
23912391
[<InlineData("module MyLib\nopen System.Text\nlet f (sb: StringBuilder | null) = sb.Length <- 0",

0 commit comments

Comments
 (0)