You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.
Ideally, I'd expect either of the first two to work (AppRecordImplicit or AppRecordExplicit). However, they create RecordOf<empty> since they are not typed themselves (they receive class RecordInstance<T: any>).
The third call illustrates how that is a bit crazy, since you can successfully cast a record factory of one type to another (which leads you to be able to make records of the wrong type entirely).
Only by using AppRecordExtraExplicit -- and using it correctly, since it is the same form as AppRecordBorked -- can you get a RecordFactory<App> and produce actual RecordOf<App>.
From @gryn on Wed, 03 Jul 2019 17:20:54 GMT
Flow version: 0.97.0 / immutable 4.0.0-rc12
What happened
When defining records, you have to do all the typecasting because
Record()
has a incorrect type definition.How to reproduce
In the above code, none of the ways of creating records work. The only way that actually works is to say:
Ideally, I'd expect either of the first two to work (
AppRecordImplicit
orAppRecordExplicit
). However, they createRecordOf<empty>
since they are not typed themselves (they receiveclass RecordInstance<T: any>
).The third call illustrates how that is a bit crazy, since you can successfully cast a record factory of one type to another (which leads you to be able to make records of the wrong type entirely).
Only by using
AppRecordExtraExplicit
-- and using it correctly, since it is the same form asAppRecordBorked
-- can you get aRecordFactory<App>
and produce actualRecordOf<App>
.Copied from original issue: immutable-js#1722
The text was updated successfully, but these errors were encountered: