By Alvin Alexander. Last updated: June 4, 2016
In a little bit of accidental Scala REPL fun this afternoon, I was testing a recursive algorithm like the following simple factorial algorithm, and forgot a return statement:
def factorial(n: Int):Int = { if (n == 1) n // forgot 'return' here factorial(n - 1) }
When I pasted that code into the Scala REPL and then tried to test it as shown below, it didn't come back for a while, until it failed with this error message:
Having lived in Alaska for a few years (and lived through the 2008 U.S. election) I can certainly appreciate the "She's gone rogue!" error message.