Template string placeholders not optimized away

Author: rx80Created Apr 28, 2022Updated Mar 12, 2026
Labelsenhancement

Compiler version: v20220405

Input code:

let x="test";
console.log(`${Math.random()}/${x}`);

Generated output with -O ADVANCED:

console.log(`${Math.random()}/${"test"}`);

Expected output:

console.log(`${Math.random()}/test`);