Why cant i initialize my list with a class that has inherited classes?

So im making a base for an RPG. I making a a sort of spell system where you choose to use spells and attacks. Ive made a class and made to classes that inherited from the first. One for magic attack and the other for physical attacks.

The thing is when i make an instance of the scriptable object and try to initialize a list with it i get the erroe

Type connot be found: MagicDamege. Containing file and class name must match.

I was wondering if anyone knows what i did wrong please?

Attacks file

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public abstract class Attacks : ScriptableObject
{

    public string name;
    public bool targetPartyMember;
    public bool targetEnemy;
    public string details;
    public int cost;

}

[CreateAssetMenu(menuName = "Attacks/MagicAttack")]
public class MagicDamege : Attacks
{
    public string element;
    public float damageMultiplyer = 1f;
    public int damageAdder = 0;

}

[CreateAssetMenu(menuName = "Attacks/PhysicalAttack")]
public class PhysicalDamege : Attacks
{
    
    public float damageMultiplyer = 1f;
    public int damageAdder = 0;



}

List

    [SerializeField] List <Attacks> attacks;

Just re-read the error:

Containing file and class name must
match

ScriptableObject as well as MonoBehaviour derived classes need to be defined in their own script file and the “Containing file and class name must match

ps: Do not use the plural for classes that themself do not represent a collection of things. Since your class represents an attack it should be called Attack.

yes this is referring to the script name such as for instance Player.cs would be the containing file and then the public class Player : monobehaviour{ would be the class name and yes they must match.

Thanks everyone for helping. I figured it out. Apparantlly Unity doesnt like it when the inherited class is in the same script as the original. So i move each of them to thier own script and it fixed it.