Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1863,9 +1863,13 @@ inherit .containing_class_value
node @switch_case.before_scope
}

(switch_case (_)* @stmts)@switch_case {
(switch_case
value:(_)@value
(_)* @stmts)@switch_case {
if (is-empty @stmts) {
edge @switch_case.after_scope -> @switch_case.before_scope
; scopes flow into the value and then directly out of the case
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The comment uses a semicolon instead of the proper comment syntax. Should use '//' for comments in TSG files.

Suggested change
; scopes flow into the value and then directly out of the case
// scopes flow into the value and then directly out of the case

Copilot uses AI. Check for mistakes.
edge @value.before_scope -> @switch_case.before_scope
edge @switch_case.after_scope -> @value.after_scope
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ switch (x) {
/**/ x;
// ^ defined: 1
y = 2;
case 1:
case 2:
/**/ x;
// ^ defined: 1
y = 2;
default:
/**/ x;
// ^ defined: 1
Expand All @@ -17,7 +22,7 @@ switch (x) {
// Flow out

/**/ y;
// ^ defined: 10, 14
// ^ defined: 10, 15, 19

// Flow around

Expand Down