def ensure_valid_default_value(value)
      return unless !value.nil? && types && types.none? { |type| type === value }
      raise TypeError
    end
def ensure_valid_default_value(value)
      return unless !value.nil? && types && types.none? { |type| type === value }
      raise TypeError
    end
Raise if value is non-nil and isn't one of the specified types.