I have two functions (not these have been edited since the original -- some of the answers below are responding to the original ones which returned a sequence of ()):
I'm not really familiar with Scala, but I have used Java and Haskell, so I'm going to go out on a limb here and guess that your second example isn't doing quite the same thing. It looks like both of them are using a pattern match to deconstruct the first two elements of a list, but the second one is using the cons operator as opposed to the List constructor. My guess would be that this is somehow related to the interop with Java and a subtle difference between the way the List constructor versus the cons operator actually function.
On the other hand, maybe it's just an edge case that got overlooked by the compiler and they both should generate a warning.