The new implementation keeps track of all global
key duplications during a build cycle, and only verifies global
key duplication at the end of the that cycle instead of
throwing an error immediately. As part of the refactoring,
we implemented a mechanism to remove previous global key
duplication in forgetChild if the rebuild had happened.
This, however, requires all Element subclasses that
override forgetChild to call the super method.

Description of change

The forgetChild of abstract class Element has a base
implementation to remove global key reservation,
and it is enforced by the @mustCallSuper meta tag.
All subclasses that override the method have to call super;
otherwise, the analyzer shows a linting error and
global key duplication detection might throw an unexpected error.

Migration guide

In the following example, an app’s Element
subclass overrides the forgetChild method.

Code before migration:

class

CustomElement

extends

Element