Skip to content

[WIP] RFC-1331 Expression-scoped opens #18814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

ijklam
Copy link
Contributor

@ijklam ijklam commented Aug 4, 2025

Description

Implements fsharp/fslang-suggestions#96
RFC fsharp/fslang-design#810

This PR only implements open in expressions. Open in type is not implemented.

图片

Checklist

  • Test cases added
  • Release notes entry updated:
  • Add language feature flag

Copy link
Contributor

github-actions bot commented Aug 4, 2025

❗ 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/10.0.100.md
LanguageFeatures.fsi docs/release-notes/.Language/preview.md

@ijklam ijklam changed the title [WIP] RFC-1331 Expression or type scoped opens [WIP] RFC-1331 Expression-scoped opens Aug 8, 2025
@ijklam ijklam marked this pull request as ready for review August 8, 2025 10:29
@ijklam ijklam requested a review from a team as a code owner August 8, 2025 10:29
@ijklam
Copy link
Contributor Author

ijklam commented Aug 8, 2025

This PR does not implement "open in types" feature. It needs some refactoring to implement the feature, which needs someone who knows a lot about the typechecking mechanics. I did make a prototype, but I am not satisfied on its restriction, working way and performance. It requires putting open declarations on the beginning of a type definition, and has bug in type ... and ... declaration. While typechecking, it need find and apply open declarations to the environment multiple times, and it causes the UnusedOpens.getUnusedOpens returning duplicated items for type-scoped opens. Also, when the line of open has error, it will raise multiple same error for it.

@T-Gro
Copy link
Member

T-Gro commented Aug 11, 2025

@ijklam : Thanks for the summary of the current state. I will convert the PR to a draft to prevent accidental merge for now.

@T-Gro T-Gro marked this pull request as draft August 11, 2025 12:41
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.

3 participants