-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
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
try {
} finally {
switch ($foo) {
'bar' {break}
'foo' {break}
}
}Expected behavior
This should parse just fine.
Actual behavior
The parser spits out the following error:
At line:4 char:8
+ 'bar' {break}
+ ~~~~~
Flow of control cannot leave a Finally block.
At line:5 char:8
+ 'foo' {break}
+ ~~~~~
Flow of control cannot leave a Finally block.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ControlLeavingFinally
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0
PSEdition Core
GitCommitId v6.0.0
OS Microsoft Windows 10.0.17692
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0kvprasoon and mklement0
Metadata
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