Files
scriptc/tests/corpus/local-class-detached-method.ts
T
Malte UblandClaude Opus 5.5 fa012f5da3 Name the corpus programs instead of numbering them
The numbers collided with other open changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:51:31 -07:00

17 lines
384 B
TypeScript

// A method that never reads `this`, taken off an instance of a class
// declared inside a function: the detached method runs without a receiver.
function helper(): string {
return "helper";
}
function make() {
return class Local {
tag = "t";
plain(): string {
return helper();
}
};
}
const C = make();
const detached = new C().plain;
console.log(detached());