Skip to content

Commit 7d91c75

Browse files
committed
update
1 parent 74f33a1 commit 7d91c75

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

mdoc/Mono.Documentation/MDocUpdater.Member.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ internal static void MakeTypeParameterConstraints(XmlElement root, XmlElement e,
2222
#endif
2323
GenericParameterAttributes attrs = typeParameter.Attributes;
2424

25-
XmlElement ce = null;
26-
var typeParameterNode = (XmlElement)e.SelectSingleNode($"TypeParameter[@Name='{typeParameter.Name}']");
27-
if (typeParameterNode != null)
28-
{
29-
ce = (XmlElement)typeParameterNode.SelectSingleNode("Constraints");
30-
}
25+
XmlElement ce = (XmlElement)e.SelectSingleNode("Constraints");
3126
if (attrs == GenericParameterAttributes.NonVariant && constraints.Count == 0)
3227
{
3328
if (ce != null)

mdoc/Mono.Documentation/MDocUpdater.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4166,7 +4166,6 @@ private void MakeTypeParameters (FrameworkTypeEntry entry, XmlElement root, ILis
41664166
xElement.RemoveAttribute(Consts.FrameworkAlternate);
41674167
xElement.SetAttribute(Consts.FrameworkAlternate, fxaValue);
41684168
MakeParamsAttributes(existing.Element, AttributeFormatter.PreProcessCustomAttributes(t.CustomAttributes), entry, member);
4169-
MakeTypeParameterConstraints(root, e, xElement, t);
41704169
}
41714170
else
41724171
{

mdoc/mdoc.Test/FormatterTests.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,19 @@ public void CSharpStaticEventImplementation(string typeFullName, string eventNam
601601
TestEventSignature(staticVirtualMemberDllPath, typeFullName, eventName, expectedSignature);
602602
}
603603

604+
[TestCase("AllowsRefStructDemo.IRefStructProcessor`1",
605+
"public interface IRefStructProcessor<T> where T : allows ref struct")]
606+
public void CSharpAllowsRefStructForTypeTest(string typeFullName, string expectedSignature)
607+
{
608+
var allowsRefStructDllPath = "../../../../external/Test/AllowsRefStructDemo.dll";
609+
TestTypeSignature(allowsRefStructDllPath, typeFullName, expectedSignature);
610+
}
611+
604612
[TestCase("AllowsRefStructDemo.Immutable", "Update",
605613
"public bool Update<TArg> (TArg transformerArgument) where TArg : new(), allows ref struct;")]
606-
public void CSharpAllowsRefStructTest(string typeFullName, string methodName, string expectedSignature)
614+
[TestCase("AllowsRefStructDemo.RefStructHandler", "Handle",
615+
"public void Handle<T> (ref T item) where T : new(), allows ref struct;")]
616+
public void CSharpAllowsRefStructForMemberTest(string typeFullName, string methodName, string expectedSignature)
607617
{
608618
var allowsRefStructDllPath = "../../../../external/Test/AllowsRefStructDemo.dll";
609619
TestMethodSignature(allowsRefStructDllPath, typeFullName, methodName, expectedSignature);

0 commit comments

Comments
 (0)