We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 96e2172 + b4de3a0 commit 6b5544dCopy full SHA for 6b5544d
compiler/test-resources/repl/i1374
@@ -0,0 +1,8 @@
1
+scala> implicit class Padder(val sb: StringBuilder) extends AnyVal { def pad2(width: Int) = { 1 to width - sb.length foreach { sb append '*' }; sb } }
2
+// defined class Padder
3
+scala> val greeting = new StringBuilder("Hello, kitteh!")
4
+val greeting: StringBuilder = Hello, kitteh!
5
+scala> val a = greeting pad2 20
6
+val a: StringBuilder = Hello, kitteh!*
7
+scala> val farewell = new StringBuilder("U go now.") // I hatez long bye-bye.
8
+val farewell: StringBuilder = U go now.
0 commit comments