Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typeops): do not copy non-existent type fields (#832)
## Summary During liftdestructors, do not produce hidden type field copies for types without such fields, preventing invalid code from being generated. ## Details `liftdestructors` produces symbols as it proceeds via `produceSym`. This procedure not only produces a symbol, but ensures it's initialized, type operations ("destructors") are attached, and necessary ops called. One such operation is copying of the hidden type field for objects types that have them. This latter opertation was guarded by `isObjLackingTypeField` that expects any type passed to it be unwrapped (i.e. removing `tyDistinct`, `tyAlias`, etc). That wasn't the case and so `liftdestructors` was producing copy operations for hidden type fields that didn't exist. Now the type passed to `isObjLackingTypeField` is first unwrapped. A test, `ttypeops_misc`, has also been added for this (contributed by @zerbina). --------- Co-authored-by: zerbina <[email protected]>
- Loading branch information