-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Implement IEquatable to Memory and ReadOnlyMemory #36497
Conversation
Note: VS went crazy and weren't doing any validation at all for me... Hope not, but there is a slim chance that I might have missed some silly mistakes.
Might be nice if I can figure out why this is happening, because it happened on me when I was trying to work on VisualBasic.Core solution as well. But besides... please have a look for possible weird stuffs among the changes. |
/cc @ahsonkhan |
Depends on dotnet/coreclr#23586 which is why CI is failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more interesting test cases/permutations. Otherwise, LGTM.
I am not sure why that's happening. Did you run build at the root of the repo first (from the command line)? Try that and then re-open the solution in VS. I don't see such errors in my instance of VS. |
Appears that VS restart fixed it. What a bug. 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on the current tests.
* Fixed where IEquatable interface tests were using object.Equals(object) instead of T.Equals(T) * Added IEquatable interface tests for Memory of different types (char, string)
Shouldn't #36501 fix this? it's been merged and they clearly implement these interfaces. ( |
* Fix tests that were missed in the previous commit (IEquatable tests calling object.Equals(object)) * Should use ReadOnlyMemory in ReadOnlyMemory tests
The PR seems to have been closed due to merging conflicts; has there been other PRs that updated the binary dependencies? |
Here's the next one: #36596 |
Can we try running tests now? Guess it's merged now (although it seems like Maestro had some hiccups). |
/azp run corefx-ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Among the checks that have just finished running, there were three failures, of which two (Packaging All Configurations x64_Debug, Windows UWP_NETNative_x86_Release) are ApiCompat failures:
And one (Windows x64_Debug) is test failure that is not related to the changes made in this PR: NullReferenceException in System.Net.Http.Functional.Tests.GetAsync_IPv6LinkLocalAddressUri_Success. |
I believe you have to add the exception to the System.Runtime API compat baseline, for uapaot.
So, just add the following to the file:
|
Do you mind filing an issue for that (labeled System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Http2/GetAsync_IPv6LinkLocalAddressUri_Success
|
Implementing IEquatable to Memory and ReadOnlyMemory (see #32905)
I think 39a3f2a should do from what I can see, but the checks for |
I am not sure why that is still failing. @ericstj, Any ideas? Do we need to update the baseline under shims too?
I don't think it matters, but other files have a total issue count in the file that the S.Runtime one is missing.
|
It looks to me like this is happening for System.Memory: D:\a\1\s.packages\microsoft.dotnet.apicompat\1.0.0-beta.19205.6\build\Microsoft.DotNet.ApiCompat.targets(72,5): error : CannotRemoveBaseTypeOrInterface : Type 'System.Memory' does not implement interface 'System.IEquatable<System.Memory>' in the implementation but it does in the contract. [D:\a\1\s\src\System.Memory\src\System.Memory.csproj] |
Lol, totally missed that! I thought both errors were from @Gnbrkm41, so, the solution is to add the API compat baseline exception there as well. The baseline file for System.Memory was removed earlier by @MichalStrehovsky (here - #33956) since it wasn't necessary anymore. Add it back with the two entries. |
Implementing IEquatable to Memory and ReadOnlyMemory (see #32905) * Remove baselines added to System.Runtime by mistake * Add baselines to System.Memory
Implementing IEquatable to Memory and ReadOnlyMemory (see #32905) * Add removed baselines to System.Runtime again
Thought I could remove ones in in System.Runtime, apparently I need both 🦆 |
* Implement IEquatable to Memory and ReadOnlyMemory * Add equality tests using IEquatable of ReadOnlyMemory and Memory * Fix and add tests for Memory and ReadOnlyMemory * Fixed where IEquatable interface tests were using object.Equals(object) instead of T.Equals(T) * Added IEquatable interface tests for Memory of different types (char, string) * Fix IEquatable tests for Memory and ReadOnlyMemory * Fix tests that were missed in the previous commit (IEquatable tests calling object.Equals(object)) * Should use ReadOnlyMemory in ReadOnlyMemory tests * Update uapaot baseline for dotnet/corefx#36497 Implementing IEquatable to Memory and ReadOnlyMemory (see dotnet/corefx#32905) * Update uapaot baseline for dotnet/corefx#36497 Implementing IEquatable to Memory and ReadOnlyMemory (see dotnet/corefx#32905) * Remove baselines added to System.Runtime by mistake * Add baselines to System.Memory * Update uapaot baseline for dotnet/corefx#36497 Implementing IEquatable to Memory and ReadOnlyMemory (see dotnet/corefx#32905) * Add removed baselines to System.Runtime again Commit migrated from dotnet/corefx@68920bb
Related: #32905
This PR includes the changes required to implement IEquatable to Memory and ReadOnlyMemory, and tests that checks for correct behaviours of the interface.