diff --git a/.fantomasignore b/.fantomasignore index b901c74bd99..d1bea49f566 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -40,6 +40,9 @@ src/Compiler/Checking/SignatureConformance.fs src/Compiler/Checking/TypeHierarchy.fs src/Compiler/Checking/TypeRelations.fs +# nullness-related problems +src/Compiler/DependencyManager/DependencyProvider.fs + # Incorrectly formatted: https://github.com/dotnet/fsharp/pull/14645/commits/49443a67ea8a17670c8a7c80c8bdf91f82231e91 or https://github.com/fsprojects/fantomas/issues/2733 # This CompilerImports.fs behavior is not fixed yet, following up in https://github.com/fsprojects/fantomas/issues/2733 src/Compiler/Driver/CompilerImports.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 3908fc98dd5..0a05f20bf45 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -55,8 +55,8 @@ * Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871)) * CheckAndThrow can be invoked only from within Cancellable context ([PR #18037](https://github.com/dotnet/fsharp/pull/18037)) * Make ILTypeDef base type calculation lazy. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) -* "#if" directive around nullness removed from src/Compiler/TypedTree/TypedTreePickle.fs and refactored. ([PR #18203](https://github.com/dotnet/fsharp/pull/18203)) +* Removed redundant hash directives around nullness syntax ([Issue #18601](https://github.com/dotnet/fsharp/issues/18061), [PR #18203](https://github.com/dotnet/fsharp/pull/18203), [PR #18207](https://github.com/dotnet/fsharp/pull/18207)) ### Breaking Changes -* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) \ No newline at end of file +* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) diff --git a/src/Compiler/DependencyManager/DependencyProvider.fs b/src/Compiler/DependencyManager/DependencyProvider.fs index cc1b47de2ea..1bf72a76e5b 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fs +++ b/src/Compiler/DependencyManager/DependencyProvider.fs @@ -15,7 +15,7 @@ open System.Collections.Concurrent module Option = /// Convert string into Option string where null and String.Empty result in None - let ofString (s: string MaybeNull) = + let ofString (s: string | null) = match s with | null -> None | "" -> None @@ -607,7 +607,7 @@ type DependencyProvider outputDir: string, reportError: ResolvingErrorReport, path: string - ) : string MaybeNull * IDependencyManagerProvider MaybeNull = + ) : string | null * IDependencyManagerProvider | null = try if path.Contains ":" && not (Path.IsPathRooted path) then let managers = @@ -637,7 +637,7 @@ type DependencyProvider outputDir: string, reportError: ResolvingErrorReport, key: string - ) : IDependencyManagerProvider MaybeNull = + ) : IDependencyManagerProvider | null = try RegisteredDependencyManagers compilerTools (Option.ofString outputDir) reportError |> Map.tryFind key @@ -657,7 +657,7 @@ type DependencyProvider packageManagerTextLines: (string * string) seq, reportError: ResolvingErrorReport, executionTfm: string, - [] executionRid: string MaybeNull, + [] executionRid: string | null, [] implicitIncludeDir: string, [] mainScriptName: string, [] fileName: string, @@ -681,8 +681,8 @@ type DependencyProvider try let executionRid = match executionRid with - | Null -> RidHelpers.platformRid - | NonNull executionRid -> executionRid + | null -> RidHelpers.platformRid + | executionRid -> executionRid Ok( packageManager.ResolveDependencies( diff --git a/src/Compiler/DependencyManager/DependencyProvider.fsi b/src/Compiler/DependencyManager/DependencyProvider.fsi index 4c97224fc90..fffaa9a2026 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fsi +++ b/src/Compiler/DependencyManager/DependencyProvider.fsi @@ -123,7 +123,7 @@ type DependencyProvider = packageManagerTextLines: (string * string) seq * reportError: ResolvingErrorReport * executionTfm: string * - [] executionRid: string * + [] executionRid: string * [] implicitIncludeDir: string * [] mainScriptName: string * [] fileName: string * @@ -133,9 +133,9 @@ type DependencyProvider = /// Fetch a dependencymanager that supports a specific key member TryFindDependencyManagerByKey: compilerTools: string seq * outputDir: string * reportError: ResolvingErrorReport * key: string -> - IDependencyManagerProvider MaybeNull + IDependencyManagerProvider | null /// TryFindDependencyManagerInPath - given a #r "key:sometext" go and find a DependencyManager that satisfies the key member TryFindDependencyManagerInPath: compilerTools: string seq * outputDir: string * reportError: ResolvingErrorReport * path: string -> - string MaybeNull * IDependencyManagerProvider MaybeNull + string | null * IDependencyManagerProvider | null \ No newline at end of file