title: Binding a Typeclass with Scala-Guice
body: <p>I hope I am on the right track.</p>
  
  <p>I have an SBT subproject (<code>model</code>) that defines an abstract class <code>AbstractTrainingEntity</code> and several subclasses (<code>Lecture</code>, <code>Section</code>, etc.) Another SBT subproject (<code>cadenza</code>) <code>dependsOn</code> the first SBT subproject.</p>
  
  <p>The <code>model</code> subproject defines an abstract typeclass with two method signatures that will be implemented in the <code>cadenza</code> subproject. This is intended to allow code in the <code>model</code> subproject to reference methods that are not defined until the two SBT subprojects are linked together:</p>
  
  <pre><code>import reflect.runtime.universe._
  
  abstract class AbstractTranscodeDispatch[A: TypeTag](dispatchType: AbstractTrainingEntity) {
    def transcodeUrl(trainingEntity: AbstractTrainingEntity): String
    def uploadUrl(trainingEntity: AbstractTrainingEntity): String
  }
  </code></pre>
  
  <p>The <code>cadenza</code> subproject wires it together in a <code>Scala-Guice</code> module:</p>
  
  <pre><code>import reflect.runtime.universe._
  
  class CadenzaModule extends AbstractModule with ScalaModule {
    @Provides
    def provideTranscodeDispatch[T: TypeTag](dispatchType: AbstractTrainingEntity) = new TranscodeDispatch[T](dispatchType)
  }
  </code></pre>
  
  <p>This gives an error:</p>
  
  <pre><code>[error] /var/work/training/cadenza/modules/cadenza/app/modules/cadenza/CadenzaModule.scala:53: javassist.bytecode.stackmap.TypeTag does not take type parameters
  [error]   def provideTranscodeDispatch[T: TypeTag](dispatchType: AbstractTrainingEntity) = new TranscodeDispatch[T](dispatchType)
  </code></pre>
  
  <p>Elsewhere in the <code>cadenza</code> subproject there is an implementation</p>
  
  <pre><code>class TranscodeDispatch[A: TypeTag](dispatchType: AbstractTrainingEntity) 
  extends AbstractTranscodeDispatch[A](dispatchType)
  </code></pre>
  
  <p>Do I need to use a <code>TypeLiteral</code> somehow? I am going about this all wrong? The docs are thin.</p>