structuremap/structuremap — pull request #300 by asbjornu (2014-10-15 14:04:13+00:00)
Title: Plugin family referencing plugin family

This PR contains a failing test that would be neat if was fixed. To get around it now, one has to cast the object to the concrete implementation, since `LambdaInstance.ReturnedType` only returns `typeof(T)` and does not actually investigate what `context.GetInstance()` might resolve to.

On top of this, instead of throwing an exception that states that the `ReturnedType` needs to be a concrete type (as verified in `TypeExtensions.CanBeCastTo():174`), StructureMap fails with an exception stating that the returned type can't be cast to the plugin family, which is actually false.

If it's not possible to fix the test, a new test should be created that verifies the exception that is thrown so it can be made more understandable.