Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Allow rooting a generic method in RD.XML - #4775

Merged
MichalStrehovsky merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:rdXmlMethodInst
Oct 23, 2017
Merged

MichalStrehovsky merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:rdXmlMethodInst

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Adds support for following syntax:

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <Assembly Name="repro">
      <Type Name="Program">
        <Method Name="SayHello">
          <GenericArgument Name="System.Object, System.Private.CoreLib" />
        </Method>
      </Type>
    </Assembly>
  </Application>
</Directives>

Since this is temporary code, I just twisted the RD.XML syntax a bit so that we can reuse the type string parser we have for custom attribute blobs.

Adds support for following syntax:

```xml
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <Assembly Name="repro">
      <Type Name="Program">
        <Method Name="SayHello">
          <GenericArgument Name="System.Object, System.Private.CoreLib" />
        </Method>
      </Type>
    </Assembly>
  </Application>
</Directives>
```

Since this is temporary code, I just twisted the RD.XML syntax a bit so that we can reuse the type string parser we have for custom attribute blobs.
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@sergiy-k PTAL

@sergiy-k

Copy link
Copy Markdown
Contributor

@MichalStrehovsky, thank you! I assume that you checked that this is sufficient to allow rooting the generics method from #4444 (comment) in RD.xml instead of putting it in the code?

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@MichalStrehovsky, thank you! I assume that you checked that this is sufficient to allow rooting the generics method from #4444 (comment) in RD.xml instead of putting it in the code?

I haven't actually tried with that, but the syntax should be along the lines of:

<Type Name="SharpYaml.Serialization.Descriptors.DictionaryDescriptor">
  <Method Name="GetGenericEnumerable" Dynamic="Required">
    <GenericArgument Name="System.String, System.Private.CoreLib" />
    <GenericArgument Name="System.Object, System.Private.CoreLib" />
  </Method>
</Type>

It should be possible to express anything with this syntax, unless there's multiple overloads of the method (overload handling would make this unnecessarily complicated so lets cross that bridge if we ever get there).

@MichalStrehovsky
MichalStrehovsky merged commit a9c7630 into dotnet:master Oct 23, 2017
@MichalStrehovsky
MichalStrehovsky deleted the rdXmlMethodInst branch October 23, 2017 17:22
A-And pushed a commit to A-And/corert that referenced this pull request Oct 31, 2017
Adds support for following syntax:

```xml
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <Assembly Name="repro">
      <Type Name="Program">
        <Method Name="SayHello">
          <GenericArgument Name="System.Object, System.Private.CoreLib" />
        </Method>
      </Type>
    </Assembly>
  </Application>
</Directives>
```

Since this is temporary code, I just twisted the RD.XML syntax a bit so that we can reuse the type string parser we have for custom attribute blobs.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants