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
|
=== tests/cases/conformance/salsa/propertyAssignmentUseParentType3.ts ===
// don't use the parent type if it's a function declaration (#33741)
function foo1(): number {
>foo1 : Symbol(foo1, Decl(propertyAssignmentUseParentType3.ts, 0, 0), Decl(propertyAssignmentUseParentType3.ts, 4, 1))
return 123;
}
foo1.toFixed = "";
>foo1.toFixed : Symbol(foo1.toFixed, Decl(propertyAssignmentUseParentType3.ts, 4, 1))
>foo1 : Symbol(foo1, Decl(propertyAssignmentUseParentType3.ts, 0, 0), Decl(propertyAssignmentUseParentType3.ts, 4, 1))
>toFixed : Symbol(foo1.toFixed, Decl(propertyAssignmentUseParentType3.ts, 4, 1))
function foo2(): any[] {
>foo2 : Symbol(foo2, Decl(propertyAssignmentUseParentType3.ts, 5, 18), Decl(propertyAssignmentUseParentType3.ts, 9, 1))
return [];
}
foo2.join = "";
>foo2.join : Symbol(foo2.join, Decl(propertyAssignmentUseParentType3.ts, 9, 1))
>foo2 : Symbol(foo2, Decl(propertyAssignmentUseParentType3.ts, 5, 18), Decl(propertyAssignmentUseParentType3.ts, 9, 1))
>join : Symbol(foo2.join, Decl(propertyAssignmentUseParentType3.ts, 9, 1))
function foo3(): string {
>foo3 : Symbol(foo3, Decl(propertyAssignmentUseParentType3.ts, 10, 15), Decl(propertyAssignmentUseParentType3.ts, 14, 1))
return "";
}
foo3.trim = "";
>foo3.trim : Symbol(foo3.trim, Decl(propertyAssignmentUseParentType3.ts, 14, 1))
>foo3 : Symbol(foo3, Decl(propertyAssignmentUseParentType3.ts, 10, 15), Decl(propertyAssignmentUseParentType3.ts, 14, 1))
>trim : Symbol(foo3.trim, Decl(propertyAssignmentUseParentType3.ts, 14, 1))
function foo4(): ({x: number}) {
>foo4 : Symbol(foo4, Decl(propertyAssignmentUseParentType3.ts, 15, 15), Decl(propertyAssignmentUseParentType3.ts, 19, 1))
>x : Symbol(x, Decl(propertyAssignmentUseParentType3.ts, 17, 19))
return {x: 123};
>x : Symbol(x, Decl(propertyAssignmentUseParentType3.ts, 18, 12))
}
foo4.x = "456";
>foo4.x : Symbol(foo4.x, Decl(propertyAssignmentUseParentType3.ts, 19, 1))
>foo4 : Symbol(foo4, Decl(propertyAssignmentUseParentType3.ts, 15, 15), Decl(propertyAssignmentUseParentType3.ts, 19, 1))
>x : Symbol(foo4.x, Decl(propertyAssignmentUseParentType3.ts, 19, 1))
|