diff --git a/packages/compiler-cli/src/ngtsc/switch/src/switch.ts b/packages/compiler-cli/src/ngtsc/switch/src/switch.ts index 8c1dfe3e81..5b8c1507d3 100644 --- a/packages/compiler-cli/src/ngtsc/switch/src/switch.ts +++ b/packages/compiler-cli/src/ngtsc/switch/src/switch.ts @@ -42,6 +42,7 @@ function flipIvySwitchInFile(sf: ts.SourceFile): ts.SourceFile { // Only update the statements in the SourceFile if any have changed. if (newStatements !== undefined) { + sf = ts.getMutableClone(sf); sf.statements = ts.createNodeArray(newStatements); } return sf;