Change record status: 
Project: 
Introduced in branch: 
11.3.x
Introduced in version: 
11.3.0
Description: 

Before

Calling \Drupal\Core\Render\Renderer::addCacheableDependency with a $dependency parameter that did not implement \Drupal\Core\Cache\CacheableDependencyInterface would result in the page being uncacheable (max-age 0).

This is rarely what the developer intended. There are other ways to mark a page as uncacheable (e.g setting max-age to 0 explicitly)

After

In 13.0.0, the method \Drupal\Core\Render\Renderer::addCacheableDependency will be have a type hint for the $dependency argument of \Drupal\Core\Cache\CacheableDependencyInterface.

public function addCacheableDependency(array &$elements, CacheableDependencyInterface $dependency) {
Impacts: 
Module developers