macro: improve type checking for r5js.IdOrLiteralTransformer