Why can't I cast Editor.target to my CustomEditor type?

I’m getting the error: “Cannot convert type UnityEngine.Object' to Mask’”
when trying to cast Editor.target to my CustomEditor type. Why?

using UnityEngine;
using UnityEditor;
using System.Collections;

[UnityEditor.CustomEditor(typeof(Mask))]
public class MaskEditor : UnityEditor.Editor {

	public override void OnInspectorGUI()
	{
		Mask mask = (Mask) target;
		// ... Draw something with EditorGUILayout static methods ...
	}
	
}

Mask is a simple class which doesn’t extends nothing and has a System.Serializable annotation.

target refers to an actual UnityEngine.Object. If Mask is not convertible to that, it won’t work. Use SerializableObject instead to successfully iterate over a custom serializable class.