Show [<Literal>] and constant value for IL fields in Go to Metadata#19922
Open
T-Gro wants to merge 5 commits into
Open
Show [<Literal>] and constant value for IL fields in Go to Metadata#19922T-Gro wants to merge 5 commits into
T-Gro wants to merge 5 commits into
Conversation
…11526) Adds a new MetadataAsTextILField module in tests/FSharp.Compiler.Service.Tests/Symbols.fs covering the rendering of IL literal (const) static fields via FSharpEntity.TryGetMetadataText(). Tests added: - Theory with 5 rows (Int32/Int64/Byte/SByte MaxValue/MinValue) asserting the rendered metadata contains [<Literal>] and "= <value>". - Fact for System.Char.MaxValue asserting [<Literal>] and "=" appear on the MaxValue line. - Negative Fact for System.Math.PI (initonly, non-literal) asserting it is NOT tagged [<Literal>] and has no "=". Current state (RED): total: 7, failed: 6, succeeded: 1 - 5 Theory rows + Char.MaxValue Fact fail with Assert.Contains() Failure: Sub-string not found because NicePrint.layoutILFieldInfo currently drops [<Literal>] and the literal value. - Math.PI passes (guards against regression of normal static val rendering). Sprint 02 will implement the fix in src/Compiler/Checking/NicePrint.fs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-to-Metadata Note: Sprint 01 test assumptions were partially incorrect: - Math.PI is actually a literal const in IL (not initonly); replaced with System.String.Empty for the non-literal case. - The 'first line containing fieldName' finder matched doc-comment lines; narrowed to lines containing 'val <fieldName>:'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fantomas no-op (both touched files are in .fantomasignore); no .bsl baseline drift observed in targeted MetadataAsTextILField run (7/7 passed in 13s). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
CI `check_release_notes` requires the entry to live in the VNEXT release-notes path (currently 11.0.100.md), not in the shipped 9.0.300.md release. Move the bullet, no behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11526
IL literal (
const) fields such asSystem.Char.MaxValuenow render with[<Literal>]and their constant value in Go to Metadata, instead ofappearing as plain
static valdeclarations.