- Notifications
You must be signed in to change notification settings - Fork548
[registrar] Fix verification of generic parameters to accept unrelated generic types. Fixes #6687.#6850
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or 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
…d generic types.Fixesdotnet#6687.When we export generic classes to Objective-C, we verify that any genericparameters are constrained so that we know how to handle them.Example: class MyObj<T> : NSObject where T: NSObject { [Export ("foo:")] public void Foo (T obj); }in this case we verify that the parameter T is constrained to NSObject, sothat we can treat the argument like an NSObject.The problem was when the function contained a generic type which was notrelated to T: class MyObj<T> : NSObject where T: NSObject { [Export ("foo:")] public void Foo (Action<int> obj); }in which case the same logic would kick in and reject the Action<int> typesince it's not related to NSObject (no generic arguments could be found, andthe default response was 'not valid').So I've changed the default response for generic types that are unrelated tothe generic parameter we're verifying to accept such types.Fixesdotnet#6687.
dalexsoto approved these changesAug 26, 2019
spouliot approved these changesAug 26, 2019
mandel-macaque approved these changesAug 26, 2019
VincentDondain approved these changesAug 26, 2019
Collaborator
monojenkins commentedAug 26, 2019
Build failure Test results3 tests failed, 88 tests passed.Failed tests
|
…just fine for this test.Fixes the test build on macOS.
Collaborator
monojenkins commentedAug 27, 2019
Build success |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we export generic classes to Objective-C, we verify that any generic
parameters are constrained so that we know how to handle them.
Example:
in this case we verify that the parameter T is constrained to NSObject, so
that we can treat the argument like an NSObject.
The problem was when the function contained a generic type which was not
related to T:
in which case the same logic would kick in and reject the Action type
since it's not related to NSObject (no generic arguments could be found, and
the default response was 'not valid').
So I've changed the default response for generic types that are unrelated to
the generic parameter we're verifying to accept such types.
Fixes#6687.