The problem here is that private is getting applied to the members of IFoo, not just the declaration. This is related to bug 5110, which was fixed for structs and classes, but not interfaces.
The fix is to only allow the same attribute propagation for interfaces that is allowed for classes, and to set the default protection for interfaces to public.
https://github.com/D-Programming-Language/dmd/pull/170