Closed
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"]
}