Error: no property 'sort' for type 'ulong[string]', or sometimes not ...

Derix derix at dexample.com
Sun Oct 20 07:50:51 PDT 2013


Hi there,

So I've just stated learning D. Playing with associative arrays, 
I wrote this simple function. No big deal.

void associativeArrayFu(){
	ulong[string] arr;
	arr["foo"]=1;
	arr["bar"]=2;
	arr["foo"]=45;
	
	foreach( thing;arr.sort){
		writeln( thing );
		}
	}

Compiles and runs just fine.
Stating to have a bunch of funtions in one file, I reorganised my 
sources among several files (in the same project in Eclipse).

Now the same function yelds this error when compiling:

Error: no property 'sort' for type 'ulong[string]'

wether it is in a source file alongside other functions, alone in 
its own file, or even all alone in its own project.

Not that I care that much about this poor function, but I am 
puzzled. What did I miss ?

And oh, maybe this is not the right place for a beginner ? Is 
there any better place ?


More information about the Digitalmars-d mailing list