Add another unit test for operator overloading

This commit is contained in:
Jonathan Turner 2009-10-14 14:00:22 +00:00
parent 9827345213
commit c88578d537
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,8 @@
def Bob::Bob() { }
attr Bob::x
def `-`(a, b) : is_type(a, "Bob") && is_type(b, "Bob") { a.x - b.x }
var b = Bob()
var c = Bob()
b.x = 4
c.x = 5
print(b-c)

View File

@ -0,0 +1 @@
-1