KEMBAR78
Type inference should handle [ref] · Issue #18759 · PowerShell/PowerShell · GitHub
Skip to content

Type inference should handle [ref] #18759

@MartinGC94

Description

@MartinGC94

Summary of the new feature / enhancement

Some .NET methods use "out" to return a value to variables, in PowerShell we can use [ref] to capture that output like this:

$Tokens = $null
$Errors = $null
$Ast = [System.Management.Automation.Language.Parser]::ParseInput("Hello", [ref] $Tokens, [ref] $Errors)

The type inference should be able to detect this and infer the type for such variables.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the product

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions