On Sat, Jun 15, 2019 at 9:02 AM Sebastian Bergmann <sebast...@php.net> wrote:
> Am 13.06.2019 um 18:48 schrieb Nikita Popov: > > An update on this: The last part of covariance support has landed [1] a > few > > days ago and is part of 7.4 alpha 1. As already described, full variance > is > > only supported in conjunction with autoloading. When working in a single > > file or with explicit includes, the requirement that classes need to be > > declared before being referenced (including reference in variant type > > declarations) remains. > > Does "only supported in conjunction with autoloading" mean that covariance > is not (completely) supported when preloading is used? > Preloading is indeed currently limited to DAG class references (this includes class references in inheritance, in types and in constant expressions). Of course, it will fall back transparently to autoloading for the cases it cannot handle. If you run into this in practice (due to covariance or other reasons), feel free to report a bug -- there's some low hanging fruit in terms of restrictions we can remove. Nikita