tracker issue : CF-3434652

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

Parser bug in function with typo in it

| View in Tracker

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

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 01/01/2013

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Minor / Few users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Problem Description:
See the steps to reproduce. Note that I have a typo in thefunction definition: "require" instead of "required". On CF9 this correctly gives  a compile error; on CF10 it gives a runtime error of  "The STRING argument passed to the f function is not of type require"

Steps to Reproduce:
	public string function f(require string s){
		return "#reverse(s)#";

Actual Result:
See above

Expected Result:
See above

Any Workarounds:
For me to not write code with typos in it ;-). But, hey, it should give the proper compile error.

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

Watson Bug ID:	3434652

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:



How come *you* can't run that code on CF9 and see for yourself, Awdesh? Too lazy? But I'll do your work for you: The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request Invalid CFML construct found on line 2 at column 41. ColdFusion was looking at the following text: s The CFML compiler was processing: A script statement beginning with public on line 2, column 1. A cfscript tag beginning on line 1, column 2. This is correct: require string s is a syntax error. That you say the "Runtime errro looks logical and correct to me." surprises me somewhat. How can that function definition be valid syntax? The only options for an argument definition are one of: [name] (eg: f(x)) [type] [name] (eg: f(string x)) required [name] (eg: f(required x)) required [type] [name] (eg: f(required string x)) "require string x" is simply not valid syntax for an argument definition. Am I missing something? -- Adam
Comment by External U.
16796 | October 08, 2013 02:27:05 AM GMT
@Adam, Awdhesh's comment was not meant for you but for the QE.
Comment by Rupesh K.
16797 | October 08, 2013 03:20:13 AM GMT
OK... you might need to get yer processes sorted out there, and I don't think it negates my observation. Still: hopefully my clarification of the issue helped. -- Adam
Comment by External U.
16798 | October 08, 2013 03:26:41 AM GMT
A complete script support has bben added for function definition in CF10. Now multiple key-value based atttribute can be defined for function param. Earlier only limited syntax was supported for cfparam and hence above mentioned check was possible. Now the attribute type check has been moved to runtime.
Comment by Awdhesh K.
16799 | December 09, 2013 07:28:47 AM GMT
"As designed". Snort. OK, whatever. As long as it's not an issue in CF11. -- Adam
Comment by External U.
16800 | December 09, 2013 09:01:45 AM GMT