Skip to content

"This expression is not callable." false positive on union of generic functions where the call is valid for all types in the unionΒ #64855

Open

Description

@DetachHead

πŸ”Ž Search Terms

union generic function "has signatures, but none of those signatures are compatible with each other"

πŸ•— Version & Regression Information

tested on 6.0.3 and 7.0.2

⏯ Playground Link

https://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true&noUnusedLocals=true&target=99&jsx=0&resolvePackageJsonExports=true&useUnknownInCatchVariables=true&exactOptionalPropertyTypes=true&noFallthroughCasesInSwitch=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true#code/CYUwxgNghgTiAEYD2A7AzgF3gMyUgXPABQA8AKgHxEBuUEAriIWQJTwC8F8r8APseXggAHhhApgaeCnoBbAEYgYVWgybc2nDQFgAUHuTosUNMGzwOOPEQCMLIA

πŸ’» Code

declare const foo: (<T>(value: T) => T) | (<T extends number>(value: T) => T)

const asdf  = foo(1)

πŸ™ Actual behavior

This expression is not callable.
  Each member of the union type '(<T>(value: T) => T) | (<T extends number>(value: T) => T)' has signatures, but none of those signatures are compatible with each other.

πŸ™‚ Expected behavior

no error, since the call is valid for both function types in the union

Additional information about the issue

No response

Activity

  1. jcalz commented on Oct 18, 2026

    @jcalz
    Contributor

    This is a known limitation of the work in #29011 to address #7294. Currently a union of call signatures can have at most one overloaded member and one generic member. Here you have two generic members, so TS does not try to unify. Not sure if this will be closed as a design limitation, or kept open as a feature request to try again to look at unification, but it's not considered a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions