Unity Crashes when i attach script to object

So whenever i attach this script Unity stops responding
Im not sure if because of my script but here is my script anyways:

public class weapon extends overWorld
{
public var ammo : int;
public var damage : int;
public var numberOfBullets : int;
public var firetype : int;
public var range :int;
public var weaponType : weaponTypes;

}

public function weapon()
{
ammo = 0;
damage = 0;
numberOfBullets = 0;
firetype = 0;
range = 0;
weaponType = weaponTypes.pistol;
}

public function weapon(amm : int, dmg : int, numOfBullets : int, rateOfFire : int, rng : int, wpnType : weaponTypes)
{
ammo = amm;
damage = dmg;
numberOfBullets = numOfBullets;
firetype = rateOfFire;
range = rng;
weaponType = wpnType;
}

public enum weaponTypes
{
sword,
pistol,
shotgun,
machinegun,
semiauto,
sniper,
}

public var sniper : weapon = new weapon(5, 5, 5, 1, 5, weaponTypes.sniper);

You need to keep the scope of the class together, you defined the class and the constructors in different scopes. I’m also not sure if overWorld extends/inherits/derives from MonoBehaviour. It should to be attached to a game object in the inspector

public class weapon extends overWorld
{
	public var ammo : int;
	public var damage : int;
	public var numberOfBullets : int;
	public var firetype : int;
	public var range :int;
	public var weaponType : weaponTypes;

	// Parameterless constructor of class weapon
	public function weapon()
	{
		ammo = 0;
		damage = 0;
		numberOfBullets = 0;
		firetype = 0;
		range = 0;
		weaponType = weaponTypes.pistol;
	}

	// Parameterized constructor of class weapon
	public function weapon(amm : int, dmg : int, numOfBullets : int, rateOfFire : int, rng : int, wpnType : weaponTypes)
	{
		ammo = amm;
		damage = dmg;
		numberOfBullets = numOfBullets;
		firetype = rateOfFire;
		range = rng;
		weaponType = wpnType;
	}

	// I'm assuming the scope of this, you will again access outside of the cass with weapson.weapsonTypes.sword for example
	public enum weaponTypes
	{
		sword,
		pistol,
		shotgun,
		machinegun,
		semiauto,
		sniper,
	}
}

public var sniper : weapon = new weapon(5, 5, 5, 1, 5, weaponTypes.sniper);