-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Fix type inference crash #19400
Fix type inference crash #19400
Conversation
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
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. Thanks for the quick fix!
* Remove FormObject.cs and FormObjectCollection.cs (PowerShell#19383) * Exclude redundant parameter aliases from completion results (PowerShell#19382) * Revert "Remove FormObject.cs and FormObjectCollection.cs (PowerShell#19383)" (PowerShell#19387) This reverts commit 190c99a. * Add the parameter `-RelativeBasePath` to `Resolve-Path` (PowerShell#19358) * Fix a crash in the type inference code (PowerShell#19400) * Remove GetResponseObject (PowerShell#19380) * Add `-Environment` parameter to `Start-Process` (PowerShell#19374) * Add `-Environment` parameter to `Start-Process` * address codefactor * fix test for Windows * handle case where value is $null to remove env var * change variables to make it more clear what the test is doing * Add PoolNames variable group to compliance pipeline (PowerShell#19408) * Improve package management acceptance tests by not going to the gallery (PowerShell#19412) * Skip VT100 tests on Windows Server 2012R2 as console does not support it (PowerShell#19413) * Update the `ICommandPredictor` interface to reduce boilerplate code from predictor implementation (PowerShell#19414) * Enable type conversion of `AutomationNull` to `$null` for assignment (PowerShell#19415) * Remove code related to `#requires -pssnapin` (PowerShell#19320) * Support CTRL-C when reading data and connection hangs for `Invoke-RestMethod` and `Invoke-WebRequest` (PowerShell#19330) * Update to the latest NOTICES file (PowerShell#19332) * Update the cgmanifest (PowerShell#19459) * WIP: Harden default command test. (PowerShell#19416)
🎉 Handy links: |
PR Summary
Fixes an infinite loop when trying to infer
$_
in the switch condition.Now a switch is only considered a parent to
$_
if the variable is after the switch condition.Also updated
VisitErrorStatement
to check for null values in the ErrorStatement.I noticed this issue while checking if the infinite loop also happened with incomplete switch statements (it doesn't).
PR Context
Fixes #19399 which was a regression added by #17716
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).