You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript Version: 3.6.0-dev.20190602 (seems to work with 20190601)
Search Terms:
Code
// @noImplicitAny: trueinterfaceI{a: string;b: string;}declarefunctioncompare(a: I,b: I): number;functiontest(){constresult=[];result.push({foo: true,a: 'a',b: 'b'});// ~~~~~~~~~ error hereresult.sort(compare);// commenting out this line makes the error disappear}
Expected behavior:
No error
Actual behavior:
Argument of type '(a: I, b: I) => number' is not assignable to parameter of type '(a: { foo: boolean; a: string; b: string; }, b: { foo: boolean; a: string; b: string; }) => number'.
Types of parameters 'a' and 'a' are incompatible.
Type '{ foo: boolean; a: string; b: string; }' is not assignable to type 'I'.
Object literal may only specify known properties, and 'foo' does not exist in type 'I'.
Maybe the error makes sense with strictNullChecks enabled (which is off in the above example), but then the location is completely off
TypeScript Version: 3.6.0-dev.20190602 (seems to work with 20190601)
Search Terms:
Code
Expected behavior:
No error
Actual behavior:
Maybe the error makes sense with
strictNullChecks
enabled (which is off in the above example), but then the location is completely offPlayground Link:
Related Issues:
The only two changes in that version are #31711 and #31687. /cc @ahejlsberg
The text was updated successfully, but these errors were encountered: