- Notifications
You must be signed in to change notification settings - Fork 720
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingbugSomething isn't workingSomething isn't working
Description
Steps to reproduce
mkdir tsgo-vs-tsc cd tsgo-vs-tsc npm init -y npm pkg set type=module npm i typescript @typescript/native-preview css-tree @types/css-tree -D npx tsc --init --module nodenext --moduleResolution nodenext printf "import { parse, walk } from 'css-tree';\nconst declarationsText = '...';\nconst ast = parse(declarationsText, { context: 'declarationList', positions: true });\n\nwalk(ast, {\n visit: 'Declaration',\n enter(node) {\n console.log(node);\n },\n});" > main.ts npx tsc --noEmit npx tsgo --noEmit
In case your terminal doesn't support printf
, the contents of main.ts
:
import { parse, walk } from 'css-tree'; const declarationsText = '...'; const ast = parse(declarationsText, { context: 'declarationList', positions: true }); walk(ast, { visit: 'Declaration', enter(node) { console.log(node); }, });
Behavior with typescript@5.8
No type errors. node
is inferred as Declaration
.
Behavior with tsgo
main.ts:7:11 - error TS7006: Parameter 'node' implicitly has an 'any' type. 7 enter(node) { ~~~~ Found 1 error in main.ts:7
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingbugSomething isn't workingSomething isn't working