From e43f51fc2c67c2cad15104fec0cf8a5f5992b443 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 28 Nov 2022 20:51:01 -0700 Subject: [PATCH] Update metadata to 39.0.18-preview --- Directory.Packages.props | 2 +- src/Microsoft.Windows.CsWin32/Generator.Com.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 1404bb3b..55b3daf8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,7 @@ true - 38.0.19-preview + 39.0.18-preview 0.1.7-alpha diff --git a/src/Microsoft.Windows.CsWin32/Generator.Com.cs b/src/Microsoft.Windows.CsWin32/Generator.Com.cs index 4233ffa2..dc4d80d6 100644 --- a/src/Microsoft.Windows.CsWin32/Generator.Com.cs +++ b/src/Microsoft.Windows.CsWin32/Generator.Com.cs @@ -746,11 +746,13 @@ private bool TryGetPropertyAccessorInfo(MethodDefinition methodDefinition, strin } const string getterPrefix = "get_"; - const string setterPrefix = "put_"; + const string putterPrefix = "put_"; + const string setterPrefix = "set_"; bool isGetter = methodName.StartsWith(getterPrefix, StringComparison.Ordinal); + bool isPutter = methodName.StartsWith(putterPrefix, StringComparison.Ordinal); bool isSetter = methodName.StartsWith(setterPrefix, StringComparison.Ordinal); - if (isGetter || isSetter) + if (isGetter || isPutter || isSetter) { if (!IsHresult(signature.ReturnType)) { @@ -778,8 +780,9 @@ private bool TryGetPropertyAccessorInfo(MethodDefinition methodDefinition, strin return true; } - if (isSetter) + if (isSetter || isPutter) { + Debug.Assert(setterPrefix.Length == putterPrefix.Length, "If these lengths do not equal, our Substring math may be wrong."); propertyName = SafeIdentifierName(methodName.Substring(setterPrefix.Length)); accessorKind = SyntaxKind.SetAccessorDeclaration; return true;