You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't mutating the ScopeId on static readonly IPAddress fields (#115456)
The Address field was made readonly in dotnet/corefx#33531. Somehow ScopeId,
the only other mutatable property, was missed. I did not see discussion of
this in that PR or the related issue.
An example program that illistrates the problem:
```csharp
Console.WriteLine(IPAddress.IPv6Loopback);
IPAddress.IPv6Loopback.ScopeId = 1;
Console.WriteLine(IPAddress.IPv6Loopback);
```
This prints:
```txt
::1
::1%1
```
I think the right behavior is to throw when setting the ScopeId (this pr).
Contributes to #27870
0 commit comments