microsoft / microsoft/TypeScript
Error elaborations should not be de-duped
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
TypeScript Version: 3.5.1
Search Terms:
- Error message different
Code
interface ExprData {
mapper : () => unknown,
blah : string,
}
interface Expr<DataT extends ExprData> {
mapper : DataT["mapper"],
blah : DataT["blah"],
extra : number,
}
declare function where (
callback : () => Expr<{
mapper : () => boolean,
blah : string,
}>
) : void;
declare function getInvalidWhere () : Expr<{
mapper : () => (boolean|null),
blah : string,
}>;
/*
Type 'Expr<{ mapper: () => boolean | null; blah: string; }>' is not assignable to type 'Expr<{ mapper: () => boolean; blah: string; }>'.
Type '{ mapper: () => boolean | null; blah: string; }' is not assignable to type '{ mapper: () => boolean; blah: string; }'.
Types of property 'mapper' are incompatible.
Type '() => boolean | null' is not assignable to type '() => boolean'.
Type 'boolean | null' is not assignable to type 'boolean'.
Type 'null' is not assignable to type 'boolean'.
*/
where(() => getInvalidWhere())
/*
Expected: Same error as above,
Actual:
Type 'Expr<{ mapper: () => boolean | null; blah: string; }>' is not assignable to type
'Expr<{ mapper: () => boolean; blah: string; }>'.
*/
where(() => getInvalidWhere())
Expected behavior:
- Both errors should have the same error message, if they're in the same file.
- Both errors should have the same error message, if they're in different files.
Actual behavior:
- Both errors have different error messages in the same file.
- Both errors have different error messages in different files.
Playground Link:
Related Issues:
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non è indicato alcun file sorgente né alcun test. Inizia riproducendo le due chiamate nell'esempio TypeScript fornito e confronta le diagnosi del Playground o di un compilatore locale, quindi segui il percorso di elaborazione e deduplicazione degli errori del compilatore. Il lavoro è concluso quando le elaborazioni ripetute mantengono lo stesso messaggio completo sia nel caso dello stesso file sia nel caso di file diversi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100