Detect recursive inline bindings and emit FS3888 diagnostic#19803
Detect recursive inline bindings and emit FS3888 diagnostic#19803T-Gro wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ostic Extend recursive-inline detection to class members via TcMutRecBindings_Phase2C, using cycle detection through inline bindings only so non-recursive inline member accesses (e.g. inline get/set referencing other plain members) are not false-positives. Refs #17991 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
Fixes #17991
Summary
Recursive use of an inline function or member now produces a clear error (FS3888: The value '{0}' is declared inline but is used recursively. Recursive inline definitions are not supported.) instead of the misleading FS1113/FS1114 errors that appeared previously.
Changes
FSComp.txtplus all localization xlf files.TcLetrecBindings(CheckDeclarations.fs): after collectinglet recbindings, any binding markedinlinethat participates in a recursive cycle now triggers FS3888 at type-check time.TcMutRecBindings_Phase2C(CheckExpressions.fs): extends the same check to class members via cycle detection through inline-only edges, avoiding false positives on non-recursive inline property accessors.TypedTree.fs/.fsi: addedSetInlineInfomutator onValto allow clearing the inline flag after the diagnostic is issued (so downstream phases don't crash).RecursiveSafetyAnalysis.fs): new test cases for recursive inlinelet recbindings and recursive inline members, verifying the diagnostic text and error code.