It turns out "is" is just a normal overridable operator. Who knew?
This commit is contained in:
@@ -14,6 +14,7 @@ class Foo {
|
||||
!=(other) { "infix != " + other }
|
||||
&(other) { "infix & " + other }
|
||||
|(other) { "infix | " + other }
|
||||
is(other) { "infix is " + other }
|
||||
|
||||
! { "prefix !" }
|
||||
~ { "prefix ~" }
|
||||
@@ -37,3 +38,4 @@ System.print(foo | "a") // expect: infix | a
|
||||
System.print(!foo) // expect: prefix !
|
||||
System.print(~foo) // expect: prefix ~
|
||||
System.print(-foo) // expect: prefix -
|
||||
System.print(foo is "a") // expect: infix is a
|
||||
|
||||
Reference in New Issue
Block a user