-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed as not planned
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
π Search Terms
Similar/duplicate of #49618, #47599 & #30134. Sorry couldn't come up with a better title.
π Version & Regression Information
Tested with TypeScript 5.7.2
β― Playground Link
π» Code
declare const create: <T>(f: (get: () => T) => T) => T
let t0 = create(() => "")
// ^? string
let t1 = create(_ => "")
// ^? unknown
π Actual behavior
t1
is inferred as unknown
π Expected behavior
t1
should be inferred as string
Additional information about the issue
This is a minimal reproduction of zustand's create
...
import { create } from "zustand"
let t0 = create(() => "")
// ^? UseBoundStore<StoreApi<string>>
let t1 = create(_ => "")
// ^? UseBoundStore<StoreApi<unknown>>
I'm certain this is a duplicate of one of the above mentioned issue I just want to know it's duplicate of which issue exactly
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created