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

Allow Record subclasses #26

Merged
merged 1 commit into from
Jul 27, 2016
Merged

Allow Record subclasses #26

merged 1 commit into from
Jul 27, 2016

Conversation

lukesneeringer
Copy link
Contributor

This request is a replacement for #25, because in trying to set up and test the Travis stuff, I somehow broke the branch.

This change allows subclasses of a Record type to satisfy checks within typed-immutable.
Currently, in typed-immutable, if you have a situation such as:

var A = Record({foo: Number}); class B extends A {}

And another composite record:

var MyRecord = Record({a: A});

If you send a B instance, it will not throw TypeError, but the instance is typecast back to A.

This change fixes that; it remains a B instance.

This change allows Record subclasses to satisfy the check for a Record.
@lukesneeringer
Copy link
Contributor Author

@stutrek Behold, automated testing! :-)

@stutrek
Copy link
Member

stutrek commented Jul 27, 2016

🎉 🎊 🎉 🎊

@lukesneeringer lukesneeringer merged commit d19039a into master Jul 27, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants