jfmengels/elm-review-simplify

Merging of let..in can lead to naming collisions

Open

#313 opened on Jun 26, 2024

View on GitHub
 (0 comments) (1 reaction) (0 assignees)Elm (10 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (22 stars)
PR merge metrics
 (PR metrics pending)

Description

SSCCE

value =
  let
    a name = name
  in
  let
    name = "str"
  in
  a name

Currently, this gets simplified to the following, which introduces a naming collision error from the compiler.

value =
  let
    a name = name

    name = "str"
  in
  a name

I think the solution would be to check that there will be no collisions, but this is quite a bit of analysis compared to what is done today. I wonder if there's a smart way of doing it :thinking:

Contributor guide