Re: Adding deprecated to an enum member
On Tuesday, 1 August 2017 at 01:12:28 UTC, Jeremy DeHaan wrote: I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: [...] It's a bug [1]. [1] https://issues.dlang.org/show_bug.cgi?id=9395
Re: Adding deprecated to an enum member
On Tuesday, 1 August 2017 at 02:06:27 UTC, dark777 wrote: I did as follows using deprecated may help you to elucidate in relation to this https://pastebin.com/NEHtWiGx Deprecating an entire module isn't really a solution though. I only want parts of an existing enum to be deprecated when they are used.
Re: Adding deprecated to an enum member
On Tuesday, 1 August 2017 at 01:12:28 UTC, Jeremy DeHaan wrote: I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: enum PrimitiveType { Points, Lines, LineStrip, Triangles, TriangleStrip, TriangleFan, Quads, deprecated("Use LineStrip instead.") LinesStrip = LineStrip, deprecated("Use TriangleStrip instead.") TrianglesStrip = TriangleStrip, deprecated("Use TriangleFan instead.") TrianglesFan = TriangleFan } PrimitiveType ptype = LinesStrip; //error, Use LineStrip instead. I did as follows using deprecated may help you to elucidate in relation to this https://pastebin.com/NEHtWiGx
Adding deprecated to an enum member
I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: enum PrimitiveType { Points, Lines, LineStrip, Triangles, TriangleStrip, TriangleFan, Quads, deprecated("Use LineStrip instead.") LinesStrip = LineStrip, deprecated("Use TriangleStrip instead.") TrianglesStrip = TriangleStrip, deprecated("Use TriangleFan instead.") TrianglesFan = TriangleFan } PrimitiveType ptype = LinesStrip; //error, Use LineStrip instead.