I encountered this in DiagnosticStartAnalysisScope.cs at line 203 (method TryGetValueCore).
using System;
using System.Diagnostics.CodeAnalysis;
#nullable enable
public class C {
internal virtual bool TryGetValueCore<TKey, TValue>(TKey key, string valueProvider, [MaybeNull] [NotNullWhen(true)] out TValue value)
where TKey : class
{
throw new NotImplementedException();
}
}
public class Derived : C
{
// warning CS8765: Type of parameter 'value' doesn't match overridden member because of nullability attributes.
internal override bool TryGetValueCore<TKey, TValue>(TKey key, string valueProvider, [MaybeNull] [NotNullWhen(true)] out TValue value)
{
throw null!;
}
}
sharplab
I encountered this in
DiagnosticStartAnalysisScope.csat line 203 (methodTryGetValueCore).sharplab