title: Scala value has incompatible type?
body: <p>I am still new enough to Scala that the typing system is destroying me. I haven't yet thought of a solution or discovered a pattern that gets around this particular problem that I am trying to solve. Consider the following program:</p>
  
  <p><strong>ShapeType.scala</strong></p>
  
  <pre><code>package models
  
  abstract class ShapeType {
    val themes: ShapeThemes[ShapeTheme] // I think this is where the problem is...?
  }
  
  class CircleShapeType extends ShapeType {
    val themes = CircleShapeThemes
  }
  
  object CircleShapeType extends CircleShapeType
  </code></pre>
  
  <p><strong>ShapeThemes.scala</strong></p>
  
  <pre><code>package models
  
  abstract class ShapeThemes[T &lt;: ShapeTheme] {
    val themes: List[T]
  }
  
  class CircleShapeThemes extends ShapeThemes[CircleShapeTheme] {
    val themes = List(
      new CircleShapeTheme,
      new CircleShapeTheme,
      new CircleShapeTheme
    )
  }
  
  object CircleShapeThemes extends CircleShapeThemes
  </code></pre>
  
  <p><strong>ShapeTheme.scala</strong></p>
  
  <pre><code>package models
  
  class ShapeTheme
  
  class CircleShapeTheme extends ShapeTheme
  </code></pre>
  
  <p>When I attempt to compile the program (using <a href="http://www.scala-sbt.org/" rel="nofollow">sbt</a>), I get the following error:</p>
  
  <pre><code>[error] /Users/mjs/Projects/sandbox/shape-types/src/main/scala/ShapeType.scala:8: overriding value themes in class ShapeType of type models.ShapeThemes[models.ShapeTheme];
  [error]  value themes has incompatible type
  [error]   val themes = CircleShapeThemes
  [error]       ^
  [error] one error found
  [error] (compile:compile) Compilation failed
  [error] Total time: 2 s, completed Mar 14, 2015 5:08:43 PM
  </code></pre>
  
  <p>However, as far as I can tell, <code>CircleShapeThemes</code> is a <code>ShapeThemes[ShapeTheme]</code>. What am I missing?</p>