[P2] Compiler: lexical super in Array subclass emits uninitialized constructor IL
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the retained fixture at artifacts/p3-compiler/lexical-array-boundary.js and the oracle script check-lexical-boundary-oracles.cjs, then trace how lexical super() is lowered for intrinsic Array subclasses with instance fields. Reproduce the compile using the command in the issue and inspect the saved IL verification errors in lexical-array-boundary-js.log. Done means the fixture passes complete saved-IL verification, constructs and initializes the Array subclass as described, and preserves the stated repeated-super behavior and native refusal boundaries.
Written by the indexing model from the issue text.
Description
A lexical super() arrow in an intrinsic Array subclass emits invalid constructor IL when the subclass has an instance field.
const C = class extends Array {
value = 7;
constructor() {
const initialize = () => super();
initialize();
}
};
const value = new C();
console.log(value.value, Array.isArray(value));
Node, including the TypeScript 6.0.3 ES2022 transpilation oracle, prints 7 true. Compile this as .js without --checkJs:
dotnet SharpTS.dll --compile lexical-array-boundary.js -o lexical-array-boundary.dll --verify
SharpTS saves the assembly and then correctly rejects it because full IL verification finds three UninitStack errors in $ClassExpr_1..ctor at offsets 14, 44, and 62. Execution was not attempted after verification failed. Evidence is retained in artifacts/p3-compiler/lexical-array-boundary.js, lexical-array-boundary-js.log, and check-lexical-boundary-oracles.cjs.
Found while verifying #3477's managed user-class element transport. Intrinsic-base construction retains its existing separate lowering and admission rules; it must preserve the intrinsic object's internal slots and cannot be routed through an ordinary user-class initialization adapter simply to pass this fixture. No introducing-commit claim is made.
Acceptance: lexical super in an Array subclass constructs a real Array once, initializes child fields before the arrow resumes, respects repeated-super side effects and rejection, and passes complete saved-IL verification. Preserve existing native refusal boundaries.
- Dominant language
- C#
- Stars
- 156
- Forks
- 4
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 42
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nickna/SharpTS
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
priority: P2
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Bug: Needs Replicating
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
space-wizards/RobustToolbox#7189 ·
Maintainers usually reply within 1 day
-
affected/v17 area/frontend type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
umbraco/Umbraco-CMS#24491 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/microsoft-ui-reactor#1460 ·
Maintainers usually reply within 1 day
-
coderabbit reviewOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CodeForFire/lagebuch#912 ·
Maintainers usually reply within 1 day