title: Class Type T - Explained
body: <p>Can anyone explain too me why I get the following compiler exception while declaring the TableQuery inside my trait.</p>
  
  <pre><code>class type required but T found
  </code></pre>
  
  <p>Isn't the T actually a Class type or am I mistaken?</p>
  
  <pre><code>trait TableModel[T &lt;: Table[_]] {
    val table: TableQuery[T] = TableQuery[T]    &lt;~~~~~~~~~~ class type required but T found
  
    def exists(implicit session: Session): Boolean =
      (!MTable.getTables(table.baseTableRow.tableName).list.isEmpty)
  
    def schemaDescription: MySQLDriver.SchemaDescription = table.ddl
  
    def create(implicit session: Session): Unit =  schemaDescription.create
  
    def drop(implicit session: Session): Unit =  schemaDescription.drop
  }
  
  
  object UsersTable extends TableModel[Users] {}
  </code></pre>