fix Issue 11136 - ICE on incorrect module declaration
Merge pull request #2606 from WalterBright/fix11136

fix Issue 11136 - ICE on incorrect module declaration