message: refactor(core): correct typing checks when registering destroy hooks
  Making the typing filtering more explicit allows typescript to properly recognize the presence of the
  `prototype` property on the provider within the `registerDestroyHooksIfSupported` method.
  PR Close
diff: import {resolveForwardRef} from '../di/forward_ref';
  -import {ClassProvider, Provider} from '../di/interface/provider';
  +import {ClassProvider, Provider, TypeProvider} from '../di/interface/provider';
  import {isClassProvider, isTypeProvider, providerToFactory} from '../di/r3_injector';
  import {assertDefined} from '../util/assert';
  @@ -192,7 +192,7 @@ function registerDestroyHooksIfSupported(
  indexInFactory?: number) {
  const providerIsTypeProvider = isTypeProvider(provider);
  if (providerIsTypeProvider || isClassProvider(provider)) {
  - const prototype = ((provider as ClassProvider).useClass || provider).prototype;
  + const prototype = ((provider as ClassProvider).useClass || provider as TypeProvider).prototype;
  const ngOnDestroy = prototype.ngOnDestroy;
  if (ngOnDestroy) {
  const hooks = tView.destroyHooks || (tView.destroyHooks = []);
  