zeroc-ice / ice

All-in-one solution for creating networked applications with RPC, pub/sub, server deployment, and more.
https://zeroc.com
GNU General Public License v2.0
2.05k stars 593 forks source link

misplaced doc comment when using cs:attribute #1067

Closed pepone closed 3 years ago

pepone commented 4 years ago
/// Determines which load sampling interval to use.
    [cs:attribute:System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1712:Do not prefix enum values with type name",
     Justification = "Cannot rename for backwards compatibility")]
    enum LoadSample

The generated C# code places the doc comment in the wrong line, resulting in a warning

warning CS1587: XML comment is not placed on a valid language element

Got this with C# 4.0, we should check 3.7 too

pepone commented 3 years ago

3.7 was not copying the Slice doc comment to the generated enum, so it didn't get the warning.

Fixed slice2cs to copy enum doc comments see https://github.com/zeroc-ice/ice/commit/156107d20268ac08e7bdd57d06ab9843f14e7295