summary refs log tree commit diff
path: root/src/test/run-pass/operator-overloading.rs
AgeCommit message (Collapse)AuthorLines
2012-03-22make --enforce-mut-vars always on, add mut annotations to remaining filesNiko Matsakis-1/+1
2012-02-02Add test case for issue #1733Marijn Haverbeke-0/+2
2012-01-30Alter/remove tests that include/concern ternaryPaul Woolcock-1/+1
3 tests, pretty/block-disambig.rs, run-pass/operator-overloading.rs, and run-pass/weird-exprs.rs, all included the ternary operator. These were changed to use the if-then-else construct instead. 2 tests, run-pass/block-arg-in-ternary.rs and run-pass/ternary.rs, were only there because of the ternary operator, and were removed.
2012-01-27Use the method name 'unary-' for overloading negationMarijn Haverbeke-1/+1
It's less likely to clash with something than 'neg'. Issue #1520
2012-01-26Use operator names for operator methodsMarijn Haverbeke-5/+9
The methods used to implement operators now simply use the name of the operator itself, except for unary -, which is called min to not clash with binary -. Index is called []. Closes #1520
2012-01-26Allow operator overloading of the indexing operatorMarijn Haverbeke-0/+5
The method `op_index` (which takes a single argument) is used for this. Issue #1520
2012-01-26First stab at operator overloadingMarijn Haverbeke-0/+17
When no built-in interpretation is found for one of the operators mentioned below, the typechecker will try to turn it into a method call with the name written next to it. For binary operators, the method will be called on the LHS with the RHS as only parameter. Binary: + op_add - op_sub * op_mul / op_div % op_rem & op_and | op_or ^ op_xor << op_shift_left >> op_shift_right >>> op_ashift_right Unary: - op_neg ! op_not Overloading of the indexing ([]) operator isn't finished yet. Issue #1520