diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs index c14950aae5..96d336ca72 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Extensions/EliminateMethodBodyPass.cs @@ -8,8 +8,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Extensions { internal sealed class EliminateMethodBodyPass : IntermediateNodePassBase, IRazorOptimizationPass { - // Run late in the optimization phase - public override int Order => int.MaxValue; + // Run early in the optimization phase + public override int Order => int.MinValue; protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) { diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs index 2e2d33795b..e9b8583cd4 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs @@ -70,21 +70,6 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests Assert.Same(typeof(StringBuilder), property.PropertyType); } - [Fact] - public void DeclarationConfiguration_IncludesRef() - { - // Arrange & Act - var component = CompileToComponent(@" -@using System.Text -
-"); - - // Assert - var field = component.GetType().GetField("myDiv", BindingFlags.NonPublic | BindingFlags.Instance); - Assert.NotNull(field); - Assert.Same(typeof(ElementReference), field.FieldType); - } - [Fact] public void DeclarationConfiguration_IncludesInherits() {