Skip to content

Conversation

@elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Nov 16, 2021

Don't always add ArrayMarshaller.cs (which uses System.Memory and System.Runtime.CompilerServices.Unsafe). This stops requiring that all the libraries projects that use the source generator at all have those references (even though they may not actually need them for the generated code), such that the generator can be enabled for everything.

If the generated code does end up needing those references, it will just come through as a compilation error.

Added a check - that should be removed once we add APIs like ArrayMarshaller - so that the generator will fire a diagnostic if targeting 7.0+ and missing an API.

@AaronRobinsonMSFT @jkoritzinsky

@elinor-fung elinor-fung reopened this Nov 17, 2021
@elinor-fung elinor-fung force-pushed the enableDllImportGeneratorFilter branch from fc15022 to 8719153 Compare November 17, 2021 03:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants