[P2] Interpreter: structuredClone rejects BigInt primitives
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp, typescript
- Domain
- compilers
Research direction
The fix belongs in StructuredClone.IsPrimitive and the recursive primitive branch, which accept System.Numerics.BigInteger but not the interpreter's SharpTSBigInt type. Reproduce with structuredClone(3n) under --no-tsconfig --lib es2022,dom, which currently exits 1 with DataCloneError. Done when it prints 3, nested BigInt values clone, and functions and Symbols still throw.
Written by the indexing model from the issue text.
Description
The interpreter rejects its actual BigInt primitive carrier during structured clone.
console.log(String(structuredClone(3n)));
Expected: 3. On immutable PR head 1aa8ac0e72596b6daf9cf2280063c423716e9838, run --no-tsconfig --lib es2022,dom: SharpTS exits 1 with DataCloneError: Cannot clone value of type SharpTSBigInt.
StructuredClone.IsPrimitive and the recursive primitive branch accept System.Numerics.BigInteger but omit the interpreter's actual SharpTSBigInt representation. This affects direct and nested BigInt values. The emitted clone core accepts its BigInteger representation; this defect concerns interpretation.
Found while verifying #3443. The unchanged regression program structuredClone([undefined,null,true,"x",2,3n]) passes the Node v22.23.2 oracle but, after the undefined repair, the interpreter now reaches and rejects SharpTSBigInt. A separate reduced original was replayed on immutable head and fails before any repair; raw evidence is retained at artifacts/p2-work/structured-clone-callable-value-3439/bigint-baseline-original.json (source SHA-256 E0A2AA27BF28897962C8FC6A43EF42C51C3D4B6C40A071F944475E67CA09C755).
Expected: actual BigInt primitive values clone successfully at the top level and in nested containers, while functions and Symbols remain uncloneable. Keep the existing transfer and graph algorithms unchanged.
- Dominant language
- C#
- Stars
- 156
- Forks
- 4
- Avg merge
- 13h 33m
- Merged PRs (30d)
- 45
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
-
bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 5/5 Over a week Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug priority: P2
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
Similar issues
-
enhancement P3 performance
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
thomhurst/TUnit#7380 · 2 comments ·
Maintainers usually reply within 1 day
-
documentation trivial
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PCL-Community/PCL-CE#3767 ·
Maintainers usually reply within 1 day
-
area-blazor NativeAOT Regression
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
dotnet/aspnetcore#70236 · 1 comment ·
Maintainers usually reply within 1 day
-
area-System.IO untriaged
Difficulty 2/5 Half a day Newbie friendliness 72/100
dotnet/runtime#136802 · 1 comment ·
Maintainers usually reply within 1 day