Khimenko Victor wrote:
Hmm. Surely this program must emit run-time error: -- cut -- type my_type=(a,b,c); var x:my_type; function my_proc(x:my_type):my_type; begin my_proc:=pred(x); end; begin x:=my_proc(a); end. -- cut -- I was unable to get one but I think it's temporary limitation, right ?
Right.
C have no operations for enums while Pascal have so I'm not sure if GCC backend is powerfull enough for Pascal...
We need to produce explicit code for such checks.
I think that build_pascal_binary_op() is the correct place to check whether the result fits in its type.
Peter