This seems like another case of the untouchable decls problem we had a thread about a while back.
Not as a obviously so, it says “refAllDecls”, and it does that. But blowing up with compile errors isn’t really the most useful semantics. Without some way to introspect a type at comptime and determine that referencing a decl will terminate compilation, it’s difficult to provide something more useful here.