I have the following class:
import scala.util.{Success, Failure, Try}
class MyClass {
def openFile(fileName: String): Try[String] = {
Failure( new
In my case, I had a project jar dependency which was depending on a different version of scala. This was found under Project Structure -> Modules -> (selected project) -> Dependencies tab. Everything else in the project and its libraries lined up in scala version (2.12), but the other jar was hiding a transitive dependency on an older version (2.11).