HPCC-8532 Fix meta annotations and type/scope generation in the IR

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #3826 from ghalliday/issue8532

HPCC-8532 Fix meta annotations and type/scope generation in the IR

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>