Scala: Type missing parameter type for expanded function The argument types of an anonymous function must be fully known. (SLS 8.5)
问题 I wrote a function which returns a function based on the String argument it receives. The code looks as follow: def getFunction(str:String) : Map[String, String] => String={ val s = str.charAt(0).toString() s matches { case "x" => (arg:Map[String, String]) => arg("random") case _ =>(arg:Map[String, String]) => arg("") } } This is giving a compilation exception Description Resource Path Location Type missing parameter type for expanded function The argument types of an anonymous function must