jackfirth / jackfirth/resyntax

Definition context conflict logic is overly conservative

Open
#345 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug existing lint
Dominant language
Racket
Stars
70
Forks
11
PR merge metrics
No merged PRs in 30d

Description

This test should pass:

#lang resyntax/private/refactoring-test
require: resyntax/default-recommendations let-binding-suggestions

header:
- #lang racket/base

test: "shadowed bindings in parent definition contexts don't prevent let-to-define refactoring"
--------------------
(define (f)
  (define x 1)
  (define (g)
    (let ([x 1])
      x))
  g)
--------------------
--------------------
(define (f)
  (define x 1)
  (define (g)
    (define x 1)
    x)
  g)
--------------------

But instead, Resyntax leaves the code unchanged. This is probably related to the changes in #344.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running or adding the regression test shown in the issue, then inspect the definition-context conflict logic and compare it with the changes in #344. Done means the test passes and the nested let-to-define refactoring produces the expected define form without being blocked by the shadowed parent binding.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.