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
|
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts ===
class C {
>C : Symbol(C, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 0))
foo() {
>foo : Symbol(C.foo, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 9))
C.prototype.foo = () => { }
>C.prototype.foo : Symbol(C.foo, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 9))
>C.prototype : Symbol(C.prototype)
>C : Symbol(C, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 0))
>prototype : Symbol(C.prototype)
>foo : Symbol(C.foo, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 9))
}
bar(x: number): number {
>bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>x : Symbol(x, Decl(instanceMemberAssignsToClassPrototype.ts, 5, 8))
C.prototype.bar = () => { } // error
>C.prototype.bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>C.prototype : Symbol(C.prototype)
>C : Symbol(C, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 0))
>prototype : Symbol(C.prototype)
>bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
C.prototype.bar = (x) => x; // ok
>C.prototype.bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>C.prototype : Symbol(C.prototype)
>C : Symbol(C, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 0))
>prototype : Symbol(C.prototype)
>bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>x : Symbol(x, Decl(instanceMemberAssignsToClassPrototype.ts, 7, 27))
>x : Symbol(x, Decl(instanceMemberAssignsToClassPrototype.ts, 7, 27))
C.prototype.bar = (x: number) => 1; // ok
>C.prototype.bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>C.prototype : Symbol(C.prototype)
>C : Symbol(C, Decl(instanceMemberAssignsToClassPrototype.ts, 0, 0))
>prototype : Symbol(C.prototype)
>bar : Symbol(C.bar, Decl(instanceMemberAssignsToClassPrototype.ts, 3, 5))
>x : Symbol(x, Decl(instanceMemberAssignsToClassPrototype.ts, 8, 27))
return 1;
}
}
|