dotnet/roslyn
Auf GitHub ansehenInvestigate a niche 'required' scenario where the compiler overrides a property from IL
Open
#62.426 geöffnet am 6. Juli 2022
Area-CompilersBugFeature - Required Membershelp wanted
Repository-Metriken
- Stars
- (20.414 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
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.