Title:
Bug 82786:(Watson Migration Closure)Cannot use metadata on arguments without specifying a default value
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Elliott Sprehn / Elliott Sprehn (Elliott Sprehn)
Created: 04/30/2010
Components: Language, CFSCRIPT
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
Cannot use metadata on arguments without specifying a default value.
Method:
function test(type name attr="1") {} // does not work
function test(type name="" attr="1") {} // does work
[vmannebo 5/3/10]
<cfscript>
//works
function foo(string name="" attr="1")
{
return "hello";
}
/**
*@name.attr1 2
*/
function bar(string name attr2="1")
{
return "hello";
}
writeoutput(foo() & "<br>");
writeoutput(bar() & "<br>");
</cfscript>
Result:
Invalid CFML construct found on line 162 at column 33.ColdFusion was looking at the following text:attrThe CFML compiler was processing:A script statement beginning with function on line 162, column 9.A cfscript tag beginning on line 1, column 2. The error occurred in /Library/WebServer/Documents/testing9/testsuite/function_declarations.cfm: line 162160 :
// Note: Can't use extra metadata if no default value provided.161 : //162 : function test(type name attr="1") {}
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041398
External Customer Info:
External Company:
External Customer Name: Elliott Sprehn
External Customer Email: 202D59C844579997992016B7
External Test Config: 04/30/2010
Attachments:
Comments: