-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Cloning a .NET 8 record deriving from a .NET 7 record leads to loss of members #72357
Labels
4 - In Review
A fix for the issue is submitted for review.
Area-Compilers
Bug
Feature - Records
Records
Milestone
Comments
@jcouv PTAL |
Some notes from when I was looking at this earlier today from a ping from a discord user: both |
333fred
added a commit
to 333fred/roslyn
that referenced
this issue
Dec 10, 2024
…ite warnings We were returning early from generating a call to the base record copy constructor initializer if use site diagnostics reported any kind of diagnostic, including warnings. This isn't good in general, but is particularly bad for warnings like CS1701, which are typically suppressed by the SDK and results in what seems like a completely clean csc invocation skipping calling the base constructor. Fixes dotnet#72357.
333fred
added a commit
that referenced
this issue
Dec 11, 2024
…ite warnings (#76347) * Do not bail generating base type initializer in the presence of use site warnings We were returning early from generating a call to the base record copy constructor initializer if use site diagnostics reported any kind of diagnostic, including warnings. This isn't good in general, but is particularly bad for warnings like CS1701, which are typically suppressed by the SDK and results in what seems like a completely clean csc invocation skipping calling the base constructor. Fixes #72357. * Set FailsPEVerify * Only run test on coreclr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
4 - In Review
A fix for the issue is submitted for review.
Area-Compilers
Bug
Feature - Records
Records
Version Used:
Compiler "4.8.0-7.24067.24 (2635711)"
Steps to Reproduce:
with
Demo.zip
https://gist.github.com/Watno/f6d78b49a15530e69a2a1cc1ce8d1e40
Expected Behavior: Members of the base record get cloned to the copy
Actual Behavior: Members of the base record disappear
Additional information: The IL code of the constructor of
DerivedRecord
seems to be broken:The text was updated successfully, but these errors were encountered: