If I make a program that contains
float x = limit(0, 1, 2);
I will, as expected, get
C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Bad type in assignment. C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Expected: float C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Got : int(1..1)
i.e. the run time type of the limit expression is not compatible with the type of the variable x. If however I change the code to
int x = limit(0.0, 1.0, 2.0);
I will instead get
C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Bad type in assignment. C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Expected: int C:/MinGW/home/Nilsson/Pike/7.7/foo.pike:5:Got : float | float | float
i.e. the compile time type of the limit expression. Why not the run time type?