-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LibraryImportGenerator] Use basic forwarder in down-level support if…
… any parameters can't be marshalled (#104416) In down-level support, when determining marshalling generators for types, we fall back to just forwarding the parameter without erroring. This means that we end up generating a stub that marshal some parameters and just silently forwards others when all of these are true: - target framework is down-level (below .NET 7) - the signature is not blittable (parameters require marshalling and/or SetLastError=true) - no parameters are identified via an `ITypeBasedMarshallingInfoProvider` as missing marshalling support - at least one parameter cannot be marshalled and falls back to just forwarding the parameter This is not a problem in non-down-level scenarios, as we error if we can't marshal any parameters. This is also not a problem if any parameters are identified as unsupported via an `ITypeBasedMarshallingInfoProvider`, as we do correctly check that case and simply forward to `DllImport`. This change makes it so that in down-level scenarios, if any type falls back to forwarding, we print a basic `DllImport` instead of a stub with mixed marshalling and forwarding.
- Loading branch information
1 parent
a0f0c6c
commit 8181785
Showing
6 changed files
with
69 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters