-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Add support for native cs type parameter constraints #8311
Add support for native cs type parameter constraints #8311
Conversation
Is this a case where |
Could be; although |
Add a test, please. |
|
Notes on tests:
|
Should I do this? I used |
I'm not sure, is there a reason why |
8875bd1
to
8499157
Compare
8499157
to
eb5a6f8
Compare
I updated |
Allow one to define native C# constraints from
haxe.Constraints.Constructible
orcs.Constraints.*
. This is useful when using C# APIs using such constraints for inputs; without it we need "ugly" workarounds.Supported native constraints:
where T : struct
withcs.Constraints.CsStruct
where T : class
withcs.Constraints.CsClass
where T : unmanaged
withcs.Constraints.CsUnmanaged
where T : new()
withhaxe.Constraints.Constructible<Void->Void>
For example, this:
Will result in:
See Microsoft's documentation on the subject for reference.