title: How do I create an instance of a trait in a generic method in scala?
body: <p>I'm trying to create an instance of a trait using this method</p>
  
  <pre><code>val inst = new Object with MyTrait
  </code></pre>
  
  <p>This works well, but I'd like to move this creation in to a generator function, ie.</p>
  
  <pre><code>object Creator {
    def create[T] : T = new Object with T
  }
  </code></pre>
  
  <p>I'm obviously going to need the manifest to somehow fix the type erasure problems, but before I get to this, I run in to 2 questions :</p>
  
  <ol>
  <li><p>Even with an implicit manifest, Scala still demands that T be a trait. How do I add a restriction to create[T] so that T is a trait?</p></li>
  <li><p>If I chose to use the Class.newInstance method to create the instance dynamically rather than using "new", how would I specify the "with" in "new Object with T"? Is it possible to dynamically create new concrete mixin types at runtime?</p></li>
  </ol>