microsoft / microsoft/TypeScript
Function's attached JSDoc is not preserved when using OmitThisParameter
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Bug Report
🔎 Search Terms
JSDoc, types with docs, preserve docs, OmitThisParameter, bind, inherit description
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "Something to do with
this" and "Strong typing ofFunctionmemberscall/bind/apply"
⏯ Playground Link
Playground link with relevant code
💻 Code
/**
* This description is lost
*
* @param p As well as this decription
*/
function func(this: {}, p: string): void {}
const f = func as OmitThisParameter<typeof func>;
const g = func.bind({});
🙁 Actual behavior
Hovering over f (or g) shows the type but not the descriptions that were attached to func.
🙂 Expected behavior
f and g to inherit the descriptions of func.
Clarification
The problem mainly lies with OmitThisParameter as bind's declaration uses it.
I'm also not sure if this is considered a bug or a missing feature, so I apologize in advance if this is not the right way to report it.
Might be related to #50715
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der bereitgestellten Playground-Reproduktion und prüfen Sie, wie OmitThisParameter deklariert und auf func angewendet wird, einschließlich der bind-Deklaration, die es verwendet. Das Issue ist abgeschlossen, wenn beim Überfahren von f und g die Beschreibung von func und die @param-Dokumentation erhalten bleiben und das bestehende Verhalten anhand der zugehörigen Diskussion #50715 überprüft wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100