Merge pull request #2683 from 9rnsr/fix11300

[REG2.064a] Issue 11300 - ICE with enums and circular module references
fix Issue 11238 - Codegen error when this is a ref parameter to the method

Revert a part of the fix for issue 2356, to avoid aliasing issue.