-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #526 from aspnet/ajbaaska/generic-int-fix
Fix invalid cast in non-generic parameterized ChildContent
- Loading branch information
Showing
7 changed files
with
242 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// <auto-generated/> | ||
#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 class TestComponent : Microsoft.AspNetCore.Components.ComponentBase | ||
{ | ||
#pragma warning disable 219 | ||
private void __RazorDirectiveTokenHelpers__() { | ||
} | ||
#pragma warning restore 219 | ||
#pragma warning disable 0414 | ||
private static System.Object __o = null; | ||
#pragma warning restore 0414 | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) | ||
{ | ||
__Blazor.Test.TestComponent.TypeInference.CreateMyComponent_0(builder, -1, -1, | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
"hi" | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
, -1, (context) => (builder2) => { | ||
#nullable restore | ||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = context.ToLower(); | ||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
, -1, (context) => (builder2) => { | ||
#nullable restore | ||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = context; | ||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
); | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = typeof(MyComponent<>); | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
#pragma warning restore 1998 | ||
} | ||
} | ||
namespace __Blazor.Test.TestComponent | ||
{ | ||
#line hidden | ||
internal static class TypeInference | ||
{ | ||
public static void CreateMyComponent_0<TItem>(global::Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int seq, int __seq0, TItem __arg0, int __seq1, global::Microsoft.AspNetCore.Components.RenderFragment<TItem> __arg1, int __seq2, global::Microsoft.AspNetCore.Components.RenderFragment<System.Int32> __arg2) | ||
{ | ||
builder.OpenComponent<global::Test.MyComponent<TItem>>(seq); | ||
builder.AddAttribute(__seq0, "Item", __arg0); | ||
builder.AddAttribute(__seq1, "GenericFragment", __arg1); | ||
builder.AddAttribute(__seq2, "IntFragment", __arg2); | ||
builder.CloseComponent(); | ||
} | ||
} | ||
} | ||
#pragma warning restore 1591 |
29 changes: 29 additions & 0 deletions
29
...est/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 - TestComponent - Microsoft.AspNetCore.Components.ComponentBase - | ||
DesignTimeDirective - | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning disable 0414 | ||
CSharpCode - | ||
IntermediateToken - - CSharp - private static System.Object __o = null; | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning restore 0414 | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
Component - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent | ||
ComponentChildContent - (32:1,2 [53] x:\dir\subdir\Test\TestComponent.cshtml) - GenericFragment - context | ||
CSharpExpression - (50:1,20 [17] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (50:1,20 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower() | ||
ComponentChildContent - (89:2,2 [35] x:\dir\subdir\Test\TestComponent.cshtml) - IntFragment - context | ||
CSharpExpression - (103:2,16 [7] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (103:2,16 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context | ||
ComponentAttribute - (19:0,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Item - AttributeStructure.DoubleQuotes | ||
CSharpExpression - (20:0,20 [6] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "hi" | ||
NamespaceDeclaration - - __Blazor.Test.TestComponent | ||
ClassDeclaration - - internal static - TypeInference - - | ||
ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateMyComponent_0 |
15 changes: 15 additions & 0 deletions
15
...ildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Source Location: (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|"hi"| | ||
Generated Location: (957:25,21 [4] ) | ||
|"hi"| | ||
|
||
Source Location: (50:1,20 [17] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|context.ToLower()| | ||
Generated Location: (1151:33,20 [17] ) | ||
|context.ToLower()| | ||
|
||
Source Location: (103:2,16 [7] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|context| | ||
Generated Location: (1370:42,16 [7] ) | ||
|context| | ||
|
66 changes: 66 additions & 0 deletions
66
...ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// <auto-generated/> | ||
#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 class TestComponent : Microsoft.AspNetCore.Components.ComponentBase | ||
{ | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) | ||
{ | ||
__Blazor.Test.TestComponent.TypeInference.CreateMyComponent_0(builder, 0, 1, | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
"hi" | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
, 2, (context) => (builder2) => { | ||
builder2.AddContent(3, | ||
#nullable restore | ||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
context.ToLower() | ||
#line default | ||
#line hidden | ||
#nullable disable | ||
); | ||
} | ||
, 4, (context) => (builder2) => { | ||
builder2.AddContent(5, | ||
#nullable restore | ||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
context | ||
#line default | ||
#line hidden | ||
#nullable disable | ||
); | ||
} | ||
); | ||
} | ||
#pragma warning restore 1998 | ||
} | ||
} | ||
namespace __Blazor.Test.TestComponent | ||
{ | ||
#line hidden | ||
internal static class TypeInference | ||
{ | ||
public static void CreateMyComponent_0<TItem>(global::Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int seq, int __seq0, TItem __arg0, int __seq1, global::Microsoft.AspNetCore.Components.RenderFragment<TItem> __arg1, int __seq2, global::Microsoft.AspNetCore.Components.RenderFragment<System.Int32> __arg2) | ||
{ | ||
builder.OpenComponent<global::Test.MyComponent<TItem>>(seq); | ||
builder.AddAttribute(__seq0, "Item", __arg0); | ||
builder.AddAttribute(__seq1, "GenericFragment", __arg1); | ||
builder.AddAttribute(__seq2, "IntFragment", __arg2); | ||
builder.CloseComponent(); | ||
} | ||
} | ||
} | ||
#pragma warning restore 1591 |
22 changes: 22 additions & 0 deletions
22
...est/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 - TestComponent - Microsoft.AspNetCore.Components.ComponentBase - | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
Component - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent | ||
ComponentChildContent - (32:1,2 [53] x:\dir\subdir\Test\TestComponent.cshtml) - GenericFragment - context | ||
CSharpExpression - (50:1,20 [17] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (50:1,20 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower() | ||
ComponentChildContent - (89:2,2 [35] x:\dir\subdir\Test\TestComponent.cshtml) - IntFragment - context | ||
CSharpExpression - (103:2,16 [7] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (103:2,16 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context | ||
ComponentAttribute - (19:0,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Item - AttributeStructure.DoubleQuotes | ||
CSharpExpression - (20:0,20 [6] x:\dir\subdir\Test\TestComponent.cshtml) | ||
IntermediateToken - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "hi" | ||
NamespaceDeclaration - - __Blazor.Test.TestComponent | ||
ClassDeclaration - - internal static - TypeInference - - | ||
ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateMyComponent_0 |