Skip to content

Enhance the NameResolution System#19536

Open
evgTSV wants to merge 6 commits intodotnet:mainfrom
evgTSV:fix-overloads-checking
Open

Enhance the NameResolution System#19536
evgTSV wants to merge 6 commits intodotnet:mainfrom
evgTSV:fix-overloads-checking

Conversation

@evgTSV
Copy link
Copy Markdown
Contributor

@evgTSV evgTSV commented Mar 31, 2026

Fixes #19349

-> Fix accessibility and type-matching for pattern-based extension lookups (CE, Dispose, etc.)

Summary

This PR fixes an issue where pattern-based extension method lookups (specifically for Computation Expressions and use bindings) would incorrectly resolve methods that are either inaccessible (private/internal) or belong to incompatible types.

Problem

Previously, the compiler's name resolution for CE-specific methods (like Bind, Delay, Run, etc.) and the Dispose pattern for resource cleanup was overly optimistic. It often bypassed accessibility checks, leading to incorrect method resolution or even compilation of calls to private extension methods from outside their scope.

Checklist

  • Test cases added
  • Release notes entry updated:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

❗ Release notes required


✅ 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

@evgTSV evgTSV force-pushed the fix-overloads-checking branch from 3f7dd89 to 170baf1 Compare March 31, 2026 21:21
@evgTSV
Copy link
Copy Markdown
Contributor Author

evgTSV commented Apr 1, 2026

It seems that my changes broke FSharp.Core. I suppose that we have to adjust type equality check to work with the core code.

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.

Unexpected type inference for Run method - generic constraints are checked too late

1 participant