Files
tsgo/testdata/baselines/reference/submodule/conformance/lateBoundClassMemberAssignmentJS3.errors.txt

32 lines
1.7 KiB
Plaintext

lateBoundClassMemberAssignmentJS.js(5,9): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
Property '[_sym]' does not exist on type 'MyClass'.
lateBoundClassMemberAssignmentJS.js(10,9): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
Property '[_sym]' does not exist on type 'MyClass'.
lateBoundClassMemberAssignmentJS.js(11,19): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
Property '[_sym]' does not exist on type 'MyClass'.
==== lateBoundClassMemberAssignmentJS.js (3 errors) ====
const _sym = Symbol("_sym");
export class MyClass {
constructor() {
var self = this
self[_sym] = "ok";
~~~~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
!!! error TS7053: Property '[_sym]' does not exist on type 'MyClass'.
}
method() {
var self = this
self[_sym] = "yep";
~~~~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
!!! error TS7053: Property '[_sym]' does not exist on type 'MyClass'.
const x = self[_sym];
~~~~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'MyClass'.
!!! error TS7053: Property '[_sym]' does not exist on type 'MyClass'.
}
}