-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics
Description
Steps to reproduce
PS> cat .\about.ps1
$Test = 1;
switch ($NeverUsedBefore[0]) {
"a" {};
}Expected behavior
Run about.ps1 reports the correct script location.
PS> .\about.ps1
Cannot index into a null array.
At F:\tmp\about.ps1:2 char:9
+ switch ($NeverUsedBefore[0]) {
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Actual behavior
Run about.ps1 reports the wrong script location.
PS> .\about.ps1
Cannot index into a null array.
At F:\tmp\about.ps1:1 char:1
+ $Test = 1;
+ ~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics