Description
The logic for whether to write an .iml file correctly skips non-packageable projects, however in generate_ipr the check is missing, and so a <module> entry is incorrectly added for such projects. When IDEA loads the project, it complains that the referenced module is missing.
(Attaching patch.)