The following patches are 4 prerequisites, where each depends on the previous one:
Another orthogonal prerequisite (it eliminates the "BUG: local parameter is not unset" debug messages):
- Fix type conversions via assignments to references. - workers/53784
(The code is ready but I should still add tests.)
Two other likely prerequisites (I'm not 100% sure they are real prerequisites):
One last likely prerequisite:
You had concerns about the scope in which assignments to not-yet-defined references should create a new variable, which currently is the global scope. A related issue is how "typeset <options but no -n> ref=..." statements behave when "ref" is a reference and no "-n" option is included. I noticed that such statements exhibit inconsistencies and outright bugs. I will eventually share something about that. However, all these issues are orthogonal to what this patch fixes. So I think it could be submitted and we can resolve these issues separately.
Something completely unrelated but that I think you already reviewed and only needs to be submitted:
Philippe