-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Use culture invariant to-string convertor for lval in replace operator #10954
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
Use culture invariant to-string convertor for lval in replace operator #10954
Conversation
|
Thanks for taking this on, @iSazonov. Generally, it sounds we should follow the example of But I don't understand how |
In second case we could fall in fast way - TryFastTrackPrimitiveTypes() or IFormattable. In first case a code path is another - follow ETS at first. |
|
I see - but, speaking from observation (haven't looked a the code): Apart from |
|
@mklement0 The example is in #10389 (comment)
You confuse ETS (Extended Type System) with extensions for Formatting System (Update-TypeData vs Update-FormatData). |
|
I see - you mean an ETS-overridden So it sounds like
In the case of #10389 the ruling was to prevent a behavioral Here, it comes down to this:
I don't know what the performance implications are, but my personal recommendation would be to pick one of the following two options:
|
|
@mklement0 Great investigations! Thanks! @SteveL-MSFT Perhaps PowerShell-Committee should weight these @mklement0 's proposed options. |
|
@PowerShell/powershell-committee reviewed this. It's definitely a breaking change (@BrucePay is calling it Bucket 2: Reasonable Gray Area), but we think it's the right thing to do. Given where we're at in the release cycle, and our new snap to .NET's 1-year release cycle, we want to take this as an experimental feature into 7.1-preview.1 so we can understand the breakage and whether we need to revert to old behavior. |
034cc01 to
57e588b
Compare
|
@iSazonov Please follow the existing code pattern for adding new engine experimental features, and don't add new public API. |
It makes no sense because we can not use strong typed names out of SMA. |
If the experimental feature is not in SMA.dll, then it's not an engine feature and should not be declared in |
fb3d4a5 to
eca5759
Compare
|
@daxian-dbw Could you please continue? |
daxian-dbw
left a comment
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.
LGTM except for a comment.
|
Should we add |
|
I think we can only use 1 |
It seems Travis said me that CL-Breaking can be used with another CL- label. From releaseTools.psm1 |
|
I don't know about that, but what would you expect the script to do then? placing the same PR under both |
|
Hmm, by looking at the following code, it seems the script doesn't handle multiple labels even if PowerShell/tools/releaseTools.psm1 Lines 292 to 313 in 384a7ba
|
Here we will have an array and the switch will run for every value from the array. |
|
Ah, you are right, I totally missed that. |
src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
Show resolved
Hide resolved
This reverts commit 36d3b3c.
src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs
Show resolved
Hide resolved
|
🎉 Handy links: |
PR Summary
Fix #10948
PR Context
Options for the fix:
That is before the fix.
Makes lval conversion being culture invariant.
Current fix. Makes lval conversion being culture invariant and add PowerShell magic conversions if lval is PSObject (ex., follow ETS) See
In the case behavior is as for -match operator
The same as previous but always use PowerShell magic conversions (follow ETS).
In the case behavior is as for
-joinoperator (with performance issue because of mandatory wrapping to PSObject)PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.