docs: document is operator as overridable infix method and add type-test examples

This commit is contained in:
Bob Nystrom
2015-11-07 21:00:24 +00:00
parent efcc4d07c7
commit f27fff9dd0
5 changed files with 30 additions and 4 deletions
+2
View File
@@ -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