    | MODULE TYPE OF module_expr
 Index: typing/typemod.ml
 ===================================================================
---- typing/typemod.ml	(revision 13274)
+--- typing/typemod.ml	(revision 13278)
 +++ typing/typemod.ml	(working copy)
 @@ -37,6 +37,7 @@
    | Not_a_packed_module of type_expr

       rm { mod_desc = Tmod_functor(id, name, mty, body);
            mod_type = Mty_functor(id, mty.mty_type, body.mod_type);
            mod_env = env;
@@ -845,6 +848,9 @@
         type_module (sttn && path <> None) funct_body None env sfunct in
       begin match Mtype.scrape env funct.mod_type with
         Mty_functor(param, mty_param, mty_res) as mty_functor ->
+          let impure = Ident.name param = "*" in
+          if impure && sarg.pmod_desc <> Pmod_structure [] then
+            raise (Error (sfunct.pmod_loc, Apply_impure));
           let coercion =
             try
               Includemod.modtypes env arg.mod_type mty_param
@@ -856,6 +862,7 @@
                 Subst.modtype (Subst.add_module param path Subst.identity)
                               mty_res
             | None ->

Index: parsing/parser.mly
===================================================================
--- parsing/parser.mly	(revision 13278)
+++ parsing/parser.mly	(working copy)
@@ -532,8 +532,12 @@
       { unclosed "struct" 1 "end" 3 }
