Previous discussion on similar issue: #3739 (comment).
Steps to reproduce
- Start a plain new project
- "@typescript/native-preview": "7.0.0-dev.20260605.1",
- "typescript": "6.0.3"
- Run
npx tsgo --init to get the default tsconfig. Turn on these flags as well.
- "allowJs": true,
- "checkJs": true,
- "stableTypeOrdering": true,
- Add
src/main.js. Run npx tsc --noEmit & npx tsgo --noEmit to see the difference.
/** @type {unknown} */
let foo;
const { bar = {} } = foo ?? {};
const { buzz = {} } = {};
Behavior with typescript@6.0
src/main.js:4:9 - error TS2339: Property 'buzz' does not exist on type '{}'.
4 const { buzz = {} } = {};
~~~~
Found 1 error in src/main.js:4
Behavior with tsgo
src/main.js:3:9 - error TS2339: Property 'bar' does not exist on type '{}'.
3 const { bar = {} } = foo ?? {};
~~~
Found 1 error in src/main.js:3
Previous discussion on similar issue: #3739 (comment).
Steps to reproduce
npx tsgo --initto get the default tsconfig. Turn on these flags as well.src/main.js. Runnpx tsc --noEmit&npx tsgo --noEmitto see the difference.Behavior with
typescript@6.0Behavior with
tsgo