Skip to content

Can anyone explain why properties cannot directly extend an accessor when inheriting? #7174

Answered by huoyaoyuan
zms9110750 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually, what I want to ask is, why does IList not inherit IReadonlyList.

A historical fact: the readonly interfaces (.NET Framework 4.5) comes way after non-readonly generic interfaces (.NET Framework 2.0).

"Moving" the declaration of interface member to base interface is a breaking change, since it will break explicit interface implementation. If we redesign the interfaces today, the read-write interfaces will probably inherit from corresponding readonly ones.

Replies: 8 comments 29 replies

Comment options

You must be logged in to vote
5 replies
@zms9110750
Comment options

@CyrusNajmabadi
Comment options

@zms9110750
Comment options

@CyrusNajmabadi
Comment options

@jnm2
Comment options

jnm2 May 10, 2023
Collaborator

Comment options

You must be logged in to vote
8 replies
@zms9110750
Comment options

@CyrusNajmabadi
Comment options

@zms9110750
Comment options

@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@yaakov-h
Comment options

@zms9110750
Comment options

@Joe4evr
Comment options

@TahirAhmadov
Comment options

@Joe4evr
Comment options

Comment options

You must be logged in to vote
1 reply
@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
6 replies
@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@zms9110750
Comment options

@CyrusNajmabadi
Comment options

@zms9110750
Comment options

Comment options

You must be logged in to vote
3 replies
@TahirAhmadov
Comment options

@DavidArno
Comment options

@jnm2
Comment options

jnm2 May 10, 2023
Collaborator

Answer selected by jnm2
Comment options

You must be logged in to vote
1 reply
@DavidArno
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
9 participants