From b8c4a99401689526254cd6eed79f75225cf5211b Mon Sep 17 00:00:00 2001 From: eryshev Date: Sun, 11 Dec 2016 15:25:17 +0100 Subject: [PATCH] Add missed isSimilar examples in traits.md. It would be better for newcomers to see some `isSimilar` examples in this doc. --- tutorials/tour/traits.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tutorials/tour/traits.md b/tutorials/tour/traits.md index 7b5ad73042..2be4cc0517 100644 --- a/tutorials/tour/traits.md +++ b/tutorials/tour/traits.md @@ -34,16 +34,20 @@ object TraitsTest extends App { val p1 = new Point(2, 3) val p2 = new Point(2, 4) val p3 = new Point(3, 3) - println(p1.isNotSimilar(p2)) - println(p1.isNotSimilar(p3)) + val p4 = new Point(2, 3) + println(p1.isSimilar(p2)) + println(p1.isSimilar(p3)) + // Point's isNotSimilar is defined in Similarity println(p1.isNotSimilar(2)) + println(p1.isNotSimilar(p4)) } ``` Here is the output of the program: ``` -false true +false true +false ```