Merge promotions and badvals in AST