ClojureScript

Undeclared var regression in fn bodies

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: 1.9.660
  • Fix Version/s: 1.9.671
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Accepted

Description

(defn foo [] x)

No longer produces a warning. Probably related to the changes to suppress double warnings as a result of fn invoke optimization. The fix needs to also supply an analyzer test case.

Activity

Hide
David Nolen added a comment -

Actually I looked into this - not related to changes around double warnings an fn optimization. Dropping `warning-for` from analyze does not change the behavior.

Show
David Nolen added a comment - Actually I looked into this - not related to changes around double warnings an fn optimization. Dropping `warning-for` from analyze does not change the behavior.
Hide
Mike Fikes added a comment -

git bisect shows that this regression was introduced with the commit for CLJS-2066.

Show
Mike Fikes added a comment - git bisect shows that this regression was introduced with the commit for CLJS-2066.
Hide
Mike Fikes added a comment -

The root cause is fairly cut-n-dry. The solution is fairly straightforward, but perhaps a little more complex than desired. Explanation is in commit comment in the attached patch. Adds a regression test specifically for this case.

Show
Mike Fikes added a comment - The root cause is fairly cut-n-dry. The solution is fairly straightforward, but perhaps a little more complex than desired. Explanation is in commit comment in the attached patch. Adds a regression test specifically for this case.
Hide
Mike Fikes added a comment -

Since method param analysis never results in warnings being emitted, a much simpler (1-line) patch is sufficient for the problem. Attaching a v2 patch as an alternative to consider.

Show
Mike Fikes added a comment - Since method param analysis never results in warnings being emitted, a much simpler (1-line) patch is sufficient for the problem. Attaching a v2 patch as an alternative to consider.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: