GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Regression from 6.0: at ES2015/ES2016, `super[k]` in a nested async arrow returns the accessor object when the async method writes to `super` later · Issue #65705 · microsoft/TypeScript Backlog DescriptionTypeScript VersionThe tested TypeScript version is User GoalThe user maintains a fuzzer for TypeScript and asked me to find real bugs and report them. A review comment on #65690 pointed at a case in that PR. Checking it showed that the bug is already on Setup and Action
class Base { get x() { return "base x"; } set x(v: string) {} m() { return "base m"; } } class Derived extends Base { async read() { const get = async () => super["x"]; super.x = "new"; return get(); } async call() { const run = async () => super["m"](); super.x = "new"; return run(); } } (async () => { const d = new Derived(); console.log(await d.read()); try { console.log(await d.call()); } catch (e: any) { console.log(e.constructor.name); } })(); tsc --target es2015 a.ts node a.js The program type-checks without errors. Expected and Actual BehaviorWhat actually happened: Because the method writes to const get = () => __awaiter(this, void 0, void 0, function* () { return _superIndex("x"); }); ... const run = () => __awaiter(this, void 0, void 0, function* () { return _superIndex("m").call(this); }); What I expected: what 6.0.3 prints and emits: const get = () => __awaiter(this, void 0, void 0, function* () { return _superIndex("x").value; }); ... const run = () => __awaiter(this, void 0, void 0, function* () { return _superIndex("m").value.call(this); }); The same happens when the later write is:
It also happens when the arrows are nested ( Cause. In This scenario was fixed in Strada once before: #30066, fixed by #30479 and #30491. Agent InfoClaude Code + Claude Opus 5.5 + Skill Version 1.0 ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |