TypeScript/tests/cases/fourslash/signatureHelpOnTypePredicates.ts
Wesley Wigham 16450a027a
Change the default type parameter constraints and defaults to unknown from {} (#30637)
* Change the default type parameter constraint and default to unknown from {}

* Relax unknown checking outside of strictNullChecks a bit

* Increase strictness on index signatures with type `unknown` so inference doesnt change surprisingly

* Remove redundant switch
2019-04-04 12:25:15 -07:00

15 lines
430 B
TypeScript

/// <reference path="fourslash.ts" />
//// function f1(a: any): a is number {}
//// function f2<T>(a: any): a is T {}
//// function f3(a: any, ...b): a is number {}
//// f1(/*1*/)
//// f2(/*2*/)
//// f3(/*3*/)
verify.signatureHelp(
{ marker: "1", text: "f1(a: any): a is number" },
{ marker: "2", text: "f2(a: any): a is unknown" },
{ marker: "3", text: "f3(a: any, ...b: any[]): a is number", isVariadic: true },
)