What scala statements or code can produce a byte-code which can not be translated to java?
bytecode, java, scala
Solution
The answer really depends on how hard you want to try to convert the code.
Since Java and Scala are both turing complete, any program in one can trivially be converted to the other, but this isn't really interesting or useful.
What you really want is to convert the results to readable, idiomatic code. From this perspective, even Java code can't automatically be converted to Java because compilation loses information (though relatively little compared to C) and machines aren't as good as humans at writing human readable code anyway.
If you got a Java and Scala expert, they could probably rewrite your Scala codebase in Java and end up with reasonably idiomatic Java code. But it wouldn't be as readable as Scala due to the simple fact that Scala is a language designed to improve on Java. Scala tries to remove the warts from Java and provide powerful high level programming features, removing the need for all the classic Java boilerplate. So the Java equivalent codebase will not be as readable.
From this perspective, the answer is "any feature in Scala that is not in Java".
Problem
I have read an answer to a question about converting Scala code to Java code. It says: I don't think it's possible to convert from scala back to standard java since Scala does some pretty low-level byte-code manipulation. I'm 90% sure they do some things that can't exactly be translated back into normal Java code. So what Scala statements or code can produce bytecode which can not be translated to java? P.S. I generally agree with that answer, but want a concrete example for learning purposes.