Skip to content

Commit 8ae4996

Browse files
committed
update
1 parent af027b8 commit 8ae4996

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

mdoc/Mono.Documentation/MDocUpdater.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4166,6 +4166,7 @@ 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);
41694170
}
41704171
else
41714172
{

mdoc/Mono.Documentation/Updater/Formatters/CSharpFullMemberFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ private StringBuilder AppendConstraints (StringBuilder buf, IList<GenericParamet
355355
// Handle 'allows ref struct' constraint
356356
if (isAllowsRefStruct)
357357
{
358-
if (comma || constraints.Count > 0 || isref || isvt || isnew)
358+
if (comma || constraints.Count > 0 || isnew)
359359
buf.Append(", ");
360360
buf.Append("allows ref struct");
361361
}

mdoc/mdoc.Test/MDocUpdaterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ public void Test_RunWithRefStructValidation()
269269
updater.Run(args);
270270

271271
// Assert
272-
var iRefStructProcessorPath = Path.Combine(outputDir, "RefStructDemo", "IRefStructProcessor`1.xml");
273-
var refStructHandlerPath = Path.Combine(outputDir, "RefStructDemo", "RefStructHandler.xml");
272+
var iRefStructProcessorPath = Path.Combine(outputDir, "AllowsRefStructDemo", "IRefStructProcessor`1.xml");
273+
var refStructHandlerPath = Path.Combine(outputDir, "AllowsRefStructDemo", "RefStructHandler.xml");
274274

275275
Assert.IsTrue(File.Exists(iRefStructProcessorPath));
276276
Assert.IsTrue(File.Exists(refStructHandlerPath));
@@ -286,7 +286,7 @@ public void Test_RunWithRefStructValidation()
286286
refStructHandlerDoc.Load(refStructHandlerPath);
287287
var refStructHandlerNode = refStructHandlerDoc.SelectSingleNode("//Members/Member/TypeParameters/TypeParameter/Constraints/ParameterAttribute[text()='AllowByRefLike']");
288288
Assert.IsNotNull(refStructHandlerNode, "Missing <ParameterAttribute>AllowByRefLike</ParameterAttribute> in RefStructHandler.xml");
289-
var refStructHandlerMemberSignatureNode = refStructHandlerDoc.SelectSingleNode("//Members/Member/MemberSignature[@Language='C#' and contains(@Value, 'where T : allows ref struct')]");
289+
var refStructHandlerMemberSignatureNode = refStructHandlerDoc.SelectSingleNode("//Members/Member/MemberSignature[@Language='C#' and contains(@Value, 'where T : new(), allows ref struct')]");
290290
Assert.IsNotNull(refStructHandlerMemberSignatureNode, "Missing MemberSignature with 'where T : allows ref struct' in RefStructHandler.xml");
291291
}
292292
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

mdoc/mdoc.Test/mdoc.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@
6868
<Link>SampleClasses\testImportDoc2.xml</Link>
6969
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7070
</Content>
71-
<Content Include="SampleClasses\TestUpdate\net-8.0\TestLibrary.dll">
72-
<Link>SampleClasses\TestUpdate\net-8.0\TestLibrary.dll</Link>
71+
<Content Include="SampleClasses\TestUpdate\net-8.0\AllowsRefStructDemo.dll">
72+
<Link>SampleClasses\TestUpdate\net-8.0\AllowsRefStructDemo.dll</Link>
7373
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7474
</Content>
75-
<Content Include="SampleClasses\TestUpdate\net-9.0\RefStructDemo.dll">
76-
<Link>SampleClasses\TestUpdate\net-9.0\RefStructDemo.dll</Link>
75+
<Content Include="SampleClasses\TestUpdate\net-9.0\AllowsRefStructDemo.dll">
76+
<Link>SampleClasses\TestUpdate\net-9.0\AllowsRefStructDemo.dll</Link>
7777
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7878
</Content>
7979
<Content Include="SampleClasses\TestUpdate\frameworks.xml">

0 commit comments

Comments
 (0)