Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 817 Bytes

inject-binding.md

File metadata and controls

26 lines (18 loc) · 817 Bytes
title inject-binding: Injection token disagrees with handler
description Resolve Arc TypeScript inject-binding diagnostics by matching @inject tokens to command handler parameter counts and provable constructor types.

What

The count or provable constructor instance type of a class-valued @inject token disagrees with handle parameters. Rule: arc-core/inject-binding (type comparisons require type information; count checks do not).

Why

Arc binds positional tokens. One extra leading handler parameter can consume an implicit value only when the command defines provide(); other mismatches cause a runtime dependency error. Opaque tokens are left to the runtime.

Bad

@inject(OtherService)
handle(tasks: Tasks) {}

Good

@inject(Tasks)
handle(tasks: Tasks) {}