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
An inlined record can be aliased to an existing type in generated code. It would still be required to duplicate record definition so PPX can parse the internal types but the generated code and the rest of the app would be dealing with the provided type instead of the one defined in the PPX'ed module.
It should be totally type-safe, but errors might be confusing when an inlined definition and actual type don't match (no way it can be ensured by PPX, unfortunatelly).
Any other drawbacks?
The text was updated successfully, but these errors were encountered:
The requirement of having record definitions inlined might be inconvenient when some type already exists and used across the app.
It's not possible to avoid inlining since PPX would need type information to generate the proper code, but it can be handled somewhat better:
An inlined record can be aliased to an existing type in generated code. It would still be required to duplicate record definition so PPX can parse the internal types but the generated code and the rest of the app would be dealing with the provided type instead of the one defined in the PPX'ed module.
So the generated code would be:
It should be totally type-safe, but errors might be confusing when an inlined definition and actual type don't match (no way it can be ensured by PPX, unfortunatelly).
Any other drawbacks?
The text was updated successfully, but these errors were encountered: