Repository navigation
Commit 210a89c
authored
Fix ActivityTagsCollection no-op in
The existing `((IEnumerator)_enumerator).Reset()` code creates a copy
(it's a struct), and then resets the copy, which is discarded. To fix,
we need to assign it back to `_enumerator`.
The explicit cast to `IEnumerator` is required because Reset is an
explicitly implemented function, not a part of the `List<>` API. So
`_enumerator.Reset();` does not work. But casting alone creates a copy.
Minimal reproduction project:
[activitytags-enumerator-reset.zip](https://github.com/user-attachments/files/35424457/activitytags-enumerator-reset.zip)
---
AI usage disclaimer: I encountered these .NET runtime bugs when using an
AI to work on an unrelated project. I had it fix the bugs as it went,
and now I am submitting fixes to each after manually reviewing the
changes, and fixing them as needed. Most of these lines of code are
AI-generated, including the tests and the MRP. The PR description and
commit message are entirely human-written, as is always the case with
every PR I open.Reset() function (#138299)1 parent d07456f commit 210a89c
2 files changed
Lines changed: 50 additions & 1 deletion
File tree
- src/libraries/System.Diagnostics.DiagnosticSource
- src/System/Diagnostics
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
279 | 286 | | |
280 | 287 | | |
281 | 288 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
161 | 203 | | |
162 | 204 | | |
163 | 205 | | |
| |||
0 commit comments