20 lines
No EOL
799 B
Text
20 lines
No EOL
799 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(11,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/Symbols/symbolProperty47.ts (2 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] = "";
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'. |