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

33 lines
1.8 KiB
Diff

--- old.lateBoundClassMemberAssignmentJS2.errors.txt
+++ new.lateBoundClassMemberAssignmentJS2.errors.txt
@@= skipped -0, +0 lines =@@
-<no content>
+lateBoundClassMemberAssignmentJS2.js(4,9): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+ Property 'my-fake-sym' does not exist on type 'MyClass'.
+lateBoundClassMemberAssignmentJS2.js(8,9): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+ Property 'my-fake-sym' does not exist on type 'MyClass'.
+lateBoundClassMemberAssignmentJS2.js(9,19): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+ Property 'my-fake-sym' does not exist on type 'MyClass'.
+
+
+==== lateBoundClassMemberAssignmentJS2.js (3 errors) ====
+ const _sym = "my-fake-sym";
+ export class MyClass {
+ constructor() {
+ this[_sym] = "ok";
+ ~~~~~~~~~~
+!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+!!! error TS7053: Property 'my-fake-sym' does not exist on type 'MyClass'.
+ }
+
+ method() {
+ this[_sym] = "yep";
+ ~~~~~~~~~~
+!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+!!! error TS7053: Property 'my-fake-sym' does not exist on type 'MyClass'.
+ const x = this[_sym];
+ ~~~~~~~~~~
+!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'MyClass'.
+!!! error TS7053: Property 'my-fake-sym' does not exist on type 'MyClass'.
+ }
+ }