Files
scriptc/tests/diagnostics/new-target-field-initializer.ts
2026-07-22 18:08:04 -05:00

10 lines
331 B
TypeScript

// `new.target` inside a class-field function expression builds a
// self-referential type through the containing class — the mapType depth
// guard fences it instead of overflowing the remote-AST walk (invariant
// signature 04).
class A {
d = function () { return new.target; };
}
const a = new A();
console.log(typeof a.d);