SYSTEM.VAL does not compile
I believe it should compile.
see attached module.
TYPE Color*=ARRAY  OF UNSIGNED8; VColor*= ARRAY  OF UNSIGNED8; OPERATOR ":="*(VAR l:Color; r:UNSIGNED32); BEGIN l:=SYSTEM.VAL(Color,r) END ":="; OPERATOR ":="*(VAR l:UNSIGNED32; CONST r:Color); BEGIN l:=SYSTEM.VAL(UNSIGNED32,r) END ":=";
#1 Updated by Felix Friedrich 7 months ago
A minimal example that reproduces your problems is the following:
MODULE Test; IMPORT SYSTEM; TYPE Color*=ARRAY  OF UNSIGNED8; OPERATOR ":="*(VAR l: Color; CONST i: ARRAY  OF SIGNED32); BEGIN END ":="; VAR l,r: Color; BEGIN l := r; END Test.
The compiler reports a "recursive Conversion". The problem is that during assignment of Color to Color the compiler tries to use the assignment operator provided and after the implicit conversion tries to assign a Color to a Color again (implicitly). This must be repaired in the compiler. Because there are implicit conversions possible (as they were requested) a simple assignment can now become an expensive operation. Because it must be possible to allow for overloading of assignment T to T, an absence of this explicit conversion operator must be handled differently by the compiler. The assignment of T to T should never go via different types.
Will be fixed.