How to pass a collection to a function?

How to pass a collection to a function?

Can't seem to figure out how to pass a collection of records to a function. Here's what I have so far. What am I missing?

// This successfully retrieves all IDs and stores them into what I think is a collection variable

defaultRecords = Data_Types[is_default == true && ID != input.ID].ID.getAll();

// If I try to pass that variable into a function, zoho complains that the argument at index '1' of function validateRecords
//does not match required data type of 'COLLECTION'. But am I not passing a collection?

test = thisapp.validateRecords(defaultRecords);

// Function, which has a collection as argument

void validateRecords(collection defaultRecords)
{

}