Skip to content

refactor(type-inference): P3b — member.ts delegates to canonical + revert #521 workaround#527

Merged
cs01 merged 1 commit intomainfrom
typeinfo-p3b
Apr 18, 2026
Merged

refactor(type-inference): P3b — member.ts delegates to canonical + revert #521 workaround#527
cs01 merged 1 commit intomainfrom
typeinfo-p3b

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Apr 18, 2026

Summary

Second consumer migration (plan P3b, after #525 P2).

  • `MemberAccessGenerator.getObjectArrayElementInfo` now consults canonical `resolveExpressionTypeRich` first; legacy branches remain as fallback for shapes canonical doesn't yet enrich.
  • With canonical covering indexed-object-array element-field access, PR fix(native): emitError chained method call caused segv on every compile error #521's `emitError` intermediate-variable workaround is reverted — the chained `method_call()[method_call().length - 1]` form now compiles correctly under the native compiler. Confirmed: `tests/fixtures/edge-cases/new-date-module-scope.ts` still prints the expected diagnostic instead of segfaulting.

Impact for users

Eliminates a whole chained-expression category of native-compiler segfaults that used to hide behind a mechanical workaround. The underlying type-propagation fix now lives in one place instead of being papered over at call sites.

Test plan

…elegates to canonical, revert #521 emitError workaround

canonical path (rich.arrayDepth>0 + rich.fields) now fires for all indexed-object-array element-field accesses; legacy branches remain as fallback for shapes canonical doesn't yet enrich.

with canonical in place, #521's emitError intermediate-variable workaround is no longer necessary — reverted to the original chained method_call+index_access form; native compiler emits the expected diagnostic (no segv).

zero fuzz regression; stage 2 self-hosting + fixture suite green.
@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results (Linux x86-64)

Benchmark C ChadScript Go Node Place
Binary Trees 1.366s 1.232s 2.716s 1.143s 🥈
Cold Start 0.9ms 0.8ms 1.2ms 26.3ms 🥇
Fibonacci 0.814s 0.763s 1.559s 3.163s 🥇
File I/O 0.127s 0.089s 0.083s 0.195s 🥈
JSON Parse/Stringify 0.004s 0.005s 0.017s 0.015s 🥈
Matrix Multiply 0.445s 0.995s 0.619s 0.368s #4
Monte Carlo Pi 0.389s 0.410s 0.404s 2.272s 🥉
N-Body Simulation 1.671s 2.130s 2.199s 2.521s 🥈
Quicksort 0.214s 0.246s 0.213s 0.262s 🥉
SQLite 0.349s 0.371s 0.424s 🥈
Sieve of Eratosthenes 0.015s 0.028s 0.020s 0.038s 🥉
String Manipulation 0.008s 0.018s 0.016s 0.036s 🥉

CLI Tool Benchmarks

Benchmark ChadScript grep node xxd Place
Hex Dump 0.431s 0.952s 0.131s 🥈
Recursive Grep 0.018s 0.009s 0.098s 🥈

@cs01 cs01 merged commit 336c81b into main Apr 18, 2026
13 checks passed
@cs01 cs01 deleted the typeinfo-p3b branch April 18, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant