If I don't comment out line 19 I get: /home/c803/c821.d(19): Error: function c821.foo (ref A a) is not callable using argument types (B) /home/c803/c821.d(19): Error: cast(A)b is not an lvalue Code: http://dpaste.dzfl.pl/89f55c62 Should not work all three?