-
Notifications
You must be signed in to change notification settings - Fork 191
Conversation
Isn't this in preview2? |
Yeah this is just cleanup, but I can make this change in preview 2 if we want |
return new PathString((string)value); | ||
} | ||
=> value is string | ||
? new PathString((string)value) |
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.
This replicates the asymmitry bug from the implicit converters:
#690
string -> PathString should use FromUriComponent(string), not new PathString(string)
We should change them both at the same time. @davidfowl
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.
Let me see if I can unify the code a bit to make that change easier
So I added a new
That both the implicit op and ConvertFrom call, but it wasn't obvious to me exactly how to write a test verifying that the round tripping issue was fixed. |
The most obvious things that are broken by the asymmetry are the equality operators. E.g. Equals, StartsWithSegments, GetHashCode, etc..
|
Added a test verifying the equality now work |
Now also fixes: #690 |
{ | ||
PathString p1 = "/?"; | ||
string s1 = p1; // Becomes "/%3F" | ||
PathString p2 = s1; // Stays "/%3F" |
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.
Stays "/%3F"
is wrong after your fix, it gets unescaped again
ping |
Yeah I'll merge this later today |
Fixes #848 #690
@Tratcher