test[0u] of type bool[1u] does not have a boolean value

Namespace rswhite4 at googlemail.com
Sat Jun 29 05:41:10 PDT 2013


Is this a bug or is it just me? It seems that the compiler 
dereference wrong.
----
import std.stdio;

void foo(bool[1]* test) {
	if (test[0])
		test[0] = false;
}

void main()
{
	bool[1] test = false;
	foo(&test);
}
----
prints: Error: expression test[0u] of type bool[1u] does not have 
a boolean value

This work:
----
if ((*test)[0])
     test[0] = false;
----


More information about the Digitalmars-d-learn mailing list