Set of mutable binding in protocol fn fails when embedded in a locking expression

Description

Consider the following code:

Works fine on ClojureJVM.
In ClojureCLR, {{T1 }}and {{T3 }}are okay, but {{T2 }}gets an error that value is not mutable.
For some reason, the {{locking }}construct establishes a boundary where {{value }}is not seen as a local field.

Environment

None

Activity

Show:
David Miller
January 21, 2021, 8:19 PM

This works in Clojure 1.8, but will fail in Clojure 1.10. The difference is that locking in Clojure 1.10 introduces a doubly nested try. If you do a doubly nested try in Clojure 1.8, it will also fail.

 

Compare T4 and T5. In Clojure 1.8 T4 fails, but T5 succeeds.

David Miller
January 23, 2021, 5:07 AM

The problem was a bad passed parameter in a special case in TryExpr.Parse. That error has been sitting there for 8.5 years.

Commit f33cf1a8, 2021.01.22.

Fixed

Assignee

David Miller

Reporter

David Miller

Labels

None

Approval

None

Patch

None

Priority

Major