January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 2013-01-10 10:49, bearophile wrote: > I agree. > And indeed that enhancement request aims to fix that little part of the > language. If you get an error if you shadowing a member variable it sounds like you need to start using naming conventions. Someone adds a new variable to a base class and suddenly your code breaks cause it use the same name for a local variable. -- /Jacob Carlborg |
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to comco | On 2013-01-10 09:37, comco wrote: > Which brings me to the question - is there any attempt to build such a > beast for the D programming language? No, not that I know about. I think it would require a complete front end to do a proper work. Yet another reason why we want a D front end available as a library. -- /Jacob Carlborg |
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 1/10/13 5:46 AM, Jacob Carlborg wrote:
> On 2013-01-10 09:37, comco wrote:
>
>> Which brings me to the question - is there any attempt to build such a
>> beast for the D programming language?
>
> No, not that I know about. I think it would require a complete front end
> to do a proper work. Yet another reason why we want a D front end
> available as a library.
Would the json output suffice?
Andrei
|
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Thursday, 10 January 2013 at 15:52:55 UTC, Andrei Alexandrescu wrote:
> On 1/10/13 5:46 AM, Jacob Carlborg wrote:
>> On 2013-01-10 09:37, comco wrote:
>>
>>> Which brings me to the question - is there any attempt to build such a
>>> beast for the D programming language?
>>
>> No, not that I know about. I think it would require a complete front end
>> to do a proper work. Yet another reason why we want a D front end
>> available as a library.
>
> Would the json output suffice?
>
> Andrei
Why not if it's good enough for ctags.
|
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 2013-01-10 16:52, Andrei Alexandrescu wrote: > Would the json output suffice? I have no idea. I would though it needed semantic analyzing to do its work. -- /Jacob Carlborg |
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | On 1/10/2013 2:18 AM, Benjamin Thaut wrote:
> But there are no such tools yet for D.
> Couldn't we add a -analyze flag to the compiler which will do such checks? Other
> compilers like the microsoft c++ compiler provide such a flag too.
The history of such flags is miserable.
Any diagnostic that gives false positives should not be in the compiler.
For example, I've run PVS-Studio over the dmd source. It produces a freakin' blizzard of false positives, where the workaround is very ugly. So, one ignores the false positives.
It's not so easy to ignore it if it is in the compiler and your company coding standards require passage with no warning messages.
|
January 10, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright: > Any diagnostic that gives false positives should not be in the compiler. I generally agree. So do you think spotting what's discussed here is going to cause many false positives? http://d.puremagic.com/issues/show_bug.cgi?id=4407 Bye, bearophile |
January 11, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Thursday, 10 January 2013 at 20:08:36 UTC, bearophile wrote:
> Walter Bright:
>
>> Any diagnostic that gives false positives should not be in the compiler.
>
> I generally agree.
> So do you think spotting what's discussed here is going to cause many false positives?
>
> http://d.puremagic.com/issues/show_bug.cgi?id=4407
>
> Bye,
> bearophile
Many? Even single possible case is enough. And it has been mentioned already - generic code gen, i.e. permutations.
|
January 16, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to mist | mist: > Many? Even single possible case is enough. And it has been mentioned already - generic code gen, i.e. permutations. Even one case is enough to kill it? Do you want to add that case in this ER, for future reference purposes? http://d.puremagic.com/issues/show_bug.cgi?id=4407 Bye, bearophile |
January 16, 2013 Re: Shadowing of members | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Wednesday, 16 January 2013 at 08:18:53 UTC, bearophile wrote:
> mist:
>
>> Many? Even single possible case is enough. And it has been mentioned already - generic code gen, i.e. permutations.
>
> Even one case is enough to kill it?
>
> Do you want to add that case in this ER, for future reference purposes?
> http://d.puremagic.com/issues/show_bug.cgi?id=4407
>
> Bye,
> bearophile
Yes and this is the very difference between compiler and static analysis tool, in my opinion. Compiler should never ever reject valid use cases, it does not matter how small chance of meeting those is.
Also I am not Walter and second question has probably been targeted wrong :)
|
Copyright © 1999-2021 by the D Language Foundation