Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Should it be possible to add primitive types? #382

Closed
cwe1ss opened this issue Mar 10, 2016 · 5 comments
Closed

Should it be possible to add primitive types? #382

cwe1ss opened this issue Mar 10, 2016 · 5 comments
Assignees
Milestone

Comments

@cwe1ss
Copy link

cwe1ss commented Mar 10, 2016

Hi! There's a unit test that adds a primitive type as a singleton to the collection:

collection.AddSingleton("Hello World");

Should this really be possible? What would be a usage scenario for this?

Castle Windsor for example doesn't support it.

@davidfowl
Copy link
Member

There's no scenario and I'm not sure why the test has it but we don't go out of our way to make it fail

@cwe1ss
Copy link
Author

cwe1ss commented Mar 10, 2016

Ok. Could you change this test? Castle Windsor throws an exception and I guess others might do so as well. And since this is not the purpose of that test, other containers shouldn't fail for such a reason IMO.

@cwe1ss
Copy link
Author

cwe1ss commented Mar 10, 2016

Maybe this line can just be removed? The test has a different purpose anyways.

@pranavkm
Copy link
Contributor

I think it's meant for the generic service to close over. We could replace it with a non-primitive type instead.

@davidfowl
Copy link
Member

Let's do that.

@davidfowl davidfowl added the bug label Mar 10, 2016
@davidfowl davidfowl added this to the 1.0.0-rc2 milestone Mar 10, 2016
pranavkm added a commit that referenced this issue Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants