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

Flow Typing Over Type Invariants #1095

Open
DavePearce opened this issue Sep 14, 2021 · 0 comments
Open

Flow Typing Over Type Invariants #1095

DavePearce opened this issue Sep 14, 2021 · 0 comments
Labels

Comments

@DavePearce
Copy link
Member

DavePearce commented Sep 14, 2021

(See also #937)

The following test (UnionType_Valid_28) fails to type check for reasons unknown:

type Tree is null | Node

type Node is { int data, Tree left, Tree right }
// Data in nodes reachable from left must be below this
where left is Node ==> left.data < data
// Data in nodes reachable from right must be above this
where right is Node ==> right.data > data

...

The error reported is:

UnionType_Valid_28.whiley:7: expected record
where right is Node ==> right.data > data
      ^^^^^
UnionType_Valid_28.whiley:7: expected record
where right is Node ==> right.data > data
      ^^^^^
UnionType_Valid_28.whiley:7: expected record
where right is Node ==> right.data > data
                        ^^^^^

This test case originated from 013_btree

@DavePearce DavePearce added the Bug label Sep 14, 2021
DavePearce added a commit that referenced this issue Sep 14, 2021
This adds a test case illustrating the problem.  The test is currently
marked ignored.
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