www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - Bug in VD

reply Josphe Brigmo <JospheBrigmo gmail.com> writes:
When having two loops it seems the variables are never show if 
the name is already used:

foreach(string a; x) { // a not shown in the locals or autos}

foreach(string a; y) { // a not shown }

renaming one of them to b, say, works as long as be wasn't used 
somewhere else.
Sep 14 2018
parent Rainer Schuetze <r.sagitario gmx.de> writes:
This works for me with dmd 2.081 for -m64 and -m32mscoff

void foo()
{
	string[] x = ["1"];
	foreach(string a; x) {
		auto b = a;
	}
	string[] y = ["2"];
	foreach(string a; y) {
		auto b = a;
	}
}

Please show a full example and add some details about your environment 
(e.g. compiler version, VS version, target architecture).

On 15/09/2018 00:25, Josphe Brigmo wrote:
 When having two loops it seems the variables are never show if the name 
 is already used:
 
 foreach(string a; x) { // a not shown in the locals or autos}
 
 foreach(string a; y) { // a not shown }
 
 renaming one of them to b, say, works as long as be wasn't used 
 somewhere else.
 
Sep 16 2018