Asteracea icon indicating copy to clipboard operation
Asteracea copied to clipboard

Finite constructor parameter lifetimes

Open Tamschi opened this issue 5 years ago • 1 comments

It's currently not possible to accept values with a lifetime shorter than 'static in constructor arguments that are captured.

It should be possible to specify any number of lifetime parameters on a component and use them with constructor arguments, including ones associated with a field capture.

Alternatively, accepting 'self may be an option, though supporting this exclusively may cause issues where variance isn't present.

Tamschi avatar Oct 09 '20 00:10 Tamschi

This almost works now ('a should be able to be specified.), but acquiring a DI marker token from the type currently requires 'static lifetime.

Tamschi avatar Dec 01 '20 22:12 Tamschi