-
Notifications
You must be signed in to change notification settings - Fork 6k
Clarify difference between type annotation and type test patterns in F# documentation #49260
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
Clarify difference between type annotation and type test patterns in F# documentation #49260
Conversation
Co-authored-by: BillWagner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready once I apply suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR clarifies the distinction between type annotation patterns and type test patterns in F# pattern matching documentation. These syntactically similar patterns serve fundamentally different purposes—compile-time type inference vs. runtime type checking—which was causing reader confusion.
Key changes:
- Enhanced explanations for both pattern types with clear compile-time vs. runtime distinctions
- Added a new comparison section with side-by-side examples and a feature comparison table
- Added C# equivalents to make concepts more accessible to developers from other .NET languages
All suggestions have been applied in commit e0e0ee0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing frontmatter/metadata.
Co-authored-by: BillWagner <[email protected]>
Added |
Summary of Changes
Enhanced the F# pattern matching documentation to clearly contrast between:
Pattern That Has Type Annotation (
pattern : type
):Type Test Pattern (
:? type
):is
oras
operatorsNew Contrasting Section:
All code examples have been verified to compile successfully with F# 9.0.
Applied formatting fixes per code review and added required
ai-usage: ai-assisted
frontmatter metadata.💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Internal previews