diff --git a/core/lib/Drupal/Core/Form/FormStateInterface.php b/core/lib/Drupal/Core/Form/FormStateInterface.php
index f990cdc0df88371fc72fc5bb0f7da1b2ba4df29e..d517666cf29bfc88a7c10b92181dfd8095112c48 100644
--- a/core/lib/Drupal/Core/Form/FormStateInterface.php
+++ b/core/lib/Drupal/Core/Form/FormStateInterface.php
@@ -536,7 +536,7 @@ public static function hasAnyErrors();
    *   element is ['foo', 'bar', 'baz'] then you may set an error on 'foo'
    *   or 'foo][bar][baz'. Setting an error on 'foo' sets an error for every
    *   element where the #parents array starts with 'foo'.
-   * @param string $message
+   * @param string|\Stringable $message
    *   (optional) The error message to present to the user.
    *
    * @return $this
@@ -548,7 +548,7 @@ public function setErrorByName($name, $message = '');
    *
    * @param array $element
    *   The form element.
-   * @param string $message
+   * @param string|\Stringable $message
    *   (optional) The error message to present to the user.
    *
    * @return $this