Skip to content

Commit

Permalink
Merge branch 'main' into reenable-tests-3
Browse files Browse the repository at this point in the history
  • Loading branch information
majocha authored Nov 7, 2024
2 parents 277c7e4 + 277f676 commit be78e0f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ After it's finished, open `FSharp.sln` in your editor of choice.

Even if you find a single-character typo, we're happy to take the change! Although the codebase can feel daunting for beginners, we and other contributors are happy to help you along.

Not sure where to contribute?
Look at the [curated list of issues asking for help](https://github.com/dotnet/fsharp/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22help%20wanted%22). If you want to tackle any of those, use the comments section of the chosen issue to indicate interest and feel free to ask for initial guidance. We are happy to help with resolving outstanding issues while making a successful PR addressing the issue.

The issues in this repository can have big differences in the complexity for fixing them.
Are you getting started? We do have a label for [good first issues](https://github.com/dotnet/fsharp/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22) as well.

## Per-build NuGet packages

### 7.0.40x series
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812))
* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845))
* Fix internal error when analyzing incomplete inherit member ([PR #17905](https://github.com/dotnet/fsharp/pull/17905))
* Fix missing nullness warning in case of method resolution multiple candidates ([PR #17917](https://github.com/dotnet/fsharp/pull/17918))

### Added

Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24521.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24554.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>ccd0927e3823fb178c7151594f5d2eaba81bba81</Sha>
<Sha>e781442b88c4d939f06a94f38f24a5dc18c383d4</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
3 changes: 1 addition & 2 deletions src/Compiler/Checking/ConstraintSolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,6 @@ and SolveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty

and shouldWarnUselessNullCheck (csenv:ConstraintSolverEnv) =
csenv.g.checkNullness &&
csenv.IsSpeculativeForMethodOverloading = false &&
csenv.SolverState.WarnWhenUsingWithoutNullOnAWithNullTarget.IsSome

// nullness1: actual
Expand Down Expand Up @@ -1102,7 +1101,7 @@ and SolveNullnessSubsumesNullness (csenv: ConstraintSolverEnv) m2 (trace: Option
| NullnessInfo.WithNull, NullnessInfo.WithoutNull ->
CompleteD
| NullnessInfo.WithoutNull, NullnessInfo.WithNull ->
if csenv.g.checkNullness && not csenv.IsSpeculativeForMethodOverloading then
if csenv.g.checkNullness then
WarnD(ConstraintSolverNullnessWarningWithTypes(csenv.DisplayEnv, ty1, ty2, n1, n2, csenv.m, m2))
else
CompleteD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ let typeCheckWithStrictNullness cu =



[<FSharp.Test.FactForNETCOREAPPAttribute>]
let ``Does report when null goes to DateTime Parse`` () =

FSharp """module TestLib
open System
let parsedDate = DateTime.Parse(null:(string|null))
let parseDate2(s:string|null) = DateTime.Parse(s)
let parsedDate3 = DateTime.Parse(null)
"""
|> asLibrary
|> typeCheckWithStrictNullness
|> shouldFail
|> withDiagnostics
[Error 3261, Line 3, Col 18, Line 3, Col 52, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability."
Error 3261, Line 4, Col 33, Line 4, Col 50, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability."
Error 3261, Line 5, Col 19, Line 5, Col 39, "Nullness warning: The type 'string' does not support 'null'."]

[<Fact>]
let ``Can convert generic value to objnull arg`` () =
FSharp """module TestLib
Expand Down

0 comments on commit be78e0f

Please sign in to comment.