diff --git a/docs/articles/nunit/release-notes/framework.md b/docs/articles/nunit/release-notes/framework.md index 9aef68aa1..0ae87ae4d 100644 --- a/docs/articles/nunit/release-notes/framework.md +++ b/docs/articles/nunit/release-notes/framework.md @@ -950,6 +950,11 @@ This release includes a series of enhancements and bug fixes. Notably, some of t Be aware that this might cause compile errors in cases where the code was previously ignored. These errors can be safely resolved by removing the affected code. +**F# users:** the new `Is.EqualTo` overloads can cause the F# compiler to report *A unique overload for method 'EqualTo' could not be determined* +when the expected value is a list or other collection. Specify the type argument, for example `Is.EqualTo([2; 3])`, +to resolve the ambiguity. See [4920](https://github.com/nunit/nunit/issues/4920) and the +[Equal Constraint](xref:constraint-equal) notes. + There are 29 issues fixed in this release. ### Enhancements diff --git a/docs/articles/nunit/writing-tests/constraints/EqualConstraint.md b/docs/articles/nunit/writing-tests/constraints/EqualConstraint.md index 907f3b358..16f5ebb73 100644 --- a/docs/articles/nunit/writing-tests/constraints/EqualConstraint.md +++ b/docs/articles/nunit/writing-tests/constraints/EqualConstraint.md @@ -506,6 +506,18 @@ But was: "89031" null, the Constraint succeeds. If only one is null, it fails. 8. NUnit has special semantics for comparing **Streams** and **DirectoryInfos**. For a **Stream**, the contents are compared. For a **DirectoryInfo**, the first-level directory contents are compared. +9. **F# callers:** since NUnit 4.3.0, `Is.EqualTo` has overloads taking `object`, `T` and `IEnumerable`. C# picks the + right one, but the F# compiler cannot choose between them when the expected value is a list or other collection and + reports _A unique overload for method 'EqualTo' could not be determined_. Specify the type argument on the call to + resolve the ambiguity: + + ```fsharp + Assert.That([2; 3], Is.EqualTo([2; 3])) + ``` + + This is a known limitation of F# overload resolution + ([dotnet/fsharp#1647](https://github.com/dotnet/fsharp/issues/1647)); see NUnit issue + [4920](https://github.com/nunit/nunit/issues/4920) for the discussion. ## See also