From 77882f0d0ad1d430716f397c95b283dfbaa4ff1f Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Wed, 24 Jul 2024 15:58:30 +0900 Subject: [PATCH] Add failing test --- inputs/failing/optimizerBug.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 inputs/failing/optimizerBug.ts diff --git a/inputs/failing/optimizerBug.ts b/inputs/failing/optimizerBug.ts new file mode 100644 index 0000000..71fc4bd --- /dev/null +++ b/inputs/failing/optimizerBug.ts @@ -0,0 +1,17 @@ +// //! test_output(1) + +export default function main() { + return f([1]); +} + +export function f(values: number[]): number { + const x = [ + values[0], + ]; + + if (values[0]) { + return x[0]; + } + + return 0; +}