Is there an existing issue for this?
Describe the bug
Problem looks like the closed dotnet/aspnetcore#37482 and dotnet/aspnetcore#18757, but dotnet/razor-compiler#34 doesn't fix it in the latest 7.0.100-preview.6.22352.1
Generated code lacks global:: on __syntheticArg0
namespace __Blazor.BlazorBug.App
...
public static void CreateChildComponent_1<T>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, BlazorBug.GenericClass<T> __syntheticArg0)
...
Produces compilation error:
Error CS0234 The type or namespace name 'GenericClass<>' does not exist in the namespace '__Blazor.BlazorBug' (are you missing an assembly reference?)
Expected Behavior
Code is generated with global:: on __syntheticArg0
namespace __Blazor.BlazorBug.App
...
public static void CreateChildComponent_1<T>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::BlazorBug.GenericClass<T> __syntheticArg0)
...
Steps To Reproduce
Project named BlazorBug
App.razror
<ParentComponent Parameter="new GenericClass<string>()">
<ChildComponent />
</ParentComponent>
ParentComponent.razor
@typeparam T
@attribute [CascadingTypeParameter(nameof(T))]
@code
{
[Parameter]
public GenericClass<T> Parameter { get; set; } = default!;
}
ChildComponent.razor
GenericClass.cs
namespace BlazorBug;
public class GenericClass<T>
{
}
Exceptions (if any)
No response
.NET Version
7.0.100-preview.6.22352.1
Anything else?
The workaround is to explicitly provide the types or move the GenericClass to a different namespace.
Is there an existing issue for this?
Describe the bug
Problem looks like the closed dotnet/aspnetcore#37482 and dotnet/aspnetcore#18757, but dotnet/razor-compiler#34 doesn't fix it in the latest 7.0.100-preview.6.22352.1
Generated code lacks global:: on __syntheticArg0
Produces compilation error:
Expected Behavior
Code is generated with global:: on __syntheticArg0
Steps To Reproduce
Project named BlazorBug
App.razror
ParentComponent.razor
ChildComponent.razor
GenericClass.cs
Exceptions (if any)
No response
.NET Version
7.0.100-preview.6.22352.1
Anything else?
The workaround is to explicitly provide the types or move the GenericClass to a different namespace.