Skip to content

Conversation

DedSec256
Copy link
Contributor

No description provided.

Copy link
Contributor

❗ Release notes required

@DedSec256,

Caution

No release notes found for the changed paths (see table below).

Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format.

The following format is recommended for this repository:

* <Informative description>. ([PR #XXXXX](https://github.com/dotnet/fsharp/pull/XXXXX))

See examples in the files, listed in the table below or in th full documentation at https://fsharp.github.io/fsharp-compiler-docs/release-notes/About.html.

If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

You can open this PR in browser to add release notes: open in github.dev

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.100.md No release notes found or release notes format is not correct

Comment on lines -1148 to 1149
|> withDiagnostics [
(Error 1, Line 14, Col 41, Line 14, Col 42, "The type 'bool' does not match the type 'int'")
(Error 1, Line 14, Col 41, Line 14, Col 42, "The type 'int' does not match the type 'bool'")
(Error 1, Line 16, Col 32, Line 16, Col 33, "This expression was expected to have type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Image

Here expected = int, actual = bool, which is incorrect. Just two lines below is a similar case, where expected = bool is correct.

(Warning 464, Line 15, Col 35, Line 15, Col 42, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.")
(Error 5, Line 17, Col 1, Line 17, Col 5, "This field is not mutable")
(Error 1, Line 17, Col 16, Line 17, Col 22, "The type 'decimal<Kg>' does not match the type 'float<Kg>'")
(Error 1, Line 17, Col 16, Line 17, Col 22, "The type 'float<Kg>' does not match the type 'decimal<Kg>'")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's simplify this case a bit to

Image

The situation is similar here, the expected type is explicitly specified and is decimal<Kg>, but the error message threats it as the actual type.

Also note that the error range is on the second argument, not on the operator. This is due to the fact that in the error
ErrorFromAddingTypeEquation(...ConstraintSolverTypesNotInEqualityRelation(...m1), m2)the wrong m is taken. But I would fix it in a separate PR.

Comment on lines -183 to +184
(1, "Type mismatch. Expecting a\n 'outref<'T>' \nbut given a\n 'inref<'T>' \nThe type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In'")
(1, "Type mismatch. Expecting a\n 'outref<'T>' \nbut given a\n 'inref<'T>' \nThe type 'ByRefKinds.In' does not match the type 'ByRefKinds.Out'")
Copy link
Contributor Author

@DedSec256 DedSec256 Sep 18, 2025

Choose a reason for hiding this comment

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

Image

In this case (and other with a difference in generic args) the main message is ok, but its clarification at the end has the same problem with the order.

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.

1 participant