Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix regression with imported
distinct
types (#1418)
## Summary Marking a `distinct T` type as imported resulted in multiple C definitions for `T`, if `T` is a non-numeric, non-pointer type. This is now fixed. Fixes #1417. ## Details When translating imported types, `mirtypes` always created a new type symbol for the imported type's underlying type. For `tyAlias` and `tyDistinct` types (or any other type kind in the `Skip` set), this resulted in a duplicate of the underlying type symbol being created. Since MIR types are identified by ID, both look separate to `cgen`, and thus a C definition is emitted for each. `handleImportedTypes` now goes through the caching mechanism for the underlying type if its not the type marked with `.importc`, fixing the issue.
- Loading branch information