Skip to content

Add support for generic constraints to Actor source generator #1535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oising
Copy link

@oising oising commented May 12, 2025

Description

The actor source generator will now correctly add any type constraints to the client class. Supported:

  • where T: class
  • where T: struct
  • where T: unmanaged
  • where T: <class or interface>
  • where T: new()
  • where T: notnull

...and any legal combinations thereof.

I've added tests for a single case (single type parameter and one constraint) and a complex case (multiple type parametes and constraints.)

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1534

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@oising oising requested review from a team as code owners May 12, 2025 17:55
Signed-off-by: Oisin Grehan <[email protected]>
@oising oising force-pushed the actor-srcgen-generic-constraints branch from aa000f9 to 087f11b Compare May 12, 2025 17:58
@oising oising force-pushed the actor-srcgen-generic-constraints branch from 1fb41e7 to 435933c Compare May 12, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Actor source generator does not copy generic constraints for type parameters
1 participant