Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Sean Corfield / ()
Created: 05/23/2018
Components: Language, Closures
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: Aether Public Beta / CF2018U5
Priority/Frequency: Normal / Some users will encounter
Locale/System: Arabic / Platforms All
Vote Count: 3
Problem Description:
If a function returns a closure, and it is immediately called, that call silently doesn't happen.
Steps to Reproduce:
{code:java}
<cfscript>
function foo( n ) {
return function( m ) { return n + m; }
}
a = foo( 3 )( 4 );
writedump( a );
</cfscript>
{code}
Actual Result:
Prints out a closure object.
Expected Result:
Should print 7.
Any Workarounds:
Using an intermediate result variable:
a = foo( 3 );
a = a( 4 );
Attachments:
Comments: