BCE0024 error, but argument list types match provided arguments

I have a custom class that whenever I call it returns the error

Assets/Scripts/Harvest Scripts/harvestCreatureScript.js(65,33): BCE0024: The type ‘BatchItem’ does not have a visible constructor that matches the argument list ‘(CakeItem, float, int)’.

However the code for the class reads

class BatchItem {
	var name : String;
	var item : CakeItem;
	var quality : float;
	var quantity : int;
	var glazed : boolean;
	var BatchItem = function(item:CakeItem, quality:float, quantity:int){
		var WorldList : worldItemList;
	    this.name = item.name || WorldList.items.base[ WorldList.getKey(item) ].name;
	    this.item     = item;
	    this.quality  = Mathf.round( (quality * item.quality)*100) /100;
	    this.quantity = parseInt(quantity);
	    this.glazed   = false;*
	};
};

The code that calls the class reads

var cake : Object = new CakeItem( flavor, quality0.1 );
var batch:Object = new BatchItem(cake, 1.0, Mathf.Round(volume
3));

The CakeItem class is in the same script as the BatchItem, and when I call the BatchItem class with no arguments the error goes away.

That’s no how you declare a constructor. Change line 7 to:

function BatchItem(item:CakeItem, quality:float, quantity:int){