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 #25

Closed
wants to merge 0 commits into from
Closed

Allow Record subclasses #25

wants to merge 0 commits into from

Conversation

lukesneeringer
Copy link
Contributor

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.

@stutrek
Copy link
Member

stutrek commented Jul 25, 2016

I like it! let's wait until we figure out the automated tests

@lukesneeringer
Copy link
Contributor Author

I mucked up git somehow. I will open a new PR.

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