tracker issue : CF-3040211

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

Bug 80194:Keys in a struct literal are incorrectly treated as keywords

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/

Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)

Created: 09/26/2009

Components: Language, CFSCRIPT

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,251028 /

Priority/Frequency: Minor / Unknown

Locale/System: English / Platforms All

Vote Count: 3

Problem:

Keys in a struct literal are incorrectly treated as keywords.Since x.contains = 1; is perfectly legal, x = { contains = 1 }; should also be perfectly legal.
Method:

Try this code:<cfset x = { contains = 1 } />It fails. Yet the following code is valid:<cfset x.contains = 1 />
Result:

Invalid CFML construct found on line 1 at column 12.ColdFusion was looking at the following text:{The CFML compiler was processing:A cfset tag beginning on line 1, column 2. The error occurred in /Library/WebServer/Documents/cf9test/contains.cfm: line 11 : <cfset x = { contains = 1 } />

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

Watson Bug ID:	3040211

External Customer Info:
External Company:  
External Customer Name: Sean Corfield
External Customer Email: 479B4EDC43F3A88B992016B6
External Test Config: 09/26/2009

Attachments:

Comments:

This bug has been voted..
Vote by External U.
22796 | November 11, 2011 12:37:42 AM GMT
+1 - I suspect the "Won't Fix" is due to Adobe's acknowledgement that some struct/array literal notation fixes "would need almost a re-write for implicit struct/array implementation" (see CF-3740276).
Vote by Aaron N.
31222 | August 26, 2019 07:29:22 AM GMT