core.async

(CLJS) Some non-tail-recursive loops compile without error

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojurescript

Description

The following code compiles without error using core.async 0.3.442:

(go-loop []
  (when true
    (recur))
  1)

The same loop structure without core.async causes the compiler to error ("ERROR: Can't recur here at..."):

(loop []
  (when true
    (recur))
  1)

Interestingly, some non-tail-recursive loops correctly fail to compile. For example the following fails with "ERROR: No implementation of method: :emit-instruction...":

(go-loop []
  (do
    (recur)
    1))

Activity

Hide
David Whittington added a comment -

Created a repository demonstrating this issue: https://github.com/djwhitt/async-190

Show
David Whittington added a comment - Created a repository demonstrating this issue: https://github.com/djwhitt/async-190

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: