-
Notifications
You must be signed in to change notification settings - Fork 14
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
Reconsider duck typing records #2
Comments
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment if you define types with a following signatures:
Then type union interprets
data
value not always as one would expected:Most likely in last statement
data
field was expected to be an instance ofY
instead ofX
, although given that{y: 2}
can be read both asX
andY
it was interpreted as a first type in the unionX
.It maybe better to disallow passing untyped values all together in order to avoid this issue.
The text was updated successfully, but these errors were encountered: