Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>

<MetadataVersion>52.0.65-preview</MetadataVersion>
<MetadataVersion>54.0.44-preview</MetadataVersion>
<WDKMetadataVersion>0.7.3-experimental</WDKMetadataVersion>
<!-- <DiaMetadataVersion>0.2.185-preview-g7e1e6a442c</DiaMetadataVersion> -->
<ApiDocsVersion>0.1.41-alpha</ApiDocsVersion>
<ApiDocsVersion>0.1.42-alpha</ApiDocsVersion>

<CodeAnalysisVersion>4.6.0</CodeAnalysisVersion>
<CodeAnalysisVersion Condition="'$(IsTestProject)'!='true'">3.11.0</CodeAnalysisVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Windows.CsWin32/Generator.Com.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ StatementSyntax InvokeVtblAndThrow() => ExpressionStatement(InvocationExpression
body: body,
semicolonToken: default);

if (methodName == nameof(object.GetType) && parameterList.Parameters.Count == 0)
if (methodName is nameof(object.GetType) or nameof(object.ToString) && parameterList.Parameters.Count == 0)
{
methodDeclaration = methodDeclaration.AddModifiers(TokenWithSpace(SyntaxKind.NewKeyword));
}
Expand Down
10 changes: 10 additions & 0 deletions test/Microsoft.Windows.CsWin32.Tests/COMTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@ public void IPersistFile_DerivesFromIComIID()
Assert.Single(iface.BaseList.Types, bt => bt.Type.ToString().Contains("IComIID"));
}

[Theory, PairwiseData]
public void ITypeNameBuilder_ToStringOverload(bool allowMarshaling)
{
const string typeName = "ITypeNameBuilder";
this.generator = this.CreateGenerator(DefaultTestGeneratorOptions with { AllowMarshaling = allowMarshaling });
Assert.True(this.generator.TryGenerateType(typeName));
this.CollectGeneratedCode(this.generator);
this.AssertNoDiagnostics();
}

[Theory]
[CombinatorialData]
public void COMInterfaceIIDInterfaceOnAppropriateTFMs(
Expand Down