-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Implement IList<T>, IReadOnlyList<T>, and IList on Regex Collections #316
Conversation
Hi @justinvp. I'm going to use this PR and corresponding issue as a way to test out the process outlined in #294. Do you mind ensuring the PR and issue are up to date with your current thinking on the proposal? I've preemptively requested an API review slot for next Wednesday (1/14) where we can discuss this if it's ready to go. If you need any help or have any questions about the process please do let me know. Thanks! |
@ellismg Thanks. The issue and this PR are good to go for the API review. |
By the way, the AppVeyor build failed after the last commit due to an unrelated issue:
|
Hi @justinvp , thanks for the PR, I've restarted AppVeyor for you. |
@justinvp, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
We've reviewed these APIs. Overall, it looks good but there is some feedback that needs to be addressed. |
Can one of the admins approve this PR test or whitelist this user? ('@dotnet-bot add to whitelist' to whitelist, '@dotnet-bot okay to test' to accept for PR, '@dotnet-bot test this please' to retest. Case sensitive). |
@dotnet-bot okay to test |
@dotnet-bot add to whitelist |
void IList<Capture>.Insert(int index, Capture item) | ||
{ | ||
throw new NotSupportedException(); | ||
} |
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.
We should probably add some exception text to these NotSupportedExceptions. Follow the pattern of what something like ReadOnlyCollection throws.
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.
The reason I didn't include exception text was because I was just following the immutable collections, which don't include any exception text when throwing NotSupportedException
. If we want the exception text, I can add it. And if so, we should probably open a bug to do the same for the immutable collections.
See
corefx/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList`1.cs
Line 1151 in dd703af
throw new NotSupportedException(); |
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 this component should follow the conventions used by the larger framework, i.e. include exception message. Both for consistency, and so we can explain in the message how to test for whether these operations are supported or not (point people to the IsReadOnly property).
please test this |
Implement IList<T>, IReadOnlyList<T>, and IList on CaptureCollection, GroupCollection, and MatchCollection.
This is the same exception message used by ReadOnlyCollection<T>.
Also rearranged some members
@justinvp. We've changed our branching strategy in a way that impacts this PR. When you're ready to continue work on this, you'll need to either recreate the PR against the 'future' branch or wait until after we have snapped the first release branch before we can merge it in to master. See https://github.com/dotnet/corefx/wiki/branching-guide |
Closing this. I'll open a new PR against the 'future' branch. |
Add link for Windows Server Hosting installer
Fixes #271
This is still a work-in-progress.
TODO
IList<T>
,IReadOnlyList<T>
, andIList
RegexCollectionDebuggerProxy
Questions/Notes
GroupEnumerator
is internal, so it might be possible to change the type ofGroupEnumerator.Capture
fromCapture
toGroup
. This would make the explicit cast in the genericCurrent
property unnecessary.