Nullability feedback for public types in Components (#25821)

* EventCallback.InvokeAsync can pass a null value
* Remove unused BindFormatterWithFormat
This commit is contained in:
Pranav K 2020-09-13 10:01:21 -07:00 committed by GitHub
parent f0c9f60903
commit 99496b41a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -23,7 +23,6 @@ namespace Microsoft.AspNetCore.Components
private static readonly object BoxedFalse = false;
private delegate object? BindFormatter<T>(T value, CultureInfo? culture);
private delegate object BindFormatterWithFormat<T>(T value, CultureInfo? culture, string format);
internal delegate bool BindParser<T>(object? obj, CultureInfo? culture, [MaybeNullWhen(false)] out T value);
internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, [MaybeNullWhen(false)] out T value);

View File

@ -51,11 +51,11 @@ namespace Microsoft.AspNetCore.Components
/// </summary>
/// <param name="arg">The argument.</param>
/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns>
public Task InvokeAsync(object arg)
public Task InvokeAsync(object? arg)
{
if (Receiver == null)
{
return EventCallbackWorkItem.InvokeAsync<object>(Delegate, arg);
return EventCallbackWorkItem.InvokeAsync<object?>(Delegate, arg);
}
return Receiver.HandleEventAsync(new EventCallbackWorkItem(Delegate), arg);