typedi icon indicating copy to clipboard operation
typedi copied to clipboard

feature: setting the token should infer the type

Open theodorDiaconu opened this issue 4 years ago • 1 comments

Description

const token = new Token<string>("MY TOKEN");
container.set(token, 123); // no warning

Proposed solution

If it's a token infer the type, same for:

container.set({
   id: token,
   value: 123, // should trigger warning.
});

theodorDiaconu avatar Jun 23 '21 09:06 theodorDiaconu

I agree this is a good idea.

NoNameProvided avatar Jan 13 '22 12:01 NoNameProvided