You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inaccurate error in anonymous record copy-and-update #14814
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 :(
Unexpected exception raised in compiler: destAppTy (Failure)
[<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
System.AggregateException: One or more errors occurred. (One or more errors occurred. (Unknown exception seen in compiler: JetBrains.ReSharper.TestRun...
System.AggregateException
One or more errors occurred. (One or more errors occurred. (Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unknown exception seen in compiler: JetBrains.ReSharper.TestRunner.Logging.TraceListener+AssertionException: Unexpected exception raised in compiler: destAppTy (Failure)
@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.
eugene@Eugenes-Air:ConsoleApp30$ dotnet build
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /Users/eugene/RiderProjects/ConsoleApp30/ConsoleApp30/ConsoleApp30.fsproj (in 158 ms).
/Users/eugene/RiderProjects/ConsoleApp30/ConsoleApp30/Program.fs(2,52): error FS0039: The record label 'ff' is not defined. [/Users/eugene/RiderProjects/ConsoleApp30/ConsoleApp30/ConsoleApp30.fsproj]
Build FAILED.
/Users/eugene/RiderProjects/ConsoleApp30/ConsoleApp30/Program.fs(2,52): error FS0039: The record label 'ff' is not defined. [/Users/eugene/RiderProjects/ConsoleApp30/ConsoleApp30/ConsoleApp30.fsproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:01.66
Activity
edgarfgp commentedon Jul 14, 2023
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 :(
Unexpected exception raised in compiler: destAppTy (Failure)@abonie Does this ring a bell based on #15519 ?
abonie commentedon Jul 14, 2023
Hmm... I don't expect these are related
KevinRansom commentedon Jul 19, 2023
This was introduced by this PR: #15214
auduchinok commentedon Jul 19, 2023
@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.
auduchinok commentedon Jul 19, 2023
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.