File: genericParameterHelpConstructorCalls.ts

package info (click to toggle)
node-typescript 4.8.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 523,068 kB
  • sloc: javascript: 1,735,777; makefile: 7; sh: 1
file content (31 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/// <reference path="fourslash.ts"/>

////interface IFoo { }
////
////class testClass<T extends IFoo, U, M extends IFoo> {
////    constructor(a:T, b:U, c:M){ }
////}
////
////// Constructor calls
////new testClass</*constructor1*/
////new testClass<IFoo, /*constructor2*/
////new testClass</*constructor3*/>(null, null, null)
////new testClass<,,/*constructor4*/>(null, null, null)
////new testClass<IFoo,/*constructor5*/IFoo,IFoo>(null, null, null)

verify.signatureHelp(
    {
        marker: "constructor1",
        text: "testClass<T extends IFoo, U, M extends IFoo>(a: T, b: U, c: M): testClass<T, U, M>",
        parameterName: "T",
        parameterSpan: "T extends IFoo",
    },
    {
        marker: "constructor2",
        parameterName: "U",
        parameterSpan: "U",
    },
    { marker: "constructor3", parameterName: "T", parameterSpan: "T extends IFoo" },
    { marker: "constructor4", parameterName: "M", parameterSpan: "M extends IFoo" },
    { marker: "constructor5", parameterName: "U", parameterSpan: "U" },
);