Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Make DispatchProxy declares Property and EventInfos of the interface #9546

Merged
1 commit merged into from
Jun 23, 2016

Conversation

yfakariya
Copy link
Contributor

This commit is implementation of issue #9220.
This adds code to declare properties and events to generating proxy type
as well as accessor methods.
Because declaring properties and events requires accessor methods,
this commit changes AddMethodImpl to return created MethodBuilder.

@dnfclas
Copy link

dnfclas commented Jun 20, 2016

Hi @yfakariya, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@dnfclas
Copy link

dnfclas commented Jun 20, 2016

@yfakariya, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

foreach (MethodInfo mi in iface.GetRuntimeMethods())
{
AddMethodImpl(mi);
var mdb = AddMethodImpl(mi);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding guidelines: "var" can only be used when the RHS unambiguously reveals the type ("new Foo()", "(IFoo)x").

@ghost
Copy link

ghost commented Jun 21, 2016

Aside from the name suggestion, LGTM. Please squash into a single commit.

@weshaggard
Copy link
Member

cc @roncain

@yfakariya yfakariya force-pushed the dispatchproxy-emit-properties-and-events branch 2 times, most recently from 0d2309e to 935c847 Compare June 22, 2016 13:28
@yfakariya
Copy link
Contributor Author

I've re-push package with conflict resolution of project.json of the test projects. No contents has been changed after 0d2309e without the project.json.

@ghost
Copy link

ghost commented Jun 22, 2016

cc @roncain

Ron, are you planning any feedback on this? I don't have any further issues but I need a second signoff from within .dotnet.

@yfakariya yfakariya force-pushed the dispatchproxy-emit-properties-and-events branch from 935c847 to a425ede Compare June 23, 2016 13:58
@yfakariya
Copy link
Contributor Author

I've re-push package with conflict resolution of project.json of the test projects. No contents has been changed after 0d2309e without the project.json. If you are busy to review, please tell me. I hold back resolving the conflict if it is noisy for you.

@ghost
Copy link

ghost commented Jun 23, 2016

Looks like the repo updated project.json again so I'll need you to do one more conflict resolution and pre-push - then I'll merge the PR. Everyone has had days to give feedback so I'll take silence as consent.

@yfakariya yfakariya force-pushed the dispatchproxy-emit-properties-and-events branch from a425ede to 5b4508a Compare June 23, 2016 15:03
This commit adds code to declare properties and events
to generating proxy type as well.

Note
* Because declaring properties and events requires accessor methods,
  this commit changes AddMethodImpl to return created MethodBuilder.
* This declares EqualityComparer for MethodInfo to avoid reference based
  comparison.
* The test case now uses System.Reflection.Emit to generate the event
  with raise_ method which is not supported in C#.
@yfakariya yfakariya force-pushed the dispatchproxy-emit-properties-and-events branch from 5b4508a to e8f650d Compare June 23, 2016 15:09
@yfakariya
Copy link
Contributor Author

Sure, I've re-pushed with conflict resolve. Thank you for gracious reviews and responses.

@ghost ghost merged commit 8d2ac6f into dotnet:master Jun 23, 2016
@yfakariya yfakariya deleted the dispatchproxy-emit-properties-and-events branch June 23, 2016 15:29
@@ -20,7 +22,6 @@
"netstandard1.3": {}
},
"supports": {
"coreFx.Test.netcore50": {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect netcore50 needed to be removed because you took a dependency on Reflection.Emit. That will block these tests from running in .NET Native.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It is required to test raise_Xxxbecause C# code cannot emit raise_ methods of events.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at a future point we may need to split these tests into 2 projects to enable us to run the majority on both .NET Core and .NET Native.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for follow-up.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants