title: Implicit abstract class constructor parameter and inheritance in Scala
body: <p>I am fairly new to Scala and have been trying to learn and understand implicit conversions and parameters and have encountered a scenario that I find confusing.</p>
  
  <p>For context, I am using Scaldi to do dependency injection in an Akka application and would like to have multiple injectable actors inherit from an abstract class.  I believe I am unable to make the abstract class a trait precisely because we need to make an implicit <code>Injector</code> available via a constructor argument to take advantage of the framework.</p>
  
  <p>A very contrived example that exhibits the behavior that I am seeing is as follows:</p>
  
  <pre class="lang-scala prettyprint-override"><code>class SecretSauce {}
  
  abstract class Base(implicit secretSauce: SecretSauce) {}
  
  class Concrete extends Base {}
  
  object Example extends App {
      ... // Setup Actor system, etc, etc
      implicit val secretSauce: SecretSauce = new SecretSauce()
  }
  </code></pre>
  
  <p>I was expecting things to work but instead I get a compilation error:</p>
  
  <pre><code>Unspecified value parameter secretSauce.
  class Concrete extends Base {
               ^
  </code></pre>
  
  <p>If I add the implicit parameter to the concrete class, like such, things work:</p>
  
  <pre class="lang-scala prettyprint-override"><code>class Concrete(implicit secretSauce: SecretSauce) extends Base {}
  </code></pre>
  
  <p>I think my confusion stems from how implicit parameters work - in situations like the one I'm describing, are they not inherited by child classes? Can someone ELI5 what is occurring in my example or point me to a reference that can help clear things up?</p>
  
  <p>Thanks!</p>