Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Recursive protocol method for a record never terminates
Description fields
Description
When extending a protocol for a record, a recursive method can never terminate in some cases.
prn call #1 prints nil as expected, but prn call #2 never terminates.
It looks like the compiler creates a variable assigned to this within the while loop such that the test of "x" is always really testing this when it should be testing the value of x passed in by the call to recur.
Note, I'm testing ClojureScript 1.8.51. The "Affects Version/s" field above only gives 1.7.228 as the most recent version.
When extending a protocol for a record, a recursive method can never terminate in some cases.
prn
call #1 printsnil
as expected, butprn
call #2 never terminates.It looks like the compiler creates a variable assigned to
this
within thewhile
loop such that the test of "x
" is always really testingthis
when it should be testing the value ofx
passed in by the call torecur
.Note, I'm testing ClojureScript 1.8.51. The "Affects Version/s" field above only gives 1.7.228 as the most recent version.