title: Unexpected behavior with implicits
body: <p>I had a strange bug yesterday that I eventually reduced to the following code:</p>
  
  <pre><code>Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29).
  Type in expressions to have them evaluated.
  Type :help for more information.
  
  scala&gt; class X extends Function[String, Int] { def apply(x: String) = Integer.parseInt(x) }
  defined class X
  
  scala&gt; implicit val x = new X
  x: X = &lt;function1&gt;
  
  scala&gt; "56" / 2
  res2: Int = 28
  </code></pre>
  
  <p>I expect this to throw an exception, since String doesn't have a <code>/</code> method. Instead, Scala treated the implicit variable as an implicit method (because it implements <code>Function[String,Int]</code>) and converted  the string "56" to the integer 56.</p>
  
  <p>How does this work? Based on the rules of implicit search, I didn't think implicit variables that act as functions would be considered.</p>