diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Any.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Any.php
index 8fe1a9a0b9..f750d9cb4d 100644
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/Any.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/Any.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\TypedData\Plugin\DataType;
 
+use Drupal\Core\TypedData\DataDefinitionInterface;
 use Drupal\Core\TypedData\TypedData;
 
 /**
@@ -25,4 +26,14 @@ class Any extends TypedData {
    */
   protected $value;
 
+  /**
+   * Overrides \Drupal\Core\TypedData\TypedData::setValue().
+   */
+  public function setValue($value, $notify = TRUE) {
+    if (is_array($value) && $value instanceof DataDefinitionInterface) {
+      throw new \InvalidArgumentException("Invalid value given, Value must not be implement DataDefinitionInterface.");
+    }
+    parent::setValue($value, $notify);
+  }
+
 }
