tracker issue : CF-4199855

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

[ANeff] Bug for: tag vs script wrt typed array arguments

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

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

Created: 10/01/2017

Components: Language, Functions

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016.0.01.298513 / 2018,0,0,308558

Priority/Frequency: Normal / Very few users will encounter

Locale/System: / Win All

Vote Count: 2

Tag allows "." in typed array arg path. Script doesn't.

Repro:

Application.cfc
-----------
{code:java}
component {
  THIS.name = "TagVsScriptWrtTypedArrayArguments";
  THIS.mappings["/mymapping"] = expandPath("./");
}
{code}

MyCFC.cfc
-----------
{code:java}
component {}
{code}

index.cfm
-----------
{code:java}
<cffunction name="f1"><cfargument name="myArg1" type="mymapping.MyCFC[]"><cfreturn isInstanceOf(ARGUMENTS.myArg1[1], "mymapping.MyCFC")></cffunction>
<cfscript>
  o = new mymapping.MyCFC();
  function f2(mymapping.MyCFC[] myArg2) {return isInstanceOf(ARGUMENTS.myArg2[1], "mymapping.MyCFC");}
  writeDump(f1([o]));
  writeDump(f2([o]));
</cfscript>
{code}

Actual Result: coldfusion.compiler.CFMLParserBase$InvalidSimpleIdentifierException: You cannot use a variable reference with "." operators in this context

Expected Result: YES YES

Attachments:

Comments:

As mentioned in the ticket this is invalid in cfscript, but valid in tags. It should be supported in cfscript ``` function foo(required my.path.to.cfc[] it) { } ```
Vote by John W.
271 | October 01, 2017 06:39:48 PM GMT
The dotted path thing is a red herring. Even this doesn't work: public function f(A[] a){ this.a = a; } (A.cfc is in the same directory as this CFC)
Comment by Adam C.
270 | October 02, 2017 06:15:39 AM GMT