mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
29 lines
1.6 KiB
Plaintext
29 lines
1.6 KiB
Plaintext
betterErrorForUnionCall.ts(2,1): error TS2349: This expression is not callable.
|
|
No constituent of type '{ a: string; } | { b: string; }' is callable.
|
|
betterErrorForUnionCall.ts(5,1): error TS2349: This expression is not callable.
|
|
Not all constituents of type '{ a: string; } | ((a: string) => void)' are callable.
|
|
Type '{ a: string; }' has no call signatures.
|
|
betterErrorForUnionCall.ts(8,1): error TS2349: This expression is not callable.
|
|
Each member of the union type '(<T extends number>(a: T) => void) | (<T>(a: string) => void)' has signatures, but none of those signatures are compatible with each other.
|
|
|
|
|
|
==== betterErrorForUnionCall.ts (3 errors) ====
|
|
declare const union: { a: string } | { b: string }
|
|
union("");
|
|
~~~~~
|
|
!!! error TS2349: This expression is not callable.
|
|
!!! error TS2349: No constituent of type '{ a: string; } | { b: string; }' is callable.
|
|
|
|
declare const fnUnion: { a: string } | ((a: string) => void)
|
|
fnUnion("");
|
|
~~~~~~~
|
|
!!! error TS2349: This expression is not callable.
|
|
!!! error TS2349: Not all constituents of type '{ a: string; } | ((a: string) => void)' are callable.
|
|
!!! error TS2349: Type '{ a: string; }' has no call signatures.
|
|
|
|
declare const fnUnion2: (<T extends number>(a: T) => void) | (<T>(a: string) => void)
|
|
fnUnion2("");
|
|
~~~~~~~~
|
|
!!! error TS2349: This expression is not callable.
|
|
!!! error TS2349: Each member of the union type '(<T extends number>(a: T) => void) | (<T>(a: string) => void)' has signatures, but none of those signatures are compatible with each other.
|
|
|