Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Type Checking of Cyclic Assignment #1148

Open
DavePearce opened this issue May 5, 2022 · 0 comments
Open

Runtime Type Checking of Cyclic Assignment #1148

DavePearce opened this issue May 5, 2022 · 0 comments
Labels

Comments

@DavePearce
Copy link
Member

DavePearce commented May 5, 2022

(see also #1145)

000497 fails because it attempts to check (at runtime) the invariant of a cyclic type:

type Cyclic is { null|&Cyclic ptr, int data }

public export method test():
    &Cyclic p = new {ptr:null, data: 0}
    &Cyclic q = new {ptr:p, data: 0}
    // Make it cyclic!
    p->ptr = q
    //
    assert p != q
    assert p->data == q->data

This is certainly problematic!

@DavePearce DavePearce added the Bug label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant