17 lines
569 B
Text
17 lines
569 B
Text
|
tests/cases/conformance/es6/Symbols/symbolProperty47.ts(3,16): error TS2322: Type 'string' is not assignable to type 'number'.
|
||
|
|
||
|
|
||
|
==== tests/cases/conformance/es6/Symbols/symbolProperty47.ts (1 errors) ====
|
||
|
class C {
|
||
|
get [Symbol.hasInstance]() {
|
||
|
return "";
|
||
|
~~
|
||
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||
|
}
|
||
|
// Should take a string
|
||
|
set [Symbol.hasInstance](x: number) {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
(new C)[Symbol.hasInstance] = 0;
|
||
|
(new C)[Symbol.hasInstance] = "";
|