Thanks!I I did some more research after seeing your reply. It looks like my problem was having a return in an anonymous function (From Scala Reference Draft)
Returning from a nested anonymous function is implemented by throwing and
catching a scala.runtime.NonLocalReturnException. Any exception catches between the point of return and the enclosing methods might see the exception. Expressions
key comparison makes sure that these exceptions are only caught by the method
instance which is terminated by the return.
Also found a couple of related items
It caught me off guard that return in an anonymous function is non-local, but a return from a named function is local.
--
---
John L Cheng