-
Notifications
You must be signed in to change notification settings - Fork 679
Closed
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingType OrderingAn issue related to ordering of typesAn issue related to ordering of typesbugSomething isn't workingSomething isn't working
Description
function foo(x?: object) {
return Object.entries(x || {})
.sort(([k1, v1], [k2, v2]) => v1.name.localeCompare(v2.name));
}
This passes typechecking in 5.8.3 but fails in b00279c. While tsc infers v1
and v2
as any
, tsgo
infers them as unknown
.
tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["esnext", "dom", "dom.iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"allowJs": false,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": false,
"noImplicitAny": true,
"checkJs": false,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUncheckedIndexedAccess": true,
"useUnknownInCatchVariables": true,
"strictNullChecks": true
},
"include": ["*.ts"]
}
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingType OrderingAn issue related to ordering of typesAn issue related to ordering of typesbugSomething isn't workingSomething isn't working