While Adobe introduced Sets as a data structure in ColdFusion 2025.0.8, it seems that the notion of a Set wasn't fully integrated into the type system that ColdFusion offers. You can create and consume Sets no problem — you just can't mandate a set within a param tag, a function return type, or an argument type. Doing so throws an error as of ColdFusion 2025 update 14.
Attempting to use set as a Function return type:
<cfscript>
writeDump( buildSet() );
private set function buildSet() {
return setNew();
}
</cfscript>
Throws error: "The value returned from the buildSet function is not of type set."
Attempting to use set as a CFParam type:
<cfscript>
param name="mySet" type="set" default=setNew();
writeDump( mySet );
</cfscript>
Throws error: "The type attribute has an invalid value."
Attempting to use set as a CFArgument type:
<cfscript>
writeDump( echoValue( setNew() ) );
private any function echoValue( required set mySet ) {
return mySet;
}
</cfscript>
Throws error: "The MYSET argument passed to the echoValue function is not of type set."
Attempting to use set in an isValid() call:
<cfscript>
mySet = setNew();
writeDump( isValid( "set", mySet ) );
</cfscript>
Throws error: "Valid type arguments are: any, array, Boolean, date, numeric, query, string, struct, UUID, GUID, binary, integer, float, eurodate, time, creditcard, email, ssn, telephone, zipcode, url, regex, range , component, and variableName."
Oh man, it's a bad day to be a ColdFusion Set on my blog - 3rd post this morning on Set-related bugs. I get the sense that Sets were added merely to enable the AI-related functionality; and only indirectly to be consumed by CFML developers.
Reader Comments
I logged this in the Adobe Tracker:
CF-4235670: Sets are not a valid "type" in
CFParam,CFArgument, return type, orisValid().Post A Comment — ❤️ I'd Love To Hear From You! ❤️
Post a Comment →