Repository: angular/angular
File: packages/core/src/di/r3_injector.ts (TypeScript)

Code before:
          throwMixedMultiProviderError();
        }
      } else {
        multiRecord = makeRecord(undefined, NOT_YET, true);
        multiRecord.factory = () => injectArgs(multiRecord!.multi!);
        this.records.set(token, multiRecord);
      }
      token = provider;
      multiRecord.multi!.push(provider);
    } else {
      if (ngDevMode) {
        const existing = this.records.get(token);
        if (existing && existing.multi !== undefined) {
          throwMixedMultiProviderError();
        }
      }
    }
    this.records.set(token, record);
  }

  private hydrate<T>(token: ProviderToken<T>, record: Record<T>, flags: InternalInjectFlags): T {
    const prevConsumer = setActiveConsumer(null);
    try {
      if (record.value === CIRCULAR) {
        throw cyclicDependencyError(ngDevMode ? stringify(token) : '');
      } else if (record.value === NOT_YET) {
        record.value = CIRCULAR;

        if (ngDevMode) {
          runInInjectorProfilerContext(this, token as Type<T>, () => {
            emitInjectorToCreateInstanceEvent(token);
            record.value = record.factory!(undefined, flags);
            emitInstanceCreatedByInjectorEvent(record.value);
          });
        } else {
          record.value = record.factory!(undefined, flags);
        }
      }
      if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
        this._ngOnDestroyHooks.add(record.value);
      }
      return record.value as T;
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }

  private injectableDefInScope(def: ɵɵInjectableDeclaration<any>): boolean {
    if (!def.providedIn) {
      return false;
    }

Review comment (suggestion):
We have a similar case here; the value is only used for dev mode.
https://github.com/angular/angular/blob/63d828aa339365b7b563b42eec9c0b27a33babf0/packages/core/src/render3/errors_di.ts#L24-L27

Code after:
        if (ngDevMode && multiRecord.multi === undefined) {
          throwMixedMultiProviderError();
        }
      } else {
        multiRecord = makeRecord(undefined, NOT_YET, true);
        multiRecord.factory = () => injectArgs(multiRecord!.multi!);
        this.records.set(token, multiRecord);
      }
      token = provider;
      multiRecord.multi!.push(provider);
    } else {
      if (ngDevMode) {
        const existing = this.records.get(token);
        if (existing && existing.multi !== undefined) {
          throwMixedMultiProviderError();
        }
      }
    }
    this.records.set(token, record);
  }

  private hydrate<T>(token: ProviderToken<T>, record: Record<T>, flags: InternalInjectFlags): T {
    const prevConsumer = setActiveConsumer(null);
    try {
      if (record.value === CIRCULAR) {
        throw cyclicDependencyError(ngDevMode ? stringify(token) : '');
      } else if (record.value === NOT_YET) {
        record.value = CIRCULAR;

        if (ngDevMode) {
          runInInjectorProfilerContext(this, token as Type<T>, () => {
            emitInjectorToCreateInstanceEvent(token);
            record.value = record.factory!(undefined, flags);
            emitInstanceCreatedByInjectorEvent(record.value);
          });
        } else {
          record.value = record.factory!(undefined, flags);
        }
      }
      if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
        this._ngOnDestroyHooks.add(record.value);
      }
      return record.value as T;
    } finally {
      setActiveConsumer(prevConsumer);
    }
  }

  private injectableDefInScope(def: ɵɵInjectableDeclaration<any>): boolean {
    if (!def.providedIn) {
      return false;