api-doc-tools icon indicating copy to clipboard operation
api-doc-tools copied to clipboard

Attribute signature is not correct

Open mairaw opened this issue 6 years ago • 5 comments

This is an issue brought up by @riverar on https://github.com/MicrosoftDocs/feedback/issues/298#issuecomment-444980502

Type: https://docs.microsoft.com/en-us/dotnet/api/accessibility.caccpropservicesclass

According to the docs, there is no parameter-less constructor for ClassInterfaceAttribute.

mdoc is generating this:

<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
      <AttributeName>System.Runtime.InteropServices.ClassInterface</AttributeName>
</Attribute>

Source shows those monikers actually use the constructor with the ClassInterfaceType parameter:

[ClassInterface(ClassInterfaceType.None)]

mairaw avatar Dec 06 '18 19:12 mairaw

@mairaw This source has since been changed to:

    <Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
      <AttributeName>System.Runtime.InteropServices.ClassInterface(0)</AttributeName>
    </Attribute>

So it's no longer showing as using an empty constructor ... is the value 0 correct, though?

joelmartinez avatar Mar 21 '19 19:03 joelmartinez

Hey @joelmartinez, that looks correct. 0 corresponds to ClassInterfaceType.None. The docs now show duplicate values, though:

[System.Runtime.InteropServices.ClassInterface(0)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]

Source: https://referencesource.microsoft.com/#Accessibility/Accessibility/CAccPropServicesClass.cs,10

riverar avatar Mar 22 '19 04:03 riverar

@riverar awesome, thanks for looking that up :) So it's "correct" now, but for some reason that enum value lookup didn't work (that's the only reason for the 'duplicate'). I'll leave this item open so we can investigate that and get it rendering with 100% fidelity :)

joelmartinez avatar Mar 22 '19 13:03 joelmartinez

Thanks for your help validating that @riverar!

mairaw avatar Mar 22 '19 23:03 mairaw

Internal bug logged.

mimisasouvanh avatar Jan 24 '20 19:01 mimisasouvanh