mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
19 lines
431 B
TypeScript
19 lines
431 B
TypeScript
//// [tests/cases/compiler/betterErrorForUnionCall.ts] ////
|
|
|
|
//// [betterErrorForUnionCall.ts]
|
|
declare const union: { a: string } | { b: string }
|
|
union("");
|
|
|
|
declare const fnUnion: { a: string } | ((a: string) => void)
|
|
fnUnion("");
|
|
|
|
declare const fnUnion2: (<T extends number>(a: T) => void) | (<T>(a: string) => void)
|
|
fnUnion2("");
|
|
|
|
|
|
//// [betterErrorForUnionCall.js]
|
|
"use strict";
|
|
union("");
|
|
fnUnion("");
|
|
fnUnion2("");
|