-
Notifications
You must be signed in to change notification settings - Fork 783
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
Inaccurate error in anonymous record copy-and-update #14814
Comments
I tried fixing this on #15598 and quickly realized there seemed to be an unexpected internal error while executing the following test. Which blocks any further attempt to improve the error reporting on anonymous records :(
[<Fact>]
let ``This expression was expected to have an anonymous Record but has a record`` () =
Fsx """
let t3 (t1: {| gu: string; ff: int |}) = { t1 with ff = 3 }
"""
|> ignoreWarnings
|> typecheck
|> shouldFail
|
Hmm... I don't expect these are related |
This was introduced by this PR: #15214 |
@KevinRansom That sounds suspicious, because #15214 was merged in May, and I can reproduce this problem using .NET SDK 6.0.100 which was released in November 2021 and in .NET SDK 7.0.101.
I didn't try it on other versions. |
Off-topic: I wonder if we could enable the normal record syntax for anon records too? RFC says this:
For some reason I thought it was already allowed, and when the normal record syntax is used, an anonymous record of the same type would be produced. |
Repro steps
or sharplab.
Expected behavior
Error saying brace-pipes are required.
Actual behavior
Squiggly under
ff
withThe record label 'ff' is not defined.
.Related information
The text was updated successfully, but these errors were encountered: