Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Apr 25, 2025

Thanks to @aschackmull for making me aware, and providing the example.

Before

flowchart TD
1["enter M16"]
10["2"]
11["call to method WriteLine"]
12["...;"]
13[""1 or 2""]
14["break;"]
15["case ...:"]
16["3"]
17["call to method WriteLine"]
18["...;"]
19[""3""]
2["exit M16"]
20["break;"]
21["default:"]
22["call to method WriteLine"]
23["...;"]
24[""def""]
25["break;"]
3["exit M16 (normal)"]
4["{...}"]
5["switch (...) {...}"]
6["access to parameter i"]
7["case ...:"]
8["1"]
9["case ...:"]

1 --> 4
3 --> 2
4 --> 5
5 --> 6
6 --> 7
7 --> 8
8 -- match, no-match --> 9
9 --> 10
10 -- match --> 12
10 -- no-match --> 14
10 -- no-match --> 15
11 --> 14
12 --> 13
13 --> 11
14 -- break --> 3
15 --> 16
16 -- match --> 18
16 -- no-match --> 21
17 --> 20
18 --> 19
19 --> 17
20 -- break --> 3
21 --> 23
22 --> 25
23 --> 24
24 --> 22
25 -- break --> 3
Loading

After

flowchart TD
1["enter M16"]
10["2"]
11["call to method WriteLine"]
12["...;"]
13[""1 or 2""]
14["break;"]
15["case ...:"]
16["3"]
17["call to method WriteLine"]
18["...;"]
19[""3""]
2["exit M16"]
20["break;"]
21["default:"]
22["call to method WriteLine"]
23["...;"]
24[""def""]
25["break;"]
3["exit M16 (normal)"]
4["{...}"]
5["switch (...) {...}"]
6["access to parameter i"]
7["case ...:"]
8["1"]
9["case ...:"]

1 --> 4
3 --> 2
4 --> 5
5 --> 6
6 --> 7
7 --> 8
8 -- match --> 12
8 -- no-match --> 9
9 --> 10
10 -- match --> 12
10 -- no-match --> 15
11 --> 14
12 --> 13
13 --> 11
14 -- break --> 3
15 --> 16
16 -- match --> 18
16 -- no-match --> 21
17 --> 20
18 --> 19
19 --> 17
20 -- break --> 3
21 --> 23
22 --> 25
23 --> 24
24 --> 22
25 -- break --> 3
Loading

@github-actions github-actions bot added the C# label Apr 25, 2025
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Apr 28, 2025
@hvitved hvitved marked this pull request as ready for review April 28, 2025 06:39
@hvitved hvitved requested a review from a team as a code owner April 28, 2025 06:39
@hvitved hvitved merged commit 14445a3 into github:main Apr 28, 2025
25 checks passed
@hvitved hvitved deleted the csharp/cfg/switch-fall-through branch April 28, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants