Skip to content

No source generation when annotated interface is explicitly internal #64

@madp4ul

Description

@madp4ul

Hi Stef,

i wanted to start a similar project today but aborted it since i found this and it perfectly fits the use case i had. It is really awesome, keep it up!

I found a small issue when trying it out:
The source generation only runs when the annotated interface is "public partial" or just "partial", but not when it is "internal partial". In any case it generates a public part for the interface which exposes the proxied class through a property, which means that it can also not generate proxies for internal classes. Then it tries to expose the internal class via the generated public property in the generated public interface which gives a compile error.

For the typical use case this should not be an issue, as proxies are mostly needed for classes from third party libraries, which are public anyway. And since we usually need the interface for mocking in unit tests, it also generally has to be public. Still i though i might let you know about it.

I do much appreciate this library and am thinking about suggesting to use it at work soon. I think stuff like this deserves some more attention, thank you very much for this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions