microsoft / microsoft/TypeScript
Error elaborations should not be de-duped
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
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:
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
Es wird keine Quelldatei und kein Test genannt. Beginne damit, die beiden Aufrufe im bereitgestellten TypeScript-Beispiel zu reproduzieren und die Diagnosen aus dem Playground oder einem lokalen Compiler zu vergleichen, und verfolge dann den Pfad der Fehleraufbereitung und -deduplizierung des Compilers. Als abgeschlossen gilt die Arbeit, wenn wiederholte Aufbereitungen in den Fällen mit derselben Datei und mit unterschiedlichen Dateien dieselbe vollständige Meldung beibehalten.
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