TypeScript/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt
2014-07-12 17:30:19 -07:00

16 lines
622 B
Plaintext

==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts (1 errors) ====
class C {
foo() {
C.prototype.foo = () => { }
}
bar(x: number): number {
C.prototype.bar = () => { } // error
~~~~~~~~~~~~~~~
!!! Type '() => void' is not assignable to type '(x: number) => number':
!!! Type 'void' is not assignable to type 'number'.
C.prototype.bar = (x) => x; // ok
C.prototype.bar = (x: number) => 1; // ok
return 1;
}
}