-
Notifications
You must be signed in to change notification settings - Fork 668
Closed
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking
Description
I've seen a few instances where errors are on different lines, which with suppressions causes tsgo errors on code that compiles with tsc.
Maybe this is an accepted breaking change?
One example is this:
type Y = {
a: number;
b: number;
};
function fetchA() {
return { a: 1, b: 2 };
}
function getA() {
return { a: 1, c: "123" };
}
async function X(d?: string): Promise<Y> {
const z = getA();
return d && d !== z.c
? fetchA()
: // @ts-expect-error
z;
}
in tsc the error is on z - in tsgo the error is on the return line.
In other cases I've seen errors on every property in a object where in tsc it errors on the top of the whole object so its not always "up" a node.
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking