Repository navigation
Conversation
Port the behaviour fix of Effect-TS/tsgo#828 ahead of the 0.51.1 pin: TypeParser::get_symbol_at_location returns nil for a delete target, and the stability usage rules call it instead of the raw checker lookup. The checker then saves no index-signature symbol for a later delete check. Fixes pingdotgg#52. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Fixes #52. Upstream: Effect-TS/tsgo#820, fixed by Effect-TS/tsgo#828 (merge
7d051dd5, first released in@effect/tsgo@0.52.0).Problem
With the Effect plugin and
exactOptionalPropertyTypes,delete env.FOOon an index signature reports a false TS2790. The stability usage rules look up the symbol of each identifier, which saves an index-signature symbol on the node.floatingEffectthen asks for the type of thedeleteexpression, which reruns thedeletecheck against that symbol.Confirmed on
main(91f3d021c) before the change.What is ported
Only the behaviour fix from #828, ahead of the 0.51.1 pin:
typeparser/helpers.rs:get_symbol_at_locationreturns nil for a delete target (the access or its property name, including through parentheses and?.).rules/stability_api_usage.rs: calls that guarded lookup instead of the raw checker call.PORTING.md: records the difference from 0.51.1 and updates the TS2790 section.tests/tsgo_effect_delete.rsso that CI runs the two that need no packages.focused-fixtures.mjsdoes not run in CI.What is left out
PORTING.mdsays to skip_test.go. The fixtures and the comparison below cover those cases.api_stability_safety,api_stability_leak,pipeable_signature_shape). They take type names, declaration names, heritage expressions and module specifiers, which are never a delete target.For maintainers to decide
delete cfg.betano longer warns whenbetais tagged.cfg.betaelsewhere still warns, and so does a tagged receiver. This matches 0.52.0, so I kept it. Please confirm you want it.PORTING.mdhas no convention for a fix taken ahead of the pin. I added a bullet to "Where the port differs from the reference", as open PR fix(effect): rule type queries read the types the check recorded (#112) #113 does, and left the stated pin at 0.51.1. Please say if you want something else.t3-rules-off.sh. Its rules-on runs now report DIFF against 0.51.1, which still prints these lines. I did not change the script.PORTING.md, but I have not tested them together.Checks
Built with Rust 1.95.0 on darwin-arm64. The reference is the npm
@effect/tsgo-darwin-arm64package.mainreference-cases.mjs(0.51.1)go-unit-cases.mjs(0.51.1)incremental-check.mjs(0.51.1)focused-fixtures.mjs, effect 4.0.0-rc.118delete-index-signatureanddelete-process-envfailfocused-fixtures.mjs, effect 4.0.0effect_cases,tsgo_effect_deletecargo fmt --check,clippy -D warningsapps/server/apps/webThe
reference-casesmismatch ismissingReturnYieldStarFnUntraced: exit code 2 against 1, with the same output as onmain.Further comparisons:
deletecases (29 sources,exactOptionalPropertyTypeson and off): this branch's output is identical to 0.52.0, and its non-Effect lines equal a run with the plugin off.mainon those cases: 29 TS2790 and 2 TS2704 are gone and nothing is added. The TS2704 is the same bug, on areadonlyindex signature.readonlyoptional property, both with the plugin on.delete process.env.Xwith@types/nodeanddelete el.dataset.x: clean.Not run
cargo test --workspaceandgo_baselines: the local workspace run was stopped partway by memory pressure on my machine. It had logged no failures, but it is not a pass.incremental-check.mjs --plain,t3-parity.mjsandt3-rules-off.sh: for T3 Code I comparedmainand this branch directly instead.scripts/run-cargo-capped.sh: it needssystemd-run, so I used plain cargo with CI's toolchain and flags.🤖 Generated with Claude Code