When returning a pointer to concrete type as a clockwork.FakeClock: return the pointer to concrete type instead.
When using clockwork.FakeClock in an interface composition: replace with the functions required by the interface.
When using clockwork.FakeClock as an argument, replace with concrete type or define a new interface.
The alternative approach would have been to use type aliases. However, this does not provide a benefit over direct replacement, because the migration is more complicated, harder to execute, needs to be done to the same code points, and results in runtime failures when type converting (whereas this approach only fails at compile-time).
This change ensures future modifications to FakeClock will not break users.
However, this change does break current users who use FakeClock as an argument, return value, or embed it in a struct or interface.
With limtied exception, build errors can be fixed by running:
Other rare build errors and their fixes are:
clockwork.FakeClock
: return the pointer to concrete type instead.clockwork.FakeClock
in an interface composition: replace with the functions required by the interface.clockwork.FakeClock
as an argument, replace with concrete type or define a new interface.The alternative approach would have been to use type aliases. However, this does not provide a benefit over direct replacement, because the migration is more complicated, harder to execute, needs to be done to the same code points, and results in runtime failures when type converting (whereas this approach only fails at compile-time).