title: Compiler expecting String where it should be expecting Long
body: <p>In this code, the compiler message says it expects "j" to be String, but it's Long based on the type of the parameters in the method.</p>
  
  <p>I added method add to express the types so there should be no inference required. If I remove the + "j" and put a constant, the problem remains. If I leave off the "+ j" it compiles. It behaves like "that.v" is implicitly converting to String. But "v" is clearly a Long in the parameter list.</p>
  
  <p>I will also note why "+". I actually want "|" but the compiler says Long does not support "|". So a hint on how to bitwise or a Long or Int would be helpful. My guess is these are signed, and perhaps there are classes specific to unsigned work that should be used.</p>
  
  <p>I have put the trait a class in an object with same result, which is what I expected. I have tried various imports, like Long, and the result is the same.</p>
  
  <p>I wonder if there is some fundamental problem with the environment, as in the hidden imports. I'm using the latest IntelliJ as I work through code in Odersky. I have the Rational class in another file and it compiles fine.</p>
  
  <p>I am at the end of my rope over something fundamental that is not obvious to a new Scala programmer.</p>
  
  <pre class="lang-scala prettyprint-override"><code>package com.proclivis.field
  
  trait CommandField[A] {
    def |: (that: CommandField[A]):CommandField[A]
  }
  
  class IntCommandField[Long] (val v: Long) extends CommandField[Long] {
    def |: (that: IntCommandField[Long]): IntCommandField[Long] =
      new IntCommandField(add(that.v, this.v))
  
    private def add (i:Long, j:Long): Long = i + j
  }
  </code></pre>
  
  <p>Error:(21, 48) type mismatch;
   found   : Long
   required: String
    private def add (i:Long, j:Long): Long = i + j</p>