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

record types do not behave correctly as supertypes #275

Open
davidchambers opened this issue Nov 25, 2019 · 1 comment
Open

record types do not behave correctly as supertypes #275

davidchambers opened this issue Nov 25, 2019 · 1 comment

Comments

@davidchambers
Copy link
Member

This expression erroneously evaluates to true:

$.test ([])
       ($.NullaryType ('X') ('') ([$.RecordType ({x: $.Number})]) (_ => true))
       ({x: null})

The problem is that the supertype membership test uses t._test (env) (x), but a record type's _test method only determines whether the field names are present.

@davidchambers
Copy link
Member Author

This is tricky. The current behaviour is what allows us to underline a particular field of a record type in error messages.

We want strict behaviour in the context of $.test but forgiving behaviour when generating error messages. 🤔

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

No branches or pull requests

1 participant