peter-perot

Results 11 comments of peter-perot

Concerning the use of `SemaphoreSlim`, I observe the same issue here, but only when async and sync stuff are mixed. Here is the code to reproduce this issue using `SemaphoreSlim`:...

Does this bug still exist in VS 2022? I don't get the `[at 'T?'] CS8627: A nullable type parameter must be known to be a value type or non-nullable reference...

@tillig I don't think this is a duplicate of https://github.com/autofac/Autofac/issues/780 _Autofac.Extensions.DependencyInjection_ is an adapter for _Autofac_ in order to act as a substitute for _Microsoft ASP.NET DependencyInjection_ when using the...

Interesting - the behaviour described [here](https://github.com/autofac/Autofac/issues/780#issuecomment-260329510) is really quirky (the difference between registration at container level as opposed to registration at scope level with a different behavior on disposal). So...

> From my perspective the issue comes from a gap in the overall design of dependency injection containers. That is not only an autofac issue. Often dependency containers work as...

> Why `MaybeNullWhen(false)` instead of `NotNullWhen(true)` Since this is the way generic arguments are annotated, see [here](https://github.com/dotnet/runtime/blob/abfdb542e8dfd72ab2715222edf527952e9fda10/docs/coding-guidelines/api-guidelines/nullability.md#nullable-attributes) and search for _"annotate generic out arguments"_. You can only use `NotNullWhen` in...

@chrisoverzero Yeah, thanks to your explanation regarding type inference, I think I found an explanation for the covariance thing and the different behaviors (covariance vs. no variance). With covariance, the...

There is one more observation I made. The following code (as proposed by @chrisoverzero) seems to work correctly: ```csharp public static class ValueHolderExtensions { public static bool TryGetValue(this IValueHolder holder,...

> > > Why `MaybeNullWhen(false)` instead of `NotNullWhen(true)` > > > > > > Since this is the way generic arguments are annotated, see [here](https://github.com/dotnet/runtime/blob/abfdb542e8dfd72ab2715222edf527952e9fda10/docs/coding-guidelines/api-guidelines/nullability.md#nullable-attributes) and search for _"annotate generic...

Interesting: https://github.com/dotnet/runtime/blob/7ac5ef959579da0202e6ad618924dfc8fe129e89/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs#L569 https://github.com/dotnet/runtime/blob/7ac5ef959579da0202e6ad618924dfc8fe129e89/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/IDictionary.cs#L46 Both attributes appear to be allowed with generics.