Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Brad Brewer
Ben Nadel at InVision In Real Life (IRL) 2018 (Hollywood, CA) with: Brad Brewer

Set Is Not A Param, Return, Or Argument "Type" In ColdFusion 2025.0.14

By
Published in — Comments (4)

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.

Want to use code from this post? Check out the license.

Reader Comments

327 Comments

I intended to search for and review the Adobe ColdFusion 25 Docs regarding this, but as I googled it, I got this AI answer which I thought was interesting. If you'd rather not approve this comment because it's mostly AI, I'd totally understand. But it seemed worth sharing.

  • Argument & Return Types: Specifying set as an argument type or returntype causes ColdFusion to look for a ColdFusion Component named set.cfc, throwing a type mismatch error unless such a CFC exists.
  • <cfparam> / param: Passing type="set" throws an invalid data type exception because set is not registered in the allowed <cfparam> type list.

Recommended Workaround: Use any in your function signature or param statement, and enforce the type manually using the built-in isSet() function:

// 1. Argument & Return Type Enforcement
public any function mergeUniqueTags(required any primaryTags, required any secondaryTags) {
    if (!isSet(arguments.primaryTags) || !isSet(arguments.secondaryTags)) {
        throw(type="InvalidArgument", message="Both arguments must be ColdFusion Sets.");
    }

    var combined = setUnion(arguments.primaryTags, arguments.secondaryTags);

    if (!isSet(combined)) {
        throw(type="InvalidReturnType", message="Expected a Set return value.");
    }

    return combined;
}

// 2. Param Enforcement
param name="variables.activeIds" type="any" default="#setNew()#";
if (!isSet(variables.activeIds)) {
    throw(type="InvalidType", message="variables.activeIds must be a Set.");
}

ColdFusion DataTypes Reference - CFDocs

16,338 Comments

The crazy part is that the isSet() function isn't even listed in the Decision Functions docs. I appreciate that Adobe is trying to move faster, more releases == more good stuff for us to play with. But with Sets, the integration has left something to be desired.

Post A Comment — I'd Love To Hear From You!

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
— Ben Nadel
Managed ColdFusion hosting services provided by:
xByte Cloud Logo