Skip to content

Commit 407f348

Browse files
authored
Fix mistake in code sample for F# 9 (#43402)
1 parent 4ac6387 commit 407f348

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/fsharp/whats-new/fsharp-9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let getLength (x: string | null) = x.Length // gives a nullability warning since
3333
let len (str: string | null) =
3434
match str with
3535
| null -> -1
36-
| NonNull s -> s.Length // binds a non-null result
36+
| s -> s.Length // binds a non-null result - compiler eliminated "null" after the first clause
3737
3838
// Parameter to a function
3939
let len (str: string | null) =

0 commit comments

Comments
 (0)