Closed lNaymonl closed 1 year ago
@lNaymonl My TypeScript version is 5.2.2, and when I tried to reproduce your issue, everything seems to be working fine, unless I missed something.
I can reproduce this. @lNaymonl @13OnTheCode could you both post your tsconfig.json settings please?
@andrewbranch
"compilerOptions": {
"strict": true,
"noEmit": true,
"allowJs": true,
"skipLibCheck": true,
"isolatedModules": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"useDefineForClassFields": true,
"noUncheckedIndexedAccess": true,
"allowImportingTsExtensions": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true
}
Still repros for me with those settings 👀
@Andarist does this look familiar to you?
Yes, Im already investigating this and gonna likely put up a PR for this soon-ish
Could have sworn either you or I have fixed this about 20 times already in the past
I can reproduce this. @lNaymonl @13OnTheCode could you both post your tsconfig.json settings please?
{ "compileOnSave": false, "compilerOptions": { "downlevelIteration": true, "module": "es2020", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es2018", "resolveJsonModule": true, "allowSyntheticDefaultImports": true, "skipLibCheck": true, "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ], "baseUrl": ".", "paths": { "globalize": [ "../node_modules/globalize/dist/globalize" ], "globalize/*": [ "../node_modules/globalize/dist/globalize/*" ], "cldr": [ "../node_modules/cldrjs/dist/cldr" ], "cldr/*": [ "../node_modules/cldrjs/dist/cldr/*" ] } } }
If i try it in VS, it works like a charm. I also tried it without the vscode extension, which worked as well.
I prepared a fix for this here: https://github.com/microsoft/TypeScript/pull/55552
Type: Bug
Extension version: 5.3.20230827
Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045
Problem: The Codesuggestion shows "1", "2", "3", "4" event though
a
is "valA". When hovering it also shows thatb
has type "1" | "2". And when i select "3" or "4" it gives me the following error:Argument of type '"3"' is not assignable to parameter of type '"1" | "2"'.
Expected: The Codesuggestion should only display"1" and "2".
Source Code: