Merge back semantic result in originalType
fix Issue 12266 - Header generation produces uncompilable header
Tweak ddoc output
Merge pull request #3360 from 9rnsr/fix12266

[REG2.065] Issue 12266 - Header generation produces uncompilable header