You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
@@ -2402,6 +2403,21 @@ let ``Issue 19658 - dot-access on nullable receiver names the binding and member
2402
2403
$"Nullness warning: Possible dereference of a null value when accessing member '{memberName}' on the nullable value '{bindingName}' of type '{typeName}'."
2403
2404
]
2404
2405
2406
+
// LINQ extension methods: on net472, BCL lacks NullableAttribute so the
2407
+
// extension-method parameter is ambivalent and no FS3261 fires.
2408
+
[<FactForNETCOREAPP>]
2409
+
let``Issue 19658 -LINQ extension method dot-access on nullable receiver`` ()=
2410
+
FSharp """module MyLib
2411
+
open System.Linq
2412
+
let f (xs: System.Collections.Generic.List<int> | null) = xs.First()"""
2413
+
|> asLibrary
2414
+
|> typeCheckWithStrictNullness
2415
+
|> shouldFail
2416
+
|> withDiagnostics [
2417
+
Error 3261, Line 3, Col 59, Line 3, Col 61,
2418
+
"Nullness warning: Possible dereference of a null value when accessing member 'First' on the nullable value 'xs' of type 'int seq | null'."
0 commit comments