Nullability feedback for public types in Components (#25821)
* EventCallback.InvokeAsync can pass a null value * Remove unused BindFormatterWithFormat
This commit is contained in:
parent
f0c9f60903
commit
99496b41a0
|
|
@ -23,7 +23,6 @@ namespace Microsoft.AspNetCore.Components
|
||||||
private static readonly object BoxedFalse = false;
|
private static readonly object BoxedFalse = false;
|
||||||
|
|
||||||
private delegate object? BindFormatter<T>(T value, CultureInfo? culture);
|
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 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);
|
internal delegate bool BindParserWithFormat<T>(object? obj, CultureInfo? culture, string? format, [MaybeNullWhen(false)] out T value);
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,11 @@ namespace Microsoft.AspNetCore.Components
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="arg">The argument.</param>
|
/// <param name="arg">The argument.</param>
|
||||||
/// <returns>A <see cref="Task"/> which completes asynchronously once event processing has completed.</returns>
|
/// <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)
|
if (Receiver == null)
|
||||||
{
|
{
|
||||||
return EventCallbackWorkItem.InvokeAsync<object>(Delegate, arg);
|
return EventCallbackWorkItem.InvokeAsync<object?>(Delegate, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Receiver.HandleEventAsync(new EventCallbackWorkItem(Delegate), arg);
|
return Receiver.HandleEventAsync(new EventCallbackWorkItem(Delegate), arg);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue