Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Improve description of `limitations of extensions`

Aperta Adatta ai principianti
#56,626 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
documentation

Direzione di ricerca

Leggi docs/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods.md e rivedi il paragrafo sulla risoluzione dei membri di estensione insieme alla formulazione proposta nell’issue. Aggiorna la spiegazione in modo che descriva chiaramente come il tipo dichiarato della variabile influisce sul metodo chiamato; il lavoro è completo quando la spiegazione affronta la confusione sollevata e corrisponde alla terminologia dell’articolo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

:watch: Not Triaged advanced-concepts/subsvc dotnet-csharp/svc
Type of issue

Missing information

Description

I tried to understand the following sentences but it was not easy for me. For instance I missed the part that the method was not specified on interface so the method call resolved to e anxtension method.

Extension members are resolved at compile time, using the declared type of the variable. Classes that implement the interface can provide a better implementation for any extension member. Variable declarations must match the implementing type to enable the compiler to choose that implementation. When the compile-time type matches the interface, method calls resolve to the extension member.

I suggest we replace with

The compiler chooses an extension method based on the variable's declared type, not the object's actual type. If a class has its own method with the same name as an extension method, that method is used only when the variable is declared as that class. If the variable is declared as the interface, the compiler can't see the class's method, so it calls the extension method.

What do you think of it? Appreciate any feedbacks!

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods.md

Document Version Independent Id

98229926-6c7a-3ad1-ab5c-86231253986c

Platform Id

5f097f47-9790-5a92-55f5-70776d1c799f

Article author

@BillWagner

Metadata
  • ID: 2c7899e8-3f01-41d2-137a-e334b73699a4
  • PlatformId: 5f097f47-9790-5a92-55f5-70776d1c799f
  • Service: dotnet-csharp
  • Sub-service: advanced-concepts

Related Issues

Lingua principale
Nessun dato sulla lingua
Stelle
4.8k
Fork
6.1k
Merge medio
1g 1h
PR unite (30g)
215

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/docs

Tutte le issue di dotnet/docs

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.