Merge pull request #1306 from WalterBright/toenum

immutable should be an enum
Merge pull request #1304 from majiang/patch-2

fix issue 10167