I want to have a class which takes a parameter with a class-dependent type, as I've often done for methods. However, to my surprise, this didn't work:
scala> trait Compiler { trait Config }
defined trait Compiler
// works fine, as expected
scala> def f(c: Compiler)(conf: c.Config) = {}
f: (c: Compiler)(conf: c.Config)Unit
scala> class F(val c: Compiler)(val conf: c.Config)
<console>:8: error: not found: value c
class F(val c: Compiler)(val conf: c.Config)
^
Why? And are there any workarounds?