Skip to content

Conversation

@daxian-dbw
Copy link
Member

Reverts #7151

The fix causes a problem in debugging. When stepping over the scripts in debugging mode, the debugger will stop at the switch statement condition expression twice at the very beginning -- one for evaluating the condition, and one for iterating the condition.

Here is an example:

PS:4> .\about.ps1
Entering debug mode. Use h or ? for help.

Hit Line breakpoint on 'F:\tmp\about.ps1:1'

At F:\tmp\about.ps1:1 char:1
+ $Test = 1;
+ ~~~~~~~~~
PS:4>> v
At F:\tmp\about.ps1:2 char:1
+ $b = 1..10
+ ~~~~~~~~~~
PS:4>> v
At F:\tmp\about.ps1:3 char:9
+ switch ($b) {
+         ~~
PS:4>> v
At F:\tmp\about.ps1:3 char:9
+ switch ($b) {
+         ~~
PS:4>> v
At F:\tmp\about.ps1:4 char:5
+     "a" {};
+     ~~~

@daxian-dbw daxian-dbw requested a review from BrucePay as a code owner June 26, 2018 16:43
@daxian-dbw daxian-dbw requested a review from rjmholt June 26, 2018 16:50
@@ -1,51 +0,0 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests still seem relevant though -- they do cover an existing bug and after it's fixed would check for regressions. We could keep them with a -Pending flag and track it with an issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests will be added back along with the next attempt to fix the issue.

@daxian-dbw daxian-dbw merged commit 13e925e into master Jun 26, 2018
@daxian-dbw daxian-dbw deleted the revert-7151-error-position branch June 26, 2018 19:24
Copy link
Collaborator

@BrucePay BrucePay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants