From 4dc4272a03d55d8fb079a94fa5cb2368b5c0fdef Mon Sep 17 00:00:00 2001 From: progressive-galib <125106402+progressive-galib@users.noreply.github.com> Date: Sun, 5 Jan 2025 16:34:57 +0000 Subject: [PATCH 1/3] src/fsi/console.fssrc/fsi/console.fs refactoring: new F#/dotnet 9 style null syntax done and MaybeNull" wrapper removed. --- src/fsi/console.fs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 6be943317ec..f6b0ab01b7d 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -11,14 +11,6 @@ open FSharp.Compiler.DiagnosticsLogger [] module internal ConsoleHelpers = -#if NO_CHECKNULLS - type MaybeNull<'T when 'T : null> = 'T - - // Shim to match nullness checking library support in preview - let inline (|Null|NonNull|) (x: 'T) : Choice = match x with null -> Null | v -> NonNull v -#else - type MaybeNull<'T when 'T : not null> = 'T | null -#endif type internal Style = | Prompt @@ -42,17 +34,17 @@ type internal History() = list.Clear() current <- -1 - member _.Add (line: string MaybeNull) = + member _.Add (line: string | null) = match line with - | Null + | null | "" -> () - | NonNull line -> list.Add(line) + | _ -> list.Add(line) - member _.AddLast (line: string MaybeNull) = + member _.AddLast (line: string | null) = match line with - | Null + | null | "" -> () - | NonNull line -> + | _ -> list.Add(line) current <- list.Count From 4770c69d617382002f2ff96b746806407349743c Mon Sep 17 00:00:00 2001 From: progressive-galib <125106402+progressive-galib@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:25:45 +0000 Subject: [PATCH 2/3] indent clearup --- src/fsi/console.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsi/console.fs b/src/fsi/console.fs index f6b0ab01b7d..9c7b08a2687 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -10,8 +10,6 @@ open FSharp.Compiler.DiagnosticsLogger [] module internal ConsoleHelpers = - - type internal Style = | Prompt | Out From 0b97f600fa68bde4b9cbd5514819381f277c7532 Mon Sep 17 00:00:00 2001 From: progressive-galib <125106402+progressive-galib@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:42:20 +0000 Subject: [PATCH 3/3] indent clearup 2 --- src/fsi/console.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 9c7b08a2687..d644180d384 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -8,8 +8,6 @@ open System.Collections.Generic open System.Runtime.InteropServices open FSharp.Compiler.DiagnosticsLogger -[] -module internal ConsoleHelpers = type internal Style = | Prompt | Out