Description:
Sometime after upgrading model to 6.1, above compilation errors could be seen without an explicit reason and without any change in the environment.
Solution:
A Re-gen and Re-build of (all) the function(s) concerned to a new Gen folder is often sufficient to get rid of these build errors : clear out everything in the Gen folder and re-gen and rebuild all functions.