Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 724 Bytes

inject-binding.md

File metadata and controls

26 lines (18 loc) · 724 Bytes
title inject-binding: Injection token disagrees with handler
description Match typed handle parameters to injected services.

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) {}