diff --git a/Compiler/src/ConstantFolding.cpp b/Compiler/src/ConstantFolding.cpp index f6f98675..7c119b16 100644 --- a/Compiler/src/ConstantFolding.cpp +++ b/Compiler/src/ConstantFolding.cpp @@ -353,6 +353,8 @@ struct ConstantVisitor : AstVisitor { // INTERP CODE REVIEW: This can theoretically fold something like `debug mode: {DEBUG_MODE}` where DEBUG_MODE is true. // Is this necessary or just something we can do later? + for (AstExpr* expression : interpString->expressions) + analyze(expression); } else { diff --git a/tests/conformance/stringinterp.lua b/tests/conformance/stringinterp.lua index e691ed96..8ffe78b8 100644 --- a/tests/conformance/stringinterp.lua +++ b/tests/conformance/stringinterp.lua @@ -21,10 +21,10 @@ assertEq(`true = {true}`, "true = true") -- -- INTERP TODO: Syntax error -- -- assert(string.find(`{{ "nested braces!" }}`, "table")) --- local name = "Luau" --- assertEq(`Welcome to { --- name --- }!`, "Welcome to Luau!") +local name = "Luau" +assertEq(`Welcome to { + name +}!`, "Welcome to Luau!") local nameNotConstantEvaluated = (function() return "Luau" end)() assertEq(`Welcome to {nameNotConstantEvaluated}!`, "Welcome to Luau!")