Skip to content

Conversation

@monkey0506
Copy link
Owner

This PR will implement the Runtime fallbacks feature as described in #21, and fixes #24.

Runtime fallbacks

  • CallingConvention callingConvention
  • MarshalAsAttribute? marshalReturnAs
  • MarshalAsAttribute?[]? marshalParamsAs
  • Remove diagnostics
    • NGD1001 - Invalid MarshalAsAttribute argument (not statically parsable)
    • NGD1002 - Invalid CallingConvention argument
    • NGD1003 - Invalid MarshalAsAttribute[] argument (spread element is not supported)

@monkey0506 monkey0506 added the enhancement New feature or request label Oct 5, 2024
@monkey0506 monkey0506 added this to the v2.0.0 milestone Oct 5, 2024
@monkey0506 monkey0506 self-assigned this Oct 5, 2024
@monkey0506 monkey0506 linked an issue Oct 5, 2024 that may be closed by this pull request
@monkey0506
Copy link
Owner Author

I had remembered the way that the incremental-generator branch was caching the MarshalAsAttribute parameters incorrectly. That branch still required these parameters to be compile-time constant expressions, because, of course, the implementation class has to be able to produce those attributes in the generated source code. The CallingConvention can be handled at runtime, but the marshalling will still have to be handled in the same way.

There might be more opportunities to expand on what values are permitted (e.g., reading a value set in a static constructor), but for now this PR is defunct. A new PR will be made for the CallingConvention changes.

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.

Implement runtime fallbacks

2 participants