General question structs literals

My coworker was converting some CFCs from tags to script today and at the same adding some struct literals in. He came across a behavior that I didn’t expect, and I haven’t been able to find anything after a precursory bit of Googling (not sure what you search for, though).

Can anyone tell me if the code below is supposed to work or error? It currently errors, saying that “Variable FOO is undefined.”. I’m not even calling example2() which makes me think that the variables in the “args” struct literal are being bound at compile time and without regard to the other variables that will exist in the method at run time. Is that expected?

I’m on CF 9,0,1,274733

function example() {}

function example2() {
foo = ‘bar’;
example(args = {value = foo});



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

I’m on 9.0.2 and it seems to work. Is it related to