Skip to content

Bugfix :: SRTP - ApplyDefaults for TyparConstraint.MayResolveMember - #19218

Merged
T-Gro merged 20 commits into
mainfrom
bugfix/srtp-resolution
Jan 22, 2026
Merged

Bugfix :: SRTP - ApplyDefaults for TyparConstraint.MayResolveMember#19218
T-Gro merged 20 commits into
mainfrom
bugfix/srtp-resolution

Conversation

@T-Gro

@T-GroT-Gro commented Jan 17, 2026

Copy link
Copy Markdown
Member

Fixes a regression introduced in .NET 9 SDK that caused FSharpPlus curryN-style SRTP patterns to fail with FS0030 (value restriction error).

Root Cause

The FreshenTypar function (added for Interfaces with Abstract Static Members) clears StaticReq to None when refreshing type parameters. However, ApplyDefaults in CheckDeclarations.fs only solved typars where StaticReq <> None, missing SRTP typars that have MayResolveMember constraints but no explicit static requirement set.

Fix

Extended ApplyDefaults to also solve typars that have MayResolveMember constraints, regardless of their StaticReq value.

@github-actions

github-actionsBot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

@T-Gro,

Caution

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:

* <Informative description>. ([PR #XXXXX](https://github.com/dotnet/fsharp/pull/XXXXX))

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

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

Change pathRelease notes pathDescription
src/Compilerdocs/release-notes/.FSharp.Compiler.Service/11.0.100.mdNo release notes found or release notes format is not correct

@T-Gro

Copy link
Copy Markdown
MemberAuthor

/run ilverify

@github-actions

Copy link
Copy Markdown
Contributor

🔧 CLI Command Report

  • Command:/run ilverify
  • Outcome: success

✅ Command succeeded, no changes needed.

Comment threadazure-pipelines-PR.yml
Comment threadazure-pipelines-PR.yml Outdated
Comment threadazure-pipelines-PR.yml Outdated
Comment threadazure-pipelines-PR.yml Outdated
CopilotAI added a commit that referenced this pull request Jan 19, 2026
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
@dotnetdotnet deleted a comment from CopilotAIJan 19, 2026
Comment threadazure-pipelines-PR.yml Outdated
@T-Gro
T-Gro marked this pull request as ready for review January 21, 2026 19:36
@T-Gro
T-Gro requested a review from a team as a code ownerJanuary 21, 2026 19:36
@T-Gro
T-Gro requested a review from abonieJanuary 21, 2026 19:36
@T-Gro
T-Gro enabled auto-merge (squash) January 22, 2026 11:52
@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingJan 22, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@T-Gro@abonie