 
   See [`:erlang.process_flag/2`](http://www.erlang.org/doc/man/erlang.html#process_flag-2) for more info.
 
-  Inlined by the compiler.
-  """
-  @spec flag(process_flag, term) :: term
+  Note that `flag` values `:max_heap_size` and `:message_queue_data` are only available since OTP 19.
+
+  Inlined by the compiler.
+  """
+  @spec flag(:error_handler, module) :: module
+  @spec flag(:max_heap_size, heap_size) :: heap_size
+  @spec flag(:message_queue_data, :erlang.message_queue_data) :: :erlang.message_queue_data
+  @spec flag(:min_bin_vheap_size, non_neg_integer) :: non_neg_integer
+  @spec flag(:min_heap_size, non_neg_integer) :: non_neg_integer
+  @spec flag(:monitor_nodes, term) :: term
+  @spec flag({:monitor_nodes, term()}, term) :: term
+  @spec flag(:priority, priority_level) :: priority_level
+  @spec flag(:save_calls, 0..10_000) :: 0..10_000
+  @spec flag(:sensitive, boolean) :: boolean
+  @spec flag(:trap_exit, boolean) :: boolean
   defdelegate flag(flag, value), to: :erlang, as: :process_flag
 
   @doc """
   Sets the given `flag` to `value` for the given process `pid`.
 
   Returns the old value of `flag`.
+
+  It raises `ArgumentError` if `pid` is not a local process.
 
   The allowed values for `flag` are only a subset of those allowed in `flag/2`,
   namely `:save_calls`.

  @spec registered() :: [atom]
  defdelegate registered(), to: :erlang

  @typep process_flag :: :trap_exit | :error_handler | :min_heap_size |
                         :min_bin_vheap_size | :priority | :save_calls |
                         :sensitive
  @doc """
  Sets the given `flag` to `value` for the calling process.



  Inlined by the compiler.
  """
  @spec flag(pid, :save_calls, 0..10_000) :: 0..10_000
  defdelegate flag(pid, flag, value), to: :erlang, as: :process_flag

  @doc """
