Fields with the same name not causing a warning?

Basile B. b2.temp at gmx.com
Fri Nov 16 17:35:13 UTC 2018


On Friday, 16 November 2018 at 17:28:15 UTC, Vinay Sajip wrote:
> On Friday, 16 November 2018 at 17:08:00 UTC, Basile B. wrote:
>
>> I agree that this is almost a case of shadowing but i don't 
>> know the exact rationale for allowing this.
>
> I'm not saying it shouldn't be allowed - just that the compiler 
> could warn you about what might very well be a mistake (as it 
> was in my case) - hard to debug with printf debugging, and 
> source level debug for D is a bit thin on the ground, ISTM.

D is not a compiler that warns much. You can still open an issue 
asking for this (and the warning must be easy to add at first 
glance), but the policy applied to warnings is "compilers 
warnings are a sign of design flaws so instead of emitting one we 
should rather fix the flaw".


More information about the Digitalmars-d-learn mailing list