dotnet/roslyn
在 GitHub 查看Investigate a niche 'required' scenario where the compiler overrides a property from IL
Open
#62,426 创建于 2022年7月6日
Area-CompilersBugFeature - Required Membershelp wanted
仓库指标
- Star
- (20,414 star)
- PR 合并指标
- (平均合并 6天 17小时) (30 天内合并 256 个 PR)
描述
So here is the scenario:
- Define a
Derivedrecord that implements aBaserecord.Basewill be justrecord Base;Derivedwill be written in IL whereEqualityContractis marked required (add setter toEqualityContractin 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.