-
Notifications
You must be signed in to change notification settings - Fork 8.2k
missing property reference error ignored if followed by unary operator #9564
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-By DesignThe reported behavior is by design.The reported behavior is by design.
Description
I found this by accident, left the . property reference while testing ideas.
I think it is incorrect that this code goes without any errors, and also generates no result.
Steps to reproduce
$Departments = @'
Alpha
Beta
Gamma
Zulu
'@. -split '\r'Expected behavior
At line:6 char:4
+ '@.
+ ~
Missing property name after reference operator.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingPropertyName
Actual behavior
Exactly, nothing happens, no error, no result. Any unary operator seems to do this. A non-unary operator will generate two error messages, missing property, and unexpected token (for the right operand).
Environment data
PowerShell 6.2 on Windows 10 1809
Windows PowerShell 5.1 (same OS)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-By DesignThe reported behavior is by design.The reported behavior is by design.