Skip to content

Consolidate F# optional parameters documentation #47580

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 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 25, 2025

The F# documentation for optional parameters was incomplete and fragmented across multiple files. The methods.md file only covered C# interop-style optional arguments using [<Optional; DefaultParameterValue>] attributes, while missing the native F# optional parameter syntax using ?.

This PR consolidates all optional parameter documentation into the parameters-and-arguments.md file with clear distinctions between the two forms:

  1. Optional Arguments with Late Defaults (F# Native): Using ? syntax for F#-idiomatic optional parameters that are interpreted as F# option types
  2. Optional Arguments with Early Defaults (C# Interop): Using [<Optional; DefaultParameterValue>] attributes for C# compatibility, introduced in F# 4.1

The methods.md file now simply references the comprehensive documentation in parameters-and-arguments.md, eliminating duplication and providing developers with a single authoritative source for all optional parameter information.

This addresses the concern raised in the issue that the F# language's native optional parameter mechanism was not covered in the documentation, which was "very curious" given how commonly this technique is used.

Fixes #45813.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] No information provided on optional parameters Consolidate F# optional parameters documentation Jul 25, 2025
@Copilot Copilot AI requested a review from gewarren July 25, 2025 18:37
Copilot finished work on behalf of gewarren July 25, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No information provided on optional parameters
2 participants