Bug with associative array properties - new in v2.064.2

Gary Willoughby dev at nomad.so
Wed Nov 13 02:47:59 PST 2013


	import std.stdio;

	void main(string[] args)
	{
		int[string] a;

		auto b = a.sizeof;
		auto c = a.length;
		auto d = a.dup;
		auto e = a.keys;
		auto f = a.values;
		a.rehash;
	}

Compile with: rdmd -property test.d

Output:

test.d(7): Error: not a property a.dup
test.d(8): Error: not a property a.rehash
Failed: 'dmd' '-property' '-v' '-o-' 'test.d' '-I.'

Is this intended behaviour now? dup and rehash not being marked 
as a property? or is this a regression?

Dynamic arrays compile fine with: rdmd -property test.d

	import std.stdio;

	void main(string[] args)
	{
		int[] a;

		auto b = a.sizeof;
		auto c = a.length;
		auto d = a.ptr;
		auto e = a.dup;
		auto f = a.idup;
		auto g = a.reverse;
		auto h = a.sort;
	}


More information about the Digitalmars-d-learn mailing list