Skip to content
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

Bugfix :: Flexible types should subsume nullable version of equivalent CoarcesTo constraints #18266

Conversation

T-Gro
Copy link
Member

@T-Gro T-Gro commented Jan 23, 2025

Fixes #18056

When using #IDisposable, it should subsume any nullable as well as non-nullable version of the head types (following the inheritance hiearchy).

When using #IDisposable | null as the flexible type, it should subsume nullable versions of any of the types in the hierarchy, and warn on when passed to non-nullable parameters.

Before this fix, a warning was always emitted from an internal compiler call to enforce constraint consistency.

@T-Gro T-Gro linked an issue Jan 23, 2025 that may be closed by this pull request
7 tasks
@dotnet dotnet deleted a comment from github-actions bot Feb 4, 2025
@T-Gro T-Gro marked this pull request as ready for review February 4, 2025 09:24
@T-Gro T-Gro requested a review from a team as a code owner February 4, 2025 09:24
@T-Gro T-Gro changed the title Bugfix :: Flexible types should subsume nullable version of any of the head types Bugfix :: Flexible types should subsume nullable version of equivalent CoarcesTo constraints Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 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/9.0.300.md

@psfinaki
Copy link
Member

psfinaki commented Feb 4, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@T-Gro T-Gro merged commit 10b812b into main Feb 4, 2025
33 checks passed
@T-Gro T-Gro deleted the 18056-nullness-issue---spurious-nullness-warning-with-flexible-type branch February 4, 2025 13:03
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.

Nullness issue - Spurious nullness warning with flexible type
3 participants