On Sun, Dec 28, 2014 at 4:13 AM, David Jeske <[email protected]> wrote:
> Seems Scala requires exhaustive pattern matching, though it's not clear how
> this interacts with late-binding. If one doesn't supply a default-match and
> late-binding produces an un-handled type, what happens? If one supplies a
> default-match to produce known behavior in the case of an un-handled type,
> it breaks exhaustive match checking.

You mean with a sealed hierarchy of case classes? The exhaustiveness
check cannot really be backed up by the JVM the way they implement it,
which is essentially Java's instanceof and dynamic cast. An unhandled
class will cause some kind of runtime exception. (I forget if they
have their own, or they just let one of the cases give a cast
exception.)
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to