summaryrefslogtreecommitdiffhomepage
path: root/scala.html.markdown
diff options
context:
space:
mode:
authorArtur Mkrtchyan <mkrtchyan.artur@gmail.com>2015-01-03 19:48:53 +0100
committerArtur Mkrtchyan <mkrtchyan.artur@gmail.com>2015-01-03 19:48:53 +0100
commitd7672a2bc53dd8b81c4da8c620178cc2458c9238 (patch)
treee46fa98fe809f6aef65567835b6d88114d57661f /scala.html.markdown
parent6027c90c90a55702d003f17a72fd82ed7f870be0 (diff)
Added warning on return usage
Diffstat (limited to 'scala.html.markdown')
-rw-r--r--scala.html.markdown4
1 files changed, 3 insertions, 1 deletions
diff --git a/scala.html.markdown b/scala.html.markdown
index 35645922..cfc5a1e9 100644
--- a/scala.html.markdown
+++ b/scala.html.markdown
@@ -198,7 +198,9 @@ weirdSum(2, 4) // => 16
// The return keyword exists in Scala, but it only returns from the inner-most
-// def that surrounds it. It has no effect on anonymous functions. For example:
+// def that surrounds it.
+// WARNING: Using return in Scala is error-prone and should be avoided.
+// It has no effect on anonymous functions. For example:
def foo(x: Int): Int = {
val anonFunc: Int => Int = { z =>
if (z > 5)