diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php
index c347e15..802f968 100644
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -63,6 +63,17 @@ protected function getDiscovery() {
     return $this->discovery;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function processDefinition(&$definition, $plugin_id) {
+    parent::processDefinition($definition, $plugin_id);
+
+    // Typed config definitions assume a leading slash, see ::hasConfigSchema().
+    if (is_array($definition) && isset($definition['class'])) {
+      $definition['class'] = '\\' . $definition['class'];
+    }
+  }
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php
index bc8b676..e5a88de 100644
--- a/core/lib/Drupal/Core/Layout/LayoutPluginManager.php
+++ b/core/lib/Drupal/Core/Layout/LayoutPluginManager.php
@@ -80,10 +80,6 @@ public function processDefinition(&$definition, $plugin_id) {
       throw new InvalidPluginDefinitionException($plugin_id, sprintf('The "%s" layout definition must extend %s', $plugin_id, LayoutDefinition::class));
     }
 
-    // Keep class definitions standard with no leading slash.
-    // @todo Remove this once https://www.drupal.org/node/2824655 is resolved.
-    $definition->setClass(ltrim($definition->getClass(), '\\'));
-
     // Add the module or theme path to the 'path'.
     $provider = $definition->getProvider();
     if ($this->moduleHandler->moduleExists($provider)) {
diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
index 294e08b..8622db9 100644
--- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
+++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
@@ -240,14 +240,18 @@ public function useCaches($use_caches = FALSE) {
    * method.
    */
   public function processDefinition(&$definition, $plugin_id) {
-    // Only arrays can be operated on.
-    if (!is_array($definition)) {
-      return;
-    }
-
-    if (!empty($this->defaults) && is_array($this->defaults)) {
+    // Only array-based definitions can have defaults merged in.
+    if (is_array($definition) && !empty($this->defaults) && is_array($this->defaults)) {
       $definition = NestedArray::mergeDeep($this->defaults, $definition);
     }
+
+    // Keep class definitions standard with no leading slash.
+    if ($definition instanceof PluginDefinitionInterface) {
+      $definition->setClass(ltrim($definition->getClass(), '\\'));
+    }
+    elseif (is_array($definition) && isset($definition['class'])) {
+      $definition['class'] = ltrim($definition['class'], '\\');
+    }
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
index c2325d4..43464d1 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
@@ -98,6 +98,7 @@ protected function setUpEntityTypeDefinitions($definitions = []) {
 
       // Give the entity type a legitimate class to return.
       $entity_type->getClass()->willReturn($class);
+      $entity_type->setClass($class)->willReturn($entity_type->reveal());
 
       $definitions[$key] = $entity_type->reveal();
     }
diff --git a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
index b3f0151..db06578 100644
--- a/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Menu\ContextualLinkDefault;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\HttpFoundation\RequestStack;
 
@@ -384,7 +385,7 @@ public function testGetContextualLinksArrayByGroupAccessCheck() {
   public function testPluginDefinitionAlter() {
     $definitions['test_plugin'] = array(
       'id' => 'test_plugin',
-      'class' => '\Drupal\Core\Menu\ContextualLinkDefault',
+      'class' => ContextualLinkDefault::class,
       'title' => 'Plugin',
       'weight' => 2,
       'group' => 'group1',
diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
index 4ced547..0a6e8d4 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
@@ -438,6 +438,17 @@ public function providerTestProcessDefinition() {
       'forms' => ['configure' => 'stdClass'],
       'foo' => ['bar' => ['baz']],
     ];
+
+    $data['class_with_slashes'][] = [
+      'class' => '\Drupal\Tests\Core\Plugin\TestPluginForm',
+    ];
+    $data['class_with_slashes'][] = [
+      'class' => 'Drupal\Tests\Core\Plugin\TestPluginForm',
+      'foo' => ['bar' => ['baz']],
+    ];
+
+    $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('\Drupal\Tests\Core\Plugin\TestPluginForm');
+    $data['object_with_class_with_slashes'][] = (new PluginDefinition())->setClass('Drupal\Tests\Core\Plugin\TestPluginForm');
     return $data;
   }
 
