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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
=== tests/cases/conformance/salsa/constructorFunctionMethodTypeParameters.js ===
/**
* @template {string} T
* @param {T} t
*/
function Cls(t) {
>Cls : typeof Cls
>t : T
this.t = t;
>this.t = t : T
>this.t : any
>this : this
>t : any
>t : T
}
/**
* @template {string} V
* @param {T} t
* @param {V} v
* @return {V}
*/
Cls.prototype.topLevelComment = function (t, v) {
>Cls.prototype.topLevelComment = function (t, v) { return v} : <V extends string>(t: T, v: V) => V
>Cls.prototype.topLevelComment : any
>Cls.prototype : any
>Cls : typeof Cls
>prototype : any
>topLevelComment : any
>function (t, v) { return v} : <V extends string>(t: T, v: V) => V
>t : T
>v : V
return v
>v : V
};
Cls.prototype.nestedComment =
>Cls.prototype.nestedComment = /** * @template {string} U * @param {T} t * @param {U} u * @return {T} */ function (t, u) { return t } : <U extends string>(t: T, u: U) => T
>Cls.prototype.nestedComment : any
>Cls.prototype : any
>Cls : typeof Cls
>prototype : any
>nestedComment : any
/**
* @template {string} U
* @param {T} t
* @param {U} u
* @return {T}
*/
function (t, u) {
>function (t, u) { return t } : <U extends string>(t: T, u: U) => T
>t : T
>u : U
return t
>t : T
};
var c = new Cls('a');
>c : Cls<"a">
>new Cls('a') : Cls<"a">
>Cls : typeof Cls
>'a' : "a"
const s = c.topLevelComment('a', 'b');
>s : "b"
>c.topLevelComment('a', 'b') : "b"
>c.topLevelComment : <V extends string>(t: "a", v: V) => V
>c : Cls<"a">
>topLevelComment : <V extends string>(t: "a", v: V) => V
>'a' : "a"
>'b' : "b"
const t = c.nestedComment('a', 'b');
>t : "a"
>c.nestedComment('a', 'b') : "a"
>c.nestedComment : <U extends string>(t: "a", u: U) => "a"
>c : Cls<"a">
>nestedComment : <U extends string>(t: "a", u: U) => "a"
>'a' : "a"
>'b' : "b"
|