title: Missing Parameter Type For Expanded Function
body: <p>I am new to Scala and I am having trouble with an example from the book Scala in Action.</p>
  
  <p>I am using IntelliJ, but I've also tried it as script (REPL). The scala compiler gives me the same error as IntelliJ. (I am using Scala 2.10, as the book suggest).</p>
  
  <p>Here is my code:</p>
  
  <pre><code>def parseArgs(args: Array[String]): Map[String, List[String]] = {
  val command = args.head
  val params  = parseArgs(args)
  val url = args.last
  
  def nameValuePair(paramName: String) = {
    def values(commaSeparatedValues: String) = commaSeparatedValues.split(",").toList
    // x =&gt; x + 2
    val index = args.indexOf(_ == paramName)
    (paramName, if(index == -1) Nil else values(args(index + 1)))
  }
  
    Map(nameValuePair("-d"), nameValuePair("-h"))
  }
  </code></pre>
  
  <p>The message I get is: </p>
  
  <pre><code>C:\scala\projects\scripts\restclientscript.scala:12: error: missing parameter type for expanded function ((x$1) =&gt; x$1.$eq$eq(paramName))
  val index = args.indexOf(_ == paramName)
                           ^
  one error found
  </code></pre>
  
  <p>This is exactly as it is shown in the book but I can't figure out how to make it work.</p>
  
  <p>Also the method indexOf is actually findIndexOf in the book. But that method does not exist the compiler tells me (and the doc: <a href="http://www.scala-lang.org/api/2.10.3/index.html#scala.Array" rel="nofollow">http://www.scala-lang.org/api/2.10.3/index.html#scala.Array</a>).</p>
  
  <p>Lastly, IntelliJ will not accept the == inside the indexOf() method (highlighted red, but compiles).</p>
  
  <p>Any help would be appreciated! :) </p>