[Authoring] Allow custom overloads#1795
[Authoring] Allow custom overloads#1795dongle-the-gadget wants to merge 4 commits intomicrosoft:masterfrom
Conversation
Sergio0694
left a comment
There was a problem hiding this comment.
Is there no unit test we can add for this?
|
I think we would need a projection that doesn't have overloads, which from my understanding is none. Or possibly an IL inspector? I'm not sure if we have any ATM. |
|
Mh. I mean, changes seem fine to me, let's just see if @manodasanW thinks we need tests or not 🙂 |
|
Oh, one more thing. This change doesn't seem to work with CsWinMD (not the source generator itself), probably due to the Windows.winmd file not being imported properly, though CsWinMD is probably low priority at the moment. |
Can't we just add another pair of functions similar to this with a different method name and then use the Overload attribute on them to define the name that should be used for the overload? |
| } | ||
|
|
||
| bool alreadyHasOverload = method.TryGetAttributeWithType(Model.Compilation.GetTypeByMetadataName("Windows.Foundation.Metadata.OverloadAttribute"), out AttributeData _); | ||
| if (alreadyHasOverload) |
There was a problem hiding this comment.
I wonder if we should be skipping when there is an attribute or if we should be checking the overloaded method name in the attribute if one is set and then using that below rather than the one we generate. Once you add the test case, we should be able to see whether the overload attribute is ending up in the winmd or not.
I’m not sure how that would work for the test. Don’t we have to check the WinMD? |
Closes #1569.
Closes #667.