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

Type checker: don't suppress errors while checking expressions #18311

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

auduchinok
Copy link
Member

Fixes #17787.

I guess many tests may need to be updated. 🙂

@auduchinok auduchinok requested a review from a team as a code owner February 12, 2025 17:41
Copy link
Contributor

github-actions bot commented Feb 12, 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

Well - 11 tests, that's much less than I would have expected here :)

@@ -51,14 +51,10 @@ neg45.fs(79,28,79,33): typecheck error FS0193: A type parameter is missing a con

neg45.fs(79,20,79,22): typecheck error FS0340: The signature and implementation are not compatible because the declaration of the type parameter 'T' requires a constraint of the form 'T :> System.IComparable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanity check - is this expected? I see that the errors here are duplicates, so it's fine anyway, just asking if that's anyhow logical side effect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not expect it, but since they're duplicates I thought it was fine to just update the baseline.

@@ -16,6 +16,7 @@
* Add support for C# `Experimental` attribute. ([PR #18253](https://github.com/dotnet/fsharp/pull/18253))
* Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186))
* Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290))
* Type checker: don't suppress errors while checking expressions ([PR #18311](https://github.com/dotnet/fsharp/pull/18311))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will need better real-life IDE tests and what it does when typing incomplete snippets of code.
I assume there was a reason to suppress typecheck errors in case of parser errors, to prevent a wall of semantic errors jumping around when typing.

I admit the reasons behind it might have changed, but it would be safer if we could either test this more while typing.

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.

Type checker errors should be reported when syntax errors are present
3 participants