Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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
rolfbjarne merged 2 commits intodotnet:xcode11fromrolfbjarne:issue-6687
Aug 27, 2019

Conversation

@rolfbjarne
Copy link
Member

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:

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, 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:

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 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.

…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.
@rolfbjarnerolfbjarne added the bugIf an issue is a bug or a pull request a bug fix labelAug 26, 2019
@rolfbjarnerolfbjarne added this to thexcode11 milestoneAug 26, 2019
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥Test run failed 🔥

Test results

3 tests failed, 88 tests passed.

Failed tests

  • xammac tests/Mac Modern/Debug: BuildFailure
  • xammac tests/Mac Modern/Release: BuildFailure
  • xammac tests/Mac Modern/Release: BuildFailure

…just fine for this test.Fixes the test build on macOS.
@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
Test run succeeded

@rolfbjarnerolfbjarne merged commit73ce0f8 intodotnet:xcode11Aug 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dalexsotodalexsotodalexsoto approved these changes

+3 more reviewers

@spouliotspouliotspouliot approved these changes

@mandel-macaquemandel-macaquemandel-macaque approved these changes

@VincentDondainVincentDondainVincentDondain approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

bugIf an issue is a bug or a pull request a bug fix

Projects

None yet

Milestone

xcode11

Development

Successfully merging this pull request may close these issues.

6 participants

@rolfbjarne@monojenkins@dalexsoto@spouliot@mandel-macaque@VincentDondain

[8]ページ先頭

©2009-2025 Movatter.jp