[BZ-1153852] fix incremental compilation when adding a new function

(cherry picked from commit e4b1bff10ebb4a03ead6f77d8aa08fcfb0f9828a)