@@ -312,3 +312,42 @@ class Test11 {
312
312
}
313
313
}
314
314
}
315
+
316
+ class Tests12 {
317
+ >Tests12 : Symbol(Tests12, Decl(typeofThis.ts, 121, 1))
318
+
319
+ test1() { // OK
320
+ >test1 : Symbol(Tests12.test1, Decl(typeofThis.ts, 123, 15))
321
+
322
+ type Test = typeof this;
323
+ >Test : Symbol(Test, Decl(typeofThis.ts, 124, 13))
324
+ }
325
+
326
+ test2() { // OK
327
+ >test2 : Symbol(Tests12.test2, Decl(typeofThis.ts, 126, 5))
328
+
329
+ for (;;) {}
330
+ type Test = typeof this;
331
+ >Test : Symbol(Test, Decl(typeofThis.ts, 129, 19))
332
+ }
333
+
334
+ test3() { // expected no compile errors
335
+ >test3 : Symbol(Tests12.test3, Decl(typeofThis.ts, 131, 5))
336
+
337
+ for (const dummy in []) {}
338
+ >dummy : Symbol(dummy, Decl(typeofThis.ts, 134, 18))
339
+
340
+ type Test = typeof this;
341
+ >Test : Symbol(Test, Decl(typeofThis.ts, 134, 34))
342
+ }
343
+
344
+ test4() { // expected no compile errors
345
+ >test4 : Symbol(Tests12.test4, Decl(typeofThis.ts, 136, 5))
346
+
347
+ for (const dummy of []) {}
348
+ >dummy : Symbol(dummy, Decl(typeofThis.ts, 139, 18))
349
+
350
+ type Test = typeof this;
351
+ >Test : Symbol(Test, Decl(typeofThis.ts, 139, 34))
352
+ }
353
+ }
0 commit comments