dotnet/roslyn

Investigate a niche 'required' scenario where the compiler overrides a property from IL

Open

#62,426 创建于 2022年7月6日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)C# (4,257 fork)batch import
Area-CompilersBugFeature - Required Membershelp wanted

仓库指标

Star
 (20,414 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

So here is the scenario:

  • Define a Derived record that implements a Base record.
    • Base will be just record Base;
    • Derived will be written in IL where EqualityContract is marked required (add setter to EqualityContract in IL if necessary)
  • In C#, define a regular record that inherits Derived, ie, record R3 : Derived;
  • Will it compile successfully? It probably shouldn't?

I messaged @333fred about this scenario, and we both agree it's not an important one, but can probably have a bug.

贡献者指南