diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentGenericTypePass.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentGenericTypePass.cs index 08eb1f6f286..30aabb72720 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentGenericTypePass.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Components/ComponentGenericTypePass.cs @@ -146,7 +146,7 @@ private void Process(ComponentIntermediateNode node) var provideCascadingGenericTypes = new CascadingGenericTypeParameter { GenericTypeNames = typeParameters, - ValueType = attribute.BoundAttribute.TypeName, + ValueType = attribute.GloballyQualifiedTypeName, ValueSourceNode = attribute, }; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index 1a8baf401d8..5f4ec022e7a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -6726,6 +6726,77 @@ public class Child : ComponentBase CompileToAssembly(generated); } + [Fact] // https://github.com/dotnet/razor/issues/7103 + public void CascadingGenericInference_ParameterInNamespace() + { + // Arrange + AdditionalSyntaxTrees.Add(Parse(""" + using Microsoft.AspNetCore.Components; + + namespace MyApp + { + public class MyClass { } + } + + namespace MyApp.Components + { + [CascadingTypeParameter(nameof(T))] + public class ParentComponent : ComponentBase + { + [Parameter] public MyApp.MyClass Parameter { get; set; } = null!; + } + + public class ChildComponent : ComponentBase { } + } + """)); + + // Act + var generated = CompileToCSharp(""" + @namespace MyApp.Components + + + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [Fact] + public void CascadingGenericInference_Tuple() + { + // Arrange + AdditionalSyntaxTrees.Add(Parse(""" + using Microsoft.AspNetCore.Components; + + namespace Test + { + [CascadingTypeParameter(nameof(T))] + public class ParentComponent : ComponentBase + { + [Parameter] public (T, T) Parameter { get; set; } + } + + public class ChildComponent : ComponentBase { } + } + """)); + + // Act + var generated = CompileToCSharp(""" + + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + [Fact] public void ChildComponent_GenericWeaklyTypedAttribute() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs index fe208b056d7..03289d87e9e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs @@ -91,7 +91,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::Microsoft.AspNetCore.Components.RenderFragment __arg0) + public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::Microsoft.AspNetCore.Components.RenderFragment __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "ChildContent", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs index 7e068809621..c1ad010285f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs @@ -101,7 +101,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Func __arg0) + public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Func __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "SomeLambda", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs index 879242b7777..c81ad9b01a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs @@ -92,7 +92,7 @@ public static void CreateAncestor_0_CaptureParameters(global::System.Coll { __arg0_out = __arg0; } - public static global::Test.Child CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static global::Test.Child CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs index a942d8489cc..e4e26311e38 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs @@ -120,7 +120,7 @@ public static void CreateParent_0_CaptureParameters(global __arg0_out = __arg0; __arg1_out = __arg1; } - public static global::Test.Child CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, TOther __syntheticArg0, System.Collections.Generic.Dictionary __syntheticArg1, System.Collections.Generic.Dictionary __syntheticArg2, int __seq0, global::System.Collections.Generic.ICollection __arg0) + public static global::Test.Child CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, TOther __syntheticArg0, global::System.Collections.Generic.Dictionary __syntheticArg1, global::System.Collections.Generic.Dictionary __syntheticArg2, int __seq0, global::System.Collections.Generic.ICollection __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "ChildOnlyItems", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs index b116f90d2fc..32895c1413d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs @@ -90,13 +90,13 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); return default; } - public static global::Test.Column CreateColumn_2(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static global::Test.Column CreateColumn_2(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs new file mode 100644 index 00000000000..2529b0363d1 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs @@ -0,0 +1,103 @@ +// +#pragma warning disable 1591 +namespace MyApp.Components +{ + #line hidden + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Components; + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +global::System.Object __typeHelper = nameof(MyApp.Components); + +#line default +#line hidden +#nullable disable + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + { + global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateParentComponent_0_CaptureParameters( +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" + new MyClass() + +#line default +#line hidden +#nullable disable + , out var __typeInferenceArg_0___arg0); + var __typeInference_CreateParentComponent_0 = global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateParentComponent_0(__builder, -1, -1, __typeInferenceArg_0___arg0, -1, (__builder2) => { + var __typeInference_CreateChildComponent_1 = global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateChildComponent_1(__builder2, -1, __typeInferenceArg_0___arg0); +#nullable restore +#line 4 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::MyApp.Components.ChildComponent<>); + +#line default +#line hidden +#nullable disable + } + ); + #pragma warning disable BL0005 + __typeInference_CreateParentComponent_0. +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" + Parameter + +#line default +#line hidden +#nullable disable + = default; + #pragma warning restore BL0005 + } +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::MyApp.Components.ParentComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 + } +} +namespace __Blazor.MyApp.Components.TestComponent +{ + #line hidden + internal static class TypeInference + { + public static global::MyApp.Components.ParentComponent CreateParentComponent_0(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::MyApp.MyClass __arg0, int __seq1, Microsoft.AspNetCore.Components.RenderFragment __arg1) + { + __builder.OpenComponent>(seq); + __builder.AddComponentParameter(__seq0, "Parameter", __arg0); + __builder.AddComponentParameter(__seq1, "ChildContent", __arg1); + __builder.CloseComponent(); + return default; + } + + public static void CreateParentComponent_0_CaptureParameters(global::MyApp.MyClass __arg0, out global::MyApp.MyClass __arg0_out) + { + __arg0_out = __arg0; + } + public static global::MyApp.Components.ChildComponent CreateChildComponent_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::MyApp.MyClass __syntheticArg0) + { + __builder.OpenComponent>(seq); + __builder.CloseComponent(); + return default; + } + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt new file mode 100644 index 00000000000..8c9c74217d6 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt @@ -0,0 +1,32 @@ +Document - + NamespaceDeclaration - - MyApp.Components + UsingDirective - (3:1,1 [12] ) - System + UsingDirective - (18:2,1 [32] ) - System.Collections.Generic + UsingDirective - (53:3,1 [17] ) - System.Linq + UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks + UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + DirectiveToken - (11:0,11 [16] x:\dir\subdir\Test\TestComponent.cshtml) - MyApp.Components + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (29:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (29:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + Component - (31:2,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent + ComponentChildContent - - ChildContent - context + HtmlContent - (82:2,51 [6] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (82:2,51 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + Component - (88:3,4 [18] x:\dir\subdir\Test\TestComponent.cshtml) - ChildComponent + HtmlContent - (106:3,22 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (106:3,22 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + ComponentAttribute - (59:2,28 [21] x:\dir\subdir\Test\TestComponent.cshtml) - Parameter - Parameter - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (59:2,28 [21] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - new MyClass() + NamespaceDeclaration - - __Blazor.MyApp.Components.TestComponent + ClassDeclaration - - internal static - TypeInference - - + ComponentTypeInferenceMethod - - __Blazor.MyApp.Components.TestComponent.TypeInference - CreateParentComponent_0 + ComponentTypeInferenceMethod - - __Blazor.MyApp.Components.TestComponent.TypeInference - CreateChildComponent_1 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.mappings.txt new file mode 100644 index 00000000000..fb5df7e5a4f --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.mappings.txt @@ -0,0 +1,15 @@ +Source Location: (11:0,11 [16] x:\dir\subdir\Test\TestComponent.cshtml) +|MyApp.Components| +Generated Location: (615:17,44 [16] ) +|MyApp.Components| + +Source Location: (59:2,28 [21] x:\dir\subdir\Test\TestComponent.cshtml) +|new MyClass()| +Generated Location: (1290:36,28 [21] ) +|new MyClass()| + +Source Location: (48:2,17 [9] x:\dir\subdir\Test\TestComponent.cshtml) +|Parameter| +Generated Location: (2246:57,17 [9] ) +|Parameter| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs new file mode 100644 index 00000000000..3fb7f334c89 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line hidden + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Components; + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + { + global::__Blazor.Test.TestComponent.TypeInference.CreateParentComponent_0_CaptureParameters( +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + (1, 2) + +#line default +#line hidden +#nullable disable + , out var __typeInferenceArg_0___arg0); + var __typeInference_CreateParentComponent_0 = global::__Blazor.Test.TestComponent.TypeInference.CreateParentComponent_0(__builder, -1, -1, __typeInferenceArg_0___arg0, -1, (__builder2) => { + var __typeInference_CreateChildComponent_1 = global::__Blazor.Test.TestComponent.TypeInference.CreateChildComponent_1(__builder2, -1, __typeInferenceArg_0___arg0); +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.ChildComponent<>); + +#line default +#line hidden +#nullable disable + } + ); + #pragma warning disable BL0005 + __typeInference_CreateParentComponent_0. +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + Parameter + +#line default +#line hidden +#nullable disable + = default; + #pragma warning restore BL0005 + } +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.ParentComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 + } +} +namespace __Blazor.Test.TestComponent +{ + #line hidden + internal static class TypeInference + { + public static global::Test.ParentComponent CreateParentComponent_0(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, (T, T) __arg0, int __seq1, Microsoft.AspNetCore.Components.RenderFragment __arg1) + { + __builder.OpenComponent>(seq); + __builder.AddComponentParameter(__seq0, "Parameter", __arg0); + __builder.AddComponentParameter(__seq1, "ChildContent", __arg1); + __builder.CloseComponent(); + return default; + } + + public static void CreateParentComponent_0_CaptureParameters((T, T) __arg0, out (T, T) __arg0_out) + { + __arg0_out = __arg0; + } + public static global::Test.ChildComponent CreateChildComponent_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, (T, T) __syntheticArg0) + { + __builder.OpenComponent>(seq); + __builder.CloseComponent(); + return default; + } + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt new file mode 100644 index 00000000000..3efe03eb4b0 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt @@ -0,0 +1,29 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [12] ) - System + UsingDirective - (18:2,1 [32] ) - System.Collections.Generic + UsingDirective - (53:3,1 [17] ) - System.Linq + UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks + UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent + ComponentChildContent - - ChildContent - context + HtmlContent - (36:0,36 [6] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (36:0,36 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + Component - (42:1,4 [18] x:\dir\subdir\Test\TestComponent.cshtml) - ChildComponent + HtmlContent - (60:1,22 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (60:1,22 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + ComponentAttribute - (28:0,28 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Parameter - Parameter - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (28:0,28 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (1, 2) + NamespaceDeclaration - - __Blazor.Test.TestComponent + ClassDeclaration - - internal static - TypeInference - - + ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateParentComponent_0 + ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateChildComponent_1 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.mappings.txt new file mode 100644 index 00000000000..850c8ec5760 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.mappings.txt @@ -0,0 +1,10 @@ +Source Location: (28:0,28 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|(1, 2)| +Generated Location: (1014:26,28 [6] ) +|(1, 2)| + +Source Location: (17:0,17 [9] x:\dir\subdir\Test\TestComponent.cshtml) +|Parameter| +Generated Location: (1919:47,17 [9] ) +|Parameter| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs index 985a251d224..fe814584135 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs @@ -114,7 +114,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Object __arg0, int __seq1, global::System.Object __arg1, int __seq2, object __arg2) + public static global::Test.Column CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Object __arg0, int __seq1, global::System.Object __arg1, int __seq2, object __arg2) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "Title", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs index 5892bc57f2c..a2fe27a8e08 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.codegen.cs @@ -59,7 +59,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::Microsoft.AspNetCore.Components.RenderFragment __arg0) + public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::Microsoft.AspNetCore.Components.RenderFragment __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "ChildContent", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs index 290aa6acc78..848066ba00f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.codegen.cs @@ -58,7 +58,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Func __arg0) + public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Func __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "SomeLambda", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs index 20fd2d50f41..4db249fffec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.codegen.cs @@ -55,7 +55,7 @@ public static void CreateAncestor_0_CaptureParameters(global::System.Coll { __arg0_out = __arg0; } - public static void CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static void CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs index 4d3dd0b8dea..aa3aaef7f37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.codegen.cs @@ -69,7 +69,7 @@ public static void CreateParent_0_CaptureParameters(global __arg0_out = __arg0; __arg1_out = __arg1; } - public static void CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, TOther __syntheticArg0, System.Collections.Generic.Dictionary __syntheticArg1, System.Collections.Generic.Dictionary __syntheticArg2, int __seq0, global::System.Collections.Generic.ICollection __arg0) + public static void CreateChild_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, TOther __syntheticArg0, global::System.Collections.Generic.Dictionary __syntheticArg1, global::System.Collections.Generic.Dictionary __syntheticArg2, int __seq0, global::System.Collections.Generic.ICollection __arg0) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "ChildOnlyItems", __arg0); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs index fc90cc28aaf..83a7b7c09a2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.codegen.cs @@ -51,12 +51,12 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); } - public static void CreateColumn_2(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0) + public static void CreateColumn_2(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0) { __builder.OpenComponent>(seq); __builder.CloseComponent(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs new file mode 100644 index 00000000000..95cc37e3036 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.codegen.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable 1591 +namespace MyApp.Components +{ + #line hidden + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Components; + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + { + global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateParentComponent_0_CaptureParameters( +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" + new MyClass() + +#line default +#line hidden +#nullable disable + , out var __typeInferenceArg_0___arg0); + global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateParentComponent_0(__builder, 0, 1, __typeInferenceArg_0___arg0, 2, (__builder2) => { + global::__Blazor.MyApp.Components.TestComponent.TypeInference.CreateChildComponent_1(__builder2, 3, __typeInferenceArg_0___arg0); + } + ); + __typeInferenceArg_0___arg0 = default; + } + } + #pragma warning restore 1998 + } +} +namespace __Blazor.MyApp.Components.TestComponent +{ + #line hidden + internal static class TypeInference + { + public static void CreateParentComponent_0(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, global::MyApp.MyClass __arg0, int __seq1, Microsoft.AspNetCore.Components.RenderFragment __arg1) + { + __builder.OpenComponent>(seq); + __builder.AddComponentParameter(__seq0, "Parameter", __arg0); + __builder.AddComponentParameter(__seq1, "ChildContent", __arg1); + __builder.CloseComponent(); + } + + public static void CreateParentComponent_0_CaptureParameters(global::MyApp.MyClass __arg0, out global::MyApp.MyClass __arg0_out) + { + __arg0_out = __arg0; + } + public static void CreateChildComponent_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::MyApp.MyClass __syntheticArg0) + { + __builder.OpenComponent>(seq); + __builder.CloseComponent(); + } + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt new file mode 100644 index 00000000000..3509ab9bc8f --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt @@ -0,0 +1,18 @@ +Document - + NamespaceDeclaration - - MyApp.Components + UsingDirective - (3:1,1 [14] ) - System + UsingDirective - (18:2,1 [34] ) - System.Collections.Generic + UsingDirective - (53:3,1 [19] ) - System.Linq + UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks + UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (31:2,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent + ComponentChildContent - - ChildContent - context + Component - (88:3,4 [18] x:\dir\subdir\Test\TestComponent.cshtml) - ChildComponent + ComponentAttribute - (59:2,28 [21] x:\dir\subdir\Test\TestComponent.cshtml) - Parameter - Parameter - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (59:2,28 [21] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - new MyClass() + NamespaceDeclaration - - __Blazor.MyApp.Components.TestComponent + ClassDeclaration - - internal static - TypeInference - - + ComponentTypeInferenceMethod - - __Blazor.MyApp.Components.TestComponent.TypeInference - CreateParentComponent_0 + ComponentTypeInferenceMethod - - __Blazor.MyApp.Components.TestComponent.TypeInference - CreateChildComponent_1 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs new file mode 100644 index 00000000000..ed424cc8dcd --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.codegen.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line hidden + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Components; + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + { + global::__Blazor.Test.TestComponent.TypeInference.CreateParentComponent_0_CaptureParameters( +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + (1, 2) + +#line default +#line hidden +#nullable disable + , out var __typeInferenceArg_0___arg0); + global::__Blazor.Test.TestComponent.TypeInference.CreateParentComponent_0(__builder, 0, 1, __typeInferenceArg_0___arg0, 2, (__builder2) => { + global::__Blazor.Test.TestComponent.TypeInference.CreateChildComponent_1(__builder2, 3, __typeInferenceArg_0___arg0); + } + ); + __typeInferenceArg_0___arg0 = default; + } + } + #pragma warning restore 1998 + } +} +namespace __Blazor.Test.TestComponent +{ + #line hidden + internal static class TypeInference + { + public static void CreateParentComponent_0(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, (T, T) __arg0, int __seq1, Microsoft.AspNetCore.Components.RenderFragment __arg1) + { + __builder.OpenComponent>(seq); + __builder.AddComponentParameter(__seq0, "Parameter", __arg0); + __builder.AddComponentParameter(__seq1, "ChildContent", __arg1); + __builder.CloseComponent(); + } + + public static void CreateParentComponent_0_CaptureParameters((T, T) __arg0, out (T, T) __arg0_out) + { + __arg0_out = __arg0; + } + public static void CreateChildComponent_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, (T, T) __syntheticArg0) + { + __builder.OpenComponent>(seq); + __builder.CloseComponent(); + } + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt new file mode 100644 index 00000000000..0065bc8e620 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt @@ -0,0 +1,18 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [14] ) - System + UsingDirective - (18:2,1 [34] ) - System.Collections.Generic + UsingDirective - (53:3,1 [19] ) - System.Linq + UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks + UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent + ComponentChildContent - - ChildContent - context + Component - (42:1,4 [18] x:\dir\subdir\Test\TestComponent.cshtml) - ChildComponent + ComponentAttribute - (28:0,28 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Parameter - Parameter - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (28:0,28 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - (1, 2) + NamespaceDeclaration - - __Blazor.Test.TestComponent + ClassDeclaration - - internal static - TypeInference - - + ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateParentComponent_0 + ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateChildComponent_1 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs index 303f3967cc6..a43258fa56c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.codegen.cs @@ -82,7 +82,7 @@ public static void CreateGrid_0_CaptureParameters(global::System.Collecti { __arg0_out = __arg0; } - public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Object __arg0, int __seq1, global::System.Object __arg1, int __seq2, object __arg2) + public static void CreateColumn_1(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, global::System.Collections.Generic.IEnumerable __syntheticArg0, int __seq0, global::System.Object __arg0, int __seq1, global::System.Object __arg1, int __seq2, object __arg2) { __builder.OpenComponent>(seq); __builder.AddComponentParameter(__seq0, "Title", __arg0);