-
Notifications
You must be signed in to change notification settings - Fork 816
Labels
bugSomething isn't workingSomething isn't working
Description
Steps to reproduce
let state: number = 0;
/**
* Sets the state to a new value.
* @param value - A number to set the state directly.
* @param newState - A function that takes the previous state and returns a new state.
*/
export function setState(value: number): void;
export function setState(newState: (prevState: number) => number): void;
export function setState(valueOrFunction: number | ((prevState: number) => number)): void {
state = typeof valueOrFunction === 'function'
? valueOrFunction(state)
: valueOrFunction;
}
/**
* Gets the current state value.
* @returns The current state as a number.
*/
export function getState(): number {
return state;
}I found this regression in parseFormData in @remix-run/form-data-parser.
バージョン: 1.108.2 (user setup)
コミット: c9d77990917f3102ada88be140d28b038d1dd7c7
日付: 2026-01-21T13:52:09.270Z
Electron: 39.2.7
ElectronBuildId: 12953945
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.26200
- Launch VS Code
- Install the TS Native Preview Extension (0.20260127.1)
- Create a new file
- Paste the above code
- Hover the mouse pointer over the function signatures other than
function setState(value: number): void - "TypeScript Native Preview: Enable (Experimental)/Disable" and go to 5. again
Behavior with typescript@5.9
Non-top overload setState(newState: (prevState: number) => number): void:
Implementation setState(valueOrFunction: number | ((prevState: number) => number)): void:
Behavior with tsgo
"(+1 overload)" and the JSDoc are not displayed in other than the top overload signature.
Non-top overload setState(newState: (prevState: number) => number): void:
Implementation setState(valueOrFunction: number | ((prevState: number) => number)): void:

Copilot
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working