* 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
16 lines
591 B
TypeScript
16 lines
591 B
TypeScript
/// <reference path='fourslash.ts'/>
|
|
|
|
////declare function f<T = boolean, U = string>(x: T, y: U): T;
|
|
////f<number, string>(/*1*/);
|
|
////f(/*2*/);
|
|
////f<number>(/*3*/);
|
|
////f<number, string, boolean>(/*4*/);
|
|
|
|
verify.signatureHelp(
|
|
{ marker: "1", text: "f(x: number, y: string): number" },
|
|
{ marker: "2", text: "f(x: boolean, y: string): boolean" },
|
|
// too few -- fill in rest with unknown
|
|
{ marker: "3", text: "f(x: number, y: unknown): number" },
|
|
// too many -- ignore extra type arguments
|
|
{ marker: "4", text: "f(x: number, y: string): number" },
|
|
);
|