-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds a test the demonstrates what happens if you declare a function called nameof in a component
- Loading branch information
Showing
7 changed files
with
264 additions
and
0 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
73 changes: 73 additions & 0 deletions
73
...BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,73 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#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) | ||
{ | ||
__o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Int32>( | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
ParentValue | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
); | ||
__o = new global::System.Action<System.Int32>( | ||
__value => ParentValue = __value); | ||
__builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { | ||
} | ||
)); | ||
#pragma warning disable BL0005 | ||
((global::Test.MyComponent)default). | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
Value | ||
|
||
#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.MyComponent); | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
#pragma warning restore 1998 | ||
#nullable restore | ||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
} | ||
#pragma warning restore 1591 |
27 changes: 27 additions & 0 deletions
27
...est/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,27 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [20] ) - global::System | ||
UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [25] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [45] ) - global::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 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent | ||
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes | ||
CSharpExpression - | ||
LazyIntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue | ||
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes | ||
CSharpExpression - | ||
IntermediateToken - - CSharp - __value => ParentValue = __value | ||
HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
CSharpCode - (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n\n public string nameof(string s) => string.Empty;\n |
23 changes: 23 additions & 0 deletions
23
...ndToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,23 @@ | ||
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|ParentValue| | ||
Generated Location: (1135:29,26 [11] ) | ||
|ParentValue| | ||
|
||
Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|Value| | ||
Generated Location: (1668:44,19 [5] ) | ||
|Value| | ||
|
||
Source Location: (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
| | ||
Generated Location: (2081:62,7 [105] ) | ||
| | ||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
| | ||
|
55 changes: 55 additions & 0 deletions
55
...BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,55 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
{ | ||
__builder.OpenComponent<global::Test.MyComponent>(0); | ||
__builder.AddComponentParameter(1, nameof(global::Test.MyComponent. | ||
#nullable restore | ||
#line (1,20)-(1,25) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
Value | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Int32>( | ||
#nullable restore | ||
#line (1,27)-(1,38) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
ParentValue | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
)); | ||
__builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action<System.Int32>)(__value => ParentValue = __value)); | ||
__builder.CloseComponent(); | ||
} | ||
#pragma warning restore 1998 | ||
#nullable restore | ||
#line (2,8)-(6,1) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
|
||
} | ||
} | ||
#pragma warning restore 1591 |
18 changes: 18 additions & 0 deletions
18
...est/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,18 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [22] ) - global::System | ||
UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [27] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components | ||
ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent | ||
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes | ||
CSharpExpression - | ||
LazyIntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue | ||
ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes | ||
CSharpExpression - | ||
IntermediateToken - - CSharp - __value => ParentValue = __value | ||
CSharpCode - (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n\n public string nameof(string s) => string.Empty;\n |
23 changes: 23 additions & 0 deletions
23
...ndToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/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,23 @@ | ||
Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|Value| | ||
Generated Location: (884:23,0 [5] ) | ||
|Value| | ||
|
||
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|ParentValue| | ||
Generated Location: (1144:31,0 [11] ) | ||
|ParentValue| | ||
|
||
Source Location: (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
| | ||
Generated Location: (1563:43,0 [105] ) | ||
| | ||
public int ParentValue { get; set; } = 42; | ||
|
||
public string nameof(string s) => string.Empty; | ||
| | ||
|