Skip to content

Commit

Permalink
Merge branch 'main' into tests-otel-2
Browse files Browse the repository at this point in the history
  • Loading branch information
majocha authored Jan 14, 2025
2 parents 1066960 + b2f2065 commit 579f882
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
* 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))
12 changes: 6 additions & 6 deletions src/Compiler/DependencyManager/DependencyProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand All @@ -657,7 +657,7 @@ type DependencyProvider
packageManagerTextLines: (string * string) seq,
reportError: ResolvingErrorReport,
executionTfm: string,
[<Optional; DefaultParameterValue(null: string MaybeNull)>] executionRid: string MaybeNull,
[<Optional; DefaultParameterValue(null: string | null)>] executionRid: string | null,
[<Optional; DefaultParameterValue("")>] implicitIncludeDir: string,
[<Optional; DefaultParameterValue("")>] mainScriptName: string,
[<Optional; DefaultParameterValue("")>] fileName: string,
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/DependencyManager/DependencyProvider.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ type DependencyProvider =
packageManagerTextLines: (string * string) seq *
reportError: ResolvingErrorReport *
executionTfm: string *
[<Optional; DefaultParameterValue(null: string MaybeNull)>] executionRid: string *
[<Optional; DefaultParameterValue(null: string | null)>] executionRid: string *
[<Optional; DefaultParameterValue("")>] implicitIncludeDir: string *
[<Optional; DefaultParameterValue("")>] mainScriptName: string *
[<Optional; DefaultParameterValue("")>] fileName: string *
Expand All @@ -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

0 comments on commit 579f882

Please sign in to comment.