You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #12957's resolution phase uses LazyContent.Create(str, static s => s) in several places to wrap string content. This looks like a no-op but actually controls the IR node type: using LazyContent produces LazyIntermediateToken in the IR tree, while using a plain string produces IntermediateToken. These wrappers were kept for IR baseline compatibility during the refactoring.
What to change
Remove the 4 identity LazyContent.Create wrappers and update IR baselines to use IntermediateToken instead of LazyIntermediateToken:
DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs — search for LazyContent.Create
DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs — search for LazyContent.Create
Each site looks like:
newHtmlIntermediateToken(LazyContent.Create(content,static s =>s),source)
Should become:
newHtmlIntermediateToken(content,source)// or
new IntermediateToken(content,source)
IR baseline updates
.ir.txt test baseline files will change: LazyIntermediateToken → IntermediateToken
No codegen baselines (.codegen.cs, .codegen.html, .mappings.txt) should change — only IR representation differs.
Run .build.cmd -test -projects srcCompilerMicrosoft.AspNetCore.Razor.LanguagetestMicrosoft.AspNetCore.Razor.Language.Test.csproj` to find affected baselines and update them.
Background
PR #12957's resolution phase uses
LazyContent.Create(str, static s => s)in several places to wrap string content. This looks like a no-op but actually controls the IR node type: usingLazyContentproducesLazyIntermediateTokenin the IR tree, while using a plain string producesIntermediateToken. These wrappers were kept for IR baseline compatibility during the refactoring.What to change
Remove the 4 identity
LazyContent.Createwrappers and update IR baselines to useIntermediateTokeninstead ofLazyIntermediateToken:DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs— search forLazyContent.CreateDefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs— search forLazyContent.CreateEach site looks like:
Should become:
IR baseline updates
.ir.txttest baseline files will change:LazyIntermediateToken→IntermediateToken.codegen.cs,.codegen.html,.mappings.txt) should change — only IR representation differs.Notes
.build.cmd -test -projects srcCompilerMicrosoft.AspNetCore.Razor.LanguagetestMicrosoft.AspNetCore.Razor.Language.Test.csproj` to find affected baselines and update them.ref: PR #12957 review comments #12957 (comment)