| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
August 01, 2017 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.
| ||||
August 01, 2017 Re: Adding deprecated to an enum member | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jeremy DeHaan | 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 | |||
August 01, 2017 Re: Adding deprecated to an enum member | ||||
|---|---|---|---|---|
| ||||
Posted in reply to dark777 | 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.
| |||
August 02, 2017 Re: Adding deprecated to an enum member | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jeremy DeHaan | 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 | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply