Skip to content

Factory and proxy open-generic checks miss inferred registrations #62

Description

@dukesteen

INJ0008 and INJ0012 detect UseProxyFactory and Factory when an open generic is written explicitly as an unbound ServiceType, but they miss equivalent registrations inferred from the attributed generic class and its registration strategy.

For example, a generic class using ImplementedInterfaces or an assembly-wide default can still describe an open-generic registration without spelling ServiceType = typeof(...). With UseProxyFactory = true or Factory = nameof(...), the generator drops the registration, but neither diagnostic fires.

Expected: determine whether the resulting descriptor is open after applying RegistrationStrategy and defaults, then report INJ0008 or INJ0012 consistently before generation drops it.

Please cover both per-attribute and assembly-default strategies.

Found while addressing review feedback on the documentation-site rewrite.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions