Skip to content

@Inject() arity not checked (DECORATOR_ARITY_WRONG) #550

Description

@Brooooooklyn

@Inject() arity is not checked in the DI paths (extract_param_dependency and siblings).

Upstream getConstructorDependencies (di.ts) reports DECORATOR_ARITY_WRONG unless @Inject is called with exactly one argument. Here @Inject() (zero args) silently falls back to the type annotation and @Inject(A, B) takes the first arg.

Only diverges on malformed decorators. Same gap likely exists wherever param decorators are parsed (injectable / directive / pipe / ng_module paths).

Found in PR #548 review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions