Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
February 16, 2007 deprecated alias | ||||
---|---|---|---|---|
| ||||
Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored? Is this intentional? |
February 16, 2007 Re: deprecated alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to kris | kris escribió: kris escribió: > Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored? > > Is this intentional? > Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored? > > Is this intentional? As far as I know, *any* declaration (imports, typedefs, static asserts, debug, version, etc.) allow *any* modifier. I don't know if it's intentional, but at least that's the way the DMD parser works. I guess this makes the parser faster than worrying about this things, but that's just a guess. |
February 17, 2007 Re: deprecated alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Manzana | Ary Manzana wrote:
> kris escribió:
> kris escribió:
>
>> Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored?
>>
>> Is this intentional?
>
>
>> Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored?
>>
>> Is this intentional?
>
>
> As far as I know, *any* declaration (imports, typedefs, static asserts, debug, version, etc.) allow *any* modifier. I don't know if it's intentional, but at least that's the way the DMD parser works. I guess this makes the parser faster than worrying about this things, but that's just a guess.
Hehe ... just want to know if deprecated is intended to work with alias or not? And if so, can we expect a fix for it soon?
:)
|
February 17, 2007 Re: deprecated alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to kris | On Fri, 16 Feb 2007 16:37:40 -0500, kris <foo@bar.com> wrote:
> Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored?
>
> Is this intentional?
I did notice deprecated isn't working in all cases, and it seemed to me that it's only working when accessing deprecated things in other code. It might just be a bug and isn't quite happening this way, but it's what I got from it, and I realized it would be a decent way of handling it.
If my code accesses a deprecated thing from within the same file, it's quite OK; like private. It's probably just happening to support the deprecated feature. e.g. a deprecated function calling another deprecated function in the same file shouldn't require -d; it might be just a stub with different parameters calling the full implementation, or calling a helper function that is also deprecated, in order to continue supporting a deprecated feature.
|
February 17, 2007 Re: deprecated alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Miller | Chris Miller wrote: > On Fri, 16 Feb 2007 16:37:40 -0500, kris <foo@bar.com> wrote: > >> Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored? >> >> Is this intentional? > > I did notice deprecated isn't working in all cases, and it seemed to me > that it's only working when accessing deprecated things in other code. It > might just be a bug and isn't quite happening this way, but it's what I > got from it, and I realized it would be a decent way of handling it. > If my code accesses a deprecated thing from within the same file, it's > quite OK; like private. It's probably just happening to support the > deprecated feature. e.g. a deprecated function calling another deprecated > function in the same file shouldn't require -d; it might be just a stub > with different parameters calling the full implementation, or calling a > helper function that is also deprecated, in order to continue supporting a > deprecated feature. I tried to test this, and the compiler did not pick up the deprecated alias if used in the client code. An additional factor that may have played a role in this particular test was that it was a .di file. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango |
February 17, 2007 Re: deprecated alias | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Ivar Igesund | Lars Ivar Igesund wrote: > Chris Miller wrote: > >> On Fri, 16 Feb 2007 16:37:40 -0500, kris <foo@bar.com> wrote: >> >>> Syntactically, the compiler allows "deprecated alias foo bar;" but the deprecated attribute is apparently ignored? >>> >>> Is this intentional? >> >> I did notice deprecated isn't working in all cases, and it seemed to me >> that it's only working when accessing deprecated things in other code. It >> might just be a bug and isn't quite happening this way, but it's what I >> got from it, and I realized it would be a decent way of handling it. >> If my code accesses a deprecated thing from within the same file, it's >> quite OK; like private. It's probably just happening to support the >> deprecated feature. e.g. a deprecated function calling another deprecated >> function in the same file shouldn't require -d; it might be just a stub >> with different parameters calling the full implementation, or calling a >> helper function that is also deprecated, in order to continue supporting >> a deprecated feature. > > I tried to test this, and the compiler did not pick up the deprecated alias if used in the client code. An additional factor that may have played a role in this particular test was that it was a .di file. > Actually it did, but not the way I expected. If you use the declared symbol, not the alias, then you will get a deprecation message. Starts to sound like a bug. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango |
Copyright © 1999-2021 by the D Language Foundation