Visit switch test case as scope dependency
This can't be tested yet - we only support simple, safely re-orderable values as case test values - but it will easy to overlook later so i'm adding now.
Joe Savona committed
May 1, 2023 at 08:51 UTC
5196fbd92b9fc4651164fb51bf888eb7570f8287
1 file changed
+3
-1
compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts
+3
-1
@@ -617,7 +617,9 @@ class PropagationVisitor extends ReactiveFunctionVisitor<Context> {
617
// CFG representation for fallthrough. This is safe. It only
618
// reduces granularity of dependencies.
619
for (const { test, block } of terminal.cases) {
620
- if (test == null) {
620
+ if (test !== null) {
621
+ context.visitOperand(test);
622
+ } else {
623
foundDefault = true;
624
}
625
if (block !== undefined) {