KEMBAR78
Exclude outvariable assignments within the same CommandAst when inferring variables by MartinGC94 · Pull Request #25224 · PowerShell/PowerShell · GitHub
Skip to content

Conversation

@MartinGC94
Copy link
Contributor

PR Summary

This PR updates the variable type inference to ignore the assignments made within the same CommandAst as the variable that is being inferred. This fixes scenarios like: gci 2>Variable:Demo -Path ($Demo.<Tab>) where it would previously infer that $Demo was an ErrorRecord even though it wouldn't be assigned yet during the parameter binding.

PR Context

Pulled out another PR, see: #25206 (comment)

PR Checklist

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Mar 24, 2025
@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonov iSazonov self-assigned this Mar 24, 2025
@iSazonov
Copy link
Collaborator

/azp run

@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonov
Copy link
Collaborator

@MartinGC94 Please resolve merge conflicts.

@iSazonov

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@iSazonov iSazonov enabled auto-merge (squash) March 26, 2025 17:15
@iSazonov iSazonov merged commit 0c96975 into PowerShell:master Mar 26, 2025
38 of 40 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-service bot commented Mar 26, 2025

📣 Hey @MartinGC94, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sysoiev-Yurii pushed a commit to Sysoiev-Yurii/PowerShell that referenced this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants