Open jnm2 opened 3 years ago
In that particular case you are right. If you want an example where this is relevant check out the testInstancePerDependencyDependenciesWithFactories
. In that example async calls are parallelized - so we trigger 2 async calls then await one, then await the other. In that case you can have a situation where you need to keep track of whether an await has started.
We definitely could improve codegen to detect this scenario and remove the unnecessary bookkeeping.
Makes sense. I'm not too concerned. Do you want to leave this issue open to track skipping this try block for the innermost await?
Yep, thanks
How can
!hasAwaitStarted_a_1_1
in the catch block ever not evaluate tofalse
? It's not assigned anywhere else.https://github.com/YairHalberstadt/stronginject/blob/2143d9f27dfdf7269b4de3e60dd198c4374cd586/StrongInject.Tests.Unit/GeneratorTests.cs#L7112-L7125