Status/Resolution/Reason: Closed/Withdrawn/AsDesigned
Reporter/Name(from Bugbase): Doug Giles / Doug Giles (Doug Giles)
Created: 04/29/2016
Components: Language, Functions
Versions: 2016
Failure Type:
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Normal / Few users will encounter
Locale/System: ALL / Windows 7 SP1 64-bit
Vote Count: 0
Problem Description:
Null variables with same name as property are not resolved correctly
If a local variable is declared in a function in a CFC, and the local variable has the same name as a property in the CFC, and has a null value, CF 2016 appears to access the value of the property instead of the value of the local variable where the local variable is in scope.
Steps to Reproduce:
A zip file is attached that demonstrates the bug. The zip file contains 3 files:
+ Application.cfc
+ index.cfm
+ artist.cfc
The demo uses the cfartgallery datasource.
Running the demo in CF 9 and CF 2016 produces different results.
The new searchImplicitScopes application variable in CF 2016 does not appear to affect the results.
Actual Result:
In CF 2016, the IsNull() function seems to access the value of the property (instead of the local variable).
Expected Result:
In CF 2016, the IsNull() function seems to correctly access the value of the local variable.
Any Workarounds:
A workaround would be to not use local variables that have the same name as a property. That might not be a realistic workaround for users who have a large codebase and want to upgrade to CF 2016.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4146924
External Customer Info:
External Company:
External Customer Name: Doug Giles
External Customer Email:
External Test Config: My Hardware and Environment details:
CF 2016: Windows 7 SP1 VM, 32-bit; ColdFusion 2016,0,0,298074
CF 9: Windows 7 SP1, 64-bit; ColdFusion 9,0,2,282541
Attachments:
- April 29, 2016 00:00:00: 1_cf2016-bug-demo.zip
Comments: