-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Enumerable.Reverse(this T[])
polyfill
#75104
Merged
jjonescz
merged 2 commits into
dotnet:features/FirstClassSpan
from
jjonescz:FirstClassSpan-21-ReversePolyfill
Sep 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's probably not correct to put this here. @jaredpar to confirm, but I'm concerned that we'll end up breaking ourselves when the bcl adds this.
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.
https://github.com/dotnet/roslyn/blob/5a39d0ad691ee88dcf163808d9ed7a46b168a1c9/docs/contributing/Target%20Framework%20Strategy.md#pattern-for-extension-methods
I think this is fine. Problems could arise if we wrap this in
#if
s incorrectly (so when bcl adds this we need to be careful making this conditional).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.
I think that we should be able to mitigate this by wrapping this in
By the time that we actually start targeting
net10.0
this API is going to be there so that won't cause a break on us. We generally move to the new TFM rather late in the release and think that we can expect this to be added early given it's tied to first class span support which is going in early.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.
Won't we potentially break in a torn dll scenario though? Or have we thoroughly removed any change of that at this point?
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.
What teared scenario are you thinking of? This is just another API inside the compiler. The only impact that can happen is weirdness at compile time. The
#if
will ensure thatnet9.0
or earlier we have the method. If we get deployed intonet10.0
or higher then there is just another polyfill API in our binary. In the case the#if
isfalse
then we're innet10.0
where the API is guaranteed to be available.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.
Well, we certainly had a tear like this when we had the EA dll. Have we gotten rid of all of those scenarios?
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.
Shouldn't have this type of tearing problem without the EA DLL
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.
Hm, good idea about adding the
#if
for .NET 10, I have done that. Now it matches our guidelines linked above precisely.