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

36 lines
1.9 KiB
Diff

--- old.lateBoundClassMemberAssignmentJS3.errors.txt
+++ new.lateBoundClassMemberAssignmentJS3.errors.txt
@@= skipped -0, +0 lines =@@
-<no content>
+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'.
+ }
+ }
+