Please report new issues athttps://github.com/DOCGroup
As far as I can tell from the spec, a typeprefix declaration can appear anywhere in an IDL file, irrespective of the scope it is applied to. This fact, plus the coexistence of mechanisms for handling typeprefix and #pragma prefix in the IDL compiler, make it a good idea to move all the prefix checking code into a separate pass over the AST, preferably run before any code generation or implied IDL processing.
Whenever there's time....