"does not have a visible constructor that matches" while such a constructor exists, what am I missing?

Im getting the error “BCE0024: The type ‘unit’ does not have a visible constructor that matches the argument list ‘(UnityEngine.GameObject, float, float, int)’.” for the following code:

var attack : float = 1;
var defence : float = 1;
var hitPoints : int = 3;

var unitStats : unit = new unit (gameObject, attack, defence, hitPoints);

With this class-code:

class unit {
	var group : GameObject;
	
	var type: GameObject;
	var attack : float;
	var defence : float;
	var hitPoints : int;
	var currentHP : float;
	
	var model : GameObject [];
	
	function team(typ : GameObject, att : float, def : float, hp : int){
		type = typ;
		attack = att;
		defence = def;
		hitPoints = hp;
		currentHP = hp;
	}
	
	function team(grp : GameObject, typ : GameObject, att : float, def : float, mod : GameObject[], hp : int){
		group = grp;
		type = typ;
		attack = att;
		defence = def;
		model = mod;
		hitPoints = hp;
		currentHP = hp;
	}

I have no clue what would be the problem as to me it seems like it would be working match with the first constructor. What am I missing?

The names of your constructors do not match the name of the class… Typical copy-paste mistake

Change to:

function unit(typ : GameObject, att : float, def : float, hp : int){
   type = typ;
   attack = att;
   defence = def;
   hitPoints = hp;
   currentHP = hp;
}

function unit(grp : GameObject, typ : GameObject, att : float, def : float, mod : GameObject[], hp : int){
   group = grp;
   type = typ;
   attack = att;
   defence = def;
   model = mod;
   hitPoints = hp;
   currentHP = hp;
}