tracker issue : CF-4101908

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: Code Analyzer doesn't warn when assigning local to non-struct

| View in Tracker

Status/Resolution/Reason: To Fix//Investigate

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 12/20/2015

Components: Administrator

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Code Analyzer doesn't warn when assigning local to non-struct

Repro:

1) Create file containing the following:

<cfscript>
  function f() {var local=[];}
  f();
</cfscript>

2) In Code Analyzer, choose "Directory to Analyze" as the file's parent directory
3) Click "Run Analyzer"

Actual result: no warning about only being allowed to assign local to a non-struct

Expected result: a warning about only being allowed to assign local to a non-struct

This exception that CF throws when running the code could be used as a guide:
--------------------------------------------
LOCAL is explicit scope in ColdFusion 9.
You can only assign LOCAL to a struct. You cannot assign LOCAL to coldfusion.runtime.Array 
--------------------------------------------

Verified in CF11 Update 7 (build 11,0,07,296330).

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4101908

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:

Attachments:

Comments:

Oops.. Actual result: no warning about only being allowed to assign local to a non-struct Expected result: a warning about only being allowed to assign local to a non-struct should've been Actual result: no warning about only being allowed to assign local to a struct Expected result: a warning about only being allowed to assign local to a struct ("non-struct" should've been "struct" in both) Thanks!, -Aaron
Comment by External U.
5017 | January 05, 2016 04:41:47 AM GMT
Code Analyzer only checks the conflicts/compatibility issues of Functions and Tags. This type of errors are handled during runtime.
Comment by Nikhil S.
5018 | June 23, 2016 03:05:09 AM GMT
We will evaluate this for the next release (if feasible) as it involves changes to the current approach.
Comment by Vamseekrishna N.
5019 | July 20, 2016 09:38:58 PM GMT