GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — Add type inference for $_ in -replace scriptblock by MartinGC94 · Pull Request #28329 · PowerShell/PowerShell Conversation
|
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Replacement callback detection incorrectly assigns Match to eagerly invoked scriptblocks and misses array-literal callbacks, producing incorrect or missing type inference for $_.
Adds type inference for $_ inside -replace scriptblocks, enabling PowerShell’s inference engine to recognize it as System.Text.RegularExpressions.Match.
Changes:
Match type.| File | Description |
|---|---|
test/powershell/engine/Api/TypeInference.Tests.ps1 |
Tests $_ type inference inside a replacement callback. |
src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs |
Adds replacement-context detection and Match inference. |
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.