Cannot add an object to a serialized field, of which type is the class named 'Object'

I have defined the class ‘Object’ in my namespace.

And I have added a serialized field, of which type is the class ‘Object’.

In that case, I cannot attach a gameObject to the field in Unity editor.

namespace Custom.Space
{
    public class Object : MonoBehaviour
    {

    }

    public class B : MonoBehaviour
    {
        [SerializeField] private Object object;
    }
}

It seems that the name of the class, ‘Object’ cannot be used as a type of a SerializeField
If I have changed the name of class ‘Object’ with another name like’ BaseObject’, it works.

Try choosing another name. Object already means UnityEngine.Object.

Otherwise, disambiguate by providing the full name of the class, Custom.Space.Object

In general Object is a TERRIBLE name to use, especially in Unity… I recommend staying away from it or you will be constantly bumping this ambiguity.