Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Nov 15, 2021

Fixes the most important cases of #12384.

This was a bug in direct recursion between immutable record/union objects when not mediated by delayed computations (e.g. lambda expressions) and two or more objects are involved. Note that this kind of "directly recursive immutable objects" is a rarely used feature from F# 1.0 and must have regressed at some point for the mutually-recursive case involving multiple objects, hence indicates that we have a lack of test cases for this feature. I've added several tests here.

Note: there is still a remaining variation of this bug that I need to consider (and either adjust the code generator or most likely rule out in the type checker). That is when mutually recursive static data is split over an enclosing module definition, e.g.

module rec Test12384d =
    type Node =
        {
            Next: Node
            Value: int
        }

    let one =
        {
            Next = two
            Value = 1
        }

    module M =
        let x() = one
        
    let two =
        {
            Next = one
            Value = 2
        }

THis will not be part of this PR

@dsyme
Copy link
Contributor Author

dsyme commented Nov 15, 2021

This is ready

@dsyme dsyme enabled auto-merge (squash) November 18, 2021 13:09
@dsyme dsyme requested review from TIHan and vzarytovskii November 19, 2021 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants