```csharp

//Its definition
 private bool IsCorrectType(Type firstValue, Type secondValue)
 {
            return firstValue.IsSubclassOf(secondValue) || firstValue == secondValue;
 }

//Where i use it.
private void DrawElementCallback(Rect rect, int index, bool isactive, bool isfocused,
            ReorderableList reorderableList)
        {
            SerializedProperty element = reorderableList.serializedProperty.GetArrayElementAtIndex(index);

            if (element.CountInProperty() == 1 && element.objectReferenceValue != null &&
                IsCorrectType(element.objectReferenceValue.GetType(), typeof(ScriptableObject))) // This gives me an error
            {
                SerializedObject localSo = new SerializedObject(element.objectReferenceValue);
                ExposeScriptableObject(element, rect, localSo);
            }
            else if (element.CountInProperty() > 1)
            {
                foreach (SerializedProperty p in element)
                {
                    DrawSingleElement(false, ref rect, p);
                }
            }
        }


private float ElementHeightCallback(ReorderableList list, int index)
        {
            SerializedObject localSo = default;
            SerializedProperty element = list.serializedProperty.GetArrayElementAtIndex(index);
            if (element.CountInProperty() == 1 && element.objectReferenceValue != null &&
                IsCorrectType(element.objectReferenceValue.GetType(), typeof(ScriptableObject))) // This gives me an error
            {
                localSo = new SerializedObject(element.objectReferenceValue);
            }

            if (CalculatePropertyHeight(element, localSo, out var propertyHeight, false)) return propertyHeight;

            propertyHeight += EditorGUI.GetPropertyHeight(element, element.isExpanded);
            foreach (SerializedProperty p in element)
            {
                propertyHeight += EditorGUI.GetPropertyHeight(p, p.isExpanded) + _spacing;
            }

            return EditorGUI.GetPropertyHeight(element, element.isExpanded) + propertyHeight;
        }
```