Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[type] cast and -as [Type] malfunction with strings that contain "]" (only) #19559

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

Prerequisites

Steps to reproduce

# OK
[Type] 'int'
'int' -as [Type]

# !! BROKEN - these calls succeed, despite obviously broken input.
# Note that prepending "[" *would* fail, as expected, given that [Type] "[int]" doesn't - and shouldn't - work.
# It doesn't matter what, if anything, follows the closing-only "]"
[Type] 'int]whatever'
'int]whatever' -as [Type]

Expected behavior

Output of two [type] instances, and two errors.

Actual behavior

Output of four [int] instances. That is, the broken type names were unexpectedly accepted.

Error details

No response

Environment data

PowerShell Core 7.4.0-preview.3

Visuals

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.