dotnet/roslyn

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

Open

#62.426 aberto em 6 de jul. de 2022

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)C# (4.257 forks)batch import
Area-CompilersBugFeature - Required Membershelp wanted

Métricas do repositório

Stars
 (20.414 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)

Description

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.

Guia do colaborador