D - function pointers not working

Whenever I try to use function pointers (both the c and d way) or delegates I
get an error like the following:
C:\projects\dsamples>dmd functionpointers.d
functionpointers.d(9): cannot implicitly convert int to int(*)()
which is what I get when I compile the following code (which is taken directly
from the manual):
int function() fp;
void test()
{ static int a = 7;
static int foo() { return a + 3; }
fp = foo;
}
void bar()
{
test();
int i = fp(); // i is set to 10
}
int main(char[][] args)
{
test();
return 0;
}
thx curtis

get an error like the following:
C:\projects\dsamples>dmd functionpointers.d
functionpointers.d(9): cannot implicitly convert int to int(*)()
which is what I get when I compile the following code (which is taken