dickwall/subcut — pull request #14 by nadavwr (2012-04-16 23:28:56+00:00)
Title: Injection via extractor

Hi,

I toyed with using extractors for dependency injection -- I'm not sure how useful it would be (if not then it should be abandoned), but thought I'd share anyway.
An interesting use case could be to enable dependency injection to occur as part of pattern matching, but I haven't tried that yet.

This is what I came up with:

```scala
val Inject(service) = manifest[EchoService]
```

The extractor Inject was added at Injectable, and I placed a minimal test along with PlainScalaInjectInBindingTest.

This could be further extended to drop mention of 'manifest[...]' from user code, and to allow inject by id as well.