-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I have a component like this:
@* SelectMultiple.razor *@
@typeparam TItem
@inherits InputBase<TItem[]>
@code {
[Parameter, EditorRequired]
public TItem[] Options { get; set; } = null!;
protected override bool TryParseValueFromString(string? value, out TItem[] result, out string validationErrorMessage) => throw new NotImplementedException();
}
Which is used like this:
<SelectMultiple @bind-Value="Selected" Options="Options" />
@code {
string[] Selected { get; set; } = Array.Empty<string>();
string[] Options { get; }
}
With .NET 6 SDK this builds and runs just fine, I believe as a result of #35980. With the .NET 7 SDK this fails with the following error:
0>/private/tmp/BlazorGeneric/BlazorGeneric/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Counter_razor.g.cs(138,96): Error CS0400 : The type or namespace name 'TItem' could not be found in the global namespace (are you missing an assembly reference?)
0>/private/tmp/BlazorGeneric/BlazorGeneric/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Counter_razor.g.cs(138,111): Error CS1503 : Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<string[]>' to 'Microsoft.AspNetCore.Components.EventCallback'
Expected Behavior
With .NET 6 SDK this builds and runs just fine. I expect the .NET 7 SDK to not introduce regressions.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
7.0.203
Anything else?
No response