Skip to content

Fix spurious FS0410 for tuple patternInput bindings (#4161)#19947

Draft
KirtiRamchandani wants to merge 1 commit into
dotnet:mainfrom
KirtiRamchandani:fix/pattern-input-accessibility-4161
Draft

Fix spurious FS0410 for tuple patternInput bindings (#4161)#19947
KirtiRamchandani wants to merge 1 commit into
dotnet:mainfrom
KirtiRamchandani:fix/pattern-input-accessibility-4161

Conversation

@KirtiRamchandani

@KirtiRamchandani KirtiRamchandani commented Jun 14, 2026

Copy link
Copy Markdown

Summary

Fixes #4161.

Tuple deconstruction (let b, c = ...) introduces a compiler-generated patternInput module binding for module init. FS0410 incorrectly fires on that temp when its type exposes private tycons (e.g. PT * PT), while the equivalent single binding (let a = ...) compiles fine because objexpr types don't trigger the same check.

This skips the FS0410 accessibility check only for compiler-generated patternInput bindings. Genuine violations still report FS0410 (tuples03.fs, tuples04.fs).

Related prior work: #18426 (closed unmerged; maintainer noted a deeper codegen fix may be preferable long-term).

Verification (local)

Built fsc 15.2.101.0 from this branch and compiled:

File Result
repro4161.fs (private module tuple deconstruction) compiles
tuples02.fs (public + private modules) compiles
tuples03.fs (public module + internal type) FS0410 x2 (expected)
tuples04.fs (internal module + private type) FS0410 x2 (expected)
repro4161.fs --realsig+ compiles

Release ComponentTests build succeeded locally (6205 passed in prior full run).

Fixes #4161

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@KirtiRamchandani

Copy link
Copy Markdown
Author

@KirtiRamchandani please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

Skip accessibility checks on compiler-generated patternInput module bindings.
These temps are module-init scaffolding whose visibility does not reflect the
enclosing let-binding scope, which caused false FS0410 errors when tuple
deconstruction referenced private types in the same module.

Fixes dotnet#4161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Anonymous interface implementation accessibility when tuple deconstruction is used.

1 participant