-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix NewValue checks to be properly recursive #79
Conversation
Fix the checks that NewValue runs to ensure that a value can be used with a Type to properly handle DynamicPseudoTypes nested in complex types. Builds on and supersedes #76. Should we make this part of the behavior for `.Is`? My gut says "no", because `Is` is supposed to be about checking whether a type is semantically similar, not that it can be used as another type. Maybe we want a `Fulfills` method, similar to Is, that does this? I don't know that this behavior needs to be exported, though... Fixes a bug in #74 that would panic for complex types containing DynamicPseudoTypes.
Add a test to exercise the object-with-a-dynamic-attribute logic we fixed.
Add tests for all the complex types, and make sure types that require elements be the same type get only elements of the same exact type.
6c7260b
to
aa0b18a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We can always export UseTypeAs
/Fulfils
or change Is
behaviour later.
I would like to, in 0.4.0, do some work on Is to make this cleaner and have less magic behavior:
I just don't want to hold up 0.3.0 for that work, it's a big enough release already. I'll write up an issue for it. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fix the checks that NewValue runs to ensure that a value can be used
with a Type to properly handle DynamicPseudoTypes nested in complex
types. Builds on and supersedes #76.
Should we make this part of the behavior for
.Is
? My gut says "no",because
Is
is supposed to be about checking whether a type issemantically similar, not that it can be used as another type. Maybe we
want a
Fulfills
method, similar to Is, that does this? I don't knowthat this behavior needs to be exported, though...
Fixes a bug in #74 that would panic for complex types containing
DynamicPseudoTypes.