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