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
|
=== tests/cases/conformance/salsa/propertyAssignmentUseParentType3.ts ===
// don't use the parent type if it's a function declaration (#33741)
function foo1(): number {
>foo1 : typeof foo1
return 123;
>123 : 123
}
foo1.toFixed = "";
>foo1.toFixed = "" : ""
>foo1.toFixed : string
>foo1 : typeof foo1
>toFixed : string
>"" : ""
function foo2(): any[] {
>foo2 : typeof foo2
return [];
>[] : undefined[]
}
foo2.join = "";
>foo2.join = "" : ""
>foo2.join : string
>foo2 : typeof foo2
>join : string
>"" : ""
function foo3(): string {
>foo3 : typeof foo3
return "";
>"" : ""
}
foo3.trim = "";
>foo3.trim = "" : ""
>foo3.trim : string
>foo3 : typeof foo3
>trim : string
>"" : ""
function foo4(): ({x: number}) {
>foo4 : typeof foo4
>x : number
return {x: 123};
>{x: 123} : { x: number; }
>x : number
>123 : 123
}
foo4.x = "456";
>foo4.x = "456" : "456"
>foo4.x : string
>foo4 : typeof foo4
>x : string
>"456" : "456"
|