dotnet / csharpstandard

Working space for ECMA-TC49-TG2, the C# standard committee.
Creative Commons Attribution 4.0 International
714 stars 84 forks source link

15.2.4.2 Base classes #150

Open gafter opened 7 years ago

gafter commented 7 years ago

While determining the meaning of the direct base class specification A of a class B, the direct base class of B is temporarily assumed to be object. Intuitively this ensures that the meaning of a base class specification cannot recursively depend on itself.

We cannot know whether the syntax is a base class specification until after the base type is bound (because we don't know if it is an interface or class), but we can't bind the base type until we know whether or not to assume, temporarily, it is object.

What we implement is that we assume the base type is object while binding the entire base clause.

gafter commented 7 years ago

Note to self: suggest changing the grammar to remove distinction between class-type and interface-type in class-base.

jskeet commented 7 years ago

We decided to punt on this until C# 6, yes? Assigning the milestone as that for the moment, but please correct me if I've misremembered.

gafter commented 7 years ago

I'm not sure, but that sounds like a good way to handle it.

jskeet commented 6 years ago

All comments prior to this one were before we removed section 7. I've updated the title only.

gafter commented 4 years ago

See also https://github.com/dotnet/roslyn/issues/43609

jskeet commented 3 years ago

I'm happy for this to be reclassified as clarity if folks see fit.