Skip to content

Conversation

SentryMan
Copy link
Collaborator

Now will warn when the @inject annotation is not needed

@SentryMan SentryMan added this to the 12.0 milestone Aug 22, 2025
@SentryMan SentryMan self-assigned this Aug 22, 2025
@SentryMan SentryMan added the enhancement New feature or request label Aug 22, 2025
Now will warn when the `@inject` annotation is not needed
@rbygrave
Copy link
Contributor

I don't understand the motiivation. Some people use @Inject on a constructor just to be more explicit and that would now be a warning?

What was the motivation for this?

@SentryMan
Copy link
Collaborator Author

Some people use @Inject on a constructor just to be more explicit and that would now be a warning?

It does not affect anything, so to me it's a useless addition. Even so, if you don't like it that's that (I don't care about this that much)

@SentryMan SentryMan closed this Aug 24, 2025
@rbygrave
Copy link
Contributor

Hmm, yeah there are those cases of (A) Necessary for multiple constructors case and (B) As documentation to assist people reading the code with their mental model of what is going on.

So I don't see it as harmful per se and I do think there are people who like to include it even when it's unnecessary for the documentation / learning / mental model type reasons. So yes at this stage I don't think we should actively discourage that with a compiler warning.

@SentryMan SentryMan removed this from the 12.0 milestone Aug 25, 2025
@SentryMan SentryMan deleted the inject-warn branch August 25, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants