qore icon indicating copy to clipboard operation
qore copied to clipboard

Operators and implicit conversions

Open tethal opened this issue 9 years ago • 1 comments

Currently it is possible to apply any operator to almost any expression, but many of them do not make sense:

class C {};
C c();
code x = sub(){};

printf("%N\n", 5 + c);  #5
printf("%N\n", 5 + x);  #5
printf("%N\n", c + x);  #class C: (<NO PRIVATE DATA>) <NO MEMBERS>

I'm not sure what the last one actually does. These cases are not documented, see also #284.

The ultimate goal (in qore-llvm) is to have a well-defined set of overloads for each operator + simple overload resolution rules + implicit coercion rules.

tethal avatar Feb 03 '16 12:02 tethal

See also #25 and #166

tethal avatar Feb 04 '16 08:02 tethal