Skip to content

Handle active patterns with inferred function ty & unsolved range typar #18642

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

Merged
merged 3 commits into from
Jun 2, 2025

Conversation

brianrourkeboll
Copy link
Contributor

@brianrourkeboll brianrourkeboll commented May 30, 2025

Description

Fixes #18638, originally introduced in #16846 (I think?).

  • Treat (|P|) : 'a -> 'b similarly to (|P|) : 'a.

    That is, for an active pattern whose type is known to be a function type but whose range type is not yet solved, assume that it could be solved to, e.g., another function type. This can show up in, e.g., an active pattern that is defined mutually-recursively with and, has no type annotations, and returns a lambda with fun or function.

Checklist

  • Test cases added.
  • Release notes entry updated.

That is, for an active pattern whose type is known to be a function type
but whose range type is not yet solved, assume that it _could_ be solved
to, e.g., another function type. This can show up in, e.g., an active
pattern that is defined mutually-recursively with `and`, has no type
annotations, and returns a lambda with `fun` or `function`.
Copy link
Contributor

github-actions bot commented May 30, 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

@brianrourkeboll brianrourkeboll marked this pull request as ready for review May 30, 2025 23:12
@brianrourkeboll brianrourkeboll requested a review from a team as a code owner May 30, 2025 23:12
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Jun 2, 2025
@abonie abonie merged commit c4a9f34 into dotnet:main Jun 2, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Jun 2, 2025
@brianrourkeboll brianrourkeboll deleted the active-pat-with-unsolved-typars branch June 2, 2025 21:27
Sign up for free to 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.

FS3868 incorrectly triggered for parameterized active patterns in F# 9
3 participants